/* 刷题 · 设计系统「线路图」
   概念：学习是一趟旅程。今日任务 = 车票，题库 = 时刻表，进度 = 带站点的轨道。
   颜色：墨色 + 站台安全线黄（唯一品牌色）；对 / 错用经色盲校验的青绿 / 朱红，且总配图标或文字。
   字体：数字用 DIN 系（铁路标牌字体），中文用系统黑体。
   结构：令牌 → 基础 → 外壳 → 组件 → 页面。颜色只走令牌，深色模式只改令牌。 */

/* ---------- 令牌 ---------- */
:root {
  --deepest: #f3f4f1;
  --mid: #ffffff;
  --light: #ecede9;
  --vibrancy: rgba(255, 255, 255, .92);
  --vibrancy-mid: rgba(255, 255, 255, .96);

  --text: #14181d;
  --text-2: #4f5862;
  --text-3: #69727c;
  --line: rgba(20, 24, 29, .1);
  --line-2: rgba(20, 24, 29, .2);
  --hover: rgba(20, 24, 29, .04);
  --fill: rgba(20, 24, 29, .06);
  --fill-2: rgba(20, 24, 29, .12);

  --signal: #ffc629;
  --on-signal: #14181d;
  --primary: #14181d;
  --primary-hi: #2b323a;
  --on-primary: #ffffff;
  --ticket: #14181d;
  --ticket-2: #262c33;
  --ticket-text: #f4f5f2;
  --ticket-dim: #aab2bb;

  --blue: #2457d6;
  --blue-soft: rgba(36, 87, 214, .1);
  --blue-line: rgba(36, 87, 214, .55);
  --green: #008c7a;
  --green-ink: #006b5e;
  --green-soft: rgba(0, 140, 122, .1);
  --green-line: rgba(0, 140, 122, .6);
  --red: #e5482d;
  --red-ink: #bd3119;
  --red-soft: rgba(229, 72, 45, .09);
  --red-line: rgba(229, 72, 45, .6);
  --orange: #a86500;
  --orange-soft: rgba(255, 198, 41, .26);
  --star: #d99a00;
  --chart-other: #a3abb3;

  --shadow-panel: 0 1px 2px rgba(20, 24, 29, .06), 0 12px 32px rgba(20, 24, 29, .08);
  --shadow-pop: 0 4px 12px rgba(20, 24, 29, .12), 0 24px 56px rgba(20, 24, 29, .2);

  --r-btn: 8px;
  --r-card: 12px;
  --r-panel: 16px;
  --pill: 999px;

  --num: "DIN Alternate", "Bahnschrift", "DIN Condensed", "Roboto Condensed", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t: 160ms cubic-bezier(.2, .7, .3, 1);
  --tabbar-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --deepest: #101317; --mid: #171b20; --light: #222830;
    --vibrancy: rgba(23, 27, 32, .94); --vibrancy-mid: rgba(28, 33, 39, .97);
    --text: #eef1f4; --text-2: #a9b2bc; --text-3: #8b95a0;
    --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .17);
    --hover: rgba(255, 255, 255, .04); --fill: rgba(255, 255, 255, .07); --fill-2: rgba(255, 255, 255, .13);
    --primary: #ffc629; --primary-hi: #ffd257; --on-primary: #14181d;
    --ticket: #1e242b; --ticket-2: #2c333c;
    --blue: #7ea6ff; --blue-soft: rgba(126, 166, 255, .14); --blue-line: rgba(126, 166, 255, .6);
    --green: #0fa08f; --green-ink: #4fd6c3; --green-soft: rgba(15, 160, 143, .16); --green-line: rgba(15, 160, 143, .7);
    --red: #ee5f36; --red-ink: #ff9274; --red-soft: rgba(238, 95, 54, .14); --red-line: rgba(238, 95, 54, .7);
    --orange: #ffc629; --orange-soft: rgba(255, 198, 41, .14); --star: #ffc629; --chart-other: #5f6973;
    --shadow-panel: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 16px 36px rgba(0, 0, 0, .35);
    --shadow-pop: 0 24px 56px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --deepest: #101317; --mid: #171b20; --light: #222830;
  --vibrancy: rgba(23, 27, 32, .94); --vibrancy-mid: rgba(28, 33, 39, .97);
  --text: #eef1f4; --text-2: #a9b2bc; --text-3: #8b95a0;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .17);
  --hover: rgba(255, 255, 255, .04); --fill: rgba(255, 255, 255, .07); --fill-2: rgba(255, 255, 255, .13);
  --primary: #ffc629; --primary-hi: #ffd257; --on-primary: #14181d;
  --ticket: #1e242b; --ticket-2: #2c333c;
  --blue: #7ea6ff; --blue-soft: rgba(126, 166, 255, .14); --blue-line: rgba(126, 166, 255, .6);
  --green: #0fa08f; --green-ink: #4fd6c3; --green-soft: rgba(15, 160, 143, .16); --green-line: rgba(15, 160, 143, .7);
  --red: #ee5f36; --red-ink: #ff9274; --red-soft: rgba(238, 95, 54, .14); --red-line: rgba(238, 95, 54, .7);
  --orange: #ffc629; --orange-soft: rgba(255, 198, 41, .14); --star: #ffc629; --chart-other: #5f6973;
  --shadow-panel: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 16px 36px rgba(0, 0, 0, .35);
  --shadow-pop: 0 24px 56px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--deepest); }
body { margin: 0; background: var(--deepest); color: var(--text); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; transition: color var(--t); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--signal); color: #14181d; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.good-text { color: var(--green-ink); }
.bad-text { color: var(--red-ink); }
.warn-text { color: var(--orange); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
body.no-scroll { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--mid); padding: 8px 12px; border-radius: var(--r-btn); }
.skip:focus { left: 8px; }

/* ---------- 外壳 ---------- */
#app { outline: none; }
.view {
  max-width: 1120px; margin: 0 auto;
  padding: 22px max(16px, env(safe-area-inset-right, 0px)) calc(var(--tabbar-h) + var(--safe-b) + 28px) max(16px, env(safe-area-inset-left, 0px));
  animation: rise .24s cubic-bezier(.2, .7, .3, 1);
}
.view:has(#prefs) { max-width: 720px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade-in { from { opacity: 0; } }

.sidebar { display: none; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: none;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--vibrancy); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
body.logged-in .tabbar { display: flex; }
body.immersive .tabbar, body.immersive .sidebar { display: none !important; }
.tabbar a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11px; font-weight: 500; }
.tabbar a .ic { width: 22px; height: 22px; }
.tabbar a.active { color: var(--text); font-weight: 700; }
.tabbar a.active::before { content: ""; position: absolute; top: -1px; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--signal); }

