/* ==========================================================================
   theme.css — 设计令牌 / 重置 / 排版 / 通用工具
   ========================================================================== */

:root {
  /* 品牌色 */
  --brand-700: #1d4ed8;
  --brand-600: #2563eb;
  --brand-500: #3b82f6;
  --brand-100: #dbeafe;
  --brand-50: #eff6ff;

  --accent-600: #0891b2;
  --accent-500: #06b6d4;
  --accent-400: #22d3ee;

  /* 中性色 */
  --ink-900: #070c18;
  --ink-800: #0f172a;
  --ink-700: #1e293b;
  --ink-600: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5e9f0;
  --line-soft: #eef2f8;

  /* 背景 */
  --bg: #ffffff;
  --bg-soft: #f6f8fc;
  --bg-dark: #070c18;
  --bg-dark-2: #0d1428;

  /* 深色区块上的文字 */
  --on-dark: #f8fafc;
  --on-dark-dim: #a9b6cc;

  /* 圆角 */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* 阴影 */
  --sh-xs: 0 1px 2px rgba(10, 16, 32, 0.06);
  --sh-sm: 0 2px 8px -2px rgba(10, 16, 32, 0.10);
  --sh-md: 0 12px 32px -14px rgba(10, 16, 32, 0.22);
  --sh-lg: 0 32px 64px -28px rgba(10, 16, 32, 0.30);
  --sh-brand: 0 14px 34px -14px rgba(37, 99, 235, 0.55);

  /* 渐变 */
  --grad-brand: linear-gradient(135deg, var(--brand-600) 0%, var(--accent-500) 100%);
  --grad-brand-soft: linear-gradient(135deg, var(--brand-50) 0%, #ecfeff 100%);
  --grad-dark: linear-gradient(160deg, #070c18 0%, #0f1b3a 55%, #0a1730 100%);
  --grad-text: linear-gradient(100deg, #60a5fa 0%, #22d3ee 100%);

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;

  --fs-display: clamp(2.05rem, 5.6vw, 3.9rem);
  --fs-h1: clamp(1.75rem, 3.6vw, 2.75rem);
  --fs-h2: clamp(1.45rem, 2.8vw, 2.15rem);
  --fs-h3: clamp(1.12rem, 1.6vw, 1.35rem);
  --fs-lead: clamp(1rem, 1.35vw, 1.16rem);
  --fs-body: 1rem;
  --fs-sm: 0.9rem;
  --fs-xs: 0.8rem;

  /* 间距 */
  --container: 1200px;
  --gutter: clamp(18px, 4.2vw, 32px);
  --sec-y: clamp(56px, 8.5vw, 112px);
  --header-h: 66px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink-700);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0 0 0.6em;
  color: var(--ink-900);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.015em;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

a:hover {
  color: var(--brand-700);
}

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

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

::selection {
  background: var(--brand-600);
  color: #fff;
}

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

/* --------------------------------------------------------------------------
   工具类
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-wide {
  max-width: 1440px;
}

.section {
  padding-block: var(--sec-y);
  position: relative;
}

.section-tight {
  padding-block: clamp(40px, 5.5vw, 72px);
}

.bg-soft {
  background: var(--bg-soft);
}

.bg-dark {
  background: var(--grad-dark);
  color: var(--on-dark-dim);
}

.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4 {
  color: var(--on-dark);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
}

.bg-dark .eyebrow {
  color: var(--accent-400);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(28px, 4vw, 52px);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head p {
  color: var(--muted);
  font-size: var(--fs-lead);
  margin: 0;
}

.bg-dark .section-head p {
  color: var(--on-dark-dim);
}

.lead {
  font-size: var(--fs-lead);
  color: var(--muted);
  line-height: 1.85;
}

.text-grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-center {
  text-align: center;
}

.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: var(--brand-600);
  color: #fff;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

.bg-dark .divider {
  background: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   入场动画
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
