/* =============================================================
   题库刷题系统 · 界面样式 v2「Neural」
   深空底色 + 极光渐变 + 玻璃质感 + 聚光交互
   ============================================================= */

/* ---------------- 设计令牌 ---------------- */
:root {
  --bg: #eef1f9;
  --bg-2: #e6ebf7;
  --surface: #ffffff;
  --surface-2: #f6f8ff;
  --surface-3: #e9eefb;
  --text: #0d1124;
  --text-2: #39405e;
  --muted: #767e9b;

  --line: rgba(18, 26, 66, .13);
  --line-2: rgba(18, 26, 66, .07);

  --accent: #5b54f0;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --accent-soft: rgba(91, 84, 240, .09);
  --grad: linear-gradient(135deg, #5b54f0 0%, #8b5cf6 52%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(91, 84, 240, .14), rgba(34, 211, 238, .10));
  --grad-pill: linear-gradient(135deg, #5b54f0 0%, #7c3aed 100%);

  --green: #0ea472;
  --green-soft: rgba(16, 185, 129, .12);
  --red: #e5484d;
  --red-soft: rgba(239, 68, 68, .10);
  --amber: #d97706;
  --amber-soft: rgba(245, 158, 11, .14);
  --blue: #2563eb;
  --blue-soft: rgba(59, 130, 246, .11);

  --shadow-sm: 0 1px 2px rgba(16, 24, 64, .05), 0 3px 10px -4px rgba(16, 24, 64, .08);
  --shadow: 0 1px 2px rgba(16, 24, 64, .04), 0 18px 44px -20px rgba(16, 24, 64, .22);
  --glow: 0 10px 30px -12px rgba(91, 84, 240, .55);

  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --qscale: 1;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --aurora-1: rgba(99, 102, 241, .30);
  --aurora-2: rgba(34, 211, 238, .22);
  --aurora-3: rgba(168, 85, 247, .22);
  --dot: rgba(18, 26, 66, .055);
}

[data-theme="dark"] {
  --bg: #05070e;
  --bg-2: #090d18;
  --surface: rgba(255, 255, 255, .038);
  --surface-2: rgba(255, 255, 255, .058);
  --surface-3: rgba(255, 255, 255, .03);
  --text: #e9edf8;
  --text-2: #adb6cd;
  --muted: #7b849f;

  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .055);

  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-3: #22d3ee;
  --accent-soft: rgba(129, 140, 248, .12);
  --grad: linear-gradient(135deg, #818cf8 0%, #a78bfa 52%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(129, 140, 248, .18), rgba(34, 211, 238, .10));
  --grad-pill: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);

  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .12);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, .12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .12);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, .12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 2px 10px rgba(0, 0, 0, .45), 0 30px 60px -30px rgba(0, 0, 0, .8);
  --glow: 0 12px 40px -14px rgba(129, 140, 248, .55);

  --aurora-1: rgba(99, 102, 241, .34);
  --aurora-2: rgba(34, 211, 238, .18);
  --aurora-3: rgba(168, 85, 247, .26);
  --dot: rgba(255, 255, 255, .05);
}

/* ---------------- 基础 ---------------- */
* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 极光背景 */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(90px);
}
body::before {
  width: 62vw; height: 62vw; max-width: 900px; max-height: 900px;
  top: -22vw; left: -12vw;
  background: radial-gradient(circle at 30% 30%, var(--aurora-1), transparent 62%),
              radial-gradient(circle at 70% 60%, var(--aurora-2), transparent 60%);
  animation: drift1 26s ease-in-out infinite alternate;
}
body::after {
  width: 54vw; height: 54vw; max-width: 780px; max-height: 780px;
  bottom: -22vw; right: -14vw;
  background: radial-gradient(circle at 50% 50%, var(--aurora-3), transparent 62%),
              radial-gradient(circle at 30% 70%, var(--aurora-2), transparent 58%);
  animation: drift2 32s ease-in-out infinite alternate;
}
@keyframes drift1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, 4vw, 0) scale(1.12); }
}
@keyframes drift2 {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(-5vw, -3vw, 0) scale(.95); }
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.018em; }
h1 { font-size: 27px; line-height: 1.28; }
h2 { font-size: 16.5px; }
h3 { font-size: 16px; }
h4 { font-size: 13.5px; color: var(--text-2); font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

kbd {
  display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 12px;
  font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line);
  border-bottom-width: 2px; color: var(--text-2);
}
code {
  background: var(--accent-soft); color: var(--accent); padding: 1px 6px;
  border-radius: 6px; font-size: 13px; font-family: var(--mono);
}

::selection { background: rgba(99, 102, 241, .28); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 99px; border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.link {
  color: var(--accent); background: none; border: 0; cursor: pointer; font-size: 13px;
  padding: 0 2px; font-weight: 550;
}
.link:hover { text-decoration: underline; }

/* ---------------- 布局 ---------------- */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  height: 62px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line-2);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .topbar { background: var(--bg); }
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, .35), rgba(34, 211, 238, .25), transparent);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; font-size: 15.5px; white-space: nowrap; }
.brand-mark {
  position: relative;
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, .8), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.brand-mark::after {
  content: ""; position: absolute; inset: -3px; border-radius: 12px;
  background: var(--grad); filter: blur(9px); opacity: .3; z-index: -1;
  animation: pulseGlow 4s ease-in-out infinite;
}
@keyframes pulseGlow { 0%, 100% { opacity: .18; } 50% { opacity: .42; } }

.nav { display: flex; gap: 3px; margin-left: 10px; }
.nav a {
  position: relative; padding: 7px 13px; border-radius: 10px;
  color: var(--text-2); font-size: 14px; transition: color .16s, background .16s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: #fff; font-weight: 600; background: var(--grad-pill); box-shadow: var(--glow); }

.topbar-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 11px;
  border: 1px solid transparent; background: transparent;
  color: var(--text-2); display: grid; place-items: center;
  cursor: pointer; font-size: 15px; transition: .16s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.icon-btn.on { color: var(--amber); }

.view { flex: 1; outline: none; }

.page {
  max-width: 1120px; margin: 0 auto;
  padding: 28px 24px 72px;
  display: flex; flex-direction: column; gap: 18px;
  animation: pageIn .42s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.page-head h1 { margin-bottom: 4px; }

.tabbar { display: none; }

/* ---------------- 卡片 ---------------- */
.card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
  transition: box-shadow .25s, border-color .25s;
}
[data-theme="dark"] .card { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--grad);
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* 鼠标聚光 */
.card, .stat-card, .hero { --mx: 50%; --my: 50%; }
.card::after, .stat-card::after, .hero::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx) var(--my),
              rgba(99, 102, 241, .13), transparent 68%);
  opacity: 0; transition: opacity .3s ease;
  z-index: 2;
}
.card:hover::after, .stat-card:hover::after, .hero:hover::after { opacity: 1; }
.card > *, .hero > *, .stat-card > * { position: relative; z-index: 1; }

