/* ============================================================
   研约 · 基础设计令牌与全局样式
   字体：思源宋体（显示）/ 思源黑体（正文）/ IBM Plex Mono（数据）
   ============================================================ */

:root {
  /* 品牌色 */
  --ink-950: #070e22;
  --ink-900: #0b1530;
  --ink-800: #101c3d;
  --ink-700: #1a2a52;
  --blue-600: #3867ff;
  --blue-500: #4d7aff;
  --blue-300: #8fafff;
  --blue-100: #e4ebff;
  --teal-500: #2ac9b7;
  --teal-400: #3fdcc9;
  --teal-100: #d8f5f0;
  --mist-50: #f5f7fc;
  --mist-25: #fafbfe;
  --white: #ffffff;

  /* 文字 */
  --text-strong: #0e1730;
  --text-body: #2c3a58;
  --text-muted: #5c6c8c;
  --text-faint: #8b99b3;
  --text-on-dark: #eef2fc;
  --text-on-dark-muted: #a3b3d2;

  /* 线与面 */
  --line: #d7dfef;
  --line-soft: #e7edf7;
  --line-dark: rgba(147, 168, 212, 0.2);
  --surface: #ffffff;
  --surface-soft: #f5f7fc;
  --surface-deep: #0b1530;

  /* 间距（8px 节奏） */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 40px;
  --sp-8: 48px;
  --sp-9: 64px;
  --sp-10: 80px;
  --sp-11: 96px;
  --sp-12: 128px;

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* 字体 */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong",
    "SimSun", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Source Han Sans SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas,
    monospace;

  /* 阴影（克制但有层次） */
  --shadow-xs: 0 1px 2px rgba(14, 23, 48, 0.04);
  --shadow-sm: 0 2px 8px rgba(14, 23, 48, 0.06);
  --shadow-md: 0 12px 32px rgba(14, 23, 48, 0.09);
  --shadow-lg: 0 28px 64px rgba(7, 14, 34, 0.18);
  --shadow-glow: 0 0 0 1px rgba(56, 103, 255, 0.14),
    0 16px 48px rgba(56, 103, 255, 0.16);

  --max-w: 1180px;
  --nav-h: 68px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-body);
  background: var(--mist-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "palt" 1;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: var(--blue-600);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
  color: var(--blue-500);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text-strong);
  line-height: 1.28;
  font-weight: 700;
  font-family: var(--font-serif);
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--blue-600);
  color: #fff;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- 布局 ---------- */
.container {
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto;
}

.section {
  padding: var(--sp-12) 0;
}

.section--tight {
  padding: var(--sp-10) 0;
}

/* ---------- 标题体系 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-600);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.eyebrow--teal {
  color: var(--teal-500);
}

.eyebrow--light {
  color: var(--teal-400);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 700;
  margin-top: var(--sp-5);
  letter-spacing: 0.02em;
  line-height: 1.32;
}

.section-lead {
  margin-top: var(--sp-5);
  max-width: 640px;
  font-size: 16.5px;
  line-height: 2;
  color: var(--text-muted);
}

.section-index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.18em;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
  display: inline-block;
}

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.22s ease, box-shadow 0.22s ease, color 0.22s ease,
    border-color 0.22s ease;
  white-space: nowrap;
  overflow: hidden;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500) 60%, #5e86ff);
  color: #fff;
  box-shadow: 0 10px 28px rgba(56, 103, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--primary:hover {
  box-shadow: 0 16px 36px rgba(56, 103, 255, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, var(--blue-500), #5e86ff);
}

.btn--ghost-light {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-on-dark);
  border: 1px solid rgba(163, 179, 210, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(163, 179, 210, 0.55);
}

.btn--ghost {
  background: var(--white);
  color: var(--text-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
}

.btn--ghost:hover {
  border-color: var(--blue-600);
  color: var(--blue-600);
  box-shadow: var(--shadow-sm);
}

.btn--teal {
  background: linear-gradient(135deg, var(--teal-500), var(--teal-400));
  color: var(--ink-900);
  box-shadow: 0 10px 26px rgba(42, 201, 183, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--teal:hover {
  filter: brightness(1.04);
  box-shadow: 0 14px 32px rgba(42, 201, 183, 0.4);
}

.btn--sm {
  padding: 10px 18px;
  font-size: 13.5px;
  border-radius: 999px;
}

.btn--lg {
  padding: 16px 32px;
  font-size: 16px;
}

/* ---------- 标签 / 徽章 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.03em;
  background: var(--blue-100);
  color: var(--blue-600);
}

.tag--teal {
  background: var(--teal-100);
  color: #0f7a6c;
}

.tag--mute {
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--line-soft);
}

.tag--warn {
  background: #fff2df;
  color: #a45f00;
}

.tag--dark {
  background: rgba(42, 201, 183, 0.13);
  color: var(--teal-400);
  border: 1px solid rgba(42, 201, 183, 0.28);
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-on-dark-muted);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px dashed rgba(163, 179, 210, 0.38);
  background: rgba(163, 179, 210, 0.07);
}

.demo-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal-400);
  box-shadow: 0 0 10px rgba(63, 220, 201, 0.9);
}

/* ---------- 导航 ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 50;
  display: flex;
  align-items: center;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-nav.is-solid {
  background: rgba(250, 251, 254, 0.86);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--line-soft);
  box-shadow: 0 1px 0 rgba(14, 23, 48, 0.03);
}

.site-nav.is-dark {
  background: rgba(7, 14, 34, 0.55);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom-color: rgba(147, 168, 212, 0.12);
}

.nav-inner {
  width: min(var(--max-w), calc(100% - 48px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}

.brand-logo--light {
  display: none;
}

.site-nav.is-dark .brand-logo--light {
  display: block;
}

.site-nav.is-dark .brand-logo--dark {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-links a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  transition: color 0.18s ease;
  padding: 4px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover {
  color: var(--blue-600);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.site-nav.is-dark .nav-links a {
  color: var(--text-on-dark-muted);
}

.site-nav.is-dark .nav-links a:hover {
  color: var(--teal-400);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--ink-950);
  color: var(--text-on-dark-muted);
  padding: var(--sp-8) 0 var(--sp-7);
  border-top: 1px solid rgba(147, 168, 212, 0.12);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-on-dark);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
}

.footer-logo {
  height: 30px;
  width: auto;
  display: block;
}

.footer-tag {
  color: var(--text-on-dark-muted);
  font-size: 13.5px;
  letter-spacing: 0.14em;
}

.footer-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-on-dark-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: color 0.18s ease;
}

.footer-links a:hover {
  color: var(--teal-400);
}

/* ---------- 工具类 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mono {
  font-family: var(--font-mono);
}

.text-muted {
  color: var(--text-muted);
}

/* 入场动效：仅在 JS 可用时隐藏初始状态 */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 响应式导航 ---------- */
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    color: var(--text-strong);
  }

  .site-nav.is-dark .nav-toggle {
    color: var(--text-on-dark);
  }

  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 14px 26px 22px;
    background: rgba(250, 251, 254, 0.98);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-md);
  }

  .site-nav.is-dark .nav-links {
    background: rgba(7, 14, 34, 0.98);
    border-bottom-color: rgba(147, 168, 212, 0.14);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 13px 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .site-nav.is-dark .nav-links a {
    border-bottom-color: rgba(147, 168, 212, 0.12);
  }

  .nav-cta .btn {
    display: none;
  }
}

@media (max-width: 560px) {
  .container {
    width: calc(100% - 32px);
  }

  .section {
    padding: var(--sp-10) 0;
  }

  .nav-inner {
    width: calc(100% - 32px);
  }
}