.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--signal); color: #14181d; display: grid; place-items: center; flex: none; }
.logo .ic { width: 20px; height: 20px; stroke-width: 2.2; }

@media (min-width: 900px) {
  body.logged-in { padding-left: 216px; }
  body.logged-in .tabbar { display: none; }
  body.logged-in .sidebar {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 216px; padding: 22px 16px 16px;
    background: var(--ticket); color: var(--ticket-text);
  }
  body.immersive.logged-in { padding-left: 0; }
  .view { padding: 40px 40px 64px; }
  .sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 26px; font-size: 18px; font-weight: 800; letter-spacing: .04em; color: var(--ticket-text); }
  /* 导航 = 一条线路上的站点 */
  .sidebar a.nav { position: relative; display: flex; align-items: center; height: 42px; padding: 0 10px 0 36px; border-radius: var(--r-btn); color: var(--ticket-dim); font-size: 14px; font-weight: 500; transition: background-color var(--t), color var(--t); }
  .sidebar a.nav .ic { display: none; }
  .sidebar a.nav::before { content: ""; position: absolute; left: 16px; top: 0; bottom: 0; width: 2px; background: var(--ticket-2); }
  .sidebar .brand + a.nav::before { top: 50%; }
  .sidebar a.nav.last-stop::before { bottom: 50%; }
  .sidebar a.nav::after { content: ""; position: absolute; left: 12px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--ticket); border: 2px solid var(--ticket-dim); transition: background-color var(--t), border-color var(--t), transform var(--t); }
  .sidebar a.nav:hover { color: var(--ticket-text); background: rgba(255, 255, 255, .05); }
  .sidebar a.nav.active { color: var(--ticket-text); font-weight: 700; background: rgba(255, 255, 255, .07); }
  .sidebar a.nav.active::after { background: var(--signal); border-color: var(--signal); transform: scale(1.25); box-shadow: 0 0 0 3px rgba(255, 198, 41, .2); }
  .sidebar .side-foot { margin-top: auto; padding: 12px 6px 0; font-size: 12px; line-height: 1.5; color: var(--ticket-dim); border-top: 1px solid var(--ticket-2); overflow-wrap: anywhere; }
}

/* 页头 */
.page-head { display: flex; align-items: flex-end; gap: 12px; margin: 2px 0 20px; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: .01em; text-wrap: balance; }
.page-head .sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.page-head .grow { flex: 1; min-width: 0; }
@media (min-width: 900px) { .page-head h1 { font-size: 34px; } .page-head { margin-bottom: 26px; } }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.back-link:hover { color: var(--text); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-btn); background: var(--mid); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background-color var(--t), border-color var(--t), color var(--t), transform var(--t);
}
.btn:hover { background: var(--light); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: var(--fill); color: var(--text-3); border-color: transparent; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: transparent; color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hi); }
.btn.primary:disabled { background: var(--fill-2); color: var(--text-3); }
.btn.signal { background: var(--signal); border-color: transparent; color: var(--on-signal); font-weight: 800; }
.btn.signal:hover { background: #ffd257; }
.btn.soft { background: var(--fill); border-color: transparent; color: var(--text); }
.btn.soft:hover { background: var(--fill-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--fill); color: var(--text); }
.btn.bad, .btn.danger { color: var(--red-ink); }
.btn.danger.fill, .dlg .btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.dlg .btn.danger:hover { filter: brightness(1.06); }
.btn.good { color: var(--green-ink); }
.btn.on { background: var(--primary); border-color: transparent; color: var(--on-primary); }
.btn.sm { min-height: 30px; padding: 0 11px; font-size: 13px; }
.btn.lg { min-height: 46px; padding: 0 22px; font-size: 16px; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }
@media (pointer: coarse) { .btn { min-height: 42px; } .btn.sm { min-height: 36px; } .btn.lg { min-height: 50px; } }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border: 0; border-radius: var(--r-btn); background: transparent; color: var(--text-2); transition: background-color var(--t), color var(--t); }
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn.on { color: var(--on-primary); background: var(--primary); }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 600; text-align: left; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.stretch > * { flex: 1; }

