/* ============================================================
   base.css — reset / 排版 / 无障碍基线
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: inherit;      /* 不用 font: 简写 —— 它的优先级会冲掉组件字号 */
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

/* 筛选 / 折叠靠 el.hidden 控制，必须压过组件的 display:flex —— 否则静默失效 */
[hidden] { display: none !important; }

/* 键盘焦点：深底上必须看得见 */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 跳转到主内容（无障碍） */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--r-btn);
  background: var(--brand);
  color: var(--brand-on);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: top .15s ease;
}
.skip-link:focus { top: var(--sp-4); text-decoration: none; }

/* 仅供屏幕阅读器 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 标题层级（字号 + 字重分层，不靠更浅的颜色） ---------- */
.t-title {
  color: var(--text);
  font-weight: 900;
  line-height: var(--lh-tight);
  letter-spacing: -.01em;
}
.t-section {                       /* 区块标题：首页 30px */
  color: var(--text);
  font-size: var(--fs-title-md);
  font-weight: 700;
  line-height: var(--lh-tight);
}
.t-section--sm { font-size: var(--fs-title-sm); }   /* 内页区块标题 26px */

/* ---------- 正文段落 ---------- */
.p {
  color: var(--text-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.p + .p { margin-top: var(--sp-3); }

/* 长文收敛到 prose 档（与容器同档，见交付说明）
   overflow-wrap: anywhere —— 正文里的长路径 / 包名（存档目录等）没有空格，
   按默认规则不换行。实测 Android 存档路径
   /storage/emulated/0/Android/data/com.LanPiaoPiao.PlantsVsZombiesRH/files
   把 390px 视口撑到 580px（横向溢出 190px）。
   中文段落本来就到处能断，anywhere 只影响这类超长不可断串。 */
.prose {
  max-width: var(--w-prose);
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
