/* 政策群島頁：米白色的「刊物」風格。三維場景疊上 HTML 的品牌、工具列、政策清單、島的詳細面板。
   這個檔案自己完整（不讀 /style.css、不讀 Google Fonts）。 */

:root {
  --bg: #f4ede4; /* 頁面底色、沒有 WebGL 時的背景 */
  --paper: #fbf7f2; /* 面板與卡片 */
  --line: #ddd0c2; /* 細線 */
  --ink: #2a2420; /* 墨色字 */
  --muted: #7a6e64; /* 次要字 */
  --accent: #e8630a; /* 強調橘（底色、邊） */
  --accent-ink: #b84d05; /* 強調橘（文字，對比 ≥ 4.5:1） */
  --pill: #1f1b18; /* 黑色膠囊按鈕 */
  --blue: #3f8fd2;
  --blue-ink: #2a6aa8;
  --green: #2fbf71;
  --green-ink: #1f7a4a;
  --yellow: #ffcf24; /* 肥皂箱島（中間）的名牌小點，和 PALETTE.yellow 同色 */
  --font-sans: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --shadow-soft: 0 18px 40px rgba(42, 36, 32, 0.12);
  --shadow-pill: 0 6px 18px rgba(42, 36, 32, 0.14);
  color-scheme: light;
}

[hidden] { display: none !important; }

/* 內距與邊框算進寬度（手機上卡片才不會超出螢幕） */
:where(.islands-page) *,
:where(.islands-page) *::before,
:where(.islands-page) *::after { box-sizing: border-box; }

html,
body.islands-page {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
/* :where() 讓元件的 class 能蓋過這個重設（specificity 為 0） */
:where(.islands-page) button { font: inherit; color: inherit; }
.islands-page :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}
.stage {
  position: absolute;
  inset: 0;
}
.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.stage.grabbing canvas { cursor: grabbing; }
.stage.pointer canvas { cursor: pointer; }

.kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* 小圖示（inline SVG 線條） */
.ico {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
}
.ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 左上品牌 ---------- */
.brand {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px 7px 7px;
  background: rgba(251, 247, 242, 0.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-pill);
  pointer-events: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.brand-game {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 上方工具列（≥ 768px） ---------- */
.toolbar {
  position: fixed;
  top: 16px;
  left: 276px;
  right: 16px;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.tool-group {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: rgba(251, 247, 242, 0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-pill);
  pointer-events: auto;
}
.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  min-width: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.tool:hover { background: rgba(42, 36, 32, 0.06); }
.tool[aria-pressed="true"] {
  background: var(--pill);
  color: #fff;
}
.tool-help-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
/* 寬度不夠時文字隱藏，但保留給螢幕閱讀器用 */
.tool-label {
  white-space: nowrap;
}
@media (max-width: 1099px) {
  .tool-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .tool { padding: 0 9px; }
}
/* 中寬（768–1199）才需要「清單」按鈕；寬螢幕右側清單常駐 */
@media (min-width: 1200px) {
  .tool-index { display: none; }
}

/* ---------- 手機右側按鈕列（< 768px） ---------- */
.dock {
  position: fixed;
  top: 84px;
  right: 10px;
  z-index: 5;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.dock-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow-pill);
  cursor: pointer;
}
.dock-btn .ico svg { width: 21px; height: 21px; }

/* ---------- 名牌（每座島上方，白色膠囊＋編號＋底下一行主題） ---------- */
.tags,
.pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tags { z-index: 3; }
.pins { z-index: 4; }
.labels-off .tags { display: none; }

.tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  cursor: pointer;
  white-space: nowrap;
  will-change: transform;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-pill);
}
.tag-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.tag[data-accent="blue"] .tag-pill::before { background: var(--blue); }
.tag[data-accent="green"] .tag-pill::before { background: var(--green); }
.tag[data-accent="yellow"] .tag-pill::before { background: var(--yellow); }
.tag-no {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--accent-ink);
}
.tag[data-accent="blue"] .tag-no { color: var(--blue-ink); }
.tag[data-accent="green"] .tag-no { color: var(--green-ink); }
.tag-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.tag-theme {
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(251, 247, 242, 0.9);
  font-size: 12px;
  color: var(--muted);
}
.tag:hover .tag-pill { border-color: var(--ink); }
.tag.is-active .tag-pill {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink), var(--shadow-pill);
}
.tag:focus-visible { outline: none; }
.tag:focus-visible .tag-pill { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---------- 圖釘：政策用編號圓點、功能用小標籤、水晶球用提示泡泡 ---------- */
.pin {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--pill);
  color: #fff;
  box-shadow: var(--shadow-pill);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.pin:hover { transform: scale(1.08); }
.pin.is-hl { background: var(--accent); }
.pin.feature {
  width: auto;
  height: auto;
  padding: 6px 11px;
  border: 1px dashed var(--muted);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pin.feature.is-hl { background: #fff1e4; border-color: var(--accent); }
/* 問題的圖釘：深色膠囊，和政策的編號圓點不同樣式 */
.pin.issue {
  width: auto;
  height: auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: var(--pill);
  color: #fff;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.pin.issue.is-hl { background: var(--accent); }
/* 政策底下的資料來源（basis）圖釘：小圓角方塊寫短名；新功能用橘底白字，和政策的編號圓點不同 */
.pin.basis {
  width: auto;
  height: auto;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pin.basis.is-new { background: var(--accent); border-color: #fff; color: #fff; }
.pin.basis.is-hl { background: #fff1e4; border-color: var(--accent); }
.pin.basis.is-new.is-hl { background: var(--accent-ink); border-color: #fff; }

.bubble {
  position: absolute;
  left: 0;
  top: 0;
  padding: 7px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-pill);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}


/* ---------- 面板共用：米白卡片、細邊、柔和陰影 ---------- */
.index,
.detail {
  position: fixed;
  top: 88px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: 340px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.index { right: 16px; }
.detail { left: 16px; width: 360px; }

/* 右側清單 */
.index-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 22px 24px;
}
.index-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.index-titles { min-width: 0; }
.index-title {
  margin: 6px 0 6px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.index-tagline {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.5;
}
.index-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.index-stats {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.index-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.index-row { border-bottom: 1px solid var(--line); }
.row-head {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.row-no {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 36px;
  line-height: 1;
  color: var(--muted);
}
.index-row.is-open .row-no,
.row-head:hover .row-no { color: var(--accent-ink); }
.row-title { display: grid; gap: 2px; min-width: 0; }
.row-name { font-size: 17px; font-weight: 700; }
.row-theme { font-size: 13px; color: var(--muted); }
.row-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.row-body { padding: 0 0 14px 60px; }

/* 政策與功能的一列項目（清單與詳細面板共用） */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
button.item { cursor: pointer; }
button.item:hover { border-color: var(--ink); }
.item-no {
  flex: none;
  min-width: 24px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--accent-ink);
}
.item-text { min-width: 0; }
.item.is-hl {
  background: #fff1e4;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 99, 10, 0.18);
}
.item.feature { border-style: dashed; }
.item.issue-item { border-left: 3px solid var(--ink); }

/* 問題段落（參與島）：白卡、細邊，段落可以展開 */
.issue {
  margin: 18px 0 2px;
  padding: 16px 16px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  scroll-margin: 16px;
}
.issue.is-hl {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 99, 10, 0.18);
}
.issue .kicker { margin-bottom: 4px; }
.issue-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
}
.issue-scene {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.issue-p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.75;
}
.issue-more {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
/* PMPC 重複使用：功能卡裡一段說明，底下一顆黑色膠囊按鈕 */
.item.reuse-card {
  flex-wrap: wrap;
  row-gap: 6px;
  cursor: default;
}
.reuse-hint {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.reuse-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--pill);
  box-shadow: var(--shadow-pill);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.reuse-btn:hover { background: #3a332d; }
.reuse-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* 雙城的城市牌：比島名牌大，深色膠囊；點了飛到雙城鳥瞰 */
.city-tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 8px 22px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--pill);
  box-shadow: var(--shadow-pill);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
}
.city-tag:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* 成本問題（資料島）：sections 每段一個小標；sources 是資料來源連結（新分頁） */
.issue-section + .issue-section { margin-top: 12px; }
.issue-sub {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
}
.issue-sources {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.issue-sources .list { margin: 0; }
.issue-link {
  display: inline-block;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.soon {
  flex: none;
  margin-left: auto;
  padding: 1px 8px;
  border: 1px solid var(--muted);
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* 左側島的詳細面板 */
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.detail-titles { min-width: 0; }
.detail-title {
  margin: 6px 0 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  outline: none;
}
.detail-title:focus { outline: none; }
.detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 22px 24px;
}
.blurb {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
}
.chip {
  padding: 3px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}
/* 資料島的「現在／之後」：兩段式切換鈕（目前的那段黑底白字），下面兩行是白天、晚上（小圖示＋文字） */
.state { margin: 14px 0 0; }
.state-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}
/* 手機的抽屜也一樣：高度 44px 以上，手指好按 */
.state-seg {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.state-seg:hover { background: rgba(42, 36, 32, 0.06); }
.state-seg.is-on,
.state-seg.is-on:hover { background: var(--pill); color: #fff; }
.state-lines { display: grid; gap: 6px; margin-top: 10px; }
.state-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
.state-line .ico { width: 16px; height: 16px; margin-top: 4px; }
.state-line .ico svg { width: 16px; height: 16px; }
.state-day .ico { color: var(--accent-ink); }
.state-night .ico { color: var(--blue-ink); }

.detail-body .sub {
  margin: 22px 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-body .item-no { min-width: 26px; }

/* 政策底下的 basis 區塊：縮排到政策標題的位置，左側一條細線，小字 label 接一排按鈕 */
.basis {
  margin: 8px 0 2px 47px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}
.basis-label {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.item.basis-item {
  align-items: center;
  padding: 7px 10px;
  font-size: 13px;
}
/* 政策／功能標題底下的說明：縮排對齊標題文字，一句一行的小字 */
.item-desc {
  margin: 6px 0 10px 47px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
}
.item-desc p { margin: 0 0 2px; }
/* 資料來源按鈕底下的說明：一句一行的小字 */
.basis-text {
  margin: 6px 2px 10px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
}
.basis-text p { margin: 0 0 2px; }
/* 新功能：橘底白字，旁邊一個白底橘字的小膠囊 */
.item.basis-item.is-new { background: var(--accent); border-color: var(--accent); color: #fff; }
button.item.basis-item.is-new:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.item.basis-item.is-new.is-hl { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--accent); }
.new-tag {
  flex: none;
  margin-left: auto;
  padding: 1px 8px;
  background: #fff;
  color: var(--accent-ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

/* 水晶球的主要按鈕：黑色膠囊，真的 <a href> */
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  padding: 14px 20px;
  background: var(--pill);
  color: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-pill);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.cta:hover { background: #3a332d; }
.cta:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.cta-hint {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.icon-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink); }

/* ---------- 手機（< 768px）：底部抽屜，同一時間一個；右側按鈕列 ---------- */
@media (max-width: 767px) {
  .brand { top: 10px; left: 10px; gap: 9px; }
  .brand-mark { width: 38px; height: 38px; font-size: 13px; border-radius: 10px; }
  .brand-title { font-size: 17px; }
  .brand-game { font-size: 11px; }
  .toolbar { display: none; }
  .dock { display: flex; }
  /* 名牌縮小、只留編號與島名，免得在小螢幕上互相蓋住 */
  .tag { gap: 0; }
  .tag-theme { display: none; }
  .tag-pill { padding: 4px 10px 4px 8px; gap: 6px; }
  .tag-pill::before { width: 7px; height: 7px; }
  .tag-no,
  .tag-name { font-size: 13px; }

  .index,
  .detail {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 55vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    box-shadow: 0 -8px 30px rgba(42, 36, 32, 0.16);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .index-scroll { padding: 18px 18px 22px; }
  .detail-head { padding: 16px 18px 12px; }
  .detail-body { padding: 14px 18px 22px; }
  .detail-title { font-size: 24px; }
  .index-title { font-size: 22px; }
  .row-no { font-size: 30px; }
  .row-body { padding-left: 52px; }
  /* 資料來源按鈕：手指好按，至少 44px 高（詳細面板與清單的抽屜都一樣） */
  .item.basis-item { min-height: 44px; font-size: 14px; }
}
/* 寬螢幕清單常駐，不需要關閉鈕；中寬與手機才有 */
@media (min-width: 1200px) {
  .index-close { display: none; }
}

/* ---------- 第一次進來的三步導覽（置中卡片；背景半透明遮罩） ---------- */
.tour {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(42, 36, 32, 0.28);
}
.tour-card {
  width: min(420px, 100%);
  padding: 26px 26px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(42, 36, 32, 0.25);
}
.tour-card .kicker { margin-bottom: 4px; }
.tour-title {
  margin: 6px 0 10px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
}
.tour-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
}
.tour-dots {
  display: flex;
  gap: 6px;
  margin: 18px 0 16px;
}
.dot {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}
.dot.is-on { background: var(--ink); }
.tour-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.btn-primary,
.btn-ghost {
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary {
  border: 0;
  background: var(--pill);
  color: #fff;
  box-shadow: var(--shadow-pill);
}
.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

/* ---------- 沒有 WebGL：三座島的內容直接列成一頁 ---------- */
.fallback {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-y: auto;
  padding: 92px 16px 28px;
  background: var(--bg);
}
.fallback-inner {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.fallback-card {
  padding: 18px 20px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}
.fallback-title {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 800;
}
.fallback-theme {
  margin: 4px 0 10px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 海上的淡出（連到遊戲時） ---------- */
.fade {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: #bfe3ff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.fade.on {
  opacity: 1;
  pointer-events: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 減少動態：不做 CSS 過渡 */
@media (prefers-reduced-motion: reduce) {
  .pin,
  .fade { transition: none; }
  .pin:hover { transform: none; }
}
