@charset "utf-8";

/**
 * /probability 機率公布頁 · PC 樣式
 *
 * 版面說明：
 *   本頁是「機率公布」長文件頁 —— 11 個章節、21 張表、115 列機率資料，總高遠超一個螢幕，
 *   必須靠瀏覽器原生捲動閱讀，也沒有任何視口錨定元素（無右下浮窗、無底部固定 CTA），
 *   因此走「單欄長捲動文件」版面（probability/index.html <head> 已標記 a2web:pc-arch=1920-fixed），
 *   而不是首頁那套固定畫布 + 分屏縮放。內容欄固定最大寬度置中，1366 ~ 2560 寬皆可正常閱讀。
 *
 * 與首頁的關係：本頁不載入 home_pc.css（首頁是縮放畫布、本頁是原生長文件，兩套骨架不相容），
 *   但頁尾 logo / 版權 / 協議連結全部綁 pages.home.fields.* 的同一份值，改首頁即同步。
 *
 * 色票取自主視覺 KV：
 *   天空藍 #dff2fb / #bde7f7   —— 頁面頂部底色
 *   草地綠 #8fd06a / #63b64d   —— 章節標題列、重點色
 *   奶油黃 #fdf3d5 / #f6e6b0   —— 表頭底色
 *   墨綠字 #2f4b3a / #63806c   —— 正文與次要文字
 */

/* ── 基礎 ────────────────────────────────────────────────────── */
* { 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-sky-2: #bde7f7;
  --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 6px 22px rgba(47, 75, 58, 0.09);
}

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 620px, #f3faec 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ── 首屏主視覺 ──────────────────────────────────────────────── */
.prob-hero {
  position: relative;
  width: 100%;
  /* 28.13vw = KV 原圖 3840:1080 的比例，讓橫幅在 1366~2560 寬之間剛好完整顯示、不裁掉角色 */
  height: clamp(260px, 28.13vw, 720px);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* 底部漸層：讓主視覺自然過渡到頁面底色，不出現硬邊 */
.prob-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(234, 247, 226, 0) 0%, rgba(234, 247, 226, 0.75) 60%, #eaf7e2 100%);
}

/* 左上角 logo：本頁是官網子頁，logo 同時當「回首頁」入口 */
.prob-hero__home {
  position: absolute;
  top: 24px;
  left: 40px;
  z-index: 2;
  display: block;
  transition: transform 0.18s ease;
}

.prob-hero__home:hover { transform: translateY(-3px); }

.prob-hero__home img {
  height: 76px;
  width: auto;
  filter: drop-shadow(0 3px 8px rgba(47, 75, 58, 0.25));
}

/* 未設定 logo 時 img[hidden] 必須真的不顯示（上面的 img { display: block } 會蓋掉 UA 預設） */
.prob-hero__home[hidden] { display: none; }

/* ── 內容欄 ──────────────────────────────────────────────────── */
.prob-wrap {
  position: relative;
  z-index: 3;
  max-width: 1160px;
  margin: -70px auto 0;
  padding: 0 24px 50px;
}

.prob-title {
  margin: 0 auto 26px;
  padding: 26px 40px;
  max-width: 860px;
  background: var(--c-card);
  border: 3px solid #fff;
  border-radius: 26px;
  box-shadow: var(--shadow-card);
  text-align: center;
  font-size: 34px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--c-ink);
}

.prob-title::after {
  content: "";
  display: block;
  width: 92px;
  height: 6px;
  margin: 16px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--c-grass), var(--c-grass-d));
}

/* ── 目錄 ────────────────────────────────────────────────────── */
.toc {
  margin: 0 0 34px;
  padding: 22px 26px 20px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}

