/* ============================================================
   大考刷题 — 设计系统 v3
   宣纸 · 墨 · 靛 · 朱砂  /  衬线数字 / 分类图形
   ============================================================ */

@font-face {
  font-family: 'PFDisplay';
  src: url('serif.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --kb: 0px;
  --fs: 1;

  --r: 18px;
  --r-sm: 12px;
  --r-xs: 9px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --pad: 18px;
  --serif: 'PFDisplay', Georgia, 'Times New Roman', serif;
}

html[data-theme="light"] {
  --bg: #F4F0E7;
  --bg-2: #FBF8F1;
  --card: #FFFCF6;
  --card-2: #F8F4EA;
  --ink: #1A1611;
  --ink2: #463F35;
  --muted: #7C7466;
  --faint: #A89F8F;
  --line: #E3DACA;
  --line2: #EFE8DA;
  --accent: #2B4A6F;
  --accent-soft: #E7EDF4;
  --on-accent: #FBF8F1;
  --green: #2E6B52;
  --green-bg: #E9F2EC;
  --amber: #B0791F;
  --amber-bg: #FAF2E1;
  --rose: #A83A2B;
  --rose-bar: #C4705F;
  --rose-bg: #F8E9E4;
  --ok: #2E6B52;
  --bad: #A83A2B;
  --shadow: 0 1px 2px rgba(26, 22, 17, .045);
  --shadow-md: 0 6px 20px -14px rgba(26, 22, 17, .35);
  --inset-top: inset 0 1px 0 rgba(255, 255, 255, .75);
}

html[data-theme="dark"] {
  --bg: #0C0B09;
  --bg-2: #12110E;
  --card: #17150F;
  --card-2: #1D1A14;
  --ink: #F4EFE4;
  --ink2: #CFC7B8;
  --muted: #8B8375;
  --faint: #5F584C;
  --line: #29251F;
  --line2: #211E18;
  --accent: #93ADD0;
  --accent-soft: #19232F;
  --on-accent: #0C0B09;
  --green: #57A781;
  --green-bg: #11201A;
  --amber: #CE9F51;
  --amber-bg: #211B0E;
  --rose: #CF7965;
  --rose-bar: #A66052;
  --rose-bg: #241411;
  --ok: #57A781;
  --bad: #CF7965;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 8px 24px -16px rgba(0, 0, 0, .9);
  --inset-top: inset 0 1px 0 rgba(255, 255, 255, .04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "MiSans VF", "MiSans", -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
svg { display: block; }
b { font-weight: 600; }

.num {
  font-family: var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -.01em;
}

#app {
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: var(--kb);
  overflow: hidden;
  transition: bottom .16s var(--ease);
}

/* ---------------- 屏幕 ---------------- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--bg-2) 0, var(--bg) 200px);
}
.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .screen::before { display: none; }
.screen.is-active {
  display: flex;
  z-index: 3;
  animation: screenIn .22s var(--ease-out);
}
.screen.is-cover { z-index: 6; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--sat) + 8px) var(--pad) 0;
}
.pad-bottom { height: calc(96px + var(--sab)); }

/* ---------------- 顶栏 ---------------- */
.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 20px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  margin-bottom: 7px;
}
.head h1 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.2;
}
.head p {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--ink2);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  flex-shrink: 0;
  transition: transform .15s var(--ease), background .15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }

/* ---------------- 总览卡 ---------------- */
.board {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 15px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
}
.board-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.board-k {
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
}
.board-total { font-size: 11.5px; color: var(--muted); }
.board-row { display: flex; align-items: flex-end; justify-content: space-between; }
.board-num {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 400;
  line-height: .92;
  letter-spacing: -.03em;
  color: var(--ink);
}
.board-num i { font-style: normal; font-size: 21px; color: var(--muted); margin-left: 4px; }
.board-right { text-align: right; padding-bottom: 4px; }
.board-right b {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.1;
}
.board-right span { font-size: 10.5px; color: var(--muted); }

.board-kv {
  display: flex;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line2);
}
.board-kv > div { flex: 1; }
.board-kv > div + div { padding-left: 14px; border-left: 1px solid var(--line2); }
.board-kv b {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.15;
}
.board-kv span { font-size: 10.5px; color: var(--muted); }

