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

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

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

/* figure 不进上面的 reset 就会带 UA 的 margin: 1em 40px，窄屏直接横向溢出 */
figure {
  margin: 0;
}

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

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

img {
  height: auto;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

/* 筛选/交互用 el.hidden 时，别被组件自己的 display 盖掉 */
[hidden] {
  display: none !important;
}

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

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

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

strong {
  font-weight: 600;
  color: var(--ink);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--sp-5);
  top: -100px;
  z-index: 100;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--text-invert);
  font-size: var(--fs-sm);
  transition: top 0.2s var(--ease);
}

.skip-link:focus-visible {
  top: var(--sp-4);
}

/* 锚点跳转要给吸顶导航留出空间 */
[id] {
  scroll-margin-top: calc(var(--header-h) + var(--sp-5));
}
