:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --paper: #f5f5f7;
  --panel: #ffffff;
  --panel-strong: #1d1d1f;
  --line: rgba(29, 29, 31, 0.1);
  --line-strong: rgba(29, 29, 31, 0.18);
  --muted: #6e6e73;
  --accent: #0066cc;
  --accent-soft: rgba(0, 102, 204, 0.1);
  --blue: #0066cc;
  --green: #248a3d;
  --gold: #a05a00;
  --code: #1d1d1f;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.72);
  --surface-input: #ffffff;
  --topbar-bg: rgba(250, 250, 252, 0.78);
  --max: 1240px;
  --radius: 18px;
  --radius-small: 12px;
  --shadow-small: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 2px 6px rgba(0, 0, 0, 0.05), 0 24px 64px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 3%, rgba(0, 113, 227, 0.08), transparent 28rem),
    radial-gradient(circle at 8% 28%, rgba(120, 120, 128, 0.07), transparent 24rem),
    var(--paper);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC", "Helvetica Neue", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  line-height: 1.65;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Keyboard users can bypass the repeated header and global navigation. */
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-small);
  background: var(--panel-strong);
  color: var(--paper);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
code {
  padding: 0.12em 0.34em;
  border: 1px solid rgba(17, 17, 15, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.92em;
}
pre {
  overflow-x: auto;
  margin: 16px 0 0;
  padding: 18px;
  border-radius: 16px;
  background: var(--code);
  color: #f5f5f7;
  line-height: 1.58;
  font-size: 0.9rem;
  box-shadow: var(--shadow-medium);
}
pre code { padding: 0; border: 0; background: transparent; color: inherit; }
mark { padding: 0 0.08em; background: #ffe08a; color: #11110f; }
h1, h2, h3 { margin: 0; line-height: 1.06; text-wrap: balance; }
h1 { max-width: 1040px; font-size: clamp(3rem, 6vw, 6rem); font-weight: 760; letter-spacing: -0.045em; }
h2 { max-width: 900px; font-size: clamp(2rem, 3.7vw, 3.65rem); font-weight: 730; letter-spacing: -0.038em; }
h3 { font-size: 1.14rem; line-height: 1.24; letter-spacing: -0.014em; }
p { margin: 0; }

.topbar {
  position: sticky;
  top: 10px;
  z-index: 30;
  width: min(calc(100% - 32px), 1160px);
  margin: 10px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 0 rgba(29, 29, 31, 0.04), 0 12px 36px rgba(29, 29, 31, 0.09);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 9px 10px 9px 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 680;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.brand-mark {
  width: 30px;
  height: 30px;
  position: relative;
  border-radius: 9px;
  background: linear-gradient(145deg, #36a4ff 0%, #0066cc 58%, #004c99 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46), 0 5px 14px rgba(0, 102, 204, 0.22);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 4px;
}
main {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.hero,
.section,
.footer {
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto;
}
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(30px, 5vw, 58px);
  align-items: center;
  justify-items: center;
  min-height: min(820px, calc(100vh - 96px));
  padding: 92px 0 84px;
}
.home-hero {
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.78fr);
  justify-items: stretch;
  min-height: min(760px, calc(100vh - 126px));
  padding: 80px 0 64px;
}
.home-hero h1 {
  max-width: 10.8ch;
  font-size: clamp(2.8rem, 4.8vw, 5rem);
  line-height: 1.02;
}
.home-hero .hero-copy {
  justify-items: start;
  align-self: center;
  text-align: left;
}
.home-hero .lead {
  max-width: 720px;
}
.home-hero .hero-actions {
  justify-content: flex-start;
}
.hero.compact {
  min-height: auto;
  padding: 84px 0 58px;
}
.hero-copy {
  display: grid;
  justify-items: center;
  gap: 22px;
  text-align: center;
}
.hero-kicker,
.section-kicker {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.lead {
  max-width: 790px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.24rem);
  line-height: 1.62;
  letter-spacing: -0.012em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 17px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 7px 20px rgba(0, 102, 204, 0.2);
}
.button:hover,
.button:focus-visible {
  transform: translateY(-1px) scale(1.012);
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(29, 29, 31, 0.1);
  outline: none;
}
.button.primary:hover,
.button.primary:focus-visible {
  border-color: #0077ed;
  background: #0077ed;
  box-shadow: 0 10px 28px rgba(0, 102, 204, 0.26);
}
.button:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}
.hero-visual {
  overflow: hidden;
  width: min(920px, 100%);
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: var(--shadow-medium);
}
.hero-visual img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: var(--surface);
}
.route-panel {
  display: grid;
  gap: 0;
  min-height: auto;
  padding: clamp(12px, 2vw, 18px);
}
.route-panel a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px 14px;
  align-items: start;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-small);
  padding: 16px 14px;
  background: transparent;
  text-decoration: none;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 180ms ease;
}
.route-panel a:last-child { border-bottom-color: transparent; }
.route-panel a:hover,
.route-panel a:focus-visible {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.76);
  outline: none;
}
.route-panel a:active { transform: scale(0.985); transition-duration: 80ms; }
.route-panel span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 760;
}
.route-panel strong {
  display: block;
  line-height: 1.24;
  letter-spacing: -0.012em;
}
.route-panel em {
  display: block;
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
  font-size: 0.94rem;
}
.terminal-card {
  display: grid;
  align-content: end;
  min-height: 360px;
  padding: clamp(18px, 3vw, 32px);
}
.terminal-card pre {
  margin: 0;
  box-shadow: none;
  background: rgba(15, 15, 15, 0.74);
  white-space: pre-wrap;
  text-align: left;
}

