:root {
  --ink: #18231d;
  --ink-soft: #344139;
  --muted: #748078;
  --paper: #f4f1e9;
  --paper-deep: #ebe7dd;
  --card: #fffdf8;
  --card-2: #faf8f2;
  --green-900: #123729;
  --green-800: #194b37;
  --green-700: #24644a;
  --green-600: #2f7a5a;
  --green-100: #e3f0e7;
  --green-050: #f0f7f2;
  --gold: #d7a65a;
  --orange: #c66c36;
  --red: #b64d4d;
  --red-soft: #f8e8e5;
  --line: #e3dfd4;
  --line-strong: #d4cec0;
  --shadow-sm: 0 6px 20px rgba(34, 48, 40, .06);
  --shadow-md: 0 18px 48px rgba(34, 48, 40, .10);
  --shadow-lg: 0 28px 80px rgba(27, 47, 37, .14);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --sidebar-width: 296px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 5%, rgba(203, 226, 197, .40), transparent 30rem),
    radial-gradient(circle at 8% 90%, rgba(220, 198, 157, .22), transparent 32rem),
    var(--paper);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(47, 122, 90, .28);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(6px);
}
.ambient-a { width: 380px; height: 380px; right: -150px; top: 24%; background: rgba(154, 198, 163, .17); }
.ambient-b { width: 320px; height: 320px; left: 180px; bottom: -160px; background: rgba(214, 176, 111, .12); }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px 22px;
  overflow-y: auto;
  color: rgba(255, 255, 255, .86);
  background:
    radial-gradient(circle at 30% 0%, rgba(111, 170, 133, .28), transparent 24rem),
    linear-gradient(165deg, #173d2e 0%, #112f24 58%, #0d281e 100%);
  box-shadow: 14px 0 45px rgba(27, 49, 39, .12);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  background-image:
    linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 55%);
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 28px;
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #d8e9ce, #94c19d);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 10px 24px rgba(0,0,0,.16);
}
.brand-mark svg {
  width: 34px;
  height: 34px;
  overflow: visible;
  fill: none;
  stroke: #183d2e;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-kicker {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  letter-spacing: .18em;
  color: rgba(255,255,255,.50);
}
.brand-title {
  margin-top: -1px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: .03em;
  color: #fffdf6;
}

.primary-nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
  margin-bottom: 26px;
}
.nav-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.72);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: .2s ease;
}
.nav-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-btn.is-active {
  color: #15392a;
  background: linear-gradient(135deg, #f8f3e4, #dfeede);
  box-shadow: 0 9px 22px rgba(0,0,0,.14);
  font-weight: 700;
}
.nav-icon { width: 18px; text-align: center; font-size: 18px; line-height: 1; }
.nav-count {
  margin-left: auto;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
  background: rgba(255,255,255,.12);
}
.nav-btn.is-active .nav-count { color: #fff; background: var(--green-700); }

.sidebar-section {
  position: relative;
  z-index: 1;
  padding: 18px 0;
  border-top: 1px solid rgba(255,255,255,.09);
}
.section-label, .field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .10em;
  color: rgba(255,255,255,.48);
}
.section-label { margin-bottom: 12px; text-transform: uppercase; }
.section-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.section-label-row .section-label { margin: 0; }
.field-label { margin: 11px 0 6px; letter-spacing: .04em; }
.text-btn {
  border: 0;
  padding: 0;
  color: #b9ddc3;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}
.text-btn:hover { color: #fff; }

.select-wrap { position: relative; }
.select-wrap::after {
  content: "⌄";
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-54%);
  pointer-events: none;
  color: rgba(255,255,255,.58);
}
.select-control {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  padding: 10px 35px 10px 12px;
  appearance: none;
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.07);
  cursor: pointer;
  transition: .2s ease;
}
.select-control:hover { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.09); }
.select-control option { color: #1a271f; background: #fffdf8; }

.search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  padding: 0 11px;
  background: rgba(255,255,255,.07);
}
.search-wrap span { color: rgba(255,255,255,.45); font-size: 20px; }
.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 9px 0 10px;
  color: rgba(255,255,255,.9);
  background: transparent;
}
.search-wrap input::placeholder { color: rgba(255,255,255,.35); }

