/* Tessovis 文档站：与官网同一套 DNA（doc/DESIGN-SYSTEM.md）——零构建静态站。
   浅灰纸面 + 白面板 + 橙色行动色 + 影像玻璃页脚；页头是浮起的药丸条。
   亮暗两套都是一等公民：暗色不是把亮色调暗，而是另一组 token。

   一处与官网刻意不同：这里的 h1 是 600 而不是 500。官网的 display 有 67px，
   500 已经足够肯定；文档标题落在密排技术正文里，600 才扫得出来。 */
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist/Geist-Variable.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist/GeistMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --fg: #181818; --fg-2: #6a6a6a; --fg-3: #9b9b9b;
  --bg: #efefef; --surface: #ffffff; --surface-2: #f5f5f5;
  --line: #e3e3e1; --line-2: #d5d5d3;
  --brand: #f26522;                     /* 图形用，不承载正文对比度 */
  --accent: #c2410c;                    /* 橙色当文字用：白底 5.18:1 */
  --ok: #067647; --err: #b42318;
  --code-bg: #0e0f11; --code-fg: #e8e8e6; --code-c: #7a7a7a;
  --ink: #0e0f11; --ink-fg: #ffffff;
  --ink-fg-2: rgb(255 255 255 / 0.64); --ink-line: rgb(255 255 255 / 0.14);
  --panel-shadow: 0 1px 2px rgb(16 16 20 / 0.05), 0 1px 1px rgb(16 16 20 / 0.03);
  --panel-inner: none;
  --shadow-bar: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.08);
  --r-pill: 28px;
  --font: "Geist", -apple-system, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #f2f2f4; --fg-2: #a1a1ac; --fg-3: #6f6f7b;
    --bg: #0a0a0a; --surface: #141416; --surface-2: #1b1b1e;
    --line: #26262a; --line-2: #33333a;
    --brand: #ff7a3d; --accent: #ff9059;
    --ok: #4ade80; --err: #f87171;
    --code-bg: #050506; --code-c: #6f6f7b;
    --panel-shadow: none;
    --panel-inner: inset 0 1px 0 rgb(255 255 255 / 0.04);
    --shadow-bar: 0 8px 32px rgb(0 0 0 / 0.55);
  }
}
/* 显式选择必须压过系统偏好——两个方向都要写，否则在暗色系统上选不回亮色 */
:root[data-theme="light"] {
  --fg: #181818; --fg-2: #6a6a6a; --fg-3: #9b9b9b;
  --bg: #efefef; --surface: #ffffff; --surface-2: #f5f5f5;
  --line: #e3e3e1; --line-2: #d5d5d3;
  --brand: #f26522; --accent: #c2410c; --ok: #067647; --err: #b42318;
  --code-bg: #0e0f11; --code-c: #7a7a7a;
  --panel-shadow: 0 1px 2px rgb(16 16 20 / 0.05), 0 1px 1px rgb(16 16 20 / 0.03);
  --panel-inner: none;
  --shadow-bar: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.08);
}
:root[data-theme="dark"] {
  --fg: #f2f2f4; --fg-2: #a1a1ac; --fg-3: #6f6f7b;
  --bg: #0a0a0a; --surface: #141416; --surface-2: #1b1b1e;
  --line: #26262a; --line-2: #33333a;
  --brand: #ff7a3d; --accent: #ff9059; --ok: #4ade80; --err: #f87171;
  --code-bg: #050506; --code-c: #6f6f7b;
  --panel-shadow: none;
  --panel-inner: inset 0 1px 0 rgb(255 255 255 / 0.04);
  --shadow-bar: 0 8px 32px rgb(0 0 0 / 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── 页头：浮起的药丸条 ────────────────────────────────────────────────── */

header { position: sticky; top: 0; z-index: 10; padding: 8px; }
@media (min-width: 640px) { header { padding: 12px; } }
.header-bar {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 5px 5px 5px 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); box-shadow: var(--shadow-bar);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none;
  font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--fg); color: var(--bg); display: grid; place-items: center; }
