/* 电击小子 · 高压电工题库
   皮卡丘配色系统：黄只做底/描边/高亮，正文永远是雷电墨。
   字体分工：标题用站酷快乐体子集，正文走系统中文字体。 */

@font-face {
  font-family: "Pika Display";
  src: url("assets/fonts/pika-display.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================== 令牌 ============================== */
:root {
  color-scheme: light;

  --paper: #fffbf0;
  --paper-2: #fff6e0;
  --surface: #ffffff;
  --surface-2: #fdf7e8;
  --sunk: #f4ecd8;

  --ink: #2e2a1e;
  --ink-2: #6e6553;
  --ink-3: #a2977f;

  --pika: #ffcb05;
  --pika-deep: #e08a00;
  --pika-soft: #fff2c2;
  --pika-edge: #2e2a1e;

  --cheek: #ee4b3b;
  --cheek-soft: #ffe3de;
  --leaf: #2f9e68;
  --leaf-soft: #dcf3e7;
  --thunder: #3b6fe0;
  --thunder-soft: #e2eafc;
  --berry: #7c5cf0;
  --berry-soft: #ede8ff;

  --line: #e8dfc8;
  --line-2: #d6c9a8;

  --sh-s: 0 1px 2px rgba(46, 42, 30, 0.06), 0 2px 8px rgba(46, 42, 30, 0.05);
  --sh-m: 0 6px 20px rgba(46, 42, 30, 0.1);
  --sh-l: 0 16px 40px rgba(46, 42, 30, 0.18);
  --sticker: 2px 2px 0 var(--pika-edge);

  --r-s: 9px;
  --r-m: 13px;
  --r-l: 18px;
  --r-xl: 24px;
  --pill: 999px;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --step: 1;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --pop: cubic-bezier(0.34, 1.4, 0.64, 1);

  /* 闪电底纹：深色描边版用在黄底上，浅色版用在墨底上 */
  --bolt-pattern: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46'%3E%3Cpath d='M27 7 L15 27h7l-3 12L33 21h-7z' fill='%232e2a1e'/%3E%3C/svg%3E");
  --bolt-pattern-dark: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='46' height='46'%3E%3Cpath d='M27 7 L15 27h7l-3 12L33 21h-7z' fill='%23ffcb05'/%3E%3C/svg%3E");

  --display: "Pika Display", "Yuanti SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --body: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "OPPOSans", "Source Han Sans SC", "Noto Sans CJK SC",
    "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #16171c;
    --paper-2: #1b1d23;
    --surface: #1e2026;
    --surface-2: #252831;
    --sunk: #2c303a;

    --ink: #f3eddd;
    --ink-2: #b5ac95;
    --ink-3: #837a67;

    --pika: #ffd34d;
    --pika-deep: #ffb020;
    --pika-soft: #3a3316;
    --pika-edge: #0d0e11;

    --cheek: #ff6a5a;
    --cheek-soft: #3b2320;
    --leaf: #48be86;
    --leaf-soft: #1b3329;
    --thunder: #6f9bff;
    --thunder-soft: #1e2740;
    --berry: #a88cff;
    --berry-soft: #272041;

    --line: #32353f;
    --line-2: #454a57;

    --sh-s: 0 1px 2px rgba(0, 0, 0, 0.4);
    --sh-m: 0 8px 24px rgba(0, 0, 0, 0.5);
    --sh-l: 0 20px 48px rgba(0, 0, 0, 0.6);
    --sticker: 2px 2px 0 rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #16171c;
  --paper-2: #1b1d23;
  --surface: #1e2026;
  --surface-2: #252831;
  --sunk: #2c303a;

  --ink: #f3eddd;
  --ink-2: #b5ac95;
  --ink-3: #837a67;

  --pika: #ffd34d;
  --pika-deep: #ffb020;
  --pika-soft: #3a3316;
  --pika-edge: #0d0e11;

  --cheek: #ff6a5a;
  --cheek-soft: #3b2320;
  --leaf: #48be86;
  --leaf-soft: #1b3329;
  --thunder: #6f9bff;
  --thunder-soft: #1e2740;
  --berry: #a88cff;
  --berry-soft: #272041;

  --line: #32353f;
  --line-2: #454a57;

  --sh-s: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-m: 0 8px 24px rgba(0, 0, 0, 0.5);
  --sh-l: 0 20px 48px rgba(0, 0, 0, 0.6);
  --sticker: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

:root[data-size="s"] { --step: 0.92; }
:root[data-size="l"] { --step: 1.1; }
:root[data-size="xl"] { --step: 1.22; }

/* ============================== 基础 ============================== */
* { box-sizing: border-box; }

html {
  background: var(--pika-edge);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: calc(15px * var(--step));
  line-height: 1.75;
  letter-spacing: 0.012em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere;
}

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.2em; }
h1, h2, h3 { text-wrap: balance; line-height: 1.35; }

:where(button, select, input, a, [tabindex]):focus-visible {
  outline: 3px solid var(--thunder);
  outline-offset: 2px;
  border-radius: 6px;
}

.is-hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
::selection { background: var(--pika); color: var(--ink); }

.num { font-variant-numeric: tabular-nums; }
.dsp { font-family: var(--display); font-weight: 400; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================== 外壳 ============================== */
.app-shell {
  position: relative;
  width: min(100%, 940px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.28);
}

/* ------------------------------ 顶栏 ------------------------------ */
.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 6px;
  min-height: calc(56px + var(--safe-t));
  padding: var(--safe-t) 10px 0;
  color: var(--paper);
  background: var(--pika-edge);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 -3px 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--pika) 0 12px, var(--pika-deep) 12px 24px);
}
.topbar.is-quiz { background: var(--pika); color: var(--ink); }
.topbar.is-quiz .icon-btn { background: rgba(46, 42, 30, 0.1); }
.topbar.is-quiz .icon-btn:hover { background: rgba(46, 42, 30, 0.2); }

