@charset "utf-8";

/**
 * /probability 機率公布頁 · 移動端樣式
 *
 * 設計基準寬 750px，所有尺寸換算方式：px ÷ 750 × 100 = vw。
 * 版面與 PC 同構（主視覺橫幅 → 標題 → 目錄 → 章節卡片 → 頁尾），
 * 差別只在：單欄堆疊、素材改用 img/m/ 下的移動端專屬圖、4 欄以上寬表改為橫向捲動。
 *
 * 色票與 PC 同一套（取自主視覺 KV）：
 *   天空藍 #dff2fb / 草地綠 #8fd06a #63b64d / 奶油黃 #fdf3d5 / 墨綠字 #2f4b3a
 */

/* ── 基礎 ────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
li { list-style: none; }

:root {
  --c-sky: #dff2fb;
  --c-grass: #8fd06a;
  --c-grass-d: #63b64d;
  --c-cream: #fdf3d5;
  --c-cream-d: #f2e2ad;
  --c-ink: #2f4b3a;
  --c-ink-2: #63806c;
  --c-line: #e7f0e0;
  --c-card: #ffffff;
  --c-zebra: #f7fbf3;
  --shadow-card: 0 0.8vw 3vw rgba(47, 75, 58, 0.1);
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
  color: var(--c-ink);
  background: linear-gradient(180deg, var(--c-sky) 0, #eaf7e2 90vw, #f3faec 100%);
  -webkit-font-smoothing: antialiased;
}

/* ── 首屏主視覺 ──────────────────────────────────────────────── */
.m-prob-hero {
  position: relative;
  width: 100%;
  height: 80vw;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.m-prob-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16vw;
  background: linear-gradient(180deg, rgba(234, 247, 226, 0) 0%, rgba(234, 247, 226, 0.8) 65%, #eaf7e2 100%);
}

/* 左上角 logo：同時當「回首頁」入口 */
.m-prob-hero__home {
  position: absolute;
  top: 3.5vw;
  left: 4vw;
  z-index: 2;
  display: block;
}

.m-prob-hero__home[hidden] { display: none; }

.m-prob-hero__home img {
  height: 14vw;
  width: auto;
  filter: drop-shadow(0 0.4vw 1vw rgba(47, 75, 58, 0.25));
}

/* ── 內容區 ──────────────────────────────────────────────────── */
.m-prob-wrap {
  position: relative;
  z-index: 3;
  margin-top: -8vw;
  padding: 0 4vw 4vw;
}

.m-prob-title {
  margin: 0 0 4.5vw;
  padding: 5vw 4vw;
  background: var(--c-card);
  border: 0.5vw solid #fff;
  border-radius: 4vw;
  box-shadow: var(--shadow-card);
  text-align: center;
  font-size: 5.2vw;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.1vw;
}

.m-prob-title::after {
  content: "";
  display: block;
  width: 14vw;
  height: 1vw;
  margin: 3vw auto 0;
  border-radius: 0.5vw;
  background: linear-gradient(90deg, var(--c-grass), var(--c-grass-d));
}

/* ── 目錄 ────────────────────────────────────────────────────── */
.m-toc {
  margin: 0 0 5vw;
  padding: 4.5vw 4vw 4vw;
  background: var(--c-card);
  border: 0.2vw solid var(--c-line);
  border-radius: 3.5vw;
  box-shadow: var(--shadow-card);
}

.m-toc__title {
  margin: 0 0 3vw;
  padding-left: 2.5vw;
  border-left: 1vw solid var(--c-grass);
  font-size: 4vw;
  font-weight: 700;
  line-height: 1.2;
}

.m-toc__list {
  /* 章節標題偏長，移動端排單欄最好讀也最好點，不做多欄擠壓 */
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.2vw;
}

.m-toc__link {
  /* 撐滿單元格：等寬膠囊右緣才齊，點擊區也更大 */
  display: flex;
  width: 100%;
  align-items: center;
  padding: 2.6vw 4.4vw;
  border: 0.2vw solid var(--c-line);
  /* 移動端膠囊是滿寬的，長標題會折兩行 —— 用圓角矩形而不是全圓角，
     文字才不會被圓弧擠到貼邊 */
  border-radius: 3vw;
  background: #f7fbf3;
  font-size: 3.3vw;
  line-height: 1.3;
}

.m-toc__link.pressed {
  background: var(--c-cream);
  border-color: var(--c-cream-d);
}

/* ── 章節卡片 ────────────────────────────────────────────────── */
.m-section {
  margin: 0 0 4.5vw;
  background: var(--c-card);
  border: 0.2vw solid var(--c-line);
  border-radius: 3.5vw;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  scroll-margin-top: 3vw;
}

.m-section__head {
  display: flex;
  align-items: center;
  padding: 3.4vw 4vw;
  background: linear-gradient(90deg, var(--c-grass) 0%, var(--c-grass-d) 100%);
}

.m-section__title {
  font-size: 4vw;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 0.2vw 0.4vw rgba(47, 75, 58, 0.25);
}

.m-section__body {
  padding: 4vw 4vw 4.5vw;
}

.m-table-block + .m-table-block { margin-top: 5vw; }

.m-table__caption {
  margin: 0 0 2.4vw;
  padding-left: 2.2vw;
  border-left: 0.8vw solid var(--c-grass);
  font-size: 3.6vw;
  font-weight: 700;
  line-height: 1.3;
}

/* 寬表（4 欄以上）在 750 寬螢幕塞不下，改為橫向捲動 */
.m-table-block { position: relative; }

/* 右緣漸隱：提示「右邊還有內容可以滑」，比只放一行文字提示更直覺 */
.m-table-scroll-wrap {
  position: relative;
}

.m-table-scroll-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 9vw;
  pointer-events: none;
  border-radius: 0 2.4vw 2.4vw 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.m-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 0.2vw solid var(--c-line);
  border-radius: 2.4vw;
}

