/* ==========================================================
   上岸刷题 · 教师招聘考试
   手机 / PC 双端自适应
   ========================================================== */

:root {
  --brand: #4f63f6;
  --brand-2: #7c5cfc;
  --brand-soft: #eef1ff;
  --brand-ink: #3346d6;
  --ok: #0ca678;
  --ok-soft: #e6f8f1;
  --bad: #f0506e;
  --bad-soft: #fdeef1;
  --warn: #f59f00;
  --warn-soft: #fff5e0;

  --bg: #f4f6fb;
  --bg-2: #eaeef7;
  --card: #ffffff;
  --card-2: #f8faff;
  --line: #e6eaf3;
  --line-strong: #d5dbe9;
  --text: #1a2033;
  --text-2: #4a5468;
  --muted: #7b8499;

  --shadow-sm: 0 1px 2px rgba(26, 32, 51, .05), 0 2px 8px rgba(26, 32, 51, .04);
  --shadow: 0 4px 16px rgba(26, 32, 51, .06), 0 1px 3px rgba(26, 32, 51, .05);
  --shadow-lg: 0 18px 48px rgba(26, 32, 51, .14);

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 22px;
  --r-full: 999px;

  --sidebar-w: 248px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --brand: #7b8cff;
  --brand-2: #a78bfa;
  --brand-soft: #1e2547;
  --brand-ink: #c3ccff;
  --ok: #37d9a8;
  --ok-soft: #10291f;
  --bad: #ff6b85;
  --bad-soft: #2e1720;
  --warn: #f7b731;
  --warn-soft: #2b2312;

  --bg: #0d1016;
  --bg-2: #12161f;
  --card: #161b25;
  --card-2: #1b212d;
  --line: #242b38;
  --line-strong: #313a4b;
  --text: #e9edf6;
  --text-2: #b9c1d1;
  --muted: #8b95a8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
html[data-fs="sm"] { font-size: 15px; }
html[data-fs="md"] { font-size: 16px; }
html[data-fs="lg"] { font-size: 18px; }
html[data-fs="xl"] { font-size: 20px; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sprite symbol { fill: none; }

h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); }

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

/* ---------- shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 26px 16px 20px;
  border-right: 1px solid var(--line);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 18px; }
.brand-mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 34%, transparent);
}
.brand-mark svg { width: 22px; height: 22px; stroke-width: 2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 1.06rem; letter-spacing: .02em; }
.brand-text span { font-size: .72rem; color: var(--muted); letter-spacing: .12em; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: .95rem;
  font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease);
  position: relative;
}
.nav-item svg { width: 20px; height: 20px; opacity: .82; }
.nav-item:hover { background: var(--card-2); color: var(--text); }
.nav-item.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav-item.on svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 20px; padding: 0 6px;
  height: 20px; line-height: 20px;
  border-radius: var(--r-full);
  background: var(--bad); color: #fff;
  font-size: .68rem; font-weight: 700; text-align: center;
}

.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px dashed var(--line); }
.side-bank { font-size: .76rem; color: var(--text-2); font-weight: 600; }
.side-tip { margin-top: 6px; font-size: .7rem; color: var(--muted); line-height: 1.6; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
}
.topbar-title { font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
.topbar-act { display: flex; align-items: center; gap: 8px; }

.streak-pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 10px;
  border-radius: var(--r-full);
  background: var(--warn-soft); color: #b26a00;
  font-size: .76rem; font-weight: 600;
}
[data-theme="dark"] .streak-pill { color: var(--warn); }
.streak-pill svg { width: 14px; height: 14px; }

.iconbtn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: transform .16s var(--ease), background .16s;
}
.iconbtn:active { transform: scale(.93); }
.iconbtn svg { width: 18px; height: 18px; }

.view {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 32px 64px;
  flex: 1;
}
.view:focus { outline: none; }

.tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0 4px;
  border-radius: 12px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 500;
  position: relative;
  transition: color .16s;
}
.tab svg { width: 21px; height: 21px; }
.tab.on { color: var(--brand); font-weight: 700; }
.tab.on svg { stroke-width: 2.2; }
.tab-badge {
  position: absolute; top: 2px; left: 50%; margin-left: 4px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--bad); color: #fff;
  font-size: .6rem; line-height: 15px; text-align: center; font-weight: 700;
}

/* ---------- generic ---------- */
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.55rem; line-height: 1.3; letter-spacing: -.01em; }
.page-head p { color: var(--muted); font-size: .86rem; margin-top: 4px; }

