/* Open Artifact website. Tokens follow packages/ui/src/styles.css (canvas, surface, text, accent, 6px radius);
   per-type colors come from packages/library-page/src/look.tsx and arrive as --tint / --wash / --ink. */

:root {
  --canvas: #f2f2f0;
  --bg: #fbfbfa;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --text: #1c1c1a;
  --text-2: #4a4a46;
  --muted: #6b6b66;
  --line: rgba(28, 28, 26, 0.1);
  --line-2: rgba(28, 28, 26, 0.16);
  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --accent-wash: rgba(37, 99, 235, 0.08);
  --brand: #2f5bb7;
  --on-accent: #ffffff;
  --code-bg: #f4f4f2;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.05), 0 18px 48px rgba(20, 30, 60, 0.1);
  --radius: 6px;
  --radius-lg: 12px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --wrap: 1160px;
  --header-h: 60px;
  /* syntax */
  --hl-key: #a43a2a;
  --hl-str: #1f6f43;
  --hl-num: #8a4b00;
  --hl-kw: #5437b8;
  --hl-fn: #1757ac;
  --hl-com: #8a8a84;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #1a1a19;
    --bg: #1a1a19;
    --surface: #242423;
    --surface-2: #20201f;
    --text: #ededeb;
    --text-2: #c9c9c5;
    --muted: #a0a09a;
    --line: rgba(237, 237, 235, 0.1);
    --line-2: rgba(237, 237, 235, 0.17);
    --accent: #60a5fa;
    --accent-ink: #93c5fd;
    --accent-wash: rgba(96, 165, 250, 0.12);
    --brand: #7ea3ec;
    --on-accent: #0d1626;
    --code-bg: #1f1f1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 48px rgba(0, 0, 0, 0.35);
    --hl-key: #f4a28c;
    --hl-str: #9fd8a8;
    --hl-num: #f2c27a;
    --hl-kw: #c3b5ff;
    --hl-fn: #8fc0ff;
    --hl-com: #85857f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:lang(zh-CN) body, html[lang='zh-CN'] body { line-height: 1.75; }
img, svg, video { max-width: 100%; }
svg { flex: none; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.875em; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius); }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -0.01em; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--brand); }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav a { color: var(--text-2); padding: 6px 10px; border-radius: var(--radius); font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.main-nav a:hover { color: var(--text); background: var(--accent-wash); text-decoration: none; }
.main-nav a[aria-current='page'] { color: var(--text); font-weight: 600; }
.nav-gh .ver { font-family: var(--mono); font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; }
.header-tools { display: flex; align-items: center; gap: 6px; }
.lang { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; }
.lang:hover { color: var(--text); border-color: var(--line-2); text-decoration: none; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; border-radius: var(--radius); align-items: center; justify-content: center; cursor: pointer; }
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }
  .header-row { gap: 12px; }
  .header-tools { margin-left: auto; }
  .main-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
  }
  .main-nav a { padding: 12px 8px; font-size: 16px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav-open .main-nav { display: flex; }
}