.brand-mark svg { width: 17px; height: 17px; fill: currentColor; }
.brand-word { white-space: nowrap; }
.brand-sub { color: var(--fg-2); font-weight: 400; }
nav { display: flex; gap: 2px; font-size: 14px; color: var(--fg-2); }
nav a { padding: 7px 12px; border-radius: var(--r-pill); white-space: nowrap;
  transition: color 200ms cubic-bezier(0.25, 0.1, 0.25, 1); }
nav a:hover { color: var(--fg); }
nav a.active { color: var(--fg); font-weight: 500; background: var(--surface-2); }
.spacer { flex: 1; }
.ext { font-size: 13px; color: var(--fg-2); white-space: nowrap;
  transition: color 200ms cubic-bezier(0.25, 0.1, 0.25, 1); }
.ext:hover { color: var(--fg); }

.theme-toggle {
  width: 32px; height: 32px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: none; color: var(--fg-2);
  cursor: pointer; transition: background 120ms ease, color 120ms ease;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--fg); }
.theme-toggle svg { width: 18px; height: 18px; stroke: currentColor;
  stroke-width: 1.5; fill: none; }
/* 当前主题只显示「切到另一边」的那个字形 */
.theme-toggle .to-dark { display: block; }
.theme-toggle .to-light { display: none; }
@media (prefers-color-scheme: dark) {
  .theme-toggle .to-dark { display: none; }
  .theme-toggle .to-light { display: block; }
}
:root[data-theme="light"] .theme-toggle .to-dark { display: block; }
:root[data-theme="light"] .theme-toggle .to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .to-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .to-light { display: block; }

/* ── 正文 ─────────────────────────────────────────────────────────────── */

main { max-width: 760px; margin: 0 auto; padding: 72px 24px 128px; }

h1 { font-size: clamp(34px, 5.6vw, 67px); font-weight: 600; letter-spacing: -0.03em;
  line-height: 1.08; text-wrap: balance; }
.sub { color: var(--fg-2); margin-top: 24px; max-width: 46ch; font-size: 17px; line-height: 1.65; }
section { margin-top: 80px; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); }
p { color: var(--fg-2); margin-bottom: 12px; }
p strong, li strong { color: var(--fg); font-weight: 500; }
ol, ul { margin: 0 0 12px 20px; color: var(--fg-2); }
li { margin-bottom: 8px; }

code { font-family: var(--mono); font-size: 14px; background: var(--surface-2);
  border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
/* 代码块在两套主题里都是最深的一层——它是终端，不是段落 */
pre { background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px; overflow-x: auto; margin: 20px 0; line-height: 1.75; }
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 14px; }
pre .c { color: var(--code-c); }

/* 表格住在面板上：文档里的表是一块可查的资料，不是段落之间的一段线 */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 16px;
  margin: 20px 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--panel-shadow), var(--panel-inner); }
th, td { text-align: left; padding: 12px 32px 12px 0;
  box-shadow: inset 0 -1px 0 var(--line); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tr:last-child td { box-shadow: none; }
th { color: var(--fg-2); font-weight: 500; font-size: 13px;
  letter-spacing: 0.04em; text-transform: uppercase; }
td { font-variant-numeric: tabular-nums; }

.a { color: var(--accent); border-bottom: 1px solid transparent;
  transition: border-color 200ms cubic-bezier(0.25, 0.1, 0.25, 1); }
a.a:hover { border-color: currentColor; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 80px 0 0; }

/* 状态页：探测行同样落在面板上，一组探测是一块仪表，不是四行文字 */
.probes { background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--panel-shadow), var(--panel-inner);
  padding: 0 20px; }
.probe { display: flex; align-items: baseline; gap: 12px; padding: 16px 0;
  box-shadow: inset 0 -1px 0 var(--line); }
