/* ============================================================
   基础层：重置 · 排版 · 通用工具
   ============================================================ */

*,
*::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;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
picture { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

::selection { background: rgba(46, 124, 246, 0.18); color: var(--ink); }

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

/* ---------- 标题 ---------- */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--fw-medium);
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--ink);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p  { margin: 0; }

/* ---------- 容器 / 区块 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: 880px; }

.section { padding-block: var(--section-y); position: relative; }
.section--soft { background: var(--panel); }
.section--soft-2 { background: linear-gradient(180deg, var(--bg) 0%, var(--panel) 100%); }
.section--tight { padding-block: clamp(48px, 5vw, 80px); }
.section--night { background: var(--grad-night); color: var(--ink-inv); }
.section--night h1,
.section--night h2,
.section--night h3 { color: var(--ink-inv); }
/* 深色区块中的白色卡片内部恢复深色文字 */
.section--night .card { color: var(--ink); }
.section--night .card h1,
.section--night .card h2,
.section--night .card h3 { color: var(--ink); }
.section--night .card p { color: var(--ink-2); }
.section--night .empty { color: var(--ink-inv-2); border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.05); }

/* ---------- 区块标题组 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--grad-brand);
  border-radius: 2px;
}
.section--night .eyebrow { color: rgba(255, 255, 255, 0.8); }

.section-head { max-width: 780px; margin-bottom: clamp(36px, 4vw, 64px); }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head h2 { margin-bottom: 18px; }
.section-head p { color: var(--ink-2); font-size: var(--fs-lead); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow::before { display: none; }
.section-head--center .eyebrow::after { display: none; }

.lead { font-size: var(--fs-lead); color: var(--ink-2); }

/* ---------- 文本工具 ---------- */
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-2 { color: var(--ink-2); }
.text-3 { color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- 滚动进入动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

.reveal-scale { opacity: 0; transform: scale(0.97); }
.reveal-scale.is-in { opacity: 1; transform: none; }

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

/* ---------- 加载骨架 ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--panel-2);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: sk 1.3s infinite;
}
@keyframes sk { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* 占位高度，避免布局抖动 */
.sk-line { height: 14px; margin-bottom: 10px; }
.sk-line.w-60 { width: 60%; }
.sk-line.w-80 { width: 80%; }
.sk-card { height: 320px; border-radius: var(--r-lg); }

/* ---------- 空态 ---------- */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-3);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: var(--bg-soft);
}

/* ---------- 无障碍 ---------- */
.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;
  left: 16px; top: -60px;
  z-index: var(--z-toast);
  padding: 10px 18px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-sm);
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 16px; }