/* ---------------- 按钮 ---------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 17px; border-radius: 12px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--text);
  font-size: 14px; font-weight: 560; cursor: pointer;
  transition: transform .16s, box-shadow .2s, background .18s, border-color .18s, color .18s;
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .28);
  overflow: hidden;
}
.btn-primary::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), transparent 60%);
  pointer-events: none;
}
.btn-primary:hover { box-shadow: 0 14px 34px -12px rgba(99, 102, 241, .75), inset 0 1px 0 rgba(255, 255, 255, .3); }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { border-color: rgba(99, 102, 241, .5); color: var(--accent); background: var(--surface-2); }

.btn-text { background: transparent; color: var(--text-2); }
.btn-text:hover { color: var(--accent); background: var(--accent-soft); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger-soft { background: var(--red-soft); color: var(--red); }
.btn-danger-soft:hover { border-color: var(--red); }
.btn-success { background: var(--green-soft); color: var(--green); }
.btn-success:hover { border-color: var(--green); }

.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 10px; }
.btn-xs { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 14px; }

/* ---------------- 标签 ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip i { font-style: normal; opacity: .5; font-weight: 400; font-size: 11.5px; }

.t-single { background: var(--blue-soft); color: var(--blue); }
.t-multi { background: var(--amber-soft); color: var(--amber); }
.t-judge { background: var(--green-soft); color: var(--green); }
.t-essay { background: var(--accent-soft); color: var(--accent); }

.chip-btn { cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); transition: .16s; }
.chip-btn:hover { border-color: rgba(99, 102, 241, .55); color: var(--accent); }
.chip-btn.on { background: var(--grad-pill); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -8px rgba(99, 102, 241, .8); }
.chip-btn.on i { opacity: .85; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: 7px; font-size: 12px;
  background: var(--surface-3); color: var(--muted); white-space: nowrap;
}
.tag-warn { background: var(--amber-soft); color: var(--amber); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-amber { background: var(--amber-soft); color: var(--amber); }

/* 进度条 */
.bar {
  height: 7px; border-radius: 99px; background: var(--surface-3);
  overflow: hidden; width: 100%; min-width: 0;
}
.bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(99, 102, 241, .5);
  transition: width .6s cubic-bezier(.22, .8, .3, 1);
}

.empty { text-align: center; padding: 60px 16px; color: var(--text-2); }
.empty-ico {
  font-size: 26px; width: 62px; height: 62px; margin: 0 auto 6px;
  display: grid; place-items: center; border-radius: 20px;
  background: var(--grad-soft); color: var(--accent); border: 1px solid var(--line);
}
.empty h3 { margin: 12px 0 6px; }
.empty p { color: var(--muted); margin-bottom: 18px; font-size: 13.5px; }

.alert {
  padding: 11px 15px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 10px; border: 1px solid transparent;
}
.alert-ok { background: var(--green-soft); color: var(--green); border-color: rgba(16, 185, 129, .22); }
.alert-warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(245, 158, 11, .24); }