.back-btn { grid-column: 1; }
.brand { grid-column: 2; }
.topbar-tools { grid-column: 3; display: flex; gap: 2px; }

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 5px 2px;
  color: inherit;
  text-align: left;
}
.brand-mark {
  flex: none;
  width: 30px; height: 30px;
  display: block;
}
.brand-text { display: grid; min-width: 0; line-height: 1.2; }
.brand-text strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(15.5px * var(--step));
  letter-spacing: 0.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text small {
  font-size: calc(10.5px * var(--step));
  opacity: 0.6;
  letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  color: inherit;
  font-size: calc(15px * var(--step));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.16s var(--ease), transform 0.16s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.2); }
.icon-btn:active { transform: scale(0.9); }

/* ------------------------------ 主体 ------------------------------ */
.main { padding-bottom: calc(86px + var(--safe-b)); min-height: 62vh; }
.pad { padding: 0 16px; }
.page { animation: page-in 0.26s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ------------------------------ 标签栏 ---------------------------- */
.tabbar {
  position: fixed;
  z-index: 40;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 940px);
  padding: 5px 6px calc(5px + var(--safe-b));
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 7px 4px 5px;
  color: var(--ink-3);
  border-radius: 12px;
  transition: color 0.16s var(--ease);
}
.tab-ico {
  display: grid; place-items: center;
  width: 26px; height: 22px;
  font-size: calc(15px * var(--step));
  line-height: 1;
  border-radius: 8px;
  transition: background 0.2s var(--ease), transform 0.24s var(--pop);
}
.tab-txt { font-size: calc(10.5px * var(--step)); font-weight: 600; letter-spacing: 0.04em; }
.tab.is-on { color: var(--ink); }
.tab.is-on .tab-ico { background: var(--pika); transform: translateY(-1px); }
.tab-dot {
  position: absolute;
  top: 4px; right: 50%;
  margin-right: -17px;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  font-size: 9px; font-weight: 700; line-height: 15px;
  color: #fff; text-align: center;
  background: var(--cheek);
  border-radius: var(--pill);
  border: 1.5px solid var(--surface);
}

