:root {
  color-scheme: light dark;
  --page: #f6f4ef;
  --panel: #fbfaf6;
  --ink: #222521;
  --secondary: #525650;
  --line: #d6d4cc;
  --accent: #963c28;
  --accent-fill: #8d3624;
  --accent-on: #fff9f2;
  --active: #ede3da;
  --editor: #202219;
  --editor-outer: #292b21;
  --editor-line: #46483b;
  --editor-ink: #f1efe2;
  --editor-mute: #b8bbab;
  --editor-warm: #f5b59f;
  --editor-green: #c4d890;
  --mode: #daddc4;
  --mode-ink: #2a3122;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #171915;
    --panel: #20231b;
    --ink: #f1efe6;
    --secondary: #c0c0b5;
    --line: #404339;
    --accent: #f0a48b;
    --accent-fill: #f0a48b;
    --accent-on: #241916;
    --active: #392c23;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.25rem; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--page); color: var(--ink); font: 1rem/1.62 var(--sans); }
a { color: var(--accent); text-underline-offset: .19em; }
a:hover { text-decoration-thickness: .13em; }
button, input { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { display: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
img { display: block; max-inline-size: 100%; height: auto; }
h1, h2, h3, p { margin-block-start: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.13; }
p { text-wrap: pretty; }
code, pre { font-family: var(--mono); font-size: .93em; }
p code, li code { overflow-wrap: anywhere; }
.shell { width: min(100% - clamp(2rem, 7vw, 7rem), 72rem); margin-inline: auto; }
.skip-link { position: fixed; z-index: 3; inset: .5rem auto auto .5rem; padding: .55rem .9rem; background: var(--panel); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
[data-lang-zh] { display: none; }
[data-site-lang="zh"] [data-lang-zh] { display: revert; }
[data-site-lang="zh"] [data-lang-en] { display: none; }

.site-header { border-bottom: 1px solid var(--line); }
.site-header-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem; min-height: 4.6rem; }
.brand, .source-link, .footer-brand { color: var(--ink); text-decoration: none; font-weight: 690; }
.brand { display: inline-flex; align-items: center; gap: .6rem; width: max-content; letter-spacing: -.03em; font-size: 1.16rem; }
.brand img { width: 2.2rem; }
.site-nav, .header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem clamp(.35rem, 1.5vw, 1.2rem); }
.site-nav { justify-content: center; }
.site-nav a, .source-link, .language-button { padding: .55rem .35rem; font-size: .88rem; white-space: nowrap; }
.site-nav a { color: var(--secondary); text-decoration: none; }
.site-nav a:hover, .site-nav [aria-current] { color: var(--ink); }
.site-nav [aria-current] { box-shadow: inset 0 -2px var(--accent); }
.language-button { border: 0; background: none; color: var(--secondary); }

main { flex: 1; }
.hero { display: grid; grid-template-columns: 1fr minmax(0, .94fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(4rem, 9vw, 8rem) clamp(3rem, 7vw, 6rem); }
.hero > *, .feature-grid > *, .docs-grid > * { min-width: 0; }
.eyebrow { margin-bottom: 1rem; color: var(--accent); font: 650 .78rem/1.5 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
h1 { margin-bottom: 1.5rem; font-size: clamp(3.1rem, 6.55vw, 5.7rem); font-weight: 660; letter-spacing: -.068em; line-height: 1.01; }
h1 em { font-style: normal; color: var(--accent); }
h2 { margin-bottom: 1rem; font-size: clamp(1.65rem, 3.4vw, 2.85rem); font-weight: 650; letter-spacing: -.045em; }
h3 { margin-bottom: .55rem; font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 650; letter-spacing: -.025em; }
.lede { color: var(--secondary); font-size: clamp(1.04rem, 1.7vw, 1.22rem); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.65rem; }
.primary-button, .secondary-button { display: inline-flex; gap: .7rem; align-items: center; min-height: 2.8rem; padding: .55rem .95rem; border: 1px solid var(--line); border-radius: .6rem; font-weight: 650; text-decoration: none; }
.primary-button { color: var(--accent-on); background: var(--accent-fill); border-color: var(--accent-fill); }
.secondary-button { color: var(--ink); background: var(--panel); }
.primary-button:hover, .secondary-button:hover { text-decoration: underline; }
.system-note { display: flex; align-items: center; gap: .55rem; color: var(--secondary); margin: 1.6rem 0 0; font: .78rem/1.5 var(--mono); }
.indicator { width: .48rem; height: .48rem; border-radius: 50%; background: var(--accent); flex: none; }
.editor { margin: 0; overflow: hidden; background: var(--editor); color: var(--editor-ink); border: 1px solid var(--editor-line); border-radius: 1rem; box-shadow: 0 1.4rem 2.8rem #22201924; font: .82rem/1.7 var(--mono); }
.editor-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: .65rem .9rem; background: var(--editor-outer); border-bottom: 1px solid var(--editor-line); color: var(--editor-mute); }
.window-controls { display: inline-flex; gap: .34rem; }
.window-controls i { width: .47rem; height: .47rem; border: 1px solid #92957d; border-radius: 50%; }
.editor-body { padding: .65rem clamp(.9rem, 3.2vw, 2.1rem) 1.25rem; }
.editor-mark { display: grid; place-items: center; margin-block: .45rem 1.1rem; border: 1px solid #555446; border-radius: .55rem; background: radial-gradient(ellipse at 50% 38%, #777261, #49493b 72%, #35372c); }
.editor-logo { width: clamp(9rem, 48%, 15rem); margin: .5rem auto; filter: drop-shadow(0 .5rem .55rem #0008); }
.editor-code { display: flex; gap: .85rem; }
.editor-code pre, .editor-code ol { margin: 0; padding: 0; font: inherit; }
.editor-code pre { min-width: 0; overflow-x: auto; }
.editor-code code { font: inherit; }
.editor-code ol { list-style: none; text-align: right; color: var(--editor-mute); }
.syntax-comment { color: var(--editor-mute); }
.syntax-keyword { color: var(--editor-warm); }
.syntax-name, .syntax-string { color: var(--editor-green); }
.mode-line { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0 .7rem; padding: .22rem .9rem; background: var(--mode); color: var(--mode-ink); }
.minibuffer { padding: .45rem .9rem; background: var(--editor-outer); }
.minibuffer span:first-child { color: var(--editor-warm); }
.cursor { display: inline-block; width: .53rem; height: .89rem; vertical-align: -.14rem; background: var(--editor-green); }

.section { padding-block: clamp(2.35rem, 6vw, 4.6rem); border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 1.6rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; background: var(--line); }
.feature, .doc-card { padding: clamp(1.15rem, 3vw, 1.8rem); background: var(--panel); }
.feature { display: flex; flex-direction: column; }
.feature > a { margin-top: auto; }
.feature p, .doc-card p, .reading > p, .status-section p { color: var(--secondary); }
.feature .term { color: var(--accent); font: 650 .87rem var(--mono); }
.status-section { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem 2rem; }
.status-section > div { flex: 1 1 32rem; }
.status-section p { margin-bottom: 0; max-width: 55rem; }
.page-intro { padding-block: clamp(3.3rem, 8vw, 6rem) clamp(2.1rem, 5vw, 4rem); }
.page-intro h1 { font-size: clamp(2.9rem, 7vw, 5.8rem); }
.page-intro .lede { margin-bottom: 0; }
.reading > p { max-width: 67ch; }
.section-links, .control-row { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.section-links { padding-bottom: 1.5rem; gap: .45rem 1.3rem; }
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 0; list-style-position: inside; }
.flow li { padding: 1rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--panel); }
.flow li > span { display: block; color: var(--secondary); }
.command-panel { min-width: 0; margin-top: .9rem; padding: .95rem; background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; }
.command-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.command-heading p { margin-bottom: .65rem; color: var(--secondary); }
.command-panel pre { max-width: 100%; margin: 0; padding: .9rem 1rem; overflow: auto; background: var(--editor); color: var(--editor-ink); border-radius: .4rem; }
.control-row button, .copy-button { min-height: 2.65rem; padding: .35rem .82rem; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: .48rem; }
.control-row button[aria-selected="true"], .control-row button[aria-pressed="true"] { background: var(--active); border-color: var(--accent); }
.search-label { display: block; margin-bottom: .35rem; font-weight: 620; }
.catalog-tools input { width: min(100%, 34rem); min-height: 2.9rem; margin-bottom: .85rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--panel); }
.results { margin: .85rem 0; color: var(--secondary); }
.docs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.doc-card { border: 1px solid var(--line); border-radius: .65rem; }
.doc-card a { color: var(--ink); text-decoration: none; }
.doc-card a:hover { text-decoration: underline; }
.doc-card a span { color: var(--accent); font-size: .8em; }
.doc-card p { margin-bottom: 0; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1.5rem; min-height: 5rem; padding-block: 1rem; }
.footer-inner > a { font-size: .86rem; }
.site-runtime { margin-left: auto; color: var(--secondary); font: .75rem var(--mono); }

@media (max-width: 54rem) {
  .site-header-inner { grid-template-columns: 1fr auto; gap: .3rem 1rem; padding-top: .65rem; }
  .site-nav { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; }
  .site-nav a { min-height: 2.75rem; display: inline-flex; align-items: center; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 3.25rem 3rem; }
  .editor { width: min(100%, 35rem); }
  .editor-logo { max-width: 13rem; }
}
@media (max-width: 39rem) {
  .feature-grid, .docs-grid, .flow { grid-template-columns: minmax(0, 1fr); }
  .feature .term { margin-bottom: .7rem; }
  .site-runtime { margin-left: 0; }
}
@media (max-width: 23rem) {
  .site-header-inner { column-gap: .25rem; }
  .brand { gap: .35rem; font-size: 1rem; }
  .brand img { width: 1.75rem; }
  .site-nav { column-gap: .21rem; }
  .site-nav a { padding-inline: .25rem; }
  h1 { font-size: clamp(2.5rem, 12vw, 3.1rem); }
}
