/* Tokening 官网。只有这一个样式表:内容安全策略不允许内联样式,页面里也不要写 style=…。
   跟随系统深浅色;系统字体,不加载任何第三方资源。 */

:root {
  color-scheme: light dark;
  --bg: #fbfbfe;
  --bg-soft: #f3f3fa;
  --surface: #ffffff;
  --text: #17171f;
  --muted: #5c5d72;
  --border: #e4e4ef;
  --accent: #4f46e5;
  --accent-strong: #4338ca;
  --on-accent: #ffffff;
  --accent-soft: #ecebff;
  --lite: #0e8f82;
  --lite-soft: #dcf5f0;
  --code-bg: #f4f4fb;
  --ok: #15803d;
  --warn: #b45309;
  --shadow: 0 1px 2px rgba(23, 23, 31, .04), 0 14px 36px rgba(46, 46, 120, .08);
  --radius: 14px;
  --wrap: 1080px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f14;
    --bg-soft: #14141b;
    --surface: #17171f;
    --text: #ededf3;
    --muted: #a4a5ba;
    --border: #272736;
    --accent: #a3a3ff;
    --accent-strong: #c3c3ff;
    --on-accent: #12121c;
    --accent-soft: #1c1c38;
    --lite: #3fd6c4;
    --lite-soft: #10312e;
    --code-bg: #12131a;
    --ok: #6bd79a;
    --warn: #f3c969;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 44px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16.5px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -.012em;
  text-wrap: balance;
}

p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 4px 0; }
img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }
main a:hover { text-decoration: underline; text-underline-offset: .18em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* 跳过导航直达正文:平时藏在屏幕外,拿到焦点才出现 */
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 30;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* ---- 布局 ------------------------------------------------------------------------------------ */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 24px;
}