/* ---------- 卡片 / 列表 ---------- */
.card { background: var(--mid); border-radius: var(--r-card); border: 1px solid var(--line); padding: 18px; }
.card + .card { margin-top: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card h3 { font-size: 16px; font-weight: 700; }
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 30px 2px 12px; font-size: 16px; font-weight: 700; color: var(--text); }
.section-title .muted { font-size: 12px; font-weight: 500 !important; }
.section-title .more { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.section-title .more:hover { color: var(--text); }
.section-title .more .ic { width: 13px; height: 13px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { flex: 1; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li, .rows > a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; border-top: 1px solid var(--line); color: inherit; min-width: 0; transition: background-color var(--t); }
.rows > li:first-child, .rows > a:first-child { border-top: 0; }
.rows > a:hover { background: var(--hover); }
.rows .main { flex: 1; min-width: 0; }
.rows .title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rows .meta { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.rows .chev { color: var(--text-3); width: 15px; height: 15px; }
.rows .lead { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--fill); color: var(--text-2); }
.rows .lead .ic { width: 17px; height: 17px; }
.rows .lead.warn { background: var(--orange-soft); color: var(--orange); }
.rows .lead.bad { color: var(--red-ink); }

.empty { text-align: center; color: var(--text-2); padding: 36px 16px; font-size: 13.5px; }
.empty .ic { width: 30px; height: 30px; color: var(--text-3); margin-bottom: 10px; stroke-width: 1.5; }
.empty b { display: block; color: var(--text); font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.empty a { text-decoration: underline; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: 5px; background: var(--fill); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.tag.accent { background: var(--primary); color: var(--on-primary); }
.tag.good { background: var(--green-soft); color: var(--green-ink); }
.tag.bad { background: var(--red-soft); color: var(--red-ink); }
.tag.warn { background: var(--orange-soft); color: var(--orange); }

/* 进度：轨道 / 环 */
.pbar, .track { height: 4px; border-radius: var(--pill); background: var(--fill-2); overflow: hidden; }
.pbar > span, .track > span { display: block; height: 100%; border-radius: inherit; background: var(--text); }
.pbar.good > span, .track.full > span { background: var(--green); }
.ring { --p: 0; --size: 56px; --w: 5px; position: relative; width: var(--size); height: var(--size); flex: none; border-radius: 50%; background: conic-gradient(var(--ring-c, var(--text)) calc(var(--p) * 1%), var(--fill-2) 0); }
.ring.full { --ring-c: var(--green); }
.ring::before { content: ""; position: absolute; inset: var(--w); border-radius: 50%; background: var(--mid); }
.ring > * { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; }

/* 数字条：一条连续的读数，不是一堆卡片 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.stats.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 600px) { .stats.four { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--mid); padding: 13px 15px; min-width: 0; transition: background-color var(--t); }
.stat b { display: block; font-family: var(--num); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat b small { font-family: var(--sans); }
.stat > span { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.stat.good > span::before, .stat.bad > span::before, .stat.accent > span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.stat.bad > span::before { background: var(--red); }
.stat.accent > span::before { background: var(--signal); }
a.stat { color: inherit; } a.stat:hover { background: var(--light); }

/* 分段 / 芯片 */
.seg { display: flex; padding: 3px; gap: 2px; background: var(--fill); border-radius: 10px; }
.seg button { flex: 1; min-height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; padding: 0 10px; transition: background-color var(--t), color var(--t); }
@media (pointer: coarse) { .seg button { min-height: 36px; } }
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"], .seg button.on { background: var(--mid); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .16); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chips { flex-wrap: wrap; margin: 0; padding: 2px 0 4px; } }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: var(--pill); background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 600; transition: background-color var(--t), color var(--t), border-color var(--t); }
.chip:hover { background: var(--fill); color: var(--text); }
.chip .n { color: var(--text-3); font-family: var(--num); font-size: 12px; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: transparent; color: var(--on-primary); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .75; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .form label, .field-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
input[type=text], input[type=search], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-btn);
  background: var(--mid); color: var(--text); font-size: 15px; transition: border-color var(--t), box-shadow var(--t);
}
@media (pointer: coarse) { input[type=text], input[type=search], input[type=password], input[type=number], input:not([type]), select { min-height: 44px; font-size: 16px; } textarea { font-size: 16px; } }
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--fill-2); }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-size: 5px 5px; background-position: right 16px center, right 11px center; background-repeat: no-repeat; }
select option { background: var(--mid); color: var(--text); }
input[type=radio], input[type=checkbox] { accent-color: var(--primary); width: 17px; height: 17px; margin: 0; flex: none; }
.search { position: relative; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; width: 17px; height: 17px; }
.search input { padding-left: 38px; min-height: 44px; border-radius: 10px; border-color: var(--line); }
.form-error { color: var(--red-ink); font-size: 13px; min-height: 1em; }
.form { display: grid; gap: 14px; grid-template-columns: 1fr; }
.form label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: var(--text); }
.form fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.form legend { font-size: 13px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; width: 100%; }
.form fieldset label { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.form h3 { font-size: 16px; }
@media (min-width: 700px) {
  .form.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form.cols > h3, .form.cols > .row, .form.cols > p, .form.cols > .grow, .form.cols > div { grid-column: 1 / -1; }
}
.switch { position: relative; width: 42px; height: 25px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: var(--pill); background: var(--fill-2); transition: background-color var(--t); }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform var(--t); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(17px); background: var(--mid); }
.switch input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }
.setting { display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 10px 16px; border-top: 1px solid var(--line); }
.setting:first-child { border-top: 0; }
.setting .main { flex: 1; min-width: 0; }
.setting .title { font-size: 15px; font-weight: 600; }
.setting .desc { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.setting select { width: auto; min-width: 96px; min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
.setting .seg { flex: none; }
.setting .seg button { padding: 0 12px; min-height: 28px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-btn); overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; color: var(--text-2); font-size: 17px; transition: background-color var(--t); }
.stepper button:hover { background: var(--fill); color: var(--text); }
.stepper output { min-width: 42px; text-align: center; font-family: var(--num); font-size: 15px; font-weight: 700; border-inline: 1px solid var(--line); line-height: 34px; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--hover); }
.tbl details summary { cursor: pointer; }

/* ---------- 首页 ---------- */
.hello { display: flex; align-items: flex-end; gap: 12px; margin: 2px 0 18px; }
.hello .eyebrow { font-size: 13px; color: var(--text-2); margin-bottom: 3px; }
.hello h1 { font-size: 26px; font-weight: 800; overflow-wrap: anywhere; }
@media (min-width: 900px) { .hello h1 { font-size: 34px; } .hello { margin-bottom: 24px; } }
.streak { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: var(--pill); background: var(--fill); font-family: var(--num); font-weight: 700; font-size: 14px; color: var(--text-2); white-space: nowrap; flex: none; }
.streak .ic { width: 15px; height: 15px; }
.streak.on { background: var(--signal); color: #14181d; }
.streak.on .ic { fill: currentColor; }
.home-grid { display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.home-grid > .col { min-width: 0; }
.home-grid > .col > .section-title:first-child { margin-top: 26px; }
@media (min-width: 1120px) {
  .home-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); }
  .home-grid > .col.side > .section-title:first-child { margin-top: 0; }
  .home-grid .col.side .stats.four { grid-template-columns: repeat(2, 1fr); }
}

/* 车票：今日任务 */
.ticket { position: relative; display: flex; flex-direction: column; border-radius: var(--r-panel); background: var(--ticket); color: var(--ticket-text); box-shadow: var(--shadow-panel); overflow: hidden; }
.ticket-main { padding: 20px 20px 18px; flex: 1; min-width: 0; }
.ticket-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ticket-dim); }
.ticket-top b { color: var(--signal); font-weight: 700; }
.ticket-top .num { letter-spacing: .06em; }
.ticket .big { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 16px; font-family: var(--num); font-size: 72px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ticket .big small { font-family: var(--sans); font-size: 17px; font-weight: 600; color: var(--ticket-dim); }
.ticket .big.done { font-family: var(--sans); font-size: 38px; font-weight: 800; line-height: 1.2; align-items: center; }
.ticket .big .ic { width: 30px; height: 30px; color: var(--signal); }
.ticket .done-msg { color: var(--ticket-dim); font-size: 14px; }
.ticket-stub { position: relative; display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 20px 18px; border-top: 2px dashed var(--ticket-2); }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--deepest); }
.ticket-stub::before { left: -10px; } .ticket-stub::after { right: -10px; }
.ticket-stub .btn { flex: 1; }
.ticket-stub .btn.ghost { flex: none; color: var(--ticket-dim); }
.ticket-stub .btn.ghost:hover { background: var(--ticket-2); color: var(--ticket-text); }
.ticket-stub a.btn:not(.signal) { background: var(--ticket-2); border-color: transparent; color: var(--ticket-text); }
@media (min-width: 640px) {
  .ticket { flex-direction: row; }
  .ticket-main { padding: 26px 28px; }
  .ticket .big { font-size: 88px; }
  .ticket-stub { width: 220px; flex: none; flex-direction: column; justify-content: center; padding: 20px; border-top: 0; border-left: 2px dashed var(--ticket-2); }
  .ticket-stub .btn { flex: none; width: 100%; }
  .ticket-stub .btn.ghost { width: 100%; }
  .ticket-stub::before, .ticket-stub::after { left: -11px; right: auto; }
  .ticket-stub::before { top: -10px; } .ticket-stub::after { top: auto; bottom: -10px; }
}

