/**
 * base.css — 全域 Reset 與基礎樣式
 *
 * 單一職責：不含任何 Token 定義，只使用 var(--token)。
 * 所有頁面 HTML 的固定載入順序：
 *   1. tokens.css  → Design Token 定義
 *   2. base.css    → 全域 Reset（本檔案）
 *   3. {page}.css  → 頁面或元件的 scoped 樣式
 */

/* ── Reset ────────────────────────────────── */

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

/* ── 文件基礎 ─────────────────────────────── */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-surface);

  /* 為底部 nav.js 導覽列預留空間 */
  padding-bottom: 56px;
}

/* ── 排版基礎 ─────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

p {
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--color-text-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── 媒體 ─────────────────────────────────── */

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

/* ── 表單元素重置 ─────────────────────────── */

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ── 工具：視覺隱藏（無障礙用）──────────── */

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