/* ---------------- 进度条 ---------------- */
.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line2);
  overflow: hidden;
  display: flex;
  gap: 2px;
}
.bar-lg { height: 8px; margin-top: 15px; }
.seg { display: block; height: 100%; border-radius: 3px; flex: 0 0 auto; }
.seg.g { background: var(--green); }
.seg.y { background: var(--amber); }
.seg.r { background: var(--rose-bar); }
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ink);
  transition: width .45s var(--ease-out);
}

/* ---------------- 快捷操作 ---------------- */
.quick { display: flex; gap: 8px; margin-top: 14px; }
.quick .btn-primary { flex: 2; }
.quick .btn-outline { flex: 1; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  height: 48px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform .15s var(--ease), opacity .15s, background .15s;
}
.btn:active { transform: scale(.985); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--ink); color: var(--bg-2); }
.btn-primary:disabled { opacity: .3; }
.btn-outline {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  font-weight: 500;
}
.btn-outline:active { background: var(--card-2); }
.btn-ghost { background: transparent; color: var(--ink2); font-weight: 500; }
.btn-soft { background: var(--card-2); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-sm {
  height: 34px;
  font-size: 12.5px;
  border-radius: var(--r-xs);
  padding: 0 13px;
  width: auto;
  font-weight: 500;
}

.hint-line {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  letter-spacing: .01em;
}
.hint-line b { color: var(--ink); font-family: var(--serif); font-size: 13.5px; font-weight: 400; }

/* ---------------- 分区标题 ---------------- */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 12px;
}
.sec-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.sec-head span { font-size: 11px; color: var(--faint); }

