/* ============================================================
   base.css —— 重置、排版基线、容器、按钮、可访问性
   约束：本文件不得出现任何字面色值，一律引用 tokens.css 变量。
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 锚点平滑滚动 + 吸顶导航偏移 */
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 8px);
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-2);
  background-color: var(--bg-deep);
  background-image: var(--grad-body-bg);
  background-repeat: no-repeat;
  background-attachment: scroll;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 移动端无横向滚动条的兜底 */
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--text-1);
  font-weight: var(--fw-bold);
  line-height: var(--lh-h2);
  letter-spacing: -0.01em;
}

p { margin: 0; }

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-hover) var(--ease-out);
}

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

img { height: auto; }

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

strong, b { color: var(--text-1); font-weight: var(--fw-semibold); }

/* 数字统一等宽，避免滚动动画抖动 */
.num,
[data-count] { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

::selection { background: var(--brand-blue); color: var(--text-on-brand); }

/* 键盘焦点可见（无障碍红线） */
:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- 滚动条（仅 WebKit / Firefox，不影响功能） ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-pill);
}

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

.container--tight { max-width: var(--container-tight); }

/* ---------- 跳转主内容（键盘用户） ---------- */
.skip {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: var(--z-progress);
  padding: var(--sp-1) var(--sp-2);
  background: var(--brand-blue);
  color: var(--text-on-brand);
  border-radius: var(--radius-btn);
  font-size: var(--fs-small);
  transition: transform var(--dur-hover) var(--ease-out), opacity var(--dur-hover) var(--ease-out);
  opacity: 0;
}
.skip:focus { top: var(--sp-2); opacity: 1; }

/* ---------- 通用文字工具 ---------- */
.txt-lead {
  font-size: var(--fs-body-l);
  line-height: var(--lh-body-l);
  color: var(--text-3);
  max-width: 62ch;
}
.txt-note {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  color: var(--text-faint);
}
.txt-grad {
  background-image: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  min-height: 48px;
  padding: 0 26px;
  border-radius: var(--radius-btn);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--text-1);
  border: 1px solid var(--border-1);
  background: var(--glass-1);
  white-space: nowrap;
  transition:
    transform var(--dur-hover) var(--ease-out),
    box-shadow var(--dur-hover) var(--ease-out),
    border-color var(--dur-hover) var(--ease-out),
    opacity var(--dur-hover) var(--ease-out);
}

.btn--primary {
  border-color: transparent;
  background-image: var(--grad-primary);
  box-shadow: var(--shadow-btn);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-accent);
  color: var(--text-1);
}
.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: var(--bg-l3);
}

.btn--lg { min-height: 56px; padding: 0 34px; font-size: var(--fs-body-l); }

.btn__icon { width: 18px; height: 18px; flex: none; }

/* ---------- 胶囊标签 ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-1);
  background: var(--glass-1);
  color: var(--text-3);
  font-size: var(--fs-small);
  line-height: 1.4;
  white-space: nowrap;
  transition:
    color var(--dur-hover) var(--ease-out),
    border-color var(--dur-hover) var(--ease-out),
    background-color var(--dur-hover) var(--ease-out),
    opacity var(--dur-hover) var(--ease-out);
}

/* ---------- 图标（内联 SVG 统一规格） ---------- */
.ico {
  width: 22px;
  height: 22px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico--sm { width: 18px; height: 18px; }
.ico--lg { width: 30px; height: 30px; stroke-width: 1.4; }

/* ---------- 渐变文字兜底 ----------
   极老浏览器不支持 background-clip:text 时，
   避免 -webkit-text-fill-color:transparent 造成「文字隐形」。 */
@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
  .txt-grad,
  .hero__title,
  .manifesto__text,
  .endcta__title,
  .giant__num,
  .metric__num,
  .role__commission-num {
    background-image: none;
    color: var(--text-1);
    -webkit-text-fill-color: var(--text-1);
  }
}

/* ---------- 全局降级：减少动态效果 ---------- */
@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;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
