/* ============================================================
   网咖消费情况调查系统 - 主样式表
   设计风格：现代玻璃拟态 (Glass Morphism)
   ============================================================ */

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    color: #2c3e50;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- 背景处理 ---------- */
.bg-wrapper {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(135deg, rgba(255,253,248,0.95) 0%, rgba(255,253,248,0.9) 100%),
        url('../img/bg.jpg') center/cover fixed;
    filter: saturate(0.8);
}



/* 如需使用自定义背景图片，替换上面的渐变为：
.bg-wrapper {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.82) 100%),
        url('../img/bg.jpg') center/cover fixed;
    filter: saturate(0.7);
}
.bg-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
*/

/* ---------- 主容器 ---------- */
.main-container {
    max-width: 900px;
    padding: 30px 16px 60px;
    margin: 0 auto;
}

/* ---------- 玻璃拟态卡片 ---------- */
.glass-card {
    position: relative;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.06),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: fadeInUp 0.6s ease-out;
    overflow: visible;
}

.card-decoration {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    opacity: 0.65;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.15));
    transition: opacity 0.3s ease;
}

.card-decoration:hover {
    opacity: 0.85;
}

.card-dec-1 {
    top: -40px;
    right: -20px;
    width: 140px;
}

.card-dec-2 {
    top: -35px;
    left: -15px;
    width: 130px;
}

.card-dec-3 {
    top: 20%;
    right: -10px;
    width: 120px;
}

.card-dec-4 {
    top: 18%;
    left: -10px;
    width: 110px;
}

.card-dec-5 {
    top: 45%;
    right: -8px;
    width: 100px;
}

.card-dec-6 {
    top: 43%;
    left: -8px;
    width: 100px;
}

.card-dec-7 {
    bottom: -30px;
    right: -15px;
    width: 120px;
}

.card-dec-8 {
    bottom: -25px;
    left: -12px;
    width: 110px;
}

.card-dec-9 {
    top: 75%;
    right: -5px;
    width: 90px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 问卷头部 ---------- */
.survey-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-hero {
    position: relative;
    text-align: center;
    padding: 32px 16px 24px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(245, 184, 65, 0.08) 0%, rgba(91, 168, 160, 0.08) 100%);
    border-radius: 16px;
    margin-bottom: 20px;
}

.hero-decoration {
    position: absolute;
}

.hero-circle-1 {
    top: -40px;
    left: -30px;
    width: 120px;
    height: 80px;
    background: #F5B841;
    border-radius: 60px 60px 0 0;
    opacity: 0.3;
}

.hero-circle-2 {
    bottom: -30px;
    right: -20px;
    width: 100px;
    height: 60px;
    background: #5BA8A0;
    border-radius: 50px 50px 0 0;
    opacity: 0.3;
}

.hero-circle-3 {
    bottom: -20px;
    left: 20px;
    width: 80px;
    height: 50px;
    background: #F5B841;
    border-radius: 40px 40px 0 0;
    opacity: 0.2;
    transform: rotate(180deg);
}