/* ---------------- 分类 ---------------- */
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  text-align: left;
  transition: transform .15s var(--ease), background .15s;
}
.cat:active { transform: scale(.988); background: var(--card-2); }
.cat-glyph {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.cat-glyph svg { width: 19px; height: 19px; }
.cat-body { flex: 1; min-width: 0; }
.cat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.cat-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-num { font-size: 11px; color: var(--faint); flex-shrink: 0; }
.cat-num b { font-family: var(--serif); font-size: 14px; font-weight: 400; color: var(--ink); }
.cat-bot {
  display: flex;
  gap: 11px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cat-bot em { font-style: normal; color: var(--muted); }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 2px; margin-right: 4px; vertical-align: 1px; }
.dot.g { background: var(--green); }
.dot.y { background: var(--amber); }
.dot.r { background: var(--rose); }

/* ---------------- 统计 ---------------- */
.kpi-row { display: flex; gap: 8px; }
.kpi {
  flex: 1;
  padding: 14px 13px 12px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
}
.kpi-num {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.kpi-num i {
  font-style: normal;
  font-size: 11px;
  color: var(--faint);
  margin-left: 3px;
  font-family: "MiSans", system-ui, sans-serif;
  letter-spacing: .01em;
}
.kpi-label { margin-top: 4px; font-size: 10.5px; color: var(--muted); }

.chart {
  padding: 16px 14px 10px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
}
.bars { display: flex; align-items: flex-end; gap: 4px; height: 84px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar-col i {
  display: block;
  width: 100%;
  border-radius: 2px;
  background: var(--line);
  min-height: 2px;
  transition: height .5s var(--ease-out), background .3s;
}
.bar-col.has i { background: var(--ink); opacity: .22; }
.bar-col.is-today i { background: var(--ink); opacity: .85; }
.bars-x {
  display: flex;
  gap: 4px;
  margin-top: 7px;
  font-size: 8.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.bars-x span { flex: 1; text-align: center; white-space: nowrap; }

.list {
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  overflow: hidden;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line2);
  text-align: left;
}
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-t { font-size: 14px; font-weight: 500; }
.row-d { margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.row-btn:active { background: var(--card-2); }
.row-val { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chev { width: 15px; height: 15px; color: var(--faint); flex-shrink: 0; }

.group { margin-bottom: 20px; }
.group-label {
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--faint);
  margin: 0 0 8px 3px;
  text-transform: uppercase;
  font-weight: 500;
}

.stepper {
  display: flex;
  align-items: center;
  background: var(--card-2);
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  overflow: hidden;
}
.stepper button { width: 30px; height: 28px; font-size: 15px; color: var(--ink2); display: grid; place-items: center; }
.stepper button:active { background: var(--line2); }
.stepper span { min-width: 32px; text-align: center; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.switch {
  width: 42px;
  height: 25px;
  border-radius: 999px;
  background: var(--line2);
  border: 1px solid var(--line);
  position: relative;
  transition: background .18s var(--ease), border-color .18s;
  flex-shrink: 0;
}
.switch i {
  position: absolute;
  top: 2px; left: 2px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .2s var(--ease-out), background .18s;
}
.switch.on { background: var(--ink); border-color: var(--ink); }
.switch.on i { transform: translateX(17px); background: var(--bg-2); }

.segmented {
  display: flex;
  background: var(--card-2);
  border-radius: var(--r-xs);
  padding: 2px;
  border: 1px solid var(--line);
  gap: 2px;
}
.segmented button {
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.segmented button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.foot-note {
  margin: 22px 2px 0;
  font-size: 10.5px;
  line-height: 1.9;
  color: var(--faint);
  text-align: center;
}

/* ---------------- TabBar ---------------- */
#tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: var(--kb);
  z-index: 5;
  display: flex;
  padding: 7px 10px calc(6px + var(--sab));
  background: var(--bg);
  border-top: 1px solid var(--line2);
  transition: transform .22s var(--ease), opacity .18s;
}
#tabbar.hide { transform: translateY(110%); opacity: 0; pointer-events: none; }
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0 2px;
  color: var(--faint);
  transition: color .15s;
}
.tab svg { width: 21px; height: 21px; }
.tab span { font-size: 9.5px; font-weight: 500; letter-spacing: .04em; }
.tab.is-active { color: var(--ink); }
.tab:active { transform: scale(.94); }

/* ============================================================
   答题
   ============================================================ */
.ses-top {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: calc(var(--sat) + 9px) var(--pad) 3px;
}
.ses-top .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
.ses-prog { flex: 1; }
.ses-prog .bar { height: 4px; background: var(--line2); }
.ses-count {
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: right;
  letter-spacing: .02em;
}
.ses-count b { color: var(--ink); font-family: var(--serif); font-size: 14px; font-weight: 400; }

.ses-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px var(--pad) 18px;
}

.q-card { animation: cardIn .26s var(--ease-out) both; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
.q-card.leaving { animation: cardOut .22s var(--ease) both; }
@keyframes cardOut { to { opacity: 0; transform: translateX(-18px); } }

.q-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.chip {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink2);
}
.chip.ok { background: var(--green-bg); color: var(--green); border-color: transparent; }
.chip.bad { background: var(--rose-bg); color: var(--rose); border-color: transparent; }
.q-idx { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

.q-stem {
  font-size: calc(18px * var(--fs));
  line-height: 1.78;
  font-weight: 500;
  letter-spacing: .004em;
  margin-bottom: 24px;
  word-break: break-word;
  white-space: pre-wrap;
}
.blank-input {
  display: inline-block;
  width: 64px;
  padding: 0 3px 1px;
  margin: 0 2px;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  font-weight: 600;
  font-size: inherit;
  line-height: inherit;
  text-align: center;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  transition: border-color .15s, background .15s;
}
.blank-input::placeholder { color: var(--faint); font-weight: 400; }
.blank-input:focus { border-bottom-color: var(--ink); background: var(--card-2); }
.blank-input.ok { color: var(--green); border-bottom-color: var(--green); background: var(--green-bg); border-radius: 4px 4px 0 0; }
.blank-input.bad { color: var(--rose); border-bottom-color: var(--rose); background: var(--rose-bg); border-radius: 4px 4px 0 0; }

.opts { display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 14px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  text-align: left;
  font-size: calc(14.5px * var(--fs));
  line-height: 1.62;
  color: var(--ink);
  transition: transform .12s var(--ease), border-color .15s, background .15s, opacity .15s;
}
.opt:active { transform: scale(.99); }
.opt-badge {
  width: 23px; height: 23px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 1px;
  transition: background .15s, color .15s, border-color .15s;
}
.opt-text { flex: 1; min-width: 0; word-break: break-word; white-space: pre-wrap; }
.opt-mark { width: 16px; height: 16px; flex-shrink: 0; margin-top: 4px; opacity: 0; }

.opt.sel { border-color: var(--ink); background: var(--card-2); }
.opt.sel .opt-badge { background: var(--ink); border-color: var(--ink); color: var(--bg-2); }
.opt.ok { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); background: var(--green-bg); }
.opt.ok .opt-badge { background: var(--green); border-color: var(--green); color: #fff; }
.opt.ok .opt-mark { opacity: 1; color: var(--green); }
.opt.bad { border-color: color-mix(in srgb, var(--rose) 40%, var(--line)); background: var(--rose-bg); }
.opt.bad .opt-badge { background: var(--rose); border-color: var(--rose); color: #fff; }
.opt.bad .opt-mark { opacity: 1; color: var(--rose); }
.opt.dim { opacity: .5; }
.opt.shake { animation: shake .32s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
}

.judge-row { display: flex; gap: 10px; }
.judge-btn {
  flex: 1;
  height: 76px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform .12s var(--ease), border-color .15s, background .15s;
}
.judge-btn svg { width: 21px; height: 21px; color: var(--muted); }
.judge-btn:active { transform: scale(.98); }
.judge-btn.sel { border-color: var(--ink); background: var(--card-2); }
.judge-btn.ok {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--card));
}
.judge-btn.ok svg { color: var(--green); }
.judge-btn.bad {
  border-color: color-mix(in srgb, var(--rose) 55%, var(--line));
  background: var(--card);
  color: var(--muted);
}
.judge-btn.bad svg { color: var(--rose); }
.judge-btn.dim { opacity: .45; }

.order-hint { font-size: 11px; color: var(--muted); margin: -12px 0 12px; }
.order-list { display: flex; flex-direction: column; gap: 9px; }
.order-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border-radius: var(--r-sm);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  text-align: left;
  font-size: calc(14.5px * var(--fs));
  line-height: 1.6;
  transition: transform .12s var(--ease), border-color .15s, background .15s;
  width: 100%;
}
.order-item:active { transform: scale(.99); }
.order-item.picked { border-color: var(--ink); background: var(--card-2); }
.order-item.picked .opt-badge { background: var(--ink); border-color: var(--ink); color: var(--bg-2); }
.order-item.ok { border-color: var(--green); background: var(--green-bg); }
.order-item.ok .opt-badge { background: var(--green); border-color: var(--green); color: #fff; }
.order-item.bad { border-color: var(--rose); background: var(--rose-bg); }
.order-item.bad .opt-badge { background: var(--rose); border-color: var(--rose); color: #fff; }

/* ---------------- 底部操作 ---------------- */
.ses-foot {
  padding: 11px var(--pad) calc(13px + var(--sab));
  background: var(--bg);
  border-top: 1px solid transparent;
  transition: border-color .15s;
}
.ses-foot.bordered { border-top-color: var(--line2); }
#screen-wrong .ses-foot { border-top-color: var(--line2); }
#wb-list { padding-bottom: 14px; }
.foot-row { display: flex; align-items: center; gap: 8px; }
.foot-hint { flex: 1; font-size: 11px; color: var(--muted); text-align: right; }
.slay-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow), var(--inset-top);
  flex-shrink: 0;
  transition: transform .12s var(--ease);
}
.slay-btn svg { width: 14px; height: 14px; }
.slay-btn:active { transform: scale(.96); }
.selectall-btn {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--card-2);
  flex-shrink: 0;
  transition: transform .12s var(--ease);
}
.selectall-btn:active { transform: scale(.96); }

.submit-btn {
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg-2);
  font-size: 13.5px;
  font-weight: 600;
  flex-shrink: 0;
  transition: transform .12s var(--ease), opacity .15s;
}
.submit-btn:active { transform: scale(.97); }
.submit-btn:disabled { background: var(--line2); color: var(--faint); }

