:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efeee9;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --line: #e2e0da;
  --accent: #5866e8;
  --accent-ink: #ffffff;
  --code: #f1f0ec;
  --running: #5b7cf0;
  --waiting: #e3a33b;
  --done: #3fae6a;
  --error: #e0564f;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113; --surface: #1b1b1e; --surface-2: #232327; --text: #f2f2f4; --muted: #9a9aa2;
    --line: #2e2e33; --accent: #8290ff; --accent-ink: #0f0f12; --code: #18181b; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111113; --surface: #1b1b1e; --surface-2: #232327; --text: #f2f2f4; --muted: #9a9aa2;
  --line: #2e2e33; --accent: #8290ff; --accent-ink: #0f0f12; --code: #18181b; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
:not(pre) > code { background: var(--code); border: 1px solid var(--line); border-radius: 6px; padding: 0.05em 0.35em; }
pre {
  position: relative; margin: 14px 0; padding: 16px 18px; overflow-x: auto;
  background: var(--code); border: 1px solid var(--line); border-radius: 14px; line-height: 1.55;
}
pre .copy {
  position: absolute; top: 8px; right: 8px; font: 12px/1 inherit; font-family: inherit;
  padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
}
table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 0.94em; }
th, td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.table { overflow-x: auto; }

header.top {
  position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line);
}
header.top .in { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 18px; }
.brand { font-weight: 700; letter-spacing: 0.02em; color: var(--text); white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand .logo { width: 26px; height: 26px; border-radius: 7px; box-shadow: 0 0 0 1px var(--line); }
nav.links { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; font-size: 0.92em; }
nav.links::-webkit-scrollbar { display: none; }
nav.links a { color: var(--muted); white-space: nowrap; }
nav.links a:hover { color: var(--text); text-decoration: none; }
nav.links a[aria-current="page"] { color: var(--text); font-weight: 600; }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px 80px; }
section { padding: 44px 0 8px; }
h1 { font-size: clamp(30px, 5.4vw, 52px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 14px; }
h2 { font-size: 26px; line-height: 1.3; margin: 0 0 6px; letter-spacing: -0.01em; }
h3 { font-size: 18px; margin: 28px 0 6px; }
.lead { color: var(--muted); font-size: 1.08em; max-width: 46em; margin: 0 0 18px; }
.eyebrow { color: var(--muted); font-size: 0.85em; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 8px; }

.hero { padding: 64px 0 20px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero img { width: 100%; height: auto; display: block; }
.hero .shots { display: grid; gap: 14px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.button {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button:hover { text-decoration: none; filter: brightness(1.04); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 4px; }
.card p { margin: 0; color: var(--muted); font-size: 0.95em; }
.card .meta { display: block; margin-top: 12px; font-size: 0.88em; color: var(--muted); }
.card .button { margin-top: 14px; }

ol.flow { counter-reset: n; list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
ol.flow li { counter-increment: n; position: relative; padding: 14px 16px 14px 56px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
ol.flow li::before {
  content: counter(n); position: absolute; left: 16px; top: 14px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.85em; background: var(--surface-2);
}

.templates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.template { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.template h3 { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.template h3 code { font-size: 0.75em; }
.template p { margin: 0; color: var(--muted); font-size: 0.95em; }
.template img { width: 100%; height: auto; display: block; }
.template pre { margin: 4px 0 0; font-size: 0.82em; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85em; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); }
.pill i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.note { border-left: 3px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 0 12px 12px 0; margin: 16px 0; }
.tabs { display: flex; gap: 6px; margin-top: 16px; }
.tabs button {
  font: inherit; font-size: 0.9em; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.panel[hidden] { display: none; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88em; }
footer .in { max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-wrap: wrap; gap: 8px 22px; }

.page-head { padding-top: 48px; }
.page-head h1 { font-size: clamp(28px, 4.6vw, 42px); }
.small { font-size: 0.88em; color: var(--muted); }
a.card.link { color: inherit; display: block; transition: border-color 0.15s; }
a.card.link:hover { text-decoration: none; border-color: var(--accent); }
a.card.link .meta { color: var(--accent); }
.button.disabled { color: var(--muted); background: var(--surface-2); cursor: default; }

/* 文档：左侧目录，右侧正文 */
.docs { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; padding-top: 44px; font-size: 0.92em; }
.toc a { color: var(--muted); padding: 5px 10px; border-radius: 8px; }
.toc a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.docs-body { min-width: 0; }
.docs-body .templates { grid-template-columns: 1fr; }
@media (min-width: 1100px) { .docs-body .templates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 下载 */
.downloads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card.download { display: flex; flex-direction: column; gap: 12px; }
.card.download p { margin: 0; color: var(--muted); }
.card.download .button { align-self: flex-start; margin-top: 0; }
.download-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.download-head h2 { margin: 0; font-size: 22px; }
.facts { margin: 4px 0 0; padding-left: 1.1em; color: var(--muted); font-size: 0.92em; display: grid; gap: 4px; }

@media (max-width: 820px) {
  .docs { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; padding-top: 20px; gap: 6px; }
  .toc a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
  .downloads { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .cards, .templates { grid-template-columns: 1fr; }
  header.top .in { gap: 12px; }
}