.toc__title {
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 5px solid var(--c-grass);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.toc__list {
  /* 用等寬網格而不是 flex 換行：11 個章節標題長短不一，flex 會讓每行參差、末行留一大片空白 */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px 12px;
}

/* li 才是網格項，膠囊在它裡面 —— li 撐成 flex，膠囊才會跟著同行最高的那個等高 */
.toc__list > li { display: flex; }

.toc__link {
  /* 撐滿網格單元格，讓同一行的膠囊等寬 —— 自適應寬度會讓右緣參差 */
  display: flex;
  width: 100%;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: #f7fbf3;
  font-size: 15px;
  color: var(--c-ink);
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.toc__link:hover {
  background: var(--c-cream);
  border-color: var(--c-cream-d);
  transform: translateY(-2px);
}

/* ── 章節卡片 ────────────────────────────────────────────────── */
.prob-section {
  margin: 0 0 28px;
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  scroll-margin-top: 24px;
}

.prob-section__head {
  display: flex;
  align-items: center;
  padding: 15px 26px;
  background: linear-gradient(90deg, var(--c-grass) 0%, var(--c-grass-d) 100%);
}

.prob-section__title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px 2px rgba(47, 75, 58, 0.25);
}

/* 表格組：一個章節可能並排多張表（扭蛋 2 張、便當 3 張、卡包 4 張），
   用 auto-fit 讓它們在寬螢幕並排、窄螢幕自動換行堆疊。 */
.prob-section__body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 22px 24px;
  padding: 22px 26px 26px;
}

/* 欄數多的寬表（釣魚 6 欄 / 轉盤 4 欄）獨佔整列，避免被擠成窄欄 */
.prob-section__body.is-wide {
  grid-template-columns: 1fr;
}

/* 剛好 4 張並排的章節（畫冊卡包）排成 2×2，
   否則 auto-fit 會排成 3+1、第 4 張孤懸在左邊並留一大片空白 */
.prob-section__body.is-quad {
  grid-template-columns: repeat(2, 1fr);
}

.prob-table__caption {
  margin: 0 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--c-grass);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-ink);
}

.prob-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 15px;
}

.prob-table th {
  padding: 11px 14px;
  background: var(--c-cream);
  border-bottom: 2px solid var(--c-cream-d);
  font-weight: 700;
  color: var(--c-ink);
  white-space: nowrap;
}

.prob-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-line);
  line-height: 1.5;
}

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

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

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

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

/* 備註欄（長跑機率表）字級小一階、顏色淡一階，不與機率數字搶視線 */
.prob-table .is-note {
  color: var(--c-ink-2);
  font-size: 14px;
}

/* ── 頁尾（值全部復用首頁 pages.home.fields.*）─────────────────── */
.prob-footer {
  padding: 26px 24px 46px;
  text-align: center;
  color: var(--c-ink-2);
}

.prob-footer__logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
  margin-bottom: 16px;
  opacity: 0.9;
}

.prob-footer__logos img {
  height: 46px;
  width: auto;
}

.prob-footer__copyright {
  /* 版權文案在 config 裡是多行字串（\n 分行），必須 pre-line 才會照原樣換行 */
  white-space: pre-line;
  max-width: 900px;
  margin: 0 auto 14px;
  font-size: 13px;
  line-height: 1.9;
  text-align: center;
}

.prob-footer__links {
  font-size: 13px;
  line-height: 2;
  letter-spacing: 0.5px;
}

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

.prob-footer__links a:hover { color: #37734c; }

.prob-footer__sep { margin: 0 10px; opacity: 0.5; }

/* ── 窄視窗（拖窄的桌面視窗 / 預覽面板）──────────────────────── */
@media (max-width: 900px) {
  .prob-wrap { margin-top: -40px; padding: 0 16px 60px; }
  .prob-title { font-size: 26px; padding: 20px 24px; }
  .prob-hero__home img { height: 56px; }
  .prob-section__body { padding: 18px 16px 20px; grid-template-columns: 1fr; }
  .prob-section__head { padding: 14px 16px; }
  .prob-table { font-size: 14px; }
  .prob-footer__logos img { height: 38px; }
}