/* 线路：任务构成 */
.route { list-style: none; display: flex; margin: 0; padding: 0; }
.route li { position: relative; flex: 1; min-width: 0; padding-top: 18px; font-size: 13px; color: var(--ticket-dim); }
.route li::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 2px; background: var(--ticket-2); }
.route li:last-child { flex: none; }
.route li:last-child::before { display: none; }
.route li::after { content: ""; position: absolute; top: 0; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ticket); border: 2px solid var(--ticket-dim); }
.route li.on::after { background: var(--signal); border-color: var(--signal); }
.route b { display: block; font-family: var(--num); font-size: 20px; line-height: 1.2; color: var(--ticket-text); }

.resume-list a { gap: 14px; }
.resume-list .pct { width: 42px; flex: none; font-family: var(--num); font-size: 17px; font-weight: 700; text-align: right; }
.resume-list .track { margin-top: 7px; }
.resume .title { white-space: nowrap; display: block; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.quick a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px 12px; background: var(--mid); color: var(--text); font-size: 13px; font-weight: 600; transition: background-color var(--t); }
.quick a:hover { background: var(--light); }
.quick .qi { display: grid; place-items: center; color: var(--text-2); }
.quick .qi .ic { width: 22px; height: 22px; }
.quick .badge { position: absolute; top: 7px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-family: var(--num); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

/* ---------- 题库：时刻表 ---------- */
.bank-tools { display: grid; gap: 12px; }
.tt { background: var(--mid); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.tt-head { display: none; }
.tt-group { display: flex; align-items: baseline; gap: 8px; padding: 9px 16px; background: var(--light); font-size: 13px; font-weight: 700; color: var(--text); border-top: 1px solid var(--line); }
.tt-group:first-child { border-top: 0; }
.tt-group span { font-family: var(--num); font-weight: 500; color: var(--text-3); }
.sess { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); transition: background-color var(--t); }
.tt-group + .sess { border-top: 0; }
.sess:hover { background: var(--hover); }
.sess .main { min-width: 0; }
.sess .title { font-size: 15px; font-weight: 600; line-height: 1.4; }
.sess .meta { font-size: 12.5px; color: var(--text-2); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.sess .prog { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.sess .prog .track { flex: 1; }
.sess .prog .v { font-family: var(--num); font-size: 13px; color: var(--text-2); min-width: 36px; text-align: right; }
.sess .cell-n, .sess .cell-acc, .sess .cell-wrong { display: none; }
.sess.fresh .prog { display: none; }
.sess .acts { display: flex; gap: 6px; flex: none; grid-row: 1; grid-column: 2; }
@media (min-width: 900px) {
  .tt-head, .sess { grid-template-columns: minmax(0, 1fr) 60px 190px 72px 60px 104px; gap: 14px; }
  .tt-head { display: grid; padding: 9px 16px; font-size: 12px; font-weight: 600; color: var(--text-3); border-bottom: 1px solid var(--line-2); }
  .tt-head .r, .sess .cell-n, .sess .cell-acc, .sess .cell-wrong { text-align: right; }
  .sess { padding: 10px 16px; min-height: 54px; }
  .sess .meta { display: none; }
  .sess .cell-n, .sess .cell-acc, .sess .cell-wrong { display: block; font-family: var(--num); font-size: 15px; font-variant-numeric: tabular-nums; }
  .sess .cell-n { color: var(--text-2); }
  .sess .prog, .sess.fresh .prog { display: flex; grid-column: auto; }
  .sess .acts { grid-row: auto; grid-column: auto; justify-content: flex-end; }
}
.result-q { display: block; padding: 13px 16px; border-top: 1px solid var(--line); color: inherit; transition: background-color var(--t); }
.result-q:first-child { border-top: 0; }
.result-q:hover { background: var(--hover); }
.result-q button.stem { border: 0; background: none; padding: 0; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.result-q .stem { font-size: 14.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.result-q .meta { font-size: 12.5px; color: var(--text-2); margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
mark { background: var(--signal); color: #14181d; border-radius: 3px; padding: 0 2px; }

/* ---------- 刷题页 ---------- */
.view.run { max-width: none; padding: 0 0 calc(92px + var(--safe-b)); }
.run-top { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); background: var(--vibrancy-mid); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--line); }
.run-bar { display: flex; align-items: center; gap: 2px; min-height: 54px; max-width: 1240px; margin: 0 auto; padding: 0 8px; }
.run-bar .count { font-family: var(--num); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.run-bar .count small { color: var(--text-3); font-weight: 500; font-size: 14px; }
.run-bar .ttl { flex: 1; min-width: 0; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; }

/* 轨道：每题一节，对 / 错 / 当前一眼可见 */
.rail { display: flex; gap: 2px; height: 4px; max-width: 1240px; margin: 0 auto; padding: 0 12px 0; }
.rail i { flex: 1; min-width: 0; border-radius: 2px; background: var(--fill-2); }
.rail i.right { background: var(--green); }
.rail i.wrong { background: var(--red); }
.rail i.done { background: var(--text-2); }
.rail i.cur { background: var(--signal); }
.rail.long { display: block; padding: 0; max-width: none; background: var(--fill-2); }
.rail.long > span { display: block; height: 100%; background: var(--text); }
.run-top { padding-bottom: 6px; }
.run-top:has(.rail.long) { padding-bottom: 0; }

.run-layout { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); }
.run-main { min-width: 0; width: 100%; max-width: 780px; margin: 0 auto; }
.view.run > .run-body { max-width: 780px; margin: 0 auto; }
.run-side { display: none; }
@media (min-width: 1180px) {
  .run-layout { grid-template-columns: minmax(0, 780px) 320px; justify-content: center; gap: 32px; }
  .run-layout:has(.run-side[hidden]) { grid-template-columns: minmax(0, 780px); }
  .run-main { margin: 0; }
  .run-side { display: block; position: sticky; top: 84px; align-self: start; margin-top: 28px; max-height: calc(100vh - 190px); overflow-y: auto; background: var(--mid); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
  .run-side h2 { font-size: 15px; margin-bottom: 10px; }
  .run-side .grid { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
  [data-grid-btn] { display: none; }
}
.run-body { padding: 18px 16px; }
@media (min-width: 900px) { .run-body { padding: 28px 24px; } }
.timer-pill { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: var(--pill); border: 0; background: var(--fill); color: var(--text-2); font-family: var(--num); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; transition: background-color var(--t), color var(--t); }
.timer-pill.warn { background: var(--orange-soft); color: var(--orange); }
.timer-pill.over { background: var(--red-soft); color: var(--red-ink); }
.timer-pill.stopped { color: var(--text-3); }
.timer-pill .ic { width: 14px; height: 14px; }

.q-head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; min-width: 0; }
.q-head .where { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 2px; }
.q-head .flag { width: 34px; height: 34px; color: var(--text-3); }
.q-head .flag.on { background: transparent; }
.q-head .flag.on[data-act=fav] { color: var(--star); }
.q-head .flag.on[data-act=fav] .ic, .q-head .flag.on[data-act=mark] .ic { fill: currentColor; }
.q-head .flag.on[data-act=mark] { color: var(--blue); }
.q-stem { font-size: 18px; font-weight: 500; line-height: 1.75; word-break: break-word; color: var(--text); }
@media (min-width: 900px) { .q-stem { font-size: 20px; } }
/* 题图多为白底扫描件，深色模式也保持白底 */
.q-stem img, .opt .c img, .parse img { display: block; margin: 10px 0; border-radius: 6px; background: #fff; max-width: 100%; height: auto; }

.opts { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.opt { width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left; padding: 12px 14px; min-height: 54px; border: 1.5px solid var(--line-2); border-radius: var(--r-card); background: var(--mid); font-size: 16px; line-height: 1.6; color: var(--text); transition: background-color var(--t), border-color var(--t), transform var(--t); }
.opt:hover:not(:disabled) { border-color: var(--text); }
.opt:active:not(:disabled) { transform: scale(.995); }
.opt:disabled { cursor: default; }
.opt .k { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--num); font-size: 15px; font-weight: 700; background: var(--fill); color: var(--text-2); transition: background-color var(--t), color var(--t); }
.opts.multi .opt .k { border-radius: 6px; }
.opt .c { flex: 1; min-width: 0; word-break: break-word; padding-top: 1px; }
.opt .mk { flex: none; margin-left: auto; align-self: center; }
.opt.sel { border-color: var(--text); background: var(--fill); }
.opt.sel .k { background: var(--primary); color: var(--on-primary); }
.opt.right { border-color: var(--green); background: var(--green-soft); }
.opt.right .k { background: var(--green); color: #fff; }
.opt.right.miss { border-style: dashed; background: transparent; }
.opt.right.miss .k { background: var(--green-soft); color: var(--green-ink); }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .k { background: var(--red); color: #fff; }
.opt.dim { color: var(--text-3); background: transparent; border-color: var(--line); }
.opt.dim .k { background: var(--fill); color: var(--text-3); }
.opt .mk .ic { width: 20px; height: 20px; stroke-width: 2.6; }
.opt.right .mk { color: var(--green-ink); } .opt.wrong .mk { color: var(--red-ink); }

.fill-box { display: grid; gap: 8px; margin-top: 18px; }
.fill-row { display: flex; align-items: center; gap: 10px; }
.fill-row .k { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.q-actions { display: grid; gap: 8px; margin-top: 16px; }
.unknown-btn { justify-self: center; color: var(--text-2); font-size: 13.5px; border: 0; background: none; padding: 8px 12px; border-radius: var(--r-btn); transition: color var(--t), background-color var(--t); }
.unknown-btn:hover { color: var(--text); background: var(--fill); }
.note-label { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--text-2); }

.feedback { margin-top: 20px; outline: none; animation: rise .22s cubic-bezier(.2, .7, .3, 1); }
.verdict { display: flex; align-items: center; gap: 10px; padding: 2px 0 12px; font-weight: 800; font-size: 17px; }
.verdict .ic { width: 24px; height: 24px; stroke-width: 2.2; }
.verdict small { display: block; font-weight: 500; font-size: 13.5px; color: var(--text-2); margin-top: 1px; }
.verdict.good { color: var(--green-ink); }
.verdict.bad { color: var(--red-ink); }
.verdict.neutral { color: var(--text-2); }
.parse-box { background: var(--mid); border: 1px solid var(--line); border-radius: var(--r-card); }
.parse-box summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 12px 16px; font-weight: 700; font-size: 14.5px; color: var(--text); border-radius: var(--r-card); transition: background-color var(--t); }
.parse-box summary:hover { background: var(--hover); }
.parse-box summary::-webkit-details-marker { display: none; }
.parse-box summary .ic { color: var(--text-3); transition: transform var(--t); }
.parse-box[open] summary .ic { transform: rotate(180deg); }
.parse { padding: 0 16px 16px; font-size: 15px; line-height: 1.8; color: var(--text-2); word-break: break-word; }
.self-eval { display: flex; gap: 8px; padding: 0 0 12px; }
.self-eval .btn { flex: 1; min-height: 44px; }
.self-eval .btn.on.good { background: var(--green); color: #fff; border-color: transparent; }
.self-eval .btn.on.bad { background: var(--red); color: #fff; border-color: transparent; }

.notice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r-btn); background: var(--red-soft); border: 1px solid var(--red-line); color: var(--red-ink); font-size: 13.5px; }
.notice .grow { flex: 1; min-width: 0; }
.notice .btn { flex: none; }
.notice.info { background: var(--fill); border-color: var(--line); color: var(--text); }
.notice.info .ic { color: var(--text-2); }
.submitting { font-size: 13px; color: var(--text-2); text-align: center; margin-top: 10px; }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + var(--safe-b)) max(16px, env(safe-area-inset-left, 0px)); background: var(--vibrancy); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
.dock-in { max-width: 732px; margin: 0 auto; display: flex; gap: 8px; }
.dock .btn { min-height: 48px; border-radius: 10px; font-size: 15px; }
.dock .btn.primary { flex: 1; }
.dock .btn.side { flex: none; width: 56px; padding: 0; }
@media (min-width: 1180px) { .dock-in { max-width: 1132px; padding: 0 376px 0 24px; } }
.kbd-hint { display: none; text-align: center; font-size: 12px; color: var(--text-3); margin-top: 24px; }
@media (hover: hover) and (pointer: fine) { .kbd-hint { display: block; } }
.kbd-hint kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--mid); color: var(--text-2); }

/* 草稿：画布保持浅色纸面，深色笔才看得清 */
.draft { margin: 12px 16px 0; border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--mid); overflow: hidden; }
.draft-tools { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.pen { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; background: none; display: grid; place-items: center; padding: 0; transition: border-color var(--t); }
.pen i { width: 15px; height: 15px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px var(--line-2); }
.pen.on { border-color: var(--text); }
#draft-canvas { display: block; width: 100%; height: 240px; touch-action: none; cursor: crosshair; background-color: #f8f8f4; background-image: radial-gradient(#d4d4cc 1px, transparent 1px); background-size: 18px 18px; }

/* 完成页 */
.done-card { max-width: 560px; margin: 12px auto 0; text-align: center; padding: 30px 20px; border-radius: var(--r-panel); box-shadow: var(--shadow-panel); }
.done-card .ring { --size: 120px; --w: 9px; margin: 0 auto 16px; font-size: 28px; }
.done-card h2 { font-size: 24px; font-weight: 800; }
.done-card .sub { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }
.done-card .stats { margin: 20px 0; text-align: left; }
.done-card .acts { display: grid; gap: 8px; }

/* ---------- 浮层（抽屉） ---------- */
.sheet-mask { position: fixed; inset: 0; z-index: 60; background: rgba(10, 12, 15, .5); animation: fade-in .18s ease-out; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 84vh; display: flex; flex-direction: column; background: var(--mid); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-pop); padding-bottom: var(--safe-b); animation: sheet-up .24s cubic-bezier(.2, .8, .3, 1); }
@keyframes sheet-up { from { transform: translateY(32px); opacity: 0; } }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 520px; transform: translate(-50%, -50%); border-radius: var(--r-panel); max-height: 80vh; animation: fade-in .18s ease-out; }
}
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--fill-2); margin: 8px auto 0; }
@media (min-width: 700px) { .sheet-grip { display: none; } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px 20px; }
.sheet-head h3 { flex: 1; font-size: 18px; font-weight: 800; }
.sheet-body { padding: 8px 20px 18px; overflow-y: auto; }
.sheet-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.cell { position: relative; aspect-ratio: 1; min-height: 34px; padding: 0; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-family: var(--num); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; transition: background-color var(--t), border-color var(--t); }
.cell:hover { background: var(--fill); }
.cell.done { background: var(--fill-2); border-color: transparent; color: var(--text); }
.cell.right { background: var(--green); border-color: transparent; color: #fff; }
.cell.wrong { background: var(--red); border-color: transparent; color: #fff; }
.cell.cur { box-shadow: 0 0 0 2px var(--mid), 0 0 0 4px var(--signal); }
.cell.marked::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1.5px var(--mid); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .l-right { background: var(--green); } .legend .l-wrong { background: var(--red); }
.legend .l-done { background: var(--fill-2); } .legend .l-none { border: 1px solid var(--line-2); }
.legend .l-other { background: var(--chart-other); }
.legend .l-mark { background: var(--blue); border-radius: 50%; }
.sheet-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; font-size: 13.5px; color: var(--text-2); }
.sheet-sum b { font-family: var(--num); font-size: 16px; color: var(--text); }
.sheet-sum .good-text b { color: var(--green-ink); } .sheet-sum .bad-text b { color: var(--red-ink); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 复习 ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo .card { padding: 16px; display: flex; flex-direction: column; gap: 4px; margin-top: 0 !important; }
.duo .card.c-due { background: var(--ticket); border-color: transparent; color: var(--ticket-text); }
.duo .card .n { font-family: var(--num); font-size: 52px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.duo .card .lbl { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; }
.duo .card .hint { font-size: 12.5px; color: var(--text-2); min-height: 2.6em; }
.duo .c-due .hint { color: var(--ticket-dim); }
.duo .card .btn { margin-top: 8px; width: 100%; }
.duo .c-due .btn.soft { background: var(--signal); color: #14181d; font-weight: 800; }
.duo .c-due .btn.primary { background: var(--signal); color: #14181d; }
.duo .c-due .btn:disabled { background: var(--ticket-2); color: var(--ticket-dim); }
@media (min-width: 900px) { .duo { gap: 14px; } .duo .card { padding: 22px; } .duo .card .n { font-size: 68px; } }

/* ---------- 考试 ---------- */
.paper-list { display: grid; gap: 6px; }
@media (min-width: 760px) { .paper-list { grid-template-columns: 1fr 1fr; } }
.paper { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--r-btn); cursor: pointer; transition: background-color var(--t), border-color var(--t); }
.paper:hover { border-color: var(--line-2); background: var(--hover); }
.paper:has(input:checked) { border-color: var(--text); background: var(--fill); }
.paper .main { flex: 1; min-width: 0; }
.paper .title { font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.paper .meta { font-size: 12.5px; color: var(--text-2); }
.exam-timer { font-family: var(--num); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.exam-timer.urgent { color: var(--red-ink); }
.score-hero { text-align: center; padding: 28px 18px 20px; border-radius: var(--r-panel); }
.score-hero .ring { --size: 136px; --w: 9px; margin: 0 auto 14px; }
.score-hero .ring b { font-size: 44px; font-weight: 700; }
.score-hero .ring b small { font: 500 14px var(--sans); color: var(--text-3); margin-left: 2px; }
.score-hero h2 { font-size: 18px; font-weight: 800; }
.result-item + .result-item { margin-top: 10px; }
.result-item .no { font-family: var(--num); font-size: 13px; color: var(--text-3); font-weight: 700; margin-bottom: 8px; }

/* ---------- 统计 ---------- */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--num); }
.chart .r { fill: var(--green); } .chart .w { fill: var(--red); } .chart .o { fill: var(--chart-other); }
.chart .grid-l { stroke: var(--line); }
.chart .base-l { stroke: var(--line-2); }
.chart .hit { fill: transparent; }
.chart g.day:hover .hit, .chart g.day.on .hit { fill: var(--fill); }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); padding: 7px 10px; border-radius: var(--r-btn); background: var(--ticket); color: var(--ticket-text); font-size: 12.5px; line-height: 1.5; white-space: nowrap; box-shadow: var(--shadow-pop); }
.chart-tip b { display: block; }
.data-table { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.data-table summary { cursor: pointer; }
.data-table .tbl-wrap { margin-top: 8px; max-height: 240px; overflow-y: auto; }
.acc-row { display: flex; align-items: center; gap: 10px; }
.acc-row .pbar { flex: 1; }
.acc-row .pbar.good > span { background: var(--green); } .acc-row .pbar.mid > span { background: var(--signal); } .acc-row .pbar.bad > span { background: var(--red); }
.acc-row .v { width: 42px; text-align: right; font-family: var(--num); font-size: 14px; font-weight: 700; color: var(--text); }
.rows details summary { cursor: pointer; }
.exam-score { font-family: var(--num); font-size: 22px; font-weight: 700; }

/* ---------- 我的 ---------- */
.profile { display: flex; align-items: center; gap: 14px; background: var(--ticket); color: var(--ticket-text); border-color: transparent; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--signal); color: #14181d; display: grid; place-items: center; font-size: 24px; font-weight: 800; flex: none; }
.profile .name { font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.profile .meta { font-size: 13px; color: var(--ticket-dim); margin-top: 2px; }
.profile .tag.accent { background: var(--signal); color: #14181d; }

/* ---------- 登录 ---------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }
.auth-art { display: flex; flex-direction: column; gap: 14px; padding: 28px 24px 24px; background: var(--ticket); color: var(--ticket-text); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: .04em; }
.auth-art h1 { font-size: 30px; font-weight: 800; line-height: 1.25; }
.auth-art h1 em { font-style: normal; color: var(--signal); }
.auth-art .route { display: none; }
.auth-main { display: grid; place-items: start center; padding: 24px 16px 32px; }
.auth { width: 100%; max-width: 380px; }
.auth .card { padding: 20px; border-radius: var(--r-panel); box-shadow: var(--shadow-panel); }
.auth form { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .auth-art { justify-content: space-between; padding: 44px 56px; }
  .auth-art h1 { font-size: 52px; }
  .auth-art .route { display: flex; max-width: 520px; }
  .auth-main { place-items: center; padding: 40px; }
  .auth .card { padding: 26px; }
}

/* ---------- 后台 ---------- */
.panel { background: var(--mid); border-radius: var(--r-card); border: 1px solid var(--line); padding: 18px; }
.panel + .panel, .panel + div, div + .panel, form + .panel, .panel + form { margin-top: 12px; }
.panel > h3 { margin-bottom: 12px; font-size: 16px; }
.panel details summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
.panel pre { background: var(--deepest); border: 1px solid var(--line); padding: 12px; border-radius: var(--r-btn); overflow-x: auto; font: 12px/1.6 var(--mono); color: var(--text-2); }
.panel .list { list-style: none; margin: 0; padding: 0; }
.panel .list > li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; font-size: 14px; }
.panel .list > li:first-child { border-top: 0; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; padding: 3px; background: var(--fill); border-radius: 10px; }
.tabs button { flex: none; min-height: 32px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13.5px; transition: background-color var(--t), color var(--t); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--mid); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .16); }
.copybox { font-family: var(--mono); font-size: 12px; margin-bottom: 10px; }
.log-filter { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.log-filter .row { align-self: end; }

/* ---------- 对话框 / 撤销条 / toast ---------- */
.dlg-mask { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(10, 12, 15, .5); animation: fade-in .18s ease-out; }
.dlg-mask.closing { opacity: 0; transition: opacity .17s ease-out; }
.dlg { width: 100%; max-width: 380px; padding: 22px; background: var(--mid); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); }
.dlg-title { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.dlg-body { color: var(--text-2); font-size: 14px; display: grid; gap: 8px; }
.dlg-detail { font-size: 13px; color: var(--text-2); background: var(--fill); padding: 8px 10px; border-radius: var(--r-btn); }
.dlg-field { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.dlg-actions { display: flex; gap: 8px; margin-top: 18px; }
.dlg-actions .btn { flex: 1; min-height: 42px; }

.undo-bar, #toast { position: fixed; left: 50%; z-index: 90; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); transform: translateX(-50%); opacity: 0; pointer-events: none; width: max-content; max-width: min(420px, calc(100vw - 32px)); background: var(--ticket); color: var(--ticket-text); border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: 11px 15px; font-size: 14px; transition: opacity var(--t); }
body.immersive .undo-bar, body.immersive #toast { bottom: calc(84px + var(--safe-b)); }
.undo-bar { display: flex; align-items: center; gap: 14px; }
.undo-bar.show, #toast.show { opacity: 1; pointer-events: auto; }
.undo-bar .btn { min-height: 28px; padding: 0 8px; background: transparent; border: 0; color: var(--signal); }
@media (min-width: 900px) { .undo-bar, #toast { bottom: 28px; } }

.loading { display: grid; place-items: center; min-height: 40vh; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--fill-2); border-top-color: var(--text); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 题库权限 */
.access-users { display: grid; gap: 10px; min-width: 0; max-height: 44vh; overflow-y: auto; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-btn); }
.access-users:disabled { opacity: .5; }
.access-users legend { padding: 0 6px; font-size: 13px; color: var(--text-2); }
/* ---------- 机考模拟：左侧连续答题，右侧固定面板 ---------- */
#mock-entry:not(:empty) { margin-bottom: 8px; }
.mock-hero { display: grid; gap: 20px; padding: 24px 20px; border-radius: var(--r-panel); background: var(--ticket); color: var(--ticket-text); box-shadow: var(--shadow-panel); }
.mock-hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--signal); }
.mock-hero-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.mock-hero h2 { margin: 8px 0 0; font-size: 28px; line-height: 1.2; font-weight: 800; color: var(--ticket-text); }
.mock-hero-facts { margin: 8px 0 0; font-family: var(--num); font-size: 15px; color: var(--ticket-dim); font-variant-numeric: tabular-nums; }
.mock-route { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; padding: 0; }
.mock-route li { min-width: 0; padding: 10px 11px; border-radius: var(--r-btn); background: var(--ticket-2); }
.mock-route b { display: block; font-size: 14px; font-weight: 700; color: var(--ticket-text); }
.mock-route span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--ticket-dim); white-space: nowrap; }
.mock-route span + span { margin-top: 0; }
@media (min-width: 760px) { .mock-route span { display: inline; } .mock-route b { margin-bottom: 2px; } .mock-route span + span::before { content: " · "; } }
.mock-route li.short { box-shadow: inset 0 0 0 1px var(--signal); }
.mock-hero-action { display: grid; gap: 8px; }
.btn.lg.mock-cta { width: 100%; min-height: 56px; gap: 8px; border-radius: 10px; font-size: 18px; }
.btn.mock-cta:disabled { background: var(--ticket-2); color: var(--ticket-dim); }
.mock-drop { justify-self: center; padding: 4px 8px; border: 0; background: transparent; color: var(--ticket-dim); font-size: 13px; cursor: pointer; }
.mock-drop:hover { color: var(--ticket-text); }
.exam-free-title { margin-top: 34px; }
.exam-free { box-shadow: none; }
@media (min-width: 760px) {
  .mock-hero { grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 32px; padding: 30px 32px; }
  .mock-hero h2 { font-size: 34px; }
  .btn.lg.mock-cta { min-height: 64px; font-size: 20px; }
}