/* ---------------- 首页 ---------------- */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 30px;
  border-radius: 26px; padding: 34px 36px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(34, 211, 238, .13), transparent 55%),
    radial-gradient(120% 140% at 0% 100%, rgba(139, 92, 246, .16), transparent 55%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(99, 102, 241, .55), rgba(34, 211, 238, .3) 45%, transparent 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
[data-theme="dark"] .hero { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

.hero-main { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
  color: var(--accent);
  padding: 4px 11px; border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, .18);
  margin-bottom: 14px;
}
.hero-kicker::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.hero h1 {
  font-size: 31px; letter-spacing: -.03em; margin-bottom: 10px;
  background: linear-gradient(110deg, var(--text) 30%, var(--accent) 78%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-desc { color: var(--muted); font-size: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.hero-ring { width: 138px; height: 138px; position: relative; flex-shrink: 0; z-index: 1; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring-fg {
  fill: none; stroke: url(#ringGrad); stroke-width: 9; stroke-linecap: round;
  transition: stroke-dashoffset .9s cubic-bezier(.22, .8, .3, 1);
  filter: drop-shadow(0 0 7px rgba(99, 102, 241, .55));
}
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b {
  font-size: 25px; display: block; line-height: 1.1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ring-label span { font-size: 11.5px; color: var(--muted); }

/* 统计卡 */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
[data-theme="dark"] .stat-card { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px;
  background: var(--grad); opacity: 0; transition: opacity .25s;
}
.stat-card:hover::before { opacity: 1; }

.stat-ico {
  position: absolute; right: 16px; top: 15px;
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--grad-soft); color: var(--accent);
  border: 1px solid var(--line);
}
.stat-ico svg { width: 17px; height: 17px; }

.stat-label { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; padding-right: 40px; }
.stat-value {
  font-size: 26px; font-weight: 720; letter-spacing: -.035em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #0b1020, #414863);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .stat-value { background: linear-gradient(180deg, #ffffff, #b9c3d9); -webkit-background-clip: text; background-clip: text; }
.stat-value .unit {
  font-size: 12.5px; font-weight: 500; margin-left: 3px;
  -webkit-text-fill-color: var(--muted); color: var(--muted);
}
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.tone-blue .stat-ico { background: var(--blue-soft); color: var(--blue); }
.tone-red .stat-ico { background: var(--red-soft); color: var(--red); }
.tone-amber .stat-ico { background: var(--amber-soft); color: var(--amber); }
.tone-blue .stat-value { background: linear-gradient(180deg, #2f6bf0, #1e40af); -webkit-background-clip: text; background-clip: text; }
.tone-red .stat-value { background: linear-gradient(180deg, #e5484d, #b0262b); -webkit-background-clip: text; background-clip: text; }
.tone-amber .stat-value { background: linear-gradient(180deg, #e08b0a, #a85c05); -webkit-background-clip: text; background-clip: text; }

/* 章节列表 */
.chapter-list { display: flex; flex-direction: column; gap: 11px; }
.chapter-row { display: grid; grid-template-columns: 132px 1fr 44px 58px; align-items: center; gap: 12px; }
.cr-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-bar { display: flex; min-width: 0; }
.cr-num { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.cr-act { text-align: right; }

/* 图表 */
.chart {
  display: flex; align-items: flex-end; gap: 8px; height: 152px; padding-top: 10px;
  border-bottom: 1px solid var(--line-2);
}
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.chart-bar {
  width: 100%; max-width: 30px; margin: 0 auto; border-radius: 8px 8px 4px 4px;
  background: var(--grad);
  box-shadow: 0 0 14px -2px rgba(99, 102, 241, .55);
  transition: height .55s cubic-bezier(.22, .8, .3, 1), filter .2s;
}
.chart-col:hover .chart-bar { filter: brightness(1.15); }
.chart-col.zero .chart-bar { background: var(--line-2); box-shadow: none; }
.chart-x { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-v { font-size: 11px; color: var(--muted); height: 14px; font-variant-numeric: tabular-nums; }
.chart-wide { height: 172px; gap: 3px; }
.chart-wide .chart-bar { max-width: 18px; border-radius: 6px 6px 3px 3px; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px 18px; border-radius: 15px;
  border: 1px solid var(--line); background: var(--surface-2);
  transition: .2s;
}
.quick::after {
  content: "→"; position: absolute; right: 14px; bottom: 12px;
  color: var(--accent); opacity: 0; transform: translateX(-4px);
  transition: .2s; font-size: 14px;
}
.quick:hover {
  border-color: rgba(99, 102, 241, .45);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  background: linear-gradient(160deg, var(--surface-2), var(--accent-soft));
}
.quick:hover::after { opacity: 1; transform: none; }
.quick b { font-size: 14px; }
.quick span { font-size: 12.5px; color: var(--muted); }

/* ---------------- 刷题 ---------------- */
.practice-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pt-left, .pt-right { display: flex; align-items: center; gap: 10px; }

.qcard {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 28px 22px;
}
[data-theme="dark"] .qcard { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

.qmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.qcount {
  margin-left: auto; font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding: 3px 10px; border-radius: 8px; background: var(--surface-3);
}
.fav-btn { font-size: 17px; }
.fav-btn.on { color: var(--amber); }

.qstem {
  font-size: calc(18px * var(--qscale)); line-height: 1.78; font-weight: 560;
  margin-bottom: 22px; word-break: break-word; white-space: pre-wrap;
}
.qstem .blank {
  display: inline-block; width: 2.6em; height: 1em; margin: 0 1px; vertical-align: -3px;
  border-bottom: 1.5px solid currentColor; opacity: .34;
}

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  position: relative;
  display: flex; align-items: flex-start; gap: 13px; width: 100%; text-align: left;
  padding: 14px 17px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer;
  transition: border-color .16s, background .16s, box-shadow .18s, transform .16s;
  font-size: calc(15px * var(--qscale)); line-height: 1.6;
}
.opt:hover {
  border-color: rgba(99, 102, 241, .45);
  background: linear-gradient(120deg, var(--surface-2), var(--accent-soft));
  box-shadow: 0 6px 20px -14px rgba(99, 102, 241, .8);
}
.opt:active { transform: scale(.997); }

.ol {
  flex-shrink: 0; width: 25px; height: 25px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
  font-size: 12.5px; font-weight: 700; margin-top: 1px;
  border: 1px solid var(--line);
  transition: .16s;
}
.otxt { flex: 1; }

.opt.picked { border-color: var(--accent); background: var(--accent-soft); }
.opt.picked .ol { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px -4px rgba(99, 102, 241, .8); }

.opt.right { border-color: rgba(16, 185, 129, .55); background: var(--green-soft); box-shadow: 0 0 0 3px rgba(16, 185, 129, .1); }
.opt.right .ol { background: var(--green); color: #fff; border-color: transparent; }
.opt.wrong { border-color: rgba(239, 68, 68, .5); background: var(--red-soft); }
.opt.wrong .ol { background: var(--red); color: #fff; border-color: transparent; }
.opt .mark { color: var(--green); font-weight: 700; margin-left: auto; font-size: 14px; }

.opts-judge { flex-direction: row; gap: 12px; }
.opts-judge .opt { justify-content: center; align-items: center; gap: 9px; font-weight: 620; padding: 16px; }
.jicon { font-size: 16px; }
.judge-yes .jicon { color: var(--green); }
.judge-no .jicon { color: var(--red); }

.multi-tip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--accent);
  margin-top: 14px; padding: 5px 12px; border-radius: 99px;
  background: var(--accent-soft);
}

.feedback {
  margin-top: 20px; padding: 16px 18px; border-radius: 15px; font-size: 14px;
  border: 1px solid transparent;
}
.feedback.ok {
  background: var(--green-soft); border-color: rgba(16, 185, 129, .22);
  animation: fbOk .42s cubic-bezier(.22, .8, .3, 1) both;
}
.feedback.bad {
  background: var(--red-soft); border-color: rgba(239, 68, 68, .22);
  animation: fbBad .52s cubic-bezier(.36, .07, .19, .97) both;
}
@keyframes fbOk {
  0% { opacity: 0; transform: translateY(-6px) scale(.975); }
  55% { transform: translateY(0) scale(1.012); }
  100% { opacity: 1; transform: none; }
}
@keyframes fbBad {
  0% { opacity: 0; transform: translateX(0); }
  10% { opacity: 1; transform: translateX(-7px); }
  26% { transform: translateX(6px); }
  42% { transform: translateX(-4px); }
  58% { transform: translateX(3px); }
  76% { transform: translateX(-2px); }
  100% { transform: none; }
}
.fb-title { font-weight: 700; margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
.feedback.ok .fb-title { color: var(--green); }
.feedback.bad .fb-title { color: var(--red); }
.fb-answer { color: var(--text-2); font-size: 13.5px; line-height: 1.75; }
.fb-answer b { color: var(--text); }

.essay-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }

.qfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.qfoot-mid { flex: 1; display: flex; justify-content: center; }

.done-card { text-align: center; padding: 52px 24px; }
.done-ico {
  width: 68px; height: 68px; margin: 0 auto 10px; border-radius: 22px;
  display: grid; place-items: center; font-size: 28px; color: #fff;
  background: var(--grad);
  box-shadow: 0 16px 40px -14px rgba(99, 102, 241, .8);
  animation: popIn .5s cubic-bezier(.22, 1, .36, 1.2) both;
}
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.done-card h2 { margin: 6px 0 24px; }
.done-stats { display: flex; justify-content: center; gap: 40px; margin-bottom: 28px; flex-wrap: wrap; }
.done-stats div { display: flex; flex-direction: column; gap: 3px; }
.done-stats b {
  font-size: 23px; font-variant-numeric: tabular-nums; letter-spacing: -.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.done-stats span { font-size: 12.5px; color: var(--muted); }
.done-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------------- 考试 ---------------- */
.exam-config { display: flex; flex-direction: column; gap: 22px; }
.cfg-sec h4 { margin-bottom: 11px; }
.cfg-types { display: flex; flex-direction: column; gap: 9px; }
.cfg-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2);
}
.cfg-name i { font-style: normal; font-weight: 400; }
.stepper {
  display: flex; align-items: center; overflow: hidden;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
}
.stepper button {
  width: 36px; height: 34px; border: 0; background: transparent;
  cursor: pointer; font-size: 16px; color: var(--text-2); transition: .15s;
}
.stepper button:hover { background: var(--accent-soft); color: var(--accent); }
.stepper input {
  width: 56px; height: 34px; border: 0; text-align: center;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  background: var(--surface-2); font-variant-numeric: tabular-nums; font-weight: 600;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.exam-start { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 4px 0; }
.exam-start-actions { display: flex; gap: 10px; }

.exam-bar {
  display: flex; align-items: center; gap: 16px; padding: 12px 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  position: sticky; top: 68px; z-index: 20;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.exam-timer {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px;
  font-family: var(--mono); letter-spacing: .02em;
  padding: 4px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
}
.exam-timer.warn { background: var(--red-soft); color: var(--red); animation: blink 1.4s ease-in-out infinite; }
.exam-progress { flex: 1; font-size: 13.5px; color: var(--muted); }
.exam-progress b { color: var(--text); font-variant-numeric: tabular-nums; }

.exam-layout { display: grid; grid-template-columns: 1fr 238px; gap: 18px; align-items: start; }
.exam-main { min-width: 0; }
.exam-side {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  position: sticky; top: 160px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.side-title {
  font-size: 12.5px; font-weight: 600; margin-bottom: 11px; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.side-title::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--grad); }
.sheet { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; max-height: 340px; overflow: auto; }
.sheet-item {
  aspect-ratio: 1; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 12.5px; cursor: pointer;
  color: var(--text-2); transition: .14s; font-variant-numeric: tabular-nums;
}
.sheet-item:hover { border-color: var(--accent); color: var(--accent); }
.sheet-item.done {
  background: var(--grad-pill); border-color: transparent; color: #fff;
  font-weight: 650; box-shadow: 0 4px 12px -6px rgba(99, 102, 241, .9);
}
.sheet-item.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.side-legend { display: flex; gap: 14px; margin-top: 13px; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--line); margin-right: 5px; }
.dot.done { background: var(--accent); }

/* 成绩 */
.result-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 30px 32px; border-radius: 24px;
  border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow);
}
.result-hero.pass { background: radial-gradient(120% 150% at 0% 0%, var(--green-soft), transparent 60%), var(--surface); }
.result-hero.fail { background: radial-gradient(120% 150% at 0% 0%, var(--amber-soft), transparent 60%), var(--surface); }
[data-theme="dark"] .result-hero { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

.result-score { display: flex; align-items: baseline; gap: 3px; }
.result-score b {
  font-size: 50px; line-height: 1; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.result-hero.pass .result-score b { background: linear-gradient(160deg, var(--green), #22d3ee); -webkit-background-clip: text; background-clip: text; }
.result-hero.fail .result-score b { background: linear-gradient(160deg, var(--amber), #f97316); -webkit-background-clip: text; background-clip: text; }
.result-score span { font-size: 14px; color: var(--muted); }
.result-info { flex: 1; }
.result-info h2 { margin-bottom: 4px; }
.result-info p { color: var(--muted); font-size: 13.5px; }
.result-actions { display: flex; gap: 10px; }

.review-item { border-top: 1px solid var(--line-2); padding: 20px 0; }
.review-item:first-child { border-top: 0; }
.review-head { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; flex-wrap: wrap; }
.review-no {
  width: 25px; height: 25px; border-radius: 8px; background: var(--surface-3);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.review-mark { margin-left: auto; font-size: 12.5px; font-weight: 650; }
.review-item.ok .review-mark { color: var(--green); }
.review-item.bad .review-mark { color: var(--red); }
.review-item.skip .review-mark { color: var(--muted); }
.review-ans { font-size: 13.5px; color: var(--text-2); margin-top: 11px; }
.review-expl {
  font-size: 13.5px; color: var(--text-2); margin-top: 8px;
  background: var(--surface-2); padding: 11px 15px; border-radius: 11px;
  border: 1px solid var(--line-2);
}
.review-item .opts { pointer-events: none; }
.review-item .qstem { font-size: 15px; margin-bottom: 13px; }

/* ---------------- 题库列表 ---------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 13px 15px; }
.input {
  padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface-2); outline: none; transition: .16s; min-width: 0;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: rgba(99, 102, 241, .6); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.toolbar .input[type="search"] { flex: 1; min-width: 180px; }
.textarea { width: 100%; resize: vertical; line-height: 1.7; }
.result-line { margin-top: -6px; }
.result-line b { color: var(--accent); }

.list-card { padding: 6px 22px; }
.qrow {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 8px; margin: 0 -8px;
  border-bottom: 1px solid var(--line-2); border-radius: 10px;
  cursor: pointer; transition: background .15s;
}
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: var(--surface-2); }
.qrow-no {
  width: 28px; color: var(--muted); font-size: 12.5px; padding-top: 2px;
  font-variant-numeric: tabular-nums; text-align: right;
}
.qrow-main { flex: 1; min-width: 0; }
.qrow-stem { font-size: 14.5px; line-height: 1.62; margin-bottom: 7px; }
.qrow-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.qrow-act { flex-shrink: 0; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 6px 0 22px; }

/* 筛选面板 */
.filter-panel { display: flex; flex-direction: column; gap: 20px; }
.fp-group .fp-title {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
}
.chapter-picker { display: flex; flex-wrap: wrap; gap: 8px; max-height: 200px; overflow: auto; padding: 2px; }
.pick {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 10px;
  border: 1px solid var(--line); cursor: pointer;
  font-size: 13px; transition: .15s; background: var(--surface-2);
}
.pick input { display: none; }
.pick:hover { border-color: rgba(99, 102, 241, .45); }
.pick.on {
  border-color: rgba(99, 102, 241, .55);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 620;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .12);
}
.pick.on::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px rgba(99, 102, 241, .9);
}
.fp-summary { font-size: 13.5px; color: var(--text-2); padding-top: 12px; border-top: 1px solid var(--line-2); }
.fp-summary b { color: var(--accent); font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------------- 导入导出 ---------------- */
.import-box { display: flex; flex-direction: column; gap: 15px; }
.dropzone {
  border: 1.5px dashed var(--line); border-radius: 16px; padding: 30px;
  text-align: center; cursor: pointer; transition: .18s; background: var(--surface-2);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dz-ico {
  font-size: 22px; color: var(--accent); margin: 0 auto 8px;
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.or { text-align: center; font-size: 12.5px; color: var(--muted); }
.import-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.import-tip { line-height: 1.75; }
.preview-chips { margin-bottom: 11px; }
.preview-list { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow: auto; }
.preview-item {
  padding: 10px 14px; background: var(--surface-2); border-radius: 11px;
  font-size: 13px; border: 1px solid var(--line-2);
}
.export-list { display: flex; flex-direction: column; gap: 10px; }
.export-item {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface-2); cursor: pointer; transition: .18s;
}
.export-item:hover {
  border-color: rgba(99, 102, 241, .5);
  background: linear-gradient(120deg, var(--surface-2), var(--accent-soft));
  transform: translateX(2px);
}
.export-item span { font-size: 12.5px; color: var(--muted); }

/* ---------------- 统计 ---------------- */
.type-stats { display: flex; flex-direction: column; gap: 13px; }
.ts-row { display: grid; grid-template-columns: 76px 1fr 50px 54px; align-items: center; gap: 10px; }
.ts-bar { display: flex; min-width: 0; }
.ts-num { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.history-list { display: flex; flex-direction: column; gap: 10px; }
.h-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.h-type { padding: 1px 9px; border-radius: 7px; font-size: 11.5px; background: var(--surface-3); color: var(--muted); font-weight: 600; }
.h-type.exam { background: var(--amber-soft); color: var(--amber); }
.h-name { flex: 1; }
.h-num { font-weight: 600; font-variant-numeric: tabular-nums; }

.chapter-table { display: flex; flex-direction: column; gap: 10px; }
.ct-row { display: grid; grid-template-columns: 196px 1fr 44px 54px 54px; align-items: center; gap: 12px; font-size: 13.5px; }
.ct-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-bar { display: flex; min-width: 0; }
.ct-num { text-align: right; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ct-sub { text-align: right; }
.ct-acc { text-align: right; font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; }
.ct-acc.good { color: var(--green); }
.ct-acc.mid { color: var(--amber); }
.ct-acc.low { color: var(--red); }

/* ---------------- 设置 ---------------- */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 0; border-bottom: 1px solid var(--line-2);
}
.set-row:last-child { border-bottom: 0; }
.set-row.flat { padding: 0; border-bottom: 0; }

.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.switch-row.slim { padding: 0 4px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { display: none; }
.switch i {
  position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px;
  transition: .22s; border: 1px solid var(--line);
}
.switch i::after {
  content: ""; position: absolute; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .22s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.switch input:checked + i { background: var(--grad); border-color: transparent; box-shadow: 0 4px 14px -6px rgba(99, 102, 241, .9); }
.switch input:checked + i::after { transform: translateX(20px); }

.about p { margin-bottom: 8px; font-size: 13.5px; color: var(--text-2); }

/* ---------------- 弹层 / 提示 ---------------- */
.modal-open { overflow: hidden; }
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 9, 20, .5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; width: 100%; max-width: 520px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .55);
  animation: pop .24s cubic-bezier(.22, 1, .36, 1.1);
}
[data-theme="dark"] .modal {
  background: #0c1019;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, .7), transparent);
}
.modal-md { max-width: 620px; }
.modal-lg { max-width: 790px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 10px; }
.modal-body { padding: 4px 22px 20px; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 15px 22px;
  border-top: 1px solid var(--line-2); background: var(--surface-3);
}
.answer-block {
  white-space: pre-wrap; line-height: 1.85; font-size: 14px;
  background: var(--surface-2); padding: 15px 17px; border-radius: 12px;
  border: 1px solid var(--line-2);
}
.detail-ans { font-size: 13.5px; color: var(--text-2); margin-top: 13px; line-height: 1.75; }
.detail-ans b { color: var(--green); }
.detail-meta { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line-2); }

.toast {
  position: fixed; left: 50%; bottom: 36px; z-index: 200;
  transform: translate(-50%, 16px);
  padding: 11px 22px; border-radius: 13px; font-size: 13.5px;
  background: rgba(16, 20, 32, .94); color: #fff;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .7);
  opacity: 0; pointer-events: none; transition: .24s; max-width: 84vw; text-align: center;
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-ok { background: linear-gradient(135deg, #10b981, #0d9488); border-color: transparent; }
.toast-warn { background: linear-gradient(135deg, #f59e0b, #ea580c); border-color: transparent; }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); border-color: transparent; }

/* ---------------- 打印 ---------------- */
#print-area { display: none; }
@media print {
  body::before, body::after { display: none !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; padding: 0; color: #000; font-size: 12pt; }
  #print-area h1 { font-size: 18pt; text-align: center; margin-bottom: 4pt; }
  .print-meta { text-align: center; color: #666; font-size: 10pt; margin-bottom: 14pt; }
  .print-q { page-break-inside: avoid; margin-bottom: 14pt; }
  .pq-stem { font-weight: 600; margin-bottom: 4pt; line-height: 1.6; white-space: pre-wrap; }
  .pq-opts { display: flex; flex-wrap: wrap; gap: 4pt 18pt; margin-bottom: 4pt; }
  .pq-ans { color: #444; border-top: 1px dashed #bbb; padding-top: 3pt; font-size: 10.5pt; }
  .pq-blank { height: 18pt; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 940px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .exam-layout { grid-template-columns: 1fr; }
  .exam-side { position: static; order: -1; }
  .sheet { grid-template-columns: repeat(10, 1fr); max-height: none; }
  .ct-row { grid-template-columns: 130px 1fr 40px 48px; }
  .ct-sub { display: none; }
  .chapter-row { grid-template-columns: 108px 1fr 40px; }
  .cr-act { display: none; }
}

@media (max-width: 780px) {
  .topbar { height: 56px; padding: 0 15px; }
  .nav { display: none; }
  .brand-text { font-size: 14.5px; }
  .page { padding: 18px 14px 96px; gap: 14px; }
  .tabbar {
    display: flex; position: fixed; z-index: 60;
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 6px; border-radius: 18px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45);
  }
  .tabbar a {
    flex: 1; text-align: center; padding: 8px 0; font-size: 12px;
    color: var(--muted); border-radius: 12px; transition: .16s;
  }
  .tabbar a.active { color: #fff; background: var(--grad-pill); font-weight: 600; box-shadow: 0 6px 16px -8px rgba(99, 102, 241, .9); }
  .hero { padding: 24px; flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero h1 { font-size: 24px; }
  .hero-ring { width: 100%; height: 92px; }
  .hero-ring .ring { display: none; }
  .ring-label { position: static; display: flex; align-items: baseline; gap: 7px; }
  .ring-label b { font-size: 30px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 15px 16px; }
  .stat-value { font-size: 22px; }
  .stat-ico { width: 30px; height: 30px; right: 13px; top: 13px; }
  .qcard { padding: 19px 16px 17px; border-radius: 17px; }
  .qstem { font-size: calc(16.5px * var(--qscale)); }
  .exam-bar { top: 58px; padding: 10px 13px; }
  .ct-row { grid-template-columns: 104px 1fr 38px 44px; }
  .chart { height: 122px; }
  .modal-mask { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; }
  .qfoot .btn { flex: 1; }
  .qfoot-mid { flex: 0 0 auto; }
  .cfg-row { flex-wrap: wrap; }
}

@media (max-width: 430px) {
  .brand-text { display: none; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .chips { gap: 6px; }
  .chip { font-size: 12px; padding: 3px 9px; }
  .hero-actions .btn { flex: 1; }
}

/* ---------------- 动效偏好 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* =============================================================
   AI 解答
   ============================================================= */
.qfoot-mid { gap: 8px; }

.ai-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, .28);
  color: var(--accent);
  font-weight: 600;
}
.ai-btn:hover {
  background: linear-gradient(120deg, var(--accent-soft), rgba(34, 211, 238, .14));
  border-color: rgba(99, 102, 241, .55);
  box-shadow: 0 6px 18px -12px rgba(99, 102, 241, .9);
}
.ai-spark {
  font-size: 13px; line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sparkle 2.6s ease-in-out infinite;
}
@keyframes sparkle {
  0%, 100% { opacity: 1; transform: rotate(0deg) scale(1); }
  50% { opacity: .55; transform: rotate(90deg) scale(1.12); }
}

/* 面板 */
.ai-q {
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  margin-bottom: 14px;
}
.ai-q-type {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
  padding: 1px 8px; border-radius: 6px; margin-bottom: 6px;
}
.ai-q-stem { font-size: 14px; line-height: 1.7; color: var(--text-2); }

.ai-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--accent); margin-bottom: 10px;
}
.ai-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
  animation: blink 1.2s ease-in-out infinite;
}
.ai-status.done { color: var(--muted); }
.ai-status.done .ai-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(16, 185, 129, .16); animation: none; }
.ai-status.error { color: var(--red); }
.ai-status.error .ai-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 68, 68, .16); animation: none; }

.ai-result { min-height: 70px; font-size: 14px; line-height: 1.85; }
.ai-line { margin: 0 0 8px; }
.ai-line:last-child { margin-bottom: 0; }
.ai-k {
  display: inline-block; font-weight: 700; color: var(--accent);
  margin-right: 8px;
}
.ai-caret {
  display: inline-block; width: 7px; height: 15px; vertical-align: -2px;
  background: var(--accent); border-radius: 1px;
  animation: blink 1s step-end infinite;
}
.ai-error {
  padding: 12px 14px; border-radius: 11px; font-size: 13px; line-height: 1.7;
  background: var(--red-soft); color: var(--red);
  border: 1px solid rgba(239, 68, 68, .22);
}
.ai-foot-note { margin-right: auto; font-size: 12.5px; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2);
}
.ai-badge.ok { background: var(--green-soft); color: var(--green); }
.ai-badge.bad { background: var(--amber-soft); color: var(--amber); }

/* 设置里的配置区 */
.ai-config { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-config .af:nth-child(1) { grid-column: span 2; }
.ai-config-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ai-config-msg { flex: 1; min-width: 120px; }
.ok-text { color: var(--green); }
.bad-text { color: var(--red); }

@media (max-width: 780px) {
  .ai-config { grid-template-columns: 1fr; }
  .ai-config .af:nth-child(1) { grid-column: span 1; }
  .qfoot-mid { flex-wrap: wrap; }
}

/* =============================================================
   动效增强
   ============================================================= */

/* 顶栏浮起 */
.topbar { transition: box-shadow .3s ease, background .3s ease; }
.topbar.scrolled { box-shadow: 0 12px 34px -22px rgba(16, 24, 64, .5); }
[data-theme="dark"] .topbar.scrolled { box-shadow: 0 12px 34px -18px rgba(0, 0, 0, .95); }

/* 选项交错入场 */
@keyframes optIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
.opts .opt { animation: optIn .36s cubic-bezier(.22, .8, .3, 1) backwards; }
.opts .opt:nth-child(1) { animation-delay: .02s; }
.opts .opt:nth-child(2) { animation-delay: .07s; }
.opts .opt:nth-child(3) { animation-delay: .12s; }
.opts .opt:nth-child(4) { animation-delay: .17s; }
.opts .opt:nth-child(5) { animation-delay: .22s; }
.opts .opt:nth-child(6) { animation-delay: .27s; }
.opts .opt:nth-child(7) { animation-delay: .32s; }
.opts .opt:nth-child(8) { animation-delay: .37s; }

/* 答题后选中的那个选项轻微弹一下 */
@keyframes rightPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.014); }
  100% { transform: scale(1); }
}
.opt.right { animation: rightPop .46s cubic-bezier(.22, .8, .3, 1) backwards; }

/* 同题重绘时不重放入场动画（但答题反馈该动还是要动） */
.no-anim .qcard { animation: none !important; }
.no-anim .qcard .opts .opt { animation: none !important; }
.no-anim .qcard .opts .opt.right { animation: rightPop .46s cubic-bezier(.22, .8, .3, 1) backwards !important; }

/* 切题方向 */
@keyframes slideNext {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: none; }
}
@keyframes slidePrev {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: none; }
}
.qcard.slide-next { animation: slideNext .34s cubic-bezier(.22, .8, .3, 1) backwards; }
.qcard.slide-prev { animation: slidePrev .34s cubic-bezier(.22, .8, .3, 1) backwards; }

/* 撒花画布 */
.confetti-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 260;
}

/* 首页大环：进入时轻微放大 */
@keyframes ringIn {
  from { opacity: 0; transform: scale(.9) rotate(-90deg); }
  to { opacity: 1; transform: scale(1) rotate(-90deg); }
}
.ring { animation: ringIn .6s cubic-bezier(.22, .8, .3, 1) backwards; }

/* 统计卡依次亮起 */
@keyframes statIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.stat-row .stat-card { animation: statIn .42s cubic-bezier(.22, .8, .3, 1) backwards; }
.stat-row .stat-card:nth-child(1) { animation-delay: .02s; }
.stat-row .stat-card:nth-child(2) { animation-delay: .07s; }
.stat-row .stat-card:nth-child(3) { animation-delay: .12s; }
.stat-row .stat-card:nth-child(4) { animation-delay: .17s; }

/* 完成态图标：外圈扩散 */
.done-ico { position: relative; }
.done-ico::after {
  content: ""; position: absolute; inset: -6px; border-radius: 28px;
  border: 2px solid var(--accent); opacity: 0;
  animation: haloOut 1.8s ease-out .3s infinite;
}
@keyframes haloOut {
  0% { opacity: .45; transform: scale(.88); }
  70% { opacity: 0; transform: scale(1.32); }
  100% { opacity: 0; transform: scale(1.32); }
}

@media (prefers-reduced-motion: reduce) {
  .done-ico::after { animation: none; }
  .ring { animation: none; }
  .opts .opt, .stat-row .stat-card, .opt.right, .qcard.slide-next, .qcard.slide-prev { animation: none; }
}

/* =============================================================
   多科目 / 150 分试卷
   ============================================================= */
.cfg-hint { margin-top: 8px; }

.cfg-nums { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cfg-x { color: var(--muted); font-size: 13px; }
.cfg-score {
  width: 66px; text-align: center; padding: 8px 6px;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.cfg-sub {
  min-width: 46px; text-align: right;
  font-variant-numeric: tabular-nums; color: var(--text-2);
}
.cfg-row.cfg-disabled { opacity: .45; }

.cfg-total {
  display: flex; align-items: baseline; gap: 6px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: 13px; color: var(--text-2);
}
.cfg-total b {
  font-size: 24px; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--amber), #f97316);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cfg-total.ok { background: var(--green-soft); border-color: rgba(16, 185, 129, .25); }
.cfg-total.ok b {
  background: linear-gradient(180deg, var(--green), #22d3ee);
  -webkit-background-clip: text; background-clip: text;
}

/* 主观题自评 */
.grade-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 14px;
  border-radius: 12px; background: var(--accent-soft);
  border: 1px solid rgba(99, 102, 241, .22);
}
.grade-input {
  width: 78px; text-align: center; padding: 7px 8px;
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px;
}

/* 多行参考答案 */
.review-expl, .fb-answer { white-space: pre-wrap; }
.review-expl b, .fb-answer b { white-space: normal; }

/* 打印：分值 */
.pq-score { font-weight: 400; color: #666; }

/* 科目标签 */
.subject-tag {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 7px; font-size: 12px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  white-space: nowrap;
}

/* 「关于」里的题库备注 */
.about-note {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--amber-soft);
  border: 1px solid rgba(217, 119, 6, .24);
}
.an-title { font-weight: 700; font-size: 14px; color: var(--amber); margin-bottom: 6px; }
.an-body { font-size: 13px; line-height: 1.7; color: var(--text-2); }
.an-meta {
  margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed rgba(217, 119, 6, .3);
  font-size: 12.5px; line-height: 1.85; color: var(--text-2);
}
.an-meta b { color: var(--text); font-weight: 600; }

/* 「关于」里的公式说明（蓝色版） */
.about-note.info { background: var(--accent-soft); border-color: rgba(91, 84, 240, .22); }
.about-note.info .an-title { color: var(--accent); }
.about-note.info .an-meta { border-top-color: rgba(91, 84, 240, .25); }

@media (max-width: 780px) {
  .cfg-nums { justify-content: flex-start; width: 100%; }
  .cfg-row { gap: 8px; }
  .cfg-sub { min-width: 0; }
}

/* =============================================================
   主观题：写答案 + 对比
   ============================================================= */
.essay-block { margin-top: 20px; }
.essay-label {
  font-size: 13px; color: var(--text-2); margin-bottom: 9px; font-weight: 600;
}
.essay-input {
  width: 100%; box-sizing: border-box;
  min-height: 110px; padding: 14px 16px;
  border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 14.5px; line-height: 1.8;
  resize: vertical; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.essay-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.essay-input[readonly] { background: var(--surface-3); color: var(--text-2); }
.essay-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px;
}

/* 对比面板 */
.essay-compare { margin-top: 18px; }
.ec-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.ec-col {
  border-radius: 14px; padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  min-width: 0;
}
.ec-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
  margin-bottom: 9px;
}
.ec-tag {
  font-weight: 500; font-size: 11.5px;
  padding: 1px 7px; border-radius: 6px;
  background: var(--green-soft); color: var(--green);
}
.ec-body {
  font-size: 14px; line-height: 1.8; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  max-height: 380px; overflow: auto;
}
.ec-body mark {
  background: rgba(16, 185, 129, .18);
  color: inherit; border-radius: 3px; padding: 0 1px;
}
.ec-stat {
  margin-top: 12px; padding: 10px 14px;
  border-radius: 12px; background: var(--green-soft);
  font-size: 13px; color: var(--text-2);
}
.ec-stat b { color: var(--green); font-size: 15px; }
.ec-stat .muted { margin-left: 8px; }

@media (max-width: 780px) {
  .ec-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   化学式上下标
   ============================================================= */
.qstem sub, .qstem sup,
.otxt sub, .otxt sup,
.fb-answer sub, .fb-answer sup,
.review-expl sub, .review-expl sup,
.ec-body sub, .ec-body sup,
.answer-block sub, .answer-block sup,
.detail-ans sub, .detail-ans sup,
.pq-stem sub, .pq-stem sup,
.pq-opts sub, .pq-opts sup {
  font-size: .72em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
.qstem sub, .otxt sub, .fb-answer sub, .review-expl sub, .ec-body sub,
.answer-block sub, .detail-ans sub, .pq-stem sub, .pq-opts sub { bottom: -.28em; }
.qstem sup, .otxt sup, .fb-answer sup, .review-expl sup, .ec-body sup,
.answer-block sup, .detail-ans sup, .pq-stem sup, .pq-opts sup { top: -.45em; }
/* 语音输入 */
.essay-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px;
}
.mic-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .18s;
}
.mic-btn:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}
.mic-btn:disabled { opacity: .45; cursor: not-allowed; }
.mic-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); transition: background .2s;
}
.mic-btn.on {
  border-color: var(--red); color: var(--red); background: var(--red-soft);
}
.mic-btn.on .mic-dot {
  background: var(--red);
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); }
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}
.mic-hint { flex: 1; min-width: 140px; }
.mic-hint:empty { display: none; }
.mic-btn.pending { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.mic-btn.pending .mic-dot {
  background: var(--amber);
  animation: micPulse 1.2s ease-in-out infinite;
}
.mic-tip {
  display: block; line-height: 1.7; padding: 9px 13px;
  border-radius: 11px; background: var(--surface-2);
  border: 1px dashed var(--line-2);
}
.mic-diag {
  border: 0; background: none; padding: 2px 4px;
  font: inherit; font-size: 12px; color: var(--muted);
  text-decoration: underline dotted; cursor: pointer;
}
.mic-diag:hover { color: var(--accent); }
.diag-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.diag-table th {
  text-align: left; font-weight: 600; color: var(--text-2);
  padding: 7px 12px 7px 0; white-space: nowrap; vertical-align: top;
  width: 108px;
}
.diag-table td { padding: 7px 0; word-break: break-all; }
.diag-table tr { border-bottom: 1px solid var(--line-2); }
.diag-tip {
  margin-top: 16px; padding: 13px 16px; border-radius: 12px;
  background: var(--amber-soft); font-size: 13px; line-height: 1.8;
  color: var(--text-2);
}
.diag-tip ol { margin: 6px 0 6px 18px; padding: 0; }
.diag-tip li { margin: 4px 0; }
.diag-tip p { margin: 0 0 4px; }
/* =============================================================
   质感升级：胶片颗粒 / 暗角 / 玻璃 / 首屏
   ============================================================= */

/* ---- 1. 全局氛围：暗角 + 胶片颗粒 ---- */
html[data-fx="on"]::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -10%, transparent 42%, rgba(16, 24, 64, .06) 100%),
    radial-gradient(90% 80% at 50% 120%, transparent 45%, rgba(16, 24, 64, .05) 100%);
}
[data-theme="dark"] html[data-fx="on"]::before {
  background:
    radial-gradient(120% 90% at 50% -10%, transparent 38%, rgba(0, 0, 0, .45) 100%),
    radial-gradient(90% 80% at 50% 120%, transparent 42%, rgba(0, 0, 0, .38) 100%);
}
html[data-fx="on"]::after {
  content: ""; position: fixed; inset: -50%; z-index: 0; pointer-events: none;
  opacity: .32; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 8s steps(6) infinite;
}
[data-theme="dark"] html[data-fx="on"]::after { opacity: .22; }
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-2%, 1%); }
  40% { transform: translate(1%, -2%); }
  60% { transform: translate(-1%, 2%); }
  80% { transform: translate(2%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ---- 2. 玻璃卡片：内高光 + 双层投影 ---- */
.card, .stat-card, .qcard, .hero, .exam-config, .list-card {
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}
.card, .stat-card, .list-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 1px 2px rgba(16, 24, 64, .04),
    0 14px 34px -18px rgba(16, 24, 64, .18);
}
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .list-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 1px 2px rgba(0, 0, 0, .4),
    0 18px 40px -20px rgba(0, 0, 0, .7);
}

/* ---- 3. 首屏 hero ---- */
.hero {
  border-radius: 30px;
  padding: 44px 46px 40px;
  gap: 40px;
  background:
    radial-gradient(110% 160% at 100% -20%, rgba(34, 211, 238, .16), transparent 52%),
    radial-gradient(110% 160% at -10% 120%, rgba(139, 92, 246, .18), transparent 55%),
    radial-gradient(70% 100% at 50% 0%, rgba(255, 255, 255, .5), transparent 70%),
    var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .75),
    0 1px 2px rgba(16, 24, 64, .04),
    0 30px 60px -34px rgba(63, 61, 180, .45);
  isolation: isolate;
}
[data-theme="dark"] .hero {
  background:
    radial-gradient(110% 160% at 100% -20%, rgba(34, 211, 238, .14), transparent 52%),
    radial-gradient(110% 160% at -10% 120%, rgba(139, 92, 246, .2), transparent 55%),
    radial-gradient(70% 100% at 50% 0%, rgba(255, 255, 255, .06), transparent 70%),
    var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    0 30px 70px -36px rgba(0, 0, 0, .9);
}
/* 顶部的流动光带 */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, .7), rgba(34, 211, 238, .6), transparent);
  opacity: .8;
}

.hero-kicker {
  font-size: 12.5px; padding: 5px 13px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--accent-soft) 70%, #fff 30%);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
[data-theme="dark"] .hero-kicker {
  background: rgba(129, 140, 248, .16);
  color: #c7cbff;
  border-color: rgba(129, 140, 248, .3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.hero h1 {
  font-size: 40px; line-height: 1.2; letter-spacing: -.035em; font-weight: 750;
  margin-bottom: 14px;
  background: linear-gradient(105deg, var(--text) 12%, var(--text) 46%, var(--accent) 82%, var(--accent-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.hero-desc {
  font-size: 14.5px; color: var(--text-2); letter-spacing: .002em;
  max-width: 46ch;
}
.hero-actions { margin-top: 26px; gap: 12px; }

/* 环形进度再精修 */
.hero-ring { width: 156px; height: 156px; }

.ring-bg { stroke-width: 7; opacity: .75; }
.ring-fg { stroke-width: 7; filter: drop-shadow(0 0 10px rgba(99, 102, 241, .45)); }
.ring-label b { font-size: 30px; font-weight: 700; }

/* ---- 4. 文字质感 ---- */
h1, h2, h3 { text-wrap: balance; }
.card-head h2, .page-head h1 { letter-spacing: -.026em; }
.card-head h2 { font-weight: 700; }
.stat-value { letter-spacing: -.03em; font-weight: 700; }
.muted.small, .small { letter-spacing: .004em; }

/* 按钮：内高光 */
.btn-primary {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 10px 24px -12px rgba(91, 84, 240, .75);
}
.btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    0 16px 34px -14px rgba(91, 84, 240, .8);
}

/* 顶栏：更薄的玻璃 */
.topbar {
  backdrop-filter: saturate(200%) blur(22px);
  -webkit-backdrop-filter: saturate(200%) blur(22px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5), 0 10px 30px -26px rgba(16, 24, 64, .5);
}
[data-theme="dark"] .topbar {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 10px 30px -22px rgba(0, 0, 0, .8);
}

@media (max-width: 780px) {
  .hero { padding: 28px 24px 26px; border-radius: 24px; gap: 20px; }
  .hero h1 { font-size: 28px; }
  .hero-desc { font-size: 13.5px; }
  .hero-ring { width: 112px; height: 112px; }
  .ring-label b { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html::after { animation: none; }
}
/* 首屏精修 v2 */
[data-theme="light"] .hero {
  background:
    radial-gradient(120% 170% at 104% -30%, rgba(34, 211, 238, .2), transparent 50%),
    radial-gradient(120% 170% at -8% 130%, rgba(139, 92, 246, .18), transparent 52%),
    radial-gradient(80% 120% at 30% -40%, rgba(255, 255, 255, .7), transparent 62%),
    rgba(255, 255, 255, .5);
}
[data-theme="light"] .hero h1 {
  background: linear-gradient(104deg, #1b1f3b 8%, #2a2f5c 40%, #5b54f0 78%, #22b8d8 100%);
  -webkit-background-clip: text; background-clip: text;
}
[data-theme="dark"] .hero h1 {
  background: linear-gradient(104deg, #f4f5ff 6%, #dfe2ff 42%, #a5aaff 76%, #6ee7f5 100%);
  -webkit-background-clip: text; background-clip: text;
}
/* 首屏底部一条极淡的暗角，增加纵深 */
.hero > * { position: relative; z-index: 1; }
.hero::after { z-index: 0; }
/* =============================================================
   质感 v3：真玻璃 / 纵深 / 层级
   ============================================================= */

/* ---- 1. 浅色：底色压深一点，卡片改成半透明，玻璃才「透」得出来 ---- */
[data-theme="light"] {
  --bg: #e7ebf6;
  --surface: rgba(255, 255, 255, .66);
  --surface-2: rgba(255, 255, 255, .72);
  --line: rgba(18, 26, 66, .10);
  --line-2: rgba(18, 26, 66, .055);
}
[data-theme="dark"] {
  --surface: rgba(255, 255, 255, .05);
}

/* ---- 2. 背景：点阵只留在首屏附近，往下化开 ---- */
body {
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 32%, var(--bg) 92%),
    radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
  background-size: auto, 22px 22px;
  background-attachment: fixed, fixed;
  background-color: var(--bg);
}

/* 极光随滚动轻微位移，制造前后层视差 */
body::before { top: calc(-22vw + var(--bg-shift, 0px)); }
body::after { bottom: calc(-22vw - var(--bg-shift, 0px)); }

/* 顶栏下沿的一道光 */
.topbar { position: sticky; }
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent 4%, rgba(99, 102, 241, .55) 32%, rgba(34, 211, 238, .5) 62%, transparent 96%);
  opacity: .75; pointer-events: none;
}

/* ---- 3. 层级：L1 首屏 / L2 卡片 / L3 内嵌块 ---- */
/* L1 */
.hero {
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
}
/* L2 */
.card, .stat-card, .list-card, .qcard, .exam-config, .result-hero {
  backdrop-filter: blur(20px) saturate(155%);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
}
/* L2 的边缘更实一点，玻璃才有厚度 */
[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .list-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 0 0 1px rgba(255, 255, 255, .35),
    0 1px 2px rgba(16, 24, 64, .05),
    0 18px 40px -22px rgba(16, 24, 64, .28);
}
/* L3：卡片内部的块不做玻璃，保证密度和可读性 */
.set-row, .qrow, .ec-col, .opt, .filter-panel, .review-item, .stat-row .stat-card .stat-value {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* 输入类控件保持实底，避免文字压在花背景上 */
.essay-input, .input, select.input, textarea.input {
  background-color: var(--surface-solid, #fff);
}
[data-theme="light"] .essay-input,
[data-theme="light"] .input {
  background-color: rgba(255, 255, 255, .88);
}
[data-theme="dark"] .essay-input,
[data-theme="dark"] .input {
  background-color: rgba(255, 255, 255, .06);
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { transition: none; }
}
/* =============================================================
   质感 v4：章节配色 / 首屏仪表 / 留白节奏
   ============================================================= */

/* ---- ⑤ 章节色彩编码 ---- */
.ch-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ch, var(--accent));
  margin-right: 8px; vertical-align: 1px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ch, var(--accent)) 16%, transparent);
}
.chapter-row .bar > i,
.ct-row .bar > i { box-shadow: 0 0 10px -2px var(--ch, transparent); }
.cr-name, .ct-name { display: flex; align-items: center; }

/* ---- ④ 首屏仪表盘：外圈刻度 ---- */
.hero-ring::before {
  content: ""; position: absolute; inset: -16px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg,
    color-mix(in srgb, var(--accent) 42%, transparent) 0deg 1.1deg,
    transparent 1.1deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 0 63%, #000 63.5%, #000 65%, transparent 65.5%);
  mask: radial-gradient(circle, transparent 0 63%, #000 63.5%, #000 65%, transparent 65.5%);
  opacity: .55;
  animation: ringSpin 90s linear infinite;
  pointer-events: none;
}
/* 再外一圈极淡的轨道 */
.hero-ring::after {
  content: ""; position: absolute; inset: -30px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  pointer-events: none;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

/* ---- ⑥ 留白节奏 ---- */
.page { gap: 22px; padding: 32px 24px 84px; }
.card { padding: 22px 26px; }
.hero + .stat-row { margin-top: 2px; }
.page-head { margin-bottom: 4px; }
.card-head { margin-bottom: 16px; }
.set-row { padding: 16px 0; }

@media (max-width: 780px) {
  .page { gap: 18px; padding: 20px 16px 92px; }
  .card { padding: 18px 18px; }
  .hero-ring::before { inset: -10px; }
  .hero-ring::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ring::before { animation: none; }
}
/* =============================================================
   复习计划
   ============================================================= */
.plan-date-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.plan-date-row .input { width: 190px; padding: 9px 12px; }

/* 今日任务 */
.plan-today-main { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.plan-big { display: flex; align-items: baseline; gap: 2px; }
.plan-big b {
  font-size: 34px; font-weight: 750; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.plan-big span { color: var(--muted); font-size: 14px; }
.plan-today-bar { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 7px; }
.plan-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 日历条 */
.plan-cal {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}
.plan-day {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  height: 50px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.pd-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.plan-day.done { background: var(--green-soft); border-color: rgba(16, 185, 129, .3); color: var(--green); }
.plan-day.done .pd-dot { background: var(--green); }
.plan-day.part { background: var(--amber-soft); border-color: rgba(245, 158, 11, .3); color: var(--amber); }
.plan-day.part .pd-dot { background: var(--amber); }
.plan-day.miss { background: var(--red-soft); border-color: rgba(239, 68, 68, .25); color: var(--red); }
.plan-day.miss .pd-dot { background: var(--red); }
.plan-day.today { box-shadow: 0 0 0 2px var(--accent-soft); border-color: var(--accent); }

/* 首页小条 */
.plan-strip {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 10px 26px -18px rgba(16, 24, 64, .3);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  transition: transform .18s, box-shadow .18s;
}
.plan-strip:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 16px 34px -18px rgba(16, 24, 64, .35); }
.ps-left { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.ps-days { font-size: 26px; font-weight: 750; letter-spacing: -.03em; color: var(--accent); font-variant-numeric: tabular-nums; }
.ps-unit { font-size: 12px; color: var(--muted); }
.ps-sep { width: 1px; height: 14px; background: var(--line); margin: 0 8px; align-self: center; }
.ps-text { font-size: 13.5px; color: var(--text-2); }
.ps-bar { flex: 1; min-width: 100px; }
.ps-go { font-size: 13px; font-weight: 650; color: var(--accent); white-space: nowrap; }

@media (max-width: 780px) {
  .plan-today-main { gap: 14px; }
  .plan-big b { font-size: 28px; }
  .plan-cal { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
  .plan-day { height: 44px; font-size: 11.5px; }
  .plan-strip { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .ps-bar { order: 3; flex-basis: 100%; }
}
/* 计划切换条 */
.plan-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.plan-tab {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 10px 16px; border-radius: 13px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text-2); font: inherit; text-align: left;
  transition: all .18s;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.plan-tab:hover { border-color: var(--accent); color: var(--text); }
.plan-tab.on {
  background: var(--accent-soft); border-color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 8px 20px -14px rgba(91, 84, 240, .8);
}
.pt-name { font-size: 13.5px; font-weight: 650; }
.pt-meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.plan-tab.add { justify-content: center; border-style: dashed; }
.plan-tab.add .pt-name { color: var(--accent); }
.ps-more {
  font-size: 11.5px; color: var(--muted);
  padding: 1px 7px; border-radius: 6px; background: var(--surface-2);
  margin-left: 6px;
}
@media (max-width: 780px) {
  .plan-tab { padding: 8px 12px; }
  .pt-name { font-size: 12.5px; }
}
/* =============================================================
   插图题：题干配图 / 选项配图
   ============================================================= */
.stem-img {
  display: block; max-width: 100%; height: auto;
  margin: 14px 0 4px; border-radius: 10px;
  background: #fff; padding: 6px;
  border: 1px solid var(--line-2);
}
[data-theme="dark"] .stem-img { background: #f7f8fc; }

.opt.has-img { align-items: center; }
.opt-img {
  display: block; max-width: 100%; height: auto;
  max-height: 132px; object-fit: contain;
  border-radius: 8px; background: #fff; padding: 5px 8px;
  border: 1px solid var(--line-2);
  margin: 2px 0;
}
[data-theme="dark"] .opt-img { background: #f7f8fc; }
.opt.has-img .mark { align-self: center; }

/* 打印时保留插图 */
.pq-opts img, .pq-stem img { max-width: 100%; }