/* CrazeCode browser surface.
   Every page renders completely under `default-src 'none'` plus same-origin
   style, script, image and font, with no inline style or script. JavaScript
   only enhances: the hero steps, copy buttons, OS tabs and Explore filters
   start hidden and site.js reveals them. */

/* Geist and Geist Mono are self-hosted (SIL OFL 1.1, see fonts/OFL.txt).
   Only the Latin subset ships; Chinese falls through to the system stack. */
@font-face {
  font-family: "Geist";
  src: url("fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Colour carries meaning. Coral (the logo's bolt) marks the primary action and
   "needs you"; mint (the logo's status dot) marks running or ready. Everything
   else stays neutral so the two colours mean something when they appear.
   Every text token clears WCAG AA (4.5:1) on every surface it is used on. */
:root {
  color-scheme: dark;
  --ground: #0b0d10;
  --pane: #12151a;
  --pane-2: #171b21;
  --code-bg: #0e1114;
  --line: #232830;
  --line-2: #2f353e;
  --text: #e6eaee;
  --body: #b4bcc4;
  --muted: #8b949e;
  --faint: #7d8792;
  --coral: #ff5d47;
  --coral-hover: #ff7563;
  --coral-ink: #1a0b08;
  --coral-soft: rgba(255, 93, 71, .14);
  --mint: #63e6a7;
  --mint-soft: rgba(99, 230, 167, .12);
  --sky: #79c0ff;
  --danger-text: #ffb4a8;
  --sans: "Geist", "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "PingFang SC", "Noto Sans SC", monospace;
  --wrap: 1180px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-width: 320px; margin: 0;
  background: var(--ground); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
[data-lang="zh"] body { line-height: 1.75; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
code, pre, kbd, .mono { font-family: var(--mono); }
h1, h2, h3 { text-wrap: balance; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* One language at a time. The server marks <html> with the reader's language;
   the other language's copy is removed from rendering and from the
   accessibility tree. `.lang-opt` is the language switch itself, which must
   name both languages in their own script. */
[data-lang="zh"] [lang="en"]:not(.lang-opt),
[data-lang="en"] [lang="zh-Hans"]:not(.lang-opt) { display: none !important; }

/* Chinese is never tracked tighter and never broken inside a phrase in a
   heading: each phrase is its own `.nb` run. */
[data-lang="zh"] :is(h1, h2, h3, .eyebrow, .btn) { letter-spacing: 0; }
.nb { white-space: nowrap; }
@media (max-width: 380px) { .nb { white-space: normal; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 8px 14px; border-radius: 8px;
  background: var(--coral); color: var(--coral-ink); font-weight: 600;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--pane); color: var(--text);
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.btn:hover { border-color: #46505c; }
.btn.hot { background: var(--coral); border-color: var(--coral); color: var(--coral-ink); }
.btn.hot:hover { background: var(--coral-hover); border-color: var(--coral-hover); }
.btn .arrow { color: var(--coral); }
.btn.hot .arrow { color: inherit; }

/* ---------- site chrome ---------- */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 13, 16, .86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-row { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; font-weight: 600; white-space: nowrap; }
.brand img { width: 28px; height: 28px; }
.brand-zh { font-size: 15px; }
.brand-en { color: var(--muted); font-size: 13px; font-weight: 500; }
.nav-links { display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
.nav-menu-panel a[aria-current] { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.nav-login { color: var(--muted); }
.nav-login:hover { color: var(--text); }
.lang-switch {
  display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--mono); font-size: 12.5px;
}
.lang-switch a { min-width: 32px; padding: 3px 8px; border-radius: 6px; color: var(--muted); text-align: center; }
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="true"] { background: var(--pane-2); color: var(--text); }
.nav-menu { display: none; }
.nav-menu summary {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer;
  list-style: none; color: var(--text); font-size: 14px;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu[open] summary { background: var(--pane-2); }
.nav-menu-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  display: grid; gap: 2px; padding: 10px var(--gutter) 16px;
  background: var(--ground); border-bottom: 1px solid var(--line);
}
.nav-menu-panel a { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--body); font-size: 16px; }
.nav-menu-panel a:last-child { border-bottom: 0; }

.foot { margin-top: 64px; border-top: 1px solid var(--line); }
.foot-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-block: 36px 28px; font-size: 14px; }
.foot-h { margin: 0 0 10px; color: var(--faint); font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.foot-links a { display: block; padding: 3px 0; color: var(--muted); }
.foot-links a:hover { color: var(--text); }
.statusbar { border-top: 1px solid var(--line); background: #0d1013; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.statusbar-row { display: flex; flex-wrap: wrap; }
.statusbar-row > span { padding: 10px 14px; border-right: 1px solid var(--line); }
.statusbar-row > .sb-brand { background: var(--coral); color: var(--coral-ink); font-weight: 600; }
.statusbar-row > .sb-right { margin-left: auto; border-right: 0; border-left: 1px solid var(--line); }

/* ---------- shared type ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--mint); font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
}
.eyebrow i {
  display: inline-block; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft);
}
h1 {
  margin: 18px 0; font-size: clamp(36px, 4.4vw, 56px); font-weight: 700;
  line-height: 1.08; letter-spacing: -.025em;
}
[data-lang="zh"] h1 { font-size: clamp(32px, 4vw, 50px); font-weight: 800; line-height: 1.2; word-break: keep-all; }
h1 em { color: var(--coral); font-style: normal; }
.h-page { font-size: clamp(34px, 4.6vw, 52px); }
[data-lang="zh"] .h-page { font-size: clamp(30px, 3.8vw, 46px); }
h2 {
  margin: 10px 0 12px; font-size: clamp(28px, 3.6vw, 42px); font-weight: 700;
  line-height: 1.15; letter-spacing: -.02em;
}
[data-lang="zh"] h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; line-height: 1.3; word-break: keep-all; }
.lede { max-width: 34em; margin: 0 0 28px; color: var(--body); font-size: 18px; }
[data-lang="zh"] .lede { font-size: 17px; }
.lede code, .card code, .facts-list code, .how-step code, .limits code, .spec code, .note code,
.guide-sec p code, .traps code, .terminal-alt p code, .dl-block p code, .side-card code {
  padding: .08em .35em; border-radius: 4px; background: rgba(255, 255, 255, .06);
  color: var(--text); font-size: .9em;
}
pre code { padding: 0; border-radius: 0; background: none; font-size: inherit; }
.crumbs { margin: 0; padding-top: 36px; color: var(--faint); font-family: var(--mono); font-size: 12.5px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.sec { padding-block: 88px; }
.sec.tight { padding-top: 0; }
.sec-head { max-width: 720px; margin-bottom: 40px; }
.sec-head .tag { color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.sec-head p { margin: 0; color: #aab3bc; font-size: 17px; }
.note {
  margin: 14px 0 0; padding: 10px 12px; border-left: 2px solid var(--line-2);
  color: var(--muted); font-size: 14px;
}

/* ---------- hero ---------- */

.hero { position: relative; overflow: hidden; padding-block: 72px 40px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 620px; pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(255, 93, 71, .12), transparent 70%),
    radial-gradient(closest-side at 70% 60%, rgba(99, 230, 167, .06), transparent 70%);
}
.hero-grid {
  position: relative; display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center;
}
.install {
  display: flex; align-items: stretch; max-width: 540px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--pane); overflow: hidden;
}
.install code {
  flex: 1; min-width: 0; padding: 12px 14px; overflow-x: auto;
  font-size: 14px; white-space: nowrap;
}
.install code b { color: var(--mint); font-weight: 500; user-select: none; }
.copy {
  flex: 0 0 auto; padding: 0 14px; border: 0; border-left: 1px solid var(--line-2);
  background: var(--pane-2); color: var(--muted); font-size: 13px; cursor: pointer;
}
.copy:hover { color: var(--text); }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.hero-note { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.hero-note li:not(:last-child)::after { content: "·"; margin-left: 14px; color: var(--faint); }
.release-note {
  max-width: 540px; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 10px;
  color: var(--body); font-size: 15px;
}
.release-note strong { display: block; margin-bottom: 4px; color: var(--text); }

/* ---------- terminal (drawn in HTML, from the real interface) ---------- */

.term-figure { margin: 0; }
.term {
  overflow: hidden; border: 1px solid var(--line-2); border-radius: 12px; background: #0e1114;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .02) inset;
}
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); background: #111418;
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2b3038; }
.term-bar span { margin-left: 8px; color: var(--faint); font-family: var(--mono); font-size: 12px; }
/* Frames share one grid cell, so the window takes the height of its tallest
   frame and nothing is clipped at any width. */
.term-body {
  display: grid; padding: 12px; min-height: 330px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
}
.frame {
  position: relative; grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0;
  transition: opacity .45s ease, visibility .45s;
}
.frame[data-off] { opacity: 0; visibility: hidden; pointer-events: none; }
.statusline { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; color: var(--muted); }
.statusline b { color: var(--text); font-weight: 500; }
.panes { display: grid; grid-template-columns: 1fr 1.1fr; gap: 8px; }
.pane { min-width: 0; min-height: 216px; padding: 6px 10px 10px; border: 1px solid var(--line-2); border-radius: 4px; }
.pane-title { margin-bottom: 6px; color: var(--sky); font-size: 11.5px; }
.row { display: flex; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row.sel { margin-inline: -6px; padding-inline: 6px; border-radius: 3px; background: #1a1f26; }
.dot-run { color: var(--mint); }
.dot-idle { color: var(--muted); }
.dot-need { color: var(--coral); }
.pill { padding: 0 6px; border: 1px solid; border-radius: 3px; font-size: 11px; }
.pill.need { border-color: rgba(255, 93, 71, .5); background: var(--coral-soft); color: var(--coral); }
.pill.ok { border-color: rgba(99, 230, 167, .4); background: var(--mint-soft); color: var(--mint); }
.kv { color: var(--muted); }
.kv b { color: var(--text); font-weight: 400; }
.me { color: var(--text); }
.footer-keys { margin-top: auto; padding-top: 10px; overflow: hidden; color: var(--faint); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.footer-keys b { color: var(--muted); font-weight: 500; }
.toast {
  margin-top: 10px; padding: 6px 10px; border: 1px solid rgba(255, 93, 71, .45); border-radius: 4px;
  background: var(--coral-soft); color: #ffd1ca;
}
.toast b { color: #fff; font-weight: 600; }
.modal {
  position: absolute; inset: 36px 30px 12px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 6px; background: #12161b;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
}
.modal h4 { margin: 0 0 8px; color: var(--sky); font-size: 12.5px; font-weight: 500; }
.modal ul { margin: 0 0 10px; padding: 0; list-style: none; }
.modal li { display: flex; gap: 10px; }
.modal li > span:first-child { flex: 0 0 6.5em; color: var(--faint); }
.steps-under { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.steps-under button {
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); font-family: var(--mono); font-size: 12px; cursor: pointer;
}
.steps-under button[aria-pressed="true"] { border-color: var(--line-2); background: var(--pane); color: var(--text); }

/* ---------- home sections ---------- */

.agents { border-block: 1px solid var(--line); background: #0d1013; }
.agents .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-block: 18px;
  color: var(--muted); font-family: var(--mono); font-size: 13.5px;
}
.agents b { color: var(--text); font-weight: 500; }
.agents .lbl { color: var(--faint); font-size: 12px; letter-spacing: .05em; }

.loop {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line);
}
.loop article { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 22px 20px 24px; background: var(--pane); }
.loop .n { color: var(--faint); font-family: var(--mono); font-size: 12px; }
.loop h3 { margin: 0; font-size: 18px; }
.loop p { margin: 0; color: var(--muted); font-size: 14.5px; }
.cmd {
  margin-top: auto; padding: 6px 10px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 6px; background: var(--code-bg);
  color: var(--mint); font-family: var(--mono); font-size: 12.5px; white-space: nowrap;
}
.cmd.need { color: var(--coral); white-space: normal; }
.cmd.plain { color: var(--muted); font-family: var(--sans); font-size: 13px; white-space: normal; }

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 24px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--pane);
  transition: border-color .2s;
}
a.card:hover { border-color: var(--line-2); }
.card.w2 { grid-column: span 2; }
.card.w3 { grid-column: span 3; }
.card.w4 { grid-column: span 4; }
.card h3 { margin: 0; font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .note { margin-top: 0; }
.more { display: inline-flex; gap: 6px; margin-top: auto; color: var(--text); font-size: 14px; }
.more::after { content: "→"; color: var(--coral); }
.mini {
  padding: 10px 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px;
  background: var(--code-bg); color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 1.75;
}
.mini .ws, .mini-ws { margin-block: 4px; padding-left: 8px; border-left: 2px solid var(--sky); color: #c7d3de; }

.spec { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.spec > div {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: baseline;
  padding: 16px 22px; border-top: 1px solid var(--line);
}
.spec > div:first-child { border-top: 0; }
.spec dt { color: var(--mint); font-family: var(--mono); font-size: 13px; }
.spec dd { margin: 0; color: #c3cad1; font-size: 15px; }

.install-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.os-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.os-tabs button {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 14px; cursor: pointer;
}
.os-tabs button[aria-selected="true"] { border-color: var(--line-2); background: var(--pane); color: var(--text); }
.os-panel + .os-panel { margin-top: 18px; }
.js .tabbed .os-panel + .os-panel { margin-top: 0; }
.panel-label { margin: 0 0 8px; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.js .tabbed .panel-label { display: none; }
.code {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--code-bg);
  font-family: var(--mono); font-size: 13.5px; line-height: 1.9; white-space: pre;
}
.code .c { color: var(--faint); }
.code .p { color: var(--mint); user-select: none; }
.code .f { color: var(--sky); }
.facts-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.facts-list li { position: relative; padding-left: 18px; color: #b8c0c8; font-size: 15px; }
.facts-list li::before { content: "›"; position: absolute; left: 0; color: var(--coral); font-family: var(--mono); }
.facts-list a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }

.cta {
  padding: 56px 40px; border: 1px solid var(--line); border-radius: 16px; text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 93, 71, .12), transparent 60%), var(--pane);
}
.cta h2 { margin-top: 0; }
.cta p { max-width: 32em; margin: 0 auto 24px; color: var(--muted); }
.cta .install, .cta .hero-ctas { margin-inline: auto; justify-content: center; }

/* ---------- product pages ---------- */

.feature-hero {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 48px; align-items: center; padding-block: 36px 64px;
}
.feature-hero .term-body { min-height: 280px; }
.problem {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line);
}
.problem > div { padding: 26px; background: var(--pane); }
.problem h3 { margin: 0 0 8px; font-family: var(--mono); font-size: 16px; font-weight: 500; }
.problem .before h3 { color: var(--muted); }
.problem .after h3 { color: var(--mint); }
.problem ul, .limits ul { display: grid; gap: 6px; margin: 0; padding-left: 18px; color: #b8c0c8; font-size: 15px; }
.how { display: grid; gap: 14px; }
.how-step {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start;
  padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--pane);
}
.how-step .num { padding-top: 3px; color: var(--faint); font-family: var(--mono); font-size: 13px; }
.how-step h3 { margin: 0 0 6px; font-size: 17px; }
.how-step p { margin: 0; color: var(--muted); font-size: 14.5px; }
.limits { padding: 22px 24px; border: 1px dashed var(--line-2); border-radius: 12px; }
.limits h2 { margin: 0 0 10px; color: var(--muted); font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: 0; line-height: 1.5; }
[data-lang="zh"] .limits h2 { font-size: 15px; font-weight: 500; }
.limits ul { color: #aeb7c0; font-size: 14.5px; }
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.related .card h3 { font-size: 18px; }

/* ---------- Explore ---------- */

.page-head { max-width: 760px; margin-top: 28px; margin-bottom: 28px; }
.page-head .lede { margin-bottom: 0; }
.explore-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 13px; cursor: pointer;
}
.filters button[aria-pressed="true"] { border-color: var(--line-2); background: var(--pane); color: var(--text); }
.search { display: flex; gap: 8px; width: min(100%, 420px); margin-left: auto; }
.search input {
  flex: 1; min-width: 0; min-height: 38px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--code-bg); color: var(--text);
}
.search input::placeholder { color: var(--faint); }
.demos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.demo { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--pane); }
.preview {
  min-height: 128px; padding: 16px; border-bottom: 1px solid var(--line); background: var(--code-bg);
  color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 1.6;
}
.pv-big { color: var(--mint); font-size: 22px; line-height: 1.4; }
.pv-quote { margin-bottom: 4px; color: var(--text); font-size: 14px; }
.pv-cmd { color: var(--text); }
.pv-cmd b { color: var(--mint); font-weight: 500; }
.bars { display: grid; gap: 5px; }
.bars div { display: grid; grid-template-columns: 4.5em minmax(0, 1fr) 1.5em; align-items: center; gap: 8px; }
.bars i { display: block; height: 8px; border-radius: 2px; background: var(--mint); }
.bars .v1 { width: 25%; }
.bars .v2 { width: 50%; }
.bars .v3 { width: 75%; }
.bars .v4 { width: 100%; }
.demo .body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 18px 18px 20px; }
.demo .meta { margin: 0; color: var(--faint); font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
.demo h2 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.35; letter-spacing: 0; }
[data-lang="zh"] .demo h2 { font-size: 17px; font-weight: 700; }
.demo p { margin: 0; color: var(--muted); font-size: 14px; }
.run {
  display: flex; align-items: stretch; margin-top: auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: 6px; background: var(--code-bg);
}
.run code { flex: 1; min-width: 0; padding: 6px 10px; overflow-x: auto; font-size: 12px; white-space: nowrap; }
.run .copy { padding: 0 10px; font-size: 12px; }
.demo .more { margin-top: 4px; }
.empty { padding: 28px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--body); }
.terminal-alt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.terminal-alt p { margin: 0; color: var(--body); }

/* ---------- Download ---------- */

.dl-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.dl-block + .dl-block { margin-top: 44px; }
.dl-block h2 { font-size: clamp(22px, 2.4vw, 28px); }
[data-lang="zh"] .dl-block h2 { font-size: clamp(21px, 2.2vw, 26px); }
.dl-block > p { max-width: 42em; color: var(--body); }
.dl-block .code { margin-top: 12px; }
.side-card { padding: 22px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--pane); }
.side-card h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: 0; }
[data-lang="zh"] .side-card h2 { font-size: 18px; }
.side-card + .side-card { margin-top: 14px; }
.side-card p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.archives { width: 100%; border-collapse: collapse; font-size: 14px; }
.archives th, .archives td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.archives th { color: var(--muted); font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.archives a { color: var(--sky); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.archives a:hover { text-decoration: underline; }
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.table-box .archives tr:last-child td { border-bottom: 0; }
.version { color: var(--mint); font-family: var(--mono); }

/* ---------- Guide ---------- */

.prose { max-width: 820px; }
.guide-sec { padding-block: 40px; border-top: 1px solid var(--line); }
.guide-sec h2 { font-size: clamp(22px, 2.4vw, 28px); }
[data-lang="zh"] .guide-sec h2 { font-size: clamp(21px, 2.2vw, 26px); }
.guide-sec h3 { margin: 28px 0 10px; font-size: 17px; }
.guide-sec > p, .prose > p { max-width: 44em; color: var(--body); }
.guide-sec .code { margin-top: 18px; line-height: 1.7; }
.code .flag { color: var(--coral); }
.traps { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); margin: 18px 0 0; border-top: 1px solid var(--line); }
.traps dt, .traps dd { margin: 0; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); }
.traps dt { font-weight: 600; }
.traps dd { color: var(--body); font-size: 15px; }
.guide-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.file-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.file-links a { padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--pane); font-size: 14px; }
.file-links a:hover { border-color: #46505c; }
.file-links a.primary { border-color: var(--coral); background: var(--coral); color: var(--coral-ink); font-weight: 600; }

/* ---------- account pages ---------- */

body.auth { display: flex; flex-direction: column; min-height: 100vh; }
.auth-top { border-bottom: 1px solid var(--line); }
.auth-top .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.auth-claim { margin: 0 0 0 auto; color: var(--muted); font-size: 13.5px; text-align: right; }
.auth-main { flex: 1; width: min(100% - 32px, 34rem); margin: 6vh auto 64px; }
.auth-card { padding: 36px; border: 1px solid var(--line); border-radius: 14px; background: var(--pane); }
.auth-card h1 { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -.01em; }
[data-lang="zh"] .auth-card h1 { font-size: 28px; font-weight: 800; }
.auth-card .subtitle { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.auth-card > p { color: var(--body); }
.auth-card > p a, .auth-links a {
  color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px;
}
.auth-card > p a:hover, .auth-links a:hover { text-decoration-color: var(--text); }
.notice {
  margin: 18px 0 0; padding: 10px 12px; border: 1px solid rgba(255, 93, 71, .45); border-radius: 8px;
  background: var(--coral-soft); color: var(--danger-text); font-size: 14.5px;
}
.notice.ok { border-color: rgba(99, 230, 167, .4); background: var(--mint-soft); color: var(--mint); }
.notice.info { border-color: var(--line-2); background: var(--pane-2); color: var(--body); }
.auth-card form { display: grid; gap: 16px; margin-top: 24px; }
.auth-card label { display: grid; gap: 6px; color: var(--text); font-size: 14px; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; }
.auth-card input, .auth-card select, .auth-card textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--code-bg); color: var(--text);
  font-weight: 400;
}
.auth-card textarea { min-height: 104px; resize: vertical; }
.auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus { border-color: #46505c; }
.auth-card button {
  min-height: 44px; padding: 0 18px; border: 1px solid var(--coral); border-radius: 8px;
  background: var(--coral); color: var(--coral-ink); font-weight: 600; cursor: pointer;
}
.auth-card button:hover { border-color: var(--coral-hover); background: var(--coral-hover); }
.auth-card button.danger { border-color: var(--line-2); background: transparent; color: var(--danger-text); }
.auth-card button.danger:hover { border-color: #46505c; background: var(--pane-2); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.auth-card .actions form { display: block; margin: 0; }
.facts {
  display: grid; grid-template-columns: minmax(8rem, .7fr) minmax(0, 1.3fr); gap: 8px 16px;
  margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--code-bg);
  font-size: 14px;
}
.facts dt { color: var(--muted); }
.facts dt .hint { display: block; font-size: 12px; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 13.5px; }
.profile-intro { margin: 18px 0 0; padding: 10px 12px; border-left: 2px solid var(--line-2); color: var(--body); font-size: 14.5px; }
.profile-intro p { margin: 0; }
.auth-links { display: grid; gap: 8px; margin-top: 22px; font-size: 14.5px; }
.auth-foot { margin-top: auto; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero-grid, .feature-hero, .install-grid, .dl-grid, .terminal-alt { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento .card.w2, .bento .card.w3, .bento .card.w4 { grid-column: span 6; }
  .demos, .related, .guide-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links, .nav-right > .nav-login { display: none; }
  .nav-menu { display: block; }
  .spec > div { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .nav-row { gap: 12px; }
  .nav-right { gap: 10px; }
  .nav-install { display: none; }
  .hero { padding-block: 40px 24px; }
  .sec { padding-block: 60px; }
  .lede { font-size: 16.5px; }
  .loop, .demos, .related, .problem, .foot-links, .guide-cards { grid-template-columns: minmax(0, 1fr); }
  .spec > div { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 16px; }
  .how-step { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .panes { grid-template-columns: minmax(0, 1fr); }
  .panes .pane:last-child { display: none; }
  .pane { min-height: 0; }
  .term-body, .feature-hero .term-body { min-height: 0; font-size: 11.5px; }
  .modal { position: relative; inset: auto; margin-top: 4px; }
  .frame-continue .panes { display: none; }
  .cta { padding: 40px 20px; }
  .statusbar-row > .sb-right { margin-left: 0; border-left: 0; }
  .traps { grid-template-columns: minmax(0, 1fr); }
  .traps dt { padding-bottom: 0; border-bottom: 0; }
  .traps dd { padding-top: 4px; }
  .auth-top .wrap { gap: 12px; }
  .auth-claim { display: none; }
  .auth-top .lang-switch { margin-left: auto; }
  .auth-main { margin-top: 20px; }
  .auth-card { padding: 24px 20px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .search { width: 100%; margin-left: 0; }
  .explore-tools { align-items: stretch; }
}
@media (max-width: 380px) {
  .brand-en { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .frame, .card { transition: none; }
}
