/* ============================================================
   base.css — 基础样式：reset / 排版 / 通用工具类
   规范：全站通用元素字号、上下边距统一（见 tokens 7 级字号）
   ============================================================ */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul,
ol {
  list-style: none;
}

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

/* ---------- 标题层级（全站统一，UI标准 2.2） ---------- */
h1,
.h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-h1);
  line-height: var(--lh-h1);
  color: var(--color-brand-dark);
}

h2,
.h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-h2);
  line-height: var(--lh-h2);
  color: var(--color-brand-dark);
}

h3,
.h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-h3);
  line-height: var(--lh-h3);
  color: var(--color-text);
}

h4,
.h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-h4);
  line-height: var(--lh-h4);
  color: var(--color-text-sub);
}

p {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text-sub);
}

/* 弱化文字：辅助说明 / 时间 / 标签（全站统一） */
.text-aux {
  font-size: var(--fs-aux);
  line-height: var(--lh-aux);
  color: var(--color-text-muted);
}

.text-note {
  font-size: var(--fs-note);
  line-height: var(--lh-aux);
  color: var(--color-text-muted);
}

/* ---------- 布局工具 ---------- */
/* 内容容器：全宽背景 + 1440px 限宽内容（2026-08-28 由 1200 放宽确认） */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* 模块区块：上下内边距统一 80px（桌面）/ 44px（手机） */
.section {
  padding-top: var(--pad-section);
  padding-bottom: var(--pad-section);
}

/* 模块底部内边距归零（产品中心/核心技术等与下一模块紧凑衔接） */
.section--flush-bottom {
  padding-bottom: 0;
}

/* 交替背景模块（暖灰），背景全宽 */
.section--alt {
  background-color: var(--color-bg-alt);
}

/* ---------- 模块头部：编辑式左对齐（新版式语言） ---------- */
/* 编号小标：等宽数字 + 短横线，杂志感 */
.section-index {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-aux);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--color-brand);
  margin-bottom: 14px;
}

.section-index::after {
  content: "";
  width: 40px;
  height: 1px;
  background-color: var(--color-brand);
}

/* 模块头部（左对齐）：编号 + 标题 + 说明，间距全站统一 */
.module-head {
  margin-bottom: 48px;
  max-width: 640px;
}

.module-head h2 {
  margin-bottom: 12px;
}

.module-head p {
  margin-bottom: 0;
}

/* 居中版式头（用于产品中心等需对齐参考图居中的模块） */
.module-head--center {
  text-align: center;
  max-width: none;
}

/* 双线系统：粗青蓝线（模块顶部分隔）+ 细分隔线（列表分隔） */
.rule-thick {
  height: 4px;
  background-color: var(--color-brand);
  border: none;
}

/* 传统居中头部（部分页面模块仍可用，保持与编辑式并存） */
.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-head h2 {
  margin-bottom: 12px;
}

.section-head p {
  max-width: 640px;
  margin: 0 auto;
}

/* 大数字（滚动动画目标） */
.stat-num {
  font-size: var(--fs-h1);
  font-weight: var(--fw-h2);
  color: var(--color-brand);
  font-variant-numeric: tabular-nums;
}

/* ---------- 可访问性 ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 键盘焦点可见 */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* 滚动渐入（尊重系统减弱动效偏好） */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 图片占位块（AI 生图接入前使用，确认排版后替换） ---------- */
.ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-alt);
  background-image: linear-gradient(
    135deg,
    rgba(47, 111, 143, 0.06) 25%,
    transparent 25%,
    transparent 50%,
    rgba(47, 111, 143, 0.06) 50%,
    rgba(47, 111, 143, 0.06) 75%,
    transparent 75%
  );
  background-size: 24px 24px;
  border: 1px dashed rgba(47, 111, 143, 0.35);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ph-label {
  font-size: var(--fs-aux);
  color: var(--color-brand);
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  text-align: center;
}