/* ---------- buttons & bits ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: var(--radius); font-weight: 600; font-size: 15px; border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--text-2); }
.btn-type { background: var(--ink); color: #fff; }
.btn-type:hover { background: color-mix(in srgb, var(--ink) 85%, black); }
@media (prefers-color-scheme: dark) { .btn-type { background: var(--tint); color: #111; } .btn-type:hover { background: color-mix(in srgb, var(--tint) 85%, white); } }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; }
.kicker { font-size: 13px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin: 0 0 12px; }
:lang(zh-CN) .kicker { letter-spacing: 0.12em; }
.section-title { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 14px; }
.section-title.small { font-size: 18px; }
.section-lead { font-size: 18px; color: var(--text-2); max-width: 720px; margin-bottom: 36px; }
.section { padding: 88px 0; }
.section-tight { padding: 48px 0; }
.band { padding: 88px 0; background: var(--canvas); border-block: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .band { background: #1e1e1d; } }
@media (max-width: 600px) { .section, .band { padding: 60px 0; } .section-lead { font-size: 16.5px; } }
.badge-beta {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 1px 7px; border-radius: 99px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.6;
  color: var(--ink, var(--muted)); background: color-mix(in srgb, var(--tint, #888) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint, #888) 35%, transparent);
}
@media (prefers-color-scheme: dark) { .badge-beta { color: color-mix(in srgb, var(--tint) 65%, white); } }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 14px; }
.chips li { font: 600 13px/1 var(--mono); padding: 8px 11px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); }

/* ---------- code ---------- */
.code { position: relative; margin: 0 0 1.25em; }
.code pre {
  margin: 0; padding: 14px 48px 14px 16px; overflow-x: auto; background: var(--code-bg);
  border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.6; font-size: 13.5px;
}
.code pre code { font-size: inherit; background: none; padding: 0; border: 0; white-space: pre; }
.code .copy {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; opacity: .85;
}
.code .copy:hover { color: var(--text); opacity: 1; }
.code .copy.done { color: #16a34a; border-color: #16a34a; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-built_in, .hljs-type { color: var(--hl-kw); }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-template-variable { color: var(--hl-str); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-meta { color: var(--hl-num); }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-name, .hljs-selector-class, .hljs-variable { color: var(--hl-key); }
.hljs-title, .hljs-title.function_, .hljs-section { color: var(--hl-fn); }
.hljs-comment, .hljs-quote, .hljs-deletion { color: var(--hl-com); font-style: italic; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 80px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 120%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); padding: 5px 12px 5px 10px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); margin-bottom: 22px; }
.eyebrow svg { color: var(--brand); }
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 22px; text-wrap: balance; }
:lang(zh-CN) .hero h1 { letter-spacing: -0.01em; line-height: 1.2; }
.hero-sub { font-size: 17.5px; color: var(--text-2); max-width: 600px; margin-bottom: 28px; }
.hero-privacy { display: flex; align-items: center; gap: 8px; margin: 22px 0 0; font-size: 14.5px; color: var(--muted); }
.spectrum { display: flex; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.spectrum a {
  width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); background: var(--wash); transition: transform .15s;
}
.spectrum a:hover { transform: translateY(-2px); }
@media (prefers-color-scheme: dark) { .spectrum a { background: color-mix(in srgb, var(--tint) 20%, var(--surface)); color: color-mix(in srgb, var(--tint) 70%, white); } }
.hero-media { margin: 0; }
.video-frame {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #111; aspect-ratio: 16 / 10;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line-2);
}
.video-frame video { display: block; width: 100%; height: 100%; object-fit: cover; background: #111; }
.hero-media figcaption { font-size: 13.5px; color: var(--muted); margin-top: 12px; }
@media (max-width: 960px) {
  .hero { padding: 48px 0 56px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

/* ---------- loop diagram ---------- */
.loop { margin: 0; }
.loop-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: s; }
.loop-step {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 18px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.loop-step:not(:last-child)::after {
  content: ''; position: absolute; top: 34px; right: -23px; width: 18px; height: 2px; background: var(--line-2);
}
.loop-step:not(:last-child)::before {
  content: ''; position: absolute; top: 30px; right: -24px; width: 8px; height: 8px;
  border-top: 2px solid var(--line-2); border-right: 2px solid var(--line-2); transform: rotate(45deg);
}
.loop-n { width: 26px; height: 26px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-wash); color: var(--accent-ink); font: 650 13px/1 var(--mono); margin-bottom: 14px; }
.loop-step h3 { font-size: 16.5px; margin-bottom: 6px; }
.loop-step p { font-size: 14.5px; color: var(--text-2); margin-bottom: 14px; flex: 1; }
.loop-step code { display: block; font-size: 12px; color: var(--text-2); background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 9px; overflow-wrap: anywhere; }
.loop-back { margin-top: 0; }
/* A U-shaped dashed line from step 4 back to step 2, with an arrowhead pointing up into step 2. */
.loop-u {
  position: relative; height: 34px;
  margin-left: calc((100% - 84px) / 4 * 1.5 + 28px);
  margin-right: calc((100% - 84px) / 8);
  border: 2px dashed var(--accent); border-top: 0; border-radius: 0 0 14px 14px;
}
.loop-u::before {
  content: ''; position: absolute; left: -6px; top: -2px; width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid var(--accent);
}
.loop-back-label { margin: 12px 0 0 calc((100% - 84px) / 4 * 1.5 + 28px); font-size: 14.5px; color: var(--text-2); }
.loop-back-label strong { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); margin-right: 4px; }
@media (max-width: 900px) {
  .loop-steps { grid-template-columns: 1fr 1fr; }
  .loop-step:nth-child(2)::after, .loop-step:nth-child(2)::before { display: none; }
  .loop-back { margin: 18px 0 0; }
  .loop-u { display: none; }
  .loop-back-label { margin: 0; border: 1.5px dashed var(--accent); border-radius: var(--radius-lg); padding: 12px 14px; }
  .loop-back-label strong { display: flex; margin-bottom: 2px; }
}
@media (max-width: 560px) {
  .loop-steps { grid-template-columns: 1fr; gap: 22px; }
  .loop-step::after, .loop-step::before { display: none; }
  .loop-step:not(:last-child)::after { display: block; top: auto; bottom: -18px; right: auto; left: 30px; width: 2px; height: 14px; }
}

/* ---------- type cards ---------- */
.type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .type-grid { grid-template-columns: 1fr; } }
.type-card {
  --card: var(--wash);
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius-lg);
  background: var(--card); color: var(--ink); overflow: hidden; border: 1px solid color-mix(in srgb, var(--tint) 22%, transparent);
  transition: transform .18s ease, box-shadow .18s ease;
}
.type-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px color-mix(in srgb, var(--tint) 22%, transparent); }
@media (prefers-color-scheme: dark) {
  .type-card { --card: color-mix(in oklab, var(--tint) 15%, var(--surface)); color: color-mix(in srgb, var(--tint) 62%, white); border-color: color-mix(in srgb, var(--tint) 28%, transparent); }
}
.type-card-main { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 18px; color: inherit; flex: 1; }
.type-card-main:hover { text-decoration: none; }
.type-icon { width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); }
@media (prefers-color-scheme: dark) { .type-icon { background: color-mix(in srgb, var(--tint) 22%, transparent); color: color-mix(in srgb, var(--tint) 70%, white); } }
.type-icon.sm { width: 26px; height: 26px; border-radius: 7px; }
.type-icon.lg { width: 56px; height: 56px; border-radius: 14px; }
.type-card-name { font-size: 19px; font-weight: 680; letter-spacing: -0.01em; color: var(--ink); }
@media (prefers-color-scheme: dark) { .type-card-name { color: #fff; } }
.type-card-line { font-size: 14.5px; line-height: 1.55; color: color-mix(in srgb, var(--ink) 88%, black); }
@media (prefers-color-scheme: dark) { .type-card-line { color: color-mix(in srgb, var(--tint) 30%, #e8e8e6); } }
.type-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 22px; border-top: 1px solid color-mix(in srgb, var(--tint) 22%, transparent); font-size: 13px; }
.type-exports { font-family: var(--mono); font-size: 12px; opacity: .8; }
.type-try { display: inline-flex; align-items: center; gap: 5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .type-try { color: color-mix(in srgb, var(--tint) 60%, white); } }

/* ---------- why ---------- */
.why-grid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.why-item { background: var(--surface); padding: 26px 24px; }
.why-item:last-child { grid-column: 1 / -1; }
.why-icon { width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-wash); color: var(--accent-ink); margin-bottom: 14px; }
.why-item h3 { font-size: 16.5px; margin-bottom: 8px; }
.why-item p { font-size: 14.5px; color: var(--text-2); margin: 0; }

/* ---------- apps ---------- */
.app-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.app-grid a { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); height: 100%; }
.app-grid a:hover { border-color: var(--line-2); text-decoration: none; box-shadow: var(--shadow); }
.app-grid strong { font-weight: 620; }
.app-grid span { font-size: 13.5px; color: var(--muted); }

/* ---------- install ---------- */
.install-wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
@media (max-width: 960px) { .install-wrap { grid-template-columns: minmax(0, 1fr); } }
.install-links { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.prompts-label { font-weight: 600; margin: 24px 0 10px; }
.tabs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.tab-list { display: flex; gap: 2px; padding: 8px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface-2); scrollbar-width: thin; }
.tab-list [role=tab] {
  flex: none; font: inherit; font-size: 13.5px; font-weight: 550; color: var(--text-2); background: none; border: 1px solid transparent;
  padding: 7px 11px; border-radius: var(--radius); cursor: pointer; white-space: nowrap;
}
.tab-list [role=tab]:hover { color: var(--text); background: var(--accent-wash); }
.tab-list [role=tab][aria-selected='true'] { color: var(--text); background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow); }
html:not(.js) .tab-list { display: none; }
.tab-panel { padding: 22px 22px 8px; }
html.js .tab-panel[data-hidden] { display: none; }
html:not(.js) .tab-panel + .tab-panel { border-top: 1px solid var(--line); }
.tab-panel-title { font-size: 17px; margin-bottom: 12px; }
.tab-panel-title small { font-weight: 450; color: var(--muted); font-size: 14px; margin-left: 6px; }
.steps { margin: 0 0 16px; padding-left: 22px; color: var(--text-2); }
.steps li { margin-bottom: 6px; }
.app-guide { font-size: 14px; }
.app-guide a { display: inline-flex; align-items: center; gap: 6px; }
.big-steps { list-style: none; margin: 0; padding: 0; counter-reset: bs; max-width: 860px; }
.big-steps > li { position: relative; padding: 0 0 40px 56px; counter-increment: bs; }
.big-steps > li::before {
  content: counter(bs); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; font: 650 14px/1 var(--mono); background: var(--accent); color: var(--on-accent);
}
.big-steps > li:not(:last-child)::after { content: ''; position: absolute; left: 16px; top: 40px; bottom: 6px; width: 2px; background: var(--line); }
.big-steps h2 { font-size: 22px; margin-bottom: 10px; }
.big-steps p { color: var(--text-2); }
@media (max-width: 600px) { .big-steps > li { padding-left: 46px; } }
.apps-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.apps-table th, .apps-table td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.apps-table thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
.apps-table tbody th { width: 28%; font-weight: 600; }
.apps-table tbody th small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.apps-table code.block { display: block; margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); gap: 36px; } }