.result { display: flex; align-items: center; gap: 10px; animation: resIn .22s var(--ease-out) both; }
@keyframes resIn { from { opacity: 0; transform: translateY(5px); } }
.result-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.result-icon svg { width: 14px; height: 14px; }
.result.ok .result-icon { background: var(--green); color: #fff; }
.result.bad .result-icon { background: var(--rose); color: #fff; }
.result-main { flex: 1; min-width: 0; }
.result-t { font-size: 13.5px; font-weight: 600; }
.result.ok .result-t { color: var(--green); }
.result.bad .result-t { color: var(--rose); }
.result-d { font-size: 11px; color: var(--muted); margin-top: 1px; line-height: 1.5; word-break: break-word; }
.result-d b { color: var(--ink2); font-weight: 600; }
.next-btn {
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg-2);
  font-size: 13.5px;
  font-weight: 600;
  flex-shrink: 0;
  transition: transform .12s var(--ease);
}
.next-btn:active { transform: scale(.97); }

/* ---------------- 已斩 / 错题 ---------------- */
.ms-item {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  margin-bottom: 8px;
}
.ms-stem {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ms-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.ms-cat { font-size: 10.5px; color: var(--faint); flex: 1; }
.ms-cat em { font-style: normal; color: var(--rose); }
.ms-restore {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink2);
  padding: 4px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--card-2);
}
.ms-restore:active { opacity: .7; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.empty-state svg { width: 32px; height: 32px; margin: 0 auto 12px; opacity: .3; }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--sat) + 10px) var(--pad) 10px;
}
.sheet-head h2 { font-size: 16px; font-weight: 600; flex: 1; letter-spacing: -.015em; }
.sheet-count { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------------- 结算 ---------------- */
.done-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--sat) + 20px) 22px calc(26px + var(--sab));
}
.done-score { display: flex; align-items: baseline; gap: 6px; }
.done-score span {
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1;
}
.done-score i { font-style: normal; font-size: 14px; color: var(--muted); }
.done-title { margin-top: 16px; font-size: 20px; font-weight: 600; letter-spacing: -.025em; }
.done-sub { margin-top: 7px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.done-stats { display: flex; gap: 28px; margin-top: 24px; }
.done-stats div b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 400; line-height: 1.2; }
.done-stats div span { font-size: 10px; color: var(--faint); }
.done-actions { margin-top: 34px; display: flex; flex-direction: column; gap: 8px; }