.view.mock-run { width: 100%; max-width: none; min-height: 100vh; margin: 0; padding: 0 0 92px; }
.mock-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px; min-height: 56px; padding: env(safe-area-inset-top) 8px 0; background: var(--vibrancy); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.mock-top-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-top-name small { margin-left: 6px; font-family: var(--num); font-size: 12px; font-weight: 500; color: var(--text-3); }
.mock-top-clock { font-family: var(--num); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mock-top-clock.urgent, .mock-clock.urgent { color: var(--red-ink); }
.mock-layout { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 14px 12px; }
.mock-main { min-width: 0; }
.mock-head { padding: 4px 4px 12px; }
.mock-head h1 { margin: 0; font-size: 24px; font-weight: 800; }
.mock-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.mock-q { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; margin-bottom: 12px; padding: 18px 14px; scroll-margin-top: 70px; background: var(--mid); border: 1px solid var(--line); border-radius: var(--r-card); }
.mock-q-no { font-family: var(--num); font-size: 18px; font-weight: 700; line-height: 1.75; }
.mock-q-body { min-width: 0; }
.mock-q .q-head { margin-bottom: 6px; }
.mock-q .q-head .where { display: none; }
.mock-q .q-stem { font-size: 16.5px; font-weight: 400; line-height: 1.8; }
.mock-q .q-stem img { max-width: 100%; }
.mock-q .opts { gap: 2px; margin-top: 12px; }
.mock-q .opt { min-height: 42px; padding: 8px 10px; background: transparent; border-color: transparent; border-radius: var(--r-btn); color: var(--text-2); font-size: 15.5px; }
.mock-q .opt:hover:not(:disabled) { border-color: transparent; background: var(--hover); }
.mock-q .opt .k { display: inline-flex; flex-direction: row; align-items: center; width: auto; height: 26px; min-width: 46px; justify-content: flex-start; gap: 8px; border: 0; border-radius: 0; background: transparent; color: var(--text-2); font-weight: 500; }
.mock-q .opt .k::before { content: ""; flex: none; width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 50%; background: var(--mid); box-sizing: border-box; }
.mock-q .opts.multi .opt .k::before { border-radius: 4px; }
.mock-q .opts.multi .opt.sel .k::before { border: 0; background: var(--text); box-shadow: inset 0 0 0 4px var(--mid), 0 0 0 1.5px var(--text); }
.mock-q .opt.sel { background: var(--fill); border-color: transparent; color: var(--text); font-weight: 500; }
.mock-q .opt.sel .k { background: transparent; color: var(--text); }
.mock-q .opt.sel .k::before { border: 5px solid var(--text); }
.mock-tools { grid-column: 2; display: flex; gap: 6px; margin-top: 10px; }
.mock-tool { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--fill); color: var(--text-2); font-size: 14px; cursor: pointer; }
.mock-tool:hover { border-color: var(--line-2); color: var(--text); }
.mock-tool.on { background: var(--signal); border-color: transparent; color: var(--on-signal); font-weight: 700; }
.mock-section { display: flex; align-items: baseline; gap: 8px; margin: 22px 4px 10px; font-size: 18px; font-weight: 800; }
.mock-section small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.mock-head .mock-warn { color: var(--orange); font-weight: 600; }
.mock-q .fill-box { margin-top: 12px; }
.mock-grid-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 14px 0 8px; font-size: 13.5px; font-weight: 700; }
.mock-grid-title small { font-size: 12px; font-weight: 500; color: var(--text-3); }
.mock-panel .grid { gap: 6px; }
.mock-panel .cell { min-height: 0; font-size: 12.5px; }
.mock-end { margin-top: 6px; display: none; }
.mock-side { display: none; }
.mock-dock .btn.primary { width: 100%; }
.mock-finish { min-height: 60vh; display: grid; place-content: center; gap: 10px; padding: 24px; text-align: center; }
.mock-result td, .mock-result th { white-space: nowrap; }

