@font-face {
  font-family: "Fuxinda Display";
  src: url("/fonts/noto-sans-sc-heading.woff2") format("woff2");
  font-style: normal;
  font-weight: 500 750;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #181b21;
  --muted: #565e67;
  --line: #e1e2e5;
  --paper: #fcfcfb;
  --white: #fff;
  --panel: #f4f4f2;
  --gold: #cfad66;
  --gold-dark: #785719;
  --gold-pale: #eee5d3;
  --night: #14171c;
  --night-text: #f3f1e9;
  --night-muted: #c5c0b6;
  --radius: 6px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --heading: "Fuxinda Display", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; min-width: 0; }
img { display: block; }
a { color: inherit; text-underline-offset: .25em; }
button { font: inherit; }
h1, h2, h3 { font-family: var(--heading); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 4px; }
.hero :focus-visible, .site-header :focus-visible { outline-color: var(--gold); }
::selection { color: var(--ink); background: var(--gold-pale); }

.shell { width: min(75rem, calc(100% - 5rem)); margin-inline: auto; }
.skip-link {
  position: fixed;
  z-index: 2;
  top: .5rem;
  left: .5rem;
  padding: .65rem .85rem;
  background: var(--white);
}
.skip-link:not(:focus) { clip-path: inset(50%); }

.site-header {
  background: #101216;
  color: var(--night-text);
  border-bottom: 1px solid #302d28;
}
.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-inner { min-height: 4.25rem; }
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-decoration: none;
  white-space: nowrap;
}
.brand img { width: 2.5rem; height: 2.5rem; margin-inline: -.18rem .28rem; }
.brand strong { font-size: 1.075rem; font-weight: 700; }
.brand span {
  margin-left: .7rem;
  padding-left: .7rem;
  border-left: 1px solid #484640;
  color: var(--night-muted);
  font-size: .875rem;
}
.site-nav { display: flex; gap: clamp(.75rem, 2.5vw, 2rem); color: var(--night-muted); }
.site-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; font-size: .875rem; white-space: nowrap; }
.site-nav a:hover { color: var(--gold); }

