/* synced from 元丰-设计规范 v1.0 */
/* ============================================================
   元丰净化 · 基础层 Base
   重置 + 排版基线 + 通用工具类
   依赖 tokens.css
   ============================================================ */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: var(--fw-bold); line-height: var(--lh-snug); }
p { margin: 0; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { cursor: pointer; }

ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
figure { margin: 0; }

table { border-collapse: collapse; width: 100%; }

::selection { background: var(--green-600); color: #fff; }

/* 焦点可见性：键盘用户必须有清晰的焦点环 */
:focus-visible {
  outline: var(--bw-2) solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* 键盘跳转链接 */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 999;
  padding: var(--sp-3) var(--sp-4);
  background: var(--green-600);
  color: #fff;
  font-size: var(--text-small);
  font-weight: var(--fw-bold);
  border-radius: var(--r-sm);
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* ==================== 排版原子类 ==================== */

.t-display { font-size: clamp(38px, 6vw, var(--text-display)); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); font-weight: var(--fw-bold); }
.t-h1 { font-size: clamp(32px, 4.4vw, var(--text-h1)); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); font-weight: var(--fw-bold); }
.t-h2 { font-size: clamp(26px, 3.2vw, var(--text-h2)); line-height: var(--lh-snug); letter-spacing: var(--ls-tight); font-weight: var(--fw-bold); }
.t-h3 { font-size: var(--text-h3); line-height: var(--lh-snug); font-weight: var(--fw-bold); }
.t-lead { font-size: var(--text-lead); line-height: 1.6; }
.t-body { font-size: var(--text-body); line-height: var(--lh-body); }
.t-small { font-size: var(--text-small); line-height: 1.6; }
.t-micro { font-size: var(--text-micro); line-height: 1.5; }

/* 等宽技术标签：编号、英文名、参数 */
.t-mono {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
}

.t-muted { color: var(--text-secondary); }
.t-tertiary { color: var(--text-tertiary); }
.t-accent { color: var(--accent); }
.t-green { color: var(--green-600); }

/* 数字：等宽数字避免跳动 */
.t-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ==================== 布局工具 ==================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-py); }
.section--soft { background: var(--bg-soft); }
.section--dark { background: var(--bg-inverse); color: var(--text-inverse); }
.section--white { background: var(--bg-surface); }

.divider { height: 1px; background: var(--border-default); border: 0; margin: 0; }

/* 可见性 */
.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;
}

/* ==================== 滚动渐显 ==================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ==================== 无障碍：尊重减少动效偏好 ==================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ==================== 打印 ==================== */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
}
