:root {
  --bg: #f8f7f3;
  --paper: #fffefa;
  --ink: #171717;
  --muted: #626a73;
  --soft: #e8e2d7;
  --line: #d8d3c8;
  --cyan: #0b7f93;
  --cyan-soft: #dff4f5;
  --amber: #b66d12;
  --amber-soft: #f7e3be;
  --code: #18222b;
  --code-bg: #12181d;
  --code-fg: #e8f6f8;
  --code-muted: #9fb0b8;
  --code-border: rgba(255, 255, 255, 0.14);
  --code-divider: rgba(255, 255, 255, 0.1);
  --code-control-bg: rgba(255, 254, 250, 0.12);
  --code-control-border: rgba(255, 255, 255, 0.22);
  --code-control-fg: #e8f6f8;
  --code-control-hover: rgba(127, 224, 237, 0.18);
  --code-success: #57c789;
  --shadow: 0 18px 50px rgba(33, 29, 23, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

:root[data-code-theme="light"] {
  --code-bg: #fffefa;
  --code-fg: #18222b;
  --code-muted: #58636d;
  --code-border: rgba(23, 23, 23, 0.14);
  --code-divider: rgba(23, 23, 23, 0.1);
  --code-control-bg: rgba(24, 34, 43, 0.06);
  --code-control-border: rgba(24, 34, 43, 0.2);
  --code-control-fg: #18222b;
  --code-control-hover: rgba(11, 127, 147, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 23, 23, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 23, 23, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid rgba(216, 211, 200, 0.78);
  background: rgba(248, 247, 243, 0.88);
  backdrop-filter: blur(18px);
}

.brand,
.top-nav,
.hero-actions,
.terminal-bar,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
}

.top-nav {
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a,
.header-action,
.phase-tab {
  min-height: 36px;
  padding: 9px 13px;
  border-radius: 8px;
}

.top-nav a:hover,
.header-action:hover,
.phase-tab:hover {
  background: rgba(11, 127, 147, 0.08);
  color: var(--cyan);
}

.header-action {
  justify-self: end;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.78fr);
  gap: clamp(30px, 5vw, 80px);
  min-height: calc(100vh - 66px);
  padding: clamp(54px, 8vw, 110px) clamp(20px, 6vw, 86px) 42px;
  align-items: center;
}

.hero-copy {
  max-width: 820px;
}

.series-label,
.section-kicker {
  margin: 0 0 16px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(58px, 8.2vw, 126px);
  font-weight: 680;
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-intro {
  max-width: 760px;
  margin-bottom: 30px;
  color: #30353a;
  font-size: clamp(17px, 2.1vw, 22px);
  line-height: 1.75;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 760;
}

.primary-link {
  background: var(--ink);
  color: var(--paper);
}

.secondary-link {
  border: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.72);
  color: var(--ink);
}

.route-panel {
  position: relative;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.82);
  box-shadow: var(--shadow);
}

.route-line {
  position: absolute;
  top: 52px;
  bottom: 52px;
  left: 52px;
  width: 2px;
  background: linear-gradient(var(--cyan), var(--amber));
}

.route-steps {
  position: relative;
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  align-items: start;
}

.route-steps span {
  position: relative;
  grid-row: 1 / span 2;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-size: 12px;
  font-weight: 820;
}

.route-steps strong {
  grid-column: 2;
  display: block;
  margin-bottom: 0;
  font-size: 18px;
}

.route-steps small {
  grid-column: 2;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.section-grid,
.experiments,
.references {
  display: grid;
  grid-template-columns: minmax(220px, 0.44fr) minmax(0, 0.56fr);
  gap: clamp(28px, 6vw, 90px);
  padding: 86px clamp(20px, 6vw, 86px);
  border-top: 1px solid rgba(216, 211, 200, 0.8);
}

.section-grid h2,
.section-heading h2,
.experiment-copy h2,
.references h2 {
  max-width: 680px;
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(34px, 4.4vw, 64px);
  font-weight: 620;
  line-height: 1.06;
}

.spine-copy > p,
.experiment-copy p {
  margin-bottom: 26px;
  color: #343a40;
  font-size: 18px;
  line-height: 1.8;
}

.principles {
  display: grid;
  gap: 12px;
}

.circuit-diagram {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(11, 127, 147, 0.2), rgba(182, 109, 18, 0.2)),
    rgba(255, 254, 250, 0.72);
}

.circuit-diagram::before {
  position: absolute;
  top: 50%;
  right: 34px;
  left: 34px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  content: "";
}

.circuit-diagram div {
  position: relative;
  z-index: 1;
  min-height: 94px;
  padding: 14px;
  border: 1px solid rgba(216, 211, 200, 0.9);
  border-radius: 8px;
  background: var(--paper);
}

.circuit-diagram strong,
.circuit-diagram span {
  display: block;
}

.circuit-diagram strong {
  margin-bottom: 8px;
  font-size: 15px;
}

.circuit-diagram span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.principles article {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.principles span {
  grid-row: 1 / span 2;
  color: var(--amber);
  font-weight: 860;
}

.principles h3 {
  grid-column: 2;
  margin-bottom: 6px;
  font-size: 17px;
}

.principles p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.featured,
.chapters,
.code-map {
  padding: 86px clamp(20px, 6vw, 86px);
  border-top: 1px solid rgba(216, 211, 200, 0.8);
}

.section-heading {
  display: grid;
  gap: 0;
  margin-bottom: 34px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.featured-grid a,
.code-map-grid a {
  min-height: 214px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.76);
  box-shadow: 0 12px 34px rgba(33, 29, 23, 0.04);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.featured-grid a:hover,
.code-map-grid a:hover {
  transform: translateY(-3px);
  border-color: rgba(11, 127, 147, 0.46);
  box-shadow: var(--shadow);
}

.featured-grid span {
  display: block;
  margin-bottom: 36px;
  color: var(--amber);
  font-weight: 860;
}

.featured-grid h3,
.code-map-grid strong {
  display: block;
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 1.25;
}

.featured-grid p,
.code-map-grid span {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.chapter-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.phase-tabs {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 8px;
}

.phase-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
}

.phase-tab.is-active {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.chapter-list {
  display: grid;
  gap: 10px;
}

.chapter-row {
  display: grid;
  grid-template-columns: 74px 1fr minmax(150px, 0.28fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.82);
}

.chapter-no {
  color: var(--cyan);
  font-weight: 860;
}

.chapter-main h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.chapter-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.chapter-meta span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4f5963;
  background: rgba(248, 247, 243, 0.72);
  font-size: 12px;
  font-weight: 740;
}

.experiments {
  align-items: center;
  background: #20262b;
  color: var(--paper);
}

.experiments .section-kicker {
  color: #7fe0ed;
}

.experiment-copy p {
  color: #d9dedf;
}

.terminal-window {
  overflow: hidden;
  border: 1px solid var(--code-border);
  border-radius: 8px;
  background: var(--code-bg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.terminal-bar {
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--code-divider);
}

.terminal-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #f2695f;
}

.terminal-bar span:nth-child(2) {
  background: #f3bf4a;
}

.terminal-bar span:nth-child(3) {
  background: #57c789;
}

pre {
  overflow-x: auto;
  margin: 0;
  padding: 50px 70px 22px 22px;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  line-height: 1.8;
}

pre code {
  font-size: 14px;
  color: var(--code-fg);
}

.code-map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.code-map-grid a {
  min-height: 150px;
}

.references {
  align-items: start;
}

.references ul {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.references li {
  display: grid;
  grid-template-columns: minmax(150px, 0.36fr) 1fr;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.references a {
  color: var(--cyan);
  font-weight: 820;
}

.references span {
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  justify-content: space-between;
  gap: 20px;
  padding: 26px clamp(20px, 6vw, 86px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer a {
  color: var(--ink);
  font-weight: 760;
}

.article-main {
  overflow: visible;
}

.article-hero {
  padding: clamp(46px, 7vw, 94px) clamp(20px, 6vw, 86px) 44px;
  border-bottom: 1px solid rgba(216, 211, 200, 0.8);
}

.article-hero > div {
  max-width: 1040px;
}

.article-hero h1 {
  max-width: 980px;
  margin-bottom: 22px;
  font-size: clamp(42px, 5.6vw, 82px);
  line-height: 1.04;
}

.article-back {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 28px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.7);
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.article-back:hover {
  color: var(--cyan);
  background: rgba(11, 127, 147, 0.08);
}

.article-summary {
  max-width: 820px;
  margin-bottom: 22px;
  color: #30353a;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.78;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-tags span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.75);
  color: #4f5963;
  font-size: 12px;
  font-weight: 780;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(190px, 0.22fr) minmax(0, 760px) minmax(0, 0.2fr);
  gap: clamp(24px, 4vw, 58px);
  padding: 54px clamp(20px, 6vw, 86px) 76px;
}

.article-toc {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 18px 0;
  color: var(--muted);
}

.article-toc strong {
  display: block;
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 840;
}

.article-toc nav {
  display: grid;
  gap: 8px;
}

.article-toc a {
  display: block;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.article-toc a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.article-toc .toc-level-2 {
  padding-left: 10px;
  font-weight: 740;
}

.article-toc .toc-level-3 {
  padding-left: 22px;
}

.markdown-body {
  min-width: 0;
  padding: 0 0 20px;
  color: #24292f;
  font-size: 17px;
  line-height: 1.86;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  scroll-margin-top: 96px;
}

.markdown-body h1 {
  margin: 0 0 26px;
  font-size: clamp(34px, 5vw, 66px);
}

.markdown-body h2 {
  margin: 46px 0 16px;
  padding-top: 8px;
  border-top: 1px solid rgba(216, 211, 200, 0.74);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(28px, 3.1vw, 42px);
  font-weight: 620;
  line-height: 1.2;
}

.markdown-body h3 {
  margin: 32px 0 12px;
  font-size: 22px;
  line-height: 1.35;
}

.markdown-body p,
.markdown-body li {
  color: #30363d;
}

.markdown-body p {
  margin: 0 0 18px;
}

.markdown-body ul,
.markdown-body ol {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  padding-left: 1.35em;
}

.markdown-body a {
  color: var(--cyan);
  font-weight: 720;
  text-decoration: underline;
  text-decoration-color: rgba(11, 127, 147, 0.28);
  text-underline-offset: 3px;
}

.lab-panel {
  margin: 0 0 34px;
  padding: 20px;
  border: 1px solid rgba(11, 127, 147, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(223, 244, 245, 0.82), rgba(255, 254, 250, 0.92)),
    var(--paper);
  box-shadow: 0 18px 42px rgba(33, 29, 23, 0.08);
}

.lab-panel-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.lab-panel-head span,
.lab-label {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 860;
  letter-spacing: 0;
}

.lab-panel-head strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.3;
}

.lab-panel p {
  margin-bottom: 16px;
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: stretch;
}

.lab-column {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(216, 211, 200, 0.86);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.72);
}

.lab-links {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.lab-links a {
  overflow-wrap: anywhere;
  text-decoration: none;
}

.lab-command {
  margin-top: 10px;
  padding: 48px 70px 14px 14px;
  border-radius: 8px;
  background: var(--code-bg);
}

.markdown-body .lab-command code {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--code-fg);
  font-size: 13px;
}

.lab-hint {
  margin: 14px 0 0;
  color: #4f5963;
  font-size: 14px;
  line-height: 1.7;
}

.markdown-body code {
  padding: 0.14em 0.34em;
  border: 1px solid rgba(216, 211, 200, 0.8);
  border-radius: 6px;
  background: rgba(255, 254, 250, 0.8);
  color: #0f3f4a;
  font-size: 0.88em;
}

.markdown-body .code-block {
  overflow: hidden;
  margin: 24px 0;
  border: 1px solid var(--code-border);
  border-radius: 8px;
  background: var(--code-bg);
  box-shadow: 0 18px 48px rgba(33, 29, 23, 0.16);
}

.markdown-body .code-block figcaption {
  padding: 10px 88px 10px 14px;
  border-bottom: 1px solid var(--code-divider);
  color: var(--code-muted);
  font-size: 12px;
  font-weight: 760;
}

.markdown-body .code-block pre {
  padding: 20px 70px 20px 20px;
}

.markdown-body .code-block code {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--code-fg);
  font-size: 14px;
}

.code-tool-host,
.code-pre-wrap {
  position: relative;
}

.code-pre-wrap {
  margin: 24px 0;
}

.code-pre-wrap pre {
  border-radius: 8px;
  background: var(--code-bg);
}

.terminal-window .code-pre-wrap {
  margin: 0;
}

.terminal-window .code-pre-wrap pre {
  border-radius: 0;
}

.lab-column .code-pre-wrap {
  margin: 10px 0 0;
}

.lab-column .lab-command {
  margin-top: 0;
}

.code-toolbar {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.code-tool-button {
  position: relative;
  width: 31px;
  height: 31px;
  border: 1px solid var(--code-control-border);
  border-radius: 8px;
  background: var(--code-control-bg);
  color: var(--code-control-fg);
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.code-tool-button:hover {
  border-color: rgba(11, 127, 147, 0.45);
  background: var(--code-control-hover);
  transform: translateY(-1px);
}

.code-tool-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.code-theme-button::before {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 15px;
  height: 15px;
  border: 1.8px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
  content: "";
}

.code-copy-button::before,
.code-copy-button::after {
  position: absolute;
  width: 11px;
  height: 13px;
  border: 1.7px solid currentColor;
  border-radius: 3px;
  content: "";
}

.code-copy-button::before {
  top: 7px;
  left: 10px;
}

.code-copy-button::after {
  top: 10px;
  left: 7px;
  background: var(--code-bg);
}

.code-copy-button.is-copied::before {
  top: 8px;
  left: 8px;
  width: 14px;
  height: 8px;
  border-width: 0 0 2px 2px;
  border-color: var(--code-success);
  border-radius: 0;
  transform: rotate(-45deg);
}

.code-copy-button.is-copied::after {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.72);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.markdown-body th,
.markdown-body td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(216, 211, 200, 0.76);
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  color: var(--ink);
  font-size: 13px;
}

.markdown-body td {
  color: #3b4249;
}

.markdown-body tr:last-child td {
  border-bottom: 0;
}

.markdown-body blockquote {
  margin: 24px 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--amber);
  color: var(--muted);
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 clamp(20px, 6vw, 86px) 76px;
}

.article-nav a,
.article-nav-empty {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.78);
}

.article-nav a:hover {
  border-color: rgba(11, 127, 147, 0.46);
  box-shadow: var(--shadow);
}

.article-nav span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.article-nav strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.article-nav-empty {
  color: var(--muted);
}

@media (max-width: 1040px) {
  .hero,
  .section-grid,
  .experiments,
  .references {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .featured-grid,
  .code-map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-shell {
    grid-template-columns: 1fr;
  }

  .article-toc {
    position: static;
    max-height: none;
    padding: 0;
  }

  .lab-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    display: none;
  }

  .hero {
    padding-top: 42px;
  }

  .route-panel {
    padding: 22px;
  }

  h1 {
    font-size: 48px;
    line-height: 1;
  }

  .hero {
    gap: 24px;
    padding-bottom: 28px;
  }

  .hero-intro {
    margin-bottom: 22px;
    font-size: 15px;
    line-height: 1.68;
  }

  .route-steps {
    gap: 14px;
  }

  .route-line {
    left: 44px;
  }

  .circuit-diagram {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
  }

  .circuit-diagram::before {
    display: none;
  }

  .chapter-layout {
    grid-template-columns: 1fr;
  }

  .phase-tabs {
    position: static;
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .phase-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .chapter-row {
    grid-template-columns: 1fr;
  }

  .chapter-meta {
    justify-content: flex-start;
  }

  .featured-grid,
  .code-map-grid {
    grid-template-columns: 1fr;
  }

  .references li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-hero {
    padding-top: 36px;
  }

  .article-shell {
    padding-top: 34px;
    padding-bottom: 48px;
  }

  .markdown-body {
    font-size: 16px;
    line-height: 1.78;
  }

  .article-nav {
    grid-template-columns: 1fr;
    padding-bottom: 52px;
  }
}
