:root {
  color-scheme: light;
  --canvas: #ffffff;
  --soft: #f6f5f4;
  --surface: #fff;
  --ink: #000;
  --text: #31302e;
  --muted: #615d59;
  --line: #e6e6e6;
  --blue: #111111;
  --blue-active: #444444;
  --indigo: #ffffff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 16px/1.8 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
header { background: var(--surface); color: var(--ink); padding: 88px 24px 72px; border-bottom: 1px solid var(--line); }
header > div, main, footer { width: min(100% - 48px, 900px); margin-inline: auto; }
header > div { width: min(100%, 900px); }
header h1 { max-width: 850px; margin: 24px 0 16px; color: var(--ink); font-size: clamp(36px, 5vw, 60px); line-height: 1.2; letter-spacing: -.035em; }
header p { max-width: 42em; margin: 0; color: var(--muted); font-size: 18px; }
.tag { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; line-height: 1.5; }
main { padding: 40px 0 72px; }
section, .card { margin: 0 0 24px; padding: 32px 36px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.35; }
h2 { margin: 0 0 18px; font-size: 26px; letter-spacing: -.025em; }
h3 { margin: 28px 0 10px; font-size: 20px; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
section > :last-child { margin-bottom: 0; }
strong { color: var(--ink); }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-active); }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid #555; outline-offset: 3px; }
ul, ol { padding-left: 1.5em; }
li { margin: .55em 0; }
li::marker { color: var(--muted); }
nav { display: flex; justify-content: space-between; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin: 0 0 24px; font-size: 15px; }
nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; }
nav a:hover { text-decoration: underline; }
pre, code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { padding: 2px 5px; border-radius: 4px; background: var(--soft); font-size: .9em; overflow-wrap: anywhere; }
pre { max-width: 100%; padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9em; }
pre code { padding: 0; background: transparent; }
details, .note { margin: 16px 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
summary { cursor: pointer; color: var(--ink); font-weight: 600; }
details p { margin: 12px 0 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); color: var(--ink); font-weight: 600; }
footer { padding: 0 0 40px; color: var(--muted); font-size: 14px; }
.flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 24px 0; padding: 18px; border-radius: 8px; background: var(--soft); }
.flow span:not(:nth-child(even)) { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.flow span:nth-child(even) { color: var(--muted); }
.state-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 20px 0; }
.state-grid > div { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.state-grid p { margin: 5px 0 0; }
.lesson-illustration { margin: 24px 0; }
.lesson-illustration img { display: block; width: 100%; height: auto; }
.deep h3 { margin-top: 26px; }
.version-figure { margin: 24px 0; scroll-margin-top: 16px; }
.version-figure figcaption { margin-bottom: 10px; font-weight: 600; }
.version-timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; list-style: none; margin: 0; padding: 0; }
.version-timeline > li { position: relative; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.version-timeline h4 { margin: 0; font-size: 1em; }
.version-timeline ul { margin: 6px 0 0; padding-left: 1.2em; font-size: .94em; }
.version-timeline del { color: var(--muted); }
.version-arrow { position: absolute; top: 50%; right: -28px; width: 28px; text-align: center; color: var(--muted); font-weight: 600; transform: translateY(-50%); }
.version-arrow::before { content: '→'; }
/* The course list reads as a set of quiet document rows. */
.course-home .course-directory ol { list-style: none; counter-reset: lesson; margin: 0; padding: 0; }
.course-home .course-directory li { counter-increment: lesson; position: relative; margin: 0; padding: 15px 0 15px 44px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.course-home .course-directory li:last-child { border-bottom: 0; }
.course-home .course-directory li::before { content: counter(lesson, decimal-leading-zero); position: absolute; left: 0; top: 16px; color: #a39e98; font-size: 13px; font-weight: 600; }
.course-home .course-directory a { color: var(--ink); font-size: 16px; font-weight: 600; text-decoration: none; }
.course-home .course-directory a:hover { color: var(--blue-active); text-decoration: underline; }
.course-home .start-link { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 600; text-decoration: none; }
.course-home .start-link:hover { background: var(--blue-active); color: #fff; }
@media (max-width: 700px) {
  header { padding: 48px 20px 54px; }
  header > div { width: 100%; }
  header p { font-size: 16px; }
  main, footer { width: calc(100% - 32px); }
  main { padding: 24px 0 48px; }
  section, .card { padding: 24px 20px; margin-bottom: 16px; }
  h2 { font-size: 23px; }
  .version-timeline { grid-template-columns: minmax(0, 1fr); }
  .version-arrow { top: 100%; right: calc(50% - 14px); height: 28px; line-height: 28px; transform: none; }
  .version-arrow::before { content: '↓'; }
  th, td { padding: 10px 6px; overflow-wrap: anywhere; }
  table { font-size: 14px; }
}