.mock-clock { font-family: var(--num); font-size: 42px; font-weight: 700; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; }
.mock-clock-label { margin: 8px 0 18px; text-align: center; font-size: 13px; color: var(--text-2); }
.mock-panel .grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mock-panel .cell { border-radius: 50%; }
.mock-panel .cell.done { background: var(--primary); color: var(--on-primary); }
.mock-panel .l-done { background: var(--primary); }
.mock-panel .btn.primary { margin-top: 18px; }
.mock-panel .btn.block + .btn.block { margin-top: 8px; }
.mock-note { margin: 8px 0 0; text-align: center; font-size: 12px; color: var(--text-3); }

@media (min-width: 1020px) {
  .view.mock-run { padding-bottom: 0; }
  .mock-top, .mock-dock { display: none; }
  .mock-layout { grid-template-columns: minmax(0, 1fr) 320px; padding: 24px; align-items: start; }
  .mock-q { grid-template-columns: auto minmax(0, 1fr) 40px; padding: 28px 22px 28px 28px; margin-bottom: 18px; scroll-margin-top: 20px; }
  .mock-q .q-stem { font-size: 17px; }
  .mock-tools { grid-column: 3; grid-row: 1; flex-direction: column; margin: 0 0 0 auto; }
  .mock-side { display: block; position: sticky; top: 24px; }
  .mock-panel { max-height: calc(100vh - 48px); overflow-y: auto; padding: 22px; background: var(--mid); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); }
  .mock-end { display: flex; max-width: 280px; margin-left: auto; }
}