/* ============================== 组件 ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  font-size: calc(14px * var(--step));
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--pill);
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease), background 0.16s var(--ease);
}
.btn--primary {
  color: var(--ink);
  background: var(--pika);
  border: 2px solid var(--pika-edge);
  box-shadow: var(--sticker);
}
.btn--primary:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--pika-edge); }
.btn--ghost {
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-2);
}
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { color: #fff; background: var(--cheek); }
.btn--text { color: var(--ink-2); padding: 9px 12px; }
.btn--text:hover { color: var(--pika-deep); }
.btn--ghost:active, .btn--danger:active, .btn--text:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.42; pointer-events: none; }
.btn--block { width: 100%; padding: 13px; font-size: calc(15px * var(--step)); }
.btn-stack { display: grid; gap: 9px; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 24px 0 11px;
}
.sec-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(19px * var(--step));
  letter-spacing: 0.02em;
}
.sec-head span { font-size: calc(11.5px * var(--step)); color: var(--ink-3); }

.note {
  padding: 11px 13px;
  font-size: calc(12px * var(--step));
  line-height: 1.8;
  color: var(--ink-2);
  border-radius: 0 var(--r-m) var(--r-m) 0;
  background: var(--pika-soft);
  border-left: 3px solid var(--pika-deep);
}
.note.is-warn { background: var(--cheek-soft); border-left-color: var(--cheek); }

.card {
  padding: 14px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-s);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 22px;
  text-align: center;
}
.empty-art { width: 108px; height: 108px; }
.empty h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(18px * var(--step));
}
.empty p { font-size: calc(12.5px * var(--step)); line-height: 1.85; color: var(--ink-2); max-width: 30em; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  font-size: calc(10.5px * var(--step));
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: var(--pill);
  background: var(--pika-soft);
  color: var(--pika-deep);
}
.chip--blue { background: var(--thunder-soft); color: var(--thunder); }
.chip--red { background: var(--cheek-soft); color: var(--cheek); }
.chip--green { background: var(--leaf-soft); color: var(--leaf); }
.chip--berry { background: var(--berry-soft); color: var(--berry); }

.seg {
  display: grid;
  gap: 3px;
  padding: 3px;
  border-radius: var(--pill);
  background: var(--sunk);
}
.seg button {
  padding: 8px 6px;
  font-size: calc(12.5px * var(--step));
  font-weight: 700;
  color: var(--ink-2);
  border-radius: var(--pill);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.seg button.is-on { color: var(--ink); background: var(--surface); box-shadow: var(--sh-s); }

.field { display: grid; gap: 5px; min-width: 0; }
.field > label { font-size: calc(11.5px * var(--step)); font-weight: 600; color: var(--ink-2); letter-spacing: 0.04em; }
.field select, .field input[type="number"], .field input[type="search"], .field input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-m);
  font-size: calc(13.5px * var(--step));
}
.field select {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* ============================== 练习页 ============================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 20px 16px 22px;
  color: var(--ink);
  background: linear-gradient(145deg, var(--pika) 0%, #ffe066 62%, #ffd84a 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bolt-pattern);
  background-size: 46px 46px;
  opacity: 0.16;
  pointer-events: none;
}
.hero-top { position: relative; display: flex; align-items: flex-start; gap: 12px; }
.hero-copy { flex: 1; min-width: 0; }
.hero-eyebrow {
  display: inline-block;
  padding: 3px 10px;
  font-size: calc(10.5px * var(--step));
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pika);
  background: var(--pika-edge);
  border-radius: var(--pill);
}
.hero h1 {
  margin-top: 9px;
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(25px * var(--step));
  letter-spacing: 0.02em;
}
.hero-sub { margin-top: 3px; font-size: calc(12px * var(--step)); color: rgba(46, 42, 30, 0.66); }
.hero-mascot { flex: none; width: 74px; height: 74px; margin-top: -2px; }

.stat-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 15px;
}
.stat {
  display: grid;
  gap: 1px;
  padding: 9px 6px;
  text-align: center;
  border-radius: var(--r-m);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(46, 42, 30, 0.08);
}
.stat b {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(19px * var(--step));
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat span { font-size: calc(10px * var(--step)); color: rgba(46, 42, 30, 0.62); }

.resume {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 11px 13px;
  color: var(--paper);
  background: var(--pika-edge);
  border-radius: var(--r-l);
  box-shadow: var(--sh-m);
  animation: pop-in 0.32s var(--pop) both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(9px) scale(0.98); } to { opacity: 1; transform: none; } }
.resume-num {
  flex: none;
  font-family: var(--display);
  font-size: calc(21px * var(--step));
  font-variant-numeric: tabular-nums;
  color: var(--pika);
  line-height: 1;
}
.resume-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.resume-body b { font-size: calc(13px * var(--step)); }
.resume-body span { font-size: calc(10.5px * var(--step)); opacity: 0.62; }
.resume-go {
  flex: none;
  padding: 7px 13px;
  font-size: calc(12px * var(--step));
  font-weight: 700;
  color: var(--ink);
  background: var(--pika);
  border-radius: var(--pill);
  transition: transform 0.14s var(--ease);
}
.resume-go:active { transform: scale(0.94); }

.cat-list { display: grid; gap: 8px; }
.cat {
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--c, var(--pika));
  overflow: hidden;
  transition: box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.cat:hover { box-shadow: var(--sh-s); transform: translateX(1px); }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; width: 100%; text-align: left; }
.cat-main { flex: 1; min-width: 0; display: block; text-align: left; }
.cat-name { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cat-name b { font-size: calc(13.5px * var(--step)); font-weight: 700; }
.cat-meta { display: block; margin-top: 2px; font-size: calc(10.5px * var(--step)); color: var(--ink-3); }
.cat-bar {
  display: block;
  height: 4px;
  margin-top: 6px;
  border-radius: var(--pill);
  background: var(--sunk);
  overflow: hidden;
}
.cat-bar i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  border-radius: var(--pill);
  background: var(--c, var(--pika));
  transition: width 0.5s var(--ease);
}
.cat-go {
  flex: none;
  padding: 6px 12px;
  font-size: calc(11.5px * var(--step));
  font-weight: 700;
  color: var(--ink);
  background: var(--pika);
  border-radius: var(--pill);
  border: 1.5px solid var(--pika-edge);
  transition: transform 0.14s var(--ease);
}
.cat-go:active { transform: scale(0.93); }
.cat-done { flex: none; font-size: calc(17px * var(--step)); color: var(--leaf); }
.cat-more {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: calc(15px * var(--step));
  color: var(--ink-3);
  border-radius: 8px;
}
.cat-more:hover { color: var(--ink); background: var(--sunk); }
.cat-panel {
  padding: 0 13px 13px;
  border-top: 1px dashed var(--line);
  margin-top: -1px;
  animation: page-in 0.2s var(--ease) both;
}
.cat-panel h4 {
  margin: 11px 0 5px;
  font-size: calc(11.5px * var(--step));
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c, var(--pika-deep));
}
.cat-panel p, .cat-panel li { font-size: calc(12.5px * var(--step)); line-height: 1.85; color: var(--ink-2); }
.cat-panel ul { display: grid; gap: 3px; }

/* ============================== 考试页 ============================ */
.page-head {
  position: relative;
  overflow: hidden;
  padding: 20px 16px 20px;
  color: var(--paper);
  background: var(--pika-edge);
}
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bolt-pattern-dark);
  background-size: 46px 46px;
  opacity: 0.2;
}
.page-head .inner { position: relative; display: flex; align-items: center; gap: 12px; }
.page-head h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(22px * var(--step));
  letter-spacing: 0.02em;
}
.page-head p { margin-top: 3px; font-size: calc(12px * var(--step)); color: rgba(255, 251, 240, 0.64); }
.page-head .mascot-sm { flex: none; width: 52px; height: 52px; }

