/* ==========================================================================
   base.css — 重置 + 排版基线
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;              /* 防移动端横向滚动 */
}

body.is-locked { overflow: hidden; }   /* 抽屉打开时锁滚动 */

h1, h2, h3, h4, h5 {
  margin: 0;
  color: var(--c-text-strong);
  font-weight: 800;
  line-height: var(--lh-tight);
}
h1 { font-size: var(--fs-h1); letter-spacing: -.5px; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 700; }
h4 { font-size: var(--fs-h4); font-weight: 700; }

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

/* 孤字。中文没有词间空格，断行时不会像西文那样权衡行长，
   于是段落最后一行常常只剩「客户。」三个字挂在下面，看着像没排完。

   注意：CJK 场景下 pretty 基本不管用 —— 它防的是西文那种「整词被甩到下一行」，
   中文逐字断行，浏览器不认为那是孤行。实测把 pretty 加在 about.html
   公司简介那段上，「客户。」照样孤在最后一行。所以这里用 balance。

   为什么敢全站铺 balance：中文排版本来就讲究行尾齐整（书刊报纸都是两端对齐），
   把每行长度拉平在中文里读起来是「排过」而不是「参差」。
   西文段落就不适合了 —— 所以这条规则只对中文正文成立，
   将来加英文长段落时要单独处理。
   浏览器上限是 6 行，更长的段落自动退回普通断行，不会出错。
   它只改变断行位置，不改变盒子宽度，因此不可能引入横向溢出。 */
p, li, blockquote, dd, dt, figcaption { text-wrap: balance; }

a {
  color: inherit;
  text-decoration: none;
  transition: color .2s var(--ease);
}
a:hover { color: var(--c-blue-deep); }

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

button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }

strong, b { font-weight: 700; color: var(--c-text-strong); }

/* 深色区块内 <strong> 改用白色，否则深蓝压深蓝不可读 */
.section--dark strong, .section--dark b,
.page-hero strong, .page-hero b,
.cta-band strong, .cta-band b,
.deliver-bar strong, .deliver-bar b,
.site-footer strong, .site-footer b { color: #fff; }

/* 键盘可达性：只在键盘聚焦时显示焦点环 */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--c-blue);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* 屏幕阅读器专用文本 */
.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;
}

/* 跳转到主内容（无障碍） */
.skip-link {
  position: absolute; top: -60px; left: 16px; z-index: 999;
  padding: 10px 18px; border-radius: var(--r-md);
  background: var(--c-navy); color: #fff; font-size: var(--fs-sm);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; color: #fff; }

/* 尊重系统的"减少动效"设置 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* 多一个 html 是为了拿到 (0,1,1) —— components.css 里的 .reveal 是 (0,1,0)，
     同优先级下靠加载顺序决胜，而 components.css 在 base.css 之后加载。 */
  html .reveal { opacity: 1; transform: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