.probes .probe:last-child { box-shadow: none; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2);
  align-self: center; flex: none; }
.dot.ok { background: var(--ok); }
.dot.down { background: var(--err); }
.probe .name { font-weight: 500; min-width: 180px; }
.probe .state { color: var(--fg-2); font-size: 14px; }
.probe .ms { margin-left: auto; color: var(--fg-2); font-size: 14px;
  font-variant-numeric: tabular-nums; }

/* 更新日志：一条一张面板，日期在左栏 */
.entry { display: grid; grid-template-columns: 120px 1fr; gap: 24px;
  padding: 24px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--panel-shadow), var(--panel-inner); }
.entry .date { color: var(--fg-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.entry h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.005em; }
.entry p { font-size: 16px; margin-bottom: 6px; }

/* 滚动揭示：内容默认可见，只在支持滚动时间线的引擎上揭示。
   把内容藏在 opacity: 0 后面等一个不会运行的时间线，在 Firefox 稳定版就是一片白屏。 */
section { opacity: 1; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    section { animation: doc-reveal linear both; animation-timeline: view();
      animation-range: entry 6% cover 26%; }
  }
}
@keyframes doc-reveal { from { opacity: 0; transform: translateY(16px); } }

/* ── 页脚：影像上的玻璃面板 ───────────────────────────────────────────── */

/* 影像带必须比玻璃面板高出一大截，否则 inset:0 的视频正好等于面板高度，
   影像读作面板的一圈描边，而不是面板浮在其中的那个环境。 */
footer { position: relative; padding: clamp(180px, 26vh, 320px) 8px 8px; isolation: isolate; }
@media (min-width: 640px) { footer { padding-inline: 12px; padding-bottom: 12px; } }
.footer-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.footer-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 功能性压暗：白字压在影像上必须有底 */
.footer-media::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgb(8 10 14 / 0.34) 0%, rgb(8 10 14 / 0.52) 45%,
    rgb(8 10 14 / 0.82) 100%); }
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 32px 24px;
  border-radius: 24px; color: var(--ink-fg-2);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; font-size: 13px;
}
.footer-inner .sep { flex: 1; }
.footer-inner a { transition: color 200ms cubic-bezier(0.25, 0.1, 0.25, 1); }
.footer-inner a:hover { color: var(--ink-fg); }
.footer-inner .rights { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

.liquid-glass {
  background: rgb(255 255 255 / 0.04);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / 0.10);
  position: relative; overflow: hidden;
}
/* 上下两端亮、中间透明的 1.4px 边——mask-composite 挖空内芯，只留描边 */
.liquid-glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.4px;
  background: linear-gradient(180deg,
    rgb(255 255 255 / 0.45) 0%, rgb(255 255 255 / 0.15) 20%,
    rgb(255 255 255 / 0) 40%, rgb(255 255 255 / 0) 60%,
    rgb(255 255 255 / 0.15) 80%, rgb(255 255 255 / 0.45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

@media (max-width: 720px) {
  main { padding-top: 48px; }
  /* 窄屏页头必须留在 110px 以内（R05 守卫）：字标片收一档、行距压紧 */
  .brand-mark { width: 32px; height: 32px; }
  .header-bar { padding: 4px 4px 4px 6px; }
  nav a { padding: 5px 10px; }
  .entry { grid-template-columns: 1fr; gap: 6px; }
  .header-bar { flex-wrap: wrap; gap: 8px; row-gap: 6px; }
  /* 窄屏导航整行换行横排——单行挤压曾把「快速开始」折成一字一行 */
  nav { order: 3; width: 100%; gap: 2px; overflow-x: auto; white-space: nowrap;
    scrollbar-width: none; }
  .spacer { display: none; }
  .ext { margin-left: auto; }
  .ext + .ext { margin-left: 0; }
  .brand-sub { display: none; }
}
