:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-3: #edf3f6;
  --ink: #18262e;
  --muted: #60717b;
  --line: #d9e2e7;
  --primary: #1f4e78;
  --primary-strong: #173b5c;
  --primary-soft: #deebf5;
  --teal: #2d7472;
  --teal-soft: #dcefed;
  --good: #25704d;
  --good-soft: #dcefe3;
  --bad: #a83f43;
  --bad-soft: #f6dddd;
  --warn: #8a641b;
  --warn-soft: #f7edd3;
  --shadow: 0 18px 50px rgba(20, 49, 68, 0.09);
  --font: "Hiragino Sans GB", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11191f;
    --surface: #18242b;
    --surface-2: #1d2a31;
    --surface-3: #22313a;
    --ink: #ecf3f6;
    --muted: #a7b4bb;
    --line: #33454f;
    --primary: #7fb7df;
    --primary-strong: #9ac6e6;
    --primary-soft: #243d50;
    --teal: #7ac7c2;
    --teal-soft: #22403e;
    --good: #83d0a8;
    --good-soft: #1f4432;
    --bad: #f0a0a4;
    --bad-soft: #4a292d;
    --warn: #e6c779;
    --warn-soft: #44391f;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 10% -10%, color-mix(in srgb, var(--primary-soft) 72%, transparent), transparent 32rem),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--teal-soft) 55%, transparent), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font: 15px/1.65 var(--font);
  -webkit-text-size-adjust: 100%;
}
button, input, select { font: inherit; }
button { color: inherit; }
a { color: var(--primary); text-underline-offset: .18em; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}
.login-panel {
  width: min(520px, 100%);
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 13px; background: var(--primary); color: #fff;
  font-size: 20px; font-weight: 700; flex: 0 0 auto;
}
.login-panel .eyebrow { margin-top: 32px; }
.login-panel h1 {
  margin: 9px 0 10px;
  font-size: clamp(29px, 5vw, 42px);
  line-height: 1.2;
  letter-spacing: -.03em;
}
.login-copy { color: var(--muted); margin: 0 0 24px; }
.login-form { display: grid; gap: 9px; }
.login-form label { color: var(--muted); font-size: 12px; font-weight: 700; }
.login-form input {
  height: 50px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--ink); padding: 0 13px; outline: none;
  font-size: 16px;
}
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.form-error { min-height: 22px; margin: 4px 0 0; color: var(--bad); font-size: 13px; }
.login-foot { display: flex; justify-content: space-between; margin-top: 20px; color: var(--muted); font-size: 12px; }

