/* 官网样式：颜色只在这里由变量决定一次，明暗两套走 [data-theme]，不在别处重复同名属性。 */

:root {
  --bg: #f6f6f3;
  --card: #ffffff;
  --ink: #15181c;
  --muted: #5c6570;
  --line: #e2e2dc;
  --signal: #0d7a6b;
  --signal-ink: #ffffff;
  --signal-soft: #ddf1ec;
  --amber: #a96400;
  --shadow: 0 1px 2px rgba(15, 20, 25, .05), 0 10px 30px rgba(15, 20, 25, .06);
  --radius: 14px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0f1214;
  --card: #171b1f;
  --ink: #e8ecec;
  --muted: #97a1ab;
  --line: #272d33;
  --signal: #4bd0b6;
  --signal-ink: #06231d;
  --signal-soft: #12352e;
  --amber: #e3a54a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.7 ui-sans-serif, system-ui, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

code, kbd, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: none; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

/* ---------- 顶栏 ---------- */
header.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar-in { display: flex; align-items: center; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .2px; color: var(--ink); text-decoration: none; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--signal); position: relative; flex: none; }
.brand .mark::after { content: ""; position: absolute; inset: 6px 6px 6px 3px; border-left: 2px solid var(--signal-ink); border-bottom: 2px solid var(--signal-ink); }
.bar nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bar nav a, .bar nav button {
  border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer;
  padding: 7px 10px; border-radius: 9px; text-decoration: none; white-space: nowrap;
}
.bar nav a:hover, .bar nav button:hover { color: var(--ink); background: var(--card); }
.bar .lang { font-weight: 600; color: var(--ink); }
.bar .ghost { border: 1px solid var(--line); }

/* ---------- 首屏 ---------- */
.hero { padding: 68px 0 40px; }
.hero h1 { font-size: clamp(30px, 5.4vw, 52px); line-height: 1.16; margin: 0 0 14px; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--signal); }
.hero .sub { font-size: clamp(15px, 1.9vw, 19px); color: var(--muted); max-width: 74ch; margin: 0 0 22px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; list-style: none; }
.tags li { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  border-radius: 11px; padding: 11px 17px; font-weight: 600; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
}
.btn.primary { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.btn:hover { box-shadow: var(--shadow); }
.btn small { font-weight: 400; opacity: .75; }

/* ---------- 区块 ---------- */
section { padding: 46px 0; border-top: 1px solid var(--line); scroll-margin-top: 74px; }
section > .wrap > h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 6px; letter-spacing: -.3px; }
section > .wrap > .lede { color: var(--muted); margin: 0 0 30px; max-width: 78ch; }

/* 功能块：图与文并排，窄容器改成上下 */
.feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 26px; align-items: start; margin-bottom: 40px; }
.feature:last-child { margin-bottom: 0; }
.feature figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 10px; box-shadow: var(--shadow); }
.feature figure img { display: block; width: 100%; height: auto; border-radius: 8px; background: #0c0f11; }
/* 录屏还没进 assets/gif/ 时 figure.pending 顶上去：16:9 的空档加一句实话说，比裂图图标诚实，
   而且 GIF 真录进来之后版面不跳。 */
.feature figure.pending { aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 22px 16px; text-align: center; }
.feature figure.pending::before { content: attr(data-pending); color: var(--muted); font-size: 13px; }
.feature figcaption { font-size: 12.5px; color: var(--muted); padding: 8px 4px 2px; }
.feature h3 { font-size: 20px; margin: 6px 0 8px; }
.feature p { margin: 0 0 12px; color: var(--muted); }
.feature p b, .feature p strong { color: var(--ink); }
.feature .facts { list-style: none; margin: 0 0 14px; padding: 0; }
.feature .facts li { padding-left: 17px; position: relative; color: var(--muted); font-size: 14px; }
.feature .facts li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.doclink { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 600; }
.doclink span { font-weight: 400; color: var(--muted); font-size: 13px; }

/* 能力一览 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 16px 17px; }
.card h3 { font-size: 15.5px; margin: 0 0 6px; }
.card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.card .num { font-variant-numeric: tabular-nums; color: var(--signal); font-weight: 700; }

/* 下载区 */
table.rel { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rel th, table.rel td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.rel th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
table.rel td.ver { font-weight: 700; white-space: nowrap; }
table.rel td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.rel code { font-size: 12px; color: var(--muted); word-break: break-all; }
.note { border-left: 3px solid var(--amber); background: var(--card); padding: 11px 14px; color: var(--muted); font-size: 13.5px; border-radius: 0 10px 10px 0; margin: 18px 0 0; }
.note b { color: var(--ink); }

/* 引用区 */
.cite { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 18px; align-items: start; }
pre.bib { margin: 0; padding: 16px; overflow: auto; background: #0e1214; color: #d9e4e2; border-radius: var(--radius); font-size: 13px; line-height: 1.65; }
html[data-theme="dark"] pre.bib { background: #0a0d0f; }
aside.cite-side { display: grid; gap: 10px; }
aside.cite-side p { margin: 0; font-size: 13px; color: var(--muted); }

/* 文档区 */
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13.5px; }
footer .foot { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: baseline; }
footer a { color: var(--muted); }
footer .sig { margin-left: auto; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .feature, .cite { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 44px; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .bar-in { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 0; }
  .bar nav { margin-left: 0; width: 100%; }
  section { padding: 34px 0; scroll-margin-top: 150px; }
  .btn { width: 100%; justify-content: center; }
  /* 六列在 380px 里挤成一团，包名会被 break-all 拆成 work-s / tream-。改成一行一格，格子自己带列名。 */
  table.rel, table.rel tbody, table.rel tr, table.rel td { display: block; }
  table.rel thead { display: none; }
  table.rel tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  table.rel td { border: 0; padding: 3px 0; }
  table.rel td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
  table.rel td:not([data-label])::before { content: none; }
  table.rel code { word-break: normal; }
  /* bib 的一行有 130 列，380px 里宁可折行也不能裁掉——裁掉就读不出引用，而复制按钮抄的是文件本文。 */
  pre.bib { white-space: pre-wrap; overflow-wrap: break-word; }
  table.rel th.hide, table.rel td.hide { display: none; }
}
