/* ===== 顶栏 ===== */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  padding-top: max(10px, var(--safe-t));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.is-stuck { border-bottom-color: var(--line); }

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--ink-soft);
  background: transparent;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
}
.icon-btn:active { background: var(--surface-3); }
.icon-btn.is-on { color: var(--warm); background: var(--warm-soft); }
.icon-btn svg { width: 21px; height: 21px; }

.topbar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-meta {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.topbar-meta .cur { font-size: 1.05rem; font-weight: 700; }
.topbar-meta .tot { font-size: 0.82rem; color: var(--muted); }

.countdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.countdown.is-warn { color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.countdown svg { width: 14px; height: 14px; }

/* 细进度条 */
.progressline {
  flex: none;
  height: 3px;
  background: var(--line);
  overflow: hidden;
}
.progressline > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--warm)));
  transition: width 0.3s ease;
}

/* ===== 首页 ===== */
.home-hero {
  position: relative;
  padding: 18px 20px 22px;
  animation: fade-up 0.4s both;
}
.hero-gear {
  position: absolute;
  top: 6px;
  right: 10px;
}
.home-eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 700;
  margin-bottom: 10px;
}
.home-title {
  font-size: 2.1rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.home-title em {
  font-style: normal;
  font-family: var(--mono);
  color: var(--accent-ink);
}
.home-desc {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 22em;
}

.ring-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 6px 16px 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  animation: fade-up 0.4s 0.04s both;
}
.ring {
  --p: 0;
  width: 86px;
  height: 86px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0);
  position: relative;
}
.ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: var(--surface);
}
.ring-txt {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.1;
}
.ring-txt b { font-size: 1.35rem; font-family: var(--mono); }
.ring-txt span { display: block; font-size: 0.62rem; color: var(--muted); letter-spacing: 0.04em; }

.ring-meta { flex: 1; min-width: 0; }
.ring-meta .row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 3px 0; }
.ring-meta .row span:first-child { color: var(--muted); }
.ring-meta .row span:last-child { font-family: var(--mono); font-weight: 600; }

.mode-list { padding: 0 16px 8px; display: grid; gap: 12px; }

.mode-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  animation: fade-up 0.42s both;
  touch-action: manipulation;
}
.mode-card:nth-child(1) { animation-delay: 0.06s; }
.mode-card:nth-child(2) { animation-delay: 0.11s; }
.mode-card:nth-child(3) { animation-delay: 0.16s; }
.mode-card:active { transform: scale(0.985); box-shadow: var(--shadow-md); }
.mode-card::before {
  content: "";
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.mode-card.warm::before { background: var(--warm); }
.mode-card.ink::before { background: var(--ink); }

.mode-icon {
  width: 44px; height: 44px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.mode-card.warm .mode-icon { background: var(--warm-soft); color: var(--warm); }
.mode-card.ink .mode-icon { background: var(--surface-3); color: var(--ink); }
.mode-icon svg { width: 22px; height: 22px; }

.mode-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mode-name { display: block; font-size: 1.02rem; font-weight: 700; letter-spacing: 0.01em; }
.mode-desc { display: block; font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; }
.mode-arrow { color: var(--muted); flex: none; }
.mode-arrow svg { width: 18px; height: 18px; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 16px 0;
}
.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--fs-xs);
  transition: background 0.15s;
  touch-action: manipulation;
}
.quick-item:active { background: var(--surface-3); }
.quick-item svg { width: 19px; height: 19px; color: var(--ink); }
.quick-item b { font-family: var(--mono); font-size: 0.95rem; color: var(--ink); font-weight: 700; }
.quick-item .qi-label { font-size: 11px; color: var(--muted); }

.resume-card {
  margin: 14px 16px 0;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fade-up 0.35s both;
}
.resume-card .rc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.resume-card .rc-title { display: block; font-weight: 700; font-size: 0.95rem; }
.resume-card .rc-sub { display: block; font-size: var(--fs-xs); color: var(--ink-soft); }

.home-foot {
  padding: 22px 20px calc(30px + var(--safe-b));
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.8;
}

/* ===== 通用列表 ===== */
.section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 20px 10px;
}
.section-h h2 { font-size: 0.98rem; font-weight: 700; }
.section-h .link { font-size: var(--fs-sm); color: var(--accent-ink); }