.section { padding-block: clamp(44px, 7vw, 84px); }
.band { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section-head { max-width: 760px; margin-bottom: 30px; }
.section-head p { color: var(--muted); font-size: 18px; margin: 10px 0 0; }
.section h2 { font-size: clamp(24px, 3vw, 32px); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
@media (max-width: 640px) {
  .wrap { padding-inline: 18px; }
}

/* ---- 页头与导航 ------------------------------------------------------------------------------ */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}

.head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  min-height: 60px;
  padding-block: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand img { display: block; border-radius: 7px; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 18px;
  font-size: 15px;
}
.site-nav a { color: var(--muted); padding: 6px 0; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.site-nav .lang {
  margin-left: 6px;
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
}
@media (max-width: 600px) {
  .head-row { position: relative; }
  .site-nav { gap: 0 14px; font-size: 14px; }
  .site-nav { flex-basis: 100%; }
  .site-nav .lang { position: absolute; top: 6px; right: 18px; margin-left: 0; }
}

/* ---- 按钮、标签 ------------------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: 600 15.5px/1.3 inherit;
  font-family: inherit;
  text-align: center;
  transition: border-color .15s, background-color .15s, color .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn.teal { background: var(--lite); border-color: var(--lite); color: #fff; }
.btn.teal:hover { filter: brightness(1.08); color: #fff; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 600;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 22px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.chips li { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.chips li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---- 首页:头图 -------------------------------------------------------------------------------- */

.hero {
  padding-block: clamp(40px, 7vw, 88px) clamp(40px, 6vw, 76px);
  background:
    radial-gradient(900px 420px at 80% -14%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(700px 380px at 2% 112%, color-mix(in srgb, var(--lite) 10%, transparent), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}

.hero h1 { font-size: clamp(32px, 5vw, 52px); margin: 18px 0 16px; }
.lead { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); max-width: 36em; }
.hero .lead { margin-bottom: 26px; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* 头图里的示意图:客户端 → 本机网关 → 服务商 */
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1.4fr) 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.flow-col { display: grid; gap: 8px; }
.flow-col:last-child { text-align: center; }
.flow-item {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 13.5px;
  line-height: 1.35;
  text-align: center;
}
.flow-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.flow-node {
  padding: 18px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 20%, var(--surface)), var(--surface));
  text-align: center;
}
.flow-node strong { font-size: 18px; }
.flow-node code { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.flow-node ul { display: grid; gap: 3px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.flow-arrow { display: flex; justify-content: center; color: var(--accent); font-size: 24px; line-height: 1; }
.flow-arrow svg { width: 26px; height: 26px; }

@media (max-width: 520px) {
  .flow { grid-template-columns: 1fr; }
  .flow-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow-arrow { transform: rotate(90deg); }
}

/* ---- 卡片、步骤、提示 ------------------------------------------------------------------------ */

.card {
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.card h3 { font-size: 18px; margin: 8px 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card p + p { margin-top: 8px; }
.card.top-accent { border-top: 3px solid var(--accent); }
.card.top-lite { border-top: 3px solid var(--lite); }
.num { color: var(--accent); font: 600 13px/1 var(--mono); letter-spacing: .08em; }
.card.accent { background: var(--accent-soft); border-color: transparent; }
.card.accent h3, .card.accent .num { color: var(--accent); }
.card.accent p { color: var(--text); }
.card.lite { background: var(--lite-soft); border-color: transparent; }
.card.lite h3, .card.lite .num { color: var(--lite); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.tag {
  padding: 1px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: nowrap;
}

.steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps > li { position: relative; margin: 0; padding-left: 52px; counter-increment: step; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 3px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 14px/1 var(--mono);
}
.steps > li strong { display: block; font-size: 17px; }
.steps > li p { margin: 2px 0 0; color: var(--muted); font-size: 15.5px; }

.callout {
  margin: 22px 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
}
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--warn); }
.callout.lite { border-left-color: var(--lite); }

/* ---- 代码 ------------------------------------------------------------------------------------ */

code, kbd, samp { font-family: var(--mono); font-size: .9em; }
:not(pre) > code {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--code-bg);
}

pre {
  position: relative;
  margin: 14px 0;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--code-bg);
  font: 400 14px/1.65 var(--mono);
  tab-size: 2;
}
pre code { font-size: inherit; padding: 0; border: 0; background: none; }

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font: 600 12px/1.4 inherit;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
pre:hover .copy, pre:focus-within .copy { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }

/* ---- 表格、定义列表 -------------------------------------------------------------------------- */

.table-wrap {
  margin: 18px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table { width: 100%; min-width: 36rem; border-collapse: collapse; font-size: 14.5px; line-height: 1.6; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { background: var(--bg-soft); color: var(--muted); font-size: 13.5px; white-space: nowrap; }
tbody th { font-weight: 600; white-space: nowrap; }
td:not(:first-child), th:not(:first-child) { text-align: center; }
.yes { color: var(--ok); font-weight: 600; white-space: nowrap; }
.no { color: var(--muted); white-space: nowrap; }

.specs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 22px; margin: 18px 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
@media (max-width: 560px) {
  .specs { grid-template-columns: 1fr; gap: 2px; }
  .specs dd { margin-bottom: 10px; }
}

/* ---- 文章页(指南、常见问题、隐私) ----------------------------------------------------------- */

.page { padding-block: clamp(32px, 5vw, 56px) clamp(48px, 7vw, 88px); }
.page-head { max-width: 780px; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(30px, 4.4vw, 44px); margin: 14px 0 12px; }
.page-head .lead { margin-bottom: 10px; }
.meta { color: var(--muted); font-size: 14px; }

.prose { max-width: 780px; }
.prose h2 { font-size: 24px; margin: 44px 0 12px; }
.prose h3 { font-size: 18px; margin: 28px 0 8px; }
.prose > :first-child { margin-top: 0; }
.prose img { display: block; border-radius: var(--radius); border: 1px solid var(--border); }

.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.guide-steps > li { margin: 0; padding-top: 30px; border-top: 1px solid var(--border); counter-increment: step; }
.guide-steps > li:first-child { padding-top: 0; border-top: 0; }
.step-title { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 22px; }
.step-title::before {
  content: counter(step, decimal-leading-zero);
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 14px/1 var(--mono);
}

.next { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 12px; }
.next a { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); }
.next a:hover { border-color: var(--accent); text-decoration: none; }
.next a strong { display: block; color: var(--accent); font-size: 15.5px; }
.next a span { color: var(--muted); font-size: 14px; }

.qa { padding: 22px 0; border-top: 1px solid var(--border); }
.qa:first-child { border-top: 0; padding-top: 0; }
.qa h2 { margin-bottom: 8px; font-size: 19px; }
.qa p, .qa ul { margin-bottom: 8px; }
.qa > :last-child { margin-bottom: 0; }

/* ---- 下载块(版本信息随静态页面生成) ------------------------------------------------------- */

.dl-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.dl-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.dl-card h3 { font-size: 19px; }
.dl-sub { margin: -6px 0 0; color: var(--muted); font-size: 14.5px; }
.release-status { min-height: 1.6em; margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.release-files { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.release-notes { margin: 0; color: var(--muted); font-size: 14.5px; }
.release-hash { font-size: 13.5px; }
.release-hash summary { color: var(--accent); cursor: pointer; }
.release-hash code { display: block; margin-top: 6px; overflow-wrap: anywhere; user-select: all; }

/* ---- 页脚 ------------------------------------------------------------------------------------ */

.site-foot { border-top: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); font-size: 14px; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.7fr repeat(3, 1fr);
  gap: 28px;
  padding-block: 44px 28px;
}
.foot-brand .brand { color: var(--text); }
.foot-brand p { max-width: 30em; margin: 10px 0 0; }
.site-foot h2 { margin-bottom: 10px; color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.site-foot nav a { display: block; padding: 3px 0; color: var(--muted); }
.site-foot nav a:hover { color: var(--text); text-decoration: none; }
.foot-legal { padding-block: 16px 30px; border-top: 1px solid var(--border); }
@media (max-width: 820px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

.download-product { margin-block: 22px 34px; }
.download-product + .download-product { padding-top: 24px; border-top: 1px solid var(--border); }
.download-product-head { margin-bottom: 14px; }
.download-product-head h2 { font-size: clamp(22px, 3vw, 28px); }
.download-product-head p { color: var(--muted); margin: 4px 0 0; }
.dl-card { border-top: 3px solid var(--accent); box-shadow: var(--shadow); }
.dl-card.lite { border-top-color: var(--lite); }
.dl-card .btn { justify-self: start; }
.release-notes { margin-top: 6px; white-space: pre-line; }
