:root {
  color-scheme: light;
  --ink: #202922;
  --muted: #6d7871;
  --accent: #3b713e;
  --accent-soft: #edf4eb;
  --line: #e4e9e3;
  --paper: #ffffff;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-family: var(--sans);
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; font-size: 16px; line-height: 1.85; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 4px; }
button { font: inherit; }
::selection { color: #213b24; background: #def0d5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
.skip-link { position: fixed; z-index: 50; top: 8px; left: 16px; padding: 8px 16px; transform: translateY(-160%); border-radius: 6px; background: var(--ink); color: #fff; }
.skip-link:focus { transform: translateY(0); }

/* A quiet, persistent header keeps the guide connected to the main site. */
.topbar { position: sticky; z-index: 20; top: 0; background: #fffffff5; border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-inner { width: min(1200px, calc(100% - 64px)); min-height: 70px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 18px; font-weight: 740; letter-spacing: -.035em; }
.brand-mark { width: 28px; height: 28px; display: inline-flex; align-items: end; justify-content: center; gap: 3px; padding: 6px; border-radius: 6px; background: #86ec43; }
.brand-mark i { width: 3px; background: #193011; display: block; border-radius: 1px; }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 11px; }
.brand-context { margin-left: 18px; padding-left: 18px; border-left: 1px solid #d9e0d8; color: var(--muted); font-size: 14px; font-weight: 450; letter-spacing: 0; }
.top-actions { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 550; }
.top-actions a { text-decoration: none; color: var(--muted); }
.top-actions a:hover { color: var(--accent); }
.top-actions .language-link { display: flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); }
.language-link svg { width: 14px; height: 14px; color: var(--muted); }

/* Three steps, presented as navigation rather than a second title block. */
.hero { background: linear-gradient(180deg, #fafcf9 0%, #fff 100%); }
.hero-inner { width: min(1200px, calc(100% - 64px)); margin: auto; padding: 48px 0 38px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; color: var(--accent); font-size: 12px; font-weight: 650; letter-spacing: .08em; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #71a960; }
h1 { margin: 0; font-size: clamp(32px, 3.6vw, 48px); font-weight: 690; line-height: 1.25; letter-spacing: -.045em; text-wrap: balance; }
:lang(zh-CN) h1 { font-size: clamp(30px, 3.2vw, 42px); letter-spacing: -.025em; }
.hero-lede { max-width: 770px; margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.95; }
.hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 29px; }
.hero-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; align-items: center; gap: 13px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 9px; background: #ffffffbd; text-decoration: none; transition: border-color .16s, background .16s; }
.hero-step:hover { border-color: #9bbb92; background: #f8fbf6; }
.hero-step b { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #dfe8da; border-radius: 8px; background: #f2f7ef; color: var(--accent); font: 550 14px var(--mono); }
.hero-step strong { display: block; font-size: 15px; font-weight: 630; line-height: 1.5; }
.hero-step small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.step-arrow { color: #8b9b89; font-size: 17px; }

/* The article and sidebar have separate spacing and typographic scales. */
.layout { width: min(1200px, calc(100% - 64px)); margin: 0 auto; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 54px; border-top: 1px solid var(--line); }
.toc { position: sticky; top: 103px; align-self: start; max-height: calc(100dvh - 130px); overflow-y: auto; margin-top: 36px; padding-right: 12px; }
.toc-label { margin: 0 0 16px 12px; color: #9aa29b; font-size: 11px; font-weight: 600; letter-spacing: .09em; }
.toc a { display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border-left: 2px solid transparent; border-radius: 0 6px 6px 0; color: #758078; text-decoration: none; font-size: 14px; line-height: 1.7; transition: color .15s, background .15s; }
.toc a + a { margin-top: 4px; }
.toc a.sub-link { padding: 6px 12px 6px 37px; font-size: 12px; }
.toc a.sub-link .toc-number { display: none; }
.toc-number { color: #a0aaa0; font: 11px var(--mono); }
.toc a:hover { background: #f5f8f3; color: var(--ink); }
.toc a[aria-current="location"] { border-left-color: #658e55; background: var(--accent-soft); color: #365c30; font-weight: 600; }
.toc a[aria-current="location"] .toc-number { color: #628355; }
.content { min-width: 0; padding: 35px 0 0; }
.section { margin: 0 0 46px; scroll-margin-top: 96px; }
.section + .section { padding-top: 36px; border-top: 1px solid var(--line); }
.section-kicker { margin: 0 0 10px; color: #7b887b; font-size: 11px; font-weight: 600; letter-spacing: .1em; }
h2 { margin: 0; color: #263228; font-size: 29px; line-height: 1.4; letter-spacing: -.025em; font-weight: 650; }
h3 { margin: 0; font-size: 21px; font-weight: 630; line-height: 1.6; letter-spacing: -.015em; }
.section-intro { margin: 11px 0 0; color: var(--muted); }
.subsection { margin-top: 30px; scroll-margin-top: 96px; }
.subsection + .subsection { margin-top: 40px; }
.subsection-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.subsection-number { color: #90a187; font: 12px var(--mono); }
p { margin: 12px 0; overflow-wrap: break-word; }
.content p, .content li { color: #526056; }
.content strong { color: #2d3a2f; font-weight: 600; }
.content h4 { margin: 25px 0 12px; color: #4c5b4d; font-size: 14px; letter-spacing: 0; }
ol, ul { padding-left: 22px; margin: 17px 0 23px; }
li { padding-left: 5px; }
li + li { margin-top: 7px; }
li::marker { color: #8b9b87; font-size: 14px; font-weight: 600; }
:not(pre) > code { padding: 2px 5px; border: 1px solid #e9ede7; border-radius: 4px; background: #f5f7f3; color: #4f6547; font: .88em/1.6 var(--mono); overflow-wrap: anywhere; }

/* Variable names wrap as a pair, never character by character on desktop. */
.table-wrap { overflow-x: auto; margin: 17px 0 22px; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.85; }
th, td { padding: 13px 18px; border-bottom: 1px solid #edf0eb; text-align: left; vertical-align: top; }
th { background: #f6f8f4; color: #6e7b6b; font-size: 11px; font-weight: 600; }
th:first-child { width: 35%; }
td { color: #62705f; }
td:first-child { min-width: 205px; }
td:first-child code { padding: 0; border: 0; background: transparent; color: #3f5940; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfdfb; }
.callout { margin: 22px 0; padding: 15px 18px; border: 1px solid #e2eada; border-radius: 8px; background: #f6f9f1; color: #68745f; font-size: 14px; line-height: 1.9; }
.callout strong { color: #48643c; }
.callout code { border-color: #e1e8d7; background: #edf2e5; }

/* Code is visually contained, with an unobtrusive action in its toolbar. */
.code-wrap { position: relative; min-width: 0; margin: 21px 0 24px; overflow: hidden; border: 1px solid #dfe5dd; border-radius: 9px; background: #1e2722; }
.code-label { min-height: 43px; display: flex; align-items: center; padding: 0 80px 0 17px; border-bottom: 1px solid #354038; background: #27312b; color: #b9c7ba; font: 12px/1.5 var(--mono); }
.code-label::before { content: ""; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%; background: #85a975; }
pre { max-width: 100%; margin: 0; padding: 20px; overflow: auto; color: #d6e1d7; font: 14px/1.85 var(--mono); tab-size: 4; scrollbar-color: #59665b #1e2722; }
pre:focus-visible { outline-offset: -3px; }
.copy-code { position: absolute; top: 7px; right: 9px; display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 3px 8px; border: 1px solid #455247; border-radius: 5px; background: transparent; color: #bbc8bb; font-size: 11px; cursor: pointer; }
.copy-code::before { content: ""; width: 9px; height: 10px; border: 1px solid currentColor; border-radius: 2px; box-shadow: -3px -2px 0 -1px #27312b, -3px -2px 0 0 currentColor; }
.copy-code:hover { color: #e3f4dc; border-color: #738768; }
.copy-code.is-copied { color: #b5e399; border-color: #70965c; }
.token-comment { color: #8c9c8d; font-style: italic; }
.token-keyword { color: #b7d6ef; }
.token-string { color: #caddb0; }
.token-number { color: #e0c499; }
.token-name { color: #edcfac; }

.requirements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; margin: 22px 0 28px; padding: 5px 21px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcf9; }
.requirement { position: relative; padding: 15px 0 15px 21px; }
.requirement::before { position: absolute; top: 21px; left: 0; content: ""; width: 8px; height: 5px; border-left: 1.5px solid #749361; border-bottom: 1.5px solid #749361; transform: rotate(-45deg); }
.requirement b { display: block; font-size: 14px; font-weight: 600; }
.requirement span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.footer { margin-top: 44px; padding: 22px 0 34px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; }
.footer p { margin: 0; color: #9aa29a; font-size: 12px; }
.footer a { color: #607c55; text-decoration: none; }

@media (min-width: 1500px) { .hero-inner, .layout, .topbar-inner { width: 1240px; } .layout { gap: 68px; } }
@media (max-width: 980px) {
  .layout { grid-template-columns: 175px minmax(0, 1fr); gap: 28px; }
  .toc { padding-right: 0; }
  .toc a { font-size: 12px; }
  .toc a.sub-link { padding-left: 22px; }
  .hero-step { padding: 14px; gap: 10px; }
  .hero-step strong { font-size: 14px; }
}
@media (max-width: 760px) {
  .hero-inner, .layout, .topbar-inner { width: calc(100% - 40px); }
  .layout { display: block; }
  .topbar-inner { min-height: 60px; }
  .hero-inner { padding: 32px 0 26px; }
  .hero-meta { gap: 8px; margin-top: 23px; }
  .hero-step { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .hero-step b { width: 24px; height: 24px; border-radius: 6px; font-size: 11px; }
  .hero-step small, .step-arrow { display: none; }
  .toc { position: static; display: flex; align-items: center; gap: 6px; max-height: none; overflow-x: auto; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .toc-label, .toc a.sub-link { display: none; }
  .toc a, .toc a + a { flex: 0 0 auto; gap: 6px; margin: 0; padding: 6px 11px; border: 0; border-radius: 6px; font-size: 12px; }
  .content { padding-top: 28px; }
  h2 { font-size: 26px; }
  .brand-context { margin-left: 8px; padding-left: 12px; }
  .hero-lede { font-size: 15px; }
}
@media (max-width: 440px) {
  .top-actions { gap: 12px; }
  .top-actions > a:first-child, .brand-context { display: none; }
  .hero-step strong { font-size: 12px; }
  .hero-step { padding: 10px; }
  body { font-size: 15px; }
  .requirements { grid-template-columns: 1fr; }
  .requirement { padding-block: 12px; }
  .requirement::before { top: 18px; }
  .footer-inner { flex-direction: column; gap: 6px; }
  pre { padding: 15px; font-size: 12px; }
  th, td { padding: 11px 13px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print {
  .topbar, .toc, .copy-code, .top-actions, .footer { display: none; }
  .layout { display: block; width: 100%; }
  .hero-inner { width: 100%; padding: 0 0 20px; }
  .hero-meta { display: none; }
  .section, .subsection { scroll-margin-top: 0; }
  .code-wrap { break-inside: avoid; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}