.exam-form { display: grid; gap: 13px; }
.exam-form .seg { grid-template-columns: repeat(3, 1fr); }
.exam-form .seg.is-4 { grid-template-columns: repeat(4, 1fr); }
.exam-brief {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-m);
  background: var(--thunder-soft);
  font-size: calc(12px * var(--step));
  line-height: 1.7;
  color: var(--ink-2);
}
.exam-brief b { color: var(--thunder); font-variant-numeric: tabular-nums; }

.score-list { display: grid; gap: 7px; }
.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: background 0.16s var(--ease);
}
.score-row:hover { background: var(--surface-2); }
.score-row .sdot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.score-row .sinfo { flex: 1; min-width: 0; }
.score-row .sinfo b { display: block; font-size: calc(12.5px * var(--step)); }
.score-row .sinfo span { font-size: calc(10.5px * var(--step)); color: var(--ink-3); }
.score-row .sval {
  font-family: var(--display);
  font-size: calc(19px * var(--step));
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.score-row .stag { flex: none; font-size: calc(10.5px * var(--step)); font-weight: 700; }

/* ============================== 错题页 ============================ */
.state-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.state-pill {
  display: grid;
  gap: 1px;
  padding: 11px 6px;
  text-align: center;
  border-radius: var(--r-m);
}
.state-pill b {
  font-family: var(--display);
  font-size: calc(21px * var(--step));
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.state-pill span { font-size: calc(10.5px * var(--step)); }
.state-pill.is-todo { background: var(--cheek-soft); color: var(--cheek); }
.state-pill.is-doing { background: var(--pika-soft); color: var(--pika-deep); }
.state-pill.is-done { background: var(--leaf-soft); color: var(--leaf); }

.wgroup {
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.wg-head {
  display: flex;
  align-items: center;
  padding-right: 6px;
  border-left: 4px solid var(--c, var(--pika));
  background: var(--surface-2);
}
.wg-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  text-align: left;
}
.wg-head b { flex: 1; min-width: 0; font-size: calc(12.5px * var(--step)); }
.wg-head .cnt { font-size: calc(10.5px * var(--step)); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wg-head .caret { font-size: calc(11px * var(--step)); color: var(--ink-3); transition: transform 0.2s var(--ease); }
.wg-head.is-open .caret { transform: rotate(180deg); }
.wg-items { display: grid; grid-template-columns: minmax(0, 1fr); }
.witem {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  width: 100%;
}
.witem .wdot { flex: none; width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; }
.witem .wdot.is-todo { background: var(--cheek); }
.witem .wdot.is-doing { background: var(--pika-deep); }
/* 截断要放在按钮内部的 span 上：浏览器会把 button 的 display 规范化，
   -webkit-box 加在 button 自身不生效，文字也会默认居中 */
.witem .wtx { flex: 1; min-width: 0; text-align: left; }
.witem .wtx span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: calc(12px * var(--step));
  line-height: 1.7;
  color: var(--ink-2);
}
.witem .wtx:hover span { color: var(--ink); }
.witem .wn { flex: none; font-size: calc(10px * var(--step)); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.witem .wdel {
  flex: none;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  font-size: calc(13px * var(--step));
  color: var(--ink-3);
  border-radius: 7px;
}
.witem .wdel:hover { color: var(--cheek); background: var(--cheek-soft); }

/* ============================== 答题页 ============================ */
.quiz { padding-bottom: calc(80px + var(--safe-b)); }

.quiz-bar {
  position: sticky;
  z-index: 25;
  top: calc(56px + var(--safe-t));
  height: 5px;
  background: var(--sunk);
}
.quiz-bar i {
  display: block;
  height: 100%;
  width: var(--p, 0%);
  background: linear-gradient(90deg, var(--pika-deep), var(--pika));
  transition: width 0.35s var(--ease);
  position: relative;
}
.quiz-bar i::after {
  content: "";
  position: absolute;
  right: -1px; top: -3px;
  width: 11px; height: 11px;
  background: var(--pika-deep);
  clip-path: polygon(55% 0, 15% 55%, 45% 55%, 30% 100%, 85% 42%, 52% 42%);
}

.quiz-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 0;
  font-size: calc(11.5px * var(--step));
  color: var(--ink-2);
}
.quiz-meta .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer {
  flex: none;
  padding: 4px 11px;
  font-family: var(--display);
  font-size: calc(14px * var(--step));
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--pika-soft);
  border-radius: var(--pill);
}
.timer.is-urgent { color: #fff; background: var(--cheek); animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { transform: scale(1.07); } }

.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 12px 16px 0;
  padding: 3px;
  border-radius: var(--pill);
  background: var(--sunk);
}
.view-switch button {
  padding: 7px;
  font-size: calc(12.5px * var(--step));
  font-weight: 700;
  color: var(--ink-2);
  border-radius: var(--pill);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.view-switch button.is-on { color: var(--ink); background: var(--surface); box-shadow: var(--sh-s); }

/* 滑动舞台 */
.stage { position: relative; overflow: hidden; touch-action: pan-y; }
.stage-inner { padding: 12px 16px 0; will-change: transform; }
.stage.is-drag .stage-inner { transition: none; }
.stage.is-snap .stage-inner { transition: transform 0.22s var(--ease); }
.stage.is-out .stage-inner { transition: transform 0.16s ease-in, opacity 0.16s ease-in; opacity: 0; }

/* 换题：从手指离开的反方向滑入，方向感明确 */
.stage-inner.slide-left { animation: slide-from-right 0.19s var(--ease) both; }
.stage-inner.slide-right { animation: slide-from-left 0.19s var(--ease) both; }
@keyframes slide-from-right {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: none; }
}
@keyframes slide-from-left {
  from { opacity: 0; transform: translateX(-26px); }
  to { opacity: 1; transform: none; }
}

.swipe-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.86);
  z-index: 5;
  padding: 7px 13px;
  font-size: calc(11.5px * var(--step));
  font-weight: 700;
  color: var(--ink);
  background: var(--pika);
  border: 2px solid var(--pika-edge);
  border-radius: var(--pill);
  box-shadow: var(--sh-m);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s var(--ease), transform 0.18s var(--pop);
  white-space: nowrap;
}
.swipe-hint.is-left { left: 12px; }
.swipe-hint.is-right { right: 12px; }
.swipe-hint.is-show { opacity: 1; transform: translateY(-50%) scale(1); }
.swipe-hint.is-edge { background: var(--sunk); color: var(--ink-3); border-color: var(--line-2); }

