/* =========================================================
   1. 基础重置与通用工具
   ========================================================= */
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #1f2937;
    line-height: 1.65;
    font-size: 15px;
    overscroll-behavior-y: none; /* 禁用滑动回弹 */
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.muted { color: #94a3b8; font-size: 13px; }
.center { text-align: center; }
hr { border: none; border-top: 1px solid #e5e7eb; }

/* 后台 / 扫码等独立布局页面不受 body padding 影响 */
body.admin-body,
body.scan-body,
body.scanpay-body,
body.rules-body {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* =========================================================
   2. 前台顶栏 + 下拉菜单（深色主题）
   ========================================================= */
.site-header {
    background: #0f172a !important;
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    z-index: 9999;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.32) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 66px; }
.logo { font-weight: 800; font-size: 19px; color: #fff !important; flex: none; }
.logo:hover { color: #60a5fa !important; text-decoration: none; }

.nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav > a.nav-item,
.nav-drop > .nav-drop-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    color: #cbd5e1 !important; font-size: 15px; padding: 8px 14px; border-radius: 9px;
    transition: .15s; text-decoration: none; cursor: pointer;
}
.nav > a.nav-item:hover,
.nav-drop > .nav-drop-toggle:hover {
    color: #fff !important; background: rgba(255, 255, 255, 0.08) !important; text-decoration: none;
}
.nav > a.nav-item.active,
.nav-drop.active > .nav-drop-toggle {
    color: #fff !important; background: rgba(37, 99, 235, 0.4) !important; font-weight: 600;
}

.nav-drop { position: relative; }
.caret { font-size: 11px; opacity: 0.7; transition: transform 0.2s; }
.nav-drop:hover .caret { transform: rotate(180deg); }
.nav-drop-menu {
    position: absolute; left: 0; top: calc(100% + 6px); min-width: 180px;
    background: #fff !important; border-radius: 12px; padding: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28) !important; border: 1px solid #eef2f7;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: .18s; z-index: 101;
}
.nav-drop-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu,
.nav-drop.open .nav-drop-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-drop-menu a {
    display: block; padding: 9px 14px; border-radius: 8px;
    color: #475569 !important; font-size: 14px; white-space: nowrap;
}
.nav-drop-menu a:hover { background: #eef2ff !important; color: #2563eb !important; text-decoration: none; }
.nav-drop-menu a.active { background: #2563eb !important; color: #fff !important; }

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.header-actions .welcome { color: #94a3b8 !important; font-size: 14px; }
.header-actions .btn-ghost {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
}
.header-actions .btn-ghost:hover { background: rgba(255, 255, 255, 0.18) !important; color: #fff !important; }

.nav-mobile-actions { display: none; }

/* =========================================================
   3. 汉堡按钮
   ========================================================= */
.nav-toggle {
    display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 44px; height: 44px; padding: 11px 10px;
    background: rgba(255, 255, 255, 0.16); border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px; cursor: pointer; flex: none; margin-left: auto;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    position: relative; z-index: 100;
}
.nav-toggle span {
    display: block; width: 20px; height: 2.5px;
    background: #ffffff; border-radius: 2px; transition: 0.2s ease; flex-shrink: 0;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (forced-colors: active) {
    .nav-toggle { border: 2px solid CanvasText !important; background: Canvas !important; }
    .nav-toggle span { background: CanvasText !important; }
}

/* =========================================================
   4. 按钮、卡片、基础布局
   ========================================================= */
.btn {
    display: inline-block; background: #2563eb; color: #fff; border: 0; border-radius: 10px;
    padding: 9px 16px; font-size: 14px; cursor: pointer; transition: .15s; line-height: 1.4;
}
.btn:hover { background: #1d4ed8; text-decoration: none; color: #fff; }
.btn-lg { padding: 13px 28px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { display: block; width: 100%; }
.btn-ghost { background: #eef2ff; color: #2563eb; }
.btn-ghost:hover { background: #e0e7ff; color: #1d4ed8; }
.btn-ok { background: #10b981; }
.btn-ok:hover { background: #059669; }
.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; }

.card { background: #fff; border-radius: 16px; padding: 22px; box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06); margin-bottom: 22px; }
.card-title { margin: 0 0 14px; font-size: 17px; }
.section { margin: 34px 0; }
.section-title { font-size: 20px; margin: 0 0 16px; }
.page-title { font-size: 24px; margin: 26px 0 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 首屏 */
.hero { margin: 26px 0; border-radius: 22px; padding: 58px 34px; color: #fff; background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 55%, #10b981 100%); box-shadow: 0 18px 40px rgba(37, 99, 235, 0.25); }
.hero h1 { margin: 0 0 12px; font-size: 34px; letter-spacing: 0.5px; }
.hero p { margin: 0 0 26px; opacity: 0.92; font-size: 16px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .btn { background: #fff; color: #2563eb; font-weight: 600; }
.hero .btn-ghost { background: rgba(255, 255, 255, 0.18); color: #fff; border: 1px solid rgba(255, 255, 255, 0.5); }
.hero-stats { display: flex; gap: 44px; margin-top: 34px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 26px; }
.hero-stats span { font-size: 13px; opacity: 0.85; }

/* =========================================================
   5. 标签、表单、提示条、表格
   ========================================================= */
.tag { display: inline-block; background: #eef2ff; color: #2563eb; border-radius: 7px; padding: 1px 8px; font-size: 12px; margin-right: 6px; vertical-align: middle; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-green { background: #d1fae5; color: #047857; }
.tag-yellow { background: #fef3c7; color: #b45309; }
.tag-gray { background: #f1f5f9; color: #64748b; }

.form label, .auth-box label { display: block; margin-bottom: 14px; font-size: 14px; color: #475569; }
.input, textarea.input, select.input, input[type="datetime-local"], input[type="file"] {
    display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 14px;
    border: 1px solid #dbe2ea; border-radius: 10px; background: #fff; font-family: inherit;
}
.input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
textarea.input { resize: vertical; }
.search-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.search-bar .input { width: auto; margin-top: 0; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .input { margin-top: 0; }
.toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.auth-box { max-width: 440px; margin: 60px auto; background: #fff; padding: 40px 34px; border-radius: 18px; box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08); }
.auth-box h2 { margin: 0 0 22px; font-size: 21px; text-align: center; }

/* 登录注册表单完美对齐 */
.auth-form-item { display: flex; align-items: center; margin-bottom: 18px; }
.auth-form-item .form-label { width: 80px; text-align: right; padding-right: 14px; font-size: 14px; color: #475569; flex-shrink: 0; }
.auth-form-item .input { margin-top: 0 !important; flex: 1; background: #f8fafc; border: 1px solid #e2e8f0; padding: 11px 14px; }
.auth-form-item .input:focus { background: #fff; border-color: #2563eb; }

.flash { padding: 12px 16px; border-radius: 11px; margin: 18px 0; font-size: 14px; }
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #e0f2fe; color: #075985; }
.flash-warn { background: #fef3c7; color: #92400e; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.table th { color: #64748b; font-weight: 600; font-size: 13px; background: #f8fafc; }

/* 列表与 Tabs */
.notice-list, .link-list { list-style: none; padding: 0; margin: 0; }
.notice-list li, .link-list li { padding: 12px 0; border-bottom: 1px dashed #e5e7eb; }
.notice-list li:last-child, .link-list li:last-child { border-bottom: 0; }
.notice-body { color: #475569; font-size: 14px; margin-top: 6px; }
.reply { margin-top: 8px; padding: 10px 12px; background: #eef2ff; border-radius: 10px; font-size: 14px; color: #1e40af; }

.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.tab { padding: 8px 16px; border-radius: 10px; background: #fff; color: #475569; font-size: 14px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05); text-decoration: none; }
.tab:hover { text-decoration: none; color: #2563eb; }
.tab.active { background: #2563eb; color: #fff; }

/* =========================================================
   6. 选座与座位布局图
   ========================================================= */
.layout-legend { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; font-size: 13px; color: #64748b; margin-bottom: 16px; }
.layout-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.lg-free { background: #d1fae5; border: 1px solid #10b981; }
.lg-busy { background: #fee2e2; border: 1px solid #ef4444; }
.lg-reserved { background: #fef3c7; border: 1px solid #f59e0b; }
.lg-off { background: #f1f5f9; border: 1px solid #cbd5e1; }

.layout-room { background: linear-gradient(180deg, #f8fafc, #eef2f7); border-radius: 18px; padding: 26px; border: 1px dashed #cbd5e1; overflow-x: auto; }
.layout-stage { max-width: 280px; margin: 0 auto 24px; padding: 10px; text-align: center; background: #fff; border-radius: 10px; color: #64748b; font-size: 12px; letter-spacing: 3px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06); }
.layout-grid { display: grid; gap: 10px; min-width: min(100%, 420px); }

.seat-layout-seat { display: block; position: relative; cursor: pointer; }
.seat-layout-seat input { position: absolute; opacity: 0; pointer-events: none; }
.seat-layout-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border-radius: 11px; font-size: 13px; font-weight: 600; background: #f1f5f9; color: #475569; border: 2px solid transparent; transition: 0.15s; }
.seat-layout-body small { font-size: 10px; font-weight: 400; opacity: 0.7; }
.seat-layout-seat:hover .seat-layout-body { background: #e0e7ff; color: #2563eb; }
.seat-layout-seat.active .seat-layout-body { background: #2563eb; color: #fff; border-color: #1d4ed8; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35); }
.seat-layout-seat.busy { cursor: not-allowed; }
.seat-layout-seat.busy .seat-layout-body { background: #fee2e2; color: #b91c1c; border-color: #fecaca; cursor: not-allowed; }
.seat-layout-seat.busy:hover .seat-layout-body { background: #fee2e2; color: #b91c1c; }

.seat-layout { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; border-radius: 11px; font-size: 13px; font-weight: 600; text-decoration: none; transition: 0.15s; }
.seat-layout:hover { text-decoration: none; }
.seat-layout.free { background: #d1fae5; color: #047857; border: 1px solid #10b981; }
.seat-layout.free:hover { background: #a7f3d0; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25); }
.seat-layout.busy { background: #fee2e2; color: #b91c1c; border: 1px solid #ef4444; cursor: not-allowed; }
.seat-layout .seat-orient { font-size: 10px; font-weight: 400; opacity: 0.75; }
.seat-layout .seat-remain, .seat-layout-body .seat-remain { display: block; font-size: 10px; font-weight: 500; margin-top: 2px; opacity: 0.9; line-height: 1.2; letter-spacing: 0; }
.seat-layout.busy .seat-remain, .seat-layout-seat.busy .seat-remain { color: #991b1b; }

.plan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.plan input { display: none; }
.plan-body { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: #f8fafc; border: 2px solid transparent; cursor: pointer; transition: 0.15s; }
.plan-body strong { font-size: 15px; }
.plan-body em { font-style: normal; font-size: 12px; color: #64748b; }
.plan-body b { color: #2563eb; font-size: 17px; }
.plan input:checked + .plan-body { border-color: #2563eb; background: #eef2ff; }
.booking-form h3 { margin: 26px 0 10px; font-size: 16px; }
.booking-form h3:first-of-type { margin-top: 0; }

/* =========================================================
   7. 次卡、留言板、在线交流
   ========================================================= */
.pass-card { background: #f8fafc; border-radius: 12px; padding: 16px; margin-bottom: 12px; border: 1px solid #eef2f7; }
.pass-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pass-head strong { font-size: 15px; }
.pass-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pass-body div { background: #fff; border-radius: 8px; padding: 10px; text-align: center; border: 1px solid #eef2f7; }
.pass-body span { display: block; font-size: 12px; color: #64748b; margin-bottom: 4px; }
.pass-body strong { font-size: 16px; color: #0f172a; }

.guestbook-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.gb-item { background: #f8fafc; border-radius: 12px; padding: 14px 16px; border-left: 4px solid #2563eb; }
.gb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.gb-body { color: #1f2937; font-size: 14.5px; line-height: 1.7; }
.gb-reply { margin-top: 10px; background: #eef2ff; border-radius: 10px; padding: 10px 12px; color: #1e40af; font-size: 14px; }
.pager { display: flex; gap: 6px; margin-top: 18px; justify-content: center; flex-wrap: wrap; }
.pager-item { padding: 6px 12px; border-radius: 8px; background: #f1f5f9; color: #475569; font-size: 14px; }
.pager-item:hover { background: #e0e7ff; color: #2563eb; text-decoration: none; }
.pager-item.active { background: #2563eb; color: #fff; }

.chat-card { padding: 16px; }
.chat-box { background: #f8fafc; border-radius: 12px; padding: 14px; height: 480px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.chat-item { background: #fff; padding: 10px 14px; border-radius: 12px; max-width: 80%; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05); }
.chat-item.guest { border-left: 3px solid #cbd5e1; }
.chat-item.registered { border-left: 3px solid #2563eb; }
.chat-nick { font-size: 12px; color: #64748b; margin-bottom: 2px; }
.chat-content { font-size: 14.5px; color: #1f2937; line-height: 1.6; word-break: break-word; }
.chat-time { font-size: 11px; color: #94a3b8; margin-top: 2px; text-align: right; }
.chat-form { display: flex; gap: 10px; margin-top: 14px; }
.chat-input { flex: 1; margin-top: 0; }

/* =========================================================
   8. 资料库与分类 Tab
   ========================================================= */
.resource-list li { padding: 14px 0; }
.res-row { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.res-info { flex: 1; min-width: 200px; line-height: 2; }
.res-info strong { font-size: 15px; margin-right: 6px; }
.res-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.res-title { font-size: 15px; font-weight: 600; color: #1e40af; margin-right: 6px; transition: color 0.15s; }
.res-title:hover { color: #2563eb; text-decoration: underline; }
.res-meta { font-size: 12px; margin-left: 8px; }

.res-cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.res-cat-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; background: #fff; color: #475569; border: 1px solid #eef2f7; font-size: 14px; font-weight: 500; text-decoration: none; transition: 0.15s; }
.res-cat-tab em { font-style: normal; font-size: 11.5px; color: #94a3b8; background: #f1f5f9; padding: 1px 7px; border-radius: 8px; }
.res-cat-tab:hover { background: #f8fafc; border-color: #cbd5e1; color: #1f2937; text-decoration: none; }
.res-cat-tab.active { background: #2563eb; color: #fff; border-color: #2563eb; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }
.res-cat-tab.active em { background: rgba(255, 255, 255, 0.22); color: #fff; }

.res-sub-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.res-sub-pill { padding: 6px 14px; border-radius: 20px; background: #f8fafc; color: #64748b; border: 1px solid #eef2f7; font-size: 13px; font-weight: 500; text-decoration: none; transition: 0.15s; }
.res-sub-pill:hover { background: #eef2ff; color: #2563eb; border-color: #dbeafe; text-decoration: none; }
.res-sub-pill.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.res-subs-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.res-sub-item { display: flex; align-items: center; gap: 6px; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 10px; padding: 6px 8px; }
.res-sub-input { border: 1px solid transparent; background: transparent; font-size: 14px; color: #1f2937; padding: 4px 8px; border-radius: 6px; outline: none; min-width: 90px; max-width: 200px; font-family: inherit; }
.res-sub-input:focus { border-color: #2563eb; background: #fff; }
.res-add-sub-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 14px; border-top: 1px dashed #eef2f7; }
.res-add-sub-form .input { margin-top: 0; flex: 1; min-width: 200px; }

/* =========================================================
   9. 报名官网卡片网格
   ========================================================= */
.exams-page { max-width: 1100px; margin: 0 auto; padding: 40px 20px 60px; }
.exams-head { text-align: center; margin-bottom: 36px; }
.exams-head-badge { display: inline-block; padding: 5px 14px; border-radius: 20px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; margin-bottom: 16px; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3); }
.exams-head h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; color: #0f172a; margin: 0 0 10px; line-height: 1.2; }
.exams-head-sub { font-size: 14.5px; color: #64748b; margin: 0 0 26px; line-height: 1.6; }
.exams-head-sub strong { color: #6366f1; font-weight: 700; font-size: 16px; }
.exams-search { max-width: 420px; margin: 0 auto; position: relative; }
.exams-search-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 18px; font-weight: 600; pointer-events: none; }
.exams-search input { width: 100%; padding: 13px 18px 13px 42px; border: 1px solid #e5e7eb; border-radius: 12px; font-size: 14px; background: #fff; color: #0f172a; outline: none; transition: 0.18s; font-family: inherit; box-sizing: border-box; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03); }
.exams-search input::placeholder { color: #94a3b8; }
.exams-search input:focus { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12); }

.exam-group-card { margin-bottom: 24px; border-radius: 20px; padding: 22px 24px 24px; background: linear-gradient(135deg, var(--c-bg) 0%, #ffffff 70%); border: 1px solid var(--c-bd); scroll-margin-top: 90px; position: relative; overflow: hidden; }
.exam-group-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.exam-group-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.exam-group-icon { width: 52px; height: 52px; border-radius: 15px; background: linear-gradient(135deg, var(--c1), var(--c2)); display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none; box-shadow: 0 6px 16px var(--c-bd); }
.exam-group-title h2 { margin: 0; font-size: 18px; font-weight: 700; color: #0f172a; line-height: 1.3; }
.exam-group-title p { margin: 3px 0 0; font-size: 12.5px; color: #64748b; line-height: 1.5; }
.exam-group-count { margin-left: auto; flex: none; padding: 5px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--c-bd); color: var(--c1); font-size: 11.5px; font-weight: 600; white-space: nowrap; }

.exam-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.exam-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border-radius: 12px; border: 1px solid #eef2f7; color: inherit; text-decoration: none; transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; }
.exam-tile:hover { transform: translateY(-2px); border-color: var(--c1); box-shadow: 0 10px 24px -8px var(--c-bd), 0 4px 8px rgba(15, 23, 42, 0.04); text-decoration: none; }
.exam-tile-icon { width: 44px; height: 44px; flex: none; border-radius: 11px; background: linear-gradient(135deg, var(--c1), var(--c2)); display: flex; align-items: center; justify-content: center; font-size: 22px; transition: 0.22s; box-shadow: 0 4px 10px var(--c-bd); }
.exam-tile:hover .exam-tile-icon { transform: scale(1.08) rotate(-4deg); }
.exam-tile-body { flex: 1; min-width: 0; }
.exam-tile-name { font-size: 14px; font-weight: 700; color: #0f172a; line-height: 1.4; margin-bottom: 3px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; transition: color 0.15s; }
.exam-tile:hover .exam-tile-name { color: var(--c1); }
.exam-tile-desc { font-size: 12px; color: #64748b; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; }
.exam-tile-domain { font-size: 10.5px; color: #94a3b8; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: -0.01em; }
.exam-tile-tag { padding: 1px 7px; background: var(--c-bg); color: var(--c1); border-radius: 5px; font-size: 10.5px; font-weight: 600; }
.exam-tile-arrow { flex: none; color: #cbd5e1; font-size: 15px; font-weight: 700; transition: 0.2s; }
.exam-tile:hover .exam-tile-arrow { color: var(--c1); transform: translate(2px, -2px); }
.exams-empty { text-align: center; padding: 60px 20px; }
.exams-foot-tip { margin-top: 12px; padding: 16px 22px; background: linear-gradient(135deg, #f8fafc, #f1f5f9); border-radius: 14px; font-size: 12.5px; color: #64748b; line-height: 1.8; text-align: center; border: 1px solid #e2e8f0; }
.exams-foot-tip strong { color: #0f172a; font-weight: 700; }
.exams-foot-tip code { display: inline-block; padding: 2px 8px; margin: 0 2px; background: #fff; border-radius: 5px; font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #6366f1; border: 1px solid #e0e7ff; }

/* =========================================================
   10. 支付页
   ========================================================= */
.pay-wrap { max-width: 960px; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 16px; }
.pay-method { text-align: center; padding: 20px; border-radius: 14px; background: #f8fafc; border: 1px solid #eef2f7; }
.pay-method h3 { margin: 0 0 14px; font-size: 16px; }
.pay-method.wechat { border-color: #10b981; }
.pay-method.alipay { border-color: #2563eb; }
.qr-img { display: block; max-width: 200px; width: 80%; margin: 0 auto 12px; border-radius: 10px; background: #fff; padding: 6px; }
.qr-placeholder { padding: 40px 10px; color: #94a3b8; background: #fff; border: 2px dashed #cbd5e1; border-radius: 10px; margin-bottom: 12px; }
.pay-method p { margin: 4px 0; font-size: 14px; }
.pay-method .small { font-size: 12px; color: #64748b; }
.pay-notice { padding: 16px 20px; background: #fef3c7; border-radius: 12px; border-left: 4px solid #f59e0b; }
.pay-notice h3 { margin: 0 0 10px; font-size: 15px; }
.pay-notice ol { margin: 0; padding-left: 20px; line-height: 1.9; font-size: 14px; }
.pay-extra { margin-top: 12px; padding: 10px 14px; background: #fff; border-radius: 8px; font-size: 14px; color: #92400e; }

/* =========================================================
   11. 后台管理界面
   ========================================================= */
.admin-body { display: flex; min-height: 100vh; background: #f4f6fb; }

/* 侧边栏基础 */
.admin-side {
    width: 210px; flex: none; background: #0f172a; color: #cbd5e1;
    display: flex; flex-direction: column; padding: 20px 14px;
    position: sticky; top: 0; height: 100vh;
}

/* 侧边栏标题（固定不压缩） */
.admin-side .admin-logo {
    display: flex;
    align-items: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    margin-bottom: 20px;
    padding: 4px 6px 18px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* 侧边栏菜单（独立滚动） */
.admin-side nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.admin-side nav a { color: #cbd5e1; padding: 9px 12px; border-radius: 9px; font-size: 14px; text-decoration: none; white-space: nowrap; }
.admin-side nav a:hover { background: #1e293b; color: #fff; text-decoration: none; }
.admin-side nav a.active { background: #2563eb; color: #fff; }

.admin-back { margin-top: 14px; font-size: 13px; color: #64748b; padding-left: 12px; text-decoration: none; flex-shrink: 0; }
.admin-back:hover { color: #93c5fd; text-decoration: none; }

.admin-main { flex: 1; padding: 22px 26px; min-width: 0; }
.admin-top h1 { margin: 0 0 18px; font-size: 22px; }
.admin-login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e293b, #0f172a); }
.admin-login-body .auth-box { margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05); }
.stat span { display: block; color: #64748b; font-size: 13px; margin-bottom: 6px; }
.stat strong { font-size: 22px; color: #0f172a; }

.badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; font-size: 11px; line-height: 18px; text-align: center; background: #ef4444; color: #fff; border-radius: 9px; font-weight: 600; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
.admin-notice-bar { background: #fef2f2; border-left: 4px solid #ef4444; color: #991b1b; padding: 14px 20px; border-radius: 10px; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.admin-notice-bar strong { color: #dc2626; font-size: 20px; line-height: 1; }
.admin-notice-bar a { margin-left: auto; background: #ef4444; color: #fff; padding: 7px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.admin-notice-bar a:hover { background: #dc2626; text-decoration: none; }
.tag-new { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; font-weight: 600; animation: pulse 2s infinite; }
tr.row-new { background: #fff7f7; }
tr.row-new:hover { background: #fee2e2; }
tr.row-refunded { background: #fef2f2; }
tr.row-refunded:hover { background: #fee2e2; }
tr.row-refunded td { color: #991b1b; }

.seat-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.seat-admin { background: #f8fafc; border-radius: 10px; padding: 10px; text-align: center; font-size: 13px; border: 1px solid #eef2f7; }
.seat-admin.off { opacity: 0.45; }
.seat-admin-ops { display: flex; justify-content: center; gap: 8px; margin-top: 6px; }
.seat-admin-ops a, .seat-admin-ops button { background: none; border: 0; color: #2563eb; font-size: 12px; cursor: pointer; padding: 0; }
.seat-admin-ops button { color: #ef4444; }

.exams-admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.exams-admin-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; background: #fff; color: #475569; border: 1px solid #eef2f7; font-size: 14px; font-weight: 500; text-decoration: none; transition: 0.15s; }
.exams-admin-tab em { font-style: normal; font-size: 12px; color: #94a3b8; background: #f1f5f9; padding: 1px 8px; border-radius: 8px; }
.exams-admin-tab:hover { background: #f8fafc; border-color: #cbd5e1; text-decoration: none; color: #1f2937; }
.exams-admin-tab.active { background: var(--accent, #2563eb); color: #fff; border-color: var(--accent, #2563eb); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }
.exams-admin-tab.active em { background: rgba(255, 255, 255, 0.25); color: #fff; }
.exams-admin-tab.add { background: #eef2ff; color: #2563eb; border-color: #dbeafe; font-weight: 600; }
.exams-admin-tab.add:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

/* =========================================================
   12. 学习工具与计划
   ========================================================= */
.tool-card { display: flex; align-items: center; gap: 16px; background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06); color: #1f2937; text-decoration: none; transition: 0.18s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(37, 99, 235, 0.15); color: #2563eb; text-decoration: none; }
.tool-icon { font-size: 34px; flex: none; }
.tool-card strong { display: block; font-size: 16px; margin-bottom: 4px; }
.tool-card p { margin: 0; font-size: 13px; }

.plan-progress-card { padding: 20px; }
.plan-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.progress-bar { height: 12px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2563eb, #10b981); transition: width 0.4s ease; }
.progress-text { margin-top: 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.progress-text strong { font-size: 22px; color: #2563eb; }
.progress-text .muted { font-size: 13px; }

.plan-list { list-style: none; padding: 0; margin: 0; }
.plan-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; background: #f8fafc; margin-bottom: 10px; border: 1px solid #eef2f7; transition: 0.15s; }
.plan-item:hover { background: #fff; border-color: #cbd5e1; }
.plan-item.done { opacity: 0.65; }
.plan-item.done .plan-title { text-decoration: line-through; color: #94a3b8; }
.plan-check { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; cursor: pointer; color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: 0.15s; }
.plan-item.done .plan-check { background: #10b981; border-color: #10b981; }
.plan-content { flex: 1; min-width: 0; }
.plan-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; word-break: break-word; }
.plan-desc { font-size: 13px; color: #475569; line-height: 1.6; margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; }
.plan-meta { font-size: 12px; color: #94a3b8; }
.plan-ops { display: flex; gap: 6px; flex-wrap: wrap; flex: none; align-items: flex-start; }

/* =========================================================
   13. 学习笔记
   ========================================================= */
.note-item { background: #f8fafc; border-radius: 12px; margin-bottom: 10px; border: 1px solid #eef2f7; padding: 0; overflow: hidden; }
.note-item.pinned { background: #fffbeb; border-color: #fde68a; }
.note-item summary { padding: 12px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; user-select: none; }
.note-item summary::-webkit-details-marker { display: none; }
.note-item summary::before { content: '▸'; color: #94a3b8; flex: none; transition: transform 0.2s; display: inline-block; }
.note-item[open] summary::before { transform: rotate(90deg); }
.note-title { font-weight: 600; font-size: 15px; flex: 1; min-width: 120px; word-break: break-word; }
.note-meta { font-size: 12px; color: #94a3b8; flex: none; }
.note-body { padding: 0 14px 12px 40px; font-size: 14px; line-height: 1.8; color: #334155; white-space: pre-wrap; word-break: break-word; }
.note-ops { padding: 0 14px 14px 40px; display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================
   14. 仪表盘 7 天趋势
   ========================================================= */
.week-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 160px; padding-top: 10px; }
.week-bar { display: flex; flex-direction: column; height: 100%; }
.week-bar-inner { flex: 1; display: flex; align-items: flex-end; background: #f8fafc; border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.week-bar-fill { width: 100%; border-radius: 8px; background: linear-gradient(180deg, #2563eb, #3b82f6); transition: height 0.3s; }
.week-bar-label { text-align: center; font-size: 12px; color: #64748b; line-height: 1.4; }

/* =========================================================
   15. 扫码页底部固定按钮
   ========================================================= */
.scan-home-btn-wrap {
    position: fixed !important; left: 0; right: 0; bottom: 0;
    z-index: 9999999 !important;
    display: flex; justify-content: center; gap: 12px; flex-wrap: nowrap;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
    margin: 0 !important;
    pointer-events: auto !important;
    isolation: isolate;
}
.scan-home-btn, .scan-rules-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 24px; border-radius: 12px; font-size: 14.5px; font-weight: 600;
    text-decoration: none; transition: .18s; white-space: nowrap; flex: 1; max-width: 220px;
    pointer-events: auto !important; cursor: pointer !important; position: relative; z-index: 1;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08); touch-action: manipulation;
    min-height: 44px; line-height: 1.2;
}
.scan-home-btn { background: #0f172a; color: #fff !important; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2); }
.scan-home-btn:hover { background: #1e293b; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28); text-decoration: none; color: #fff !important; }
.scan-rules-btn { background: #fff; color: #0f172a !important; border: 1px solid #cbd5e1; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05); }
.scan-rules-btn:hover { background: #f8fafc; border-color: #0f172a; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12); text-decoration: none; color: #0f172a !important; }

body.scan-body .scan-wrap,
body.scanpay-body .scanpay-wrap,
body.rules-body .rules-wrap { padding-bottom: 120px !important; }
body.scan-body .site-footer, body.scanpay-body .site-footer, body.rules-body .site-footer { display: none !important; }

/* =========================================================
   16. 页脚（全新浅色多列设计）
   ========================================================= */
.site-footer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0;
    padding: 60px 0 30px;
    margin-top: 60px;
    color: #64748b;
    font-size: 14px;
    position: relative !important; /* 取消固定定位 */
    z-index: 10;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 20px;
}
.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: #2f6feb;
    text-decoration: none;
    margin-bottom: 16px;
}
.footer-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.footer-desc {
    line-height: 1.8;
    margin: 0;
    max-width: 320px;
}
.footer-links, .footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li { margin-bottom: 12px; }
.footer-links a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: #2f6feb; }
.footer-contact li {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.6;
}
.footer-contact i {
    font-style: normal;
    color: #94a3b8;
}
.footer-bottom {
    border-top: 1px dashed #e2e8f0;
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: #94a3b8;
    font-size: 13px;
}
.footer-bottom p { margin: 0; }

/* =========================================================
   17. 电脑端在线交流：自适应视口
   ========================================================= */
@media (min-width: 861px) {
    .container > .chat-card { display: flex; flex-direction: column; height: min(660px, calc(100vh - 260px)); }
    .container > .chat-card .chat-box { flex: 1; height: auto !important; min-height: 0; overflow-y: auto; }
    .container > .chat-card .chat-form { flex-shrink: 0; }
}

/* =========================================================
   18. 响应式布局（≤860px 手机 & 小平板）
   ========================================================= */
@media (max-width: 860px) {
    body:not(.admin-body):not(.scan-body):not(.scanpay-body):not(.rules-body) { padding-top: 56px; padding-bottom: 0px; }
    .container { padding: 0 14px; }

    /* 前台导航 */
    .header-inner { height: auto; padding: 10px 0; gap: 10px; display: flex; align-items: center; justify-content: space-between; }
    .logo { font-size: 17px; }
    .nav-toggle { display: flex; }
    .header-actions { display: none; }

    .nav {
        position: fixed; left: 0; right: 0; top: 56px; bottom: 0; background: #0f172a !important; z-index: 70;
        padding: 14px 16px 24px; overflow-y: auto; flex-direction: column; gap: 4px;
        transform: translateY(-100%); opacity: 0; visibility: hidden; transition: transform 0.22s ease, opacity 0.22s;
        box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4) !important; border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav.open { transform: translateY(0); opacity: 1; visibility: visible; display: flex; }

    .nav > a.nav-item, .nav-drop > a.nav-item { background: rgba(255, 255, 255, 0.05) !important; color: #cbd5e1 !important; display: flex; justify-content: space-between; align-items: center; padding: 13px 12px; font-size: 15px; border-radius: 10px; margin-bottom: 2px; }
    .nav > a.nav-item.active, .nav-drop.active > a.nav-item { background: rgba(37, 99, 235, 0.4) !important; color: #fff !important; }

    .nav-drop { display: block; }
    .nav-drop-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none !important; border: none !important; background: rgba(255, 255, 255, 0.04) !important; padding: 0; margin: 4px 0 4px 12px; display: none; }
    .nav-drop.open .nav-drop-menu { display: block; }
    .nav-drop-menu a { color: #94a3b8 !important; padding: 11px 12px; border-radius: 8px; background: transparent !important; margin-top: 4px; }
    .nav-drop-menu a:hover { background: rgba(255, 255, 255, 0.08) !important; color: #fff !important; }
    .nav-drop-menu a.active { background: rgba(37, 99, 235, 0.5) !important; color: #fff !important; }

    .nav-mobile-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
    .nav-mobile-actions .welcome { width: 100%; font-size: 13px; color: #94a3b8 !important; margin-bottom: 6px; }
    .nav-mobile-actions .btn-ghost { background: rgba(255, 255, 255, 0.1) !important; color: #e2e8f0 !important; border: 1px solid rgba(255, 255, 255, 0.16) !important; }
    .nav-mobile-actions .btn-ghost:hover { background: rgba(255, 255, 255, 0.18) !important; color: #fff !important; }

    /* 通用页面元素 */
    .page-title { font-size: 20px; margin: 16px 0 14px; }
    .section-title { font-size: 18px; }
    .card { padding: 16px; border-radius: 14px; margin-bottom: 16px; }
    .card-title { font-size: 16px; margin-bottom: 12px; }
    .grid-2, .grid-3, .grid-4, .row-2 { grid-template-columns: 1fr; gap: 14px; }

    .hero { margin: 14px 0; padding: 30px 20px; border-radius: 18px; }
    .hero h1 { font-size: 22px; line-height: 1.35; }
    .hero p { font-size: 14px; margin-bottom: 18px; }
    .hero-actions { flex-direction: column; gap: 10px; }
    .hero-actions .btn { width: 100%; text-align: center; padding: 12px; }
    .hero-stats { gap: 22px; margin-top: 22px; flex-wrap: wrap; }
    .hero-stats strong { font-size: 20px; }
    .hero-stats span { font-size: 12px; }

    .input, textarea.input, select.input, input[type="datetime-local"], input[type="file"] { font-size: 16px; padding: 11px 12px; }
    .form label, .auth-box label { font-size: 14px; }
    .search-bar { flex-direction: column; align-items: stretch; }
    .search-bar .input, .search-bar .btn { width: 100%; }
    .card > .table, .table { display: block; overflow-x: auto; white-space: nowrap; font-size: 13px; }
    .table th, .table td { padding: 8px 10px; }
    .table th { font-size: 12px; }
    .form-actions .btn, .form .btn { width: 100%; margin-top: 4px; }
    .form .btn + .btn { margin-top: 8px; }

    .layout-room { padding: 14px; border-radius: 14px; }
    .layout-grid { gap: 6px; }
    .seat-layout, .seat-layout-body { min-height: 44px; font-size: 12px; border-radius: 8px; }
    .seat-layout .seat-remain { font-size: 9px; }
    .layout-stage { max-width: 200px; margin-bottom: 14px; font-size: 11px; letter-spacing: 2px; }
    .plan-list { grid-template-columns: 1fr; gap: 10px; }
    .plan-body { padding: 12px; }
    .pay-methods { grid-template-columns: 1fr; }
    .qr-img { max-width: 170px; }
    .pass-body { grid-template-columns: repeat(2, 1fr); }

    .res-row { flex-direction: column; align-items: flex-start; }
    .res-actions { width: 100%; }
    .res-cat-tab { padding: 7px 12px; font-size: 13px; }
    .res-sub-pill { padding: 5px 11px; font-size: 12px; }
    .res-add-sub-form .input, .res-add-sub-form .btn { width: 100%; }

    .exams-page { padding: 24px 12px 40px; }
    .exams-head { margin-bottom: 22px; }
    .exams-head h1 { font-size: 26px; margin-bottom: 8px; }
    .exams-head-sub { font-size: 13px; margin-bottom: 18px; }
    .exams-search input { padding: 11px 15px 11px 38px; font-size: 13.5px; }
    .exam-group-card { padding: 16px 14px 18px; border-radius: 16px; margin-bottom: 16px; }
    .exam-tile-grid { grid-template-columns: 1fr; gap: 8px; }
    .exam-tile { padding: 12px 13px; gap: 10px; }

    .chat-box { height: 360px; }

    /* 页脚移动端适配 */
    .site-footer { padding: 40px 0 20px !important; margin-top: 40px; font-size: 13px; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; text-align: center; }
    .footer-desc { margin: 0 auto; }
    .footer-logo { justify-content: center; }
    .footer-contact li { justify-content: center; text-align: left; }
    .footer-bottom { flex-direction: column; text-align: center; padding-top: 20px; }

    .scan-home-btn-wrap { padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)) !important; gap: 10px; }
    .scan-home-btn, .scan-rules-btn { padding: 11px 16px !important; font-size: 13.5px !important; max-width: none; }

    /* 登录/注册页自适应 */
    .auth-box { padding: 30px 20px; margin: 30px auto; }
    .auth-form-item { flex-direction: column; align-items: flex-start; }
    .auth-form-item .form-label { width: 100%; text-align: left; padding-right: 0; margin-bottom: 6px; }
    .auth-form-item .input { width: 100%; }

    /* 后台移动端 */
    .admin-body { display: block; }
    .admin-mobile-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 50; background: #0f172a; color: #fff; padding: 10px 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); }
    .admin-mobile-title { font-weight: 700; font-size: 15px; flex: 1; }
    .admin-mobile-bar .badge { margin: 0; }
    .admin-nav-toggle { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 36px; height: 36px; padding: 8px; background: none; border: 0; cursor: pointer; }
    .admin-nav-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; }
    .admin-side { 
        position: fixed; left: 0; top: 0; bottom: 0; width: 250px; max-width: 80vw; height: 100vh; 
        z-index: 80; transform: translateX(-100%); transition: transform 0.25s ease; 
        overflow-y: hidden; padding: 20px 14px; flex-direction: column; 
    }
    .admin-side.open { transform: translateX(0); }
    .admin-side nav { flex-direction: column; flex-wrap: nowrap; }
    .admin-side .admin-logo { margin: 0 0 16px 0; width: 100%; }
    .admin-back { margin-top: 14px; padding-left: 12px; }
    .admin-mask { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 60; backdrop-filter: blur(2px); }
    .admin-mask.show { display: block; }
    .admin-main { padding: 14px 14px 30px; min-width: 0; }
    .admin-top h1 { font-size: 19px; margin: 6px 0 14px; }
    .admin-notice-bar { padding: 12px 14px; font-size: 13px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .admin-notice-bar strong { font-size: 17px; }
    .admin-notice-bar a { margin-left: 0; width: 100%; text-align: center; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat { padding: 14px; }
    .stat strong { font-size: 18px; }
    .seat-admin-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
    .week-chart { gap: 6px; height: 120px; }
    .week-bar-label { font-size: 10px; }

    .plan-progress-head { flex-direction: column; align-items: flex-start; }
    .plan-item { gap: 10px; padding: 10px; }
    .plan-title { font-size: 14px; }
    .plan-ops { width: 100%; justify-content: flex-end; }
    .note-item summary { padding: 10px 12px; }
    .note-body, .note-ops { padding-left: 12px; }
    .tool-card { padding: 16px; gap: 12px; }
    .tool-icon { font-size: 28px; }
    .tool-card strong { font-size: 15px; }
}

/* =========================================================
   19. 小屏手机（≤480px）
   ========================================================= */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .logo { font-size: 16px; }
    .hero { padding: 24px 16px; }
    .hero h1 { font-size: 20px; }
    .hero-stats { gap: 16px; }
    .hero-stats strong { font-size: 18px; }
    .card { padding: 14px; }
    .card-title { font-size: 15px; }
    .btn { padding: 9px 13px; font-size: 13.5px; }
    .btn-sm { padding: 6px 10px; font-size: 12.5px; }
    .nav { top: 52px; }
    .nav-toggle { width: 40px; height: 40px; padding: 10px 9px; border-radius: 9px; }
    .nav-toggle span { width: 18px; height: 2.2px; }
    .admin-mobile-bar { padding: 9px 12px; }
    .admin-main { padding: 12px 12px 26px; }
    .stat-grid { gap: 8px; }
    .stat { padding: 12px; }
    .stat span { font-size: 12px; }
    .stat strong { font-size: 16px; }
    .chat-box { height: 300px; padding: 10px; }
    .chat-item { max-width: 92%; padding: 8px 12px; }
    .table th, .table td { padding: 7px 8px; font-size: 12px; }
    .seat-layout, .seat-layout-body { min-height: 40px; font-size: 11px; }
    .layout-grid { gap: 5px; }
    .scan-home-btn, .scan-rules-btn { padding: 10px 12px; font-size: 13px; }
}

/* =========================================================
   20. 防止抽屉打开时页面滚动
   ========================================================= */
body.nav-open,
body.sidebar-open {
    overflow: hidden;
}
/* =========================================================
   彻底修复：电脑端隐藏手机端顶栏，保证单一标题
   ========================================================= */
@media (min-width: 861px) {
    .admin-mobile-bar { display: none !important; }
    .admin-mask { display: none !important; }
}

@media (max-width: 860px) {
    /* 手机端隐藏左侧边栏里的大标题，因为顶部已经有了 */
    .admin-side .admin-logo { display: none !important; }
    .admin-side { padding-top: 14px !important; }
}
/* =========================================================
   静鱼自习室 - 前台首页专属焕新 UI 覆盖 (New Home Redesign)
   ========================================================= */
.home-redesign-container {
    background: transparent !important; /* 改为透明，让插画背景透出来 */
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #1f2937;
    padding-bottom: 40px;
}

/* 顶部导航 */
.home-navbar-wrapper {
    width: 100%;
    padding: 16px 20px;
    background: transparent !important; /* 原来是 #f7f9fc，改为透明 */
}
.home-navbar-wrapper .navbar {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}
.home-navbar-wrapper .logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 18px; font-weight: 700; color: #2f6feb; text-decoration: none;
}
.home-navbar-wrapper .logo-mark {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #5b8def, #2f6feb);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
}
.home-navbar-wrapper .nav-menu {
    display: flex; gap: 28px; list-style: none; margin: 0; padding: 0;
}
.home-navbar-wrapper .nav-menu a {
    text-decoration: none; color: #4b5563; font-size: 14px;
    padding: 8px 14px; border-radius: 999px; transition: all 0.25s ease;
}
.home-navbar-wrapper .nav-menu a:hover,
.home-navbar-wrapper .nav-menu a.active {
    color: #2f6feb; background: #eef4ff;
}
.home-navbar-wrapper .user-action { display: flex; align-items: center; gap: 14px; }
.home-navbar-wrapper .search-box {
    display: flex; align-items: center; gap: 8px;
    background: #f3f4f6; border-radius: 999px; padding: 8px 16px;
    color: #6b7280; font-size: 14px;
}
.home-navbar-wrapper .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 14px; text-decoration: none;
}
.home-navbar-wrapper .btn-login {
    background: #2f6feb; color: #fff; padding: 8px 20px;
    border-radius: 999px; text-decoration: none; font-size: 14px;
}

/* 容器 */
.home-redesign-container .hero, 
.home-redesign-container .features {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 32px;
}

/* Hero 区域 */
.home-redesign-container .hero {
    background: linear-gradient(135deg, #fef6ef 0%, #f3f7ff 50%, #eef4ff 100%);
    border-radius: 28px;
    padding: 60px 50px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    box-shadow: 0 10px 40px rgba(47, 111, 235, 0.08);
    position: relative;
    overflow: hidden;
}
.home-redesign-container .hero-text h1 {
    font-size: 34px; line-height: 1.4; color: #111827; margin-bottom: 14px; font-weight: 800;
}
.home-redesign-container .hero-text h1 .blue { color: #2f6feb; }
.home-redesign-container .hero-text p.desc {
    font-size: 15px; color: #6b7280; line-height: 1.7; margin-bottom: 30px; max-width: 460px;
}
.home-redesign-container .hero-actions { display: flex; gap: 14px; margin-bottom: 30px; }
.home-redesign-container .btn-primary {
    display: inline-block; background: #2f6feb; color: #fff;
    padding: 14px 34px; border-radius: 999px; text-decoration: none;
    font-size: 15px; font-weight: 600; box-shadow: 0 10px 24px rgba(47, 111, 235, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.home-redesign-container .btn-primary:hover {
    transform: translateY(-3px); box-shadow: 0 14px 30px rgba(47, 111, 235, 0.45);
}
.home-redesign-container .btn-outline {
    display: inline-block; background: transparent; color: #2f6feb;
    padding: 14px 34px; border-radius: 999px; text-decoration: none;
    font-size: 15px; font-weight: 600; border: 2px solid #2f6feb;
    transition: all 0.25s ease;
}
.home-redesign-container .btn-outline:hover { background: #2f6feb; color: #fff; }

/* Hero 统计数据 */
.home-redesign-container .hero-stats { display: flex; gap: 30px; }
.home-redesign-container .hero-stats div { display: flex; flex-direction: column; }
.home-redesign-container .hero-stats strong { font-size: 24px; color: #111827; font-weight: 800; }
.home-redesign-container .hero-stats span { font-size: 13px; color: #6b7280; }

/* Hero 插画 (直接搬过来的CSS) */
.home-redesign-container .hero-illustration { position: relative; height: 340px; }
.home-redesign-container .desk {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    width: 340px; height: 18px; background: #2f6feb; border-radius: 10px; z-index: 2;
}
.home-redesign-container .desk::before,
.home-redesign-container .desk::after {
    content: ""; position: absolute; bottom: -50px; width: 10px; height: 50px; background: #2f6feb; border-radius: 0 0 6px 6px;
}
.home-redesign-container .desk::before { left: 20px; }
.home-redesign-container .desk::after { right: 20px; }
.home-redesign-container .laptop {
    position: absolute; bottom: 58px; left: 50%; transform: translateX(-60%);
    width: 180px; height: 110px; background: #ffffff; border: 10px solid #1f2937; border-radius: 14px; z-index: 3;
}
.home-redesign-container .laptop-screen {
    width: 100%; height: 100%; background: linear-gradient(135deg, #dcebff, #b6d4ff); border-radius: 6px; position: relative; overflow: hidden;
}
.home-redesign-container .laptop-screen::before {
    content: ""; position: absolute; top: 18px; left: 18px; width: 36px; height: 36px; background: #ffd166; border-radius: 4px;
}
.home-redesign-container .laptop-screen::after {
    content: ""; position: absolute; top: 18px; left: 62px; width: 80px; height: 14px; background: #2f6feb; border-radius: 3px; box-shadow: 0 26px 0 #2f6feb;
}
.home-redesign-container .chair { position: absolute; bottom: 0; left: 50%; transform: translateX(-10%); width: 90px; height: 110px; z-index: 1; }
.home-redesign-container .chair-back { width: 50px; height: 70px; background: #c7dafc; border-radius: 20px 20px 8px 8px; margin: 0 auto; }
.home-redesign-container .chair-seat { width: 70px; height: 14px; background: #a4c2f4; border-radius: 6px; margin: -6px auto 0; }
.home-redesign-container .cup { position: absolute; bottom: 76px; left: 22%; width: 26px; height: 30px; background: #ffffff; border: 6px solid #2f6feb; border-radius: 0 0 14px 14px; z-index: 4; }
.home-redesign-container .book { position: absolute; bottom: 72px; left: 42%; width: 90px; height: 14px; background: #ffffff; border-radius: 4px; transform: rotate(-18deg); z-index: 4; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); }
.home-redesign-container .book::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: repeating-linear-gradient(90deg, #2f6feb 0, #2f6feb 4px, transparent 4px, transparent 10px); border-radius: 4px; opacity: 0.5; }
.home-redesign-container .calendar { position: absolute; bottom: 76px; right: 20%; width: 46px; height: 54px; background: #ffffff; border: 6px solid #2f6feb; border-radius: 8px; z-index: 4; }
.home-redesign-container .calendar::before { content: ""; position: absolute; top: 8px; left: 6px; right: 6px; height: 4px; background: #2f6feb; box-shadow: 0 10px 0 #2f6feb; }
.home-redesign-container .float-card { position: absolute; background: #ffffff; border-radius: 14px; box-shadow: 0 10px 30px rgba(47, 111, 235, 0.12); display: flex; align-items: center; justify-content: center; font-size: 28px; z-index: 5; }
.home-redesign-container .float-card.blue { width: 70px; height: 80px; top: 40px; left: 42%; background: linear-gradient(135deg, #dcebff, #b6d4ff); }
.home-redesign-container .float-card.yellow { width: 54px; height: 64px; top: 20px; left: 18%; background: linear-gradient(135deg, #fff3cd, #ffe066); }
.home-redesign-container .float-card.pink { width: 54px; height: 64px; top: 30px; right: 18%; background: linear-gradient(135deg, #ffd6e0, #ff9ebb); }
.home-redesign-container .check-badge { position: absolute; bottom: 90px; left: 8%; width: 44px; height: 44px; background: #34d399; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; z-index: 5; box-shadow: 0 8px 20px rgba(52, 211, 153, 0.4); }

/* 下方功能卡片 */
.home-redesign-container .features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 28px; }
.home-redesign-container .feature-card {
    background: #ffffff; border-radius: 22px; padding: 28px; display: flex; justify-content: space-between; align-items: flex-start;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04); transition: transform 0.3s ease, box-shadow 0.3s ease; border: 1px solid #eef2f7;
}
.home-redesign-container .feature-card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(47, 111, 235, 0.12); }
.home-redesign-container .feature-text { flex: 1; margin-right: 16px; }
.home-redesign-container .feature-text h3 { font-size: 18px; color: #111827; margin: 0 0 12px 0; }
.home-redesign-container .feature-icon { width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 30px; flex-shrink: 0; }
.home-redesign-container .icon-blue { background: linear-gradient(135deg, #dcebff, #b6d4ff); }
.home-redesign-container .icon-orange { background: linear-gradient(135deg, #ffe4c4, #ffb37a); }
.home-redesign-container .icon-pink { background: linear-gradient(135deg, #ffd6e0, #ff9ebb); }

/* 迷你列表样式 (公告与资料) */
.home-redesign-container .mini-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.home-redesign-container .mini-item { display: flex; align-items: center; justify-content: space-between; text-decoration: none; font-size: 13px; color: #4b5563; padding: 6px 0; border-bottom: 1px dashed #e5e7eb; transition: color 0.2s; }
.home-redesign-container .mini-item:hover { color: #2f6feb; }
.home-redesign-container .mini-item .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 10px; }
.home-redesign-container .mini-item .date { color: #9ca3af; font-size: 12px; flex-shrink: 0; }
.home-redesign-container .tag-red { background: #fee2e2; color: #b91c1c; padding: 2px 6px; border-radius: 4px; font-size: 11px; margin-right: 6px; flex-shrink: 0; }
.home-redesign-container .btn-text { color: #2f6feb; text-decoration: none; font-size: 14px; font-weight: 600; }
.home-redesign-container .btn-text:hover { text-decoration: underline; }

/* 响应式 */
@media (max-width: 968px) {
    .home-redesign-container .hero { grid-template-columns: 1fr; padding: 40px 24px; text-align: center; }
    .home-redesign-container .hero-actions { justify-content: center; }
    .home-redesign-container .hero-stats { justify-content: center; }
    .home-redesign-container .hero-illustration { display: none; /* 手机端简化隐藏插画 */ }
    .home-redesign-container .features { grid-template-columns: 1fr; padding: 0 20px; }
    .home-navbar-wrapper .nav-menu { display: none; }
}
/* =========================================================
   🎨 全站全局主题：卡通立体奶油风 
   ========================================================= */
:root {
    --theme-bg: #fcf9f2;          /* 奶油色主背景 */
    --theme-primary: #5b7cfa;     /* 活力亮蓝 */
    --theme-primary-hover: #4a6ae6;
    --theme-text-main: #1f2329;   /* 近黑色主文字 */
    --theme-text-sub: #646a73;    /* 灰色副文字 */
    --theme-card-bg: #ffffff;     /* 卡片纯白 */
    --theme-border: #f0f2f5;      /* 极浅边框 */
    
    /* 柔和的立体阴影，不再死黑 */
    --shadow-soft: 0 8px 24px rgba(28, 31, 35, 0.04);
    --shadow-hover: 0 16px 32px rgba(91, 124, 250, 0.12);
    --shadow-btn: 0 8px 20px rgba(91, 124, 250, 0.3);
    
    --radius-card: 24px;          /* 大圆角 */
    --radius-btn: 999px;          /* 药丸按钮 */
    --radius-input: 12px;
}

/* 🆕 全局背景和文字：仅对前台页面应用背景图 */
body:not(.admin-body):not(.scan-body):not(.scanpay-body):not(.rules-body) {
    background-color: #fcf9f2 !important;
    color: #1f2329 !important;
    
    /* 强效覆盖：使用绝对路径，并叠加 85% 透明度的奶油色遮罩 */
    background-image: linear-gradient(rgba(252, 249, 242, 0.85), rgba(252, 249, 242, 0.85)), url('/uploads/qrcodes/bg.jpg') !important; 
    background-size: cover !important;
    background-position: center center !important;
    background-attachment: fixed !important; 
    background-repeat: no-repeat !important;
}

/* 卡片立体化：纯白底 + 大圆角 + 柔和阴影 */
.card, .auth-box, .feature-card, .plan-body, .photo-card {
    background: var(--theme-card-bg) !important;
    border-radius: var(--radius-card) !important;
    border: 1px solid var(--theme-border) !important;
    box-shadow: var(--shadow-soft) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.card:hover, .feature-card:hover, .plan:hover .plan-body, .photo-card:hover {
    box-shadow: var(--shadow-hover) !important;
    transform: translateY(-4px);
}

/* 按钮立体化：药丸型 + 彩色阴影 */
.btn, .btn-primary, .btn-login {
    border-radius: var(--radius-btn) !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    padding: 10px 24px !important;
    transition: all 0.25s ease !important;
}
.btn:not(.btn-ghost):not(.btn-ok):not(.btn-danger), 
.btn-primary, 
.btn-login {
    background: var(--theme-primary) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: var(--shadow-btn) !important;
}
.btn:not(.btn-ghost):hover, .btn-primary:hover, .btn-login:hover {
    background: var(--theme-primary-hover) !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 25px rgba(91, 124, 250, 0.4) !important;
}
.btn-ghost {
    background: #f0f4ff !important;
    color: var(--theme-primary) !important;
    border: 2px solid transparent !important;
}
.btn-ghost:hover {
    background: #ffffff !important;
    border-color: #f0f4ff !important;
    box-shadow: var(--shadow-soft) !important;
}

/* 输入框立体化 */
.input, input[type="datetime-local"], select.input, textarea.input {
    border-radius: var(--radius-input) !important;
    border: 2px solid #eef2f7 !important;
    background: #f8fafc !important;
    padding: 12px 16px !important;
    color: var(--theme-text-main) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important;
    transition: all 0.2s !important;
}
.input:focus {
    background: #ffffff !important;
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 4px rgba(91, 124, 250, 0.1) !important;
}

/* 标签和提示 */
.tag, .tag-red, .tag-yellow {
    border-radius: 8px !important;
    padding: 4px 10px !important;
    font-weight: 600 !important;
    border: none !important;
}
/* =========================================================
   🪑 座位专属 3D 质感重写
   ========================================================= */

/* 1. 在线选座页的座位 */
.seat-layout-body {
    border-radius: 12px !important;
    box-shadow: 0 4px 0 #cbd5e1, 0 6px 10px rgba(0,0,0,0.05) !important; /* 模拟3D底座 */
    border: none !important;
    transform: translateY(-2px);
    transition: all 0.1s !important;
}
/* 选中的座位 */
.seat-layout-seat.active .seat-layout-body {
    background: linear-gradient(135deg, #5b7cfa, #7b93ff) !important;
    box-shadow: 0 2px 0 #3a55c9, 0 4px 8px rgba(91,124,250,0.4) !important; /* 按下时的立体感 */
    transform: translateY(2px);
}
/* 使用中的座位（浅灰底座） */
.seat-layout-seat.busy .seat-layout-body {
    background: #f1f5f9 !important;
    box-shadow: 0 2px 0 #cbd5e1 !important;
    color: #94a3b8 !important;
    transform: translateY(0);
}

/* 2. layout.php 全景图的座位 */
.seat {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 4px 0 #cbd5e1, 0 4px 10px rgba(0,0,0,0.04) !important;
    transform: translateY(-2px);
    transition: all 0.15s !important;
}
.seat.free:hover {
    box-shadow: 0 4px 0 #5b7cfa, 0 8px 16px rgba(91,124,250,0.2) !important;
    transform: translateY(-4px) !important;
}
.seat.occupied {
    background: #f1f5f9 !important;
    box-shadow: 0 2px 0 #cbd5e1 !important;
    transform: translateY(0) !important;
}
.seat.expiring {
    background: #fff7ed !important;
    color: #ea580c !important;
    box-shadow: 0 4px 0 #fdba74 !important;
}

/* 设施也变成 3D 小色块 */
.facility {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 3px 0 rgba(0,0,0,0.1) !important;
    transform: translateY(-2px);
}