.hero-dots-1 {
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-dots-1::before {
    content: '';
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.hero-dots-1::before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: radial-gradient(circle, #F5B841 3px, transparent 3px);
    background-size: 8px 8px;
    background-repeat: repeat;
    opacity: 0.5;
}

.hero-dots-2 {
    bottom: 20px;
    left: 25px;
    width: 30px;
    height: 20px;
    background-image: radial-gradient(circle, #5BA8A0 3px, transparent 3px);
    background-size: 10px 10px;
    background-repeat: repeat;
    opacity: 0.4;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.survey-title {
    font-size: 2.1rem;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: 0.8px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.intro-lines {
    margin-top: 16px;
    text-align: right;
    padding-right: 48px;
}

.intro-line {
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
    line-height: 1.8;
    margin: 4px 0;
}

.intro-line:nth-child(2) {
    display: inline-block;
}

.survey-desc-box {
    padding: 0 8px;
}

.survey-desc {
    font-size: 1.1rem;
    color: #8e8e9a;
    line-height: 1.8;
    margin: 0;
    text-align: center;
}

/* ---------- 题目卡片 ---------- */
.question-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    margin-bottom: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}

.question-card:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.question-card.error {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.04);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.question-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F5B841 0%, #E89F3C 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(245, 184, 65, 0.3);
}

.question-content {
    flex: 1;
    min-width: 0;
}

.question-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

/* ---------- 年龄输入框 ---------- */
.input-wrapper {
    position: relative;
    max-width: 200px;
}

.age-input {
    height: 44px;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    transition: all 0.2s ease;
    padding-right: 30px;
}

.age-input:focus {
    border-color: #F5B841;
    outline: none;
}

.age-input.is-invalid {
    border-color: #e74c3c;
}

.input-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.85rem;
    font-weight: 400;
    pointer-events: none;
}

/* ---------- 选项组 ---------- */
.options-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    font-weight: normal;
    user-select: none;
}

.option-item:hover {
    background: rgba(245, 184, 65, 0.06);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #F5B841;
    cursor: pointer;
    flex-shrink: 0;
}

.option-item:has(input:checked) {
    background: rgba(245, 184, 65, 0.08);
}

.option-text {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.4;
}

/* 第七题 N 选项样式 */
.option-n {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.option-n .option-text {
    color: #e67e22;
    font-weight: 500;
}

/* ---------- 验证错误提示 ---------- */
.invalid-feedback {
    display: none;
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 6px;
    padding-left: 4px;
}

.question-card.error .invalid-feedback {
    display: block;
}

/* ---------- 提交区域 ---------- */
.survey-footer {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-text {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
}

.btn-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    height: 52px;
    padding: 0 40px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #F5B841 0%, #E89F3C 100%);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(245, 184, 65, 0.35);
    overflow: hidden;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(245, 184, 65, 0.45);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-submit .btn-text,
.btn-submit .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ---------- 成功弹窗 ---------- */
.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.display-no {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 6px;
    color: #F5B841;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(245, 184, 65, 0.2);
}

/* ---------- 后台管理通用样式 ---------- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #F5B841;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-brand i {
    font-size: 1.3rem;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(245, 184, 65, 0.08);
    color: #F5B841;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(245, 184, 65, 0.12), rgba(232, 159, 60, 0.12));
    color: #F5B841;
    font-weight: 600;
}

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-main {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
    background: rgba(248, 249, 252, 0.6);
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-content {
    padding: 24px 28px;
}

/* ---------- 统计卡片 ---------- */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}

.stat-unit {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

/* ---------- 后台卡片 ---------- */
.admin-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.admin-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-card-body {
    padding: 20px;
}

/* ---------- 后台表格 ---------- */
.admin-table {
    font-size: 0.85rem;
    margin: 0;
}

.admin-table thead th {
    background: rgba(248, 249, 252, 0.8);
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding: 12px 10px;
    font-size: 0.8rem;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    color: #F5B841;
}

.sortable i {
    font-size: 0.7rem;
    opacity: 0.4;
}

.admin-table tbody td {
    padding: 10px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.admin-table tbody tr:hover {
    background: rgba(245, 184, 65, 0.03);
}

/* ---------- 后台登录 ---------- */
.admin-login-card {
    max-width: 400px;
    margin: 80px auto;
    padding: 40px 36px;
}

.admin-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #F5B841, #E89F3C);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(245, 184, 65, 0.3);
}

/* ---------- 导出页面 ---------- */
.export-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- 深色模式 ---------- */
body.dark-mode {
    color: #e0e0e0;
}

body.dark-mode .bg-wrapper {
    background:
        linear-gradient(135deg, rgba(18, 18, 24, 0.95) 0%, rgba(18, 18, 24, 0.9) 100%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

body.dark-mode .glass-card {
    background: rgba(30, 30, 40, 0.85);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

body.dark-mode .survey-title {
    background: linear-gradient(135deg, #F5B841 0%, #5BA8A0 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

body.dark-mode .question-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .question-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .question-label {
    color: #e0e0e0;
}

body.dark-mode .option-text {
    color: #bbb;
}

body.dark-mode .admin-sidebar {
    background: rgba(22, 22, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .admin-main {
    background: rgba(18, 18, 24, 0.8);
}

body.dark-mode .admin-topbar {
    background: rgba(22, 22, 30, 0.9);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .stat-card,
body.dark-mode .admin-card {
    background: rgba(30, 30, 40, 0.85);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .stat-value {
    color: #e0e0e0;
}

body.dark-mode .admin-table thead th {
    background: rgba(255, 255, 255, 0.04);
    color: #aaa;
}

body.dark-mode .admin-table tbody td {
    border-color: rgba(255, 255, 255, 0.04);
}

body.dark-mode .admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .nav-item {
    color: #aaa;
}

body.dark-mode .nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #F5B841;
}

body.dark-mode .nav-item.active {
    background: rgba(245, 184, 65, 0.15);
    color: #F5B841;
}

body.dark-mode .age-input,
body.dark-mode .form-control,
body.dark-mode .form-select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

body.dark-mode .age-input:focus,
body.dark-mode .form-control:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #F5B841;
    color: #e0e0e0;
}

body.dark-mode .input-group-text {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

body.dark-mode .modal-content {
    background: rgba(30, 30, 40, 0.95);
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .page-link {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: #bbb;
}

body.dark-mode .page-item.active .page-link {
    background: #F5B841;
    border-color: #F5B841;
}

body.dark-mode .pagination {
    --bs-pagination-bg: transparent;
    --bs-pagination-color: #bbb;
    --bs-pagination-border-color: rgba(255,255,255,0.08);
    --bs-pagination-hover-bg: rgba(255,255,255,0.06);
    --bs-pagination-hover-color: #e0e0e0;
    --bs-pagination-disabled-bg: transparent;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .glass-card {
        padding: 30px 14px 20px;
        border-radius: 16px;
    }

    .card-decoration {
        opacity: 0.5;
    }

    .card-dec-1 {
        top: -25px;
        right: -10px;
        width: 85px;
    }

    .card-dec-2 {
        top: -20px;
        left: -8px;
        width: 80px;
    }

    .card-dec-3 {
        top: 18%;
        right: -5px;
        width: 70px;
    }

    .card-dec-4 {
        top: 16%;
        left: -5px;
        width: 65px;
    }

    .card-dec-5 {
        top: 40%;
        right: -5px;
        width: 60px;
    }

    .card-dec-6 {
        top: 38%;
        left: -5px;
        width: 60px;
    }

    .card-dec-7 {
        bottom: -18px;
        right: -8px;
        width: 70px;
    }

    .card-dec-8 {
        bottom: -15px;
        left: -6px;
        width: 65px;
    }

    .card-dec-9 {
        top: 70%;
        right: -3px;
        width: 55px;
    }

    .header-hero {
        padding: 24px 12px 20px;
    }

    .survey-title {
        font-size: 1.25rem;
        letter-spacing: 0.5px;
        margin-bottom: 14px;
    }

    .intro-line {
        font-size: 0.85rem;
    }

    .survey-desc {
        font-size: 0.78rem;
    }

    .question-card {
        padding: 14px 12px;
        gap: 10px;
    }

    .question-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .question-label {
        font-size: 0.95rem;
    }

    .option-item {
        padding: 8px 10px;
    }

    .option-text {
        font-size: 0.82rem;
    }

    .btn-submit {
        width: 100%;
        min-width: unset;
        height: 48px;
        font-size: 1rem;
    }

    .display-no {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }

    /* 后台移动端 */
    .admin-sidebar {
        transform: translateX(-100%);
        width: 240px;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-content {
        padding: 16px;
    }

    .admin-topbar {
        padding: 12px 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .admin-table {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 16px 8px 40px;
    }

    .glass-card {
        padding: 20px 12px;
    }

    .input-wrapper {
        max-width: 100%;
    }

    .card-decoration {
        opacity: 0.4;
    }

    .card-dec-1 {
        top: -18px;
        right: -6px;
        width: 60px;
    }

    .card-dec-2 {
        top: -15px;
        left: -5px;
        width: 55px;
    }

    .card-dec-3 {
        top: 15%;
        right: -3px;
        width: 50px;
    }

    .card-dec-4 {
        top: 13%;
        left: -3px;
        width: 45px;
    }

    .card-dec-5 {
        top: 35%;
        right: -3px;
        width: 45px;
    }

    .card-dec-6 {
        top: 33%;
        left: -3px;
        width: 45px;
    }

    .card-dec-7 {
        bottom: -12px;
        right: -5px;
        width: 50px;
    }

    .card-dec-8 {
        bottom: -10px;
        left: -4px;
        width: 45px;
    }

    .card-dec-9 {
        top: 70%;
        right: -3px;
        width: 40px;
    }
}
