/* ============================================================
   Reset 與版面基礎
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }

p { margin: 0; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--primary-hover); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* 數字一律等寬，避免表格與統計跳動 */
.num, td.num, .stat-value {
  font-variant-numeric: tabular-nums;
}

/* 版面容器 */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--sp-5) var(--sp-7);
}

.page-title {
  margin: var(--sp-6) 0 var(--sp-2);
}
.page-subtitle {
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-5);
}

.noscript-note { padding: 24px; }

/* 螢幕閱讀器專用 */
.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 (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
