:root { --panel: #142330; --zh-ink: #cfdee8; }
html[data-theme="light"] {
  color-scheme: light;
  --ink: #1b2e3d; --muted: #4c6374; --rule: #bccfd9;
  --accent: #075b79; --wash: #edf5f8; --paper: #fbfdfe;
  --canvas: #e2edf2; --panel: #f1f7fa; --zh-ink: #364f60;
}
.zh { color: var(--zh-ink); }
.figure, .answer { background: var(--panel); }
a:hover { color: var(--ink); }
.theme-tools { display: flex; justify-content: flex-end; margin: -1.5rem 0 1.2rem; }
#theme-toggle { background: var(--wash); color: var(--ink); border: 1px solid var(--accent); border-radius: .35rem; padding: .55rem .85rem; font: 600 .78rem Arial,sans-serif; cursor:pointer; }
#theme-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.course-page { max-width: 1080px; }
.course-page main { min-width: 0; }
.route-nav { display: flex; flex-wrap: wrap; gap: .8rem; text-transform: none; letter-spacing: 0; font-size: .82rem; }
.source-content { border-top: 1px solid var(--rule); margin-top: 2rem; padding-top: 1rem; }
.source-content h2 { scroll-margin-top: 1rem; }
.source-content h3 { font-size: 1.1rem; margin-top: 1.8rem; font-weight: 500; }
.source-content h3.zh { font-size: .96rem; margin-top: -.6rem; }
.source-content table, .course-page table { width: 100%; border-collapse: collapse; font: .88rem/1.45 Arial,sans-serif; margin: 1.3rem 0; }
.source-content td,.source-content th,.course-page td,.course-page th { text-align: left; vertical-align:top; border-bottom: 1px solid var(--rule); padding: .6rem; }
.course-page .equation { white-space: normal; font-size: 1.04rem; overflow-x: auto; padding: .25rem; }
.course-page .equation .katex-display { margin: .6rem 0; }
.course-page .formula-figure img { max-height: none; }
.source-content img { max-width: 100%; }
.source-content pre { overflow-x:auto; background: var(--wash); padding: 1rem; font-size: .75rem; }
.source-content code { font-size: .86em; }
.variable-map { font-family: Arial,sans-serif; font-size: .74rem; margin: .3rem 0; color:var(--muted); }
.section-toc { columns: 2; font: .82rem/1.5 Arial,sans-serif; margin: 1rem 0 2rem; }
.section-toc a { display: block; padding: .25rem 0; break-inside:avoid; }
.prepared { border: 1px solid var(--rule); padding: .25rem .45rem; display:inline-block; font-size:.72rem; }
.checklist { font-size: .9rem; }
.course-progress { border-left: 4px solid #83e5a4; }
.progress-cell { min-width: 9rem; }
.progress-status { display: inline-block; border: 1px solid currentColor; border-radius: .3rem; padding: .25rem .45rem; font-weight: 600; }
.progress-solved { color: #83e5a4; background: #123527; }
.progress-next { color: #92d7ff; background: #123047; }
.progress-pending { color: var(--muted); }
html[data-theme="light"] .course-progress { border-left-color: #17653b; }
html[data-theme="light"] .progress-solved { color: #17653b; background: #e5f7ec; }
html[data-theme="light"] .progress-next { color: #075b79; background: #e3f3fc; }
.chapter-problem .equation { text-align: center; }
.chapter-problem li { padding-bottom: .7rem; }
.source-line { color: var(--muted); font: .7rem Arial,sans-serif; }
.course-page .keyword { font-family:inherit; }
.conceptual-reference { margin: 1rem 0; }
html[data-theme="light"] .formula-figure img[src$=".svg"] { filter: invert(1) hue-rotate(180deg); }
html[data-theme="light"] .keyword { color: #734316; background:#fff0dc; }
@media(max-width:700px) {
 html { font-size:16px; } body { padding:2rem 1rem; } .section-toc { columns:1; }
 .course-page h1 { font-size:1.8rem; } .course-page table { display:block; overflow-x:auto; }
}
@media print {
 .theme-tools { display:none; } .course-page { max-width:none; }
 .course-page .equation { font-size:.95rem; }
 .course-page .formula-figure { break-inside:avoid; }
}