.chapter-progress-list { display: grid; gap: 4px; }
.chapter-row {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 8px 9px;
  color: rgba(255,255,255,.72);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: .18s ease;
}
.chapter-row:hover, .chapter-row.is-active { color: #fff; background: rgba(255,255,255,.075); }
.chapter-row-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.chapter-row-top span:last-child { color: rgba(255,255,255,.42); font-variant-numeric: tabular-nums; }
.chapter-mini-track { height: 3px; margin-top: 7px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.10); }
.chapter-mini-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9bc9a6, #dce9c8); transition: width .35s ease; }

.sidebar-footer {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.09);
  font-size: 11px;
  color: rgba(255,255,255,.44);
}
.global-summary { color: rgba(255,255,255,.70); line-height: 1.7; }
.source-note { margin-top: 5px; }

.main-shell { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px clamp(24px, 4vw, 56px);
  border-bottom: 1px solid rgba(212, 206, 192, .68);
  background: rgba(244, 241, 233, .80);
  backdrop-filter: blur(18px);
}
.topbar-title { min-width: 0; }
.eyebrow {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--green-600);
}
.topbar h1 {
  margin: 1px 0 0;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  letter-spacing: .02em;
  line-height: 1.3;
}
.topbar-actions { margin-left: auto; }
.icon-btn, .ghost-btn, .round-btn, .mode-btn, .primary-btn, .danger-ghost-btn {
  border: 1px solid transparent;
  cursor: pointer;
  transition: .2s ease;
}
.icon-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fffdf8;
  border-color: var(--line);
}
.ghost-btn {
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}
.ghost-btn:hover { color: var(--red); background: rgba(182,77,77,.07); }