.hero { background: var(--night); color: var(--night-text); }
.hero-inner {
  min-height: 22rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  padding-block: 3.5rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.375rem, 6vw, 4.375rem);
  line-height: 1.13;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.hero-copy > p {
  max-width: 23em;
  margin: 1rem 0 1.7rem;
  color: var(--night-muted);
  line-height: 1.75;
  font-size: 1.0625rem;
  text-wrap: balance;
}
.primary-button, .quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .5rem .9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.primary-button { min-height: 3rem; padding-inline: 1.2rem; color: var(--ink); background: var(--gold); }
.primary-button:hover, .primary-button:active { background: #dfc384; }
.quiet-button { background: var(--white); color: var(--ink); border-color: #d5d6d4; }
.quiet-button:hover, .quiet-button:active { background: var(--gold-pale); border-color: var(--gold); }

.routing-diagram {
  --wire: #aa8d58;
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  align-items: center;
  gap: 1.55rem;
  margin: 0;
  padding: 1.65rem 1.4rem;
  border: 1px solid #443d31;
  border-radius: 10px;
  background: #1b1d22;
}
.diagram-source {
  position: relative;
  padding: .7rem .15rem;
  border: 1px solid #6b5a3e;
  border-radius: var(--radius);
  background: #222126;
  color: var(--night-text);
  text-align: center;
  font-size: .875rem;
  line-height: 1.3;
}
.diagram-branches { position: relative; display: grid; gap: .8rem; min-width: 0; }
.diagram-branches::before {
  content: "";
  position: absolute;
  left: -.8rem;
  inset-block: 25%;
  width: .8rem;
  border: 1px solid var(--wire);
  border-right: 0;
  border-radius: 4px 0 0 4px;
}
.diagram-source::after, .diagram-router::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: .85rem;
  border-top: 1px solid var(--wire);
}
.diagram-router::after { width: .42rem; }
.diagram-lane { display: grid; align-items: center; grid-template-columns: minmax(0, 1.07fr) minmax(0, 1fr); gap: .8rem; }
.diagram-router, .diagram-targets span { border: 1px solid #544833; border-radius: var(--radius); background: #24232a; }
.diagram-router {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 4.45rem;
  padding: .48rem .65rem;
  line-height: 1.25;
}
.diagram-router strong { font-size: 1.35rem; font-weight: 650; color: var(--gold); }
.diagram-router span { color: var(--night-text); font-size: .875rem; }
.diagram-targets {
  position: relative;
  display: grid;
  gap: .3rem;
  color: var(--night-muted);
  font-size: .875rem;
}
.diagram-targets::before {
  content: "";
  position: absolute;
  left: -.41rem;
  inset-block: calc((100% - .3rem) / 4);
  width: .41rem;
  border: 1px solid var(--wire);
  border-right: 0;
  border-radius: 3px 0 0 3px;
}
.diagram-targets span { padding: .18rem .48rem; }

.home-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, .43fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
  padding-block: 3rem 4.5rem;
}
.home-content h2 { margin: 0 0 1.15rem; font-size: 1.55rem; line-height: 1.25; letter-spacing: -.02em; }
.course-list { margin: 0; padding: 0; list-style: none; counter-reset: course; border-bottom: 1px solid var(--line); }
.course-list li { counter-increment: course; border-top: 1px solid var(--line); }
.course-link {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 5.25rem;
  padding: .7rem .6rem .7rem .15rem;
  text-decoration: none;
}
.course-link::before { content: counter(course, decimal-leading-zero); color: var(--gold-dark); font-size: 1.185rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.course-link > span { display: grid; gap: .28rem; }
.course-link strong { font-size: 1.075rem; font-weight: 700; }
.course-link > span > span { font-size: .925rem; color: var(--muted); line-height: 1.6; }
.course-link:hover { background: var(--panel); }
.course-link:hover strong, .resource-guide:hover strong { color: var(--gold-dark); }
.first-practice { margin-top: 1.45rem; }
.first-practice h3 { margin: 0 0 .3rem; font-size: 1rem; }
.first-practice p { margin: 0; color: var(--muted); line-height: 1.75; }
.chevron { width: .52rem; height: .52rem; border: solid var(--gold-dark); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.resources { padding: 1.35rem 1.4rem 1.45rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.resources h2 { margin-bottom: .65rem; font-size: 1.2rem; }
.resource-guide { display: grid; gap: .2rem; padding-block: .7rem; text-decoration: none; }
.resource-guide strong { font-size: 1rem; text-decoration: underline; text-decoration-color: #a98647; }
.resource-guide span { color: var(--muted); font-size: .875rem; }
.resource-demos { margin-top: .7rem; border-top: 1px solid #dcdedb; padding-top: .9rem; }
.resource-demos h3 { margin: 0 0 .65rem; font-size: .875rem; font-weight: 650; }
.demo-links { display: flex; flex-wrap: wrap; gap: .55rem; }

.lesson-layout {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 42.5rem) minmax(8.5rem, 1fr);
  align-items: start;
  gap: clamp(1rem, 3.1vw, 2.75rem);
  padding-block: 3.2rem 4.5rem;
}
.lesson, .prose { min-width: 0; }
.course-menu, .on-page { position: sticky; top: 1.75rem; }
.menu-title { margin: .15rem 0 .6rem; color: var(--muted); font-size: .875rem; font-weight: 700; }
.course-menu ol, .on-page ul { margin: 0; padding: 0; list-style: none; }
.course-menu a, .on-page a { display: block; padding: .56rem .55rem; color: var(--muted); line-height: 1.55; font-size: .875rem; text-decoration: none; }
.course-menu a { border-radius: var(--radius); }
.course-menu a:hover { background: var(--panel); color: var(--ink); }
.course-menu a[aria-current] { background: var(--gold-pale); color: var(--gold-dark); font-weight: 700; }
.on-page { padding-left: 1rem; border-left: 1px solid var(--line); }
.on-page a { padding-inline: 0; }
.on-page a:hover { color: var(--gold-dark); text-decoration: underline; }
.mobile-menu { display: none; }

.prose { font-size: 1rem; line-height: 1.85; overflow-wrap: anywhere; }
.prose h1 { margin: 0 0 1rem; font-size: 2.45rem; line-height: 1.24; letter-spacing: -.03em; text-wrap: balance; }
.prose h2 { margin: 2.4rem 0 .65rem; font-size: 1.42rem; line-height: 1.4; scroll-margin-top: 1rem; }
.prose h3 { margin: 1.6rem 0 .5rem; font-size: 1.16rem; line-height: 1.4; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose table { margin: 0 0 1.05rem; }
.prose h1 + p { color: var(--muted); font-size: 1.0625rem; }
.prose li + li { margin-top: .38rem; }
.prose ol, .prose ul { padding-left: 1.45rem; }
.prose a:not([class]) { color: var(--gold-dark); text-decoration-thickness: 1px; }
.prose a:hover { color: var(--ink); }
.prose blockquote { padding: .75rem 1rem; background: #f2ece1; border-left: 1px solid var(--gold); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .875rem; }
.prose :not(pre) > code { padding: .12rem .24rem; background: var(--panel); border-radius: 3px; }
.prose pre { overflow: auto; padding: .85rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: .925rem; line-height: 1.65; }
.prose th, .prose td { padding: .62rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--panel); font-weight: 650; }
.prose th:first-child { min-width: 6.65rem; }
.prose td:first-child { font-weight: 650; }
.cell-label { display: none; }
.copy-actions, .share-tool { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.copy-actions { margin-bottom: .5rem; }
.copy-block pre { white-space: pre-wrap; overflow-wrap: anywhere; }
[role="status"] { color: var(--muted); font-size: .875rem; }
.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .65rem 1rem; margin-top: 2.25rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.pagination a { display: inline-flex; flex-direction: column; justify-content: center; min-height: 3rem; color: var(--gold-dark); font-size: .95rem; }
.pagination a[rel="next"] { margin-left: auto; }
.pagination span { color: var(--muted); font-size: .875rem; }
.customer-layout { max-width: 42.5rem; padding-block: 3.3rem 4rem; }
.share-tool { margin-top: 1.7rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.footer-inner { min-height: 4.25rem; font-size: .875rem; }
.footer-inner a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--gold-dark); }

@media (max-width: 68rem) {
  .lesson-layout { grid-template-columns: 11rem minmax(0, 42.5rem); justify-content: center; }
  .on-page { display: none; }
}

@media (max-width: 51rem) {
  .shell { width: calc(100% - 2.75rem); }
  .hero-inner { grid-template-columns: 1fr minmax(0, .85fr); gap: 1.35rem; min-height: 19.5rem; }
  .routing-diagram { padding: 1rem .75rem; grid-template-columns: 3rem minmax(0, 1fr); }
  .home-content { column-gap: 1.75rem; }
  .lesson-layout { display: block; max-width: 42.5rem; padding-block: 1.3rem 3.5rem; }
  .course-menu { position: static; margin-bottom: 1.45rem; }
  .desktop-menu { display: none; }
  .mobile-menu { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
  .mobile-menu summary { min-height: 2.75rem; padding: .7rem .85rem; font-size: .925rem; font-weight: 650; cursor: pointer; }
  .mobile-menu nav { padding: 0 .6rem .6rem; }
}

@media (max-width: 40rem) {
  .shell { width: calc(100% - 2rem); }
  .hero-inner { grid-template-columns: 1fr; gap: 1.45rem; padding-block: 2rem; }
  .hero-copy > p { max-width: 25em; margin-block: .7rem 1.1rem; font-size: 1rem; }
  .routing-diagram { padding: .9rem; max-width: 27rem; }
  .diagram-router { min-height: 3.5rem; }
  .home-content { grid-template-columns: 1fr; gap: 1.65rem; padding-block: 1.85rem 2.7rem; }
  .home-content h2 { font-size: 1.32rem; }
  .course-link { grid-template-columns: 1.85rem minmax(0, 1fr) auto; gap: .65rem; padding-block: .62rem; }
  .course-link strong { font-size: 1rem; }
  .course-link > span > span { font-size: .875rem; }
  .resources { padding: 1rem; }
  .site-nav .nav-course { display: none; }
  .header-inner { min-height: 3.65rem; }
  .brand span { margin-left: .45rem; padding-left: .45rem; }
  .site-nav { gap: .75rem; }
  .site-nav a { font-size: .875rem; }
  .prose h1 { font-size: 1.95rem; }
  .prose h2 { margin-top: 1.85rem; font-size: 1.3rem; }
  .prose h1 + p { font-size: 1rem; }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .prose tbody tr { padding-block: .45rem; border-bottom: 1px solid var(--line); }
  .prose tbody tr:first-child { border-top: 1px solid var(--line); }
  .prose td { padding: .24rem .35rem; border: 0; }
  .cell-label { display: block; color: var(--muted); font-size: .875rem; font-weight: 650; }
  .customer-layout { padding-block: 2rem 3rem; }
}

@media (max-width: 23rem) {
  .brand span { display: none; }
  .header-inner { gap: .55rem; }
  .routing-diagram { gap: 1.45rem; }
  .diagram-router { padding-inline: .45rem; }
  .diagram-targets span { padding-inline: .3rem; }
}
