:root {
  color-scheme: light;
  --paper: #f5f5f0;
  --white: #fff;
  --text: #192125;
  --muted: #536269;
  --line: #dce2df;
  --accent: #0d5b4e;
  --deep: #11483d;
  --green: #dbf7ad;
  --right: #e5f4e9;
  --wrong: #fbe8e5;
  --pending: #f8edc9;
  font: 16px/1.55 "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--paper);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #357ea0; outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
main.shell { padding: 30px 0 64px; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 69px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; background: var(--deep); color: var(--green); width: 36px; height: 36px; border-radius: 10px; }
.brand-mark i { position: relative; border: 2px solid currentColor; height: 13px; width: 17px; border-radius: 3px; }
.brand-mark i::before, .brand-mark i::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); background: currentColor; border-radius: 2px; }
.brand-mark i::before { bottom: -5px; height: 4px; width: 2px; }
.brand-mark i::after { bottom: -6px; height: 2px; width: 10px; }
nav { display: flex; gap: 6px; }
nav a { padding: 8px 13px; border-radius: 7px; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
nav a:hover, nav a[aria-current] { color: var(--deep); background: #e9f2ed; }
.hero { display: flex; position: relative; min-height: 282px; align-items: center; isolation: isolate; overflow: hidden; border-radius: 22px; background: var(--deep); color: var(--white); }
.hero-content { position: relative; padding: 31px 48px 34px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.15; letter-spacing: .035em; font-weight: 800; }
.hero p { color: #d3e8dc; margin: 14px 0 22px; letter-spacing: .075em; }
.hero-art { position: absolute; right: 0; inset-block: 0; z-index: -1; width: 52%; overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at 55% 54%, #327462 0%, transparent 68%); }
.hero-art::before { position: absolute; inset: -60px -40px -60px 40px; content: ""; opacity: .45; transform: skewY(-12deg); background-image: linear-gradient(#98c3a745 1px, transparent 1px), linear-gradient(90deg, #98c3a745 1px, transparent 1px); background-size: 37px 37px; mask-image: linear-gradient(90deg, transparent, black 24%, black 80%, transparent); }
.hero-art::after { position: absolute; width: 40%; height: 70%; inset: 14% auto auto 40%; content: ""; border: 1px solid #cbf6a575; border-left-color: transparent; border-radius: 50%; transform: rotate(-15deg); }
.hero-art i { position: absolute; border: 1px solid #c7eec3a8; background: #276659; height: 24px; width: 24px; border-radius: 7px; transform: rotate(-12deg); box-shadow: 0 0 24px #d9f7a840; }
.hero-art i:nth-child(1) { top: 23%; left: 44%; }
.hero-art i:nth-child(2) { top: 52%; left: 60%; background: #c9ed9f; width: 38px; height: 38px; }
.hero-art i:nth-child(3) { top: 37%; left: 77%; }
.hero-art i:nth-child(4) { top: 75%; left: 83%; height: 16px; width: 16px; border-radius: 5px; }
.hero-art i:nth-child(5) { top: 69%; left: 35%; height: 14px; width: 14px; border-radius: 4px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.button { display: inline-flex; min-height: 42px; justify-content: center; align-items: center; gap: 9px; padding: 8px 15px; border-radius: 8px; border: 1px solid transparent; font-weight: 650; font-size: 14px; white-space: nowrap; }
.hero-button { background: var(--green); color: #17362e; }
.hero-button:hover { background: #eafbca; }
.hero-outline { color: white; border-color: #9ac8b6; }
.hero-outline:hover { background: #ffffff19; }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: #08483e; }
.button-quiet { background: #fff; color: var(--accent); border-color: var(--line); }
.button-quiet:hover { background: #edf5ef; border-color: #b8cfc7; }
.dashboard-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 30px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.dashboard-stats > div { display: flex; min-width: 0; flex-direction: column; padding: 13px 22px; }
.dashboard-stats > div + div { border-left: 1px solid var(--line); }
.dashboard-stats > div > span, .dashboard-stats a { color: var(--muted); font-size: 13px; font-weight: 650; }
.dashboard-stats a { align-self: flex-start; }
.dashboard-stats a:hover { color: var(--accent); text-decoration: underline; }
.dashboard-stats strong { font-size: 27px; font-variant-numeric: tabular-nums; line-height: 1.4; }
.dashboard-stats small { color: var(--muted); font-size: 13px; font-weight: 550; white-space: nowrap; }
.section-heading, .page-heading, .practice-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading { margin-bottom: 13px; }
.section-heading h2 { font-size: clamp(21px, 4vw, 26px); }
.filter { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; color: var(--muted); }
select { min-height: 38px; padding: 4px 9px; color: var(--text); font-size: 14px; border: 1px solid #cdd8d2; border-radius: 8px; background: var(--white); }
.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.chapter-card, .surface { border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.chapter-card { padding: 16px 19px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 10px; }
.chapter-kicker { grid-column: 1 / -1; font-size: 12px; font-weight: 650; color: var(--accent); letter-spacing: .1em; }
.chapter-card h3 { grid-column: 1 / -1; font-size: 21px; margin: 4px 0 13px; }
.chapter-progress { display: grid; gap: 5px; align-self: center; }
.chapter-progress span { color: var(--muted); font-size: 12px; }
progress { appearance: none; width: 100%; height: 5px; display: block; color: var(--accent); background: #e9eeeb; border: 0; border-radius: 20px; overflow: hidden; }
progress::-webkit-progress-bar { background: #e9eeeb; }
progress::-webkit-progress-value { border-radius: 20px; background: var(--accent); }
progress::-moz-progress-bar { border-radius: 20px; background: var(--accent); }
.chapter-button { padding: 5px 10px; min-height: 34px; color: var(--deep); background: #ebf3ed; font-size: 13px; }
.chapter-button:hover { background: #d9eadf; }
.chapter-reset { grid-column: 1 / -1; justify-self: end; padding: 5px 1px 0; color: var(--muted); font-size: 13px; }
.chapter-reset:hover { color: var(--accent); text-decoration: underline; }
.page-heading { margin: 8px 0 24px; }
.page-heading h1 { font-size: clamp(27px, 5vw, 39px); line-height: 1.2; }
.page-heading p { margin-top: 9px; color: var(--muted); }
.practice-top { margin: 0 0 14px; min-height: 32px; }
.back-link { color: var(--accent); font-size: 14px; font-weight: 650; }
.back-link:hover { text-decoration: underline; }
.practice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 282px; gap: 15px; align-items: start; }
.question { min-width: 0; padding: 22px 28px 19px; }
.question-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.pill { color: var(--accent); background: #eaf4ec; border-radius: 5px; padding: 3px 8px; font-weight: 650; }
.question h1 { margin: 10px 0 5px; font-size: 27px; }
.rich { overflow-wrap: anywhere; white-space: pre-wrap; }
.rich p + p { margin-top: .45em; }
.stem { font-size: 17px; margin-bottom: 16px; }
.rich img { display: block; width: auto; height: auto; background: white; border-radius: 5px; margin: 8px 0; padding: 2px; }
.rich img.inline-diagram { display: inline-block; height: 1em; margin: 0 2px; padding: 0; vertical-align: -.12em; }
.rich sup, .rich sub { line-height: 0; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 8px 0; }
.rich table { width: 100%; border-collapse: collapse; white-space: normal; font-size: .93em; }
.rich th, .rich td { padding: 6px 10px; text-align: left; border: 1px solid #b9cac2; }
.rich th { background: #e4eee9; }
.choices { border: 0; margin: 0 0 15px; padding: 0; min-width: 0; display: grid; gap: 7px; }
.choice { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; }
.choice:has(input:checked) { border-color: #76a599; background: #edf7f1; }
.choice:has(input:focus-visible) { outline: 3px solid #357ea0; outline-offset: 2px; }
.choice input { margin: 0; accent-color: var(--accent); flex: none; }
.choices:disabled .choice { cursor: default; }
.choices .choice-right { background: var(--right); border-color: #9ac4a8; }
.choices .choice-wrong { background: var(--wrong); border-color: #dca8a2; }
.choice-mark { margin-left: auto; font-weight: 650; font-size: 12px; white-space: nowrap; }
.option-letter { font-weight: 750; font-size: 14px; flex: none; }
.option-content { min-width: 0; }
.option-content > span { display: block; }
.field-label { display: block; font-weight: 700; margin-bottom: 4px; }
.field-label span { color: var(--muted); font-weight: 400; }
textarea { width: 100%; min-height: 106px; resize: vertical; border-radius: 8px; border: 1px solid #bfcec5; padding: 8px 10px; margin-bottom: 7px; }
.saved-response { padding: 10px 12px; border-radius: 7px; background: #f3f4ef; margin-bottom: 12px; }
.saved-response p { white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback, .notice { padding: 11px 13px; border-radius: 8px; margin: 0 0 12px; }
.feedback > span { display: block; font-size: 14px; margin-top: 2px; }
.feedback h2 { font-size: 17px; margin-bottom: 5px; }
.feedback-right { background: var(--right); color: #18522d; }
.feedback-wrong { background: var(--wrong); color: #77362d; }
.feedback-reference { background: #edf4ef; }
.notice { background: var(--pending); color: #624c16; font-size: 14px; }
.grade-label { color: var(--accent); font-weight: 650; font-size: 14px; }
.question-nav { display: flex; justify-content: space-between; gap: 9px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.answer-sheet { padding: 18px; }
.answer-sheet h2 { font-size: 18px; }
.answer-sheet p { color: var(--muted); margin: 2px 0 9px; font-size: 13px; }
.sheet-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; max-height: 247px; overflow: auto; padding: 3px; margin: 12px 0; scrollbar-width: thin; }
.sheet-number { display: grid; align-items: center; justify-items: center; min-width: 0; min-height: 34px; border: 1px solid #dce3de; border-radius: 6px; font-size: 12px; font-weight: 650; }
.sheet-number:hover { border-color: var(--accent); }
.sheet-number[aria-current] { border: 2px solid var(--accent); }
.sheet-right { background: var(--right); }
.sheet-wrong { background: var(--wrong); }
.sheet-pending { background: var(--pending); }
.sheet-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.sheet-legend span::before { content: ""; display: inline-block; vertical-align: -1px; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; border: 1px solid #7a8e83; }
.legend-right::before { background: var(--right); }
.legend-wrong::before { background: var(--wrong); }
.legend-pending::before { background: var(--pending); }
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state p { margin-top: 8px; color: var(--muted); }
.empty-state .button { margin-top: 19px; }
.error-state h1 { font-size: 22px; }
.list-panel { overflow: hidden; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 13px 18px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.row-content { flex: 1; min-width: 0; }
.row-content h2 { font-size: 17px; }
.row-meta { display: block; color: var(--muted); font-size: 13px; }
.row-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; margin-top: 2px; }
.summary-stats { margin-bottom: 15px; }
.summary-row:hover { background: #f2f7f2; }
.summary-row:focus-visible { outline-offset: -3px; }
.summary-number { min-width: 25px; color: var(--muted); font-variant-numeric: tabular-nums; }
.result-label { color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
.result-right { color: #18522d; }
.result-wrong { color: #77362d; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.builder { max-width: 790px; padding: 23px 28px; }
.builder-group { border: 0; margin: 0 0 22px; padding: 0; min-width: 0; }
.builder-group legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.builder-group legend span { margin-left: 5px; font-size: 12px; color: var(--muted); font-weight: 500; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-chip, .check-label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.filter-chip { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; font-size: 14px; }
.filter-chip:has(input:checked) { border-color: #8eb2a4; background: #edf6f0; color: var(--deep); }
.filter-chip input, .check-label input { width: 15px; height: 15px; flex: none; accent-color: var(--accent); margin: 0; }
.text-button { padding: 4px 0; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 650; }
.builder-group .text-button { margin-top: 6px; }
.text-button:hover { text-decoration: underline; }
.quantity { max-width: 115px; min-height: 42px; border: 1px solid #bfcec5; border-radius: 8px; padding: 4px 9px; }
.builder-footer { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding-top: 17px; border-top: 1px solid var(--line); }
.builder-footer p { color: var(--muted); font-size: 14px; }
.builder-footer strong { color: var(--accent); }
button:disabled { opacity: .6; cursor: default; }
.filter-tabs { display: flex; gap: 5px; width: fit-content; max-width: 100%; margin-bottom: 13px; padding: 4px; border-radius: 9px; background: #e9eeea; }
.filter-tabs a { padding: 6px 12px; white-space: nowrap; border-radius: 6px; font-size: 14px; font-weight: 650; color: var(--muted); }
.filter-tabs a:hover, .filter-tabs a[aria-current] { background: var(--white); color: var(--deep); }
.filter-tabs a span { margin-left: 2px; font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; justify-self: end; align-items: center; min-height: 24px; padding: 2px 8px; border-radius: 6px; color: var(--deep); background: #e5f2e8; white-space: nowrap; font-size: 12px; font-weight: 675; }
.refine, .list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 13px; padding: 10px 13px; margin-bottom: 10px; }
.refine label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
.refine .button { min-height: 38px; }
.list-tools { justify-content: space-between; padding-left: 1px; padding-right: 0; }
.list-tools > .actions { margin-left: auto; }
.list-tools, [data-selection-count] { color: var(--muted); font-size: 14px; }
.history-row > .check-label { min-height: 30px; }
.button-danger { color: #803c32; background: var(--white); border-color: #e5c2bb; }
.button-danger:hover:not(:disabled) { background: #f8e9e6; }
.button-danger-solid { color: var(--white); background: #903d30; }
.button-danger-solid:hover { background: #793126; }
.confirmation-list { color: var(--muted); margin: 16px 0; padding-left: 20px; }
.reset-confirmation > .actions { margin-top: 16px; }
.review-guide { color: var(--muted); margin-bottom: 12px; font-size: 14px; }
.wrong-row > .actions { flex: none; }
.sheet-complete { background: #edf0ee; color: var(--muted); }
.sign-out { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.sign-out span { overflow-wrap: anywhere; }
.auth-shell { max-width: 520px; margin: 45px auto 0; }
.account-form { display: grid; gap: 15px; }
.account-form label { display: grid; gap: 5px; color: var(--muted); font-size: 14px; }
.account-form input, .account-entry input, .directory-search input { min-width: 0; min-height: 42px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--text); font: inherit; }
.account-form .button { justify-self: start; }
.account-entry { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 4px 16px; margin-bottom: 16px; padding: 13px 18px; }
.account-entry h2 { font-size: 15px; }
.account-link-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.account-entry input { flex: 1 0 220px; width: 100%; font-size: 14px; }
.account-entry p { grid-column: 2; color: var(--muted); font-size: 13px; }
.directory-top { padding: 17px 18px; background: #fafbf9; border-radius: 13px 13px 0 0; }
.directory-top .section-heading { margin-bottom: 10px; }
.directory-top .section-heading h2 { font-size: 20px; }
.directory-top p, .directory-empty, .directory-pages, .credential-note { color: var(--muted); font-size: 13px; }
.directory-search { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.directory-search input { width: min(235px, 100%); font-size: 14px; }
.directory-search select { min-height: 42px; }
.account-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(124px, max-content) auto; align-items: center; gap: 9px 18px; min-height: 62px; padding: 11px 18px; border-top: 1px solid var(--line); }
.account-row h3 { font-size: 16px; overflow-wrap: anywhere; }
.account-identity, .account-devices { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.account-role, .device-state { display: inline-block; border-radius: 5px; padding: 3px 7px; background: #edf0ee; color: var(--muted); font-size: 12px; white-space: nowrap; }
.device-state.is-signed-in { color: var(--deep); background: #e5f2e8; }
.account-operations { justify-content: flex-end; }
.account-operations .button, .password-actions .button { min-height: 35px; padding: 4px 8px; font-size: 13px; }
.directory-empty { padding: 26px 18px; border-top: 1px solid var(--line); }
.directory-pages { display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding: 10px 18px; }
.account-form .credential-note { margin: -6px 0 0; }
.device-dialog { width: min(420px, calc(100% - 32px)); padding: 23px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
.device-dialog::backdrop { background: #1923299e; }
.device-dialog p { margin: 10px 0 18px; }
@media (max-width: 800px) {
  .account-row { grid-template-columns: 1fr 1fr; }
  .account-devices { justify-content: flex-end; }
  .account-operations { grid-column: 1 / -1; }
  .shell { width: calc(100% - 34px); }
  .practice-layout { grid-template-columns: minmax(0, 1fr) 220px; }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question { padding: 19px; }
  .hero-content { padding-inline: 32px; }
}
@media (max-width: 590px) {
  .account-entry { grid-template-columns: minmax(0, 1fr); }
  .account-entry p { grid-column: 1; }
  .account-entry input { flex-basis: 165px; }
  .directory-search label:first-child { width: 100%; }
  .directory-search input { width: 100%; }
  .account-row { grid-template-columns: minmax(0, 1fr); }
  .account-devices, .account-operations { justify-content: flex-start; }
  .shell { width: calc(100% - 24px); }
  main.shell { padding-top: 17px; }
  .header-inner { gap: 4px; min-height: 58px; }
  .brand { font-size: 15px; gap: 5px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  nav { gap: 1px; }
  nav a { font-size: 12px; padding: 7px 5px; }
  .hero { min-height: 0; border-radius: 15px; }
  .hero-content { padding: 24px 18px; }
  .hero p { margin: 11px 0 16px; }
  .hero-art { opacity: .55; }
  .dashboard-stats { margin: 12px 0 23px; }
  .dashboard-stats > div { padding: 10px 8px; }
  .dashboard-stats > div > span, .dashboard-stats a, .dashboard-stats small { font-size: 11px; }
  .dashboard-stats strong { font-size: 20px; }
  .chapter-card { padding: 13px 12px; grid-template-columns: minmax(0, 1fr); }
  .chapter-card h3 { margin-bottom: 8px; font-size: 18px; }
  .chapter-button { justify-self: start; margin-top: 9px; }
  .practice-layout { grid-template-columns: minmax(0, 1fr); }
  .question { padding: 16px 12px; }
  .choice { gap: 6px; padding-inline: 8px; }
  .choice-mark { white-space: normal; min-width: 25px; }
  .answer-sheet .sheet-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .list-row { align-items: flex-start; padding-inline: 12px; }
  .list-row .actions { justify-content: flex-end; }
  .list-row .button { min-height: 32px; padding: 4px 7px; font-size: 12px; }
  .builder { padding: 16px 13px; }
  .chapter-card .status-pill { justify-self: start; margin-top: 9px; }
  .history-row { display: grid; grid-template-columns: auto 1fr; gap: 6px 11px; }
  .history-row > .actions { grid-column: 2; justify-content: flex-start; }
  .wrong-row { display: grid; }
  .wrong-row > .actions { justify-content: flex-start; }
  .header-inner:has(.sign-out) { flex-wrap: wrap; padding: 8px 0; gap: 5px; }
  .header-inner:has(.sign-out) nav { order: 1; width: 100%; flex-wrap: wrap; }
  .sign-out { margin-left: auto; }
  .auth-shell { margin-top: 22px; }
}
