/* ==========================================================================
   base.css · reset + 排版基线 + 可访问性
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--text);
  line-height: var(--lh-tight);
}

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

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

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

/* 注意：这里用长写属性，不用 `font: inherit` 简写。
   简写会以更高优先级盖掉组件自己的字号（.pill / .btn 这类），
   且不报错 —— 是个静默的坑。 */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* 筛选 / 手风琴靠 el.hidden 开关，组件自身的 display 会盖掉 UA 的
   [hidden]{display:none}，所以这条 !important 是必须的 */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
