:root {
  --bg: #0c0e13;
  --bg-2: #11141c;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f7;
  --muted: #9aa3b4;
  --muted-2: #6b7385;
  --gold: #c8a24a;
  --gold-2: #e7cd86;
  --gold-soft: rgba(200, 162, 74, 0.14);
  --danger: #e0616b;
  --warn: #e6a23c;
  --ok: #5fbf8f;
  --blue: #6aa0ff;
  --green: #5fbf8f;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --serif: "Noto Serif SC", "Songti SC", "Georgia", serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(200, 162, 74, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(80, 120, 200, 0.07), transparent 55%),
    var(--bg);
}

a { color: var(--gold-2); text-decoration: none; }
button { font-family: inherit; }

/* ---------- generic ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  color: #1a1408;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(200,162,74,0.25);
}
.btn-primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { border-color: rgba(224,97,107,0.5); color: var(--danger); background: rgba(224,97,107,0.08); }
.btn-danger:hover { background: rgba(224,97,107,0.16); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

.input {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 15px;
  border-radius: 11px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input::placeholder { color: var(--muted-2); }
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; letter-spacing: .02em; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
  background: rgba(255,255,255,0.03);
}
.tag.gold { color: var(--gold-2); border-color: rgba(200,162,74,0.35); background: var(--gold-soft); }

.empty {
  text-align: center; color: var(--muted-2); padding: 60px 20px; font-size: 15px;
}

/* ---------- LOGIN ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.login-brand {
  position: relative;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(700px 500px at 20% 15%, rgba(200,162,74,0.18), transparent 60%),
    linear-gradient(160deg, #15171f 0%, #0a0c11 100%);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 39.5h40M39.5 0v40' stroke='%23ffffff' stroke-opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
}
.brand-logo { display: flex; align-items: center; gap: 14px; z-index: 1; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  display: grid; place-items: center; color: #1a1408; font-weight: 700; font-size: 20px;
  font-family: var(--serif); box-shadow: 0 8px 20px rgba(200,162,74,0.3);
}
.brand-name { font-family: var(--serif); font-size: 22px; letter-spacing: .04em; }
.brand-sub { color: var(--muted); font-size: 13px; margin-top: 3px; letter-spacing: .12em; text-transform: uppercase; }
.brand-hero { z-index: 1; }
.brand-hero h1 {
  font-family: var(--serif); font-weight: 600; font-size: 40px; line-height: 1.25; margin: 0 0 18px;
  background: linear-gradient(180deg, #fff, #cdd3df);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-hero p { color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 420px; }
.brand-foot { z-index: 1; color: var(--muted-2); font-size: 12px; letter-spacing: .08em; }

.login-form {
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.form-card {
  width: 100%; max-width: 380px;
  animation: fadeUp .6s ease both;
}
.form-card h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0 0 6px; }
.form-card .hint { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.role-toggle { display: flex; gap: 8px; margin-bottom: 22px; padding: 4px; background: rgba(0,0,0,0.25); border: 1px solid var(--border); border-radius: 12px; }
.role-toggle button {
  flex: 1; border: none; background: transparent; color: var(--muted);
  padding: 10px; border-radius: 9px; cursor: pointer; font-size: 14px; transition: all .2s ease;
}
.role-toggle button.active { background: var(--gold-soft); color: var(--gold-2); font-weight: 600; }
.form-msg { font-size: 13px; margin: 4px 0 14px; min-height: 18px; }
.form-msg.err { color: var(--danger); }
.form-msg.ok { color: var(--ok); }
.switch-line { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.switch-line a { color: var(--gold-2); text-decoration: none; font-weight: 600; margin-left: 4px; cursor: pointer; }
.switch-line a:hover { text-decoration: underline; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- APP (viewer) ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 1px solid var(--border);
  background: rgba(10,12,17,0.78); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .left { display: flex; align-items: center; gap: 14px; }
.topbar .brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  display: grid; place-items: center; color: #1a1408; font-weight: 700; font-size: 18px;
  font-family: var(--serif); box-shadow: 0 0 20px rgba(200,162,74,0.35);
}
.topbar .brand-name { font-family: var(--serif); font-size: 17px; letter-spacing: .04em; font-weight: 600; }
.topbar .right { display: flex; align-items: center; gap: 16px; }
.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--muted); font-size: 18px; cursor: pointer;
  align-items: center; justify-content: center;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,0.10); color: var(--text); }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 5px 5px 6px; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  display: grid; place-items: center; color: #1a1408; font-weight: 700; font-size: 12px;
}

.layout { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 67px); }
.sidebar {
  border-right: 1px solid var(--border); padding: 22px 14px;
  background: rgba(255,255,255,0.018);
}
.sidebar .nav-title { font-size: 11px; color: var(--muted-2); letter-spacing: .14em; text-transform: uppercase; margin: 0 12px 10px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; color: var(--muted); cursor: pointer;
  font-size: 14px; transition: all .15s ease; margin-bottom: 4px;
  position: relative; overflow: hidden;
}
.nav-item::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; border-radius: 0 3px 3px 0;
  background: var(--gold-2); transition: height .2s ease;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active { background: rgba(200,162,74,0.12); color: var(--gold-2); font-weight: 600; }
.nav-item.active::before { height: 18px; }
.nav-item .ic {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255,255,255,0.06); font-size: 13px; flex-shrink: 0;
}
.nav-item.active .ic { background: var(--gold-soft); }
.nav-item.has-children { justify-content: space-between; }
.nav-arrow {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-size: 10px; color: var(--muted-2); margin-left: auto;
  transition: all .15s ease;
}
.nav-item:hover .nav-arrow { background: rgba(255,255,255,0.06); color: var(--text); }
.nav-children { padding-left: 8px; margin: 0 0 8px 16px; }
.nav-child { padding: 8px 10px; font-size: 13px; margin-bottom: 2px; }
.nav-child .nav-arrow { font-size: 10px; }
.nav-grandchildren { padding-left: 8px; margin: 0 0 6px 14px; }
.nav-grandchild { padding: 7px 10px; font-size: 12px; margin-bottom: 2px; color: var(--muted-2); }
.nav-grandchild.active { color: var(--gold-2); font-weight: 600; }
.nav-grandchild.file-leaf { display: flex; align-items: center; gap: 8px; color: var(--muted-2); }
.nav-grandchild.file-leaf .file-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--muted-2); flex-shrink: 0;
}
.nav-grandchild.file-leaf.active .file-dot { background: var(--gold-2); }
.nav-grandchild.file-leaf span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 25;
}

.content { padding: 28px 32px; }
.content-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.content-head h1 { font-family: var(--serif); font-size: 28px; font-weight: 600; margin: 0; }
.content-head .count { color: var(--muted); font-size: 14px; }
.content-head .stats { display: flex; gap: 18px; color: var(--muted-2); font-size: 13px; margin-top: 6px; }
.content-head .stats span { display: flex; align-items: center; gap: 6px; }
.content-head .stats b { color: var(--text); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: transform .22s ease, border-color .2s ease, background .2s ease, box-shadow .25s ease;
  position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--panel-2);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35), 0 0 0 1px rgba(200,162,74,0.08);
}
.card-stripe {
  height: 4px; width: 100%;
}
.card-stripe.audio { background: linear-gradient(90deg, #5fbf8f, #7dd6ac); }
.card-stripe.ppt { background: linear-gradient(90deg, #6aa0ff, #94baff); }
.card-stripe.software { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.card-stripe.group { background: linear-gradient(90deg, rgba(255,255,255,0.35), rgba(255,255,255,0.08)); }

.card.group .card-icon {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-strong);
  color: var(--gold-2);
}
.card-bg-icon {
  position: absolute;
  right: -10px;
  bottom: -24px;
  font-size: 120px;
  line-height: 1;
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
  transform: rotate(-8deg);
}
.card.audio .card-bg-icon { color: #5fbf8f; opacity: 0.08; }
.card.ppt .card-bg-icon { color: #6aa0ff; opacity: 0.08; }
.card.software .card-bg-icon { color: var(--gold); opacity: 0.10; }

@media (max-width: 900px) {
  .card-bg-icon { font-size: 90px; right: -6px; bottom: -18px; }
}
.card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card .card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.card-icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border); flex-shrink: 0;
}
.card.audio .card-icon { background: rgba(95,191,143,0.12); border-color: rgba(95,191,143,0.25); }
.card.ppt .card-icon { background: rgba(106,160,255,0.12); border-color: rgba(106,160,255,0.25); }
.card.software .card-icon { background: var(--gold-soft); border-color: rgba(200,162,74,0.25); }
.card h3 { font-size: 15px; margin: 0 0 6px; font-weight: 600; line-height: 1.4; }
.card .meta { color: var(--muted-2); font-size: 12px; }
.card .desc {
  color: var(--muted); font-size: 13px; line-height: 1.6; margin: 12px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .badge { font-size: 11px; padding: 3px 9px; }
.card-actions { margin-top: auto; padding-top: 16px; }
.card-dl {
  width: 100%; border: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  color: #1a1408; font-weight: 600;
}
.card-dl:hover { filter: brightness(1.06); }

/* ---------- MODAL ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(4,5,8,0.78); backdrop-filter: blur(10px);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 30px;
}
.modal-back.show { display: flex; animation: fadeUp .25s ease both; }
.modal {
  width: 100%; max-width: 860px; max-height: 88vh; overflow: auto;
  background: linear-gradient(180deg, #13161f 0%, #0b0d12 100%);
  border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: rgba(19,22,31,0.92); backdrop-filter: blur(10px); z-index: 2;
}
.modal-head h3 { font-family: var(--serif); font-size: 18px; margin: 0; }
.modal-body { padding: 26px; }
.close-x {
  width: 32px; height: 32px; border-radius: 9px; border: none; background: rgba(255,255,255,0.05);
  color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; display: grid; place-items: center;
}
.close-x:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.player-wrap { display: flex; flex-direction: column; gap: 18px; }
.audio-warn { background: rgba(196, 142, 47, 0.12); border: 1px solid rgba(196, 142, 47, 0.4); color: var(--gold-2); border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.7; }
.sub-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.subtitle-box { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 8px 4px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.subtitle-box .cue { padding: 10px 14px; border-radius: 11px; font-size: 15px; line-height: 1.7; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; border: 1px solid transparent; }
.subtitle-box .cue:hover { background: rgba(255,255,255,0.04); }
.subtitle-box .cue.active { background: rgba(37,99,235,0.18); color: #cfe0ff; border-color: rgba(106,160,255,0.5); font-weight: 500; }

audio { width: 100%; border-radius: 12px; }
audio::-webkit-media-controls-download-button { display: none !important; }
audio::-webkit-media-controls-enumeration-button { display: none !important; }

.slides { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.slides img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #fff; cursor: zoom-in; }
.slide-hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: -2px; }
.slide-nav { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 8px; }

/* 全屏查看幻灯片（全屏整个 .slides 容器，导航按钮仍可见） */
.slides:fullscreen {
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; width: 100vw; height: 100vh; padding: 0;
}
.slides:fullscreen img {
  max-width: 100vw; max-height: 82vh; width: auto; height: auto; object-fit: contain;
  border-radius: 0; border: none; background: #fff; cursor: pointer;
}
.slides:fullscreen .slide-nav { margin-top: 0; }

