/* ==========================================================
   基础层：reset + 排版 + 通用工具类
   ========================================================== */

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

* { margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 0;
  overflow-x: hidden;
  transition: background var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out);
}

/* 背景氛围光（跟随主题，位于所有内容之下） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(680px 380px at 12% -6%, rgba(99, 102, 241, .16), transparent 70%),
    radial-gradient(620px 360px at 92% 4%, rgba(34, 211, 238, .12), transparent 70%);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

::selection {
  background: color-mix(in srgb, var(--brand-500) 22%, transparent);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--brand-400);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* 细滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border: 3px solid var(--bg);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ---------- 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { position: relative; padding-block: 104px; }
.section--alt { background: var(--bg-alt); }
.section--tight { padding-block: 72px; }

/* 区块之间的发丝线 */
.section + .section--alt::before,
.section--alt + .section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--grad-hairline);
  opacity: .5;
}

/* ---------- 排版 ---------- */
.display {
  font-size: clamp(38px, 6.2vw, 68px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -.035em;
}

.h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -.03em;
}

.h3 {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.015em;
}

.lead {
  font-size: clamp(15px, 1.4vw, 17.5px);
  line-height: 1.7;
  color: var(--muted);
}

.muted { color: var(--muted); }
.mono {
  font-family: var(--font-mono);
  font-size: .86em;
  letter-spacing: -.01em;
}

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

/* 小标签：用于区块标题上方 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-400);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

/* ---------- 区块头部 ---------- */
.section-head {
  max-width: 720px;
  margin-bottom: 56px;
}
.section-head .lead { margin-top: 18px; }
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head--center .eyebrow { justify-content: center; }

/* ---------- 工具类 ---------- */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 网格底纹（Hero / 深色面板上叠加） */
.grid-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(720px 460px at 50% 8%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(720px 460px at 50% 8%, #000 20%, transparent 78%);
}

/* 噪点质感，避免大面积渐变出现色带 */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