.q-card {
  padding: 15px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-s);
}
.q-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.q-no { margin-left: auto; font-size: calc(10.5px * var(--step)); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.q-stem {
  font-size: calc(16.5px * var(--step));
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: 0.015em;
}
.q-figure {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 0;
  padding: 11px 12px;
  border-radius: var(--r-m);
  background: var(--thunder-soft);
  border: 1.5px dashed var(--thunder);
}
.q-figure-ico { flex: none; font-size: calc(18px * var(--step)); line-height: 1.25; color: var(--thunder); }
.q-figure > span:last-child { font-size: calc(11.5px * var(--step)); line-height: 1.75; color: var(--ink-2); }
.q-figure b { display: block; font-size: calc(12.5px * var(--step)); color: var(--thunder); }
.q-tools { display: flex; gap: 7px; margin-top: 13px; padding-top: 11px; border-top: 1px dashed var(--line); }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  font-size: calc(11.5px * var(--step));
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.tool-btn:hover { color: var(--pika-deep); background: var(--pika-soft); }
.tool-btn.is-on { color: var(--pika-deep); background: var(--pika-soft); border-color: transparent; }
.tool-btn.is-flag.is-on { color: var(--berry); background: var(--berry-soft); }

.opts { display: grid; gap: 8px; margin-top: 11px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  text-align: left;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: var(--sh-s);
  transition: transform 0.13s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.opt:not([disabled]):hover { border-color: var(--pika-deep); transform: translateY(-1px); }
.opt:not([disabled]):active { transform: scale(0.985); }
.opt-key {
  flex: none;
  display: grid; place-items: center;
  width: 26px; height: 26px;
  /* 选项字母是判读关键，固定用系统字体的粗体，不跟标题字走 */
  font-family: var(--body);
  font-weight: 800;
  font-size: calc(13px * var(--step));
  color: var(--ink-2);
  background: var(--sunk);
  border-radius: 8px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.opt-text { flex: 1; min-width: 0; font-size: calc(14.5px * var(--step)); line-height: 1.7; padding-top: 2px; }
.opt-mark { flex: none; align-self: center; font-size: calc(15px * var(--step)); font-weight: 700; }
.opt.is-pick { border-color: var(--pika-deep); background: var(--pika-soft); }
.opt.is-pick .opt-key { color: var(--ink); background: var(--pika); }
.opt.is-right { border-color: var(--leaf); background: var(--leaf-soft); }
.opt.is-right .opt-key, .opt.is-right .opt-mark { color: #fff; background: var(--leaf); }
.opt.is-right .opt-mark { background: none; color: var(--leaf); }
.opt.is-bad { border-color: var(--cheek); background: var(--cheek-soft); }
.opt.is-bad .opt-key { color: #fff; background: var(--cheek); }
.opt.is-bad .opt-mark { color: var(--cheek); }
.opt[disabled] { cursor: default; }

.q-actions { display: grid; gap: 9px; margin-top: 14px; }
.q-actions.is-two { grid-template-columns: 1fr auto; align-items: center; }

/* 判定条 */
.verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: var(--r-l);
  background: var(--leaf-soft);
  border-left: 4px solid var(--leaf);
  animation: pop-in 0.26s var(--pop) both;
}
.verdict.is-bad { background: var(--cheek-soft); border-left-color: var(--cheek); }
.verdict-art { flex: none; width: 46px; height: 46px; }
.verdict-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.verdict-copy strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(16px * var(--step));
  color: var(--leaf);
}
.verdict.is-bad .verdict-copy strong { color: var(--cheek); }
.verdict-copy span { font-size: calc(12px * var(--step)); color: var(--ink-2); line-height: 1.7; }

.streak {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: calc(11px * var(--step));
  font-weight: 700;
  color: var(--ink);
  background: var(--pika);
  border-radius: var(--pill);
  animation: pop-in 0.3s var(--pop) both;
}

.study-answer {
  display: grid;
  gap: 3px;
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: var(--r-l);
  background: var(--leaf-soft);
  border-left: 4px solid var(--leaf);
}
.study-answer span { font-size: calc(10.5px * var(--step)); font-weight: 700; letter-spacing: 0.08em; color: var(--leaf); }
.study-answer strong { font-size: calc(14.5px * var(--step)); line-height: 1.7; font-weight: 600; }

/* 解析卡 */
.exp {
  margin-top: 11px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-s);
  overflow: hidden;
}
.exp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: linear-gradient(100deg, var(--pika-soft), transparent);
  border-bottom: 1px solid var(--line);
}
.exp-head h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(15px * var(--step));
  letter-spacing: 0.03em;
}
.exp-head .point {
  margin-left: auto;
  padding: 2px 9px;
  font-size: calc(10px * var(--step));
  font-weight: 700;
  color: var(--pika-deep);
  background: var(--pika-soft);
  border-radius: var(--pill);
  text-align: right;
}
.exp-body { padding: 3px 14px 14px; }
.exp-sec { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.exp-sec:last-child { border-bottom: 0; padding-bottom: 3px; }
.exp-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: calc(11.5px * var(--step));
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--pika-deep);
}
.exp-label i {
  display: grid; place-items: center;
  width: 19px; height: 19px;
  font-style: normal;
  font-size: calc(10.5px * var(--step));
  border-radius: 6px;
  background: var(--pika-soft);
}
.exp-sec p { font-size: calc(13.5px * var(--step)); line-height: 1.95; color: var(--ink); }
.exp-sec p + p { margin-top: 7px; }
.exp-sec.is-trap .exp-label { color: var(--cheek); }
.exp-sec.is-trap .exp-label i { background: var(--cheek-soft); }
.exp-sec.is-mem .exp-label { color: var(--berry); }
.exp-sec.is-mem .exp-label i { background: var(--berry-soft); }