.sec-title { font-size: .95rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sec-title::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: linear-gradient(var(--brand), var(--brand-2)); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 20px;
  border-radius: var(--r-sm);
  font-size: .94rem; font-weight: 600;
  border: 1px solid transparent;
  transition: transform .14s var(--ease), filter .18s, background .18s, border-color .18s;
  white-space: nowrap;
  user-select: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(.975); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 28%, transparent);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--card); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 32%, transparent); }
.btn-sm { height: 34px; padding: 0 14px; font-size: .82rem; border-radius: 10px; }
.btn-lg { height: 50px; padding: 0 28px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text-2);
  font-size: .82rem; font-weight: 500;
  transition: all .16s var(--ease);
  user-select: none;
}
.chip:active { transform: scale(.96); }
.chip.on {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  color: var(--brand-ink);
  font-weight: 700;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: 6px;
  font-size: .7rem; font-weight: 700;
  background: var(--card-2); color: var(--text-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.type-single { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.badge.type-multi { background: #f3ecff; color: #6b3fc9; border-color: transparent; }
.badge.type-judge { background: #e8f7ff; color: #0b7fa8; border-color: transparent; }
.badge.type-fill { background: var(--warn-soft); color: #a76a00; border-color: transparent; }
.badge.type-short { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
[data-theme="dark"] .badge.type-multi { background: #241a3d; color: #c4a6ff; }
[data-theme="dark"] .badge.type-judge { background: #102733; color: #6fd3f5; }
[data-theme="dark"] .badge.type-fill { background: var(--warn-soft); color: var(--warn); }
[data-theme="dark"] .badge.type-single { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- home ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 26px 28px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(150, 120, 255, .38), transparent 55%),
    linear-gradient(120deg, #4a5cf0 0%, #554ef0 50%, #6d4bec 100%);
  color: #fff;
  box-shadow: 0 16px 40px color-mix(in srgb, var(--brand) 26%, transparent);
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -90px;
  width: 260px; height: 260px; border-radius: 50%;
  border: 34px solid rgba(255, 255, 255, .08);
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; position: relative; z-index: 1; }
.hero h2 { font-size: 1.42rem; line-height: 1.4; letter-spacing: .01em; }
.hero p { margin-top: 6px; font-size: .85rem; color: rgba(255, 255, 255, .78); }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero .btn-hero {
  background: #fff; color: #3346d6;
  box-shadow: 0 8px 20px rgba(10, 15, 40, .18);
}
.hero .btn-hero-ghost {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
}
.hero-ring { flex: none; display: grid; place-items: center; position: relative; width: 92px; height: 92px; }
.hero-ring .ring-val { position: absolute; text-align: center; line-height: 1.1; }
.hero-ring .ring-val b { font-size: 1.24rem; display: block; }
.hero-ring .ring-val span { font-size: .64rem; opacity: .8; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat .k { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); }
.stat .k svg { width: 14px; height: 14px; }
.stat .v { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; line-height: 1.25; }
.stat .v small { font-size: .74rem; font-weight: 600; color: var(--muted); margin-left: 3px; }

.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
}
.quick:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.quick .qi {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
}
.quick .qi svg { width: 20px; height: 20px; }
.quick b { display: block; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick > span:last-child { min-width: 0; overflow: hidden; }
.quick > span:last-child > span { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi-q1 { background: var(--brand-soft); color: var(--brand-ink); }
.qi-q2 { background: var(--bad-soft); color: var(--bad); }
.qi-q3 { background: var(--warn-soft); color: #b26a00; }
.qi-q4 { background: var(--ok-soft); color: var(--ok); }
.qi-q5 { background: color-mix(in srgb, #7c5cfc 14%, transparent); color: #8b6cf7; }
.qi-q6 { background: color-mix(in srgb, #0b94c8 14%, transparent); color: #0b94c8; }

.subj-progress { display: flex; flex-direction: column; gap: 16px; }
.sp-item { display: flex; align-items: center; gap: 14px; }
.sp-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sp-name { width: 96px; flex: none; font-size: .84rem; font-weight: 600; }
.sp-bar { flex: 1; height: 8px; border-radius: var(--r-full); background: var(--bg-2); overflow: hidden; }
.sp-bar i { display: block; height: 100%; border-radius: var(--r-full); transition: width .6s var(--ease); }
.sp-num { width: 106px; text-align: right; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- setup ---------- */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.form-block + .form-block { margin-top: 24px; }
.form-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.form-label > span { font-size: .86rem; font-weight: 700; }
.form-label .hint { font-size: .74rem; color: var(--muted); font-weight: 400; }

.subject-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.subject-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-2);
  font-size: .84rem; font-weight: 600; color: var(--text-2);
  transition: all .16s;
}
.subject-tab .n { font-size: .7rem; color: var(--muted); font-weight: 500; }
.subject-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--brand) 26%, transparent); }
.subject-tab.on .n { color: rgba(255, 255, 255, .8); }

.chapter-list { display: flex; flex-direction: column; gap: 8px; }
.chapter-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 26px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.8;
  text-align: center;
}
.chapter-empty svg { width: 22px; height: 22px; opacity: .7; }
.chapter-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}
.chapter-item:hover { border-color: var(--line-strong); background: var(--card-2); }
.chapter-item.on { border-color: color-mix(in srgb, var(--brand) 50%, transparent); background: var(--brand-soft); }
.chapter-item .cbx {
  width: 20px; height: 20px; flex: none;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  color: #fff;
  transition: all .16s;
}
.chapter-item .cbx svg { width: 13px; height: 13px; opacity: 0; stroke-width: 3; }
.chapter-item.on .cbx { background: var(--brand); border-color: var(--brand); }
.chapter-item.on .cbx svg { opacity: 1; }
.chapter-item .c-name { font-size: .87rem; font-weight: 500; }
.chapter-item .c-sub { font-size: .72rem; color: var(--muted); }
.chapter-item .c-meta { margin-left: auto; text-align: right; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.type-check {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .82rem; font-weight: 500;
  cursor: pointer;
  transition: all .16s;
}
.type-check .n { margin-left: auto; font-size: .7rem; color: var(--muted); }
.type-check.on { border-color: color-mix(in srgb, var(--brand) 50%, transparent); background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }

.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: 10px; gap: 2px; }
.seg button {
  height: 32px; padding: 0 14px;
  border-radius: 8px;
  font-size: .81rem; font-weight: 600; color: var(--muted);
  transition: all .16s;
}
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }

.summary-card {
  position: sticky; top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow);
}
.summary-card .sc-n { font-size: 2.6rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.summary-card .sc-n small { font-size: .85rem; font-weight: 600; color: var(--muted); -webkit-text-fill-color: var(--muted); margin-left: 4px; }
.summary-list { display: flex; flex-direction: column; gap: 9px; margin: 16px 0 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.summary-list .li { display: flex; justify-content: space-between; font-size: .8rem; gap: 10px; }
.summary-list .li span { color: var(--muted); }
.summary-list .li b { font-weight: 600; text-align: right; }

/* ---------- quiz ---------- */
.quiz-wrap { max-width: 820px; margin: 0 auto; }
.quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.quiz-head .iconbtn { background: transparent; border-color: transparent; }
.q-counter { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-counter b { color: var(--text); font-size: 1.02rem; }
.q-timer { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--text-2); font-variant-numeric: tabular-nums; background: var(--card); border: 1px solid var(--line); padding: 5px 10px; border-radius: var(--r-full); }

.progress { height: 6px; border-radius: var(--r-full); background: var(--bg-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .35s var(--ease); }

.q-card { margin-top: 18px; padding: 26px 28px 22px; }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.q-stem { font-size: 1.06rem; line-height: 1.85; font-weight: 500; letter-spacing: .01em; white-space: pre-wrap; word-break: break-word; }
.q-sub { margin-top: 6px; font-size: .74rem; color: var(--muted); }

.options { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s, background .16s, transform .1s;
  width: 100%;
  font-size: .94rem;
  line-height: 1.7;
}
.option:hover { border-color: var(--line-strong); background: var(--card-2); }
.option:active { transform: scale(.995); }
.option .ok {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--bg-2);
  font-size: .8rem; font-weight: 700; color: var(--text-2);
  transition: all .16s;
}
.option .ot { padding-top: 1px; word-break: break-word; }
.option.sel { border-color: var(--brand); background: var(--brand-soft); }
.option.sel .ok { background: var(--brand); color: #fff; }
.option.right { border-color: var(--ok); background: var(--ok-soft); }
.option.right .ok { background: var(--ok); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .ok { background: var(--bad); color: #fff; }
.option.dim { opacity: .55; }
.option[disabled] { cursor: default; }
.option .mark { margin-left: auto; font-size: .74rem; font-weight: 700; }

.judge-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.judge-btn {
  padding: 18px 0;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-size: 1rem; font-weight: 700;
  color: var(--text-2);
  background: var(--card);
  transition: all .16s;
}
.judge-btn:hover { border-color: var(--line-strong); background: var(--card-2); }
.judge-btn.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.judge-btn.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.judge-btn.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.judge-btn .ic { display: block; font-size: 1.5rem; line-height: 1; margin-bottom: 6px; }

.fill-row { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.fill-row label { display: flex; align-items: center; gap: 10px; }
.fill-row .idx { font-size: .78rem; color: var(--muted); width: 46px; flex: none; }
.fill-row input, .short-input {
  flex: 1; height: 44px; padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  outline: none;
  transition: border-color .16s;
}
.fill-row input:focus, .short-input:focus { border-color: var(--brand); }
.short-input { width: 100%; height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.7; }

.feedback {
  margin-top: 20px;
  border-radius: 12px;
  padding: 16px 18px;
  animation: fadeUp .26s var(--ease);
  border: 1px solid transparent;
}
.feedback.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.feedback.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.feedback .fb-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem; }
.feedback.ok .fb-head { color: var(--ok); }
.feedback.bad .fb-head { color: var(--bad); }
.feedback .fb-head svg { width: 18px; height: 18px; }
.feedback .fb-ans { margin-top: 8px; font-size: .85rem; color: var(--text-2); }
.feedback .fb-ans b { color: var(--text); }
.explain { margin-top: 12px; padding-top: 12px; border-top: 1px dashed color-mix(in srgb, currentColor 18%, transparent); font-size: .88rem; line-height: 1.8; color: var(--text-2); white-space: pre-wrap; }
.explain .ex-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--text); margin: 0 6px 2px 0; font-size: .8rem; }
.point-row { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.point-tag { font-size: .7rem; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand-ink); }

.quiz-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.quiz-foot .grow { display: flex; gap: 8px; }
.foot-tools { display: flex; gap: 6px; }
.tool-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--card);
  transition: all .16s;
}
.tool-btn svg { width: 18px; height: 18px; }
.tool-btn:hover { color: var(--text); border-color: var(--line-strong); }
.tool-btn.on { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.tool-btn.on.star { color: var(--warn); }
.tool-btn.on.star svg { fill: currentColor; }

/* ---------- result ---------- */
.result-hero { text-align: center; padding: 34px 20px 26px; }
.score-ring { width: 148px; height: 148px; margin: 0 auto 16px; position: relative; display: grid; place-items: center; }
.score-ring .in { position: absolute; text-align: center; }
.score-ring .in b { font-size: 2.5rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; display: block; }
.score-ring .in span { font-size: .72rem; color: var(--muted); }
.result-tip { font-size: .9rem; color: var(--text-2); margin-top: 6px; }
.result-stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-sm); overflow: hidden; margin-top: 22px; }
.result-stat div { background: var(--card); padding: 14px 8px; text-align: center; }
.result-stat b { display: block; font-size: 1.24rem; font-weight: 800; }
.result-stat span { font-size: .72rem; color: var(--muted); }

/* ---------- list ---------- */
.item-list { display: flex; flex-direction: column; gap: 10px; }
.qitem {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 15px;
  transition: border-color .16s, box-shadow .16s;
}
.qitem:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.qitem .qi-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.qitem .qi-stem { font-size: .87rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qitem .qi-bot { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .72rem; color: var(--muted); }
.qitem .qi-bot .grow { display: flex; gap: 10px; flex-wrap: wrap; min-width: 0; }
.qitem .qi-bot .btn-sm { height: 30px; }
.qitem.expanded .qi-stem { -webkit-line-clamp: unset; display: block; }
.qitem .answer-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .85rem; line-height: 1.8; color: var(--text-2); animation: fadeUp .2s var(--ease); }
.qitem .answer-box b { color: var(--ok); }

.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .e-ic { width: 64px; height: 64px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 20px; background: var(--card-2); color: var(--line-strong); }
.empty .e-ic svg { width: 30px; height: 30px; }
.empty h3 { font-size: 1rem; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: .82rem; }
.empty .btn { margin-top: 16px; }

/* ---------- stats ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 8px; position: relative; }
.bars.empty::after {
  content: "还没有练习记录，做完一组题这里就会亮起来";
  position: absolute; inset: 0 0 22px;
  display: grid; place-items: center;
  font-size: .76rem; color: var(--muted);
  border-bottom: 1px dashed var(--line);
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col .bar { width: 100%; max-width: 36px; border-radius: 7px 7px 4px 4px; background: var(--bg-2); position: relative; min-height: 4px; transition: height .5s var(--ease); }
.bar-col .bar i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, var(--brand), var(--brand-2)); opacity: .9; }
.bar-col .lb { font-size: .66rem; color: var(--muted); }
.bar-col .num { font-size: .66rem; color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }

.chapter-progress { display: flex; flex-direction: column; gap: 12px; }
.cp-row { display: flex; flex-direction: column; gap: 5px; }
.cp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .81rem; }
.cp-top span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-top b { font-size: .74rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.cp-bar { height: 6px; border-radius: var(--r-full); background: var(--bg-2); overflow: hidden; }
.cp-bar i { display: block; height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

/* ---------- settings ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .sl b { font-size: .88rem; font-weight: 600; display: block; }
.set-row .sl span { font-size: .74rem; color: var(--muted); }
.switch {
  width: 46px; height: 27px; flex: none;
  border-radius: var(--r-full);
  background: var(--line-strong);
  position: relative;
  transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s var(--ease);
}
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(19px); }

.import-zone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r);
  padding: 26px 20px;
  text-align: center;
  background: var(--card-2);
  transition: all .18s;
}
.import-zone.drag { border-color: var(--brand); background: var(--brand-soft); }
.import-zone .iz-ic { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 14px; display: grid; place-items: center; background: var(--card); color: var(--brand); box-shadow: var(--shadow-sm); }
.import-zone b { font-size: .9rem; display: block; }
.import-zone p { font-size: .76rem; color: var(--muted); margin-top: 4px; }

.bank-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; }
.bank-info div { background: var(--card-2); padding: 12px; text-align: center; }
.bank-info b { display: block; font-size: 1.05rem; }
.bank-info span { font-size: .7rem; color: var(--muted); }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(12, 16, 28, .48);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease both;
}
.modal-card {
  position: relative;
  width: min(360px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-lg);
  animation: pop .22s var(--ease) both;
}
.modal-card h3 { font-size: 1rem; margin-bottom: 6px; }
.modal-card p { font-size: .85rem; color: var(--text-2); line-height: 1.7; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 小节选择 ---------- */
.sec-group { margin-top: 14px; }
.sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 8px;
}
.sec-all {
  font-size: .7rem; font-weight: 600; color: var(--brand-ink);
  background: var(--brand-soft); padding: 3px 8px; border-radius: 6px;
}
.sec-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sec-chips .chip { height: auto; padding: 7px 10px; font-size: .78rem; line-height: 1.3; }
.sec-chips .chip .n { margin-left: 5px; font-size: .68rem; opacity: .65; }

/* ---------- 选项分析 ---------- */
.opt-analysis { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(120, 130, 150, .25); }
.oa-title { display: flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; margin-bottom: 8px; }
.oa-title svg { width: 14px; height: 14px; }
.oa-row { display: flex; gap: 8px; font-size: .84rem; line-height: 1.7; padding: 3px 0; color: var(--text-2); }
.oa-k {
  flex: none; width: 20px; height: 20px; margin-top: 2px;
  display: grid; place-items: center;
  border-radius: 6px; background: var(--bg-2);
  font-size: .68rem; font-weight: 700;
}
.oa-row.right .oa-k { background: var(--ok); color: #fff; }
.oa-row.right .oa-t { color: var(--text); }
.oa-row.wrong .oa-k { background: var(--bad-soft); color: var(--bad); }

/* ---------- 记忆口诀 ---------- */
.mnemonic {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--warn-soft);
  border: 1px solid rgba(245, 159, 0, .30);
}
.mn-head { display: flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; color: #a86800; }
[data-theme="dark"] .mn-head { color: var(--warn); }
.mn-head svg { width: 13px; height: 13px; }
.mn-text { font-size: 1.02rem; font-weight: 800; letter-spacing: .06em; margin: 6px 0 5px; }
.mn-items { display: flex; flex-wrap: wrap; gap: 5px 12px; font-size: .75rem; color: var(--text-2); }
.mn-items b { color: var(--brand-ink); margin-right: 3px; }

/* ---------- 小节掌握 ---------- */
.session-secs { display: flex; flex-direction: column; gap: 14px; }
.ss-row { display: flex; flex-direction: column; gap: 5px; }
.ss-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .82rem; }
.ss-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-top b { font-size: .71rem; color: var(--muted); font-weight: 600; flex: none; }
.ss-bar { height: 7px; border-radius: var(--r-full); background: var(--bg-2); overflow: hidden; }
.ss-bar i { display: block; height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .6s var(--ease); }
.ss-sub { font-size: .67rem; color: var(--muted); }

/* ---------- 手机导入 ---------- */
.import-file-btn { position: relative; overflow: hidden; }
.import-file-btn input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; font-size: 0; cursor: pointer;
}
.url-import { display: flex; gap: 8px; margin-top: 14px; }
.url-import input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--card); color: var(--text); font-size: .84rem;
  outline: none;
}
.url-import input:focus { border-color: var(--brand); }
@media (max-width: 520px) {
  .url-import { flex-direction: column; }
  .url-import .btn { width: 100%; }
}

/* ---------- 粘贴 JSON ---------- */
.paste-box { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.paste-box summary { cursor: pointer; font-size: .8rem; color: var(--text-2); font-weight: 600; }
.paste-box textarea {
  width: 100%; min-height: 120px; margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--card-2); color: var(--text);
  font-family: ui-monospace, Consolas, monospace; font-size: .74rem; line-height: 1.6;
  resize: vertical;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 90px;
  transform: translate(-50%, 16px);
  max-width: min(86vw, 420px);
  padding: 11px 18px;
  border-radius: var(--r-full);
  background: #1c2333;
  color: #fff;
  font-size: .84rem;
  line-height: 1.5;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s, transform .24s var(--ease);
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .toast { background: #2b3446; }

.view.no-anim > * { animation: none !important; }

/* 答题页：全屏沉浸，隐藏顶栏与底部导航 */
body[data-page="quiz"] .topbar,
body[data-page="quiz"] .tabbar { display: none !important; }
body[data-page="quiz"] .view {
  padding-top: calc(env(safe-area-inset-top) + 18px);
  padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
}

/* 顶栏标题在内容页滚动后淡入，避免与页面大标题重复 */
.topbar-title { transition: opacity .2s var(--ease), transform .2s var(--ease); }
@media (max-width: 900px) {
  .topbar.can-collapse .topbar-title { opacity: 0; transform: translateY(-4px); }
  body.scrolled .topbar.can-collapse .topbar-title { opacity: 1; transform: none; }
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.view > * { animation: fadeUp .3s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .04s; }
.view > *:nth-child(3) { animation-delay: .08s; }
.view > *:nth-child(4) { animation-delay: .12s; }

/* ---------- 云端同步 ---------- */
.cloud-form { display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.cloud-form input {
  height: 44px; padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  font-size: .92rem;
  font-family: inherit;
}
.cloud-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.cloud-user { display: flex; flex-direction: column; gap: 3px; margin: 12px 0 14px; }
.cloud-user b { font-size: .92rem; word-break: break-all; }
.cloud-user span { font-size: .74rem; color: var(--muted); }
.cloud-pill {
  flex: none;
  font-size: .7rem; font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-full);
  background: var(--bg-2); color: var(--muted);
}
.cloud-pill.is-ok { background: var(--ok-soft); color: var(--ok); }
.cloud-pill.is-bad { background: var(--bad-soft); color: var(--bad); }
.cloud-pill.is-busy { background: var(--brand-soft); color: var(--brand-ink); }
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--line-strong);
  display: inline-block; margin-right: 6px;
  vertical-align: middle;
}
.dot.on { background: var(--ok); }

/* ---------- 背书 ---------- */
.note-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.note-chapter {
  text-align: left; display: flex; flex-direction: column; gap: 6px;
  padding: 15px 17px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .18s, transform .14s;
}
.note-chapter:hover { border-color: var(--brand); }
.note-chapter:active { transform: scale(.99); }
.nc-name { font-weight: 700; font-size: .95rem; }
.nc-meta { font-size: .73rem; color: var(--muted); }

.note-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.note-card.done { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.note-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: var(--card-2);
  border-bottom: 1px dashed var(--line);
}
.nh-txt b { display: block; font-size: .95rem; }
.nh-txt span { font-size: .72rem; color: var(--muted); }
.note-check {
  flex: none; font-size: .78rem; font-weight: 600;
  padding: 7px 13px; border-radius: var(--r-full);
  border: 1px solid var(--line-strong); background: var(--card); color: var(--muted);
}
.note-check.on { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.note-body { padding: 4px 18px 14px; }
.nb { padding: 13px 0; border-bottom: 1px dashed var(--line); }
.nb:last-child { border-bottom: 0; }
.nb h3 {
  font-size: .93rem; color: var(--brand-ink);
  padding-left: 10px; margin-bottom: 9px;
  border-left: 3px solid var(--brand);
}
.nb h4 { font-size: .85rem; color: var(--text-2); margin-bottom: 7px; padding-left: 4px; }
.nb ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.nb li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  font-size: .87rem; line-height: 1.8;
  padding: 7px 11px; border-radius: 10px;
}
.nb li.hot {
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  box-shadow: inset 3px 0 0 var(--warn);
}
.n-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); flex: none; margin-top: 3px; }
.n-txt { flex: 1 1 60%; min-width: 0; }
.ntag {
  font-size: .62rem; line-height: 1.6; padding: 1px 7px;
  border-radius: var(--r-full); background: var(--bg-2); color: var(--text-2);
  white-space: nowrap;
}
.ntag.t-单 { background: color-mix(in srgb, #4f63f6 15%, transparent); color: var(--brand-ink); }
.ntag.t-多 { background: color-mix(in srgb, #7c5cfc 16%, transparent); color: #8b6cf7; }
.ntag.t-判 { background: color-mix(in srgb, #0b94c8 15%, transparent); color: #0b94c8; }
.ntag.t-填 { background: color-mix(in srgb, #0ca678 15%, transparent); color: var(--ok); }
.ntag.t-简, .ntag.t-辨, .ntag.t-案 { background: color-mix(in srgb, #f59f00 18%, transparent); color: #b8730a; }
.nexam {
  font-size: .62rem; line-height: 1.6; font-weight: 700;
  padding: 1px 8px; border-radius: var(--r-full);
  background: linear-gradient(135deg, #f7b731, #f59f00); color: #fff;
  white-space: nowrap;
}
.note-empty { padding: 17px 18px; font-size: .82rem; color: var(--muted); }
.nmemo {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; font-weight: 600;
  padding: 3px 10px; margin: 0 0 9px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, #7c5cfc 13%, transparent);
  color: #8b6cf7;
}
.nmemo svg { width: 12px; height: 12px; }
[data-theme="dark"] .ntag.t-简, [data-theme="dark"] .ntag.t-辨, [data-theme="dark"] .ntag.t-案 { color: #f7b731; }
[data-theme="dark"] .ntag.t-多 { color: #b39dfb; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .setup-grid { grid-template-columns: minmax(0, 1fr) 290px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { display: flex; }
  .tabbar { display: flex; }
  .view {
    padding: 18px 16px calc(88px + env(safe-area-inset-bottom));
    max-width: 720px;
  }
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
  .summary-card { position: static; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 22px 20px; border-radius: 20px; }
  .hero h2 { font-size: 1.14rem; }
  .hero p { font-size: .8rem; }
  .hero-ring { width: 76px; height: 76px; }
  .hero-ring svg { width: 76px !important; height: 76px !important; }
  .hero-ring .ring-val b { font-size: 1.05rem; }
  .page-head h1 { font-size: 1.32rem; }
  .q-card { padding: 20px 18px 18px; margin-top: 14px; }
  .q-stem { font-size: 1.02rem; line-height: 1.8; }
  .quiz-wrap { max-width: none; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-hero { padding: 26px 12px 20px; }
}

@media (max-width: 420px) {
  .stat .v { font-size: 1.3rem; }
  .quick { padding: 13px 14px; gap: 10px; }
  .quick .qi { width: 38px; height: 38px; }
  .hero-actions .btn { flex: 1; }
  .subject-tab { padding: 8px 11px; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
