:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --surface: #fffefa;
  --ink: #273b33;
  --muted: #68736b;
  --faint: #7b837b;
  --green: #234d40;
  --green-hover: #173e31;
  --green-soft: #eaf0e8;
  --line: #e3e6dc;
  --gold: #97773b;
  --bad: #ad4e3d;
  --bad-soft: #fbefea;
  --radius: 18px;
  --sidebar: 216px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  scroll-padding-bottom: 160px;
}
html[data-font="large"] { font-size: 18px; }
html[data-font="larger"] { font-size: 20px; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.6; }
body, input, button, select { -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; }
button, a, select, summary { touch-action: manipulation; }
button, a { -webkit-user-select: none; user-select: none; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; text-decoration: none; }
button, input, select, dialog { color: inherit; }
button, input, select { max-width: 100%; }
button, input, a, select, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid #a58d53; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.4; }
button { border: 0; }
small { font-size: 0.875rem; }
::selection { background: #d9e6cf; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; padding: 12px 20px; background: var(--green); color: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 34px 20px 24px; background: #efefe8; border-right: 1px solid #e2e4d9; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 9px; }
.brand-mark { background: var(--green); color: #faf7e9; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.75rem; flex: 0 0 40px; line-height: 1; }
.brand strong { display: block; font-size: 1.125rem; font-weight: 650; letter-spacing: .1em; }
.brand small { display: block; color: var(--muted); font-size: .625rem; letter-spacing: .12em; margin-top: 3px; }
.nav-caption { color: var(--faint); font-size: 0.8125rem; letter-spacing: .08em; padding: 0 13px; margin: 55px 0 13px; }
.main-nav { display: flex; flex-direction: column; gap: 8px; }
.main-nav a { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 9px 14px; font-size: .875rem; color: #626f64; border-radius: 10px; transition: background .16s, color .16s; }
.main-nav a:hover { background: #e4e8de; color: var(--green); }
.main-nav a.active { background: var(--green); color: #fffdf5; font-weight: 600; }
.nav-icon { font-family: "Segoe UI Symbol", sans-serif; font-size: 1.35rem; line-height: 1; width: 23px; text-align: center; }
.nav-count { font-size: 0.8125rem; line-height: 1.6; padding: 0 6px; margin-left: auto; background: #e2e6da; border-radius: 5px; }
.active .nav-count { background: #436759; }
.sidebar-note { margin: auto 13px 35px; padding-top: 44px; }
.note-symbol { display: block; color: var(--gold); font-size: 1.9rem; margin-bottom: 9px; }
.sidebar-note p { font-family: "Noto Serif SC", "Songti SC", SimSun, serif; line-height: 1.8; font-size: 1rem; letter-spacing: .08em; }
.sidebar-note small { color: var(--faint); display: block; margin-top: 9px; font-size: 0.875rem; }
.sidebar-footer { padding: 16px 4px 0; border-top: 1px solid #dfe2d6; color: var(--muted); font-size: .75rem; display: flex; gap: 7px; align-items: center; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #749064; flex-shrink: 0; }
.main-shell { margin-left: var(--sidebar); min-width: 0; }
.topbar { height: 82px; max-width: 1320px; margin: auto; padding: 0 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.breadcrumb { font-size: .75rem; color: var(--faint); display: flex; flex-wrap: wrap; gap: 13px; align-items: center; }
.breadcrumb strong { color: #546057; font-weight: 500; }
.breadcrumb > span { color: #c0c5b8; }
.font-control { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--muted); }
.font-control > span { font-family: Georgia, serif; font-size: 1rem; }
.font-control select { border: 0; background: transparent; min-height: 44px; cursor: pointer; padding: 4px; font-size: 0.875rem; }
#main { max-width: 1320px; margin: auto; padding: 20px 44px 32px; min-height: calc(100vh - 168px); }
#main:focus { outline: 0; }
.view { min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 143px; margin-bottom: 25px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: .75rem; letter-spacing: .12em; color: var(--green); font-weight: 500; margin-bottom: 14px; }
.page-heading h1 { font-size: clamp(1.65rem, 2.5vw, 2.25rem); font-weight: 600; letter-spacing: -.025em; }
.heading-dot { color: #a38a51; }
.page-heading p { font-size: 0.875rem; color: var(--muted); margin-top: 12px; }
.math-decoration { position: relative; width: 192px; height: 126px; flex-shrink: 0; color: #6d806a; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-8deg); font-family: Georgia, serif; isolation: isolate; }
.math-decoration::before { content: ""; position: absolute; width: 116px; height: 116px; border: 1px solid #d5ddcb; border-radius: 50%; z-index: -1; right: 15px; top: 1px; }
.math-decoration::after { content: ""; position: absolute; width: 85px; height: 85px; border: 1px solid #d5ddcb; border-radius: 50%; z-index: -1; left: 10px; bottom: 3px; }
.math-decoration > span { font-size: 1.125rem; font-style: italic; }
.math-decoration b { font-size: 2.875rem; line-height: 1.1; font-weight: 400; color: var(--green); }
.math-decoration i { margin-top: 9px; font-size: .75rem; color: #7c866f; }
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; margin-bottom: 32px; }
.stat-item { min-width: 0; padding: 0 24px; }
.stat-item:first-child { padding-left: 0; }
.stat-item + .stat-item { border-left: 1px solid var(--line); }
.stat-label { display: block; font-size: 0.8125rem; color: var(--muted); margin-bottom: 6px; }
.stat-item > strong { display: inline-block; font-size: 1.75rem; font-weight: 600; line-height: 1.2; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-item > small { margin-left: 7px; color: var(--faint); font-size: 0.8125rem; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 28px; align-items: start; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 17px; }
.section-heading h2 { font-size: 1rem; font-weight: 600; }
.section-heading > span { font-size: 0.8125rem; color: var(--faint); }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.topic-card { position: relative; display: flex; align-items: flex-start; gap: 13px; min-width: 0; padding: 21px 17px; min-height: 119px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; text-align: left; transition: border-color .15s, background .15s, box-shadow .15s; }
.topic-card:hover { border-color: #a8b7a1; background: #fcfcf7; }
.topic-card.selected { border-color: #779075; background: #edf2e9; box-shadow: 0 0 0 1px #779075 inset; }
.topic-symbol { width: 31px; height: 31px; min-width: 31px; display: grid; place-items: center; font-family: Georgia, "Segoe UI Symbol", serif; font-size: 1.375rem; font-weight: 400; line-height: 1; color: var(--green); margin-top: 1px; }
.topic-info { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.topic-name { display: block; font-size: 1rem; font-weight: 600; line-height: 1.5; padding-right: 9px; }
.topic-desc { display: block; font-size: 0.875rem; color: var(--muted); margin-top: 5px; line-height: 1.6; overflow-wrap: anywhere; }
.topic-stat { display: block; font-size: 0.8125rem; color: var(--faint); margin-top: 10px; }
.topic-check { position: absolute; right: 10px; top: 10px; color: var(--green); font-size: 0.8125rem; }
.quiet-tip { display: flex; align-items: flex-start; gap: 9px; font-size: 0.875rem; line-height: 1.8; color: var(--muted); padding-top: 20px; }
.quiet-tip > span { color: var(--gold); }
.practice-panel { position: sticky; top: 24px; background: #edf0e7; border: 1px solid #dde3d3; border-radius: var(--radius); padding: 24px; }
.panel-eyebrow { font-size: .75rem; color: #6b7e62; margin-bottom: 9px; letter-spacing: .08em; }
.practice-panel h2 { font-size: 1.25rem; font-weight: 600; }
.practice-panel > p { font-size: 0.875rem; line-height: 1.7; color: var(--muted); margin-top: 7px; }
.setting-block { padding-top: 22px; }
.setting-block h3 { font-size: 0.875rem; color: #5f705c; font-weight: 500; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button { background: #f8f9f3; min-height: 44px; padding: 9px 12px; border: 1px solid #dce1d3; border-radius: 8px; font-size: 0.875rem; color: #61705d; line-height: 1.3; transition: background .15s, border-color .15s; }
.chips button:hover { border-color: #8b9b80; }
.chips button.active { background: #dce5d4; border-color: #97aa88; color: var(--green); font-weight: 600; }
.mode-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.mode-chips button { grid-column: span 2; padding: 9px 6px; }
.mode-chips button:nth-child(n+4) { grid-column: span 3; }
.toggle-row { display: flex; gap: 10px; align-items: flex-start; margin: 23px 0; cursor: pointer; min-height: 44px; }
.toggle-row input { accent-color: var(--green); width: 17px; height: 17px; margin: 3px 0 0; flex: 0 0 17px; }
.toggle-row > span { font-size: 0.875rem; }
.toggle-row small { display: block; color: var(--muted); font-size: 0.875rem; margin-top: 2px; }
.button { min-height: 46px; border-radius: 9px; padding: 11px 20px; font-size: .875rem; font-weight: 500; display: inline-flex; gap: 12px; align-items: center; justify-content: center; text-align: center; border: 1px solid transparent; line-height: 1.45; transition: background .15s, border-color .15s; }
.button.primary { background: var(--green); color: #fffdf5; }
.button.primary:hover { background: var(--green-hover); }
.button.secondary { background: var(--surface); color: var(--green); border-color: #dce2d6; }
.button.secondary:hover { background: var(--green-soft); border-color: #bccab2; }
.button.quiet { background: transparent; color: var(--muted); padding-left: 0; padding-right: 0; }
.button.quiet:hover { color: var(--green); }
.start-dock .button { width: 100%; display: flex; justify-content: space-between; min-height: 49px; }
.start-summary { font-size: 0.8125rem; color: var(--muted); margin-bottom: 9px; }
.practice-panel .panel-foot { font-size: 0.875rem; color: #77836e; text-align: center; margin-top: 11px; }
.page-footer { max-width: 1320px; margin: 14px auto 0; padding: 24px 44px 28px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .75rem; color: #768171; }
.footer-separator { color: #b4bdab; margin: 0 10px; }
.quiz-view { max-width: 740px; margin: 16px auto 0; }
.quiz-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 23px; }
.timer { font-size: .875rem; font-weight: 500; font-variant-numeric: tabular-nums; background: #eeeee5; padding: 7px 13px; border-radius: 7px; }
.timer.urgent { color: var(--bad); background: var(--bad-soft); }
.quiz-progress { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); margin-bottom: 10px; }
.progress-track { height: 4px; border-radius: 10px; background: #e0e5d8; overflow: hidden; margin-bottom: 25px; }
.progress-track > span { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; transition: width .2s; }
.question-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 40px 40px 29px; text-align: center; box-shadow: 0 8px 30px #324b2b04; }
.question-label { display: inline-block; background: var(--green-soft); color: #58714f; font-size: 0.875rem; padding: 6px 12px; border-radius: 6px; margin-bottom: 25px; }
.question-text { font-size: clamp(1.65rem, 3.4vw, 2.375rem); line-height: 1.55; font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.question-note { color: var(--muted); font-size: 0.875rem; margin: 12px 0 28px; min-height: 1.2em; }
.answer-inputs { max-width: 330px; margin: auto; display: flex; gap: 12px; align-items: flex-end; justify-content: center; }
.answer-inputs.pair { max-width: 380px; }
.answer-field { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; text-align: left; font-size: 0.875rem; color: var(--muted); }
.answer-field > span, .answer-field label { display: block; font-size: 0.875rem; }
.answer-inputs input { width: 100%; min-width: 0; max-width: 100%; background: #f8f9f4; border: 1.5px solid #d2dccb; padding: 11px 14px; border-radius: 10px; text-align: center; font-size: 1.5rem; font-weight: 500; line-height: 1.6; color: var(--ink); font-variant-numeric: tabular-nums; }
.answer-inputs input:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 3px #dfe8d766; outline: 0; }
.answer-inputs input::placeholder { color: #9aa391; font-weight: 400; font-size: 1rem; }
.answer-inputs input:disabled { opacity: 1; color: #67755d; background: #f2f4ed; }
.answer-separator, .input-separator { color: var(--muted); font-size: 1.25rem; padding-bottom: 15px; }
.feedback { min-height: 70px; margin: 17px 0 15px; padding: 12px; font-size: .9375rem; line-height: 1.7; border-radius: 10px; overflow-wrap: anywhere; }
.feedback:empty { padding: 0; }
.feedback.correct { background: #eef5e9; color: #35613c; }
.feedback.wrong { background: var(--bad-soft); color: var(--bad); }
.feedback > p, .feedback .hint, .feedback small { display: block; font-size: 0.875rem; color: var(--muted); margin-top: 5px; }
.quiz-actions { display: flex; gap: 11px; max-width: 430px; margin: auto; }
.quiz-actions .primary { flex: 1; }
.quiz-actions .secondary { flex: 0 0 28%; }
.input-help { font-size: 0.875rem; color: var(--faint); margin-top: 15px; }
.quiz-footer { color: #89907f; text-align: center; font-size: .75rem; margin: 22px 0; letter-spacing: .1em; }
.result-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 32px 36px; background: #eaf0e4; border: 1px solid #dce5d2; border-radius: var(--radius); margin-top: 14px; }
.result-summary { min-width: 0; }
.result-summary h1 { font-size: 1.875rem; font-weight: 600; }
.result-summary p { font-size: 0.875rem; color: var(--muted); margin-top: 12px; }
.score-ring { border: 5px solid #ccd9be; border-top-color: #527249; border-right-color: #527249; border-radius: 50%; width: 140px; height: 140px; flex: 0 0 140px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: #f6f8ef; }
.score-ring strong { font-size: 2.125rem; font-weight: 600; line-height: 1.2; letter-spacing: -.05em; }
.score-ring > span, .score-ring small { font-size: 0.8125rem; color: #6b7d5e; margin-top: 5px; }
.result-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 25px 0; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.result-stats .stat-item > strong { font-size: 1.25rem; letter-spacing: -.02em; }
.result-actions, .toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.result-actions { margin: 20px 0 28px; }
.save-note { color: #66785b; font-size: 0.875rem; margin-top: 13px; }
.result-meta { font-size: 0.8125rem; color: var(--muted); line-height: 1.8; margin: 14px 0; }
.collection-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 12px 0 22px; }
.collection-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 1rem; font-weight: 600; }
.filter-select { min-height: 44px; background: var(--surface); padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.875rem; max-width: 100%; }
.review-filters { margin-bottom: 17px; display: flex; flex-wrap: wrap; gap: 5px; background: #eeeee7; padding: 4px; border-radius: 9px; width: fit-content; max-width: 100%; }
.review-filters button { min-height: 44px; background: none; padding: 8px 16px; border-radius: 6px; font-size: 0.875rem; color: var(--muted); }
.review-filters button.active { background: var(--surface); color: var(--green); box-shadow: 0 1px 5px #38452d09; font-weight: 600; }
.review-list { display: grid; gap: 12px; }
.review-card { background: var(--surface); padding: 18px 22px 21px; border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.review-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.review-index { flex: 1 1 100px; font-size: 0.8125rem; color: var(--faint); }
.status-badge { border-radius: 5px; padding: 3px 7px; font-size: 0.8125rem; }
.status-badge.correct { background: #edf4e7; color: #456539; }
.status-badge.wrong { background: var(--bad-soft); color: var(--bad); }
.status-badge.skipped { background: #f3efdf; color: #886b31; }
.favorite-toggle { margin-left: auto; min-height: 44px; min-width: 44px; padding: 7px 10px; border-radius: 7px; background: transparent; color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
.favorite-toggle:hover { background: #f5f1e5; }
.favorite-toggle.saved { color: #8a6a2c; background: #f7f1df; }
.review-question { font-size: 1.0625rem; font-weight: 500; margin: 11px 0 13px; line-height: 1.7; overflow-wrap: anywhere; }
.review-answer { display: flex; gap: 10px 24px; flex-wrap: wrap; font-size: 0.875rem; line-height: 1.8; color: var(--muted); overflow-wrap: anywhere; }
.review-answer b { color: var(--ink); font-weight: 500; margin-left: 5px; }
.review-hint { border-top: 1px solid #eceee5; font-size: 0.875rem; color: var(--muted); line-height: 1.9; margin-top: 13px; padding-top: 12px; overflow-wrap: anywhere; }
.favorite-card details { font-size: 0.875rem; color: var(--muted); }
.favorite-card summary { cursor: pointer; min-height: 44px; padding: 9px 0; color: var(--green); }
.favorite-card details[open] summary { margin-bottom: 8px; }
.favorite-card .button { margin-top: 15px; }
.history-list { display: grid; gap: 12px; }
.history-card { min-width: 0; }
.history-card { display: flex; align-items: center; gap: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 22px; width: 100%; text-align: left; }
.history-card:hover { border-color: #9eaf94; background: #fcfcf6; }
.history-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; background: #eff3e8; color: #58734b; font-size: 1.5rem; border-radius: 10px; }
.history-info { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.history-info h3 { font-size: 1rem; font-weight: 500; }
.history-info p { color: var(--muted); font-size: 0.8125rem; margin-top: 6px; line-height: 1.7; }
.history-score { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.history-score strong { font-size: 1.3125rem; font-weight: 500; line-height: 1.2; }
.history-score small { font-size: 0.8125rem; color: var(--muted); margin-top: 4px; }
.history-arrow { font-size: 1.25rem; color: #9ba58f; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 58px 20px 66px; border: 1px dashed #d5decc; border-radius: 18px; background: #fafbf5; }
.empty-symbol { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; background: #eaf0e1; color: #65804f; font-size: 2.25rem; margin-bottom: 24px; }
.empty-state h2 { font-size: 1.125rem; font-weight: 500; margin-bottom: 9px; }
.empty-state p { font-size: 0.875rem; color: var(--muted); line-height: 1.9; max-width: 27em; }
.empty-state .button { margin-top: 24px; }
.tables { display: grid; gap: 12px; }
.table-section { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.table-section > summary { min-height: 64px; padding: 19px 23px; cursor: pointer; color: var(--ink); font-size: 1rem; font-weight: 500; }
.table-section > summary::marker { color: #899b77; font-size: .8em; }
.table-section[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.table-grid { padding: 0 22px 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 450px; overflow: auto; scrollbar-width: thin; scrollbar-color: #bcc8af transparent; }
.table-cell { background: #f3f5ed; border-radius: 6px; padding: 10px 8px; text-align: center; font-size: 0.875rem; line-height: 1.6; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.table-cell b { color: var(--green); font-weight: 600; }
.table-note { font-size: 0.875rem; color: var(--muted); padding: 0 23px 22px; line-height: 1.8; }
.fraction-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 22px; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.fraction-row > * { text-align: center; min-width: 0; padding: 9px 6px; overflow-wrap: anywhere; border-bottom: 1px solid #e8eddf; }
.fraction-row:first-of-type { background: #f0f4e8; color: #66765c; }
.fraction-row:last-child { margin-bottom: 22px; }
.storage-warning { max-width: 1232px; margin: 0 44px 15px; background: #fff3da; color: #835e22; border: 1px solid #e9d7ae; border-radius: 9px; padding: 13px 17px; font-size: 0.875rem; }
.toast { position: fixed; left: calc(50% + var(--sidebar) / 2); bottom: 30px; transform: translateX(-50%); z-index: 90; background: #263f32; color: #fffdf3; border-radius: 10px; padding: 13px 22px; font-size: 0.875rem; box-shadow: 0 6px 25px #20371d20; max-width: min(430px, 90vw); text-align: center; }
dialog { border: 1px solid #dce3d2; border-radius: 20px; width: min(440px, calc(100% - 32px)); padding: 30px; box-shadow: 0 15px 80px #24332330; background: var(--surface); }
dialog::backdrop { background: #26332b70; backdrop-filter: blur(3px); }
dialog h2 { font-size: 1.375rem; font-weight: 600; }
dialog p { margin-top: 14px; font-size: 0.875rem; line-height: 1.9; color: var(--muted); }
.dialog-actions { margin-top: 26px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (min-width: 1600px) {
  #main { padding-top: 36px; }
  .page-heading { margin-bottom: 35px; }
  .overview { margin-bottom: 38px; }
  .topic-card { min-height: 127px; }
}
@media (max-width: 1200px) {
  .topbar { padding-right: 30px; padding-left: 30px; }
  #main { padding-right: 30px; padding-left: 30px; }
  .page-footer { padding-right: 30px; padding-left: 30px; }
  .home-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 22px; }
  .topic-grid { grid-template-columns: 1fr; gap: 10px; }
  .topic-card { padding: 17px; min-height: 94px; }
  .topic-stat { margin-top: 5px; }
  .practice-panel { padding: 21px; }
  .math-decoration { width: 145px; }
}
@media (max-width: 960px) and (min-width: 761px) {
  :root { --sidebar: 170px; }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .brand { padding: 0 3px; gap: 7px; }
  .brand strong { font-size: .9375rem; }
  .brand small { font-size: 0.75rem; letter-spacing: .13em; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .main-nav a { padding-left: 12px; gap: 9px; }
  .sidebar-note { margin-left: 12px; margin-right: 0; }
  .sidebar-footer { font-size: 0.75rem; }
  .home-layout { grid-template-columns: minmax(0, 1fr) 235px; gap: 16px; }
  .practice-panel { padding: 18px; }
  .topic-card { gap: 8px; padding: 15px 11px; }
  .topic-symbol { width: 24px; min-width: 24px; }
  .math-decoration { display: none; }
  .stat-item { padding-right: 15px; padding-left: 15px; }
  .stat-item > small { display: block; margin: 5px 0 0; }
  .page-heading h1 { font-size: 1.875rem; }
}
@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { position: static; width: 100%; padding: 20px 20px 5px; border: 0; background: var(--paper); }
  .brand { padding: 0; width: fit-content; gap: 9px; }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; font-size: 1.45rem; }
  .brand strong { font-size: 1rem; letter-spacing: .08em; }
  .brand small { display: none; }
  .nav-caption, .sidebar-note, .sidebar-footer { display: none; }
  .main-nav { min-height: calc(74px + env(safe-area-inset-bottom, 0px)); position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: #fafaf5f5; border-top: 1px solid #e2e6d9; backdrop-filter: blur(14px); }
  .main-nav a { position: relative; flex-direction: column; justify-content: center; gap: 3px; min-height: 49px; padding: 3px; font-size: 0.875rem; line-height: 1.2; border-radius: 9px; }
  .main-nav a.active { color: var(--green); background: #eaf0e2; }
  .nav-icon { font-size: 1.35rem; }
  .nav-count { position: absolute; top: 0; right: 15%; min-width: 16px; background: #e1e8d6; font-size: 0.8125rem; line-height: 1.6; padding: 0 4px; }
  .active .nav-count { background: #ccd9bf; }
  .main-shell { margin-left: 0; }
  .topbar { height: 54px; padding: 0 20px; }
  .breadcrumb { font-size: .75rem; gap: 9px; }
  .font-control { gap: 4px; }
  .font-control select { font-size: 0.875rem; }
  .font-control > span { font-size: .875rem; }
  #main { padding: 15px 20px 18px; min-height: calc(100svh - 245px); }
  .page-heading { min-height: 0; margin: 6px 0 25px; }
  .page-heading .eyebrow { font-size: .75rem; margin-bottom: 12px; }
  .page-heading h1 { font-size: 1.75rem; letter-spacing: -.03em; line-height: 1.5; }
  .page-heading p { margin-top: 9px; font-size: 0.875rem; }
  .math-decoration { display: none; }
  .overview { padding: 17px 0; margin-bottom: 25px; }
  .stat-item { padding: 0 14px; }
  .stat-label { font-size: 0.8125rem; margin-bottom: 6px; }
  .stat-item > strong { font-size: 1.4rem; }
  .stat-item > small { font-size: 0.8125rem; display: block; margin: 4px 0 0; }
  .home-layout { grid-template-columns: minmax(0, 1fr); gap: 23px; }
  .section-heading { margin-bottom: 13px; }
  .section-heading h2 { font-size: 1rem; }
  .section-heading > span { font-size: 0.8125rem; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .topic-card { padding: 15px 12px; min-height: 111px; gap: 6px; flex-direction: column; border-radius: 11px; }
  .topic-symbol { width: 24px; height: 25px; min-width: 24px; font-size: 1.25rem; }
  .topic-name { font-size: 1rem; padding-right: 0; }
  .topic-desc { font-size: 0.875rem; margin-top: 3px; }
  .topic-stat { font-size: 0.8125rem; margin-top: 7px; }
  .topic-check { top: 9px; right: 10px; font-size: 0.8125rem; }
  .quiet-tip { padding-top: 13px; font-size: 0.875rem; }
  .practice-panel { position: static; padding: 21px; border-radius: 14px; }
  .practice-panel h2 { font-size: 1.125rem; }
  .setting-block { padding-top: 17px; }
  .setting-block h3 { font-size: 0.875rem; }
  .chips button { font-size: 0.875rem; }
  .mode-chips { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .toggle-row { margin-bottom: 10px; }
  .toggle-row > span { font-size: 0.875rem; }
  .toggle-row small { font-size: 0.875rem; }
  .practice-panel .panel-foot { text-align: left; font-size: 0.875rem; }
  .is-home .start-dock { position: fixed; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; z-index: 39; display: flex; gap: 13px; align-items: center; padding: 12px 20px; background: #fafaf5f5; border-top: 1px solid #e2e6d9; backdrop-filter: blur(14px); box-shadow: 0 -8px 28px #233d2705; }
  .is-home .start-summary { margin: 0; flex: 1; min-width: 0; font-size: 0.8125rem; line-height: 1.6; }
  .is-home .start-dock .button { width: auto; flex: 0 0 46%; max-width: 245px; min-height: 47px; padding: 11px 15px; }
  .page-footer { padding: 19px 20px calc(90px + env(safe-area-inset-bottom, 0px)); margin-top: 0; font-size: 0.75rem; gap: 5px; flex-direction: column; }
  .is-home .page-footer { padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px)); }
  .is-quiz .main-nav { display: none; }
  .is-quiz .sidebar { padding-top: 15px; }
  .is-quiz .topbar { height: 46px; }
  .is-quiz #main { padding-top: 0; }
  .is-quiz .page-footer { padding-bottom: 20px; }
  .quiz-view { margin-top: 5px; }
  .quiz-toolbar { margin-bottom: 13px; }
  .quiz-progress { font-size: 0.8125rem; gap: 8px; }
  .progress-track { margin-bottom: 17px; }
  .question-card { padding: 27px 21px 23px; border-radius: 17px; }
  .question-label { margin-bottom: 20px; }
  .question-text { font-size: 1.75rem; line-height: 1.6; }
  .question-note { margin: 10px 0 23px; }
  .answer-inputs { gap: 9px; }
  .answer-inputs input { font-size: 1.375rem; padding: 10px 8px; }
  .feedback { font-size: .875rem; min-height: 62px; margin: 14px 0; }
  .quiz-actions { gap: 8px; }
  .quiz-actions .button { padding: 11px 10px; }
  .input-help { font-size: 0.875rem; }
  .quiz-footer { margin: 17px 0; font-size: .75rem; }
  .result-hero { padding: 24px 20px; gap: 14px; }
  .result-summary h1 { font-size: 1.375rem; }
  .result-summary .eyebrow { font-size: .75rem; margin-bottom: 9px; }
  .result-summary p { font-size: 0.875rem; }
  .score-ring { width: 102px; height: 102px; flex-basis: 102px; border-width: 4px; }
  .score-ring strong { font-size: 1.75rem; }
  .score-ring > span, .score-ring small { font-size: 0.8125rem; }
  .result-stats { padding: 20px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .result-stats .stat-item:nth-child(3) { border-left: 0; padding-left: 0; }
  .result-stats .stat-item > strong { font-size: 1rem; }
  .result-actions { gap: 8px; margin: 17px 0 22px; }
  .result-actions .button { padding: 10px 13px; font-size: 0.875rem; }
  .collection-toolbar { gap: 11px; margin-bottom: 17px; }
  .collection-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 1rem; }
  .review-filters button { padding: 8px 12px; font-size: 0.875rem; }
  .review-card { padding: 14px 16px 18px; border-radius: 11px; }
  .review-question { font-size: 1rem; margin: 8px 0 10px; }
  .review-answer { font-size: 0.875rem; gap: 6px 16px; }
  .review-hint { font-size: 0.875rem; }
  .history-card { padding: 17px 15px; gap: 12px; }
  .history-icon { width: 36px; height: 36px; flex-basis: 36px; font-size: 1.25rem; }
  .history-info h3 { font-size: 1rem; }
  .history-info p { font-size: 0.8125rem; }
  .history-score strong { font-size: 1.125rem; }
  .history-arrow { display: none; }
  .empty-state { padding: 42px 20px 47px; }
  .empty-state h2 { font-size: 1rem; }
  .empty-state p { font-size: 0.875rem; }
  .table-section > summary { font-size: 1rem; padding: 16px; min-height: 58px; }
  .table-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); padding: 0 13px 16px; gap: 6px; }
  .table-cell { padding: 9px 6px; font-size: 0.875rem; }
  .table-note { padding: 0 16px 17px; font-size: 0.875rem; }
  .fraction-row { margin: 0 13px; font-size: 0.875rem; }
  .fraction-row:last-child { margin-bottom: 16px; }
  .storage-warning { margin: 8px 20px 12px; font-size: 0.875rem; padding: 12px; }
  .toast { left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); font-size: 0.875rem; width: max-content; }
  .is-home .toast { bottom: calc(168px + env(safe-area-inset-bottom, 0px)); }
  .is-quiz .toast { bottom: 24px; }
  dialog { padding: 26px 22px; }
}
@media (max-width: 360px) {
  .sidebar { padding-left: 15px; padding-right: 15px; }
  .topbar { padding-left: 15px; padding-right: 15px; }
  #main { padding-left: 15px; padding-right: 15px; }
  .page-heading h1 { font-size: 1.4375rem; }
  .stat-item { padding-left: 11px; padding-right: 11px; }
  .topic-card { padding: 13px 10px; }
  .question-card { padding: 23px 16px 20px; }
  .question-text { font-size: 1.5rem; }
  .is-home .start-dock { padding-left: 15px; padding-right: 15px; gap: 8px; }
  .is-home .start-dock .button { flex-basis: 48%; }
  .result-hero { padding: 20px 16px; }
  .result-summary h1 { font-size: 1.25rem; }
  .score-ring { width: 88px; height: 88px; flex-basis: 88px; }
  .score-ring strong { font-size: 1.375rem; }
  .history-icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.stat-item strong small { font-size: 0.8125rem; margin-left: 7px; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.history-info > small { display: block; color: var(--faint); font-size: 0.8125rem; margin-top: 4px; }
.collection-toolbar > label { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; font-size: 0.875rem; max-width: 100%; }
.score-ring strong small { margin-left: 2px; font-size: .9375rem; }
