:root {
  color-scheme: light;
  --ink: #1c2d40;
  --muted: #6d7c8b;
  --navy: #173454;
  --blue: #356da4;
  --blue-soft: #eaf2fa;
  --line: #e1e7ed;
  --paper: #f5f7fa;
  --surface: #ffffff;
  --orange: #d58a39;
  --orange-soft: #fff4e7;
  --green: #2f806a;
  --green-soft: #e8f5ef;
  --red: #b94c49;
  --red-soft: #fff0ef;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink); }
body { min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #9bc1e8; outline-offset: 2px; }
[hidden] { display: none !important; }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--navy); color: #fff; font-family: Georgia, serif; font-size: 24px; font-weight: 700; box-shadow: inset 0 -4px 0 rgba(255,255,255,.12); }
.brand-name { color: var(--navy); font-size: 15px; font-weight: 750; letter-spacing: .04em; }
.brand-subtitle { margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .035em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.chapter-pill, .surface-tag, .status-chip, .score-chip { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
.chapter-pill { padding: 8px 12px; background: #f1f4f7; color: #536579; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 9px 13px; font-size: 12px; font-weight: 650; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:active { transform: translateY(1px); }
.button-primary { color: #fff; background: var(--navy); }
.button-primary:hover { background: #22496f; }
.button-quiet { color: #344c64; background: #fff; border-color: #dce4ec; }
.button-quiet:hover { background: #f3f6f9; }
.app-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { position: sticky; top: 0; align-self: start; display: flex; flex-direction: column; min-height: calc(100vh - 76px); padding: 27px 14px 18px; background: #f0f3f7; border-right: 1px solid #e0e6ec; }
.sidebar-heading { padding: 0 10px 19px; }
.eyebrow { color: #7890a7; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.sidebar-heading h2 { margin: 8px 0 6px; color: var(--navy); font-size: 16px; }
.sidebar-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 58px; padding: 9px 10px; text-align: left; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #536578; }
.nav-item:hover { background: rgba(255,255,255,.7); }
.nav-item[aria-current="page"] { background: #fff; border-color: #dce6ef; color: var(--navy); box-shadow: 0 4px 14px rgba(28,55,81,.045); }
.nav-index { display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 9px; background: #e4eaf0; color: #63778b; font-size: 10px; font-weight: 800; }
.nav-item[aria-current="page"] .nav-index { background: var(--navy); color: #fff; }
.nav-item strong { display: block; font-size: 12px; font-weight: 750; }
.nav-item small { display: block; margin-top: 4px; color: #8a97a5; font-size: 10px; }
.sidebar-note { margin: auto 9px 18px; padding: 13px 12px; border-radius: 12px; background: #e7edf3; }
.note-label { color: #627c95; font-size: 10px; font-weight: 800; }
.sidebar-note p { margin: 7px 0 0; color: #6d7e8f; font-size: 10px; line-height: 1.7; }
.sidebar-close { width: 100%; padding: 10px 12px; border: 1px solid #dbe3ea; border-radius: 10px; background: transparent; color: #64788b; font-size: 11px; text-align: left; }
.sidebar-close span { float: right; }
.main-content { min-width: 0; padding: 28px 30px 18px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 26px; }
.page-heading h1 { margin: 7px 0 6px; color: var(--navy); font-size: clamp(23px, 2.1vw, 30px); line-height: 1.25; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.sidebar-open { margin-top: 6px; }
.section-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 15px; }
.section-number { color: #7e93a7; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.section-intro h2 { margin: 5px 0 6px; color: var(--navy); font-size: 20px; letter-spacing: -.025em; }
.section-intro p { max-width: 750px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.status-chip { margin-top: 4px; padding: 8px 11px; background: var(--green-soft); color: var(--green); }
.status-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47,128,106,.12); }
.surface { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 7px 22px rgba(25,48,72,.025); }
.experiment-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .85fr); align-items: stretch; gap: 14px; }
.graph-surface, .control-surface, .interval-surface, .takeaway-surface { padding: 17px 18px; }
.surface-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.surface-heading h3, .takeaway-surface h3 { margin: 0; color: #233e59; font-size: 14px; }
.surface-heading p { margin: 5px 0 0; color: #8a97a5; font-size: 10px; line-height: 1.6; }
.surface-tag { padding: 6px 8px; background: #f1f4f7; color: #8192a3; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.graph-wrap { width: 100%; margin-top: 8px; overflow: hidden; }
#graph-svg { display: block; width: 100%; height: auto; min-height: 250px; overflow: visible; }
.graph-grid { stroke: #edf1f5; stroke-width: 1; }
.graph-axis { stroke: #9baaba; stroke-width: 1.4; }
.graph-tick { fill: #8c9aaa; font-size: 10px; }
.graph-axis-label { fill: #667d92; font-size: 12px; font-weight: 700; }
.function-curve { fill: none; stroke: #356da4; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.point-guide { stroke: #9db1c5; stroke-width: 1.2; stroke-dasharray: 4 5; }
.point-guide-two { stroke: #d5a56d; }
.function-point { stroke: #fff; stroke-width: 2.5; }
.function-point-one { fill: #356da4; }
.function-point-two { fill: #d58a39; }
.point-label { fill: #344e67; font-size: 11px; font-weight: 750; }
.graph-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; padding-top: 9px; border-top: 1px solid #f0f2f5; color: #7e8c9b; font-size: 10px; }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 16px; height: 3px; border-radius: 3px; background: var(--blue); }
.legend-point { display: inline-block; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #a5b4c3; }
.point-one { background: var(--blue); }
.point-two { background: var(--orange); }
.control-stack { display: flex; flex-direction: column; gap: 14px; }
.control-surface { flex: 1; }
.field-label { display: block; margin: 18px 0 7px; color: #687b8e; font-size: 11px; font-weight: 700; }
.select-control { width: 100%; padding: 11px 12px; border: 1px solid #d9e2ea; border-radius: 10px; background: #fbfcfd; color: #243d56; font-size: 12px; }
.function-summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin: 10px 0 20px; }
.function-summary span:first-child { color: var(--navy); font-size: 13px; font-weight: 800; }
.function-summary span:last-child { color: #8796a5; font-size: 10px; }
.range-control { margin-top: 16px; }
.range-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #65798d; font-size: 11px; }
.range-label output { min-width: 48px; padding: 4px 7px; border-radius: 6px; background: #edf3f8; color: var(--navy); text-align: center; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; margin: 12px 0 0; accent-color: var(--blue); cursor: ew-resize; }
#x2-range { accent-color: var(--orange); }
.interval-hint { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; padding: 10px 11px; border-radius: 10px; background: #f5f7fa; color: #788897; font-size: 10px; line-height: 1.7; }
.hint-icon { display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; border-radius: 50%; background: #dfe8f0; color: #617b93; font-family: Georgia, serif; font-weight: 800; }
.comparison-card { padding: 16px 17px; border: 1px solid #dce7f1; border-radius: 15px; background: linear-gradient(145deg, #f1f6fb, #fff 72%); }
.comparison-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.comparison-status { padding: 5px 8px; border-radius: 7px; background: #e6edf4; color: #59748e; font-size: 9px; font-weight: 800; }
.comparison-status.status-good { background: var(--green-soft); color: var(--green); }
.comparison-status.status-warn { background: var(--orange-soft); color: #98632a; }
.comparison-values { display: grid; grid-template-columns: minmax(0,1fr) 25px minmax(0,1fr); align-items: center; gap: 6px; margin: 13px 0 11px; }
.comparison-values > div:not(.comparison-symbol) { padding: 10px; border: 1px solid #e4ebf2; border-radius: 10px; background: rgba(255,255,255,.86); }
.comparison-values small { display: block; color: #8996a3; font-size: 10px; }
.comparison-values strong { display: block; margin-top: 5px; color: var(--navy); font-size: 17px; font-variant-numeric: tabular-nums; }
.comparison-symbol { color: #8a9daf; font-size: 18px; text-align: center; }
.comparison-card p { margin: 0; color: #61768b; font-size: 11px; line-height: 1.8; }
.bottom-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .9fr); gap: 14px; margin-top: 14px; }
.interval-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.interval-chip { padding: 8px 10px; border: 1px solid #dce7f1; border-radius: 9px; background: #f6f9fc; color: #486782; font-size: 11px; }
.interval-chip strong { margin-right: 5px; color: var(--blue); }
.takeaway-surface { background: #fbfcfd; }
.takeaway-surface h3 { margin-top: 8px; font-size: 15px; }
.takeaway-surface p { margin: 9px 0 10px; color: #778694; font-size: 11px; line-height: 1.85; }
.text-link { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 800; }
.text-link span { margin-left: 4px; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 25px; padding: 13px 2px 0; border-top: 1px solid #e5e9ee; color: #99a4af; font-size: 9px; }
.lesson-hero { padding: 21px 23px; border: 1px solid #dce7f1; border-radius: 15px; background: linear-gradient(120deg, #edf4fa, #fff 76%); }
.lesson-hero h2 { margin: 0 0 8px; color: var(--navy); font-size: 20px; }
.lesson-hero p { max-width: 850px; margin: 0; color: #647a8f; font-size: 12px; line-height: 1.9; }
.lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.lesson-card { min-width: 0; padding: 18px 19px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.lesson-card h3 { margin: 0 0 9px; color: #2c455e; font-size: 14px; }
.lesson-card p { margin: 0; color: #6e7e8e; font-size: 12px; line-height: 1.9; }
.lesson-formula { display: block; margin: 11px 0; padding: 11px 12px; border-radius: 9px; background: #f1f5f9; color: #264967; font-family: "Cambria Math", "Times New Roman", serif; font-size: 14px; font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
.lesson-tag { display: inline-flex; margin-bottom: 10px; padding: 5px 8px; border-radius: 6px; background: #eaf2fa; color: #557b9e; font-size: 9px; font-weight: 800; }
.lesson-action { margin-top: 13px; padding: 8px 10px; border: 1px solid #dce5ed; border-radius: 8px; background: #fff; color: var(--blue); font-size: 10px; font-weight: 800; }
.step-list { display: grid; gap: 10px; margin-top: 15px; }
.step-card { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.step-number { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #edf3f8; color: var(--navy); font-size: 13px; font-weight: 850; }
.step-card h3 { margin: 0; color: #2c455e; font-size: 13px; }
.step-card p { margin: 8px 0 0; color: #6e7e8e; font-size: 11px; line-height: 1.8; }
.composite-table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.composite-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: center; }
.composite-table th { padding: 13px 10px; background: #f1f5f8; color: #526a80; font-size: 11px; }
.composite-table td { padding: 15px 10px; border-top: 1px solid #e9edf1; color: #586e82; }
.composite-table td:last-child { color: var(--navy); font-weight: 800; }
.composite-note { margin-top: 14px; padding: 14px 16px; border-left: 3px solid var(--orange); border-radius: 0 10px 10px 0; background: #fff8f0; color: #7b6a55; font-size: 11px; line-height: 1.8; }
.question-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.question-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.question-topic { color: #62809b; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.question-source { color: #9aa5af; font-size: 9px; text-align: right; }
.question-card h3 { margin: 0 0 13px; color: #2a4259; font-size: 13px; font-weight: 700; line-height: 1.8; }
.question-choices { display: grid; gap: 7px; }
.choice-option { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; border: 1px solid #e6ebf0; border-radius: 9px; background: #fcfdfe; color: #607386; font-size: 11px; line-height: 1.65; cursor: pointer; }
.choice-option:hover { border-color: #c9d9e8; background: #f6f9fc; }
.choice-option input { margin: 2px 0 0; accent-color: var(--blue); }
.answer-input { width: 100%; padding: 10px 11px; border: 1px solid #dbe3eb; border-radius: 9px; background: #fbfcfd; color: var(--ink); font-size: 12px; }
.question-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 13px; }
.question-actions .button { padding: 8px 12px; }
.question-result { display: none; margin-top: 12px; padding: 11px 12px; border-radius: 9px; font-size: 11px; line-height: 1.8; }
.question-result.visible { display: block; }
.question-result.correct { background: var(--green-soft); color: #2d6e5d; }
.question-result.incorrect { background: var(--red-soft); color: #8d4a48; }
.question-result.unanswered { background: var(--orange-soft); color: #94642f; }
.question-card.is-correct { border-color: #b7dccc; }
.question-card.is-incorrect { border-color: #ebc7c5; }
.score-chip { padding: 8px 11px; background: #edf3f8; color: #58738d; }
.practice-complete { margin-bottom: 14px; padding: 13px 15px; border: 1px solid #c9e1d7; border-radius: 12px; background: #eef8f3; color: #3d7965; font-size: 12px; }
@media (max-width: 1200px) {
  .topbar { padding: 0 20px; }
  .app-layout { grid-template-columns: 218px minmax(0,1fr); }
  .main-content { padding: 23px 20px 16px; }
  .experiment-layout { grid-template-columns: minmax(0,1.3fr) minmax(245px,.9fr); gap: 12px; }
  .graph-surface, .control-surface, .interval-surface, .takeaway-surface { padding: 14px; }
}
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; min-height: 0; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-heading { padding: 2px 8px 10px; }
  .sidebar-heading p { display: none; }
  .nav-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .nav-item { min-height: 48px; gap: 7px; padding: 7px; }
  .nav-index { flex-basis: 26px; width: 26px; height: 26px; }
  .nav-item small { display: none; }
  .sidebar-note, .sidebar-close { display: none; }
  .experiment-layout { grid-template-columns: minmax(0,1.2fr) minmax(235px,.8fr); }
}
@media (max-width: 650px) {
  .topbar { height: 64px; padding: 0 13px; }
  .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .brand-subtitle, .chapter-pill { display: none; }
  .topbar-actions { gap: 6px; }
  .button { padding: 8px 9px; font-size: 10px; }
  .app-layout { min-height: calc(100vh - 64px); }
  .sidebar { padding: 10px; }
  .sidebar-heading h2 { font-size: 14px; }
  .nav-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .main-content { padding: 20px 12px 14px; }
  .page-heading { margin-bottom: 20px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 11px; }
  .section-intro { gap: 8px; }
  .section-intro h2 { font-size: 18px; }
  .section-intro p { font-size: 11px; }
  .status-chip { display: none; }
  .experiment-layout, .bottom-grid, .lesson-grid, .question-list { grid-template-columns: minmax(0,1fr); }
  .graph-surface { padding: 12px 10px; }
  #graph-svg { min-height: 220px; }
  .control-stack { display: grid; grid-template-columns: minmax(0,1fr); }
  .page-footer { flex-direction: column; }
  .step-card { grid-template-columns: 36px minmax(0,1fr); gap: 9px; padding: 13px; }
  .step-number { width: 31px; height: 31px; }
}
body.presentation-mode .app-layout { grid-template-columns: minmax(0,1fr); }
body.presentation-mode .sidebar { display: none; }
body.presentation-mode .page-heading { display: none; }
body.presentation-mode .main-content { padding: 14px 18px; }
body.presentation-mode .topbar { height: 58px; }
body.presentation-mode .sidebar-open { display: none !important; }
body.presentation-mode #experiment-page .bottom-grid { display: none; }
body.presentation-mode #experiment-page .section-intro { margin-bottom: 8px; }
body.presentation-mode #experiment-page .section-intro h2 { font-size: 17px; }
body.presentation-mode #experiment-page .experiment-layout { grid-template-columns: minmax(0,1.7fr) minmax(260px,.8fr); }
body.presentation-mode #graph-svg { max-height: calc(100vh - 210px); }

body.sidebar-collapsed .app-layout { grid-template-columns: minmax(0,1fr); }
body.sidebar-collapsed .sidebar-open { display: inline-flex; }
.question-visual { margin: 0 0 12px; padding: 8px 9px 4px; border: 1px solid #edf1f5; border-radius: 10px; background: #fbfcfd; }
.question-visual svg { display: block; width: 100%; height: auto; }

/* V0.2 parameter-driven graph and question-to-graph workflow */
.parameter-layout { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(300px,.85fr); gap:14px; align-items:start; }
.parameter-graph-surface, .parameter-control-surface, .parameter-insight-surface { min-width:0; padding:16px; }
.parameter-graph-wrap { min-height:300px; }
#parameter-graph-svg { display:block; width:100%; min-height:300px; height:auto; }
.parameter-curve { fill:none; stroke:var(--blue); stroke-width:3.2; stroke-linecap:round; stroke-linejoin:round; }
.parameter-baseline { fill:none; stroke:#aab4bf; stroke-width:2.5; stroke-dasharray:7 6; stroke-linecap:round; }
.parameter-comparison { fill:none; stroke:var(--orange); stroke-width:2.8; stroke-dasharray:8 5; stroke-linecap:round; }
.parameter-comparison-alt { stroke:#8b6ab1; }
.parameter-auxiliary { fill:none; stroke:var(--green); stroke-width:2.6; stroke-dasharray:4 5; stroke-linecap:round; }
.parameter-interval-band { fill:#dcefe7; opacity:.95; }
.parameter-interval-boundary { stroke:#4f947f; stroke-width:1.4; stroke-dasharray:3 5; }
.parameter-legend { display:flex; flex-wrap:wrap; gap:10px 16px; margin:10px 2px 13px; color:#718294; font-size:10px; }
.parameter-legend span { display:inline-flex; align-items:center; gap:7px; }
.parameter-legend-line { display:inline-block; width:23px; height:0; border-top:3px solid var(--blue); }
.parameter-legend-line.baseline { border-top:2px dashed #aab4bf; }
.parameter-legend-line.compare { border-top:3px dashed var(--orange); }
.parameter-legend-line.compare-alt { border-top-color:#8b6ab1; }
.parameter-legend-line.auxiliary { border-top:3px dashed var(--green); }
.parameter-formula-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:12px; border:1px solid #e1e9f0; border-radius:10px; background:#f7f9fb; }
.parameter-formula-row span:first-child { color:var(--navy); font-family:"Cambria Math","Times New Roman",serif; font-size:15px; font-weight:800; overflow-wrap:anywhere; }
.parameter-formula-row span:last-child { color:#77899a; font-size:10px; }
.parameter-interval-focus { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; margin-top:10px; padding:10px 12px; border-radius:9px; background:#eef7f3; color:#4b7c6d; font-size:11px; }
.parameter-interval-focus strong { font-weight:800; }
.parameter-question-context { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; padding:16px 18px; border:1px solid #d9e5ef; border-radius:14px; background:linear-gradient(110deg,#edf4fa,#fff 80%); }
.parameter-question-context h3 { margin:7px 0 5px; color:var(--navy); font-size:14px; line-height:1.8; }
.parameter-question-context p { margin:0; color:#718294; font-size:11px; line-height:1.8; }
.parameter-question-context .eyebrow { color:#6886a0; font-size:9px; font-weight:800; letter-spacing:.06em; }
.parameter-controls { margin-top:6px; }
.parameter-range-control { margin-top:15px; }
.parameter-button-row { display:flex; flex-wrap:wrap; gap:8px; margin-top:20px; }
.parameter-button-row .button { flex:1 1 120px; }
.parameter-baseline-status { margin:10px 0 0; color:#81909d; font-size:10px; line-height:1.7; }
.parameter-no-controls { padding:12px; border-radius:9px; background:#f5f7fa; color:#6f8293; font-size:11px; line-height:1.8; }
.parameter-insight-surface { margin-top:14px; background:#fbfcfd; }
.parameter-insight-surface h3 { margin:8px 0 10px; color:var(--navy); font-size:15px; }
.parameter-insight-surface p { margin:8px 0; color:#63798c; font-size:11px; line-height:1.85; }
.parameter-footer-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.question-actions { flex-wrap:wrap; }
.question-action-buttons { display:flex; flex-wrap:wrap; gap:7px; }
.question-action-buttons .button { white-space:nowrap; }
@media (max-width: 1000px) {
  .parameter-layout { grid-template-columns:minmax(0,1.1fr) minmax(260px,.9fr); }
}
@media (max-width: 650px) {
  .parameter-layout { grid-template-columns:minmax(0,1fr); }
  .parameter-graph-surface, .parameter-control-surface, .parameter-insight-surface { padding:12px; }
  #parameter-graph-svg { min-height:230px; }
  .parameter-question-context { align-items:flex-start; flex-direction:column; padding:13px; }
  .parameter-formula-row { align-items:flex-start; flex-direction:column; }
  .question-action-buttons { width:100%; }
  .question-action-buttons .button { flex:1 1 auto; }
}
/* V0.3: exact numeric parameter input and interval-constraint solver */
.parameter-range-control .range-label { font-size:12px; }
.parameter-number { width:100px; min-height:36px; padding:6px 9px; border:1px solid #c7d8e8; border-radius:8px; background:#fff; color:#173454; font-size:14px; font-variant-numeric:tabular-nums; font-weight:750; text-align:right; }
.parameter-number:focus-visible { outline:2px solid #356da4; }
.parameter-edit-tip { margin:10px 0; color:#698195; line-height:1.7; font-size:11px; }
.unknown-panel { margin-top:18px; padding:14px; border:1px solid #ccdae7; border-radius:13px; background:#f8fafc; }
.unknown-header { display:flex; align-items:center; justify-content:space-between; gap:9px; }
.unknown-header strong { font-size:14px; color:#173454; }
.unknown-header span { font-size:10px; color:#8193a3; }
.unknown-preset-row { display:flex; flex-wrap:wrap; gap:6px; margin:13px 0; }
.unknown-preset-row .button { padding:7px 8px; font-size:10px; }
.unknown-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.unknown-fields label { display:grid; gap:6px; color:#63798c; font-size:11px; }
.unknown-fields select,.unknown-fields input { min-width:0; width:100%; height:38px; border:1px solid #d7e1ea; border-radius:8px; background:#fff; color:#173454; padding:5px 9px; font:inherit; font-size:13px; }
.unknown-help { color:#718596; font-size:10px; line-height:1.75; margin-top:10px; }
.unknown-feedback { margin:11px 0; padding:10px; border-radius:8px; font-size:11px; line-height:1.8; background:#edf4fa; color:#315b81; }
.unknown-feedback.fits { background:#e9f5ee; color:#356e57; }
.unknown-feedback.does-not-fit { background:#fff1e6; color:#945f2e; }
.unknown-feedback.invalid { background:#fff0ef; color:#9b4c48; }
.unknown-answer { padding:12px; margin-top:10px; border:1px solid #d6e3f0; border-radius:9px; background:#fff; color:#31516e; font-size:12px; line-height:1.9; overflow-wrap:anywhere; }
.unknown-answer p { margin:7px 0; }
.parameter-symmetry-axis { stroke:#cf8a40; stroke-width:1.6; stroke-dasharray:5 5; }
.parameter-vertex { fill:#cf8a40; stroke:#fff; stroke-width:2; }
@media(max-width:650px){.unknown-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }.parameter-number{width:88px;} }

/* V0.4: diagram first, high-visibility geometry and inverse special-point editing */
.parameter-layout {display:flex; flex-direction:column; gap:16px}
.parameter-graph-surface {width:100%;padding:20px 22px 16px;overflow:visible}
.graph-titlebar {align-items:center;gap:16px}
.graph-titlebar h3 {font-size:19px!important}
.graph-titlebar p {font-size:12px!important;line-height:1.7}
.graph-action-buttons {display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.graph-action-buttons .button {min-height:36px;padding:8px 13px;font-size:11px;white-space:nowrap}
.parameter-graph-wrap {min-height:0;background:#fff;border:1px solid #d6e2ee;border-radius:14px;padding:8px;box-shadow:inset 0 0 0 1px #f3f7fa;touch-action:pan-y}
#parameter-graph-svg {width:100%;height:auto;min-height:420px;display:block}
.parameter-curve {stroke:#1e5f9e;stroke-width:4.25}
.parameter-baseline {stroke:#a9b5c3;stroke-width:2.4}
.parameter-interval-curve {fill:none;stroke:#168165;stroke-width:5.4;stroke-linecap:round;stroke-linejoin:round}
.parameter-interval-curve.not-monotonic {stroke:#b6762b}
.parameter-symmetry-axis {stroke:#e59c35;stroke-width:2.5;stroke-dasharray:9 6}
.parameter-vertex {fill:#ed9827;stroke:white;stroke-width:3}
.parameter-interval-band {fill:#d8eee5;opacity:.58}
.parameter-interval-boundary {stroke:#439783;stroke-width:1.9;stroke-dasharray:7 5}
.parameter-feature-ribbon {display:flex}
.quadratic-feature-ribbon {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:10px 0 15px}
.feature-tile {border:1px solid #dce6f0;border-radius:11px;padding:10px 12px;background:#f8fbfd;min-width:0}
.feature-tile .feature-name {font-size:11px;color:#72859a;display:block}
.feature-tile .feature-value {color:#1e466b;font-size:17px;font-weight:800;margin-top:5px;display:block;font-family:"Cambria Math","Times New Roman",serif;word-break:break-word}
.feature-tile.feature-axis {border-top:3px solid #e59c35}
.feature-tile.feature-vertex {border-top:3px solid #e59c35}
.feature-tile.feature-roots {border-top:3px solid #168165}
.feature-tile.feature-y {border-top:3px solid #477bb1}
.control-stack {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:16px;width:100%}
.control-stack>.surface {margin:0;min-width:0}
.control-stack>.parameter-insight-surface {grid-column:1/-1}
.parameter-control-surface,.special-point-surface {padding:20px}
.special-point-surface {display:block}
.special-point-surface[hidden] {display:none}
.special-point-detail {margin:10px 0 14px;padding:12px;background:#f0f6fa;border-radius:10px;color:#325b78;font-size:12px;line-height:1.8}
.special-point-controls {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.special-point-control {padding:11px;border:1px solid #dce7f1;border-radius:11px;background:#fff}
.special-point-control label {font-size:11px;color:#60788e;display:block;margin-bottom:7px;min-height:16px}
.special-point-control input {width:100%;height:38px;border:1px solid #c9d9e7;border-radius:8px;color:#193f62;background:#fdfefe;padding:5px 9px;font-size:15px;font-weight:750;font-variant-numeric:tabular-nums}
.special-point-control small {display:block;color:#758a9a;font-size:10px;line-height:1.5;min-height:28px;margin-top:7px}
.special-point-control .point-formula {color:#2b5677;min-height:0}
.special-point-feedback {margin:13px 0 0;color:#47749a;background:#ecf5fc;border-radius:8px;font-size:11px;line-height:1.8;padding:10px}
.graph-special-hit {cursor:grab;touch-action:none;outline:none}
.graph-special-hit:active {cursor:grabbing}
.graph-point-ring {stroke:white;stroke-width:3}
.graph-point-halo {fill:transparent;stroke:transparent;stroke-width:28}
.graph-point-label {font-size:14px;paint-order:stroke;stroke:#fff;stroke-width:6px;stroke-linejoin:round;font-weight:800}
.graph-point-label.axis-label {fill:#a96512}
.graph-point-label.vertex-label {fill:#a96512}
.graph-point-label.root-label {fill:#08775e}
.graph-point-label.intercept-label {fill:#245e9c}
.graph-point-label.endpoint-label {fill:#178467}
.graph-interval-callout {font-size:13px;font-weight:800;fill:#23745c;paint-order:stroke;stroke:#fff;stroke-width:5px}
.parameter-legend {font-size:12px;margin:12px 4px 14px}
.parameter-formula-row span:first-child {font-size:20px}
.parameter-formula-row span:last-child {font-size:12px}
body.math-graph-zoom .parameter-graph-surface {position:fixed;z-index:1100;inset:10px;width:auto;max-height:calc(100vh - 20px);overflow:auto;box-shadow:0 0 0 50vw #0b1b2bcf;border-radius:18px}
body.math-graph-zoom .graph-action-buttons {position:sticky;top:0;z-index:2}
body.math-graph-zoom .parameter-graph-wrap {max-width:min(1300px,95vw);margin:auto}
body.math-graph-zoom #parameter-graph-svg {min-height:min(68vh,720px);max-height:76vh}
body.math-graph-zoom {overflow:hidden}
@media(min-width:1350px){.quadratic-feature-ribbon{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:900px) {
  .control-stack {grid-template-columns:1fr}
  .control-stack>.parameter-insight-surface {grid-column:auto}
  .quadratic-feature-ribbon {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:650px){
  .parameter-graph-surface {padding:12px}
  .graph-titlebar {flex-wrap:wrap}
  .graph-action-buttons {width:100%;justify-content:flex-start}
  .graph-action-buttons .button {flex:1}
  .quadratic-feature-ribbon {gap:7px}
  .feature-tile {padding:8px}
  .feature-tile .feature-value {font-size:13px}
  .parameter-graph-wrap {padding:2px}
  #parameter-graph-svg {min-height:270px}
  .special-point-controls {grid-template-columns:repeat(2,minmax(0,1fr))}
  .parameter-formula-row span:first-child {font-size:16px}
}

/* Remove duplicated lesson introduction so the large graph is visible immediately */
body.parameter-active .page-heading {display:none}
#parameter-lab-page>.section-intro {display:none}
#parameter-lab-page>.parameter-question-context[hidden] {display:none}
body.parameter-active .main-content {padding-top:16px}
body.parameter-active .parameter-graph-surface {scroll-margin-top:12px}
.parameter-legend-line.interval {border-top:4px solid #168165}
