/* ============================================================
   站点共用样式
   单文件、无外部依赖。改写色值只需动 :root。
   ============================================================ */

:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --bg-softer: #1c2128;
  --border: #2d333b;
  --border-soft: #21262d;
  --text: #e6edf3;
  --text-dim: #9198a1;
  --text-faint: #6e7681;
  --accent: #58a6ff;
  --accent-soft: rgba(88, 166, 255, 0.12);
  --green: #3fb950;
  --amber: #d29922;
  --red: #f85149;
  --max: 960px;
  --max-narrow: 720px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}
code {
  background: var(--bg-softer);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 5px;
  color: #d0d7de;
}

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

/* ---------------- 导航 ---------------- */
nav.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
nav.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 20px;
}
nav.site-nav .brand {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
nav.site-nav .brand:hover { text-decoration: none; color: var(--accent); }
nav.site-nav .links { display: flex; gap: 20px; align-items: center; }
nav.site-nav .links a { color: var(--text-dim); }
nav.site-nav .links a:hover { color: var(--text); text-decoration: none; }
nav.site-nav .links a.active { color: var(--accent); }
@media (max-width: 560px) {
  nav.site-nav .links { gap: 14px; }
  nav.site-nav .links a.hide-sm { display: none; }
}

/* ---------------- Hero ---------------- */
header.hero {
  border-bottom: 1px solid var(--border);
  padding: 88px 0 56px;
  background:
    radial-gradient(ellipse 700px 320px at 18% 0%, rgba(88,166,255,0.10), transparent 70%),
    var(--bg);
}
header.hero.compact { padding: 56px 0 40px; }

.hero-role {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(88,166,255,0.28);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 22px;
}

h1 {
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.25;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h1.page-title { font-size: clamp(26px, 4.4vw, 38px); }
h1 .thin { color: var(--text-dim); font-weight: 400; }

.hero-sub {
  font-size: 17px;
  color: var(--text-dim);
  margin: 0 0 34px;
  max-width: 40em;
}
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-sub:last-child { margin-bottom: 0; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-size: 14px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.dot.amber { background: var(--amber); }
.dot.dim { background: var(--text-faint); }

/* ---------------- 面包屑 ---------------- */
.crumbs {
  font-size: 13px;
  color: var(--text-faint);
  padding: 18px 0 0;
}
.crumbs a { color: var(--text-faint); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 8px; color: var(--border); }

/* ---------------- Section ---------------- */
section { padding: 58px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
section.tight { padding: 40px 0; }
section.no-border { border-bottom: none; }

h2 {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin: 0 0 8px;
}
h2 + .sec-lead { margin-top: 0; }

h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 34px 0 12px;
}
h3:first-child { margin-top: 0; }

h4 {
  font-size: 15.5px;
  font-weight: 600;
  margin: 26px 0 10px;
  color: var(--text);
}

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

.sec-lead {
  font-size: 15px;
  color: var(--text-dim);
  margin: 0 0 30px;
  max-width: 46em;
}

/* ---------------- 卡片 ---------------- */
.cards { display: grid; gap: 16px; }
@media (min-width: 700px) { .cards.two { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  transition: border-color .18s ease, transform .18s ease;
}
a.card { color: inherit; }
a.card:hover { border-color: #3d444d; transform: translateY(-2px); text-decoration: none; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-idx {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-faint);
}
.card h3 { font-size: 17px; margin: 0 0 10px; }
.card p { font-size: 14px; color: var(--text-dim); margin: 0 0 16px; flex: 1; }
.card ul {
  list-style: none; padding: 0; margin: 0 0 16px;
  font-size: 13px; color: var(--text-dim);
}
.card ul li { padding-left: 15px; position: relative; margin-bottom: 5px; }
.card ul li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 5px; height: 1px; background: var(--text-faint);
}
.card-foot {
  border-top: 1px dashed var(--border);
  padding-top: 13px;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.65;
}

/* ---------------- 标签 ---------------- */
.tag {
  font-size: 11px; padding: 3px 9px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--text-dim);
  white-space: nowrap; flex: none;
}
.tag.live { color: var(--green); border-color: rgba(63,185,80,.35); background: rgba(63,185,80,.08); }
.tag.soon { color: var(--amber); border-color: rgba(210,153,34,.35); background: rgba(210,153,34,.08); }
.tag.private { color: var(--text-faint); }

/* ---------------- 技术栈 ---------------- */
.stack { display: grid; gap: 14px; }
@media (min-width: 700px) { .stack { grid-template-columns: 168px 1fr; } }
.stack-row { display: contents; }
.stack-label {
  font-size: 14px; color: var(--text-dim);
  padding-top: 3px; font-weight: 500;
}
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  font-size: 13px; padding: 4px 11px; border-radius: 6px;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
}
.pill.strong { border-color: rgba(88,166,255,.38); color: var(--accent); background: var(--accent-soft); }
.pill.learn { color: var(--text-faint); border-style: dashed; }

/* ---------------- 提示块 ---------------- */
.note {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 18px 22px;
  font-size: 14px;
  color: var(--text-dim);
}
.note strong { color: var(--text); }
.note p { margin: 0 0 10px; }
.note p:last-child { margin-bottom: 0; }

.note.warn { border-left-color: var(--amber); }
.note.edge { border-left-color: var(--text-faint); }

/* ---------------- 键值列表 ---------------- */
.rules { list-style: none; padding: 0; margin: 0; }
.rules li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  gap: 14px;
}
.rules li:last-child { border-bottom: none; }
.rules .k { color: var(--text); font-weight: 600; flex: none; min-width: 7.5em; }
@media (max-width: 560px) {
  .rules li { flex-direction: column; gap: 4px; }
  .rules .k { min-width: 0; }
}

/* ---------------- 表格 ---------------- */
.table-scroll { overflow-x: auto; margin: 0 0 20px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 480px;
}
th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13px;
  border-bottom-color: var(--border);
  white-space: nowrap;
}
td { color: var(--text-dim); }
td strong, td .hl { color: var(--text); }

/* ---------------- 规模数字 ---------------- */
.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin: 0 0 24px;
}
.stat {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px 16px;
}
.stat .n {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.stat .l { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; }

/* ---------------- 结构图 ---------------- */
figure { margin: 0 0 24px; }
figure svg { width: 100%; height: auto; display: block; }
figcaption {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 10px;
  text-align: center;
}
.diagram-frame {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 20px 16px;
}

/* ---------------- 决策记录 ---------------- */
.decision {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 18px;
}
.decision > .d-head {
  background: var(--bg-softer);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.decision > .d-body { padding: 16px 18px; font-size: 14px; }
.decision dl { margin: 0; }
.decision dt {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  margin: 0 0 4px;
}
.decision dd {
  margin: 0 0 16px;
  color: var(--text-dim);
}
.decision dd:last-child { margin-bottom: 0; }
.decision dd strong { color: var(--text); }

/* ---------------- 页脚 ---------------- */
footer {
  padding: 40px 0 56px;
  font-size: 13px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}
footer a { color: var(--text-faint); }
footer .frow { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }
footer .sep { color: var(--border); }
footer .fnote { margin-top: 14px; max-width: 46em; line-height: 1.7; }

/* ---------------- 工具类 ---------------- */
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 13.5px; }
.nowrap { white-space: nowrap; }
