/* ============================================================
   SeimiRender 官网 — 共享样式（导航 / 按钮 / 页脚 / 工具类）
   ============================================================ */

:root {
  --bg-0: #04060d;
  --bg-1: #070b16;
  --bg-2: #0a101f;
  --bg-3: #0e1526;
  --surface: rgba(148, 178, 255, .045);
  --surface-2: rgba(148, 178, 255, .08);
  --border: rgba(148, 178, 255, .13);
  --border-strong: rgba(148, 178, 255, .24);
  --text-1: #e9effc;
  --text-2: #a3b1c9;
  --text-3: #6d7c96;
  --brand-1: #4f8cff;
  --brand-2: #26d0f5;
  --brand-3: #8f7bff;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --grad-brand: linear-gradient(120deg, #4f8cff 0%, #26d0f5 100%);
  --grad-text: linear-gradient(100deg, #8ab8ff 0%, #5fd8f2 55%, #8f7bff 100%);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
  --radius: 16px;
  --nav-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 20px); }

body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(79, 140, 255, .35); color: #fff; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1c2740; border-radius: 8px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: #2a3a5e; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }

/* ---------- 通用文字工具 ---------- */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.mono { font-family: var(--font-mono); }

/* ---------- 章节骨架 ---------- */
.section { padding: 108px 0; position: relative; }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .22em;
  color: var(--text-3); text-transform: uppercase;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px;
  background: var(--grad-brand);
}
.section-head.center .eyebrow::after {
  content: ""; width: 22px; height: 2px; border-radius: 2px;
  background: var(--grad-brand);
}
.section-title {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700; line-height: 1.25; letter-spacing: -.01em;
  margin-bottom: 16px;
}
.section-sub { color: var(--text-2); font-size: 17px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: 12px;
  font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease,
    border-color .18s ease, color .18s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: var(--grad-brand);
  color: #03101d;
  box-shadow: 0 8px 28px -8px rgba(56, 149, 255, .55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px -8px rgba(56, 149, 255, .65); }
.btn-ghost {
  background: rgba(148, 178, 255, .05);
  border-color: var(--border-strong);
  color: var(--text-1);
}
.btn-ghost:hover { background: rgba(148, 178, 255, .11); border-color: rgba(148, 178, 255, .4); transform: translateY(-2px); }
.btn .ico { width: 17px; height: 17px; flex: none; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 8, 16, .78);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  height: 100%; display: flex; align-items: center; gap: 40px;
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  box-shadow: 0 4px 18px -4px rgba(59, 130, 246, .55);
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.brand-name em { font-style: normal; color: var(--text-3); font-weight: 600; }

.nav-links { display: flex; align-items: center; gap: 6px; flex: 1; }
.nav-links a {
  padding: 8px 14px; border-radius: 9px;
  font-size: 14.5px; font-weight: 500; color: var(--text-2);
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--text-1); background: rgba(148, 178, 255, .08); }
.nav-links a.active { color: var(--text-1); }

.nav-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.nav-actions .btn { padding: 10px 18px; font-size: 14px; }
.gh-stars {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); font-weight: 600;
  padding: 4px 8px; border-radius: 8px;
}
.gh-stars .ico { width: 15px; height: 15px; }

.nav-burger {
  display: none; width: 40px; height: 40px; flex: none;
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
  align-items: center; justify-content: center;
}
.nav-burger svg { width: 18px; height: 18px; stroke: var(--text-1); }

.nav-mobile {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 99;
  background: rgba(5, 8, 16, .97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px 22px;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block; padding: 11px 6px; font-size: 16px; color: var(--text-2);
  border-bottom: 1px solid rgba(148, 178, 255, .07);
}
.nav-mobile a:last-child { border-bottom: 0; }
.nav-mobile a:hover, .nav-mobile a.active { color: var(--text-1); }

/* ---------- 玻璃卡片基类 ---------- */
.card {
  background: linear-gradient(180deg, rgba(148, 178, 255, .06), rgba(148, 178, 255, .028));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .22s ease, transform .22s ease, background .22s ease, box-shadow .22s ease;
}
.card:hover {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(148, 178, 255, .09), rgba(148, 178, 255, .04));
}

/* ---------- 代码块（带复制按钮） ---------- */
.code-block {
  position: relative;
  background: #060a13;
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
}
.code-block .code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(148, 178, 255, .09);
  background: rgba(148, 178, 255, .04);
}
.code-block .code-lang {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em;
  color: var(--text-3); text-transform: uppercase;
}
.code-block pre {
  overflow-x: auto; padding: 16px 18px;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75;
  color: #c9d6f0;
}
.code-block pre code { font-family: inherit; background: none; padding: 0; }

.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  padding: 4px 9px; font-size: 12px; color: var(--text-3);
  transition: color .15s, border-color .15s, background .15s;
}
.copy-btn:hover { color: var(--text-1); border-color: var(--border-strong); background: rgba(148,178,255,.07); }
.copy-btn.done { color: var(--ok); }
.copy-btn svg { width: 13px; height: 13px; }

/* ---------- 徽标 / 小标签 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  background: rgba(148, 178, 255, .08);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 8px var(--brand-2); }
.chip.mono { font-family: var(--font-mono); font-size: 12px; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  background:
    radial-gradient(60% 130% at 50% 100%, rgba(79, 140, 255, .07), transparent 70%),
    var(--bg-1);
  padding: 72px 0 36px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 56px;
}
.footer-brand p { color: var(--text-3); font-size: 14px; margin-top: 16px; max-width: 340px; }
.footer h4 {
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 18px; font-weight: 600;
}
.footer-links { display: flex; flex-direction: column; gap: 11px; }
.footer-links a {
  color: var(--text-2); font-size: 14.5px; width: fit-content;
  transition: color .15s ease;
}
.footer-links a:hover { color: var(--text-1); }
.footer-links a .ico { width: 13px; height: 13px; opacity: .5; margin-left: 4px; }
.footer-bottom {
  border-top: 1px solid rgba(148, 178, 255, .08);
  padding-top: 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13.5px;
}
.footer-bottom a {
  color: var(--text-3);
  border-bottom: 1px dashed rgba(148, 178, 255, .25);
  transition: color .15s ease, border-color .15s ease;
}
.footer-bottom a:hover { color: var(--text-1); border-bottom-color: rgba(148, 178, 255, .55); }

/* ---------- 滚动浮现动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.2, .65, .3, 1), transform .7s cubic-bezier(.2, .65, .3, 1);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 4, 9, .9);
  backdrop-filter: blur(10px);
  display: none; flex-direction: column; align-items: center;
  padding: 4vh 4vw;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(1200px, 100%); max-height: 78vh;
  border-radius: 12px; border: 1px solid var(--border-strong);
  box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .8);
  object-fit: contain;
}
.lightbox .lightbox-scroll {
  max-height: 78vh; overflow-y: auto; border-radius: 12px;
}
.lightbox .lightbox-scroll img { max-height: none; height: auto; }
.lightbox figcaption {
  margin-top: 16px; color: var(--text-2); font-size: 14px;
  text-align: center; max-width: 720px;
}
.lightbox .lightbox-close {
  position: absolute; top: 22px; right: 26px;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(148, 178, 255, .1); border: 1px solid var(--border-strong);
  color: var(--text-1); font-size: 19px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox .lightbox-close:hover { background: rgba(148, 178, 255, .22); }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  .section { padding: 76px 0; }
  .container { padding: 0 20px; }
  .nav-actions .btn-ghost span.txt { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}