.app { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 12px 22px;
  display: grid; grid-template-columns: minmax(230px, 1fr) auto minmax(290px, 1fr);
  align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-copy span { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 5px; padding: 4px; border-radius: 14px; background: var(--surface-3); }
.tab {
  border: 0; border-radius: 10px; background: transparent; padding: 9px 14px;
  cursor: pointer; color: var(--muted); font-weight: 650; white-space: nowrap;
}
.tab:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 58%, transparent); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 4px 14px rgba(18,44,60,.08); }
.header-user { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.header-username { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.level-select {
  height: 38px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); padding: 0 9px;
}

.main { max-width: 1440px; margin: 0 auto; padding: 22px; }
.panel-enter { animation: panelIn .18s ease-out; }
@keyframes panelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
}
.hero { display: grid; grid-template-columns: 1.55fr .75fr; gap: 20px; margin-bottom: 22px; }
.hero-main { padding: 30px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.eyebrow { color: var(--teal); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.hero h1 { margin: 9px 0 10px; font-size: clamp(27px, 3.4vw, 43px); line-height: 1.18; letter-spacing: -.035em; }
.hero p { margin: 0; color: var(--muted); max-width: 800px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag { border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); padding: 5px 11px; font-size: 12px; font-weight: 650; }
.hero-side { padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.progress-ring {
  width: 126px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--primary) calc(var(--progress) * 1%), var(--surface-3) 0);
  position: relative; margin: 0 auto;
}
.progress-ring::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.progress-ring div { position: relative; z-index: 1; text-align: center; }
.progress-ring strong { display: block; font-size: 26px; line-height: 1; }
.progress-ring span { color: var(--muted); font-size: 11px; }
.hero-side h2 { margin: 0; font-size: 16px; }
.hero-side p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.btn {
  min-height: 42px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); padding: 9px 14px; font-weight: 650;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-small { min-height: 35px; padding: 6px 10px; font-size: 13px; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.guide-layout { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidebar { position: sticky; top: 86px; padding: 16px; max-height: calc(100vh - 105px); overflow: auto; }
.search-box { position: relative; }
.search-box input {
  width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 12px; background: var(--surface-2); color: var(--ink); outline: none;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.search-results {
  position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; right: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  box-shadow: var(--shadow); padding: 6px; max-height: 380px; overflow: auto;
}
.search-result { width: 100%; border: 0; background: transparent; text-align: left; border-radius: 9px; padding: 9px 10px; cursor: pointer; }
.search-result:hover { background: var(--surface-3); }
.search-result strong { display: block; font-size: 13px; }
.search-result span { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc-title { margin: 18px 4px 8px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.toc { display: grid; gap: 2px; }
.toc-link { display: block; border-radius: 9px; padding: 7px 9px; color: var(--muted); text-decoration: none; font-size: 13px; line-height: 1.35; }
.toc-link:hover { background: var(--surface-3); color: var(--ink); }
.toc-level-1 { color: var(--ink); font-weight: 700; margin-top: 5px; }
.toc-level-2 { padding-left: 20px; }
.side-progress { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-progress-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 7px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--teal); width: 0; transition: width .25s ease; }

.manual { padding: 34px 42px 46px; min-width: 0; }
.chapter { margin-bottom: 8px; }
.chapter-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-top: 18px; }
.chapter:first-child .chapter-heading { margin-top: 0; }
.chapter h1 { margin: 0; font-size: 29px; line-height: 1.3; letter-spacing: -.02em; }
.chapter-read { flex: 0 0 auto; margin-top: 3px; }
.chapter-read.is-read { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); color: var(--good); }
.manual h2 { margin: 30px 0 10px; font-size: 20px; line-height: 1.4; }
.manual h3 { margin: 22px 0 7px; font-size: 16px; line-height: 1.45; }
.manual p { margin: 8px 0 11px; line-height: 1.85; text-align: justify; }
.manual-bullet { padding-left: 16px; position: relative; }
.manual-bullet::before { content: ""; position: absolute; left: 1px; top: .78em; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }
.manual-step { padding: 7px 11px; border-left: 3px solid var(--primary-soft); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.manual-note { padding: 12px 14px; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 10px 10px 0; }
.source-link { font-size: 12px; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 14px 0 22px; border: 1px solid var(--line); border-radius: 12px; }
.manual table { width: 100%; border-collapse: collapse; min-width: 610px; font-size: 13px; }
.manual th { background: var(--primary); color: white; font-weight: 650; }
.manual th, .manual td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.manual tbody tr:nth-child(even) { background: var(--surface-2); }
.manual tbody tr:last-child td { border-bottom: 0; }
.flash-target { animation: flashTarget 1.15s ease; }
@keyframes flashTarget { 0%,100% { background: transparent; } 30% { background: var(--warn-soft); } }

.practice-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.filter-card { position: sticky; top: 86px; padding: 18px; }
.filter-head { display: flex; align-items: center; justify-content: space-between; }
.filter-card h2, .practice-title h2, .exam-title h2, .wrong-title h2 { margin: 0; font-size: 20px; }
.filter-card p, .practice-title p, .exam-title p, .wrong-title p { margin: 4px 0 14px; color: var(--muted); font-size: 13px; }
.field { display: grid; gap: 6px; margin-bottom: 13px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 650; }
.select, .input {
  width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink); padding: 9px 11px; outline: none;
}
.select:focus, .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.filter-summary { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.practice-main, .exam-main, .wrong-main { min-width: 0; }
.practice-title, .exam-title, .wrong-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 22px 24px; margin-bottom: 16px; }
.question-card { padding: 28px 30px; }
.question-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.meta-chip { border-radius: 999px; background: var(--surface-3); color: var(--muted); padding: 4px 9px; font-size: 11px; font-weight: 650; }
.meta-chip.module { background: var(--primary-soft); color: var(--primary-strong); }
.meta-chip.wrong { background: var(--bad-soft); color: var(--bad); }
.question-card h2 { margin: 0 0 20px; font-size: clamp(20px, 2.2vw, 27px); line-height: 1.5; }
.option-list { display: grid; gap: 10px; }
.option {
  width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface); padding: 12px 14px; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 10px;
}
.option:hover { border-color: var(--primary); background: var(--surface-2); }
.option-letter { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-weight: 750; }
.option.correct { background: var(--good-soft); border-color: var(--good); }
.option.correct .option-letter { background: var(--good); color: white; }
.option.wrong { background: var(--bad-soft); border-color: var(--bad); }
.option.wrong .option-letter { background: var(--bad); color: white; }
.feedback { margin-top: 18px; padding: 15px 16px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.feedback.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 34%, var(--line)); }
.feedback.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 34%, var(--line)); }
.feedback strong { display: block; margin-bottom: 5px; }
.feedback p { margin: 5px 0; }
.mnemonic { color: var(--muted); font-size: 13px; }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.nav-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination-text { color: var(--muted); font-size: 13px; }
.empty-state { padding: 46px 24px; text-align: center; }
.empty-state strong { display: block; font-size: 19px; margin-bottom: 6px; }
.empty-state p { margin: 0; color: var(--muted); }

