/* ============================================================
   合因科技 · 官网设计系统  —  基础层 (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(--nav-h) + 16px);
  /* 不在 html/body 上设置 overflow，避免成为 sticky 的限定容器而影响吸顶。
     横向溢出由各装饰容器（.hero/.page-hero/.marquee 等 overflow:hidden）各自裁剪。 */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: .01em;
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--dur-1) var(--ease); }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
::selection { background: rgba(var(--c-brand-rgb), .16); color: var(--c-ink); }

/* ---------- 标题排版 ---------- */
h1, h2, h3, h4 { color: var(--c-ink); font-weight: 700; line-height: 1.18; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(34px, 5vw, 56px); }
h2 { font-size: clamp(28px, 3.6vw, 42px); }
h3 { font-size: clamp(20px, 2.2vw, 26px); }
strong { font-weight: 600; color: var(--c-ink); }

/* ---------- 布局容器 ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { max-width: var(--container-wide); }
.section { padding-block: var(--section-y); position: relative; }
.section--soft { background: var(--c-bg-soft); }
.section--muted { background: var(--c-bg-muted); }
.section--ink { background: var(--grad-ink); color: #C9D4EC; }
.section--ink h1, .section--ink h2, .section--ink h3 { color: #fff; }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }

/* ---------- 区块标题工具 ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em;
  color: var(--c-brand-600); text-transform: uppercase;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--c-brand-50); border: 1px solid var(--c-brand-100);
}
.section--ink .eyebrow { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #9CC4FF; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-title { margin-top: 18px; }
.section-sub { margin-top: 16px; font-size: clamp(15px, 1.6vw, 18px); color: var(--c-muted); }
.section--ink .section-sub { color: #9FB0D4; }

/* ---------- 文本工具 ---------- */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.muted { color: var(--c-muted); }
.faint { color: var(--c-faint); }
.center { text-align: center; }
.lead { font-size: clamp(16px, 1.7vw, 19px); color: var(--c-muted); line-height: 1.8; }
.nowrap { white-space: nowrap; }

/* ---------- 栅格 ---------- */
.grid { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 12px; } .gap-md { gap: 20px; } .gap-lg { gap: 32px; }
.wrap { flex-wrap: wrap; }

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  :root { --gutter: 18px; }
}

/* ---------- 图标 ---------- */
.icon { width: 1em; height: 1em; stroke-width: 1.8; flex: none; }
[data-lucide] { width: 22px; height: 22px; stroke-width: 1.8; }

/* ---------- 数字排版（等宽数字，滚动计数不跳动） ---------- */
.stat .num, .mk-kpi .v, .kpi-inline .ki .v, [data-num] { font-variant-numeric: tabular-nums; }

/* ---------- 键盘焦点（精致但不打扰鼠标用户） ---------- */
:focus-visible { outline: 2px solid var(--c-brand-400); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible { outline-offset: 3px; }

/* ---------- 辅助 ---------- */
.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; }
.divider { height: 1px; background: var(--c-line); border: 0; }
.spacer-sm { height: 24px; } .spacer { height: 48px; } .spacer-lg { height: 80px; }