/* ---------------- 模考 ---------------- */
.exam-score-hero { display: flex; align-items: baseline; gap: 8px; padding: 18px 0 4px; }
.exam-score-hero span {
  font-family: var(--serif);
  font-size: 62px;
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1;
}
.exam-score-hero i { font-style: normal; font-size: 13px; color: var(--muted); }
.exam-grid { display: flex; flex-direction: column; gap: 18px; }
.field-k { font-size: 10px; color: var(--faint); letter-spacing: .14em; margin-bottom: 9px; text-transform: uppercase; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 12px;
  color: var(--ink2);
  transition: background .15s, border-color .15s, color .15s;
}
.chip-btn.on { border-color: var(--ink); background: var(--ink); color: var(--bg-2); font-weight: 500; }
.chip-btn:active { transform: scale(.97); }
.exam-nav { display: flex; gap: 8px; }
.exam-nav .btn { flex: 1; }

.wrong-item {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow), var(--inset-top);
  margin-bottom: 8px;
}
.wrong-q { font-size: 12.5px; line-height: 1.62; color: var(--ink); }
.wrong-a { margin-top: 9px; font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.wa-k { display: block; font-size: 9px; color: var(--faint); letter-spacing: .1em; margin-bottom: 1px; }
.wrong-a b { color: var(--green); font-weight: 500; }
.wrong-mine { margin-top: 7px; font-size: 11.5px; line-height: 1.55; color: var(--rose); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--kb));
  transform: translate(-50%, 10px);
  padding: 9px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg-2);
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .22s var(--ease-out);
  z-index: 40;
  white-space: nowrap;
  max-width: 88vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 弹层 ---------------- */
.mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(12, 11, 9, .48);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity .2s;
}
.mask.show { opacity: 1; }
.sheet {
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-2);
  border-radius: 20px 20px 0 0;
  padding: 20px var(--pad) calc(18px + var(--sab));
  transform: translateY(100%);
  transition: transform .28s var(--ease-out);
  border-top: 1px solid var(--line);
}
.mask.show .sheet { transform: none; }
.sheet h3 { font-size: 17px; font-weight: 600; margin-bottom: 5px; letter-spacing: -.02em; }
.sheet .sub { font-size: 11.5px; color: var(--muted); margin-bottom: 18px; line-height: 1.65; }
.sheet-actions { display: flex; gap: 8px; margin-top: 20px; }
.sheet-actions .btn { height: 46px; font-size: 14.5px; }
.sheet-grip { width: 32px; height: 4px; border-radius: 999px; background: var(--line); margin: -8px auto 14px; }