.main-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 32px clamp(24px, 4vw, 56px) 90px;
}
.view { animation: view-in .35s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}
.stat-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 18px;
  border: 1px solid rgba(220, 214, 201, .86);
  border-radius: var(--radius-md);
  background: rgba(255,253,248,.82);
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--green-700);
  background: var(--green-050);
  font-size: 12px;
  font-weight: 800;
}
.stat-done .stat-icon { color: #3c6f47; background: #eaf4e7; }
.stat-left .stat-icon { color: #9a6a2c; background: #f8eedc; }
.stat-rate .stat-icon { color: #8a4b45; background: #f7e9e5; }
.stat-label { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.stat-value {
  margin-top: -1px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.progress-panel {
  padding: 18px 20px 15px;
  border: 1px solid rgba(220, 214, 201, .86);
  border-radius: var(--radius-md);
  background: rgba(255,253,248,.72);
}
.progress-copy, .progress-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.progress-heading { font-weight: 700; font-size: 13px; }
.progress-subtitle { color: var(--muted); font-size: 11px; margin-top: 1px; }
.pool-fraction { font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-variant-numeric: tabular-nums; }
.progress-track { height: 8px; margin: 13px 0 11px; overflow: hidden; border-radius: 999px; background: #e8e4da; }
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-600), #83b58e);
  box-shadow: 0 0 15px rgba(47,122,90,.18);
  transition: width .45s cubic-bezier(.2,.85,.25,1);
}
.progress-footer { color: var(--muted); font-size: 11px; }
.mode-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: #ece9e0;
}
.mode-btn {
  min-width: 46px;
  border: 0;
  border-radius: 7px;
  padding: 4px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
}
.mode-btn.is-active { color: var(--ink); background: #fffdf8; box-shadow: 0 2px 8px rgba(30,42,35,.09); }

.question-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 11px;
}
.scope-badge {
  min-height: 24px;
  color: var(--green-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}
.scope-badge:empty { display: none; }
.question-position { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.round-btn {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: rgba(255,253,248,.72);
  border-color: var(--line);
}
.round-btn:hover:not(:disabled) { transform: translateY(-1px); background: #fff; box-shadow: var(--shadow-sm); }
.round-btn:disabled { opacity: .32; cursor: not-allowed; }

.question-mount { min-height: 440px; }
.question-card {
  position: relative;
  padding: clamp(23px, 3.4vw, 38px);
  border: 1px solid rgba(218, 212, 199, .92);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255,255,255,.58), transparent 38%),
    var(--card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: card-in .32s ease both;
}
.question-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--green-700), #83b58e 48%, #d3bc88);
}
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.995); } to { opacity: 1; transform: none; } }
.question-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--green-700);
  background: var(--green-050);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
}
.chip.type-chip { color: #7a5927; background: #f7edd9; }
.chip.done-chip { color: #8a4b45; background: #f7e9e5; }
.chip.source-chip { color: var(--muted); background: #f0ede6; }
.question-stem {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Songti SC", serif;
  font-size: clamp(19px, 2.1vw, 24px);
  font-weight: 650;
  line-height: 1.68;
  letter-spacing: .01em;
  white-space: pre-wrap;
}
.question-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.diagram-list { display: grid; gap: 12px; margin: 19px 0 2px; }
.diagram-list img {
  display: block;
  max-width: 100%;
  max-height: 430px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  object-fit: contain;
}
.options-list { display: grid; gap: 10px; margin-top: 26px; }
.option-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  align-items: start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  background: rgba(250,248,242,.66);
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.option-btn:hover:not(:disabled) { border-color: #a7c4ad; background: var(--green-050); transform: translateX(2px); }
.option-btn:disabled { cursor: default; }
.option-key {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--green-700);
  background: #eceee8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
}
.option-text { padding-top: 2px; line-height: 1.55; }
.option-btn.is-selected { border-color: var(--green-600); background: var(--green-100); box-shadow: 0 0 0 2px rgba(47,122,90,.08); }
.option-btn.is-selected .option-key { color: #fff; background: var(--green-700); }
.option-btn.is-correct { border-color: #68a77d; background: #e4f1e7; }
.option-btn.is-correct .option-key { color: #fff; background: #438b5b; }
.option-btn.is-wrong { border-color: #d18a83; background: var(--red-soft); }
.option-btn.is-wrong .option-key { color: #fff; background: var(--red); }
.option-btn.is-correct::after, .option-btn.is-wrong::after {
  justify-self: end;
  font-size: 17px;
  line-height: 30px;
}
.option-btn.is-correct::after { content: "✓"; color: #438b5b; }
.option-btn.is-wrong::after { content: "×"; color: var(--red); }
.option-btn.is-correct, .option-btn.is-wrong { grid-template-columns: 34px minmax(0,1fr) 20px; }

.result-strip {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 22px;
  padding: 13px 15px;
  border-radius: 13px;
  font-size: 13px;
  animation: view-in .2s ease both;
}
.result-strip strong { display: block; font-size: 14px; }
.result-strip span { color: var(--muted); }
.result-strip.correct { color: #2f7046; background: #e8f3e9; border: 1px solid #cce3d1; }
.result-strip.wrong { color: #924440; background: #f8e9e6; border: 1px solid #efd0cc; }
.result-strip.info { color: #775a2c; background: #faf0df; border: 1px solid #eddcbe; }
.result-mark { flex: 0 0 27px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; background: rgba(255,255,255,.55); }

.answer-panel {
  margin-top: 20px;
  padding: 18px 19px;
  border: 1px solid #d8e4da;
  border-radius: 15px;
  background: linear-gradient(135deg, #f4faf5, #fbfaf5);
  animation: view-in .25s ease both;
}
.answer-panel h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; }
.answer-panel h3::before { content: "解"; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--green-700); font-size: 11px; }
.answer-primary { color: var(--green-800); font-weight: 700; }
.explanation-text { margin: 11px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.reference-answer {
  margin: 11px 0 0;
  padding: 13px 14px;
  border-radius: 11px;
  color: var(--ink-soft);
  background: rgba(255,255,255,.68);
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 13px;
}
.recall-guide { margin: 0; color: var(--muted); font-size: 12px; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 23px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.action-row .spacer { flex: 1; }
.primary-btn {
  border-radius: 11px;
  padding: 10px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  box-shadow: 0 8px 20px rgba(36,100,74,.20);
  font-size: 13px;
  font-weight: 700;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(36,100,74,.25); }
.primary-btn:disabled { transform: none; opacity: .45; cursor: not-allowed; }
.secondary-btn, .danger-btn, .subtle-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  background: #fffdf8;
  font-size: 12px;
  cursor: pointer;
  transition: .2s ease;
}
.secondary-btn { color: var(--green-700); }
.secondary-btn:hover { background: var(--green-050); border-color: #b8d2bd; }
.danger-btn { color: var(--red); background: #fffaf8; border-color: #ecd2ce; }
.danger-btn:hover { background: var(--red-soft); }
.subtle-btn { color: var(--muted); background: transparent; }
.subtle-btn:hover { color: var(--ink); background: #f2efe7; }
.danger-ghost-btn {
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--red);
  background: transparent;
  border-color: #e7cfcb;
  font-size: 12px;
}
.danger-ghost-btn:hover { background: var(--red-soft); }

.empty-state {
  margin-top: 20px;
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255,253,248,.58);
}
.empty-illustration {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: var(--green-700);
  background: var(--green-100);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}
.empty-state h2 { margin: 0; font-size: 19px; }
.empty-state p { margin: 7px 0 20px; color: var(--muted); font-size: 13px; }

.wrong-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 30px 31px;
  border-radius: var(--radius-lg);
  color: rgba(255,255,255,.88);
  background:
    radial-gradient(circle at 88% 10%, rgba(193,149,93,.34), transparent 16rem),
    linear-gradient(135deg, #1b4c37, #123428);
  box-shadow: var(--shadow-md);
}
.wrong-hero h2 { margin: 1px 0 4px; color: #fffdf7; font-size: 28px; }
.wrong-hero p { max-width: 610px; margin: 0; color: rgba(255,255,255,.58); font-size: 13px; }
.wrong-hero .eyebrow { color: #b7d7bb; }
.wrong-hero-count {
  min-width: 138px;
  text-align: center;
  padding: 15px 18px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 17px;
  background: rgba(255,255,255,.07);
}
.wrong-hero-count strong { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 38px; line-height: 1.1; color: #fff; }
.wrong-hero-count span { font-size: 11px; color: rgba(255,255,255,.52); }
.wrong-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 14px; }
.wrong-list { display: grid; gap: 11px; }
.wrong-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,253,248,.79);
  box-shadow: var(--shadow-sm);
  transition: .2s ease;
}
.wrong-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: #cfc8b9; }
.wrong-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.wrong-card-title { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.65; }
.wrong-card-sub { margin-top: 7px; color: var(--muted); font-size: 11px; }
.wrong-card-actions { display: flex; flex-direction: column; justify-content: center; gap: 7px; min-width: 92px; }
.wrong-card-actions button { white-space: nowrap; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 100;
  transform: translate(-50%, 20px);
  min-width: 180px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 11px;
  color: #fff;
  background: rgba(20,45,34,.94);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.keyboard-hint {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 10;
  color: rgba(24,35,29,.38);
  font-size: 10px;
  pointer-events: none;
}
.sidebar-backdrop { display: none; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 270px minmax(0,1fr); }
  .sidebar { padding-inline: 18px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 880px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    z-index: 60;
    left: 0;
    top: 0;
    width: min(86vw, 310px);
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.2,.85,.25,1);
  }
  .sidebar-backdrop {
    position: fixed;
    z-index: 55;
    inset: 0;
    background: rgba(15, 30, 23, .38);
    backdrop-filter: blur(3px);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .icon-btn.menu-btn { display: grid; place-items: center; }
  .topbar { min-height: 74px; padding: 12px 20px; }
  .main-content { padding: 24px 20px 72px; }
  .keyboard-hint { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 14px; }
  .topbar h1 { font-size: 19px; }
  .topbar-actions { display: none; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 13px; border-radius: 14px; }
  .stat-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
  .stat-value { font-size: 23px; }
  .progress-panel { padding: 15px; }
  .question-toolbar { margin-top: 21px; }
  .question-card { border-radius: 20px; padding: 21px 17px 23px; }
  .question-stem { font-size: 18px; line-height: 1.65; }
  .option-btn { padding: 12px; grid-template-columns: 30px minmax(0,1fr); gap: 9px; }
  .option-btn.is-correct, .option-btn.is-wrong { grid-template-columns: 30px minmax(0,1fr) 18px; }
  .option-key { width: 28px; height: 28px; border-radius: 8px; }
  .wrong-hero { align-items: flex-start; padding: 22px; }
  .wrong-hero h2 { font-size: 23px; }
  .wrong-hero-count { min-width: 82px; padding: 11px; }
  .wrong-hero-count strong { font-size: 29px; }
  .wrong-card { grid-template-columns: 1fr; gap: 12px; }
  .wrong-card-actions { flex-direction: row; justify-content: flex-start; }
  .action-row .spacer { display: none; }
  .action-row > button { flex: 1 1 auto; }
}