.list { padding: 0 16px; display: grid; gap: 10px; }

.row-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: left;
  width: 100%;
  transition: background 0.15s;
  touch-action: manipulation;
}
.row-card:active { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 0.94rem; font-weight: 600; }
.row-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; }
.row-tail { flex: none; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }

/* ===== 题目卡 ===== */
.qwrap { padding: 14px 16px 8px; animation: fade-up 0.24s both; }

.q-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-3);
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip.single { background: var(--accent-soft); color: var(--accent-ink); }
.chip.multi { background: var(--warm-soft); color: var(--warm); }
.chip.num { font-family: var(--mono); background: transparent; color: var(--muted); padding-left: 0; }
.chip.wrong { background: var(--danger-soft); color: var(--danger); }
.chip.dead { background: var(--surface-3); color: var(--muted); text-decoration: line-through; }
.q-head .spacer { flex: 1; }
.q-head .icon-btn { width: 34px; height: 34px; border-radius: 10px; }

.q-stem {
  font-size: var(--fs-stem);
  line-height: 1.78;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0.005em;
  font-weight: 500;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.q-stem.is-empty { color: var(--muted); font-style: italic; font-weight: 400; }

.q-imgs { display: grid; gap: 10px; margin-top: 12px; }
.q-img {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0;
  display: block;
  width: 100%;
}
.q-img img {
  width: 100%;
  height: auto;
  display: block;
}
.q-img::after {
  content: "点击查看大图";
  position: absolute;
  right: 8px; bottom: 8px;
  font-size: 10px;
  color: #fff;
  background: rgba(22, 39, 60, 0.55);
  padding: 2px 7px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* 选项 */
.opts { display: grid; gap: 10px; margin-top: 18px; }

.opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 15px;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  touch-action: manipulation;
  min-height: 56px;
}
.opt:active:not(.is-locked) { transform: scale(0.99); }
.opt.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.opt.is-correct {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.opt.is-wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.opt.is-missing {
  border-color: var(--warm);
  border-style: dashed;
  background: var(--warm-soft);
}
.opt.is-dim { opacity: 0.62; }
.opt.is-locked { cursor: default; }

.opt-key {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--mono);
  background: var(--surface-3);
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
  margin-top: 1px;
}
.opt.is-selected .opt-key { background: var(--accent); color: #fff; }
.opt.is-correct .opt-key { background: var(--ok); color: #fff; }
.opt.is-wrong .opt-key { background: var(--danger); color: #fff; }
.opt.is-missing .opt-key { background: var(--warm); color: #fff; }

.opt-text {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.opt-mark {
  flex: none;
  align-self: center;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.opt-mark.ok { color: var(--ok); background: var(--ok-soft); }
.opt-mark.no { color: var(--danger); background: var(--danger-soft); }
.opt-mark.miss { color: var(--warm); background: var(--warm-soft); }

/* ===== 解析反馈 ===== */
.feedback {
  margin: 16px 16px 8px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  animation: fade-up 0.26s both;
}
.feedback.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.feedback.no { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

.fb-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 15px;
  font-weight: 700;
  font-size: 0.95rem;
}
.feedback.ok .fb-head { color: var(--ok); background: var(--ok-soft); }
.feedback.no .fb-head { color: var(--danger); background: var(--danger-soft); }
.fb-head svg { width: 18px; height: 18px; flex: none; }
.fb-head .fb-ans {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--surface);
  padding: 2px 9px;
  border-radius: 999px;
}

.fb-body { padding: 14px 15px 16px; }
.fb-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}
.fb-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
}
.fb-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fb-more {
  margin-top: 8px;
  font-size: var(--fs-sm);
  color: var(--accent-ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.fb-more svg { width: 14px; height: 14px; }
.fb-empty { font-size: 0.88rem; color: var(--muted); }

/* ===== 底部操作 ===== */
.actions { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 50px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-size: 0.97rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.12s, opacity 0.15s, background 0.15s;
  touch-action: manipulation;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: scale(0.976); }
.btn:disabled { opacity: 0.4; }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--ink); color: var(--surface); flex: 1; }
html[data-theme="dark"] .btn-primary { background: var(--accent); color: #07201d; }
.btn-accent { background: var(--accent); color: #fff; flex: 1; }
.btn-ghost { background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.btn-quiet { background: transparent; color: var(--ink-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 42px; padding: 0 14px; font-size: 0.9rem; border-radius: 12px; }
.btn-block { width: 100%; }

.dock-index {
  flex: none;
  width: 50px; height: 50px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.1;
  touch-action: manipulation;
}
.dock-index b { font-family: var(--mono); font-size: 0.95rem; color: var(--ink); }
.dock-index svg { width: 18px; height: 18px; }
.dock-index:active { background: var(--surface-3); }

/* ===== 弹层 / 抽屉 ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 18, 28, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade-in 0.18s both;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 640px;
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.26s cubic-bezier(0.22, 0.8, 0.3, 1) both;
  padding-bottom: var(--safe-b);
}
.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 10px;
}
.sheet-head h3 { font-size: 1rem; font-weight: 700; flex: 1; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 18px; }
.sheet-foot { flex: none; padding: 10px 18px 14px; border-top: 1px solid var(--line); }
.sheet-handle {
  width: 38px; height: 4px;
  border-radius: 99px;
  background: var(--line-strong);
  margin: 8px auto 0;
}

.dialog {
  width: calc(100% - 48px);
  max-width: 340px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s both;
  align-self: center;
}
.overlay.is-center { align-items: center; }
.dialog h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 8px; }
.dialog p { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.7; }
.dialog-actions { display: flex; gap: 10px; margin-top: 18px; }
.dialog-actions .btn { flex: 1; height: 44px; font-size: 0.92rem; }

/* 答题卡 */
.sheet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 12px;
  font-size: 11.5px;
  color: var(--muted);
}
.sheet-legend i {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -1px;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  padding-bottom: 8px;
}
.ag-cell {
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  position: relative;
  touch-action: manipulation;
}
.ag-cell.is-answered { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-ink); }
.ag-cell.is-current { outline: 2px solid var(--ink); outline-offset: 1px; }
.ag-cell.is-correct { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.ag-cell.is-wrong { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.ag-cell.is-flag::after {
  content: "";
  position: absolute;
  top: 3px; right: 3px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--warm);
}

/* ===== 结果页 ===== */
.result-hero {
  padding: 24px 20px 8px;
  text-align: center;
  animation: fade-up 0.35s both;
}
.score-ring {
  --p: 0;
  width: 148px; height: 148px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-3) 0);
  position: relative;
}
.score-ring.fail { background: conic-gradient(var(--danger) calc(var(--p) * 1%), var(--surface-3) 0); }
.score-ring::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.score-val { position: relative; z-index: 1; text-align: center; line-height: 1; }
.score-val b { font-size: 2.7rem; font-family: var(--mono); letter-spacing: -0.03em; }
.score-val span { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 6px; letter-spacing: 0.1em; }

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.verdict.pass { background: var(--ok-soft); color: var(--ok); }
.verdict.fail { background: var(--danger-soft); color: var(--danger); }
.verdict.done { background: var(--surface-3); color: var(--ink-soft); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 18px 16px 6px;
}
.stat-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 8px;
  text-align: center;
}
.stat-cell b { display: block; font-family: var(--mono); font-size: 1.28rem; font-weight: 700; }
.stat-cell span { font-size: 11.5px; color: var(--muted); }
.stat-cell.ok b { color: var(--ok); }
.stat-cell.no b { color: var(--danger); }
.stat-cell.mute b { color: var(--muted); }

.breakdown { padding: 6px 16px 0; display: grid; gap: 8px; }
.bd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 0.86rem;
}
.bd-row .bd-name { width: 62px; flex: none; color: var(--ink-soft); }
.bd-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bd-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bd-row .bd-val { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); min-width: 62px; text-align: right; }

/* ===== 统计 ===== */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 96px;
  padding: 16px 20px 8px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-col i {
  width: 100%;
  max-width: 30px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, transparent));
  min-height: 3px;
  transition: height 0.4s ease;
}
.bar-col i.is-zero { background: var(--line-strong); opacity: 0.55; }
.bar-col b { font-size: 10px; font-family: var(--mono); color: var(--muted); font-weight: 500; }
.bar-col span { font-size: 10px; color: var(--muted); }

