/* ============================================================
   TT Code · 终端原生 共享样式
   tokens · base · nav · footer · buttons · 通用组件
   字体自托管 (China 不可用 Google Fonts), CJK 走系统字体
   ============================================================ */
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/jbm-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/jbm-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/jbm-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/jbm-700.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/sg-500.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/sg-600.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/sg-700.woff2") format("woff2"); }

:root {
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --grotesk: "Space Grotesk", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Space Grotesk", sans-serif;
}
[data-theme="dark"] {
  --bg: #0d100e; --bg-2: #151a16; --panel: #151a16; --panel-2: #1b211c;
  --ink: #eef1ee; --muted: #99a39c; --faint: #6e7872;
  --line: #343b36; --line-2: #2a302c; --grid: #262c28;
  --green: #46e08f; --green-ink: #08130d; --green-dim: #3e7a5b;
  --glow: rgba(70,224,143,.22); --green-soft: rgba(70,224,143,.12);
  --nav-bg: rgba(13,16,14,.82); --blue: #6db3e8;
  --l1: #e06b52; --l2: #d8c24f; --l3: #57cf8f;
  --term-shadow: 0 30px 80px -30px rgba(0,0,0,.65);
}
[data-theme="light"] {
  --bg: #f5f8f4; --bg-2: #eef2ec; --panel: #fbfcfa; --panel-2: #f0f4ef;
  --ink: #1a201b; --muted: #586159; --faint: #838c85;
  --line: #dde2dc; --line-2: #e7ebe6; --grid: #e7ebe6;
  --green: #0c9a55; --green-ink: #fafdf9; --green-dim: #5cae84;
  --glow: rgba(12,154,85,.16); --green-soft: rgba(12,154,85,.10);
  --nav-bg: rgba(245,248,244,.82); --blue: #2f6fd0;
  --l1: #e0795f; --l2: #d8b84f; --l3: #3fae73;
  --term-shadow: 0 24px 60px -28px rgba(20,40,28,.28);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; line-height: 1.5; overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}
::selection { background: var(--green); color: var(--green-ink); }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--green); font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--green); display: inline-block; }

/* NAV */
nav {
  position: sticky; top: 0; z-index: 50; background: var(--nav-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.nav-in { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.logo {
  width: 26px; height: 26px; border: 1px solid var(--green); border-radius: 7px;
  display: grid; place-items: center; color: var(--green); font-size: 13px; flex: none;
  box-shadow: inset 0 0 12px var(--green-soft);
}
.nav-links { display: flex; gap: 26px; margin-left: 12px; }
.nav-links a { font-size: 13.5px; color: var(--muted); font-family: var(--mono); transition: color .2s; }
.nav-links a:hover, .nav-links a.on { color: var(--ink); }
.nav-links a.on { color: var(--green); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.theme-btn {
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center;
  transition: all .2s; font-size: 14px;
}
.theme-btn:hover { color: var(--ink); border-color: var(--green); }

/* BUTTONS */
.btn {
  font-family: var(--mono); font-size: 13.5px; font-weight: 500; padding: 9px 16px;
  border-radius: 8px; cursor: pointer; transition: all .2s; display: inline-flex;
  align-items: center; gap: 8px; border: 1px solid transparent; white-space: nowrap;
  /* button 元素默认带 UA 白底 — 显式置透明, 否则暗色下 ghost/line 按钮变白块看不见字 */
  background: transparent; color: var(--ink); appearance: none; -webkit-appearance: none;
}
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }
.btn-solid { background: var(--green); color: var(--green-ink); font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset; }
.btn-solid:hover { transform: translateY(-1px); box-shadow: 0 6px 22px var(--glow); }
.btn-line { border-color: var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--green); color: var(--green); }
.btn-lg { padding: 13px 22px; font-size: 14.5px; border-radius: 10px; }
.btn-block { width: 100%; justify-content: center; }

/* GRID BACKDROP (shared hero/page top) */
.page-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0%, transparent 80%);
  opacity: .5;
}
.page-glow {
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 820px; height: 460px; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, var(--glow), transparent 68%);
  filter: blur(10px); opacity: .85;
}

/* PAGE HEAD (sub pages) */
.phead { position: relative; padding: 72px 0 8px; overflow: hidden; }
.phead-in { position: relative; z-index: 2; }
.phead .badge {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono);
  font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  padding: 5px 11px 5px 7px; border-radius: 100px; margin-bottom: 24px;
}
.phead .badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.phead h1 { font-family: var(--grotesk); font-weight: 600; font-size: 52px; line-height: 1.05; letter-spacing: -.03em; margin-bottom: 18px; }
.phead h1 .accent { color: var(--green); }
.phead .lede { font-size: 17px; color: var(--muted); max-width: 560px; line-height: 1.65; }

/* FOOTER */
footer { border-top: 1px solid var(--line-2); padding: 50px 0 40px; margin-top: 20px; }
.foot-in { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot-col h4 { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-bottom: 16px; }
.foot-col a { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; transition: color .2s; }
.foot-col a:hover { color: var(--green); }
.foot-bottom { display: flex; justify-content: space-between; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; color: var(--faint); flex-wrap: wrap; gap: 12px; }
.foot-bottom a { color: var(--faint); transition: color .2s; }
.foot-bottom a:hover { color: var(--green); }

/* TERMINAL CARD (shared) */
.terminal { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--term-shadow); }
.term-bar { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); background: var(--panel-2); }
.term-bar .lights { display: flex; gap: 7px; }
.term-bar .lights i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.l1 { background: var(--l1); } .l2 { background: var(--l2); } .l3 { background: var(--l3); }
.term-bar .title { font-family: var(--mono); font-size: 12px; color: var(--faint); margin: 0 auto; }
.term-bar .pill { font-family: var(--mono); font-size: 11px; color: var(--green); border: 1px solid var(--green-dim); padding: 2px 8px; border-radius: 6px; }

/* CTA BAND (shared) */
.cta-band { position: relative; border: 1px solid var(--line); border-radius: 18px; padding: 64px 48px; text-align: center; overflow: hidden; background: var(--panel); }
.cta-band .cta-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 80% at 50% 50%, #000, transparent 75%);
}
.cta-band h2 { position: relative; font-family: var(--grotesk); font-weight: 600; font-size: 42px; letter-spacing: -.02em; margin-bottom: 16px; }
.cta-band p { position: relative; color: var(--muted); margin-bottom: 30px; font-family: var(--mono); font-size: 14px; }
.cta-band .cta-row { position: relative; justify-content: center; display: flex; gap: 12px; flex-wrap: wrap; }

section.block { padding: 88px 0; }
.head { max-width: 640px; margin-bottom: 48px; }
.head h2 { font-family: var(--grotesk); font-weight: 600; font-size: 38px; letter-spacing: -.02em; margin: 16px 0 14px; line-height: 1.1; }
.head p { color: var(--muted); font-size: 16px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .phead h1 { font-size: 40px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .phead h1 { font-size: 33px; }
}
