/* Classroom interface tokens. Stimulus colors and mathematical channel colors
   are defined by their scientific models, not by this interface palette. */
:root {
  color-scheme:light;
  --paper:#f5f5f7; --panel:#fff; --ink:#1d1d1f; --muted:#626269;
  --line:#dedee3; --accent:#0066cc; --accent-light:#edf5ff; --dark:#161b22;
  --sans:'Microsoft YaHei','微软雅黑',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --serif:var(--sans); --radius:10px;
  --tutor-blue:#0066cc; --tutor-ink:#1d1d1f; --tutor-muted:#626269;
  --tutor-line:#dedee3; --tutor-glass:rgba(255,255,255,.92);
  --tutor-glass-strong:rgba(255,255,255,.97);
}
body {background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:18px;line-height:1.8}
h1,h2,h3,h4 {font-family:var(--sans);font-weight:700;letter-spacing:-.025em;text-wrap:balance}
p,li,dd {text-wrap:pretty}
button,input,select,textarea {font-family:var(--sans)}
button,summary {font-weight:600}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {outline:3px solid #0071e3;outline-offset:4px}
::selection {background:#d7eaff;color:#172b4d}
.wrap {width:min(1440px,calc(100% - 80px))}
.site-header {background:rgba(255,255,255,.92);border-color:var(--line);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
.site-header nav a {font-size:16px;font-weight:600;color:#515157}
.site-header nav a[aria-current=page] {color:var(--accent)}
.site-header nav a[aria-current=page]:after {background:var(--accent)}
.brand-copy strong {font-size:20px;font-weight:700;color:var(--ink)}
.brand-copy small {font-size:12px;color:var(--muted)}
.site-footer {background:#fff;border-color:var(--line);color:var(--muted)}
.site-footer a,.site-footer p,.site-footer span {font-size:15px}
.button,.ex-button {border-radius:999px;min-height:46px;font-size:16px;font-weight:600;letter-spacing:0}
.button.primary,.ex-button {background:var(--accent);color:#fff;border-color:var(--accent)}
.button.primary:hover,.ex-button:hover {background:#0071e3;border-color:#0071e3}
.button.outline,.button.secondary {background:#fff;color:var(--accent);border-color:#b9cde4}
.text-button,.text-link,.back-link,.ex-inline-link {color:var(--accent);font-size:16px}
.eyebrow {color:var(--muted);font-size:14px;letter-spacing:.035em}
.page-heading h1,.lesson-heading h1 {font-size:clamp(34px,4vw,54px);font-weight:700;line-height:1.3}
.page-heading>p,.lesson-heading>p {font-size:20px;line-height:1.8;color:var(--muted);max-width:65ch}
.page-heading {padding-block:48px 36px}
.section-title h2 {font-size:30px;font-weight:700}
.section-title>p,.section-title .quiet {font-size:16px}
.ex-hero h1 {font-family:var(--sans);font-weight:750;color:var(--ink)}
.ex-hero-intro,.ex-hero-copy>p {font-size:20px;line-height:1.85;color:var(--muted)}
.ex-home,.ex-map,.ex-journey {color:var(--ink)}
.ex-home a.ex-resume {color:var(--accent);font-size:16px}
.ex-section-heading h2 {font-size:34px;font-weight:700}
.ex-section-heading p {font-size:18px;color:var(--muted)}
.ex-project {background:#fff;border:1px solid var(--line);border-radius:18px;overflow:hidden}
.ex-project-copy {padding:24px}
.ex-project h3 {font-size:24px;font-weight:700;color:var(--ink)}
.ex-project p,.ex-project-count,.ex-project-meta {font-size:16px;color:var(--muted)}
.ex-project-open {color:var(--accent)}
.ex-hero-stage,.ex-story-stage {background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 32px #1d1d1f05;overflow:hidden}
.ex-stage-top,.ex-stage-caption {background:#fff;border-color:var(--line);color:var(--muted);font-size:15px}
.ex-home .studio-root .studio-controls,.ex-story-stage .studio-root .studio-controls,.studio-root .studio-controls {background:#fff;border-color:var(--line);padding:22px}
.ex-home .studio-root .studio-field-title,.studio-root .studio-field-title {font-size:17px;color:var(--ink)}
.studio-root .studio-field-title output,.studio-root .studio-range-ends,.ex-home .studio-root .studio-note {font-size:15px;color:var(--muted)}
.studio-root .studio-note {background:#fff;border-color:var(--line);font-size:16px;padding:16px 22px}
.ex-home .studio-root .studio-meter,.ex-story-stage .studio-root .studio-meter {font-size:15px;padding:14px 22px}
.studio-root .studio-choice,.studio-root .studio-toggle {font-size:16px;min-height:44px;border-radius:8px}
.ex-story-copy h2,.ex-journey-title h1 {font-size:34px;font-weight:700;color:var(--ink)}
.ex-story-copy p,.ex-observation p,.ex-note-prompt,.ex-explain p {font-size:18px;line-height:1.85;color:var(--muted)}
.ex-stage-counter,.ex-step-rail button,.ex-journey-top,.ex-stage-top {font-size:15px}
.ex-step-rail button {min-height:44px}
.ex-step-rail button.is-active,.ex-choice.is-selected {background:var(--accent-light);color:var(--accent);border-color:#adcdf1}
.ex-current-task,.ex-review-entry,.ex-bridge,.ex-challenge,.ex-own-words,.ex-check-feedback {background:#fff;border-color:var(--line);border-radius:14px}
.ex-current-task>p,.ex-bridge p,.ex-challenge>p,.ex-own-words label {font-size:17px;color:var(--muted)}
.ex-challenge>button {background:var(--accent);color:#fff;border-radius:10px;font-size:16px}
.ex-check-options button {background:#fff;border-color:var(--line);font-size:17px;color:var(--ink);padding:14px 18px;border-radius:10px}
.ex-own-words textarea,.ex-note-area textarea {background:#fff;border-color:var(--line);color:var(--ink);font-size:18px;line-height:1.8}
.ex-finish,.ex-deeper {border-color:var(--line)}
.chapter-row,.chapter-heading,.chapter-lessons>a,.lesson-card,.related-list>a {border-color:var(--line)}
.chapter-heading h3 {font-size:24px;color:var(--ink)}
.chapter-heading p,.chapter-lessons>a {font-size:17px;color:var(--muted)}
.chapter-lessons>a:hover,.related-list>a:hover {background:#fff}
.lab-card,.quiz-card {background:#fff;border-color:var(--line);border-radius:16px}
.lab-card-body {padding:24px}
.lab-card h3 {font-size:23px;font-weight:700}
.lab-card p {font-size:17px;color:var(--muted)}
.lesson-reading {font-size:18px}
.lesson-layout:has(.cl-lab) {grid-template-columns:1fr}
.lesson-layout:has(.cl-lab) .lesson-reading {max-width:90ch}
.lesson-layout:has(.cl-lab) .lesson-experiment {position:static;min-width:0}
.objective,.scenario,.beginner-bridge,.explain-guide,.transfer-task,.practical .deliverable,.sources-layout aside {background:#fff;border-color:var(--line);border-radius:14px}
/* These blocks used to be open text strips. Their card surfaces need space on every side. */
.objective,.scenario,.explain-guide {padding:24px;border:1px solid var(--line);min-width:0}
.objective p,.scenario p,.step-content p,.step-content li,.lab-reading-note p {font-size:18px;line-height:1.9;color:var(--ink)}
.step-content h2,.step-content h3 {font-size:26px;font-weight:700}
.scenario>span,.objective>span,.lab-reading-note>span {font-size:15px;color:var(--muted)}
.quiz-card h3 {font-size:20px;font-weight:650}
.quiz-options button {font-size:17px;background:#fff;border-color:var(--line);border-radius:10px;padding:14px 16px}
.quiz-options button:hover:not(:disabled) {background:var(--accent-light);border-color:#9fc1e8}
.quiz-options button.is-correct {background:#eef8f1;border-color:#88b899;color:#225c37}
.quiz-options button.is-wrong {background:#fff3ed;border-color:#d5a487;color:#805133}
.takeaways ul,.explain-guide li,.misconception-list details,.transfer-task p,.practical-goal,.practical details {font-size:18px;line-height:1.9;color:var(--muted)}
.explain-result,.review-finished {background:var(--accent-light);border-color:#85b5e5;border-radius:12px;font-size:17px}
.explain-result>strong {font-weight:650}
.explain-prompt,textarea#explanation {font-size:18px;line-height:1.9}
textarea {background:#fff;border-color:var(--line);color:var(--ink)}
.math-section,.math-topic,.math-article,.math-toc,.math-block {border-color:var(--line)}
.math-equation {font-size:22px;overflow-x:auto}
.math-topic p,.math-article p,.math-reading p,.math-symbols,.math-example {font-size:18px;line-height:1.9}
.math-toc a {font-size:16px}
.math-note,.math-example,.math-conditions {background:#fff;border-color:var(--line);color:var(--muted)}
.math-conditions {padding:24px;border:1px solid var(--line);border-radius:14px;min-width:0}
.math-topic li,.math-result {overflow-wrap:anywhere}
/* Keep a long derivation inside its own column and let its equation scroll locally. */
:is(.c1-workbench,.c2-workbench,.c34-workbench,.c5-workbench,.c7-workbench)>* {min-width:0}
:is(.c1-formula,.c2-formula,.c34-formula,.c5-formula,.c7-formula,.c1-substitution,.c2-substitution,.c34-substitution,.c5-substitution,.c7-substitution,.c1-calculation,.c2-calculation,.c34-calculation,.c5-calculation,.c7-calculation) {max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
#main math[display=inline] {display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;vertical-align:middle}
/* Chapter controls share the same surface; graph colors stay inside screens. */
:is(.c1-player,.c2-player,.c34-player,.c5-player,.c7-player) :is(.c1-header,.c2-header,.c34-header,.c5-header,.c7-header) p {font-size:18px;line-height:1.9;color:var(--muted)}
:is(.c1-header,.c2-header,.c34-header,.c5-header,.c7-header) h2 {font-family:var(--sans);font-weight:700;font-size:clamp(28px,3vw,40px)}
:is(.c1-control,.c2-control,.c34-control,.c5-control,.c7-control)>span {font-size:17px;color:var(--ink)}
:is(.c1-control,.c2-control,.c34-control,.c5-control,.c7-control) output {font-size:16px;color:var(--accent)}
:is(.c1-control,.c2-control,.c34-control,.c5-control,.c7-control) select {background:#fff;border-color:var(--line);color:var(--ink);font-size:17px}
:is(.c1-controls,.c2-controls,.c34-controls,.c5-controls,.c7-controls) {border-color:var(--line)}
:is(.c1-readouts,.c2-readouts,.c34-readouts,.c5-readouts,.c7-readouts) dt {font-size:16px;color:var(--muted)}
:is(.c1-readouts,.c2-readouts,.c34-readouts,.c5-readouts,.c7-readouts) dd {font-size:21px;color:var(--ink)}
:is(.c1-readouts,.c2-readouts,.c34-readouts,.c5-readouts,.c7-readouts)>div {border-color:var(--line)}
:is(.c1-step-nav,.c2-step-nav,.c34-step-nav,.c5-step-nav,.c7-step-nav) {border-color:var(--line)}
:is(.c1-step-nav,.c2-step-nav,.c34-step-nav,.c5-step-nav,.c7-step-nav) button {color:var(--muted);font-size:16px;min-height:48px}
:is(.c1-step-nav,.c2-step-nav,.c34-step-nav,.c5-step-nav,.c7-step-nav) button.is-active {background:var(--accent-light);color:var(--accent);box-shadow:inset 0 -2px var(--accent)}
:is(.c1-task,.c2-task,.c34-task,.c5-task,.c7-task,.c1-challenge,.c2-challenge,.c34-challenge,.c5-challenge,.c7-challenge,.c1-prerequisites,.c2-prerequisites,.c34-prerequisites,.c5-prerequisites,.c7-prerequisites) {background:#fff;border-color:var(--line);border-radius:14px}
:is(.c1-checkpoint,.c2-checkpoint,.c34-checkpoint,.c5-checkpoint,.c7-checkpoint) {background:#fff;border-color:#99bfe9;border-radius:12px}
:is(.c1-task-fields,.c2-task-fields,.c34-task-fields,.c5-task-fields,.c7-task-fields) input {font-size:18px;background:#fff;color:var(--ink);border-color:#c6c6cc}
:is(.c1-caption,.c2-caption,.c34-caption,.c5-caption,.c7-caption) p {font-size:18px;line-height:1.85}
:is(.c1-transport,.c2-transport,.c34-transport,.c5-transport,.c7-transport) button {font-size:16px;min-height:42px;border-radius:8px}
:is(.c1-calculation,.c2-calculation,.c34-calculation,.c5-calculation,.c7-calculation) {font-size:18px;line-height:1.9;color:var(--ink)}
/* Images are large enough to compare on classroom displays. */
.photo-case {--pc-ink:var(--ink);--pc-muted:var(--muted);--pc-line:var(--line);--pc-accent:var(--accent);border-color:var(--line)}
.pc-layout {grid-template-columns:minmax(0,1.35fr) minmax(390px,1fr);gap:32px}
.pc-heading p,.pc-image-help,.pc-reading p {font-size:17px}
.pc-heading h2 {font-weight:700;font-family:var(--sans)}
.pc-condition span,.pc-controlled,.pc-chart {background:#fff;border-color:var(--line);color:var(--ink);border-radius:12px}
.pc-condition span {font-size:15px}
.pc-file-button,.pc-keep {background:var(--accent);border-color:var(--accent);color:#fff;font-size:16px;border-radius:999px}
.pc-file-actions button,.pc-stops button {background:#fff;color:var(--ink);border-color:var(--line);font-size:16px;border-radius:999px}
.pc-reading dd {font-size:28px;font-weight:650}
.pc-reading dt,.pc-photo-meta,.pc-chart p,.pc-notes {font-size:16px}
.pc-chart h3 {font-size:22px;font-weight:650}
.pc-chart {padding:24px}
.pc-pipeline p {font-size:17px;color:var(--ink)}
/* All experiments retain swatches and stable numeric grids. */
.lab-root .lab-stats {display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin:24px 0}
.lab-root .lab-stats>div {padding:18px;background:#fff;border:1px solid var(--line);border-radius:12px;min-width:0}
.lab-root .lab-stats dt {color:var(--muted);font-size:15px}
.lab-root .lab-stats dd {margin:8px 0 0;font-size:21px;font-weight:650;color:var(--ink);overflow-wrap:anywhere}
.lab-root .lab-swatches {display:flex;gap:16px;flex-wrap:wrap;margin:20px 0}
.lab-root .lab-swatch {flex:1;min-width:160px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fff}
.lab-root .lab-swatch-color {height:80px}
.lab-root .lab-swatch>span,.lab-root .lab-swatch>small {display:block;padding:8px 14px 0;font-size:16px}
.lab-root .lab-swatch>small {padding-block:0 14px;color:var(--muted);font-size:15px}
.lab-root .lab-title {font-size:26px}
.lab-root .lab-instruction,.lab-root .lab-insight {font-size:18px;line-height:1.85}
.lab-root .lab-control-heading,.lab-root select {font-size:17px}
.lab-root .lab-legend {font-size:16px;gap:12px 24px}
.lab-root .lab-control output {font-size:16px}
.lab-root .lab-note {font-size:16px}
.ink-root {font-family:var(--sans);font-size:18px}
.ink-root .ink-heading {font-size:26px}
.ink-root .ink-instruction,.ink-root .ink-insight {font-size:18px;line-height:1.85}
.ink-root .ink-button,.ink-root .ink-control-heading,.ink-root .ink-controls legend {font-size:16px}
.ink-root .ink-metric h4,.ink-root .ink-rank dt,.ink-root .ink-rank small {font-size:16px}
.ink-root .ink-equation,.ink-root .ink-ties,.ink-root .ink-note {font-size:16px;line-height:1.8}
.tutor-launcher button {background:rgba(255,255,255,.94);border-color:var(--line);box-shadow:0 8px 28px #1d1d1f0c;backdrop-filter:blur(22px)}
.tutor-launcher strong {font-size:18px;font-weight:700}
.tutor-launcher small {font-size:15px;line-height:1.5}
.coach-dialog[open] {background:rgba(255,255,255,.98);border-color:#d2d2d7;box-shadow:0 24px 80px #1d1d1f24}
.coach-dialog[open] .dialog-heading {background:rgba(255,255,255,.96);border-color:var(--line)}
.coach-dialog[open] .dialog-heading>div {font-size:18px}
.coach-dialog[open] .dialog-heading>div>span {font-size:14px}
.coach-dialog[open] .coach-context h3 {font-size:24px}
.coach-dialog[open] :is(.coach-context p,.coach-context small,.coach-welcome p,.coach-welcome li) {font-size:17px;color:var(--muted);line-height:1.8}
.coach-dialog[open] .coach-message p {font-size:18px;line-height:1.85;color:var(--ink)}
.coach-dialog[open] .coach-message {background:#f5f5f7;border-color:var(--line);border-radius:14px}
.coach-dialog[open] .coach-message-user {background:#edf5ff;border-color:#c7ddf7}
.coach-dialog[open] .coach-message-label {font-size:14px;color:var(--muted)}
.coach-dialog[open] .coach-modes button {background:#f5f5f7;border-color:var(--line);color:var(--ink);font-size:15px}
.coach-dialog[open]>textarea {background:#fff;border-color:#c6c6cc;font-size:18px;line-height:1.8;border-radius:12px}
.coach-dialog[open] .coach-send small {font-size:14px;color:var(--muted)}
.coach-dialog[open] .coach-size-toggle {font-size:14px;color:var(--accent);background:#fff;border-color:var(--line)}
.coach-dialog.coach-dialog-large[open] {width:min(800px,calc(100vw - 40px));max-height:calc(100dvh - 100px)}
.coach-dialog.coach-dialog-large[open] #coach-output {max-height:46dvh}
@media(min-width:761px) and (max-width:2249px) {
 .tutor-launcher {top:108px;left:4px;width:48px;bottom:auto}
 .tutor-launcher button {width:48px;min-height:56px;padding:8px;gap:0;border-radius:14px}
 .tutor-launcher button>span:nth-child(2),.tutor-launcher .tutor-launcher-arrow {display:none}
 .tutor-launcher-mark {width:28px;height:28px}
}
@media(min-width:1880px) {.wrap{width:min(1440px,calc(100% - 560px))}}
@media(max-width:1100px) {.wrap{width:calc(100% - 48px)}.site-header{gap:18px;padding-inline:24px}.site-header nav{gap:18px}.site-header nav a{font-size:15px}.pc-layout{grid-template-columns:1fr}.pc-charts{grid-template-columns:repeat(2,minmax(0,1fr))}.pc-chart{width:100%;max-width:none}.lesson-layout{grid-template-columns:1fr}.lesson-reading{max-width:80ch}.ex-story-copy{max-width:none}}
@media(max-width:760px) {
 body{font-size:17px}.wrap{width:calc(100% - 32px)}
 .objective,.scenario,.explain-guide,.math-conditions {padding:18px}
 .site-header{padding-inline:16px}.site-header nav{max-width:100%;overflow-x:auto;overflow-y:hidden;justify-content:flex-start;gap:20px;scrollbar-width:none;padding-block:5px}.site-header nav a{font-size:15px;flex-shrink:0}
 .page-heading{padding-block:28px}.page-heading>p,.lesson-heading>p{font-size:18px}
 .ex-hero-intro,.ex-hero-copy>p,.ex-story-copy p,.ex-observation p{font-size:18px}
 .ex-project-copy{padding:18px}.ex-project h3{font-size:21px}
 .pc-charts{grid-template-columns:1fr}.pc-chart{padding:18px}.pc-layout{gap:24px}
 .coach-dialog.coach-dialog-large[open]{width:calc(100vw - 24px);max-height:calc(100dvh - 90px)}
 .tutor-launcher {left:12px;right:auto;bottom:14px;width:58px;top:auto}
 .tutor-launcher button {width:58px;min-height:58px;padding:12px;border-radius:18px}
 .tutor-launcher button>span:nth-child(2),.tutor-launcher .tutor-launcher-arrow {display:none}
 .site-footer {padding-bottom:90px}
 .lab-root .lab-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.lab-root .lab-stats>div{padding:14px}.lab-root .lab-stats dd{font-size:19px}
 :is(.c1-caption,.c2-caption,.c34-caption,.c5-caption,.c7-caption) p{font-size:17px}
}