.section {
  padding: clamp(82px, 10vw, 128px) 0 0;
  scroll-margin-top: 90px;
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.55fr);
  gap: clamp(22px, 4vw, 48px);
  align-items: end;
  margin-bottom: 34px;
}
.section-head p {
  color: var(--muted);
  max-width: 560px;
  font-size: 1.04rem;
  line-height: 1.68;
}
.section-title {
  display: grid;
  gap: 12px;
}
.callout {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  line-height: 1.65;
}
.callout a { color: var(--accent); }

.bento,
.source-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 16px;
}
.split-visual {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.6fr);
  gap: 18px;
  align-items: stretch;
}
.figure-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  box-shadow: var(--shadow-small);
  padding: clamp(18px, 2.4vw, 26px);
}
.article-illustration { margin-top: 22px; }
.figure-card img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface);
}
.figure-card figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: center;
}
.mermaid-card {
  overflow: hidden;
}
.mermaid {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow-x: auto;
  padding: clamp(14px, 2.4vw, 26px) 8px;
  border-radius: 14px;
  background: var(--surface);
}
.mermaid svg {
  width: 100% !important;
  max-width: 1180px;
  max-height: 720px;
  min-width: 0;
  height: auto;
}

.mermaid-large .mermaid {
  padding: 14px 0 8px;
  justify-content: stretch;
}

.mermaid-large .mermaid svg {
  width: 100% !important;
  max-width: 1240px !important;
}
.route-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.route-pill {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}
.route-pill strong {
  display: block;
  margin-bottom: 4px;
}
.route-pill span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}
.card,
.source-card {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: clamp(20px, 2.4vw, 28px);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 180ms ease, background-color 180ms ease, box-shadow 220ms ease;
}
.card:hover,
.card:focus-within,
.source-card:hover,
.source-card:focus-visible {
  transform: translateY(-3px) scale(1.006);
  border-color: rgba(0, 102, 204, 0.24);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-small);
  outline: none;
}
.source-card:active { transform: scale(0.985); transition-duration: 80ms; }
.card h3,
.source-card h3 { margin-bottom: 9px; }
.card p,
.step p,
.source-card p,
.content-block p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.dark-card {
  background: var(--panel-strong);
  color: #f5f5f7;
}
.priority-card {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-small);
}
.priority-card::after {
  content: "";
  position: absolute;
  inset: auto 22px 18px auto;
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
}
.dark-card p,
.dark-card code { color: rgba(245, 245, 247, 0.72); }

