/* ========================================
   BASE.CSS - 全站基礎樣式
   Reset + 通用元素樣式
   ======================================== */

/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-serif);
  font-size: var(--text-md);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-white);
  overflow-x: hidden;
  /* 禁止偽粗體/偽斜體 — 缺失字重時退回最近真實字重，而非合成
     電腦/手機才會一致：有真粗體才粗、沒有就不粗 */
  font-synthesis: none;
  -webkit-font-synthesis: none;
}

/* ===== 標題 ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: var(--color-dark);
}

h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

h5 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--text-md);
  margin-bottom: var(--space-2);
}

/* ===== 段落 ===== */
p {
  margin-bottom: var(--space-4);
  line-height: var(--lh-normal);
}

/* ===== 連結 ===== */
a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-primary);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== 圖片 ===== */
img {
  max-width: 100%;
  display: block;
  height: auto;
}

/* ===== 按鈕 ===== */
button {
  font-family: inherit;
  font-size: var(--text-md);
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition-base);
}

button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== 表單 ===== */
input,
textarea,
select {
  font-family: inherit;
  font-size: var(--text-md);
}

/* ===== 清單 ===== */
ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
}

/* ===== 無障礙：焦點可見 ===== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}