@charset "UTF-8";

:root {
  color-scheme: light;
  --page: #f5f6fa;
  --surface: #ffffff;
  --ink: #202b45;
  --muted: #7d8599;
  --line: #e9ebf2;
  --primary: #6860df;
  --primary-dark: #5048c7;
  --primary-soft: #eeedfc;
  --mint: #e3f5ee;
  --mint-ink: #3d826c;
  --danger: #bd5265;
  --danger-soft: #fff2f3;
  --radius: 20px;
  --shadow: 0 5px 24px rgb(38 49 78 / 3%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.65; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, input, select, textarea { color: inherit; }
button { touch-action: manipulation; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
button, a, input, select, textarea, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid #b1aafa; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: middle; }
.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; }
.skip-link { position: fixed; left: 20px; top: 12px; z-index: 30; background: var(--ink); color: white; padding: 12px 20px; border-radius: 10px; clip-path: inset(50%); pointer-events: none; }
.skip-link:focus, .skip-link:focus-visible { clip-path: none; pointer-events: auto; visibility: visible; }
.app-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1480px; min-height: 96px; margin: 0 auto; padding: 20px 44px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; flex: 0 0 auto; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--primary); color: white; box-shadow: 0 4px 9px #6860df20; }
.brand-mark .icon { width: 25px; height: 25px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.4; gap: 3px; }
.brand-copy strong { font-size: 18px; letter-spacing: .4px; font-weight: 750; }
.brand-copy > span { font-size: 11px; color: var(--muted); letter-spacing: 1.5px; }
.main-nav { display: flex; gap: 5px; padding: 5px; border: 1px solid #f0f1f6; border-radius: 14px; background: #f8f9fc; }
.nav-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 15px; background: transparent; border: 0; border-radius: 10px; color: #737c91; white-space: nowrap; font-size: 13px; font-weight: 600; transition: background .16s, color .16s, box-shadow .16s; }
.nav-button .icon { width: 17px; height: 17px; }
.nav-button:hover { color: var(--primary); background: #eeedf8; }
.nav-button.is-active, .nav-button.active, .nav-button[aria-current="page"] { background: white; color: var(--primary); box-shadow: 0 2px 7px #26314e0c; }
.header-note { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #6bb69b; flex: 0 0 auto; }
.main-shell { max-width: 1420px; padding: 34px 38px 18px; margin: 0 auto; }
.dashboard-intro { display: flex; justify-content: space-between; align-items: center; gap: 28px; margin-bottom: 30px; }
.eyebrow { color: #85829e; font-size: 11px; font-weight: 600; letter-spacing: 1.4px; margin-bottom: 6px; }
.intro-copy h1 { font-size: clamp(24px, 2.3vw, 31px); font-weight: 730; line-height: 1.45; letter-spacing: -.7px; }
.intro-copy > p:last-child { color: var(--muted); font-size: 13px; margin-top: 8px; }
.learning-stats { display: flex; align-items: center; gap: 29px; }
.stat-item { display: flex; align-items: center; gap: 11px; }
.stat-item:not(:last-child) { padding-right: 28px; border-right: 1px solid #e1e4ed; }
.stat-item > div { display: flex; flex-direction: column; gap: 1px; }
.stat-item strong { font-size: 23px; line-height: 1.3; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-item div > span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.stat-icon { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 12px; }
.stat-icon-purple { background: #eae8fa; color: var(--primary); }
.stat-icon-mint { background: #e1f2ea; color: #589d83; }
.stat-icon-peach { background: #f8ecdf; color: #c69c6c; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.practice-layout { display: grid; grid-template-columns: 344px minmax(0, 1fr); align-items: start; gap: 24px; }
.settings-panel { padding: 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.panel-heading h2 { font-size: 20px; font-weight: 700; }
.panel-heading .eyebrow { font-size: 10px; margin-bottom: 2px; }
.heading-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: #f4f3fc; color: #8b83d8; }
.heading-icon .icon { width: 19px; height: 19px; }
.settings-section + .settings-section { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.section-label { display: flex; align-items: center; gap: 8px; margin-bottom: 17px; }
.section-label h3 { font-size: 13px; font-weight: 650; }
.step-number { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 6px; color: var(--primary); background: var(--primary-soft); font-size: 10px; font-weight: 700; }
.subject-label { font-size: 10px; margin-left: auto; color: #848ca0; background: #f5f6fa; padding: 1px 8px; border-radius: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label, fieldset legend, .quantity-row > label { font-size: 12px; font-weight: 600; }
select, input[type="number"], textarea { border: 1px solid #e1e4ee; border-radius: 9px; background-color: #fdfdff; transition: border-color .16s, box-shadow .16s; }
select { min-height: 41px; width: 100%; padding: 8px 31px 8px 11px; font-size: 12px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23808a9e' stroke-width='1.5' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select:hover, input:hover, textarea:hover { border-color: #bfc3d5; }
select:focus, input:focus, textarea:focus { border-color: #8d85e7; }
input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; margin: 0; flex: 0 0 auto; cursor: pointer; }
.topic-fieldset { margin-top: 18px; }
.label-hint { font-weight: 400; color: var(--muted); font-size: 10px; margin-left: 5px; }
.topic-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.topic-chip, .topic-option { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid #e7e8f0; border-radius: 8px; background: #fafbfe; font-size: 11px; line-height: 1.45; cursor: pointer; transition: background .16s, border-color .16s; }
.topic-chip:hover, .topic-option:hover { border-color: #bcb6ef; }
.topic-chip:has(input:checked), .topic-option:has(input:checked), .topic-chip.selected, .topic-option.selected, .topic-chip.is-active, .topic-option.is-active { background: var(--primary-soft); border-color: #bdb7ee; color: #6056bc; }
.topic-chip input, .topic-option input { width: 12px; height: 12px; }
.field-hint, .loading-hint { font-size: 10px; color: var(--muted); line-height: 1.75; margin-top: 8px; }
.difficulty-fieldset legend { margin-bottom: 8px; }
.difficulty-options { display: flex; background: #f4f5fa; padding: 4px; border-radius: 10px; gap: 4px; }
.difficulty-option { flex: 1; min-height: 35px; border: 1px solid transparent; background: transparent; border-radius: 7px; font-size: 12px; color: var(--muted); transition: background .16s, color .16s; }
.difficulty-option:hover { background: #eceaf9; color: var(--primary); }
.difficulty-option.is-active, .difficulty-option.active, .difficulty-option[aria-pressed="true"] { color: var(--primary); border-color: #e4e0f7; background: white; box-shadow: 0 2px 5px #202b4507; font-weight: 650; }
.quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.quantity-input { position: relative; width: 105px; }
.quantity-input input { width: 100%; min-height: 39px; padding: 7px 33px 7px 12px; font-size: 13px; font-variant-numeric: tabular-nums; appearance: textfield; }
.quantity-input input::-webkit-inner-spin-button, .quantity-input input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.quantity-input > span { position: absolute; top: 8px; right: 12px; font-size: 12px; color: var(--muted); pointer-events: none; }
.checkbox-row { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 11px; color: #6e778d; margin-top: 13px; }
.checkbox-row input { width: 13px; height: 13px; }
.generate-area { margin-top: 21px; }
.settings-summary { font-size: 10px; color: #84829e; margin-bottom: 9px; line-height: 1.7; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 600; line-height: 1.45; text-decoration: none; transition: background .16s, border-color .16s, box-shadow .16s; }
.button .icon { width: 16px; height: 16px; }
.button-primary { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 9px #6860df13; }
.button-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 5px 13px #6860df2a; }
.button-secondary { background: white; border-color: #e1e3ed; color: #5f6783; }
.button-secondary:hover:not(:disabled) { background: #f7f6fe; border-color: #bfb9ed; color: var(--primary); }
.button-ghost { background: transparent; color: #7e8599; }
.button-ghost:hover:not(:disabled) { background: #f1f0fa; color: var(--primary); }
.button-small { min-height: 34px; padding: 6px 9px; font-size: 11px; }
.button-wide { width: 100%; }
#generate-button { min-height: 46px; font-size: 13px; }
#generate-button > .icon:first-child { width: 18px; height: 18px; }
#generate-button .arrow-icon { margin-left: auto; }
#generate-button > span { margin-right: auto; }
.quick-request { margin-top: 22px; padding-top: 19px; border-top: 1px dashed #e2e4ee; }
.quick-request > label { display: flex; align-items: center; gap: 6px; color: #777f95; font-size: 10px; }
.quick-request label .icon { width: 13px; height: 13px; }
textarea { display: block; width: 100%; resize: vertical; min-height: 68px; max-height: 180px; padding: 10px 11px; margin-top: 9px; font-size: 11px; line-height: 1.8; }
textarea::placeholder { color: #9ba1b2; }
#parse-request-button { min-height: 35px; font-size: 11px; margin-top: 8px; }
.worksheet-panel { overflow: hidden; }
.worksheet-topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 19px 27px; border-bottom: 1px solid var(--line); }
.paper-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #68728a; font-weight: 600; }
.paper-label .icon { width: 16px; height: 16px; color: #958cd2; }
.badge, .tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 6px; font-size: 10px; line-height: 1.5; background: var(--primary-soft); color: #7167bd; }
.badge-mint { background: var(--mint); color: var(--mint-ink); }
.worksheet-title-block { margin: 31px 30px 0; }
.worksheet-title-block h2 { font-size: 23px; font-weight: 700; letter-spacing: -.3px; }
.text-muted { color: var(--muted); font-size: 12px; }
.worksheet-title-block p { margin-top: 6px; line-height: 1.9; }
.worksheet-empty { display: flex; flex-direction: column; align-items: center; padding: 45px 28px 64px; text-align: center; }
.sample-paper { position: relative; width: 282px; padding: 23px 24px 24px; border: 1px solid #e5e3f0; border-radius: 13px; background: white; transform: rotate(-3deg); box-shadow: 12px 12px 0 #f2f1fa, 0 8px 26px #333c5d08; margin-bottom: 42px; }
.sample-paper-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 13px; margin-bottom: 3px; border-bottom: 1px solid #edecf5; }
.sample-label { font-size: 10px; color: #8b879e; letter-spacing: 1px; }
.sample-dots { display: flex; gap: 4px; }
.sample-dots i { width: 4px; height: 4px; border-radius: 50%; background: #d7d3ed; }
.sample-equation { display: flex; align-items: center; gap: 15px; height: 49px; font-family: "Segoe UI", sans-serif; font-size: 19px; font-weight: 550; letter-spacing: .7px; }
.sample-number { color: #bab4d2; font-size: 10px; font-weight: 500; }
.sample-answer { margin-left: auto; width: 41px; height: 29px; border-radius: 6px; border: 1px dashed #d6d2e9; background: #faf9fe; }
.paper-sticker { position: absolute; right: -17px; bottom: 18px; display: grid; place-items: center; width: 44px; height: 44px; border: 5px solid white; border-radius: 14px; background: #d9f2e8; color: #5b9a80; transform: rotate(12deg); box-shadow: 0 3px 9px #326b500b; }
.paper-sticker .icon { width: 25px; height: 25px; stroke-width: 2.6; }
.worksheet-empty h3 { font-size: 16px; font-weight: 650; }
.worksheet-empty > p { font-size: 12px; color: var(--muted); margin-top: 8px; }
.workflow-hints { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; color: #8b91a4; font-size: 10px; }
.workflow-hints > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.workflow-hints i { display: grid; place-items: center; width: 17px; height: 17px; font-size: 9px; font-style: normal; background: #f1f0f8; color: #9a92c2; border-radius: 50%; }
.workflow-hints > .icon { width: 12px; height: 12px; color: #c8cbda; }
.worksheet-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 26px 28px 28px; }
.worksheet-body:empty { display: none; }
.question-card { padding: 17px 17px 15px; border: 1px solid #e7e8f1; border-radius: 12px; background: #fdfdff; min-width: 0; }
.question-number { display: inline-block; color: #a1a7b8; font-size: 10px; font-weight: 600; margin-bottom: 9px; }
.question-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.question-top .question-number { margin: 3px 0 0; flex: 0 0 auto; }
.question-top .tag { max-width: calc(100% - 28px); text-align: right; justify-content: flex-end; font-size: 9px; padding: 3px 7px; }
.question-expression { font-size: 18px; font-weight: 550; line-height: 1.7; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.math-fraction { display: inline-flex; flex-direction: column; align-items: stretch; justify-content: center; vertical-align: middle; min-width: .85em; margin: .13em .14em; line-height: 1.15; text-align: center; white-space: nowrap; overflow-wrap: normal; word-break: keep-all; font-variant-numeric: tabular-nums; }
.fraction-numerator, .fraction-denominator { display: block; padding: .06em .18em; white-space: nowrap; }
.fraction-numerator { border-bottom: 1px solid currentColor; padding-bottom: .12em; }
.fraction-denominator { padding-top: .12em; }
.answer-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; color: #6c7590; font-size: 12px; }
.answer-label { display: flex; align-items: center; gap: 9px; margin-top: 12px; color: #858ba0; font-size: 11px; }
.answer-input { width: min(100%, 160px); min-height: 41px; border: 1px solid #dfe1ee; border-radius: 8px; padding: 8px 11px; background: white; font-size: 16px; font-variant-numeric: tabular-nums; }
.answer-label .answer-input { width: 0; flex: 1 1 auto; min-width: 0; max-width: 180px; }
.answer-input::placeholder { color: #b5b9c8; font-size: 12px; }
.answer-input:disabled { opacity: 1; color: var(--ink); background: #f7f8fb; }
.question-card.is-correct { border-color: #c2e6d7; background: #f6fcf9; }
.question-card.is-correct .answer-input { border-color: #b1d7c6; }
.question-card.is-incorrect { border-color: #edc6cc; background: var(--danger-soft); }
.question-card.is-incorrect .answer-input { border-color: #daa6b0; }
.question-card.is-unanswered, .question-card.is-invalid { border-color: #e9d6b1; background: #fffaf1; }
.question-card.is-invalid .answer-input { border-color: #cfa76b; }
.detail-note { color: #7e8293; font-size: 11px; line-height: 1.9; margin-top: 9px; overflow-wrap: anywhere; }
.question-card.is-incorrect .detail-note { color: #a25365; }
.question-card.is-correct .detail-note { color: #45836a; }
.question-result { margin-top: 11px; font-size: 11px; line-height: 1.85; color: #7e8293; overflow-wrap: anywhere; }
.is-correct .question-result { color: #45836a; }
.is-incorrect .question-result { color: #a25365; }
.is-unanswered .question-result, .is-invalid .question-result { color: #a17b43; }
.question-explanation { margin-top: 8px; color: #69738b; font-size: 11px; line-height: 1.9; }
.question-explanation summary { cursor: pointer; color: #7b72bc; padding: 3px 0; width: fit-content; }
.question-explanation summary:hover { color: var(--primary-dark); }
.question-explanation summary::marker { font-size: 9px; }
.question-explanation p { padding-top: 7px; overflow-wrap: anywhere; }
.worksheet-feedback, .result-summary { margin: 21px 28px 0; padding: 13px 16px; border-radius: 10px; font-size: 12px; line-height: 1.85; background: #f2f0fc; color: #756bb1; overflow-wrap: anywhere; }
.worksheet-feedback:empty, .result-summary:empty { display: none; }
.worksheet-feedback.error, .worksheet-feedback.is-error { background: #fff1f2; color: #ad5265; }
.result-summary { background: #edf8f3; color: #477e68; }
.result-summary strong { font-size: 15px; }
.result-summary p + p { margin-top: 5px; }
.result-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.result-banner > strong { flex-basis: 100%; margin-bottom: 2px; }
.result-banner > span { font-size: 11px; }
.worksheet-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 20px 28px; border-top: 1px solid var(--line); }
.action-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.worksheet-footer { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 15px 24px; background: #fcfcfe; border-top: 1px solid var(--line); color: #9a9faf; font-size: 10px; }
.worksheet-footer .status-dot { width: 5px; height: 5px; background: #a6c5b8; }
.collection-panel { padding: 30px; min-height: 520px; }
.collection-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; padding-bottom: 26px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.collection-heading h2 { font-size: 23px; }
.collection-heading .text-muted { margin-top: 5px; }
.collection-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.collection-actions select { width: auto; min-width: 105px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; padding: 36px 20px; text-align: center; grid-column: 1 / -1; }
.empty-state h3 { font-size: 17px; margin-top: 17px; }
.empty-state p { color: var(--muted); font-size: 12px; margin-top: 9px; max-width: 410px; }
.empty-icon { display: grid; place-items: center; width: 66px; height: 66px; color: #9991cf; background: #f1effa; border-radius: 20px; }
.empty-icon .icon { width: 29px; height: 29px; }
.mistake-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mistake-card { padding: 21px; border: 1px solid #e6e7f0; border-radius: 13px; background: #fdfdff; min-width: 0; }
.mistake-card > header, .history-item > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.mistake-card h3, .history-item h3 { font-size: 15px; }
.mistake-card p + p { margin-top: 7px; }
.mistake-card .question-expression { margin: 10px 0; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.card-actions .button { min-height: 34px; font-size: 11px; padding: 7px 10px; }
.history-list { display: grid; gap: 12px; }
.history-item { padding: 21px 23px; border: 1px solid #e6e7f0; border-radius: 13px; background: #fdfdff; }
.history-item > header { margin-bottom: 7px; }
.history-item .card-actions { margin-top: 12px; }
.curriculum-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 17px; }
.curriculum-notice { grid-column: 1 / -1; padding: 14px 17px; border: 1px solid #e5e2f3; border-radius: 10px; background: #f7f6fc; color: #867d9f; font-size: 11px; line-height: 1.95; }
.curriculum-grade { border: 1px solid #e5e6f0; border-radius: 13px; overflow: hidden; min-width: 0; }
.curriculum-grade > h3, .curriculum-grade > header, .curriculum-grade > summary { padding: 15px 18px; font-size: 15px; font-weight: 650; background: #f6f5fd; border-bottom: 1px solid #e8e5f4; }
.curriculum-grade > h3 { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.curriculum-grade > h3 .tag { font-size: 9px; font-weight: 500; }
.curriculum-grade > summary { cursor: pointer; }
.curriculum-grade > ul { list-style: none; padding: 12px 16px; margin: 0; }
.curriculum-grade > .text-muted { padding: 10px 17px 0; }
.curriculum-topic { margin: 0; padding: 13px 17px; font-size: 12px; }
.curriculum-topic + .curriculum-topic { border-top: 1px solid #efeff5; }
.curriculum-topic h4 { font-size: 12px; margin: 0; font-weight: 650; }
.curriculum-topic p { margin-top: 5px; font-size: 10px; color: var(--muted); line-height: 1.8; }
.curriculum-topic .tag { margin-top: 7px; }
.app-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 23px 3px 0; color: #979cac; font-size: 10px; }
.backup-actions { display: flex; align-items: center; gap: 6px; }
.backup-actions .button { color: #979cac; }
.backup-actions .icon { width: 13px; height: 13px; }
.storage-status { margin: 0 0 22px; padding: 14px 18px; background: #fff6e7; border: 1px solid #ecd5ac; border-radius: 12px; color: #966d31; font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.storage-status strong { font-weight: 650; }
.storage-status .button { margin: 8px 7px 0 0; }
.storage-status:empty { display: none; }
.toast { position: fixed; z-index: 50; bottom: 28px; left: 50%; transform: translateX(-50%); max-width: min(620px, calc(100vw - 32px)); padding: 13px 20px; border-radius: 12px; background: #303b55; color: white; box-shadow: 0 8px 30px #202b4533; font-size: 13px; line-height: 1.8; }
.print-root { display: none; }

@media (min-width: 1600px) {
  .main-shell { padding-top: 42px; }
  .practice-layout { grid-template-columns: 360px minmax(0, 1fr); gap: 28px; }
  .settings-panel { padding: 28px; }
  .worksheet-empty { padding-top: 62px; padding-bottom: 79px; }
}

@media (max-width: 1150px) {
  .header-inner { padding-left: 26px; padding-right: 26px; }
  .header-note { display: none; }
  .main-shell { padding-left: 25px; padding-right: 25px; }
  .dashboard-intro { gap: 20px; }
  .learning-stats { gap: 16px; }
  .stat-item { gap: 8px; }
  .stat-item:not(:last-child) { padding-right: 16px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .stat-icon .icon { width: 17px; height: 17px; }
  .stat-item strong { font-size: 20px; }
  .practice-layout { grid-template-columns: 316px minmax(0, 1fr); gap: 20px; }
  .settings-panel { padding: 22px; }
  .worksheet-topbar { padding: 18px 23px; }
  .worksheet-title-block { margin-left: 24px; margin-right: 24px; }
  .worksheet-body { margin-left: 22px; margin-right: 22px; gap: 10px; }
  .question-card { padding: 14px; }
  .question-expression { font-size: 17px; }
  .worksheet-actions { padding-left: 22px; padding-right: 22px; }
  .curriculum-content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: 18px; padding-top: 19px; padding-bottom: 16px; }
  .main-nav { margin-left: auto; }
  .nav-button { padding-left: 10px; padding-right: 10px; gap: 6px; font-size: 12px; }
  .brand-copy strong { font-size: 16px; }
  .brand-mark { width: 41px; height: 41px; border-radius: 12px; }
  .dashboard-intro { align-items: flex-start; }
  .learning-stats { gap: 15px; padding-top: 9px; }
  .stat-item:not(:last-child) { padding-right: 14px; }
  .stat-icon { display: none; }
  .intro-copy h1 { font-size: 25px; }
  .intro-copy > p:last-child { font-size: 11px; }
  .practice-layout { grid-template-columns: 295px minmax(0, 1fr); gap: 16px; }
  .settings-panel { padding: 20px; }
  .worksheet-topbar { padding: 16px 20px; flex-wrap: wrap; gap: 7px; }
  .worksheet-topbar .badge { font-size: 9px; }
  .worksheet-title-block h2 { font-size: 20px; }
  .worksheet-empty { padding-left: 18px; padding-right: 18px; }
  .sample-paper { width: 230px; padding: 18px; }
  .sample-equation { font-size: 17px; gap: 12px; }
  .sample-answer { width: 33px; }
  .workflow-hints { gap: 6px; font-size: 9px; }
  .workflow-hints > .icon { width: 10px; }
  .worksheet-body { grid-template-columns: 1fr; }
  .question-expression { font-size: 19px; }
  .collection-panel { padding: 25px; }
}

@media (max-width: 700px) {
  .header-inner { padding: 17px 20px 12px; gap: 17px; }
  .brand-copy strong { font-size: 18px; }
  .brand-copy > span { font-size: 10px; }
  .brand-mark { width: 43px; height: 43px; }
  .main-nav { width: 100%; margin-left: 0; justify-content: space-between; gap: 1px; padding: 4px; }
  .nav-button { flex: 1; padding: 9px 5px; min-height: 40px; font-size: 11px; gap: 5px; }
  .nav-button .icon { width: 15px; height: 15px; }
  .main-shell { padding: 26px 18px 16px; }
  .dashboard-intro { flex-direction: column; gap: 22px; margin-bottom: 23px; }
  .intro-copy h1 { font-size: 26px; }
  .intro-copy > p:last-child { font-size: 12px; }
  .learning-stats { width: 100%; justify-content: space-between; padding: 0; gap: 10px; }
  .stat-item { flex: 1; gap: 9px; }
  .stat-item:not(:last-child) { padding-right: 10px; }
  .stat-icon { display: grid; width: 33px; height: 33px; border-radius: 10px; }
  .stat-item strong { font-size: 20px; }
  .stat-item div > span { font-size: 9px; }
  .practice-layout { grid-template-columns: 1fr; gap: 20px; }
  .settings-panel { padding: 24px; }
  .panel-heading { margin-bottom: 22px; }
  .panel-heading h2 { font-size: 21px; }
  .section-label h3 { font-size: 14px; }
  .field label, fieldset legend, .quantity-row > label { font-size: 13px; }
  select { font-size: 14px; min-height: 44px; }
  .topic-chip, .topic-option { padding: 9px 11px; font-size: 12px; min-height: 38px; }
  .topic-chip input, .topic-option input { width: 14px; height: 14px; }
  .field-hint { font-size: 11px; }
  .difficulty-option { min-height: 40px; font-size: 13px; }
  .checkbox-row { font-size: 12px; min-height: 32px; }
  .checkbox-row input { width: 15px; height: 15px; }
  .quantity-input input { min-height: 43px; font-size: 16px; }
  .quantity-input > span { top: 10px; }
  .settings-summary { font-size: 11px; }
  #generate-button { min-height: 49px; font-size: 14px; }
  .quick-request > label { font-size: 11px; }
  textarea { font-size: 16px; }
  textarea::placeholder { font-size: 12px; }
  #parse-request-button { min-height: 42px; font-size: 12px; }
  .worksheet-topbar { padding: 18px 23px; }
  .worksheet-title-block { margin-top: 25px; }
  .worksheet-title-block h2 { font-size: 22px; }
  .sample-paper { width: 265px; padding: 21px; }
  .sample-equation { font-size: 19px; gap: 15px; }
  .sample-answer { width: 41px; }
  .worksheet-empty { padding-top: 38px; padding-bottom: 43px; }
  .worksheet-empty h3 { font-size: 16px; }
  .workflow-hints { font-size: 10px; gap: 10px; }
  .worksheet-body { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 23px 20px; }
  .question-expression { font-size: 17px; }
  .worksheet-actions { padding: 18px 20px; }
  .worksheet-actions .button { min-height: 43px; font-size: 12px; }
  .worksheet-feedback, .result-summary { margin-left: 20px; margin-right: 20px; }
  .collection-panel { padding: 23px 20px; min-height: 450px; }
  .collection-heading { gap: 18px; padding-bottom: 21px; }
  .collection-heading h2 { font-size: 23px; }
  .collection-actions { gap: 8px; }
  .collection-actions .button { padding: 10px 12px; min-height: 43px; }
  .collection-actions select { min-width: 103px; font-size: 12px; }
  .mistake-list { grid-template-columns: 1fr; }
  .curriculum-content { grid-template-columns: 1fr; gap: 13px; }
  .curriculum-topic { font-size: 13px; }
  .app-footer { flex-direction: column; text-align: center; gap: 8px; padding-top: 23px; }
  .app-footer p { font-size: 10px; }
  .backup-actions .button { min-height: 40px; }
}

@media (max-width: 380px) {
  .header-inner { padding-left: 14px; padding-right: 14px; }
  .main-shell { padding-left: 12px; padding-right: 12px; }
  .nav-button { gap: 4px; font-size: 10px; }
  .nav-button .icon { width: 14px; height: 14px; }
  .stat-icon { width: 27px; height: 30px; }
  .stat-item { gap: 6px; }
  .stat-item:not(:last-child) { padding-right: 7px; }
  .settings-panel { padding: 20px; }
  .worksheet-body { grid-template-columns: 1fr; }
  .question-expression { font-size: 20px; }
  .sample-paper { width: 245px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@page { size: A4 portrait; margin: 15mm 13mm; }
@media print {
  html, body { background: white !important; color: black !important; margin: 0 !important; padding: 0 !important; width: auto !important; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
  body > :not(#print-root) { display: none !important; }
  #print-root { display: block !important; color: black; font-size: 11pt; line-height: 1.8; }
  #print-root * { box-shadow: none !important; text-shadow: none !important; color: black !important; }
  #print-root h1 { font-size: 20pt; line-height: 1.5; text-align: center; margin: 0 0 5mm; }
  #print-root h2 { font-size: 17pt; line-height: 1.5; text-align: center; margin: 0 0 5mm; }
  #print-root h3 { font-size: 12pt; margin: 4mm 0 2mm; }
  #print-root .print-header, #print-root header { margin-bottom: 7mm; break-inside: avoid; }
  #print-root .print-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3mm 7mm; font-size: 9pt; margin: 3mm 0; }
  #print-root .print-name-line, #print-root .print-student-info { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5mm; padding: 3mm 0; margin-top: 4mm; }
  #print-root .print-grid, #print-root .print-questions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5mm 9mm; margin: 0; padding: 0; list-style: none; }
  #print-root .print-question, #print-root .question-card, #print-root .print-item, #print-root li { break-inside: avoid; page-break-inside: avoid; }
  #print-root .print-question, #print-root .print-item { min-width: 0; min-height: 17mm; padding: 3mm 1mm; font-size: 12pt; line-height: 1.9; overflow-wrap: anywhere; }
  #print-root .print-question::marker { content: ""; }
  #print-root .print-number { font-size: 9pt; margin-right: 2mm; }
  #print-root .question-card { background: white !important; border: none !important; border-radius: 0; padding: 3mm 1mm; min-height: 17mm; }
  #print-root .question-number { color: black; font-size: 9pt; margin-right: 3mm; }
  #print-root .question-expression { font-size: 12pt; }
  #print-root .math-fraction { display: inline-flex; flex-direction: column; vertical-align: middle; break-inside: avoid; page-break-inside: avoid; }
  #print-root .fraction-numerator { border-bottom: .7pt solid black !important; }
  #print-root .answer-blank { display: inline-block; min-width: 20mm; min-height: 7mm; border-bottom: 1px solid #555; }
  #print-root .print-answer { display: block; margin-top: 2mm; font-size: 10pt; font-weight: 650; }
  #print-root .print-answer-space { display: inline-block; min-width: 24mm; min-height: 7mm; margin-left: 2mm; white-space: nowrap; }
  #print-root .print-explanation { margin-top: 2mm; font-size: 8.5pt; line-height: 1.85; overflow-wrap: anywhere; }
  #print-root .with-answers .print-question { min-height: 0; }
  #print-root .print-note, #print-root .text-muted, #print-root .detail-note { font-size: 9pt; }
  #print-root .print-footer { margin-top: 7mm; padding-top: 3mm; border-top: 1px solid #ccc; font-size: 8pt; }
  #print-root .print-page + .print-page, #print-root .print-sheet + .print-sheet, #print-root .answer-sheet { break-before: page; page-break-before: always; }
  #print-root .print-page:first-child, #print-root .print-sheet:first-child, #print-root .answer-sheet:first-child { break-before: auto; page-break-before: auto; }
  #print-root .print-title, #print-root h1, #print-root h2, #print-root h3 { break-after: avoid; }
  #print-root button { display: none !important; }
}

.topic-group { min-width: 0; width: 100%; padding: 0; margin: 0 0 12px; border: 0; }
.topic-group legend { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.topic-group-options { display: flex; flex-wrap: wrap; gap: 7px; }
.topic-controls { display: flex; width: 100%; gap: 12px; margin-bottom: 8px; }
.topic-controls button { border: 0; background: transparent; color: var(--primary); padding: 2px 0; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.audit-overview { grid-column: 1 / -1; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.audit-overview > p { color: var(--muted); margin: 10px 0 16px; }
.audit-report { border-top: 1px solid var(--line); padding: 14px 0; }
.audit-report summary { font-weight: 650; cursor: pointer; }
.audit-books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 16px 0; font-size: 12px; }
.audit-table-wrap { overflow-x: auto; }
.audit-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.audit-table th, .audit-table td { padding: 12px 10px; vertical-align: top; border-bottom: 1px solid var(--line); min-width: 120px; }
.audit-table th { background: #f5f6fb; }
.audit-table small { display: block; color: var(--muted); margin-top: 5px; }
.audit-overview a { color: var(--primary); }
@media (max-width: 700px) { .audit-overview { padding: 16px; } .audit-books { grid-template-columns: 1fr; } }

.practice-mode-field { margin: 16px 0; }
.process-question { grid-column: 1 / -1; }
.process-field { margin: 16px 0; min-width: 0; }
.process-field > label { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.process-instruction { margin: 6px 0 9px; color: #505a72; font-size: 13px; }
.process-input { display: block; width: 100%; min-height: 104px; resize: vertical; padding: 12px 14px; border: 1px solid #cbd1e3; border-radius: 10px; background: #fff; font-size: 17px; line-height: 1.75; letter-spacing: .3px; }
.process-input:focus { border-color: var(--primary); }
.process-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0 5px; }
.process-toolbar button { width: 36px; min-height: 33px; border: 1px solid #dddff0; border-radius: 7px; background: #fff; color: var(--primary-dark); font-size: 17px; }
.process-toolbar button:hover { background: var(--primary-soft); }
.process-input-help, .structure-evidence-note { font-size: 12px; color: #626d84; }
.structure-evidence-note { margin: 12px 0; }
.process-feedback { margin: 9px 0; padding: 12px 14px; background: #fff; border-radius: 9px; border: 1px solid var(--line); font-size: 13px; }
.process-feedback p + p { margin-top: 4px; }
.process-step-list { margin: 10px 0 0; padding-left: 20px; }
.process-step-list li { padding: 4px 0; overflow-wrap: anywhere; }
.process-step-list small { display: block; color: #646e81; }
.step-incorrect, .step-incorrect small { color: var(--danger); }
.step-correct { color: var(--mint-ink); }
.reference-process { margin: 8px 0; font-size: 16px; }
.reference-process p { padding: 3px 0; }
.result-banner.needs-attention { background: #fff7e9; color: #755723; }
.mistake-kind { margin: 8px 0; color: var(--danger); font-weight: 650; }
.mistake-process { padding: 12px; margin: 12px 0; background: #f6f7fc; border-radius: 10px; }
.mistake-process pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; margin: 6px 0 0; }
.print-process-lines > div { height: 28px; border-bottom: 1px solid #bbb; }
@media (max-width: 700px) {
  .process-toolbar button { width: 34px; min-height: 38px; }
  .process-input { font-size: 16px; padding: 10px; }
  .process-question .question-expression { font-size: 19px; }
}
@media print {
  #print-root .with-process { grid-template-columns: 1fr; gap: 4mm; }
  #print-root .print-process-instruction { font-size: 9pt; line-height: 1.6; margin-top: 3mm; }
  #print-root .print-process-lines { margin: 1mm 0 3mm; }
  #print-root .print-process-lines > div { height: 8mm; border-bottom: .6pt solid #bbb; }
  #print-root .print-process-answer { font-size: 10pt; margin-top: 2mm; }
}