.decision-table {
  display: grid;
  gap: 10px;
}
.decision-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(170px, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 16px;
}
.decision-row strong { color: var(--ink); }
.decision-row span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.tier-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tier-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(17, 17, 15, 0.14);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}
.repair-card {
  border-left: 4px solid var(--accent);
}

.mini-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.mini-list li {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
}
.mini-list strong { color: var(--ink); }
.dark-card .mini-list li { border-color: rgba(245, 245, 247, 0.16); }
.dark-card .mini-list strong { color: #f5f5f7; }

.doc-layout {
  width: min(calc(100% - 36px), var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding-top: 38px;
}
.doc-content {
  min-width: 0;
}
.content-block {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-soft);
  padding: clamp(24px, 4vw, 44px);
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.025);
}
.content-block h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  counter-reset: step;
}
.step {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 26px 26px 26px 70px;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 23px;
  left: 22px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
}
.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-top: 112px;
  padding: 50px 0 70px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer strong { color: var(--ink); }

.topbar-actions,
.page-freshness,
.page-sequence {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-trigger,
.search-close,
.copy-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 160ms ease, border-color 160ms ease;
}
.search-trigger:hover,
.search-close:hover,
.copy-button:hover { background: var(--surface); border-color: var(--line-strong); }
.search-trigger:active,
.search-close:active,
.copy-button:active { transform: scale(0.96); transition-duration: 70ms; }
.search-trigger:focus-visible,
.search-close:focus-visible,
.copy-button:focus-visible,
.heading-permalink:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.search-dialog {
  width: min(calc(100% - 32px), 760px);
  max-height: min(82vh, 760px);
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 0;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  backdrop-filter: blur(32px) saturate(180%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.24);
}
.search-dialog[open] { animation: materialize-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.search-dialog::backdrop { background: rgba(0, 0, 0, 0.34); backdrop-filter: blur(3px); }
.search-dialog-panel { display: grid; gap: 14px; padding: clamp(20px, 4vw, 34px); }
.search-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.search-title { font-size: clamp(1.75rem, 4vw, 2.6rem); font-weight: 790; line-height: 1.06; }
.search-label { color: var(--muted); font-size: 0.92rem; }
.search-input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.search-input:focus { outline: 3px solid var(--blue); outline-offset: 2px; }
.search-message { min-height: 1.5em; color: var(--muted); font-size: 0.9rem; }
.search-results {
  display: grid;
  gap: 8px;
  max-height: min(48vh, 430px);
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.search-option {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.56);
  cursor: pointer;
}
.search-option[aria-selected="true"],
.search-option:hover { border-color: rgba(0, 102, 204, 0.34); background: var(--surface); }
.search-option span { color: var(--accent); font-size: 0.88rem; font-weight: 720; }
.search-option small { color: var(--muted); line-height: 1.45; }
.copy-block { margin-top: 16px; }
.copy-block pre { margin-top: 8px; }
.copy-tools { display: flex; min-height: 40px; align-items: center; gap: 10px; }
.copy-button { min-height: 36px; padding: 5px 13px; }
.copy-button:disabled { cursor: wait; opacity: 0.62; }
.copy-status { color: var(--muted); font-size: 0.86rem; }
.heading-permalink {
  display: inline-flex;
  margin-left: 0.28em;
  color: var(--accent);
  font-size: 0.55em;
  text-decoration: none;
  opacity: 0.34;
  vertical-align: 0.16em;
}
h2:hover .heading-permalink,
h3:hover .heading-permalink,
.heading-permalink:focus-visible { opacity: 1; }
.menu-toggle {
  display: none;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
}
.toolbook-shell {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  gap: clamp(20px, 2.5vw, 42px);
  width: min(calc(100% - 32px), 1560px);
  margin: 38px auto 0;
  align-items: start;
}
.toolbook-main { min-width: 0; }
.toolbook-main > main { overflow: visible; }
.toolbook-shell .hero,
.toolbook-shell .section,
.toolbook-shell .doc-layout {
  width: 100%;
}
.toolbook-shell .doc-layout { grid-template-columns: minmax(0, 1fr); }
.global-nav {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 22px;
  background: rgba(231, 231, 236, 0.6);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  padding: 14px;
  box-shadow: 0 1px 0 rgba(29, 29, 31, 0.04);
}
.page-toc {
  margin: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 8px 14px;
}
.global-nav-group + .global-nav-group { margin-top: 18px; }
.global-nav-group strong,
.page-toc summary {
  display: block;
  padding: 4px 8px 8px;
  font-size: 0.76rem;
  font-weight: 680;
  letter-spacing: 0.045em;
  color: var(--muted);
}
.global-nav a,
.page-toc a {
  display: block;
  border-radius: 10px;
  padding: 8px 9px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.87rem;
  line-height: 1.35;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.global-nav a:hover,
.global-nav a:focus-visible,
.page-toc a:hover,
.page-toc a:focus-visible,
.page-toc a[aria-current="location"] {
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}
.global-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 5px 16px rgba(0, 0, 0, 0.04);
}
.global-nav a:active,
.page-toc a:active { transform: scale(0.97); }
.page-toc details > summary { cursor: pointer; font-weight: 760; }
.page-toc details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 4px 0;
}
.page-toc details > summary::after {
  content: "展开";
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 760;
}
.page-toc details[open] > summary::after { content: "收起"; }
.page-toc nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 2px 12px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding: 10px 0 4px;
}
.page-toc a { break-inside: avoid; }
.page-toc .toc-h3 { padding-left: 16px; font-size: 0.82rem; }
.global-nav-disclosure { margin: 2px 0; }
.global-nav-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  padding: 8px 9px;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
}
.global-nav-disclosure > summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 760;
}
.global-nav-disclosure[open] > summary::after { content: "−"; }
.global-nav-disclosure > summary:hover,
.global-nav-disclosure > summary:focus-visible { background: rgba(255, 255, 255, 0.72); outline: none; }
.global-nav-disclosure > a { padding-left: 20px; font-size: 0.82rem; }
.breadcrumbs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}
.page-freshness {
  flex-wrap: wrap;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.8rem;
}
.page-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -8px 0 20px;
  color: var(--muted);
  font-size: 0.8rem;
}
.page-sources > strong { color: var(--ink); }
.page-source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.68);
  text-decoration: none;
}
.page-source-link .external-link-indicator { order: 3; margin-left: 0; }
.source-kind {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}
.recent-updates { padding-top: 26px; }
.update-grid,
.update-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.update-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.update-card > a,
.update-row > a {
  display: grid;
  gap: 7px;
  color: inherit;
  text-decoration: none;
}
.update-card > a {
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: var(--surface-soft);
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 180ms ease, box-shadow 200ms ease;
}
.update-card > a:hover,
.update-card > a:focus-visible { transform: translateY(-2px); border-color: rgba(0, 102, 204, 0.28); box-shadow: var(--shadow-small); outline: none; }
.update-card > a:active { transform: scale(0.985); transition-duration: 80ms; }
.update-card strong { font-size: 1.02rem; }
.update-card > a > span:last-child,
.update-row > a > span:last-child { color: var(--muted); }
.update-meta { display: flex; gap: 8px; color: var(--accent); font-size: 0.76rem; font-weight: 780; }
.changelog-disclosure {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--surface-soft);
}
.changelog-disclosure > summary { cursor: pointer; font-weight: 780; }
.update-list { margin-top: 12px; }
.update-row { border-top: 1px solid var(--line); padding: 12px 0; }
.update-row:first-child { border-top: 0; }
.page-sequence {
  justify-content: space-between;
  margin-top: 42px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.page-sequence a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--surface-soft);
  text-decoration: none;
  font-weight: 650;
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 160ms ease;
}
.page-sequence a:hover,
.page-sequence a:focus-visible { background: var(--surface); outline: none; }
.page-sequence a:active { transform: scale(0.97); }


