/* Reset + 排版基线 */
*, *::before, *::after { box-sizing: border-box; }

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

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

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

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

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

h1, h2, h3, h4 { line-height: var(--lh-tight); font-weight: 700; }

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

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

code, kbd, samp { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 组件的 display 会盖掉 UA 的 [hidden]，必须 !important */
[hidden] { display: none !important; }

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

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

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 50;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--text-invert);
  border-radius: var(--r-btn);
  font-size: var(--fs-small);
}
.skip-link:focus { top: var(--sp-4); }

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

/* 长文位：全站唯一的阅读宽度类 */
.prose { max-width: var(--w-prose); }