.exp-lead {
  padding: 11px 13px;
  font-size: calc(13.5px * var(--step));
  line-height: 1.85;
  border-radius: var(--r-m);
  background: var(--leaf-soft);
}
.exp-opts { display: grid; gap: 7px; }
.exp-opt {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border-left: 3px solid var(--line-2);
}
.exp-opt.is-right { background: var(--leaf-soft); border-left-color: var(--leaf); }
.exp-opt b { flex: none; width: 16px; font-family: var(--display); font-size: calc(13px * var(--step)); color: var(--ink-2); }
.exp-opt.is-right b { color: var(--leaf); }
.exp-opt span { font-size: calc(12.5px * var(--step)); line-height: 1.85; color: var(--ink-2); }
.exp-opt.is-right span { color: var(--ink); }

/* 悬浮题号 */
.fab {
  position: fixed;
  z-index: 35;
  right: max(16px, calc(50vw - 454px));
  bottom: calc(20px + var(--safe-b));
  display: grid;
  padding: 8px 15px;
  color: var(--ink);
  background: var(--pika);
  border: 2px solid var(--pika-edge);
  border-radius: var(--pill);
  box-shadow: var(--sh-l);
  transition: transform 0.14s var(--ease);
}
.fab:active { transform: scale(0.94); }
.fab b { font-family: var(--display); font-size: calc(14px * var(--step)); font-variant-numeric: tabular-nums; line-height: 1.15; }
.fab small { font-size: calc(9.5px * var(--step)); opacity: 0.7; }