/* ---------- page heads ---------- */
.page-head { padding: 64px 0 8px; }
.page-head h1 { font-size: clamp(32px, 4.2vw, 46px); letter-spacing: -0.025em; margin-bottom: 16px; }
.crumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs code { font-size: 12.5px; }
.choose-grid { list-style: none; margin: 24px 0 28px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.choose-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.choose-grid h3 { font-size: 16px; margin-bottom: 6px; }
.choose-grid p { margin: 0; color: var(--text-2); font-size: 14.5px; }
@media (max-width: 400px) { .choose-grid { grid-template-columns: 1fr; } }

/* ---------- type page ---------- */
.type-hero { background: var(--wash); color: var(--ink); padding: 56px 0 64px; border-bottom: 1px solid color-mix(in srgb, var(--tint) 25%, transparent); position: relative; overflow: hidden; }
@media (prefers-color-scheme: dark) { .type-hero { background: color-mix(in oklab, var(--tint) 14%, var(--bg)); color: color-mix(in srgb, var(--tint) 55%, white); } }
.type-hero .crumbs, .type-hero .crumbs a { color: inherit; opacity: .8; }
.type-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 40px; align-items: center; }
.type-hero h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.03em; margin-bottom: 18px; color: var(--ink); }
@media (prefers-color-scheme: dark) { .type-hero h1 { color: #fff; } }
.type-hero h1 .badge-beta { font-size: 13px; margin-left: 0; }
.type-hero .type-icon { background: color-mix(in srgb, #fff 60%, transparent); }
.type-tagline { font-size: 20px; font-weight: 550; line-height: 1.45; max-width: 680px; margin-bottom: 14px; }
.type-summary { font-size: 16.5px; max-width: 680px; color: color-mix(in srgb, currentColor 85%, transparent); margin-bottom: 26px; }
.type-hero .btn-ghost { background: color-mix(in srgb, var(--surface) 75%, transparent); border-color: color-mix(in srgb, var(--tint) 35%, transparent); }
.beta-note { font-size: 13.5px; margin: 16px 0 0; opacity: .8; }
.type-hero-art { color: var(--tint); opacity: .55; display: flex; justify-content: center; }
.type-hero-art svg { width: 220px; height: 220px; }
.type-hero-art svg [stroke] { stroke-width: 1.1; }
@media (max-width: 760px) { .type-hero-grid { grid-template-columns: 1fr; } .type-hero-art { display: none; } }
.feature-grid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 400px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-grid li { padding: 22px 22px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--tint); }
.feature-grid h3 { font-size: 16.5px; margin-bottom: 8px; }
.feature-grid p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.tree { margin: 0; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--tint); border-radius: var(--radius-lg); overflow-x: auto; font-size: 13.5px; line-height: 1.75; }
.tree code { font-size: inherit; }
.tree-rule { color: var(--muted); opacity: .7; }
.tree-note { color: var(--muted); }
.type-side .section-title { font-size: 22px; margin-top: 4px; }
.type-side .section-title + * { margin-top: 0; }
.type-side > .section-title:not(:first-child) { margin-top: 30px; }
.ds-note { display: flex; align-items: center; gap: 8px; color: #865400; }
@media (prefers-color-scheme: dark) { .ds-note { color: #e6c26a; } }
.type-links { display: flex; flex-wrap: wrap; gap: 18px; }
.other-types { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.other-types a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 550; }
.other-types a:hover { border-color: var(--tint); text-decoration: none; }
.other-types .type-icon { background: var(--wash); }
@media (prefers-color-scheme: dark) { .other-types .type-icon { background: color-mix(in srgb, var(--tint) 22%, transparent); } }

/* ---------- CTA band ---------- */
.cta-band { padding: 96px 0; text-align: center; }
.cta-band-inner { display: flex; flex-direction: column; align-items: center; }
.cta-mark { color: var(--brand); margin-bottom: 18px; }
.cta-band h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 10px; text-wrap: balance; }
.cta-band p { color: var(--muted); margin-bottom: 26px; }
.cta-band .cta-row { justify-content: center; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 28px; background: var(--surface-2); font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-brand p { color: var(--muted); margin-top: 12px; max-width: 300px; }
.site-footer h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 14px; font-weight: 650; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer li a { color: var(--text-2); }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- 404 ---------- */
.not-found { padding: 120px 0; text-align: center; }
.not-found .cta-row { justify-content: center; margin-top: 28px; }
.nf-code { font: 700 72px/1 var(--mono); color: var(--brand); opacity: .35; margin-bottom: 18px; }
.not-found h1 { font-size: 30px; margin-bottom: 16px; }
.not-found p { color: var(--text-2); }

/* ---------- docs ---------- */
.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 44px; padding-top: 28px; padding-bottom: 80px; align-items: start; max-width: 1320px; }
.docs-sidebar { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); display: flex; }
.docs-nav-toggle { width: 100%; display: flex; flex-direction: column; min-height: 0; }
.docs-nav-toggle > summary { display: none; }
.docs-nav { overflow-y: auto; padding-right: 8px; font-size: 14px; scrollbar-width: thin; }
.nav-group { margin-bottom: 10px; }
.nav-group > summary { cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px; }
:lang(zh-CN) .nav-group > summary { letter-spacing: .1em; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: '▸'; float: right; font-size: 10px; transition: transform .15s; }
.nav-group[open] > summary::after { transform: rotate(90deg); }
.nav-group ul { list-style: none; margin: 2px 0 8px; padding: 0; }
.nav-group a { display: block; padding: 5px 10px; border-radius: var(--radius); color: var(--text-2); line-height: 1.4; }
.nav-group a.mono { font-family: var(--mono); font-size: 12.5px; }
.nav-group a:hover { background: var(--accent-wash); color: var(--text); text-decoration: none; }
.nav-group a[aria-current='page'] { background: var(--accent-wash); color: var(--accent-ink); font-weight: 600; }
.docs-toc { position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 56px); overflow-y: auto; font-size: 13px; }
.toc p { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.4; }
.toc li.d3 a { padding-left: 24px; }
.toc li a:hover { color: var(--text); text-decoration: none; }
.toc li a.on { color: var(--accent-ink); border-left-color: var(--accent); }
@media (max-width: 1200px) { .docs-layout { grid-template-columns: 240px minmax(0, 1fr); } .docs-toc { display: none; } }
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 16px; }
  .docs-sidebar { position: static; max-height: none; }
  .docs-nav-toggle { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
  .docs-nav-toggle > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-size: 14.5px; font-weight: 600; list-style: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .docs-nav-toggle > summary::-webkit-details-marker { display: none; }
  .docs-nav-toggle[open] > summary { border-bottom: 1px solid var(--line); }
  .docs-nav { padding: 10px; max-height: 60vh; }
}
.doc { min-width: 0; max-width: 780px; }
.doc-title { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.025em; margin-bottom: 14px; }
.doc-title code { font-size: .8em; }
.doc-lead { font-size: 17px; color: var(--text-2); }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--line-2); background: var(--surface); font-size: 14.5px; margin: 0 0 24px; }
.callout p { margin: 4px 0 0; color: var(--text-2); }
.callout-agents { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-wash); }
.callout-agents > svg { color: var(--brand); margin-top: 2px; }
.callout-links { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.callout-links a { display: inline-flex; align-items: center; gap: 4px; }
.callout-note { background: color-mix(in srgb, #c79a1b 10%, var(--surface)); border-color: color-mix(in srgb, #c79a1b 40%, transparent); display: block; }
.doc-foot { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); }
.doc-source { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; }
.doc-source a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.doc-source a:hover { color: var(--text); }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.pn { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--text); background: var(--surface); }
.pn:hover { border-color: var(--accent); text-decoration: none; }
.pn small { color: var(--muted); font-size: 12.5px; }
.pn span { font-weight: 600; }
.pn.next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .prev-next { grid-template-columns: 1fr; } .pn.next { grid-column: 1; } }

/* prose (rendered markdown) */
.prose { font-size: 16px; color: var(--text); overflow-wrap: break-word; }
.prose h2 { font-size: 24px; margin: 2.1em 0 .7em; padding-top: .3em; }
.prose h3 { font-size: 19px; margin: 1.8em 0 .6em; }
.prose h4 { font-size: 16px; margin: 1.6em 0 .5em; }
.prose h2:first-child, .prose h3:first-child { margin-top: .5em; }
.prose .anchor { float: left; margin-left: -0.95em; padding-right: .25em; color: var(--muted); opacity: 0; font-weight: 400; text-decoration: none; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: .7; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.05em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose li > ul, .prose li > ol { margin: .3em 0; }
.prose :not(pre) > code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 4px; padding: .08em .35em; font-size: .86em; overflow-wrap: anywhere; }
.prose a code { color: inherit; }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--accent-wash); padding: 10px 16px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose img { border-radius: var(--radius); }
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.5; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 620; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: normal; }
.prose input[type=checkbox] { margin-right: 6px; }

.prompts pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
.prompts pre { padding-right: 48px; }
.split-type { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
@media (max-width: 860px) { .split-type { grid-template-columns: minmax(0, 1fr); } }