.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.theme-control { display: inline-flex; align-items: center; }
.theme-select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 30px 7px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
}
.theme-select:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.external-link-indicator { margin-left: 0.28em; color: var(--accent); font-weight: 800; }
.diagram-status { margin-bottom: 10px; color: var(--accent); font-weight: 720; }
.mermaid[data-mermaid-failed="true"] {
  display: block;
  min-height: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f7;
  --paper: #000000;
  --panel: #1c1c1e;
  --panel-strong: #f5f5f7;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --muted: #a1a1a6;
  --accent: #2997ff;
  --accent-soft: rgba(41, 151, 255, 0.16);
  --blue: #2997ff;
  --green: #30d158;
  --gold: #ff9f0a;
  --code: #111113;
  --surface: #1c1c1e;
  --surface-soft: rgba(28, 28, 30, 0.78);
  --surface-input: #242426;
  --topbar-bg: rgba(28, 28, 30, 0.74);
  --shadow-small: 0 1px 1px rgba(0, 0, 0, 0.32), 0 12px 32px rgba(0, 0, 0, 0.34);
  --shadow-medium: 0 2px 6px rgba(0, 0, 0, 0.38), 0 28px 72px rgba(0, 0, 0, 0.46);
}
:root[data-theme="dark"] .topbar { background: var(--topbar-bg); border-color: rgba(255, 255, 255, 0.12); }
:root[data-theme="dark"] code { border-color: var(--line); background: var(--surface-input); }
:root[data-theme="dark"] .button,
:root[data-theme="dark"] .hero-visual,
:root[data-theme="dark"] .hero-visual img,
:root[data-theme="dark"] .figure-card,
:root[data-theme="dark"] .figure-card img,
:root[data-theme="dark"] .mermaid,
:root[data-theme="dark"] .route-pill,
:root[data-theme="dark"] .priority-card,
:root[data-theme="dark"] .search-input,
:root[data-theme="dark"] .search-option,
:root[data-theme="dark"] .search-option:hover,
:root[data-theme="dark"] .search-option[aria-selected="true"] {
  background: var(--surface-input);
}
:root[data-theme="dark"] .route-panel a,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .source-card,
:root[data-theme="dark"] .decision-row,
:root[data-theme="dark"] .callout,
:root[data-theme="dark"] .content-block,
:root[data-theme="dark"] .step {
  background: var(--surface-soft);
}
:root[data-theme="dark"] .dark-card { background: #f5f5f7; color: #1d1d1f; }
:root[data-theme="dark"] .dark-card p,
:root[data-theme="dark"] .dark-card code { color: rgba(29, 29, 31, 0.72); }
:root[data-theme="dark"] .dark-card code {
  border-color: rgba(29, 29, 31, 0.1);
  background: rgba(29, 29, 31, 0.08);
}
:root[data-theme="dark"] .dark-card .mini-list li {
  border-color: rgba(29, 29, 31, 0.12);
  color: #6e6e73;
}
:root[data-theme="dark"] .dark-card .mini-list strong { color: #1d1d1f; }
:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 78% 3%, rgba(41, 151, 255, 0.14), transparent 30rem),
    radial-gradient(circle at 8% 28%, rgba(99, 99, 102, 0.12), transparent 24rem),
    var(--paper);
}
:root[data-theme="dark"] .global-nav { background: rgba(44, 44, 46, 0.72); border-color: rgba(255, 255, 255, 0.1); }
:root[data-theme="dark"] .global-nav a[aria-current="page"] { background: rgba(99, 99, 102, 0.34); }
:root[data-theme="dark"] .search-dialog { background: rgba(28, 28, 30, 0.9); }