.exam-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.exam-stat { padding: 13px 14px; }
.exam-stat span { display: block; color: var(--muted); font-size: 11px; }
.exam-stat strong { display: block; font-size: 20px; line-height: 1.25; }
.exam-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 16px; align-items: start; }
.exam-side { position: sticky; top: 86px; padding: 16px; }
.exam-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.grid-btn {
  min-height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; font-size: 12px; position: relative;
}
.grid-btn.answered { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); color: var(--primary-strong); }
.grid-btn.current { outline: 2px solid var(--teal); outline-offset: 1px; }
.grid-btn.flagged::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; top: 4px; right: 4px; background: var(--warn); }
.exam-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 4px; }
.result-card { padding: 28px; }
.result-score { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.score-ring {
  width: 118px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--teal) calc(var(--score) * 1%), var(--surface-3) 0);
  position: relative;
}
.score-ring::after { content: ""; position: absolute; inset: 10px; background: var(--surface); border-radius: 50%; }
.score-ring strong { position: relative; z-index: 1; font-size: 27px; }
.result-copy h2 { margin: 0 0 6px; }
.result-copy p { margin: 0; color: var(--muted); }
.review-list { display: grid; gap: 9px; margin-top: 18px; }
.review-item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 0 14px; }
.review-item summary { cursor: pointer; padding: 11px 0; font-weight: 650; }
.review-item p { margin: 5px 0 11px; color: var(--muted); font-size: 13px; }

.wrong-list { display: grid; gap: 12px; }
.wrong-item { padding: 18px 20px; }
.wrong-item h3 { margin: 4px 0 8px; font-size: 17px; line-height: 1.5; }
.wrong-item p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

