:root {
  color-scheme: light;
  --ink: #172e35;
  --muted: #4d656b;
  --accent: #0c7167;
  --accent-dark: #085c54;
  --line: #d9e5e5;
  --paper: #f4f8f8;
  --white: #fff;
  --rail: 224px;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent-dark); text-decoration: none; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #268d84; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 4; padding: 10px 16px; background: white; transform: translateY(-150%); }
.skip:focus { transform: none; }
.layout { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fbfdfd; padding: 28px 18px 22px; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 9px 38px; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 10px; background: #123d43; color: #9ae7d9; font: 700 32px/1 "Instrument Serif", Georgia, serif; }
.brand strong { display: block; font-size: 17px; letter-spacing: .02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .10em; }
#menu { display: grid; gap: 7px; }
#menu a { display: flex; align-items: center; border-radius: 8px; padding: 12px 11px; min-height: 45px; gap: 11px; color: #3b555d; font-size: 14px; }
#menu a span { width: 24px; text-align: center; font-size: 19px; font-family: "Segoe UI Symbol", system-ui, sans-serif; line-height: 1; }
#menu a:hover, #menu a[aria-current] { background: #e0f1ee; color: var(--accent-dark); }
#menu a[aria-current] { font-weight: 700; }
.rail-progress { margin-top: auto; padding: 14px 12px 11px; border: 1px solid var(--line); border-radius: 10px; background: #f1f8f7; font-size: 12px; }
.progress-label { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
#rail-count { color: var(--muted); font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 20px; margin: 11px 0 9px; background: #d8eae7; }
progress::-webkit-progress-bar { border-radius: 20px; background: #d8eae7; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 20px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 20px; }
.workspace { min-width: 0; }
.topbar { display: grid; grid-template-columns: 1fr minmax(240px, 358px) auto; gap: 20px; align-items: center; min-height: 69px; padding: 12px clamp(20px, 3.2vw, 48px); border-bottom: 1px solid var(--line); background: #fbfdfd; }
.breadcrumb { font-size: 14px; font-weight: 700; }
.search { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; min-width: 0; min-height: 38px; padding-left: 13px; }
.search-icon { width: 13px; height: 13px; transform: scale(.83); border: 1.7px solid var(--muted); border-radius: 50%; position: relative; flex-shrink: 0; }
.search-icon::after { content: ""; position: absolute; top: 9px; left: 9px; width: 6px; height: 1.7px; background: var(--muted); transform: rotate(45deg); }
.search input { min-width: 0; flex: 1; background: transparent; border: 0; border-radius: 3px; padding: 8px 2px; color: var(--ink); font-size: 13px; }
.search input::placeholder { color: #5a7176; }
.search button { align-self: stretch; padding: 0 11px; border: 0; border-left: 1px solid var(--line); border-radius: 0 7px 7px 0; color: var(--accent-dark); background: #eaf4f2; font-size: 12px; white-space: nowrap; }
.top-download { justify-self: end; font-size: 13px; font-weight: 700; white-space: nowrap; }
.top-download:hover { text-decoration: underline; }
#content { max-width: 1320px; padding: 29px clamp(20px, 3.2vw, 48px) 38px; margin: 0 auto; outline: none; }
.hero { position: relative; isolation: isolate; min-height: 310px; display: flex; align-items: center; padding: 38px 40px; border-radius: 15px; overflow: hidden; background: radial-gradient(ellipse at 87% 16%, #166a6c, transparent 54%), linear-gradient(120deg, #112d37 23%, #0c4651 100%); color: #f2fbfa; }
#wave-field { position: absolute; z-index: -2; width: 76%; height: 100%; left: 24%; top: 0; }
.hero::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #112e38 2%, #112e38 24%, #112e3800 67%); }
.hero-text { max-width: 520px; }
.eyebrow { margin: 0 0 10px; color: var(--accent-dark); font-size: 13px; font-weight: 700; letter-spacing: .09em; }
.hero .eyebrow { color: #adeddf; }
.hero h1 { margin: 0; font-size: clamp(36px, 4.04vw, 57px); line-height: 1.15; font-weight: 760; letter-spacing: .045em; }
.hero p:not(.eyebrow) { margin: 15px 0 22px; color: #d6ebea; font-size: 14px; line-height: 1.65; }
.hero-caption { position: absolute; right: 28px; bottom: 20px; font: 14px/1.5 "IBM Plex Mono", Consolas, monospace; letter-spacing: .01em; color: #c6ede8; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; gap: 9px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.button:hover { filter: brightness(.96); }
.hero-button { background: #c4f3e8; color: #124741; }
.primary { color: white; background: var(--accent); }
.secondary { color: var(--accent-dark); border-color: #c9dedb; background: #f6fcfa; }
.path-section { margin-top: 26px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 21px; }
.section-heading > span, .path-footer > span { color: var(--muted); font-size: 12px; }
.path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.path-card { display: flex; flex-direction: column; min-width: 0; padding: 20px 22px 17px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.path-top { display: flex; justify-content: space-between; align-items: flex-start; }
.part-symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; background: #dcf2ed; color: var(--accent-dark); font: 27px/1 "Instrument Serif", Georgia, serif; }
.simulation .part-symbol { background: #e2edf6; color: #345c7b; }
.part-period { padding-top: 4px; font-size: 12px; color: var(--muted); }
.path-card h3 { margin: 12px 0 5px; font-size: 23px; }
.path-card p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--muted); }
.topics { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.topics li { padding: 4px 8px; border-radius: 5px; background: #f0f6f6; color: #365b62; font-size: 11px; }
.path-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px; border-top: 1px solid var(--line); padding-top: 13px; margin-top: auto; }
.page-intro { padding: 15px 0 23px; }
.page-intro h1 { margin: 0; font-size: clamp(32px, 4vw, 49px); letter-spacing: .035em; line-height: 1.24; }
.page-intro p:not(.eyebrow) { margin: 11px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin-bottom: 19px; }
.tabs a { padding: 10px 3px 11px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 14px; }
.tabs a[aria-current] { border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.lesson-index { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 18px; }
.lesson-index a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 7px; background: #edf7f6; font-size: 13px; }
.lesson-index a:hover { background: #e1f1ee; }
.lesson-card, .question { border: 1px solid var(--line); border-radius: 12px; background: white; padding: clamp(15px, 2.5vw, 27px); margin-bottom: 13px; min-width: 0; scroll-margin-top: 14px; }
.lesson-card h2, .question h2 { margin: 0; line-height: 1.36; font-size: 21px; }
.lesson-card header { border-bottom: 1px solid var(--line); padding-bottom: 11px; margin-bottom: 13px; }
.lesson-card > .button { margin-top: 4px; }
.source { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.prose { font-size: 15px; line-height: 1.8; }
.prose p { margin: 7px 0 11px; }
.prose h4 { margin: 16px 0 5px; font-size: 16px; color: var(--accent-dark); }
.equation { max-width: 100%; overflow-x: auto; padding: 2px 4px; border-radius: 6px; background: #f5f9f9; }
.equation + .equation { margin-top: 7px; }
.equation .katex-display { margin: .51em 0; }
.equation .katex { font-size: 1.08em; }
.study-note { border-left: 3px solid #63a79f; background: #edf7f6; color: #234f51; padding: 7px 12px; }
.filterbar { display: flex; gap: 9px 15px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filterbar label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.filterbar select { max-width: min(68vw, 280px); min-height: 38px; padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line); background: white; color: var(--ink); }
.filterbar > span { color: var(--muted); font-size: 13px; }
.filterbar > button { margin-left: auto; }
.question-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.question-tags span { padding: 3px 7px; border-radius: 4px; background: #eef4f4; font-size: 11px; color: #3c5a61; }
.question-tags .question-number { background: #def2eb; color: #085d53; font-weight: 700; }
.question .prompt { padding: 4px 0; }
.question details { border-top: 1px solid var(--line); }
.question summary { padding: 10px 0; color: var(--accent-dark); font-size: 14px; font-weight: 700; }
.question details > .prose { padding: 4px 12px; background: #f8fbfb; border-radius: 6px; margin-bottom: 8px; }
.question details[open] summary { color: #244a50; }
.question-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.toggle-action { padding: 7px 12px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--muted); font-size: 13px; }
.toggle-action[aria-pressed="true"] { border-color: #93c8be; background: #def2eb; color: var(--accent-dark); font-weight: 700; }
.resource-group { margin-top: 22px; }
.resource-group > h2 { font-size: 20px; }
.resource-group > h2 small { color: var(--muted); margin-left: 5px; font-weight: 400; font-size: 13px; }
.resource-card { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 10px; background: white; margin-bottom: 8px; padding: 12px 14px; }
.resource-card h2, .resource-card h3 { margin: 0; font-size: 16px; }
.resource-card p, .resource-card small { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.resource-card .button { margin-left: auto; }
.resource-card.featured { background: #eaf6f3; }
.file-type { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 6px; background: #e2efef; color: #335d64; font: 12px/1 Consolas, monospace; }
.empty { padding: 16px; border-radius: 9px; background: white; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.empty a { text-decoration: underline; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.results a { display: grid; grid-template-columns: 1fr 22px; gap: 3px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 12px 14px; }
.results a:hover { background: #e9f5f2; }
.results span:not(.result-arrow) { grid-row: 2; color: var(--muted); font-size: 12px; }
.result-arrow { grid-row: 1 / span 2; grid-column: 2; align-self: center; justify-self: end; }
.lab-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; font-size: 14px; }
.lab-controls label { font-weight: 700; }
.lab-controls input { accent-color: var(--accent); }
.lab-controls > div { display: flex; flex-wrap: wrap; gap: 7px; }
#diffusion-plot { width: 100%; height: 235px; border-radius: 8px; }
.lab-readout { color: var(--muted); font-size: 13px; }
.footer { max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 3.2vw, 48px) 22px; color: var(--muted); font-size: 11px; }
.noscript { padding: 20px; }

@media (max-width: 1040px) { :root { --rail: 188px; } }
@media (max-width: 840px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; display: grid; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); padding: 13px 15px 10px; }
  .brand { margin: 0; }
  .brand-mark { width: 32px; height: 32px; font-size: 26px; }
  .brand small { display: none; }
  #menu { display: flex; flex-wrap: wrap; gap: 2px; }
  #menu a { min-height: 33px; padding: 6px 8px; gap: 2px; font-size: 13px; }
  #menu a span { font-size: 15px; width: 18px; }
  .rail-progress { display: none; }
  .topbar { grid-template-columns: 1fr auto; min-height: 54px; padding: 8px 15px; gap: 10px; }
  .breadcrumb { display: none; }
  #content { padding-top: 18px; }
}
@media (max-width: 560px) {
  #content { padding-inline: 12px; }
  .topbar { padding-inline: 12px; }
  .top-download { font-size: 11px; }
  .hero { min-height: 280px; padding: 23px 17px 35px; }
  .hero h1 { font-size: clamp(30px, 8vw, 39px); }
  .hero p:not(.eyebrow) { max-width: 246px; font-size: 13px; }
  .hero::after { background: linear-gradient(90deg, #112e38 7%, #112e38db 39%, #112e3800 100%); }
  .hero-caption { bottom: 9px; right: 13px; font-size: 10px; }
  .path-grid, .lesson-index { grid-template-columns: 1fr; gap: 8px; }
  .path-card { padding: 16px; }
  .section-heading h2 { font-size: 18px; }
  .tabs { gap: 12px; }
  .tabs a { font-size: 13px; }
  .filterbar > button { margin-left: 0; }
  .resource-card { gap: 9px; padding: 10px; }
  .resource-card .button { padding: 6px 8px; }
  .prose { font-size: 14px; }
}