.sec-list { padding: 6px 16px 0; display: grid; gap: 8px; }
.sec-row {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.sec-top { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 7px; }
.sec-top .n { color: var(--ink-soft); }
.sec-top .v { font-family: var(--mono); color: var(--muted); font-size: 0.8rem; }
.sec-bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.sec-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ===== 设置 ===== */
.set-group { padding: 8px 16px 0; }
.set-group h3 {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
  padding: 14px 4px 8px;
}
.set-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 8px;
}
.set-item .si-main { flex: 1; min-width: 0; }
.set-item .si-title { font-size: 0.93rem; font-weight: 600; }
.set-item .si-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-3);
  gap: 2px;
}
.seg button {
  padding: 5px 11px;
  border-radius: 8px;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.switch {
  width: 46px; height: 27px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.switch.is-on { background: var(--accent); border-color: var(--accent); }
.switch.is-on::after { transform: translateX(19px); }

/* ===== 空状态 ===== */
.empty {
  padding: 48px 32px;
  text-align: center;
  color: var(--muted);
}
.empty svg { width: 44px; height: 44px; margin: 0 auto 14px; opacity: 0.45; }
.empty p { font-size: 0.9rem; line-height: 1.7; }

/* ===== Toast ===== */
.toast-host {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(92px + var(--safe-b));
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 80vw;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(20, 30, 42, 0.9);
  color: #fff;
  font-size: 0.84rem;
  box-shadow: var(--shadow-md);
  animation: fade-up 0.2s both;
  backdrop-filter: blur(6px);
}
html[data-theme="dark"] .toast { background: rgba(240, 245, 250, 0.92); color: #101820; }

/* ===== 图片查看器 ===== */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 14, 20, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade-in 0.16s both;
  overflow: auto;
}
.viewer img { max-width: 100%; height: auto; border-radius: 8px; }
.viewer .v-close {
  position: fixed;
  top: max(14px, var(--safe-t));
  right: 14px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: grid; place-items: center;
}
.viewer .v-close svg { width: 20px; height: 20px; }

/* ===== 结果页动作区 ===== */
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px 16px calc(24px + var(--safe-b));
}
.result-actions .btn-full { grid-column: 1 / -1; }

/* ===== 复习/错题列表 ===== */
.review-nav { display: flex; gap: 10px; align-items: center; }
.review-note {
  margin: 12px 16px 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  line-height: 1.7;
}

.chip-row { display: flex; gap: 8px; padding: 10px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  touch-action: manipulation;
}
.filter-chip.is-on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
html[data-theme="dark"] .filter-chip.is-on { background: var(--accent); color: #07201d; border-color: var(--accent); }

/* ===== 首页同步状态 ===== */
.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 6px 13px 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
}
.sync-chip::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.sync-chip.is-on {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.sync-chip.is-on::before { background: var(--accent); }
html[data-theme="dark"] .sync-chip.is-on { border-color: var(--accent); }

/* ===== 登录页 ===== */
.auth-hero { padding: 22px 20px 2px; }
.auth-badge {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: 14px;
}
.auth-badge svg { width: 24px; height: 24px; }
.auth-hero h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.auth-hero p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.68;
}

.auth-form { padding: 20px 20px 0; }
.auth-field { display: block; }
.auth-field + .auth-field { margin-top: 16px; }
.af-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 7px;
}
.auth-input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.auth-input::placeholder { color: var(--muted); }
.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-code-row { display: flex; gap: 10px; align-items: center; }
.auth-code-row .auth-input { flex: 1; min-width: 0; }
.auth-send { flex: none; height: 50px; min-width: 110px; }
.auth-err {
  margin-top: 8px;
  color: var(--danger);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.auth-err[hidden] { display: none; }
.auth-submit { margin-top: 22px; height: 52px; border-radius: var(--r-md); }
.auth-note {
  padding: 16px 20px calc(28px + var(--safe-b));
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.85;
}

/* 设置项里的按钮不要被 flex:1 拉满 */
.set-item .btn { flex: none; }