.software-detail {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px;
  padding: 16px 10px;
}
.software-detail .card-icon { width: 72px; height: 72px; font-size: 34px; }
.software-detail h3 { font-family: var(--serif); font-size: 22px; margin: 0; }
.software-detail .meta { color: var(--muted); font-size: 14px; }
.software-detail p { color: var(--muted); line-height: 1.8; font-size: 14px; max-width: 420px; }
.software-detail .modal-dl { align-self: center; padding: 12px 28px; }

/* ---------- ADMIN ---------- */
.admin-layout { min-height: calc(100vh - 67px); }
.admin-sidebar { padding-top: 26px; }
.admin-view { display: none; }
.admin-view.active { display: block; }
.admin-view .content-head { margin-bottom: 20px; }
.admin-grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
}
.panel h2 { font-family: var(--serif); font-size: 20px; margin: 0 0 18px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.admin-table th { color: var(--muted); font-weight: 500; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.admin-table td .mono { font-family: ui-monospace, monospace; color: var(--muted); font-size: 12px; }
.section-title { font-family: var(--serif); font-size: 18px; margin: 26px 0 14px; }

.admin-cat-tabs { display: flex; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.admin-cat-tab {
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 18px; font-size: 14px; cursor: pointer; transition: all .2s;
}
.admin-cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.admin-cat-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.admin-cat-section { margin-bottom: 22px; }
.admin-cat-header { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px 4px; }
.admin-cat-name { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--text); }
.admin-cat-count { color: var(--muted); font-size: 13px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0;
  transition: all .25s ease; z-index: 80; font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(95,191,143,0.5); }
.toast.err { border-color: rgba(224,97,107,0.5); }

/* ---------- HOMEPAGE HERO ---------- */
.hero {
  min-height: 0;
  padding: 5vh 28px 60px;
  position: relative;
}
.hero-glow {
  position: absolute; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,162,74,0.16) 0%, transparent 65%);
  top: 40%; left: 55%; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 0;
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-left {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img {
  width: 100%;
  max-width: 520px;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.45));
  user-select: none;
  -webkit-user-drag: none;
}
.hero-label {
  align-self: flex-start;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-2);
  border: 1px solid rgba(200,162,74,0.35); padding: 7px 16px; border-radius: 999px;
  background: var(--gold-soft);
}
.hero-title {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 600;
  margin: 0;
  letter-spacing: .04em;
  line-height: 1.25;
  background: linear-gradient(180deg, #fff, #d6dbe7);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-motto {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 540px;
}
.motto-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: var(--text);
  font-family: var(--serif);
  letter-spacing: .04em;
}
.motto-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(200,162,74,0.15);
  flex-shrink: 0;
}
.hero-footer {
  color: var(--muted-2); font-size: 13px; letter-spacing: .04em;
}

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .layout { grid-template-columns: 1fr; }
  .mobile-menu-btn { display: inline-flex; margin-left: 8px; }
  .mobile-overlay.show { display: block; }
  .sidebar {
    display: block; position: fixed; left: 0; top: 0; bottom: 0;
    width: 260px; max-width: 80vw; z-index: 30;
    transform: translateX(-100%); transition: transform .25s ease;
    background: var(--bg-2); border-right: 1px solid var(--border);
    padding-top: 70px;
  }
  .sidebar.open { transform: translateX(0); }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-view { display: block !important; }
  .hero { padding: 32px 20px 40px; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-left { text-align: center; align-items: center; }
  .hero-label { align-self: center; }
  .hero-title { font-size: 34px; }
  .hero-motto { max-width: 100%; padding: 22px 24px; }
  .motto-item { font-size: 15px; }
  .hero-img { max-width: 320px; }
}

