﻿/* ================================================================
   错题整理 · 样式
   ================================================================ */
:root {
  --bg: #f4f5fa;
  --card: #ffffff;
  --ink: #1d2330;
  --ink-soft: #3d4557;
  --muted: #7b8496;
  --line: #e6e8f0;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef0ff;
  --accent: #0ea5e9;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(24, 30, 48, .05), 0 2px 8px rgba(24, 30, 48, .04);
  --shadow-md: 0 10px 30px rgba(30, 36, 60, .10);
  --shadow-lg: 0 24px 60px rgba(24, 30, 60, .18);
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --serif: "Songti SC", "SimSun", "Noto Serif SC", "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; }
::selection { background: #c7d2fe; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(230, 232, 240, .9);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #4338ca);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(79, 70, 229, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 17px; letter-spacing: .01em; }
.brand-text small { font-size: 11px; color: var(--muted); letter-spacing: .06em; }

.nav { display: flex; gap: 2px; margin-left: 10px; flex: 1; }
.nav a {
  padding: 8px 14px; border-radius: 10px; color: var(--ink-soft);
  font-size: 14px; font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: #eef0f7; }
.nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--ink-soft);
  box-shadow: var(--shadow-sm); transition: transform .12s, border-color .15s;
}
.cart-btn:hover { border-color: #c9cdf3; transform: translateY(-1px); }
.cart-btn .cart-count {
  font-style: normal; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 12px; display: grid; place-items: center; font-weight: 600;
}
.cart-btn .cart-count[data-zero="1"] { background: #c7cad8; }

/* ---------- 主区域 ---------- */
.view {
  flex: 1; width: 100%; max-width: 1180px; margin: 0 auto;
  padding: 26px 20px 70px; outline: none;
}
.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px max(20px, calc((100vw - 1180px) / 2));
  color: #98a0b3; font-size: 12px; border-top: 1px solid var(--line);
  background: #fff;
}
.footer-icp { width: 100%; text-align: center; margin-top: 6px; font-size: 11px; }
.footer-icp a { color: #98a0b3; text-decoration: none; }
.footer-icp a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- 首页 hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 34px 36px;
  background:
    radial-gradient(900px 260px at 88% -20%, rgba(99, 102, 241, .18), transparent 60%),
    radial-gradient(500px 220px at 106% 110%, rgba(14, 165, 233, .13), transparent 60%),
    linear-gradient(135deg, #ffffff, #f7f8ff 60%, #eef2ff);
  border: 1px solid #e7e9f7;
  box-shadow: var(--shadow-sm);
}
.hero h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.01em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.hero .stats { display: flex; gap: 26px; margin-top: 22px; flex-wrap: wrap; }
.hero .stats div { display: flex; flex-direction: column; line-height: 1.25; }
.hero .stats b { font-size: 24px; font-variant-numeric: tabular-nums; }
.hero .stats span { font-size: 12px; color: var(--muted); }
.hero .hero-actions { position: absolute; right: 34px; bottom: 30px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; max-width: 52%; }
.chip-exam { background: #fff8ed; border-color: #fde3bd; color: #92400e; }
.chip-exam:hover { border-color: #f6c66b; color: #7c3f00; }
.exam-notice { background: #fff7e6; color: #b45309; border: 1px solid #fde3bd; border-radius: 6px; padding: 1px 7px; }

.searchbar {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 8px; padding: 11px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.searchbar svg { color: var(--muted); flex: none; }
.searchbar input {
  border: 0; outline: 0; background: transparent; font: inherit; width: 100%;
  color: var(--ink);
}
.searchbar input::placeholder { color: #a6adbd; }
.searchbar kbd {
  flex: none; font-family: inherit; font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px;
}

.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 16px; margin: 30px 2px 14px;
}
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: .01em; }
.section-head .hint { color: var(--muted); font-size: 12.5px; }

/* ---------- 章节目录 ---------- */
.chapter {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 14px; overflow: hidden;
}
.chapter-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid #f0f1f7;
  background: linear-gradient(180deg, #fff, #fbfbfe);
}
.chapter-head .ch-no {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--brand-soft); color: var(--brand-dark);
}
.chapter-head h3 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.chapter-head .ch-count { color: var(--muted); font-size: 12.5px; }

.lesson-list { padding: 6px 10px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.lesson {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 11px; transition: background .14s;
}
.lesson:hover { background: #f5f6fd; }
.lesson .l-no {
  flex: none; min-width: 58px; font-variant-numeric: tabular-nums;
  font-weight: 600; color: var(--brand); font-size: 13.5px;
}
.lesson .l-title { flex: 1; font-size: 14px; color: var(--ink-soft); line-height: 1.45; }
.lesson .l-count { flex: none; font-size: 12px; color: var(--muted); }
.lesson .l-lock { flex: none; font-size: 10.5px; font-weight: 600; color: #b45309; background: #fff7e6; border: 1px solid #fde3bd; border-radius: 999px; padding: 1px 7px; }
.lesson.is-locked .l-title { color: #9aa1b2; }
.lesson.practice { background: #fffdf8; }
.lesson.practice:hover { background: #fff7e6; }
.lesson.practice .l-no { color: #b45309; }
.lesson.practice .l-go { color: #d6b98c; }
.practice-divider {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
  margin: 10px 12px 2px; font-size: 11.5px; color: #a58b62; letter-spacing: .04em;
}
.practice-divider::after { content: ""; flex: 1; height: 1px; background: #f2e6d2; }.lesson .l-go { flex: none; color: #c3c7d6; }
.lesson:hover .l-go { color: var(--brand); }

/* ---------- 面包屑 / 课时头部 ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { color: #c9cede; }
.lesson-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.lesson-head h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.01em; line-height: 1.35; }
.lesson-head .sub { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.lesson-head .sub b { color: var(--brand); font-weight: 600; }
.lesson-actions { display: flex; gap: 8px; flex: none; }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  position: sticky; top: 64px; z-index: 20;
  background: rgba(244, 245, 250, .92); backdrop-filter: blur(8px);
  padding: 10px 0 12px; margin-bottom: 6px;
}
.toolbar .grow { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; color: var(--ink-soft); transition: .15s;
}
.chip:hover { border-color: #c9cdf3; color: var(--brand-dark); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { font-variant-numeric: tabular-nums; opacity: .8; }

/* ---------- 题目卡片 ---------- */
.qlist { display: flex; flex-direction: column; gap: 12px; }
.qcard {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px 15px 56px;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, background .15s;
}
.qcard:hover { border-color: #d4d7ea; box-shadow: 0 6px 20px rgba(30, 36, 60, .07); }
.qcard.is-selected { border-color: #a5b4fc; background: linear-gradient(180deg, #fdfdff, #f7f8ff); box-shadow: 0 4px 18px rgba(79, 70, 229, .10); }
.q-check {
  position: absolute; left: 16px; top: 18px; width: 24px; height: 24px; border-radius: 8px;
  border: 1.6px solid #cfd3e3; background: #fff; display: grid; place-items: center;
  color: #fff; transition: .15s; cursor: pointer;
}
.qcard.is-selected .q-check { background: var(--brand); border-color: var(--brand); }
.q-check svg { opacity: 0; transform: scale(.6); transition: .15s; }
.qcard.is-selected .q-check svg { opacity: 1; transform: none; }
.q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.q-no { font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.tag {
  font-size: 11px; color: #6b7280; background: #f2f3f9; border-radius: 6px;
  padding: 1px 7px; letter-spacing: .02em;
}
.tag.type-multi { background: #fef3c7; color: #92400e; }
.tag.type-solve { background: #e0f2fe; color: #0369a1; }
.tag.type-fill { background: #f3e8ff; color: #7e22ce; }
.q-stem { color: var(--ink); line-height: 1.95; }
.q-stem .q-img.fig { display: block; margin: 10px auto; max-width: min(100%, 520px); height: auto !important; }
.q-stem .q-img.page { display: block; width: 100%; max-width: 100%; height: auto !important; margin: 8px auto; border: 1px solid #eef0f6; border-radius: 8px; background: #fff; }
.q-img.inline { display: inline-block; vertical-align: middle; max-width: 100%; margin: 0 1px; }
.q-stem table, .q-sol table { border-collapse: collapse; }
.q-table { border-collapse: collapse; margin: 8px auto; font-size: .92em; }
.q-table td { border: 1px solid #cbd0dd; padding: 3px 10px; text-align: center; vertical-align: middle; }
.q-opts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px;
  margin-top: 10px; color: var(--ink-soft);
}
.q-opts .opt { display: flex; gap: 6px; line-height: 1.9; }
.q-opts .opt b { color: #8b93a7; font-weight: 600; flex: none; }
.q-opts .opt .q-img { max-height: 90px; }

.answer-toggle {
  margin-top: 10px; border: 0; background: none; padding: 0;
  color: var(--brand); font-size: 13px; display: inline-flex; align-items: center; gap: 4px;
}
.answer-toggle:hover { text-decoration: underline; }
.q-answer {
  margin-top: 10px; border-radius: 10px; padding: 10px 14px;
  background: #f6fbf8; border: 1px solid #d9f0e5; font-size: 14px; color: #14532d;
}
.q-answer .lbl { font-weight: 700; margin-right: 6px; }
.q-answer .sol { color: #374151; margin-top: 4px; line-height: 1.85; }
.q-answer math { font-size: 1.06em; }
.q-answer .sol .q-img.fig { display: block; margin: 8px auto; max-width: min(100%, 480px); height: auto !important; }
.q-answer .sol .q-img.page { display: block; width: 100%; max-width: 100%; height: auto !important; margin: 8px auto; border: 1px solid #eef0f6; border-radius: 8px; background: #fff; }
.q-answer .math-block, .q-stem .math-block { display: block; margin: 6px 0; }
.q-src { color: #9aa1b2; font-size: 11.5px; margin-top: 8px; }

/* 空状态 */
.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  background: #fff; border: 1px dashed #dfe2ee; border-radius: var(--radius);
}
.empty h3 { margin: 0 0 6px; color: var(--ink-soft); font-size: 16px; }
.empty p { margin: 0 0 18px; font-size: 13.5px; }

/* ---------- 试卷列表 ---------- */
.papers-note {
  margin: 0 0 22px; padding: 13px 16px; border-radius: 12px;
  background: #fff8ed; border: 1px solid #fde3bd; color: #7c4a03;
  font-size: 13px; line-height: 1.75;
}
.papers-note b { color: #92400e; }
.paper-group h2 .g-note { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.p-kind.actual { background: #fef3c7; color: #92400e; }
.paper-card .p-desc { font-size: 12px; color: var(--muted); margin-top: -4px; }.paper-group { margin-bottom: 26px; }
.paper-group h2 { font-size: 16px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.paper-group h2 .bar { width: 4px; height: 16px; border-radius: 2px; background: var(--brand); }
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.paper-card {
  display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow-sm); transition: .15s;
}
.paper-card:hover { border-color: #c9cdf3; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.paper-card .p-kind { font-size: 11px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.paper-card h3 { font-size: 15px; margin: 0; line-height: 1.5; }
.paper-card .p-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }

/* ---------- 自助额外练习 ---------- */
.res-tip {
  margin: 0 0 4px; padding: 12px 16px; border-radius: 12px;
  background: #f0f9ff; border: 1px solid #dbeafe; color: #075985;
  font-size: 13px; line-height: 1.7;
}
.res-topics { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.res-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px; margin: 18px 0 34px;
}
.res-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
}
.res-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.res-topic {
  font-size: 11.5px; background: var(--brand-soft); color: var(--brand-dark);
  border-radius: 6px; padding: 2px 8px;
}
.res-date { font-size: 11.5px; color: var(--muted); }
.res-card h3 { margin: 0; font-size: 16px; line-height: 1.5; }
.res-desc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.res-files { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.res-dl {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 10px; padding: 9px 14px; font-size: 13.5px; font-weight: 500;
  transition: .15s;
}
.res-dl:hover { border-color: #a5b4fc; color: var(--brand-dark); background: #f7f8ff; }
.res-dl.primary { background: linear-gradient(135deg, #5b52ea, #4338ca); border-color: var(--brand); color: #fff; }
.res-dl.primary:hover { color: #fff; box-shadow: 0 6px 16px rgba(67, 56, 202, .25); }
.res-dl small { font-size: 11px; opacity: .72; font-weight: 400; }
.res-upload {
  margin: 26px 0 10px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 2px 18px 16px;
}
.res-upload summary {
  cursor: pointer; padding: 14px 0; font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.res-upload summary span { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 6px; }
.res-form { display: flex; flex-direction: column; gap: 12px; }
.res-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.res-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.res-form input:not([type="file"]) {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font: inherit; font-size: 13.5px; color: var(--ink); background: #fff; outline: none;
}
.res-form input:not([type="file"]):focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef0ff; }
.res-form input[type="file"] { font-size: 12.5px; color: var(--ink-soft); }
.res-form .btn-primary { width: auto; align-self: flex-start; padding: 10px 22px; }
/* ---------- 我的错题本 ---------- */
.book-group { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.book-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: #fbfbfe; border-bottom: 1px solid #f0f1f7; }
.book-head h3 { margin: 0; font-size: 14.5px; flex: 1; font-weight: 600; }
.book-head .n { color: var(--muted); font-size: 12.5px; }
.book-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 18px; border-top: 1px solid #f5f6fa; }
.book-item:first-child { border-top: 0; }
.book-item .b-no { font-weight: 700; color: var(--brand); flex: none; font-variant-numeric: tabular-nums; }
.book-item .b-body { flex: 1; min-width: 0; }
.book-item .b-stem { font-size: 14px; color: var(--ink-soft); line-height: 1.75; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.book-item .b-stem .q-img.fig { display: none; }
.book-item .b-stem math { font-size: 1em; }
.book-item .b-meta { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.book-item .b-del { border: 0; background: none; color: #b7bccb; padding: 2px; flex: none; }
.book-item .b-del:hover { color: #dc2626; }

/* ---------- 上传 ---------- */
.upload-wrap { max-width: 720px; margin: 0 auto; }
.upload-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow-sm); }
.upload-card h1 { margin: 0 0 8px; font-size: 22px; }
.upload-card > p { color: var(--muted); margin: 0 0 22px; font-size: 13.5px; }
.dropzone {
  border: 1.6px dashed #cdd3e8; border-radius: 14px; padding: 40px 20px;
  text-align: center; color: var(--muted); background: #fbfbff; transition: .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.dropzone b { display: block; color: var(--ink); margin-bottom: 4px; font-size: 15px; }
.dropzone .hint { font-size: 12px; margin-top: 8px; }
.upload-status { margin-top: 16px; font-size: 13.5px; }
.upload-status.ok { color: var(--ok); }
.upload-status.err { color: #b91c1c; }
.steps { margin-top: 24px; padding: 16px 18px; background: #f7f8fc; border-radius: 12px; font-size: 13px; color: var(--ink-soft); }
.steps b { display: block; margin-bottom: 6px; }
.steps ol { margin: 0; padding-left: 20px; }
.steps li { margin: 4px 0; }

/* ---------- 抽屉 ---------- */
.cart-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 390px; max-width: 92vw; z-index: 60;
  background: #fff; box-shadow: var(--shadow-lg); transform: translateX(105%);
  transition: transform .24s cubic-bezier(.22, .8, .3, 1); display: flex; flex-direction: column;
}
.cart-panel.open { transform: none; }
.cart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 18px; }
.cart-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--ink); }
.cart-body { flex: 1; overflow: auto; padding: 6px 20px; }
.cart-src { margin: 14px 0 6px; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; display: flex; justify-content: space-between; gap: 8px; }
.cart-src b { color: var(--ink-soft); font-weight: 600; }
.cart-q { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border-bottom: 1px dashed #eef0f6; font-size: 13px; }
.cart-q .cq-no { font-weight: 700; color: var(--brand); flex: none; }
.cart-q .cq-text { flex: 1; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.55; }
.cart-q .cq-del { border: 0; background: none; color: #b7bccb; padding: 0 2px; }
.cart-q .cq-del:hover { color: #dc2626; }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 20px 18px; background: #fcfcff; }
.field { margin-bottom: 12px; }
.field-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; background: #eceef6; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 7px 4px; font-size: 12.5px; color: var(--ink-soft); }
.seg button.is-on { background: #fff; color: var(--brand-dark); font-weight: 600; box-shadow: 0 1px 3px rgba(20, 24, 40, .1); }
.switch-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: #d9dce8; position: relative; transition: .16s; flex: none; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: .16s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { left: 16px; }
.btn-primary {
  width: 100%; border: 0; border-radius: 12px; padding: 12px;
  background: linear-gradient(135deg, #5b52ea, #4338ca); color: #fff;
  font-weight: 600; font-size: 14.5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 20px rgba(67, 56, 202, .28); transition: transform .12s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(67, 56, 202, .34); }
.btn-primary:disabled { background: #cbd0e2; box-shadow: none; cursor: not-allowed; transform: none; }
.btn-ghost { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 9px; width: 100%; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.btn-ghost:hover { color: var(--ink); border-color: #d4d7e6; }
.btn-danger:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.scrim { position: fixed; inset: 0; background: rgba(20, 24, 40, .35); z-index: 50; backdrop-filter: blur(2px); }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: #1d2330; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; z-index: 100;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 打开即登录 ---------- */
body.gated { overflow: hidden; }
body.gated .app { display: none; }
.gate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 18px; overflow-y: auto;
  background:
    radial-gradient(900px 500px at 15% 0%, #e8e9ff 0%, rgba(232,233,255,0) 60%),
    radial-gradient(700px 500px at 100% 100%, #e6f7f2 0%, rgba(230,247,242,0) 55%),
    #f7f8fc;
}
.gate[hidden] { display: none; }
.gate-card {
  width: 100%; max-width: 390px; background: #fff;
  border: 1px solid #eceef6; border-radius: 22px;
  padding: 34px 32px 26px; box-shadow: 0 24px 60px rgba(38, 44, 80, .13);
}
.gate-logo {
  width: 52px; height: 52px; border-radius: 15px; color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: grid; place-items: center; margin: 0 auto 16px;
  box-shadow: 0 10px 24px rgba(79, 70, 229, .28);
}
.gate-card h1 { margin: 0; text-align: center; font-size: 25px; letter-spacing: .02em; }
.gate-sub { margin: 6px 0 22px; text-align: center; color: var(--muted); font-size: 13px; }
.gate-tip { margin: 16px 0 0; color: #9aa1b2; font-size: 12px; line-height: 1.7; text-align: center; }
.gate-foot { margin-top: 18px; color: #a6acbd; font-size: 11.5px; letter-spacing: .06em; }
.gate .auth-form input { padding: 12px 13px; font-size: 14.5px; }
.gate .btn-primary { margin-top: 2px; }
@media (max-width: 480px) {
  .gate-card { padding: 28px 22px 22px; border-radius: 18px; }
  .gate-card h1 { font-size: 22px; }
}
.admin-wish-toolbar { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid #f1f2f8; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.admin-wish-toolbar .btn-primary { width: auto; padding: 7px 14px; font-size: 12.5px; }
.admin-wish-list { padding: 4px 18px 12px; }
.admin-wish-row { padding: 10px 0; border-top: 1px solid #f4f5fa; }
.admin-wish-row:first-child { border-top: 0; }
.admin-wish-main b { font-size: 13px; }
.admin-wish-main p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.7; }
.admin-wish-row.drawn { background: #faf5ff; margin: 0 -18px; padding: 10px 18px; border-top-color: #ede9fe; }
.admin-wish-row.selected { background: #f0fdf4; }
.admin-wish-selected { margin-top: 5px; color: #166534; font-size: 12px; }
.admin-wish-pick { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.admin-wish-pick input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12px; }
.admin-wish-pick .btn-primary { width: auto; padding: 7px 12px; font-size: 12px; }
/* ---------- 信箱 ---------- */
.letter-banner { margin: 10px auto 0; max-width: 1100px; padding: 10px 18px; border-radius: 12px; background: linear-gradient(90deg,#fff7ed,#faf5ff); border: 1px solid #fde3bd; color: #92400e; font-size: 13px; cursor: pointer; box-shadow: var(--shadow-sm); }
.letter-banner:hover { border-color: #fbbf24; }
.letter-compose { background: #fffdf8; border: 1px solid #fdebd3; border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.letter-compose-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.letter-compose-head h3 { margin: 0; font-size: 16px; }
.letter-compose-head span { color: var(--muted); font-size: 11.5px; }
.letter-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.letter-form input, .letter-form select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; background: #fff; outline: none; }
.letter-form textarea { min-height: 120px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 13px; line-height: 1.8; resize: vertical; outline: none; }
.letter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.letter-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.letter-col-title { font-size: 14px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid #eceef6; }
.letter-col-title span { color: var(--muted); font-weight: 400; font-size: 12px; }
.letter-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow-sm); }
.letter-card:hover { border-color: #c7d2fe; }
.letter-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.letter-card-head b { font-size: 13.5px; }
.letter-card-head span { font-size: 11px; color: #8b5cf6; white-space: nowrap; }
.letter-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.letter-card p { margin: 7px 0 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.7; }
.letter-detail { max-width: 760px; margin: 0 auto; }
.letter-paper { margin-top: 14px; background: #fffdf8; border: 1px solid #fdebd3; border-radius: 16px; padding: 26px 30px; box-shadow: 0 18px 50px rgba(120,80,20,.08); }
.letter-detail-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; margin-bottom: 14px; }
.letter-paper h1 { font-size: 22px; margin: 0 0 16px; }
.letter-body { white-space: pre-wrap; color: var(--ink); font-size: 14px; line-height: 2; }
.letter-reply { margin-top: 20px; padding: 14px 16px; border-radius: 10px; background: #f5f3ff; border: 1px solid #e9d5ff; }
.letter-reply b { color: #6d28d9; font-size: 12.5px; }
.letter-reply p { margin: 6px 0 0; white-space: pre-wrap; color: var(--ink-soft); font-size: 13px; line-height: 1.9; }
.letter-sign { margin-top: 20px; text-align: right; color: #a6acbd; font-size: 11px; }
.admin-letters-box { max-height: 320px; overflow-y: auto; }\n.admin-letter-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid #f3f4f8; cursor: pointer; align-items: center; }
.admin-letter-row:first-child { border-top: 0; }
.admin-letter-row:hover { background: #faf8ff; }
.admin-letter-main { min-width: 0; }
.admin-letter-main p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.admin-letter-detail { padding: 14px 18px 16px; }
.admin-letter-detail h3 { margin: 6px 0 10px; font-size: 16px; }
.admin-letter-detail .letter-body { background: #fffdf8; border: 1px solid #fdebd3; border-radius: 10px; padding: 14px; font-size: 13px; }
.admin-reply-label { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.admin-reply-label textarea { min-height: 90px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 13px; resize: vertical; outline: none; }
@media (max-width: 760px) { .letter-columns, .letter-row { grid-template-columns: 1fr; } }
/* ---------- 临时账号风险提示 ---------- */
.space-risk-gate { max-width: 820px; margin: 34px auto; background: #fffdf8; border: 1px solid #f5d9b8; border-radius: 18px; padding: 28px 30px; box-shadow: 0 18px 50px rgba(120,80,20,.08); }
.space-risk-kicker { color: #b45309; font-size: 12px; font-weight: 700; letter-spacing: .08em; margin-bottom: 6px; }
.space-risk-gate h2 { margin: 0 0 14px; font-size: 24px; }
.space-risk-list { background: #fff7ed; border: 1px solid #fde3bd; border-radius: 12px; padding: 14px 18px; }
.space-risk-list p { margin: 0 0 8px; color: #7c2d12; font-size: 13px; line-height: 1.8; }
.space-risk-list p:last-child { margin-bottom: 0; }
.space-risk-check { display: flex; gap: 8px; align-items: flex-start; margin: 18px 0 14px; font-size: 13px; color: #374151; cursor: pointer; }
.space-risk-check input { margin-top: 3px; }
.space-risk-actions { display: flex; gap: 10px; align-items: center; }
.space-risk-actions .btn-primary { width: auto; padding: 10px 20px; }
.temp-risk-banner { margin: 10px auto 14px; max-width: 1100px; padding: 10px 16px; border-radius: 10px; background: #fff7ed; border: 1px solid #fde3bd; color: #9a3412; font-size: 12.5px; }
@media (max-width: 760px) { .space-risk-gate { margin: 16px; padding: 20px; } }
/* ---------- 九班空间 · 教师后台 ---------- */
.admin-task-editor { padding: 12px 18px 16px; }
.admin-task-label { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.admin-task-label input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; }
.admin-task-editor textarea { width: 100%; min-height: 96px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; font: inherit; font-size: 12.5px; line-height: 1.8; resize: vertical; outline: none; }
.admin-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-soft); margin: 9px 0; cursor: pointer; }
.admin-check input { accent-color: #4f46e5; }
.admin-task-editor .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-task-editor .btn-primary { width: auto; padding: 8px 16px; font-size: 12.5px; }
.admin-plan-scroll { max-height: 420px; overflow: auto; }
.admin-plan-table th { position: sticky; top: 0; background: #fbfbfe; z-index: 1; }
.admin-plan-table td { vertical-align: top; font-size: 12.5px; line-height: 1.7; }
.admin-plan-table .plan-text { max-width: 220px; white-space: pre-wrap; word-break: break-word; color: var(--ink-soft); }
.admin-plan-table .muted { color: #b3b8c7; font-size: 12px; }
.admin-plan-count { padding: 9px 14px; color: var(--muted); font-size: 12px; border-top: 1px solid #f3f4f8; }
.banned-tag { display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px; background: #fee2e2; color: #b91c1c; font-size: 10px; font-weight: 500; }
/* ---------- 九班空间 ---------- */
.space-head { padding: 10px 4px 20px; }
.space-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; color: #8b5cf6; margin-bottom: 6px; }
.space-head h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: .02em; }
.space-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.space-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.space-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 18px 20px 20px; min-height: 150px; }
.space-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.space-card-head h3 { margin: 0; font-size: 16px; }
.space-card-head span { font-size: 11.5px; color: var(--muted); }
.space-task-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; color: #312e81; }
.space-task-list { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.9; }
.space-task-list li { padding-left: 2px; }
.space-empty { color: var(--muted); font-size: 13px; line-height: 1.8; padding: 12px 0; }
.space-link { display: inline-block; margin-top: 10px; color: var(--brand); font-size: 13px; }
.birthday-list { display: flex; flex-direction: column; gap: 8px; }
.birthday-row { display: flex; align-items: center; gap: 12px; padding: 9px 11px; background: #fffaf5; border: 1px solid #fdebd3; border-radius: 10px; }
.birthday-date { font-weight: 700; color: #b45309; font-size: 13px; min-width: 68px; }
.birthday-name { font-weight: 600; color: var(--ink); font-size: 14px; flex: 1; }
.birthday-cake { font-size: 16px; }
.space-plan-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.space-plan-form textarea { width: 100%; min-height: 76px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 13px; line-height: 1.7; resize: vertical; outline: none; }
.space-plan-form textarea:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef0ff; }
.space-plan-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.space-plan-actions .btn-primary { width: auto; padding: 9px 18px; font-size: 13px; }
.space-plan-actions .admin-msg { margin: 0; }
.space-confession-card { background: linear-gradient(145deg, #fbf8ff, #fff); border-color: #e9d5ff; }
.space-confession-text { color: var(--ink-soft); font-size: 13.5px; line-height: 1.8; margin: 0 0 14px; }
.space-confession-card .btn-primary { width: auto; padding: 9px 18px; font-size: 13px; }
.space-card.span-2 { grid-column: 1 / -1; }
.space-songs-card .song-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.song-form input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; }
.song-form input#spaceSongTitle { width: 190px; }
.song-form input#spaceSongArtist { width: 150px; }
.song-form .btn-primary { width: auto; padding: 8px 14px; font-size: 12.5px; }
.song-hint { color: var(--muted); font-size: 11.5px; }
.song-list { display: flex; flex-direction: column; gap: 7px; }
.song-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fbfbff; border: 1px solid #eef0f8; border-radius: 9px; }
.song-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.song-main b { font-size: 13.5px; }
.song-main span { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-vote { border: 1px solid #e9d5ff; background: #faf5ff; color: #7c3aed; border-radius: 8px; padding: 5px 10px; font-size: 12px; min-width: 48px; }
.song-vote.voted { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.song-del { border: 0; background: none; color: #c4c8d8; font-size: 18px; line-height: 1; padding: 2px 5px; }
.song-del:hover { color: #ef4444; }
.birthday-comments-title { margin: 15px 0 8px; padding-top: 12px; border-top: 1px dashed #eceef6; font-weight: 700; font-size: 13px; }
.birthday-form { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.birthday-form select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12.5px; background: #fff; }
.birthday-form textarea { min-height: 58px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; font: inherit; font-size: 12.5px; resize: vertical; outline: none; }
.birthday-form .btn-primary { width: auto; align-self: flex-start; padding: 7px 14px; font-size: 12.5px; }
.birthday-comments { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; }
.birthday-comment { background: #fffaf5; border: 1px solid #fdebd3; border-radius: 9px; padding: 8px 10px; }
.birthday-comment-text { color: var(--ink-soft); font-size: 12.5px; line-height: 1.7; word-break: break-word; }
.birthday-comment-meta { color: #a6acbd; font-size: 10.5px; margin-top: 4px; }
.link-danger { border: 0; background: none; color: #ef4444; font-size: 10.5px; padding: 0 3px; }
.space-wish-form textarea { width: 100%; min-height: 70px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; font: inherit; font-size: 13px; resize: vertical; outline: none; }
.wish-status { padding: 8px 10px; border-radius: 9px; background: #fff7ed; border: 1px solid #fde3bd; color: #92400e; font-size: 12.5px; line-height: 1.7; margin-bottom: 9px; }
.wish-status.selected { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.space-future-card { margin-top: 16px; background: linear-gradient(145deg, #fffdf8, #fff); border-color: #fde3bd; }
.space-future-note { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.space-future-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); margin-bottom: 11px; }
.space-future-form input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; outline: none; }
.space-future-form textarea { min-height: 110px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 13px; line-height: 1.8; resize: vertical; outline: none; }
.space-future-form input:focus, .space-future-form textarea:focus { border-color: #fbbf24; box-shadow: 0 0 0 3px #fffbeb; }
.admin-wish-pick { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.admin-wish-pick input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12px; }
.admin-wish-pick .btn-primary { width: auto; padding: 7px 12px; font-size: 12px; }
@media (max-width: 760px) {
  .space-grid { grid-template-columns: 1fr; }
  .space-head h1 { font-size: 26px; }
}
/* ---------- 题目反馈 / 师生沟通 ---------- */
.q-tools { display: flex; align-items: center; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.q-tools .answer-toggle { margin-top: 0; }
.feedback-toggle {
  border: 0; background: none; padding: 0; color: #7c3aed;
  font-size: 13px; display: inline-flex; align-items: center; gap: 4px;
}
.feedback-toggle:hover { text-decoration: underline; }
.fb-badge {
  margin-left: auto; font-size: 11px; font-weight: 600; color: #7c3aed;
  background: #f3e8ff; border: 1px solid #e9d5ff; border-radius: 999px; padding: 2px 8px;
}
.fb-card { max-width: 540px; padding: 24px 24px 20px; }
.fb-head { padding-right: 22px; }
.fb-eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: #8b5cf6; margin-bottom: 4px; }
.fb-head h2 { font-size: 18px; line-height: 1.5; margin: 0 0 4px; }
.fb-head .modal-sub { margin-bottom: 14px; }
.fb-messages {
  max-height: 330px; overflow-y: auto; background: #f8f9fe; border: 1px solid #eef0f8;
  border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 90px;
}
.fb-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 26px 10px; line-height: 1.8; }
.fb-msg { max-width: 84%; padding: 9px 12px; border-radius: 12px; background: #fff; border: 1px solid #e9ebf5; font-size: 13px; line-height: 1.75; color: var(--ink-soft); white-space: pre-wrap; word-break: break-word; }
.fb-msg.me { align-self: flex-end; background: var(--brand-soft); border-color: #dfe2fb; color: #312e81; }
.fb-msg .who { font-size: 10.5px; color: #9aa1b2; margin-bottom: 3px; }
.fb-msg.me .who { color: #818cf8; }
.fb-form { margin-top: 12px; }
.fb-form textarea { width: 100%; min-height: 76px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13.5px; resize: vertical; outline: none; }
.fb-form textarea:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef0ff; }
.fb-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.fb-actions .btn-primary { width: auto; padding: 9px 18px; font-size: 13px; }
.fb-actions .form-err { flex: 1; }
.fb-thread-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-top: 1px solid #f1f2f8; cursor: pointer; }
.fb-thread-row:first-child { border-top: 0; }
.fb-thread-row:hover { background: #faf8ff; }
.fb-thread-main { min-width: 0; flex: 1; }
.fb-thread-main b { font-size: 14px; }
.fb-thread-main p { margin: 4px 0; color: var(--ink-soft); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-thread-main .fb-unread { margin-left: 8px; }
.fb-thread-arrow { color: #c4c8d8; font-size: 22px; }.admin-release { margin-bottom: 16px; }
.admin-release .release-hint { margin: 10px 18px 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.release-toolbar { display: flex; gap: 8px; padding: 10px 18px 0; flex-wrap: wrap; }
.release-list { max-height: 420px; overflow-y: auto; margin: 12px 18px 0; border: 1px solid #eef0f8; border-radius: 10px; }
.release-ch { border-top: 1px solid #f1f2f8; padding: 10px 12px; }
.release-ch:first-child { border-top: 0; }
.release-ch-head { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.release-lessons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 13px; padding: 8px 0 2px 24px; }
.release-papers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 14px; }
.release-papers label { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; line-height: 1.6; }
.release-papers input { accent-color: #4f46e5; margin-top: 2px; flex: none; }
.release-lessons label { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; line-height: 1.6; }
.release-lessons input, .release-ch-head input { accent-color: #4f46e5; margin-top: 2px; flex: none; }
.release-save { display: flex; align-items: center; gap: 12px; padding: 12px 18px 16px; }
.release-save .btn-primary { width: auto; padding: 9px 18px; font-size: 13px; }
.release-save .admin-msg { margin: 0; }
@media (max-width: 760px) {
  .release-lessons { grid-template-columns: 1fr; }
}
.admin-fb-table tbody tr { cursor: pointer; }
.fb-thread-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-top: 1px solid #f1f2f8; cursor: pointer; }
.fb-thread-row:first-child { border-top: 0; }
.fb-thread-row:hover { background: #faf8ff; }
.fb-thread-main { min-width: 0; flex: 1; }
.fb-thread-main b { font-size: 14px; }
.fb-thread-main p { margin: 4px 0; color: var(--ink-soft); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-thread-main .fb-unread { margin-left: 8px; }
.fb-thread-arrow { color: #c4c8d8; font-size: 22px; }.admin-release { margin-bottom: 16px; }
.admin-release .release-hint { margin: 10px 18px 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.release-toolbar { display: flex; gap: 8px; padding: 10px 18px 0; flex-wrap: wrap; }
.release-list { max-height: 420px; overflow-y: auto; margin: 12px 18px 0; border: 1px solid #eef0f8; border-radius: 10px; }
.release-ch { border-top: 1px solid #f1f2f8; padding: 10px 12px; }
.release-ch:first-child { border-top: 0; }
.release-ch-head { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.release-lessons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 13px; padding: 8px 0 2px 24px; }
.release-papers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 14px; }
.release-papers label { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; line-height: 1.6; }
.release-papers input { accent-color: #4f46e5; margin-top: 2px; flex: none; }
.release-lessons label { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; line-height: 1.6; }
.release-lessons input, .release-ch-head input { accent-color: #4f46e5; margin-top: 2px; flex: none; }
.release-save { display: flex; align-items: center; gap: 12px; padding: 12px 18px 16px; }
.release-save .btn-primary { width: auto; padding: 9px 18px; font-size: 13px; }
.release-save .admin-msg { margin: 0; }
@media (max-width: 760px) {
  .release-lessons { grid-template-columns: 1fr; }
}
.admin-fb-table tbody tr:hover { background: #faf8ff; }
.fb-thread-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-top: 1px solid #f1f2f8; cursor: pointer; }
.fb-thread-row:first-child { border-top: 0; }
.fb-thread-row:hover { background: #faf8ff; }
.fb-thread-main { min-width: 0; flex: 1; }
.fb-thread-main b { font-size: 14px; }
.fb-thread-main p { margin: 4px 0; color: var(--ink-soft); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-thread-main .fb-unread { margin-left: 8px; }
.fb-thread-arrow { color: #c4c8d8; font-size: 22px; }.admin-release { margin-bottom: 16px; }
.admin-release .release-hint { margin: 10px 18px 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.release-toolbar { display: flex; gap: 8px; padding: 10px 18px 0; flex-wrap: wrap; }
.release-list { max-height: 420px; overflow-y: auto; margin: 12px 18px 0; border: 1px solid #eef0f8; border-radius: 10px; }
.release-ch { border-top: 1px solid #f1f2f8; padding: 10px 12px; }
.release-ch:first-child { border-top: 0; }
.release-ch-head { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.release-lessons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 13px; padding: 8px 0 2px 24px; }
.release-papers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 14px; }
.release-papers label { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; line-height: 1.6; }
.release-papers input { accent-color: #4f46e5; margin-top: 2px; flex: none; }
.release-lessons label { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; line-height: 1.6; }
.release-lessons input, .release-ch-head input { accent-color: #4f46e5; margin-top: 2px; flex: none; }
.release-save { display: flex; align-items: center; gap: 12px; padding: 12px 18px 16px; }
.release-save .btn-primary { width: auto; padding: 9px 18px; font-size: 13px; }
.release-save .admin-msg { margin: 0; }
@media (max-width: 760px) {
  .release-lessons { grid-template-columns: 1fr; }
}
.admin-fb-table tbody tr.active { background: #f5f0ff; }
.fb-unread { color: #fff; background: #8b5cf6; border-radius: 999px; font-size: 10.5px; padding: 1px 7px; font-weight: 600; }
.fb-thread-head { padding: 13px 18px; border-bottom: 1px solid #f0f1f7; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-thread-head b { font-size: 14px; }
.fb-thread-head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.fb-detail .fb-messages { margin: 12px 18px; max-height: 300px; }
.fb-reply { padding: 0 18px 16px; }
.fb-reply textarea { width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 13px; resize: vertical; outline: none; }
.fb-reply .fb-actions { margin-top: 8px; }
/* ---------- 登录 / 教师后台 ---------- */
.contact-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #e9d5ff; background: #faf5ff; border-radius: 12px;
  padding: 8px 13px; font-size: 14px; color: #7c3aed; box-shadow: var(--shadow-sm);
}
.contact-btn:hover { background: #f3e8ff; border-color: #d8b4fe; }.auth-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 8px 13px; font-size: 14px; color: var(--ink-soft); box-shadow: var(--shadow-sm);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-btn:hover { border-color: #c9cdf3; color: var(--brand-dark); }
.auth-btn.is-user { background: var(--brand-soft); border-color: #dcdffb; color: var(--brand-dark); font-weight: 600; }
.auth-btn.is-teacher { background: #fff7e6; border-color: #fde3bd; color: #92400e; }
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(18, 22, 38, .38); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-card { position: relative; width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 28px 26px 24px; box-shadow: var(--shadow-lg); }
.modal-close { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 26px; line-height: 1; color: #9aa1b2; cursor: pointer; }
.modal-card h2 { margin: 0 0 6px; font-size: 21px; }
.modal-sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.auth-form input { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; font-size: 14px; outline: none; }
.auth-form input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef0ff; }
.form-err { color: #b91c1c; font-size: 12.5px; min-height: 16px; }
.auth-form .btn-primary { width: 100%; }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { margin: 0 0 4px; font-size: 25px; }
.admin-head .sub { color: var(--muted); font-size: 13px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-stats { display: flex; gap: 24px; flex-wrap: wrap; margin: 16px 0 22px; }
.admin-stats div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 20px; box-shadow: var(--shadow-sm); }
.admin-stats b { display: block; font-size: 24px; line-height: 1.2; }
.admin-stats span { font-size: 12px; color: var(--muted); }
.admin-mode { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; margin: 0 0 16px; flex-wrap: wrap; }
.admin-mode .mode-info { min-width: 0; flex: 1; }
.admin-mode .mode-info b { font-size: 14px; }
.admin-mode .mode-info p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.mode-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--brand-dark); white-space: nowrap; cursor: pointer; padding: 8px 12px; border: 1px solid #e3e5f5; border-radius: 10px; background: #fafaff; }
.mode-switch input { width: 18px; height: 18px; accent-color: #4f46e5; cursor: pointer; }.admin-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; align-items: start; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.admin-card h3 { margin: 0; padding: 14px 18px; font-size: 14.5px; border-bottom: 1px solid #f0f1f7; background: #fbfbfe; display: flex; justify-content: space-between; gap: 10px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 14px; border-top: 1px solid #f3f4f8; }
.admin-table th { color: var(--muted); font-weight: 500; font-size: 12px; border-top: 0; }
.admin-table tbody tr { cursor: pointer; }
.admin-table tbody tr:hover { background: #f8f9fe; }
.admin-table tbody tr.active { background: var(--brand-soft); }
.admin-table .num { font-variant-numeric: tabular-nums; color: var(--brand); font-weight: 600; }
.admin-empty { padding: 30px 18px; color: var(--muted); font-size: 13px; text-align: center; }
.admin-detail { padding: 0 0 10px; max-height: 560px; overflow: auto; }
.admin-detail .d-head { padding: 13px 18px; border-bottom: 1px solid #f0f1f7; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.admin-detail .d-head b { font-size: 15px; }
.admin-q { padding: 10px 18px; border-top: 1px solid #f6f7fb; display: flex; gap: 10px; font-size: 13px; }
.admin-q:first-child { border-top: 0; }
.admin-q .q-no { color: var(--brand); font-weight: 700; flex: none; }
.admin-q .q-body { min-width: 0; }
.admin-q .q-src { font-size: 11.5px; color: var(--muted); }
.admin-q .q-text { color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.admin-top { padding: 6px 0; }
.admin-top .item { display: flex; align-items: center; gap: 10px; padding: 8px 18px; font-size: 13px; border-top: 1px solid #f6f7fb; }
.admin-top .item:first-child { border-top: 0; }
.admin-top .bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6366f1, #a5b4fc); flex: none; min-width: 6px; }
.admin-top .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-top .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.admin-import { padding: 14px 18px; }
.admin-import textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: 13px/1.6 Consolas, monospace; resize: vertical; }
.admin-import .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.admin-import .hint { color: var(--muted); font-size: 12px; }
.admin-import .btn-primary { width: auto; padding: 9px 18px; font-size: 13px; }
.admin-import .btn-ghost { width: auto; margin: 0; padding: 9px 14px; }
.admin-msg { margin-top: 10px; font-size: 12.5px; }
.admin-msg.ok { color: var(--ok); }
.admin-msg.err { color: #b91c1c; }
/* ---------- 打印预览 ---------- */
.print-shell { position: fixed; inset: 0; z-index: 40; background: #e9ebf2; overflow: auto; }
body.printing .app { display: none; }
.print-toolbar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px;
  padding: 10px max(16px, calc((100vw - 900px) / 2));
  background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.print-toolbar .pt-info { flex: 1; font-size: 13px; color: var(--muted); }
.print-toolbar .pt-info b { color: var(--ink); }
.print-toolbar .btn-primary { width: auto; padding: 9px 18px; font-size: 13.5px; }
.print-toolbar .btn-ghost { width: auto; margin: 0; padding: 9px 14px; }
.paper {
  width: 210mm; min-height: 297mm; margin: 22px auto; padding: 16mm 15mm 18mm;
  background: #fff; color: #111; box-shadow: 0 10px 40px rgba(24, 30, 60, .16);
  font-family: var(--serif); font-size: 11pt; line-height: 1.78;
}
.paper-head { text-align: center; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 14px; }
.paper-head h1 { margin: 0; font-size: 20pt; letter-spacing: .16em; font-family: var(--sans); font-weight: 700; }
.paper-head .ph-sub { font-size: 9.5pt; color: #555; margin-top: 2px; letter-spacing: .04em; }
.paper-meta { display: flex; justify-content: space-between; font-size: 10pt; color: #333; margin-bottom: 10px; }
.paper-note { font-size: 9pt; color: #777; text-align: right; margin-bottom: 12px; }
.pq { margin: 0 0 9px; break-inside: avoid; page-break-inside: avoid; }
.pq-group-src {
  margin: 12px 0 5px; padding-bottom: 2px; border-bottom: 1px dashed #ccc;
  font-size: 9pt; color: #555; font-family: var(--sans); font-weight: 700;
}
.pq-src { font-size: 8.4pt; color: #8a8a8a; letter-spacing: .02em; margin-bottom: 1px; }
.pq-head { font-weight: 700; }
.pq-stem { text-align: justify; }
.pq-stem .q-img.fig { display: block; max-width: 78%; max-height: 62mm; width: auto; height: auto !important; margin: 6px auto; }
.pq-stem .q-img.page { display: block; max-width: 100%; max-height: 128mm; width: auto; height: auto !important; margin: 5px auto; }
.pq .q-img.inline { display: inline-block; vertical-align: middle; max-width: 100%; margin: 0 1px; }
.pq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-top: 2px; }
.pq-opts .opt { display: flex; gap: 3px; }
.pq-opts .opt b { font-weight: 700; }
.pq .q-table { border-collapse: collapse; margin: 6px auto; font-size: 10pt; }
.pq .q-table td { border: 1px solid #333; padding: 2px 8px; text-align: center; }
.pq-work { height: 10mm; }
.pq-work.tall { height: 28mm; }
.pq-answer { margin: 5px 0 0; padding: 6px 9px; background: #f7f9f7; border: 1px solid #e3ebe3; font-size: 9.3pt; line-height: 1.62; break-inside: avoid; }
.pq-answer .lbl { font-weight: 700; color: #14532d; margin-right: 5px; }
.pq-answer .sol { color: #333; }
.pq-answer math { font-size: 1.02em; }
.pq-answer .sol .lbl { color: #14532d; }
.pq-answer .q-img.fig { max-width: 62%; max-height: 38mm; display: block; margin: 4px auto; }
.answers-page { break-before: page; page-break-before: always; }
.answers-page h2 { text-align: center; font-size: 15pt; letter-spacing: .12em; margin: 0 0 12px; font-family: var(--sans); }
.pa { margin-bottom: 10px; font-size: 10.2pt; break-inside: avoid; }
.pa .pa-no { font-weight: 700; }
.paper-foot { margin-top: 16px; padding-top: 8px; border-top: 1px solid #ddd; text-align: center; font-size: 8.5pt; color: #999; }

math { font-size: 1.04em; }
sup, sub { font-size: .72em; line-height: 0; }
.q-stem, .q-opts, .q-answer { overflow-wrap: anywhere; }
math[display="block"] { margin: 4px 0; }
.mspace { display: inline-block; }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  .nav { gap: 0; }
  .nav a { padding: 8px 10px; font-size: 13px; }
  .lesson-list { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .brand-text small { display: none; }
  .nav { order: 3; width: 100%; flex: none; overflow-x: auto; margin: 0; padding-bottom: 2px; }
  .nav a { white-space: nowrap; }
  .cart-btn { margin-left: auto; }
  .cart-btn span:not(.cart-count) { display: none; }
  .view { padding: 18px 14px 90px; }
  .hero { padding: 26px 22px; }
  .hero h1 { font-size: 24px; }
  .hero .hero-actions { position: static; margin-top: 18px; }
  .lesson-head { flex-direction: column; }
  .toolbar { top: 108px; }
  .qcard { padding: 15px 15px 14px 50px; }
  .q-check { left: 14px; top: 15px; }
  .q-opts { grid-template-columns: 1fr; }
  .res-form-row { grid-template-columns: 1fr; }
  .res-grid { grid-template-columns: 1fr; }
  .paper { width: 100%; min-height: 0; margin: 0; padding: 22px 18px; box-shadow: none; }
  .print-shell { background: #fff; }
  .print-toolbar { position: sticky; top: 0; }
  .print-toolbar .pt-info { display: none; }
  .footer { flex-direction: column; }
.footer-icp { width: 100%; text-align: center; margin-top: 6px; font-size: 11px; }
.footer-icp a { color: #98a0b3; text-decoration: none; }
.footer-icp a:hover { color: var(--brand); text-decoration: underline; }
  .footer-icp { width: 100%; text-align: center; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3) { display: none; }
}

/* ---------- 打印 ---------- */
@page { size: A4; margin: 15mm 14mm; }
@media print {
  html, body { background: #fff !important; }
  .app, .footer, .cart-panel, .scrim, .toast, .print-toolbar { display: none !important; }
  .print-shell { position: static; overflow: visible; background: #fff; }
  .paper {
    width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none;
    font-size: 11pt;
  }
  .paper-head { margin-bottom: 10px; }
  .pq { page-break-inside: avoid; }
  .pq-stem .q-img.fig { max-height: 58mm; }
  .answers-page { page-break-before: always; }
  a { color: inherit; }
}































/* ================================================================
   周末能量站
   ================================================================ */
.game-page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 72px; }
.game-loading { padding: 90px 20px; text-align: center; color: var(--muted); }
.game-loading span { font-size: 36px; display: block; margin-bottom: 8px; }
.game-hero {
  position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 24px; align-items: center;
  padding: 30px 32px; border-radius: 24px; color: #fff;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 24%),
              linear-gradient(115deg, #312e81 0%, #4f46e5 52%, #7c3aed 100%);
  box-shadow: 0 22px 48px rgba(79,70,229,.25);
}
.game-hero::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -65px; bottom: -115px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255,255,255,.05), 0 0 0 68px rgba(255,255,255,.04);
}
.game-eyebrow { font-size: 11px; letter-spacing: .18em; opacity: .72; }
.game-hero h1 { margin: 7px 0 4px; font-size: 36px; line-height: 1.15; letter-spacing: -.03em; }
.game-hero p { margin: 0; color: rgba(255,255,255,.82); font-size: 14px; }
.game-points {
  position: relative; z-index: 1; flex: none; min-width: 150px; padding: 16px 20px; border-radius: 18px;
  text-align: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
}
.game-points span { display: block; font-size: 12px; color: rgba(255,255,255,.74); }
.game-points b { display: block; font-size: 44px; line-height: 1.1; letter-spacing: -.04em; }
.game-points small { font-size: 11px; color: rgba(255,255,255,.6); }
.g-preview {
  margin-top: 12px; display: inline-block; padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,.14); color: #fef3c7; font-size: 12px;
}
.game-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0;
}
.game-stats > div {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.game-stats b { display: block; font-size: 22px; line-height: 1.2; }
.game-stats span { color: var(--muted); font-size: 12px; }
.g-flash {
  margin: 4px 0 14px; padding: 11px 15px; border-radius: 12px; font-size: 13.5px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46;
}
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.game-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px;
  box-shadow: var(--shadow-sm); min-width: 0;
}
.g-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.g-title > span { font-size: 20px; }
.g-title h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.g-title em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 11px; background: #f3f4f8; padding: 3px 8px; border-radius: 999px; }
.game-card p { color: var(--ink-soft); font-size: 13.5px; }
.game-checkin { background: linear-gradient(135deg, #fffbeb, #fff); }
.game-checkin .btn-primary { width: 100%; margin-top: 6px; }
.btn-primary {
  border: 0; background: var(--brand); color: #fff; border-radius: 10px; padding: 10px 16px;
  font-weight: 600; transition: background .15s, transform .12s;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); transform: translateY(-1px); }
.btn-primary:disabled, .btn-ghost:disabled { opacity: .48; cursor: not-allowed; }
.btn-ghost { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; }
.g-mini { color: var(--muted) !important; font-size: 12px !important; margin: 8px 0 0; }
.g-wheel-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.wheel-stage { position: relative; width: 200px; height: 200px; margin: 4px auto 0; }
.wheel {
  width: 200px; height: 200px; border-radius: 50%; border: 6px solid #fff;
  box-shadow: 0 12px 28px rgba(30,36,60,.16), inset 0 0 0 1px rgba(255,255,255,.7);
  background: conic-gradient(#6366f1 0 60deg, #f59e0b 60deg 120deg, #10b981 120deg 180deg,
                           #ec4899 180deg 240deg, #0ea5e9 240deg 300deg, #8b5cf6 300deg 360deg);
  transition: transform 1.15s cubic-bezier(.18,.78,.25,1);
}
.wheel::before {
  content: ""; position: absolute; inset: 50%; width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.8);
}
.wheel-pin {
  position: absolute; z-index: 3; top: -13px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 21px; text-shadow: 0 2px 4px rgba(0,0,0,.3);
}
.wheel-center {
  position: absolute; z-index: 4; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff;
  background: #111827; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .05em;
  box-shadow: 0 7px 18px rgba(0,0,0,.25);
}
.wheel-center:disabled { opacity: .55; cursor: not-allowed; }
.g-blind-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.g-blind {
  border: 1px dashed #c7d2fe; background: linear-gradient(160deg, #eef2ff, #fff);
  border-radius: 14px; padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .15s, border-color .15s;
}
.g-blind:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--brand); }
.g-blind > span { font-size: 28px; }
.g-blind b { font-size: 13px; }
.g-blind small { color: var(--muted); font-size: 10.5px; }
.g-blind:disabled { opacity: .55; cursor: not-allowed; }
.g-blind-opened { max-width: 210px; }
.g-blind-opened .g-card { box-shadow: none; margin-bottom: 0; }
.guess-hints { margin: 0 0 10px; padding: 0 0 0 18px; color: var(--ink-soft); font-size: 13px; }
.guess-hints li { margin: 4px 0; }
.guess-attempts { display: flex; gap: 5px; margin: 8px 0 12px; }
.guess-attempts i { width: 18px; height: 6px; border-radius: 99px; background: #e5e7eb; }
.guess-attempts i.used { background: var(--brand); }
.guess-input-row { display: flex; gap: 8px; }
.guess-input-row input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font: inherit; background: #fbfbfd; outline: none;
}
.guess-input-row input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
.g-answer { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #ecfdf5; color: #065f46; font-size: 13px; }
.game-shop, .game-collection { margin-top: 14px; }
.g-reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.g-reward {
  display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: #fbfbfd;
}
.g-reward-emoji { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #eef2ff; font-size: 19px; flex: none; }
.g-reward-main { flex: 1; min-width: 0; }
.g-reward-main b { font-size: 13px; display: block; }
.g-reward-main p { margin: 1px 0; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-reward-main small { font-size: 11px; color: var(--brand-dark); }
.g-redeem { flex: none; font-size: 12px; padding: 6px 9px; }
.g-redemptions { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 10px; }
.g-redemptions h3 { font-size: 13px; margin: 0 0 4px; }
.g-redemption { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f2f3f7; font-size: 12.5px; }
.g-redemption small { color: var(--muted); }
.g-card-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.g-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff;
  transition: transform .15s;
}
.g-card.owned { border-color: #c7d2fe; background: linear-gradient(160deg, #f5f3ff, #fff); }
.g-card.locked { opacity: .46; filter: grayscale(.8); }
.g-card:hover { transform: translateY(-2px); }
.g-card-top { display: flex; justify-content: space-between; align-items: center; }
.g-card-emoji { font-size: 23px; }
.g-rarity { font-size: 9.5px; color: var(--muted); background: #f3f4f8; border-radius: 99px; padding: 2px 6px; }
.rarity-传说 .g-rarity { color: #92400e; background: #fef3c7; }
.rarity-史诗 .g-rarity { color: #6b21a8; background: #f3e8ff; }
.rarity-稀有 .g-rarity { color: #075985; background: #e0f2fe; }
.g-card > b { display: block; font-size: 12.5px; margin-top: 5px; }
.g-card p { margin: 3px 0; font-size: 10.5px; color: var(--muted); line-height: 1.4; min-height: 29px; }
.g-card small { color: var(--muted); font-size: 9.5px; }
.game-rules {
  margin-top: 14px; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 12px;
}
.game-rules b { color: var(--ink); margin-right: 4px; }
.game-rules span { background: #f3f4f8; color: var(--ink-soft); padding: 3px 8px; border-radius: 99px; }
.game-rules small { width: 100%; margin-top: 2px; color: #9aa1b2; }

@media (max-width: 760px) {
  .game-page { padding: 16px 12px 56px; }
  .game-hero { padding: 22px 18px; align-items: flex-start; }
  .game-hero h1 { font-size: 28px; }
  .game-points { min-width: 104px; padding: 10px 12px; }
  .game-points b { font-size: 32px; }
  .game-stats { grid-template-columns: 1fr 1fr; }
  .game-grid { grid-template-columns: 1fr; }
  .g-reward-grid { grid-template-columns: 1fr; }
  .g-card-grid { grid-template-columns: repeat(3, 1fr); }
  .g-reward-main p { white-space: normal; }
}

.admin-game-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f0f1f6;
}
.admin-game-row:last-child { border-bottom: 0; }
.admin-game-row p { margin: 2px 0; font-size: 13px; }
.admin-game-row .q-src { font-size: 11px; }
.admin-game-status { color: var(--brand-dark); font-size: 11px; background: #eef2ff; border-radius: 99px; padding: 2px 7px; }
.admin-game-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 760px) {
  .admin-game-row { align-items: flex-start; flex-direction: column; }
  .admin-game-actions { width: 100%; }
}

/* 游戏页细节修正 */
.nav a { white-space: nowrap; flex: none; }
.nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.game-grid { align-items: start; }
.g-redeem { width: auto; margin: 0; flex: none; }
.guess-input-row .btn-primary { width: auto; flex: none; padding: 10px 16px; }
@media (max-width: 1400px) {
  .nav a { padding: 7px 9px; font-size: 13px; }
  .nav { margin-left: 4px; }
  .topbar { gap: 12px; }
}

@media (max-width: 820px) {
  .contact-btn { display: none !important; }
  .auth-btn { max-width: 118px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .game-hero { flex-direction: column; align-items: stretch; }
  .game-points { width: 100%; min-width: 0; display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .game-points b { font-size: 34px; }
}

/* 图鉴 / 卡片详情 / 收集进度 */
.g-card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.g-card-formula { display: block; margin-top: 2px; color: var(--brand-dark); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-last-open { margin-top: 10px; }
.g-last-open .g-card { border-style: dashed; }
.g-collection-progress { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.g-progress { flex: 1; height: 8px; border-radius: 99px; background: #eef0f7; overflow: hidden; }
.g-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #818cf8, #4f46e5); transition: width .35s; }
.g-collection-progress span { flex: none; color: var(--brand-dark); font-size: 12px; font-weight: 600; }
.g-modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(15, 23, 42, .55); backdrop-filter: blur(5px);
}
.g-modal {
  position: relative; width: min(460px, 100%); max-height: 86vh; overflow-y: auto; padding: 26px;
  border-radius: 22px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.25);
  animation: g-modal-in .2s ease-out;
}
@keyframes g-modal-in { from { transform: translateY(12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.g-modal-close {
  position: absolute; top: 10px; right: 12px; border: 0; background: #f3f4f8; width: 30px; height: 30px;
  border-radius: 50%; font-size: 20px; line-height: 1; color: var(--muted);
}
.g-modal-top { display: flex; align-items: center; gap: 14px; padding-right: 18px; }
.g-modal-emoji { font-size: 46px; line-height: 1; }
.g-modal-kind { font-size: 11px; color: var(--brand-dark); background: #eef2ff; border-radius: 99px; padding: 3px 8px; }
.g-modal h2 { margin: 5px 0 1px; font-size: 24px; letter-spacing: -.03em; }
.g-modal small { color: var(--muted); font-size: 11px; }
.g-modal-formula {
  margin: 18px 0 10px; padding: 13px 14px; border-radius: 12px; background: #f7f5ff;
  color: #4338ca; font-family: "Cambria Math", "Times New Roman", serif; font-size: 18px; text-align: center;
}
.g-modal-quote { margin: 10px 0; color: var(--ink-soft); font-size: 14px; }
.g-modal-desc { margin: 8px 0 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.85; }
@media (max-width: 760px) {
  .g-card-grid { grid-template-columns: repeat(2, 1fr); }
  .g-modal { padding: 22px 18px; }
  .g-modal h2 { font-size: 21px; }
  .g-card-formula { font-size: 10px; }
}

/* 教师端：收集进度 / 奖励编辑 */
.admin-collection-table { display: flex; flex-direction: column; }
.admin-collection-row {
  display: grid; grid-template-columns: 1.2fr 90px 1fr; gap: 14px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid #f0f1f6;
}
.admin-collection-row:last-child { border-bottom: 0; }
.admin-collection-name { display: flex; flex-direction: column; line-height: 1.35; }
.admin-collection-name b { font-size: 13px; }
.admin-collection-score { color: var(--muted); font-size: 11px; white-space: nowrap; }
.admin-collection-score b { color: var(--ink); font-size: 16px; }
.admin-collection-cards { display: flex; align-items: center; gap: 8px; }
.admin-collection-cards .g-progress { height: 7px; }
.admin-collection-cards span { flex: none; font-size: 11px; color: var(--brand-dark); }
.admin-reward-new { display: grid; grid-template-columns: 1.2fr 1.4fr 80px 80px auto; gap: 7px; margin-bottom: 12px; }
.admin-reward-new input, .admin-reward-row input {
  min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; font: inherit; font-size: 12px;
  background: #fbfbfd; outline: none;
}
.admin-reward-new input:focus, .admin-reward-row input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
.admin-reward-new .btn-primary { width: auto; padding: 8px 12px; font-size: 12px; border-radius: 8px; }
.admin-reward-row {
  display: grid; grid-template-columns: 1.1fr 1.4fr 70px 70px auto auto; gap: 7px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #f0f1f6;
}
.admin-reward-row:last-child { border-bottom: 0; }
.admin-reward-row .chip { padding: 6px 8px; font-size: 11px; }
@media (max-width: 760px) {
  .admin-collection-row { grid-template-columns: 1fr 70px; gap: 6px; }
  .admin-collection-cards { grid-column: 1 / -1; }
  .admin-reward-new, .admin-reward-row { grid-template-columns: 1fr 1fr; }
  .admin-reward-new .btn-primary { grid-column: 1 / -1; }
}

/* 试卷/教辅申请 & 游戏设置 */
.g-practice-form {
  display: grid; grid-template-columns: 1.2fr 70px 1.4fr auto auto; gap: 8px; align-items: center;
  padding: 12px; border-radius: 12px; background: #fbfbfd; border: 1px solid var(--line); margin-top: 8px;
}
.g-practice-form select, .g-practice-form input {
  min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 12px;
  background: #fff; outline: none;
}
.g-practice-form select:focus, .g-practice-form input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
.g-practice-form .btn-primary { width: auto; padding: 9px 12px; font-size: 12px; white-space: nowrap; }
.g-practice-preview { color: var(--brand-dark); font-size: 12px; white-space: nowrap; }
.g-practice-preview b { font-size: 18px; }
.g-practice-list { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.g-practice-list h3 { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.g-practice-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f4f5f8; font-size: 12px; }
.g-practice-row:last-child { border-bottom: 0; }
.g-practice-row small { color: var(--muted); text-align: right; }
.admin-practice-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.admin-practice-actions input { width: 58px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; font: inherit; font-size: 12px; }
.admin-settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.admin-settings-grid label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11.5px; }
.admin-settings-grid input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; font: inherit; font-size: 13px; outline: none; background: #fbfbfd; }
.admin-settings-grid input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px #eef2ff; }
.admin-settings-save { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.admin-settings-save .btn-primary { width: auto; padding: 8px 16px; font-size: 12px; }
@media (max-width: 760px) {
  .g-practice-form { grid-template-columns: 1fr 1fr; }
  .g-practice-form select, .g-practice-form input[type="text"], .g-practice-form #practiceNote { grid-column: 1 / -1; }
  .g-practice-form .btn-primary { grid-column: 1 / -1; width: 100%; }
  .admin-practice-actions { width: 100%; flex-wrap: wrap; }
  .admin-settings-grid { grid-template-columns: 1fr 1fr; }
}