.mobile-nav, .mobile-toc-toggle, .mobile-filter-toggle { display: none; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%,14px);
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: 9px 16px;
  opacity: 0; pointer-events: none; transition: .2s ease; box-shadow: var(--shadow); font-size: 13px;
}
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1080px) {
  .topbar-inner { grid-template-columns: 1fr auto; }
  .tabs { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; overflow-x: auto; }
  .tab { flex: 1; }
  .guide-layout { grid-template-columns: 238px minmax(0,1fr); }
  .practice-layout { grid-template-columns: 230px minmax(0,1fr); }
  .exam-layout { grid-template-columns: minmax(0,1fr) 245px; }
}
@media (max-width: 820px) {
  .app { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .topbar-inner { padding: 10px 14px; gap: 10px; }
  .tabs { display: none; }
  .brand-copy span { display: none; }
  .header-user { gap: 5px; }
  .header-username { display: none; }
  .level-select { max-width: 150px; }
  .main { padding: 14px; }
  .hero { grid-template-columns: 1fr; }
  .hero-main { padding: 24px; }
  .hero-side { display: grid; grid-template-columns: auto 1fr; }
  .guide-layout, .practice-layout, .exam-layout { grid-template-columns: 1fr; }
  .sidebar, .filter-card, .exam-side { position: static; max-height: none; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
  .sidebar .search-box, .sidebar .toc-panel { grid-column: 1 / -1; }
  .mobile-toc-toggle, .mobile-filter-toggle {
    display: inline-flex; min-height: 44px; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2);
    padding: 9px 12px; color: var(--muted); font-weight: 650; cursor: pointer;
  }
  .mobile-toc-toggle { width: 100%; }
  .mobile-filter-toggle { min-height: 36px; padding: 5px 10px; font-size: 12px; }
  .toc-panel, .practice-filter-fields { display: none; }
  .toc-panel.is-open, .practice-filter-fields.is-open { display: block; }
  .side-progress { margin: 0; padding: 0; border: 0; grid-column: 1 / -1; }
  .manual { padding: 26px 22px 34px; }
  .chapter h1 { font-size: 25px; }
  .question-card { padding: 22px 20px; }
  .exam-head { grid-template-columns: repeat(2,1fr); }
  .exam-side .exam-grid { grid-template-columns: repeat(10,1fr); }
  .mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 -10px 30px rgba(18,44,60,.11);
    backdrop-filter: blur(18px);
  }
  .mobile-tab {
    min-height: 52px; border: 0; border-radius: 12px; background: transparent;
    color: var(--muted); display: grid; place-items: center; align-content: center;
    gap: 2px; cursor: pointer; padding: 4px 2px; font-size: 11px;
  }
  .mobile-tab-icon { font-size: 17px; line-height: 1; font-weight: 750; }
  .mobile-tab[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-strong); }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-copy { display: none; }
  .level-select { max-width: 118px; }
  .header-user .btn { min-height: 36px; padding: 5px 8px; }
  .hero-main h1 { font-size: 27px; line-height: 1.22; }
  .hero-main p { font-size: 14px; }
  .hero-side { grid-template-columns: 1fr; }
  .hero-side .progress-ring { margin: 0 auto; }
  .hero-actions .btn { flex: 1; }
  .sidebar { grid-template-columns: 1fr; }
  .sidebar .search-box, .sidebar .toc-panel, .side-progress { grid-column: auto; }
  .toc { max-height: 280px; overflow: auto; }
  .manual { padding: 22px 16px 30px; }
  .manual p { text-align: left; }
  .chapter-heading { display: block; }
  .chapter-read { margin-top: 8px; }
  .chapter h1 { font-size: 23px; }
  .manual table { min-width: 500px; font-size: 12px; }
  .manual th, .manual td { padding: 9px 10px; }
  .practice-title, .exam-title, .wrong-title { padding: 18px; flex-direction: column; align-items: stretch; }
  .practice-title .btn, .exam-title .btn, .wrong-title .btn { width: 100%; }
  .question-card h2 { font-size: 19px; }
  .option { grid-template-columns: 28px 1fr; padding: 11px; }
  .option-letter { width: 27px; height: 27px; }
  .nav-row, .nav-row .nav-group { width: 100%; align-items: stretch; }
  .nav-row .nav-group .btn { flex: 1; }
  .btn, .btn-small { min-height: 44px; }
  .select, .input, .search-box input { min-height: 48px; font-size: 16px; }
  .grid-btn { min-height: 42px; }
  .exam-side .exam-grid { grid-template-columns: repeat(5,1fr); }
  .result-score { align-items: flex-start; }
  .score-ring { width: 96px; }
  .toast { width: calc(100% - 28px); text-align: center; bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media print {
  body { background: #fff; color: #000; }
  .topbar, .sidebar, .hero-side, .hero-actions, .practice-panel, .exam-panel, .wrong-panel, .mobile-nav, .chapter-read { display: none !important; }
  .main { padding: 0; max-width: none; }
  .hero { display: block; }
  .hero-main, .manual { box-shadow: none; border: 0; padding: 0; }
  .guide-layout { display: block; }
  .chapter { break-before: page; }
  .chapter:first-child { break-before: auto; }
  .table-wrap { overflow: visible; }
  .manual table { min-width: 0; font-size: 9pt; }
}