/* ---------- LIGHT THEME (app.html) ---------- */
body.app-light {
  --bg: #f8fafc;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --gold-soft: rgba(200, 162, 74, 0.12);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  color: var(--text);
}

body.app-light .topbar {
  background: rgba(255,255,255,0.88);
  border-bottom-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
  backdrop-filter: blur(10px);
}
body.app-light .brand-name { color: #0f172a; font-weight: 600; }
body.app-light .user-chip { color: #64748b; }
body.app-light .avatar { background: linear-gradient(135deg, #2563eb, #60a5fa); color: #fff; }

body.app-light .sidebar {
  background: #ffffff;
  border-right-color: #e2e8f0;
}
body.app-light .mobile-menu-btn { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
body.app-light .mobile-menu-btn:hover { background: #e2e8f0; color: #0f172a; }
body.app-light .nav-title { color: #94a3b8; }
body.app-light .nav-item { color: #475569; position: relative; }
body.app-light .nav-item:hover { background: #f1f5f9; color: #0f172a; }
body.app-light .nav-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
body.app-light .nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: #2563eb;
}
body.app-light .nav-arrow { color: #94a3b8; }
body.app-light .nav-children,
body.app-light .nav-grandchildren { border-left-color: #e2e8f0; }
body.app-light .file-dot { background: #cbd5e1; }
body.app-light .nav-grandchild.active .file-dot { background: #2563eb; }

body.app-light .content-head h1 { color: #0f172a; }
body.app-light .content-head .count { color: #64748b; }
body.app-light .stats { color: #64748b; }
body.app-light .stats b { color: #0f172a; }

body.app-light .card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px rgba(15,23,42,0.06);
}
body.app-light .card:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15,23,42,0.10);
}
body.app-light .card-icon { background: #f8fafc; border-color: #e2e8f0; }
body.app-light .card.audio .card-icon { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
body.app-light .card.ppt .card-icon { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
body.app-light .card.software .card-icon { background: #fffbeb; border-color: #fde68a; color: #d97706; }
body.app-light .card.group .card-icon { background: #f8fafc; border-color: #e2e8f0; color: #2563eb; }
body.app-light .card h3 { color: #0f172a; }
body.app-light .card .meta { color: #64748b; }
body.app-light .card .desc { color: #475569; }
body.app-light .card-bg-icon { opacity: 0.05; }

body.app-light .modal-back { background: rgba(15,23,42,0.55); }
body.app-light .modal { background: #ffffff; border-color: #e2e8f0; }
body.app-light .modal-head { background: rgba(255,255,255,0.95); border-bottom-color: #e2e8f0; }
body.app-light .close-x { background: #f1f5f9; color: #64748b; }
body.app-light .close-x:hover { background: #e2e8f0; color: #0f172a; }

body.app-light .audio-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
body.app-light .subtitle-box { border-color: #e2e8f0; }
body.app-light .subtitle-box .cue { color: #475569; }
body.app-light .subtitle-box .cue:hover { background: #f8fafc; }
body.app-light .subtitle-box .cue.active { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
body.app-light .slides img { border-color: #e2e8f0; }
body.app-light .software-detail .card-icon { background: #fffbeb; border-color: #fde68a; color: #d97706; }
body.app-light .empty { color: #64748b; }

body.app-light .btn { background: #f1f5f9; border-color: #e2e8f0; color: #0f172a; }
body.app-light .btn:hover { background: #e2e8f0; }
body.app-light .btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); border-color: transparent; color: #fff; }
body.app-light .btn-primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, #2563eb, #3b82f6); }
body.app-light .btn-ghost { background: transparent; border-color: transparent; color: #64748b; }
body.app-light .btn-ghost:hover { background: #f1f5f9; color: #0f172a; }
body.app-light .btn-outline { background: #fff; border-color: #cbd5e1; color: #0f172a; }
body.app-light .btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }
body.app-light .btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 12px; }

/* Light theme hero */
body.app-light .hero {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 50%, #f8fafc 100%);
  overflow: hidden;
  padding: 0;
}
body.app-light .hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 700px at 85% 15%, rgba(37,99,235,0.08), transparent 60%),
    radial-gradient(700px 500px at 5% 90%, rgba(200,162,74,0.08), transparent 55%);
  pointer-events: none;
}
body.app-light .hero-inner {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: 72px 32px 56px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center;
}
body.app-light .hero-left { text-align: left; display: flex; flex-direction: column; gap: 22px; }
body.app-light .hero-right { display: flex; align-items: center; justify-content: center; }
body.app-light .hero-tag {
  align-self: flex-start;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: #2563eb; font-weight: 600;
  border: 1px solid #bfdbfe; padding: 7px 16px; border-radius: 999px;
  background: #eff6ff;
}
body.app-light .hero-title {
  font-family: var(--serif);
  font-size: 48px; font-weight: 600; margin: 0;
  letter-spacing: .02em; line-height: 1.22;
  color: #0f172a;
  background: none; -webkit-text-fill-color: initial;
}
body.app-light .hero-accent { color: #2563eb; }
body.app-light .hero-lead { color: #475569; font-size: 18px; line-height: 1.75; margin: 0; max-width: 540px; }
body.app-light .hero-bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
body.app-light .hero-bullets li { display: flex; align-items: center; gap: 12px; color: #334155; font-size: 15px; }
body.app-light .check {
  width: 20px; height: 20px; border-radius: 50%; background: #2563eb; color: #fff;
  display: grid; place-items: center; font-size: 12px; flex-shrink: 0;
}
body.app-light .hero-actions { display: flex; gap: 14px; margin-top: 6px; }
body.app-light .hero-img {
  width: 100%; max-width: 560px;
  filter: drop-shadow(0 30px 60px rgba(15,23,42,0.14));
  user-select: none; -webkit-user-drag: none;
}

body.app-light .features { padding: 80px 32px; background: #f8fafc; }
body.app-light .section-head { text-align: center; max-width: 640px; margin: 0 auto 50px; }
body.app-light .section-head h2 { font-family: var(--serif); font-size: 34px; color: #0f172a; margin: 0 0 14px; }
body.app-light .section-head p { color: #64748b; font-size: 16px; line-height: 1.7; margin: 0; }
body.app-light .feature-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
body.app-light .feature-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 22px;
  padding: 34px; box-shadow: 0 4px 20px rgba(15,23,42,0.05);
  transition: transform .2s ease, box-shadow .2s ease;
}
body.app-light .feature-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(15,23,42,0.10); }
body.app-light .feature-icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; margin-bottom: 22px; }
body.app-light .feature-icon.audio { background: #f0fdf4; color: #16a34a; }
body.app-light .feature-icon.ppt { background: #eff6ff; color: #2563eb; }
body.app-light .feature-icon.software { background: #fffbeb; color: #d97706; }
body.app-light .feature-icon.video { background: #fdf2f8; color: #db2777; }
body.app-light .feature-card h3 { font-size: 20px; color: #0f172a; margin: 0 0 10px; }
body.app-light .feature-card p { color: #64748b; font-size: 15px; line-height: 1.7; margin: 0; }

body.app-light .trust { text-align: center; padding: 36px 32px; color: #94a3b8; font-size: 13px; background: #f8fafc; border-top: 1px solid #e2e8f0; }

@media (max-width: 900px) {
  body.app-light .hero-inner { grid-template-columns: 1fr; padding: 44px 24px 40px; gap: 36px; }
  body.app-light .hero-left { text-align: center; align-items: center; }
  body.app-light .hero-tag { align-self: center; }
  body.app-light .hero-title { font-size: 32px; }
  body.app-light .hero-lead { font-size: 16px; }
  body.app-light .hero-actions { justify-content: center; }
  body.app-light .hero-img { max-width: 340px; }
  body.app-light .features { padding: 56px 24px; }
  body.app-light .section-head h2 { font-size: 26px; }
  body.app-light .feature-grid { grid-template-columns: 1fr; }
}

/* ---------- REPORT STAT CARDS ---------- */
.stat-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.stat-num {
  font-size: 26px;
  font-weight: 600;
  color: var(--gold-2);
  line-height: 1.2;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- REPORT TABLE 汇总/人均 行 ---------- */
.admin-table tr.report-row-summary td {
  background: rgba(212, 175, 55, 0.08);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.admin-table tr.report-row-summary:first-child td {
  border-top: 2px solid var(--gold-2);
}
.admin-table tr.report-row-summary td strong {
  color: var(--gold-2);
  font-weight: 600;
}

/* ---------- REPORT FILTERS & SORTABLE HEADERS ---------- */
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sortable-th:hover { color: var(--gold-2); }
.sortable-th::after {
  content: '⇅';
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted-2);
  opacity: .5;
}
.sortable-th.sort-asc::after { content: '↑'; opacity: 1; color: var(--gold-2); }
.sortable-th.sort-desc::after { content: '↓'; opacity: 1; color: var(--gold-2); }

.report-filters {
  background: var(--panel-2);
}
.report-filters .input[type="date"] {
  color-scheme: dark;
}
#reportSeatOptions label,
#reportSeatDropdown > label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
#reportSeatOptions label:hover,
#reportSeatDropdown > label:hover {
  background: rgba(255,255,255,0.06);
}

body.app-light .report-filters {
  background: #f8fafc;
  border-color: #e2e8f0;
}
body.app-light .report-filters .input[type="date"] {
  color-scheme: light;
}

/* ---------- REPORT HEADER FILTER (表头筛选) ---------- */
.sortable-th[data-sort="seat"]::after { display: none; } /* 坐席列用筛选按钮代替排序箭头 */

.th-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  user-select: none;
  vertical-align: middle;
  line-height: 1;
}
.th-filter-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.th-filter-btn.active { color: #4f8cff; background: rgba(79,140,255,0.15); }

.header-filter-panel {
  position: fixed;
  z-index: 1200;
  min-width: 180px;
  max-height: 300px;
  overflow: auto;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  font-size: 13px;
  color: var(--text);
}
.header-filter-panel .hf-options label { border-radius: 6px; }
.header-filter-panel .hf-options label:hover { background: rgba(255,255,255,0.06); }
.header-filter-panel input[type="checkbox"] { accent-color: #4f8cff; }

body.app-light .header-filter-panel {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 12px 32px rgba(15,23,42,.15);
  color: #0f172a;
}
body.app-light .header-filter-panel .hf-options label:hover { background: #f1f5f9; }
body.app-light .th-filter-btn:hover { background: rgba(15,23,42,0.08); color: #0f172a; }
body.app-light .th-filter-btn.active { color: #2563eb; background: rgba(37,99,235,0.12); }
