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

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 筛选/折叠类交互靠 el.hidden 切换，组件自身的 display 会盖掉 UA 的 [hidden]，
   所以这里必须带 !important，否则「隐藏」失效且不报错 */
[hidden] { display: none !important; }

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

ul, ol { list-style: none; }

img, svg, video {
  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;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

::selection {
  background: rgba(46, 139, 255, 0.32);
  color: #FFFFFF;
}

/* 焦点可见：深底上用亮蓝描边，保证键盘用户能定位 */
:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* 仅屏幕阅读器可见（给纯图形元素补可读名称） */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 跳转到主内容：键盘用户第一个 Tab 就能用 */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: var(--brand-solid);
  color: #FFFFFF;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.skip-link:focus {
  inset-inline-start: 16px;
}

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