/* base.css — reset、基礎字體、全域保護 */

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

/* ── Overflow protection（防止橫向捲軸）────────────────── */
html {
  overflow-x: clip;
  scrollbar-gutter: stable;
}

/* ── Body ─────────────────────────────────────────────────── */
body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.8;
  overflow-x: clip;
}

/* ── Images ───────────────────────────────────────────────── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Links ────────────────────────────────────────────────── */
a {
  color: inherit;
}

/* ── Focus visible ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Screen-reader only ───────────────────────────────────── */
.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;
}

/* ── Smooth scroll（僅在使用者無降低動態偏好時）────────── */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