/* 快速练习 */
.quick-grid { display: grid; gap: 16px; }
.quick-chips { margin: 6px 0 0; padding: 0; flex-wrap: wrap; }
@media (min-width: 760px) { .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } }

/* 成绩分享卡 */
.share-btn { margin-top: 8px; }
.share-preview { display: block; width: min(100%, 340px); height: auto; margin: 0 auto; border-radius: var(--r-card); box-shadow: var(--shadow-panel); }
.share-actions { display: flex; gap: 8px; }
.share-actions .btn { flex: 1; }

/* 新用户第一屏 */
.first-run { display: flex; flex-direction: column; justify-content: center; min-height: min(72vh, 620px); padding: 28px 22px; border-radius: var(--r-panel); background: var(--ticket); color: var(--ticket-text); }
.first-kicker { margin: 0; color: var(--signal); font-size: 14px; font-weight: 700; }
.first-run h1 { margin: 10px 0 0; color: var(--ticket-text); font-size: 34px; line-height: 1.25; font-weight: 800; }
.first-run p:not(.first-kicker) { margin: 12px 0 0; color: var(--ticket-dim); font-size: 16px; }
.btn.lg.first-cta { width: 100%; max-width: 360px; min-height: 60px; gap: 8px; margin-top: 26px; font-size: 19px; }
.first-skip { align-self: flex-start; margin-top: 12px; padding: 6px 2px; border: 0; background: none; color: var(--ticket-dim); font-size: 14px; cursor: pointer; }

/* 分享卡样式切换 */
.share-seg { margin-bottom: 12px; }

/* 增长漏斗 */
.funnel-table th, .funnel-table td { white-space: nowrap; }
.funnel-total td { font-weight: 700; background: var(--fill); }