/* 答题卡 */
.sheet-legend { display: flex; flex-wrap: wrap; gap: 13px; margin-bottom: 12px; font-size: calc(11.5px * var(--step)); color: var(--ink-2); }
.sheet-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sheet-legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--sunk); }
.sheet-legend i.c { background: var(--leaf); }
.sheet-legend i.w { background: var(--cheek); }
.sheet-legend i.s { background: var(--ink-3); }
.sheet-legend i.f { background: var(--berry); }
.sheet-legend i.a { background: var(--thunder); }

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 7px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 2px;
}
.sheet-dot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: calc(12px * var(--step));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  transition: transform 0.13s var(--ease);
}
.sheet-dot:active { transform: scale(0.9); }
.sheet-dot.is-correct { color: #fff; background: var(--leaf); border-color: transparent; }
.sheet-dot.is-wrong { color: #fff; background: var(--cheek); border-color: transparent; }
.sheet-dot.is-skipped { color: #fff; background: var(--ink-3); border-color: transparent; }
.sheet-dot.is-answered { color: #fff; background: var(--thunder); border-color: transparent; }
.sheet-dot.is-flag { box-shadow: inset 0 0 0 2px var(--berry); }
.sheet-dot.is-now { box-shadow: 0 0 0 3px var(--pika-deep); }

/* ============================== 结果页 ============================ */
.result-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 26px 18px 24px;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(150deg, var(--pika), #ffe066);
}
.result-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--bolt-pattern);
  background-size: 46px 46px;
  opacity: 0.16;
}
.result-hero.is-fail { background: linear-gradient(150deg, #ffd9d2, #ffeae6); }
.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 108px; height: 108px;
  border-radius: 50%;
  background: conic-gradient(var(--pika-edge) calc(var(--p) * 1%), rgba(46, 42, 30, 0.14) 0);
}
.score-ring::before {
  content: "";
  position: absolute; inset: 9px;
  border-radius: 50%;
  background: var(--pika);
}
.result-hero.is-fail .score-ring { background: conic-gradient(var(--cheek) calc(var(--p) * 1%), rgba(46, 42, 30, 0.12) 0); }
.result-hero.is-fail .score-ring::before { background: #ffeae6; }
.score-ring b {
  position: relative;
  font-family: var(--display);
  font-size: calc(34px * var(--step));
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.score-ring span { position: relative; font-size: calc(10px * var(--step)); color: rgba(46, 42, 30, 0.6); }
.result-hero h1 {
  position: relative;
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(21px * var(--step));
}
.result-hero p { position: relative; font-size: calc(12px * var(--step)); color: rgba(46, 42, 30, 0.66); }
.pass-badge {
  position: relative;
  padding: 4px 14px;
  font-size: calc(12px * var(--step));
  font-weight: 700;
  color: var(--paper);
  background: var(--pika-edge);
  border-radius: var(--pill);
}
.result-hero.is-fail .pass-badge { background: var(--cheek); color: #fff; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid3 > div {
  display: grid; gap: 2px;
  padding: 12px 8px;
  text-align: center;
  border-radius: var(--r-m);
  background: var(--surface);
  border: 1px solid var(--line);
}
.grid3 b {
  font-family: var(--display);
  font-size: calc(20px * var(--step));
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.grid3 span { font-size: calc(10.5px * var(--step)); color: var(--ink-3); }

/* ============================== 我的页 ============================ */
.panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-s);
}
.panel h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(16px * var(--step));
  letter-spacing: 0.02em;
}
.panel > p { margin-top: 4px; font-size: calc(12px * var(--step)); line-height: 1.8; color: var(--ink-2); }
.panel .btn-stack { margin-top: 11px; }

.activity { display: flex; gap: 4px; margin-top: 12px; }
.act-cell { flex: 1; display: grid; gap: 4px; justify-items: center; }
.act-cell i {
  position: relative;
  display: block;
  width: 100%; height: 36px;
  border-radius: 7px;
  background: var(--sunk);
  overflow: hidden;
}
.act-cell i::after {
  content: "";
  position: absolute; inset: auto 0 0 0;
  height: var(--h, 0%);
  background: linear-gradient(180deg, var(--pika), var(--pika-deep));
  border-radius: 7px;
}
.act-cell small { font-size: calc(9.5px * var(--step)); color: var(--ink-3); }

.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.opt-row > div { min-width: 0; }
.opt-row strong { display: block; font-size: calc(13px * var(--step)); }
.opt-row small { display: block; margin-top: 2px; font-size: calc(11px * var(--step)); line-height: 1.7; color: var(--ink-3); }
.opt-row .seg { flex: none; display: inline-flex; }
.opt-row .seg button { padding: 6px 11px; font-size: calc(11.5px * var(--step)); }

.kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  font-size: calc(10.5px * var(--step));
  font-weight: 700;
  font-family: var(--mono);
  text-align: center;
  color: var(--ink-2);
  background: var(--sunk);
  border: 1px solid var(--line-2);
  border-radius: 5px;
}

/* ============================== 搜索 ============================== */
.search-bar { display: flex; gap: 8px; }
.search-bar input {
  flex: 1;
  padding: 12px 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--pill);
  font-size: calc(13.5px * var(--step));
}
.hit-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.hit {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  text-align: left;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.16s var(--ease);
}
.hit:hover { transform: translateX(2px); box-shadow: var(--sh-s); }
.hit > div { flex: 1; min-width: 0; }
.hit mark { background: var(--pika); color: var(--ink); border-radius: 3px; padding: 0 2px; }
.hit-tags { display: flex; gap: 5px; margin-bottom: 4px; flex-wrap: wrap; }
.hit-stem {
  font-size: calc(12.5px * var(--step));
  line-height: 1.7;
  color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hit-go { flex: none; font-size: calc(15px * var(--step)); color: var(--pika-deep); }

/* ============================== 弹层 ============================== */
.mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(20, 16, 6, 0.48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade 0.18s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(100%, 520px);
  max-height: 86vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 17px;
  padding-bottom: calc(17px + var(--safe-b));
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 2px solid var(--pika-edge);
  box-shadow: var(--sh-l);
  animation: rise 0.26s var(--pop) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(18px * var(--step));
  letter-spacing: 0.02em;
}
.sheet-head p { margin-top: 3px; font-size: calc(12px * var(--step)); line-height: 1.75; color: var(--ink-2); }
.sheet-close {
  flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  font-size: calc(17px * var(--step));
  color: var(--ink-2);
  background: var(--sunk);
  border-radius: 9px;
}
.sheet-close:hover { color: var(--ink); }
.sheet-body { display: grid; gap: 12px; }

.menu-list { display: grid; gap: 6px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  text-align: left;
  font-size: calc(13.5px * var(--step));
  border-radius: var(--r-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background 0.16s var(--ease);
}
.menu-item:hover { background: var(--sunk); }
.menu-item .mi { flex: none; width: 22px; text-align: center; font-size: calc(14px * var(--step)); }
.menu-item.is-danger { color: var(--cheek); }
.menu-item small { display: block; font-size: calc(11px * var(--step)); color: var(--ink-3); margin-top: 1px; }

.range-row { display: flex; align-items: center; gap: 11px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--pika-deep); }
.range-val {
  min-width: 48px;
  padding: 5px 9px;
  text-align: center;
  font-family: var(--display);
  font-size: calc(13px * var(--step));
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--pika-soft);
  border-radius: var(--r-s);
}

textarea.io {
  width: 100%;
  height: 140px;
  padding: 11px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-m);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  resize: vertical;
}

