/* ==========================================================================
   base.css — reset + 排版基线 + 焦点可见
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: 96px;   /* 锚点跳转时避开吸顶站头 */
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 关键：筛选/开合靠 el.hidden，组件自己的 display 会盖掉 UA 规则 */
[hidden] { display: none !important; }

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

img { height: auto; }

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

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }

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

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

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

button {
  font-family: var(--font-sans);
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* 焦点可见（只在键盘导航时出现） */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* 跳到主内容 */
.skip {
  position: absolute;
  inset-inline-start: var(--sp-4);
  inset-block-start: -100px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--text-invert);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: inset-block-start 0.18s ease;
}
.skip:focus { inset-block-start: var(--sp-3); text-decoration: none; }

/* 屏幕阅读器专用 */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 长文阅读宽（唯一挂载点） */
.prose { max-width: var(--w-prose); }
