/* ==========================================================================
   基础层：reset、排版基线、通用容器与可访问性
   只消费 tokens.css 中的变量，不写死颜色尺寸。
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-body);
  background: var(--bg-body);
  /* 让字体边缘与抗锯齿在不同平台观感一致 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 选中文字用品牌色淡底，细节上的精致感 */
::selection {
  background: color-mix(in srgb, var(--brand-500) 22%, transparent);
}

/* 滚动条：细、随主题，避免默认宽滚动条破坏版面 */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-muted) 35%, transparent);
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    background-clip: content-box;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text-muted) 55%, transparent);
    border: 2px solid transparent;
    background-clip: content-box;
  }
  ::-webkit-scrollbar-track { background: transparent; }
}

h1, h2, h3, h4 {
  margin: 0 0 var(--space-4);
  color: var(--text-strong);
  line-height: var(--leading-tight);
  /* Noto Sans SC 提供 400/500/700，明确用 700 避免浏览器合成假粗体 */
  font-weight: 500;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p { margin: 0 0 var(--space-4); }

a {
  color: var(--brand-500);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--brand-600); }

img { max-width: 100%; height: auto; }

code, pre, kbd, samp { font-family: var(--font-mono); }

/* --- 焦点可见性：键盘用户必须能看到焦点在哪 --- */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* 跳转到主内容：仅键盘聚焦时出现 */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--brand-500);
  color: var(--text-on-brand);
  border-radius: 0 0 var(--radius-md) 0;
}
.skip-link:focus { left: 0; }

/* --- 布局 --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 768px) {
  .container { padding: 0 var(--space-6); }
}

/* --- 页头 --- */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 64px;
}
/* 站名 Logo 字标（字体、渐变、动效）的完整样式只住在 components.css 的
   .site-logo 一节：这里曾经的第二份定义会在层叠里覆盖渐变的透明色，
   导致字标退化成纯色实字（实测踩过）。同一组件两处定义必然漂移。 */
.site-nav {
  display: flex;
  gap: var(--space-5);
}

/* --- 页脚 ---
   页脚的完整样式在 components.css（.site-footer 及其子元素）。
   这里刻意不再定义任何规则：base.css 曾经给 .site-footer 设过
   text-align:center 和旧 padding，与 components.css 的分层页脚叠加后
   导致文字全部居中、留白失衡——同一组件两处定义必然漂移，页脚只留一处。 */

/* --- 首页占位样式（阶段 5 由主题完整接管） --- */
.hero {
  padding: var(--space-12) 0 var(--space-8);
}
.hero__title { font-size: var(--text-4xl); margin-bottom: var(--space-2); }
.hero__subtitle { color: var(--text-muted); font-size: var(--text-lg); }

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}
.panel__title { font-size: var(--text-xl); }

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
}
.checklist li {
  padding: var(--space-2) 0;
  border-bottom: 1px dashed var(--border);
}
.checklist li:last-child { border-bottom: none; }
.checklist__ok {
  display: inline-block;
  min-width: 3.5em;
  margin-right: var(--space-2);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
  font-size: var(--text-xs);
  font-weight: 500;
  text-align: center;
}

.muted { color: var(--text-muted); font-size: var(--text-sm); margin: 0; }