.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: calc(92px + var(--safe-b));
  transform: translate(-50%, 14px);
  max-width: min(90vw, 440px);
  padding: 10px 17px;
  font-size: calc(12.5px * var(--step));
  line-height: 1.65;
  color: var(--paper);
  text-align: center;
  background: var(--pika-edge);
  border-radius: var(--pill);
  box-shadow: var(--sh-l);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* 电光一闪 */
.spark {
  position: fixed;
  z-index: 55;
  left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  width: 120px; height: 120px;
  pointer-events: none;
  animation: spark 0.52s var(--ease) both;
}
@keyframes spark {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(-12deg); }
  35% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) rotate(4deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3) rotate(8deg); }
}

/* ============================== 宽屏 ============================== */
@media (min-width: 700px) {
  .pad { padding: 0 24px; }
  .hero { padding: 26px 24px; }
  .hero h1 { font-size: calc(30px * var(--step)); }
  .hero-mascot { width: 92px; height: 92px; }
  .page-head { padding: 24px; }
  .quiz-meta { padding-left: 24px; padding-right: 24px; }
  .view-switch { margin-left: 24px; margin-right: 24px; }
  .stage-inner { padding-left: 24px; padding-right: 24px; }
  .cat-list { grid-template-columns: 1fr 1fr; }
  .mask { place-items: center; }
  .q-stem { font-size: calc(17.5px * var(--step)); }
}

@media print {
  .topbar, .tabbar, .fab, .toast, .view-switch, .q-actions, #modalRoot, .swipe-hint { display: none !important; }
  .app-shell { box-shadow: none; }
  body { background: #fff; }
}
