/* ============================================================
   谷多 GooDuo · 基础样式（重置 + 排版 + 通用）
   ============================================================ */

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

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

body {
  font-family: var(--font-family);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

/* 尊重系统减弱动效：关闭平滑滚动与过渡动画 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 焦点可见性（无障碍：键盘焦点环） ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 版式容器（方案 B+：1920 大容器 + 通栏背景） ---------- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--pad-side-desktop);
}

/* 模块：上下留白 桌面 80px / 手机 44px */
.module {
  padding-block: var(--pad-module);
}

/* 模块头部：标题 + 描述 */
.section-head {
  text-align: left;
  margin-bottom: 48px;
  max-width: 760px;
}
.section-head--split {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  text-align: left;
  gap: 16px;
}
/* eyebrow：栏目标签（卡萨帝/西门子式小字分类） */
.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.22em;
  color: var(--color-primary-text);
}
.section-title {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-h2);
  color: var(--color-text);
  letter-spacing: 0.01em;
  position: relative;
  padding-left: 18px;
}
/* 左侧短竖线装饰（编辑式栏目感，替代原居中渐变粗线） */
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 4px;
  border-radius: 2px;
  background: var(--color-primary);
}
.section-title::after { display: none; }
.section-head--split .section-title::after { display: none; }
.section-desc {
  margin-top: 14px;
  font-size: var(--fs-small);
  color: var(--color-text-secondary);
  max-width: 56ch;
}
/* 深色模块上的标题适配（由父级 .is-dark 控制） */
.is-dark .eyebrow { color: rgba(255, 255, 255, 0.62); }
.is-dark .section-title { color: #fff; }
.is-dark .section-title::before { background: var(--color-primary); }
.is-dark .section-desc { color: rgba(255, 255, 255, 0.58); }

/* ---------- 标题层级（UI 标准字号体系） ---------- */
h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-semibold); line-height: var(--lh-h2); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); line-height: var(--lh-h3); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-medium); line-height: 1.5; }

/* 正文行宽约束（PC ≤80 字符 / 移动 ≤40 字符） */
p { max-width: 66ch; }
.section-desc, .card-text, .tech-text, .news-excerpt { max-width: 46ch; }

/* ---------- 无障碍：跳过链接 ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 2000;
  padding: 10px 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 0 0 8px 8px;
  transition: top var(--duration-fast) ease;
}
.skip-link:focus { top: 0; }

/* 锚点跳转不被 fixed 导航遮挡 */
[id] { scroll-margin-top: calc(var(--nav-height) + 8px); }

/* ---------- 滚动揭示动画（模块进入视口淡入上移，规范第 22 条精神） ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   响应式（移动优先增强）
   ============================================================ */
@media (max-width: 1023px) {
  .container { padding-inline: var(--pad-side-tablet); }
  .module { padding-block: 64px; }
  .section-head { margin-bottom: 36px; }
}

@media (max-width: 639px) {
  .container { padding-inline: var(--pad-side-mobile); }
  .module { padding-block: var(--pad-module-mobile); }
  .section-head { margin-bottom: 28px; }
  .section-title { font-size: 21px; }
  .section-desc { font-size: 13px; }
}
