/* ============================================================================
   base.css｜重置、排版基礎、無障礙
   ============================================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;   /* 錨點跳轉時不被固定導覽列蓋住 */
  color-scheme: var(--scheme, light);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);   /* 中文正文的字距，全站繼承 */
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;   /* 頁面本身不得橫向捲動 */
}

/* ---------- 標題 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-display);
  line-height: var(--leading-heading);
  font-weight: 700;
  margin: 0 0 var(--s4);
  text-wrap: balance;
}
/* 字距：大字級收一點（tracking-display），中小標放一點（tracking-heading）。
   中文沒有詞間空白，字距全部給 0 會讓整段糊在一起。 */
h1 { font-size: var(--size-h1); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--size-h2); letter-spacing: var(--tracking-heading); }
h3 { font-size: var(--size-h3); letter-spacing: var(--tracking-heading); font-weight: 500; }
h4 {
  font-size: var(--size-body); font-family: var(--font-body); font-weight: 700;
  letter-spacing: var(--tracking-heading); line-height: 1.6;
}

/* ---------- 行長上限 ----------
   這是這個站最容易被忽略、但影響最大的一條。
   沒有上限時，一段中文會攤成 1140px 寬 ＝ 一行 60–70 個字，
   讀起來就是「壅擠」。34em ≒ 34 個中文字，接近可讀上限。
   用 em 而不是 px，字級調整時行長會自動跟著收。 */
p, dd, li { max-width: var(--measure); }
/* 置中的區塊，段落也要跟著置中，不然會靠左看起來歪掉 */
.text-center p,
.section-head--center p { margin-inline: auto; }

p  { margin: 0 0 var(--s4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

/* 中文閱讀行長：22–30 字/行 */
.prose { max-width: var(--w-read); }
.prose p { font-size: var(--size-body); }

.lead {
  font-size: var(--size-lead);
  line-height: 1.9;
  color: var(--text-body);
  max-width: var(--measure-narrow);
}

small, .small { font-size: var(--size-small); color: var(--text-muted); }

/* ---------- 連結 ---------- */
a {
  color: var(--text-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--accent-strong); }

/* ---------- 鍵盤焦點（無障礙硬規則：不可拿掉） ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
  box-shadow: var(--focus-ring);
}
:focus:not(:focus-visible) { outline: none; }

/* 跳至主內容 */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: var(--z-overlay);
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
  padding: var(--s3) var(--s5); border-radius: 0 0 var(--radius) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ---------- 圖片 ---------- */
img, svg, video { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }

/* ---------- 表格：自帶橫向捲動容器 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: var(--size-small); }
th, td {
  text-align: left; padding: var(--s3) var(--s4);
  border-bottom: var(--hairline) solid var(--border-default);
  vertical-align: top;
}
th { font-weight: 700; color: var(--text-display); white-space: nowrap; }

/* ---------- 清單 ---------- */
ul, ol { margin: 0 0 var(--s4); padding-left: 1.35em; }
li { margin-bottom: var(--s2); }
.list-plain { list-style: none; padding: 0; }

/* ---------- 通用工具 ---------- */
.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;
}
[hidden] { display: none !important; }
.mono {
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-mono);
  font-variant-numeric: tabular-nums;
}
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mb0 { margin-bottom: 0 !important; }

/* ---------- 區塊小標 ----------
   照 410 的寫法：不是等寬大寫加寬字距，而是一行普通的中文分類標籤，
   字級同內文、降透明度。中文網站上這樣更沉穩、跟內容的距離更近。 */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-muted);
  margin-bottom: var(--s3);
}
/* 夜版的頻道標記（CH00 / TUNING IN）是品牌語彙，保留等寬大寫 */
.eyebrow--mono {
  font-family: var(--font-mono);
  font-size: var(--size-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-accent);
}

/* ---------- 沒有 JavaScript 時的提示 ---------- */
.noscript-bar {
  background: var(--surface-raised);
  color: var(--text-body);
  padding: var(--s4);
  text-align: center;
  border-bottom: var(--hairline) solid var(--border-strong);
  font-size: var(--size-small);
}