@keyframes materialize-in {
  from { opacity: 0; transform: scale(0.97) translateY(8px); filter: blur(5px); }
  to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

@keyframes hero-arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-hero .hero-copy,
.home-hero .hero-visual {
  animation: hero-arrive 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.home-hero .hero-visual { animation-delay: 80ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar,
  .global-nav,
  .hero-visual,
  .search-dialog {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--surface);
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(29, 29, 31, 0.34);
    --line-strong: rgba(29, 29, 31, 0.58);
  }
  :root[data-theme="dark"] {
    --line: rgba(255, 255, 255, 0.4);
    --line-strong: rgba(255, 255, 255, 0.64);
  }
  .topbar,
  .global-nav,
  .hero-visual,
  .search-dialog,
  .card,
  .source-card,
  .content-block { border-color: var(--line-strong); }
  .global-nav a[aria-current="page"] { outline: 2px solid var(--accent); outline-offset: -2px; }
}

@media (max-width: 980px) {
  .topbar { position: sticky; top: 8px; border-radius: 22px; }
  .topbar-inner { align-items: flex-start; flex-direction: column; }
  .hero,
  .home-hero,
  .section-head,
  .footer,
  .doc-layout,
  .split-visual,
  .decision-row,
  .route-strip { grid-template-columns: 1fr; }
  .update-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 68px; }
  .home-hero .hero-copy { justify-items: center; text-align: center; }
  .home-hero .hero-actions { justify-content: center; }
  .hero-visual,
  .terminal-card { min-height: 320px; }
  .span-12,
  .span-8,
  .span-6,
  .span-4,
  .span-3 { grid-column: span 6; }
  .section-head p { max-width: 720px; }
  .toolbook-shell { grid-template-columns: minmax(0, 1fr); }
  .toolbook-main { order: 2; }
  .global-nav { order: 0; position: static; max-height: none; }
  .menu-toggle { display: inline-flex; align-items: center; }
  html.js .global-nav { display: none; }
  html.js body.nav-open .global-nav { display: block; animation: materialize-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
}
@media (max-width: 720px) {
  .hero,
  .section,
  .footer,
  .doc-layout { width: min(calc(100% - 24px), var(--max)); }
  h1 { font-size: clamp(2.5rem, 13vw, 4rem); letter-spacing: -0.05em; }
  h2 { font-size: clamp(1.95rem, 9vw, 3rem); }
  .lead { font-size: 1rem; }
  .button { width: 100%; }
  .hero-actions { width: 100%; }
  .route-panel a { grid-template-columns: 38px minmax(0, 1fr); }
  pre {
    max-width: 100%;
    font-size: 0.82rem;
  }
  pre code {
    display: block;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .mermaid {
    justify-content: start;
    padding-block: 12px;
  }
  .mermaid svg { min-width: 720px; }
  .mermaid-large .mermaid { padding-bottom: 12px; }
  .bento,
  .source-grid,
  .steps { grid-template-columns: 1fr; }
  .span-12,
  .span-8,
  .span-6,
  .span-4,
  .span-3 { grid-column: span 1; }
  .mini-list li { grid-template-columns: 1fr; }
  .footer { align-items: start; }
  .toolbook-shell { width: min(calc(100% - 24px), var(--max)); margin-top: 22px; }
  .topbar { width: min(calc(100% - 16px), 1160px); }
  .topbar-inner { align-items: stretch; flex-direction: column; padding: 10px 12px; }
  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
    margin-left: 0;
    gap: 7px;
  }
  .theme-control,
  .theme-select { min-width: 0; width: 100%; }
  .search-trigger,
  .menu-toggle { min-height: 44px; padding-inline: 11px; }
  .search-dialog { width: min(calc(100% - 20px), 760px); max-height: calc(100vh - 20px); }
  .search-dialog-panel { padding: 18px; }
  .page-sequence { align-items: stretch; flex-direction: column; }
}