.m-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 3.3vw;
}

.m-table-block[data-cols="4"] .m-table { min-width: 150vw; }
.m-table-block[data-cols="5"] .m-table { min-width: 185vw; }
.m-table-block[data-cols="6"] .m-table { min-width: 220vw; }

.m-table th {
  padding: 2.4vw 2.8vw;
  background: var(--c-cream);
  border-bottom: 0.4vw solid var(--c-cream-d);
  font-weight: 700;
  white-space: nowrap;
}

.m-table td {
  padding: 2.2vw 2.8vw;
  border-bottom: 0.2vw solid var(--c-line);
  line-height: 1.5;
}

.m-table tbody tr:last-child td { border-bottom: none; }
.m-table tbody tr:nth-child(even) { background: var(--c-zebra); }

.m-table .col-text { text-align: left; }

.m-table .col-pct,
.m-table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.m-table .col-pct { color: #37734c; }

.m-table .is-note {
  color: var(--c-ink-2);
  font-size: 3vw;
}

/* 橫向捲動提示：只有真的會捲的表才顯示 */
.m-table-hint {
  margin-top: 1.6vw;
  font-size: 2.9vw;
  color: var(--c-ink-2);
  text-align: right;
}

/* ── 頁尾（值全部復用首頁 pages.home.fields.*）─────────────────── */
.m-prob-footer {
  padding: 4vw 5vw 9vw;
  text-align: center;
  color: var(--c-ink-2);
}

.m-prob-footer__logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5vw;
  margin-bottom: 3vw;
  opacity: 0.9;
}

.m-prob-footer__logos img {
  height: 8vw;
  width: auto;
}

.m-prob-footer__copyright {
  /* 版權文案在 config 裡是多行字串（\n 分行），必須 pre-line 才會照原樣換行 */
  white-space: pre-line;
  margin: 0 0 2.4vw;
  font-size: 2.9vw;
  line-height: 1.9;
  text-align: left;
}

.m-prob-footer__links {
  font-size: 2.9vw;
  line-height: 2.2;
  letter-spacing: 0.1vw;
}

.m-prob-footer__links a {
  color: #4b8f3d;
  border-bottom: 0.2vw solid rgba(75, 143, 61, 0.35);
}

.m-prob-footer__sep { margin: 0 2vw; opacity: 0.5; }
