/* ============================================================
   base.css — reset、排版基线、无障碍基线
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.75;
  color: var(--text-body);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* 避免段落最后一行只剩一两个字（「没网。」这种孤行） */
p, li, dd, figcaption {
  text-wrap: pretty;
}

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

/* figure 自带 UA margin: 1em 40px，不清掉会把通栏图位顶破移动端 */
figure {
  margin: 0;
}

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;
}

/* 筛选 / 手风琴靠 [hidden] 切换，必须压过组件的 display */
[hidden] {
  display: none !important;
}

::selection {
  background: var(--brand-surface);
  color: var(--brand-ink);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 18px;
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: 0 0 var(--r-chip) 0;
}

.skip-link:focus {
  left: 0;
}

/* 只给读屏用的文本 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 只在宽屏生效的手动换行：窄屏交给浏览器自己折，免得中间剩半行 */
@media (max-width: 860px) {
  .br-desk {
    display: none;
  }
}

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