/* ============================================================
   速记与解析
   ============================================================ */
.note-panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-2);
  overflow: hidden;
  animation: resIn .3s var(--ease-out) both;
}
.note-sec { padding: 12px 14px 13px; }
.note-sec + .note-sec { border-top: 1px solid var(--line2); }
.note-k {
  font-size: 9.5px;
  letter-spacing: .18em;
  font-weight: 600;
  color: var(--faint);
  margin-bottom: 5px;
}
.note-sec.tip .note-k { color: var(--amber); }
.note-t {
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink2);
  white-space: pre-wrap;
}
.note-sec.tip .note-t { color: var(--ink); font-weight: 500; }
.note-link {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 11px 14px;
  border-top: 1px solid var(--line2);
  font-size: 11.5px;
  color: var(--accent);
  text-align: left;
}
.note-link svg { width: 13px; height: 13px; margin-left: auto; flex-shrink: 0; }
.note-link:active { background: var(--card); }

/* 速记手册 */
.card-item {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  margin-bottom: 8px;
  text-align: left;
}
.card-item:active { background: var(--card-2); }
.card-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.card-item h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.card-tag {
  font-size: 9.5px;
  padding: 2.5px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
  font-weight: 500;
}
.card-preview {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { margin-top: 9px; font-size: 10.5px; color: var(--faint); }

.card-body {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink2);
  white-space: pre-wrap;
}
.rel-list { display: flex; flex-direction: column; gap: 8px; }
.rel {
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
}
.rel-q { font-size: 12px; line-height: 1.6; color: var(--ink); }
.rel-a { margin-top: 5px; font-size: 11.5px; line-height: 1.55; color: var(--green); }
.rel-no { font-size: 9.5px; color: var(--faint); margin-right: 5px; }

/* ============================================================
   单手布局 + 评分按钮
   ============================================================ */
.ses-body { display: flex; flex-direction: column; }
.q-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  justify-content: center;
  padding-top: 13vh;
}
.q-meta, .q-stem { flex: 0 0 auto; }
.opts, .judge-row, .order-hint, .order-list { flex: 0 0 auto; }
.q-card.t-blank .q-stem { margin-bottom: 0; }

.order-hint { margin: 0 0 12px; flex: 0 0 auto; }

.reveal-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  background: transparent;
  flex-shrink: 0;
  transition: transform .12s var(--ease);
}
.reveal-btn svg { width: 14px; height: 14px; }
.reveal-btn:active { transform: scale(.96); background: var(--card-2); }

.grade-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 10px;
  animation: resIn .24s var(--ease-out) both;
}
.grade-btn {
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink2);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  flex-shrink: 0;
  transition: transform .12s var(--ease), background .15s;
}
.grade-btn:active { transform: scale(.96); background: var(--card-2); }
#g-slay { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.grade-hint { font-size: 10.5px; color: var(--faint); margin-left: auto; }

.result-note {
  font-size: 10.5px;
  color: var(--accent);
  margin-top: 3px;
  letter-spacing: .01em;
}
.result.mid .result-icon { background: var(--muted); color: #fff; }
.result.mid .result-t { color: var(--fg2); }

.date-input {
  border: 0;
  background: transparent;
  font-size: 12.5px;
  color: var(--ink2);
  text-align: right;
  font-family: inherit;
  max-width: 140px;
}
.date-input::-webkit-calendar-picker-indicator { opacity: .45; }

/* ============================================================
   星级 + 撤回
   ============================================================ */
.stars { display: flex; gap: 1px; margin-left: auto; flex-shrink: 0; }
.star {
  width: 26px; height: 26px;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--faint) 60%, transparent);
  transition: color .15s, transform .12s var(--ease);
  padding: 0;
}
.star.on { color: var(--amber); }
.star:active { transform: scale(.82); }
.stars.sm { margin-left: 0; gap: 0; }
.stars.sm .star { width: 13px; height: 13px; font-size: 10px; pointer-events: none; }

.toast { white-space: normal; text-align: left; }
.toast-msg { flex: 1; min-width: 0; }
.toast-action {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bg-2);
  background: color-mix(in srgb, var(--bg-2) 15%, transparent);
}
.toast-action:active { background: color-mix(in srgb, var(--bg-2) 28%, transparent); }

