/* ==========================================================================
   base.css —— reset、排版、容器、分节骨架、入场动效基类
   ========================================================================== */

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

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  /* 锚点跳转时给固定导航留出空间 */
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
               "Microsoft YaHei", "Hiragino Sans GB", system-ui, "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--fg);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---- 页面底纹：双光源辉光 + 极淡网格 ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(880px 520px at 10% -10%, rgba(255, 107, 53, .10), transparent 62%),
    radial-gradient(1020px 640px at 90% -6%, rgba(56, 189, 248, .13), transparent 64%),
    var(--bg-0);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 64px);
  -webkit-mask-image: radial-gradient(ellipse 110% 62% at 50% 0%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 110% 62% at 50% 0%, #000 15%, transparent 72%);
}

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

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

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

/* ---- 可见焦点环：键盘用户必需 ---- */
:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---- 跳到主内容 ---- */
.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  z-index: 200;
  padding: 10px 20px;
  background: var(--ice);
  color: #04121D;
  font-weight: 700;
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 0; }

/* ---- 排版 ---- */
h1, h2, h3, h4 { line-height: 1.28; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { color: var(--fg-muted); }

strong { color: var(--fg); font-weight: 600; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .06);
  color: var(--ice-bright);
}

/* ---- 渐变文字 ---- */
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grad-ice-text {
  background: var(--grad-ice);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grad-flame-text {
  background: var(--grad-flame);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

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

.section--tint {
  background: linear-gradient(180deg, transparent, rgba(13, 20, 36, .8) 18%, rgba(13, 20, 36, .8) 82%, transparent);
}

/* ---- 分节标题 ---- */
.section-head { max-width: 720px; margin-bottom: var(--sp-8); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ice-bright);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
}
.section-head--center .eyebrow::after {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-brand);
}

.section-head p {
  margin-top: var(--sp-4);
  font-size: var(--fs-lead);
  line-height: 1.85;
}

/* ---- 通用网格 ---- */
.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 992px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---- 滚动入场动效 ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* JS 未执行（禁用脚本）时不能让内容永久隐藏 */
.no-js .reveal { opacity: 1; transform: none; }

/* ---- 尊重系统「减弱动态效果」 ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
