/* ==========================================================================
   base.css — reset / 排版基准 / 焦点与无障碍
   ========================================================================== */

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

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

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

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

body {
  background: var(--bg);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
  border: 0;
}

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

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

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
}

strong, b {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   筛选靠 el.hidden 切换，组件自身的 display 会盖掉 UA 规则，必须提权
   -------------------------------------------------------------------------- */
[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -80px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--r-md);
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: var(--fs-sm);
  font-weight: 700;
  transition: top var(--dur) var(--ease);
}

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

/* 仅供读屏 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  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;
  }
}