.ms-stars { display: flex; gap: 0; margin-right: 2px; }
#screen-starred .ses-foot { border-top-color: var(--line2); }
.q-meta { flex-wrap: wrap; }

/* ============================================================
   答题卡 / 速览
   ============================================================ */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
}
.sc-cell {
  height: 42px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink2);
  display: grid;
  place-items: center;
  transition: transform .12s var(--ease), background .15s;
}
.sc-cell:active { transform: scale(.94); }
.sc-cell.ok { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 38%, var(--line)); color: var(--green); }
.sc-cell.hard { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 38%, var(--line)); color: var(--amber); }
.sc-cell.bad { background: var(--rose-bg); border-color: color-mix(in srgb, var(--rose) 38%, var(--line)); color: var(--rose); }
.sc-cell.reveal { background: var(--rose-bg); border-style: dashed; border-color: color-mix(in srgb, var(--rose) 38%, var(--line)); color: var(--rose); }
.sc-cell.slain { background: var(--card-2); color: var(--faint); text-decoration: line-through; }
.sc-cell.done { background: var(--card-2); border-color: var(--border-strong, var(--line)); color: var(--muted); }
.sc-cell.cur { border-color: var(--ink); border-width: 1.5px; font-weight: 700; color: var(--ink); }

.sc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  font-size: 10.5px;
  color: var(--muted);
}
.sc-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 3px;
  margin-right: 4px;
  border: 1px solid var(--line);
  vertical-align: 0.5px;
}
.sc-dot.ok { background: var(--green); border-color: transparent; }
.sc-dot.hard { background: var(--amber); border-color: transparent; }
.sc-dot.bad { background: var(--rose); border-color: transparent; }
.sc-dot.slain { background: var(--faint); border-color: transparent; }

/* 速览 */
#screen-skim .q-card { justify-content: flex-start; padding-top: 0; }
.opt.static, .order-item.static { pointer-events: none; }
.opt.static.dim { opacity: .52; }
.blank-filled {
  color: var(--green);
  font-weight: 600;
  border-bottom: 1.5px solid var(--green);
  padding: 0 4px;
  margin: 0 2px;
}
#screen-skim .note-panel { margin-bottom: 8px; }

/* ============================================================
   搜索 / 筛选
   ============================================================ */
.search-input {
  flex: 1;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.search-input::placeholder { color: var(--faint); font-size: 13px; }
.search-input:focus { border-color: var(--ink); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.se-item {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), var(--inset-top);
  margin-bottom: 8px;
  text-align: left;
}
.se-item:active { background: var(--card-2); }
.se-stem {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.se-stem mark {
  background: color-mix(in srgb, var(--amber) 28%, transparent);
  color: var(--ink);
  padding: 0 1px;
  border-radius: 2px;
}
.se-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--faint);
}
.se-ans {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--green);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.se-empty { padding: 56px 20px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.9; }

/* 错题本筛选：单行横向滚动 */
#wb-filter {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--pad)) 12px;
  padding: 0 var(--pad) 2px;
}
#wb-filter::-webkit-scrollbar { display: none; }
#wb-filter .chip-btn { flex: 0 0 auto; }

/* ============================================================
   桌面端（网页版）：居中手机框
   ============================================================ */
@media (min-width: 600px) {
  body { background: #E7E1D3; }
  html[data-theme="dark"] body { background: #08080A; }
  #app {
    left: 50%;
    right: auto;
    top: 22px;
    bottom: 22px;
    width: 440px;
    transform: translateX(-50%);
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 40px 100px -50px rgba(26, 22, 17, .55), 0 2px 8px rgba(26, 22, 17, .08);
  }
  #tabbar {
    left: 50%;
    right: auto;
    bottom: 22px;
    width: 440px;
    transform: translateX(-50%);
    border-radius: 0 0 22px 22px;
  }
  #tabbar.hide { transform: translateX(-50%) translateY(110%); opacity: 0; }
  .mask { justify-content: center; }
  .mask .sheet { max-width: 440px; margin: 0 auto; }
  .toast { max-width: 400px; }
}

.head-actions { display: flex; gap: 8px; flex-shrink: 0; }
