/* 環遊世界學地理 — 兒童向樣式
 * 字型：jf open huninn 粉圓體（fonts/，在地化）；畫面以 1280×800 stage 一體等比縮放。
 */
@font-face {
  font-family: 'Huninn';
  src: url('../fonts/huninn-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
  font-weight: 400;
}
@font-face {
  font-family: 'Huninn';
  src: url('../fonts/huninn-tc.woff2') format('woff2');
  font-weight: 400;
}
:root {
  --home-scene-background: linear-gradient(180deg, #26bdf2 0%, #4ec8f3 58%, #65d2f1 100%);
  --ink: #22386e;
  --asia: #ffb38a;
  --europe: #a8dcb0;
  --africa: #ffd873;
  --north-america: #8ec9ee;
  --south-america: #b5e48c;
  --oceania: #cdb4f0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: 'Huninn', 'PingFang HK', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: linear-gradient(180deg, #2c63ad, #1d4476);
  overflow: hidden;
}
.hidden { display: none !important; }

/* ---------- stage：一體等比縮放 ---------- */
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1280px; height: 800px;
  transform-origin: center center;
  border-radius: 0; overflow: hidden;
  box-shadow: 0 30px 80px #061f42aa;
  background: linear-gradient(180deg, #3d74d6, #27548f);
}

/* ---------- 首頁：父布局 1280×800 单场景 ---------- */
#view-home {
  position: absolute; inset: 0; overflow: hidden;
  background: var(--home-scene-background);
}
body.home-layout-active #stage {
  background: var(--home-scene-background);
}
#home-scene {
  position: absolute; left: 0; top: 0; width: 1280px; height: 800px;
  transform-origin: top left; transform: scale(1);
}
#world-map { position: absolute; inset: 0; width: 1280px; height: 800px; display: block; overflow: visible; }
#home-button-layer { position: absolute; inset: 0; pointer-events: none; }
#view-home #home-button-layer button {
  position: absolute; right: auto; top: auto; bottom: auto; z-index: 2;
  display: block; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; line-height: 0;
  pointer-events: auto; cursor: pointer;
}
#view-home #home-button-layer img { display: block; width: 100%; height: 100%; object-fit: fill; }
#view-home #home-button-layer button:focus-visible {
  outline: 4px solid #ffd93b; outline-offset: 3px; border-radius: 14px;
}
.home-layout-image { pointer-events: none; }
.home-layout-label {
  font-family: 'Huninn', 'PingFang HK', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-weight: 900; fill: #123b78; stroke: #fff; stroke-linejoin: round;
  paint-order: stroke fill;
  filter: drop-shadow(0 0 4px #a6e0ff) drop-shadow(0 2px 2px #103e7255);
  text-anchor: middle; pointer-events: none;
}
.blob { stroke: #fff; stroke-width: 1.7; stroke-linejoin: round; cursor: pointer; }
.blob:hover { filter: brightness(1.07); }
#world-map path.blob:focus { outline: none; }
#world-map path.blob:focus-visible { stroke: #ffd93b; stroke-width: 3px; }
.land-gray { fill: #e8eef4; stroke: #fff; stroke-width: 1.2; }
.cont-label { letter-spacing: 6px; }
.ocean-label { font-weight: 800; letter-spacing: 4px; }
.deco { text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.wave-line { fill: none; stroke: #ffffff1f; stroke-width: 3; stroke-linecap: round; }
.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ---------- 洲頁頂欄 ---------- */
#view-continent { position: absolute; inset: 0 0 76px 0; display: flex; flex-direction: column; }
/* 頂欄三欄網格：左返回、右使用說明，洲名嚴格置中於畫面中央 */
#topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px 18px 10px; flex: none; }
#page-title {
  text-align: center; margin: 0;
  font-size: 42px; font-weight: 900; letter-spacing: 3px;
  color: #fff; text-shadow: 0 3px 0 #17385f66;
}
#btn-back { justify-self: start; }
.help-wrap { position: relative; justify-self: end; }
#btn-help { background: #6aa9e6; box-shadow: 0 4px 0 #4785c4; }
#help-panel, #hk-help-panel, #cn-help-panel, #cnp-help-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 350px; z-index: 40;
  background: #fffdf4; color: var(--ink); border-radius: 16px;
  box-shadow: 0 16px 40px #0b2c5c55; padding: 18px 22px;
  font-size: 17.5px; line-height: 1.6; text-align: left;
}
#help-panel p, #hk-help-panel p, #cn-help-panel p, #cnp-help-panel p { margin: 0 0 10px; }
#help-panel p:last-child, #hk-help-panel p:last-child, #cn-help-panel p:last-child, #cnp-help-panel p:last-child { margin-bottom: 0; }
.pill-btn {
  border: none; cursor: pointer; border-radius: 999px;
  padding: 12px 24px; font-size: 21px; font-weight: 900; color: #fff;
  background: #4a90d9; box-shadow: 0 4px 0 #2f6cb3; font-family: inherit;
}
.pill-btn:active { transform: translateY(2px); box-shadow: none; }

/* ---------- 洲地圖佈局 ---------- */
.continent-layout { display: flex; gap: 16px; padding: 0 18px 18px; flex: 1; min-height: 0; }
.map-wrap {
  position: relative; flex: 1; min-width: 0;
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 14px 34px #0b2c5c4d;
}
/* 背景同海洋漸變：視窗比例與 viewBox 不一致時的留白帶也讀作海面，
   不再露出舞台深藍（v2.7.1 用戶截圖：認識香港右邊深藍直帶） */
.map-wrap { background: linear-gradient(180deg, #b5e3fa, #79c4f2); }
.map-wrap svg { width: 100%; height: 100%; display: block; background: linear-gradient(180deg, #b5e3fa, #79c4f2); }
.land { stroke: #fff; stroke-width: 1.7; stroke-linejoin: round; cursor: pointer; }
.land:hover { filter: brightness(1.07); }
.land-context { fill: #e4e4e4; stroke: #c2c2c2; stroke-width: 0.8; }
.map-label {
  font-weight: 900; fill: var(--ink); text-anchor: middle;
  pointer-events: none; paint-order: stroke; stroke: #ffffffd9; stroke-width: 3.5px; stroke-linejoin: round;
}
.dotm { stroke: #fff; stroke-width: 2.4; }
.hit { fill: #fff; fill-opacity: 0; stroke: none; cursor: pointer; }
.wave-line-l { fill: none; stroke: #ffffff59; stroke-width: 3; stroke-linecap: round; }

/* ---------- 小地方列表（面板內捲動） ---------- */
#small-list-card {
  width: 264px; flex: none; background: #fff8dc; border-radius: 24px;
  box-shadow: 0 14px 34px #0b2c5c4d; padding: 16px;
  display: flex; flex-direction: column; min-height: 0;
}
#small-list-card h2 { margin: 2px 0 6px; font-size: 22px; font-weight: 900; }
.small-note { margin: 0 0 10px; font-size: 14.5px; color: #7a6a35; line-height: 1.5; }
#small-list {
  list-style: none; margin: 0; padding: 0 2px 2px 0;
  display: grid; gap: 8px; align-content: start;
  overflow-y: auto; flex: 1; min-height: 0;
  scrollbar-width: thin; scrollbar-color: #d9c98a transparent;
}
#small-list button {
  width: 100%; display: flex; align-items: center; gap: 10px; height: 35px; flex: none;
  border: none; cursor: pointer; background: #fff; border-radius: 14px;
  padding: 8px 10px; font-size: 17px; font-weight: 900; color: var(--ink);
  box-shadow: 0 2px 0 #00000014; text-align: left; font-family: inherit;
}
#small-list button:active { transform: translateY(1px); box-shadow: none; }
#small-list img { width: 34px; height: 24px; object-fit: contain; background: #eef4fa; border-radius: 4px; box-shadow: 0 0 0 1px #0002; }
#small-list .en { font-size: 12px; color: #8296b5; font-weight: 700; }

/* ---------- 自製大字 tooltip（取代瀏覽器預設小黃籤） ---------- */
#tooltip {
  position: absolute; z-index: 80; pointer-events: none;
  background: #ffe066; color: #22386e;
  font-size: 27px; font-weight: 900; line-height: 1.25;
  padding: 8px 20px; border-radius: 999px;
  box-shadow: 0 8px 22px #0b2c5c55; white-space: nowrap;
}
#tooltip .tip-en { font-size: 18px; font-weight: 700; opacity: 0.7; margin-left: 6px; }

/* ---------- 提示 toast ---------- */
#toast {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #22386ee6; color: #fff; font-size: 19px; font-weight: 900;
  padding: 13px 24px; border-radius: 999px; box-shadow: 0 8px 24px #12325e44;
  z-index: 60; max-width: 92%; text-align: center;
}

/* ---------- 詳情卡（v0.1 原樣，用戶已確認喜歡，勿改設計） ---------- */
#detail-overlay {
  position: absolute; inset: 0; background: #1d3a5f55;
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
#detail-card {
  position: relative; background: #fff; border-radius: 28px;
  width: min(560px, 100%); max-height: 92%; overflow: auto;
  padding: 26px 28px; box-shadow: 0 24px 60px #12325e55;
}
#btn-close-detail {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px;
  border: none; border-radius: 50%; background: #eef2f7; color: #5b729e;
  font-size: 18px; cursor: pointer;
}
.detail-head { display: flex; gap: 18px; align-items: center; }
#d-flag { width: 132px; height: 92px; object-fit: contain; background: #eef4fa; border-radius: 10px; box-shadow: 0 2px 10px #0003; }
.country-photo-block { width: min(390px, 100%); margin: 12px auto 4px; }
.country-photo { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 14px; background: #eef4fa; }
#d-zh { font-size: 40px; font-weight: 900; line-height: 1.15; }
#d-en { font-size: 19px; color: #8296b5; font-weight: 700; }
.detail-rows { margin: 20px 0 0; display: grid; gap: 10px; }
.detail-rows > div { display: flex; gap: 12px; align-items: baseline; background: #f2f7fd; border-radius: 14px; padding: 10px 14px; }
.detail-rows dt { flex: none; width: 118px; font-weight: 800; font-size: 16.5px; }
.detail-rows dd { margin: 0; font-size: 17.5px; font-weight: 600; }
.trivia-box { margin-top: 16px; background: #fff3b0; border-radius: 18px; padding: 14px 18px; }
.trivia-box h3 { margin: 0 0 8px; color: #b3541e; font-size: 19px; }
.trivia-box ul { margin: 0; padding-left: 20px; display: grid; gap: 7px; }
.trivia-box li { font-size: 16.5px; line-height: 1.55; }

/* ---------- 底部導覽列（全站共用，方案 A） ---------- */
#main-nav {
  position: absolute; left: 0; right: 0; bottom: 0; height: 76px; z-index: 20;
  background: #16345c; display: flex; justify-content: center; align-items: stretch; gap: 110px;
}
.nav-btn {
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: #a9c8ec; font-size: 23px; font-weight: 700; letter-spacing: 2px;
  padding: 0 18px; position: relative;
}
.nav-label { position: relative; display: inline-block; z-index: 0; }
.nav-btn.on { color: #17385f; font-weight: 900; }
.nav-btn.on .nav-label::before {
  content: ""; position: absolute; z-index: -1; left: -16px; right: -16px;
  top: -7px; bottom: -7px; border-radius: 999px; background: #ffd93b; pointer-events: none;
}

/* ---------- 子頁面共同頁首 ---------- */
.page-head h1 {
  text-align: center; margin: 0; padding: 18px 0 4px;
  font-size: 42px; font-weight: 900; letter-spacing: 3px;
  color: #fff; text-shadow: 0 3px 0 #17385f66;
}

/* ---------- 國家列表 ---------- */
#view-list { position: absolute; inset: 0 0 76px 0; display: flex; flex-direction: column; }
#list-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 12px 18px 12px; flex: none; }
.chip {
  font-family: inherit; cursor: pointer; border-radius: 999px;
  border: 2px solid #ffffff45; background: #ffffff22; color: #dcefff;
  padding: 8px 20px; font-size: 19px; font-weight: 700;
}
.chip.on { background: #ffd93b; border-color: #ffd93b; color: #14406e; font-weight: 900; }
#list-scroll { flex: 1; overflow-y: auto; padding: 2px 22px 22px; }
.list-cont-head { color: #fff; font-size: 24px; font-weight: 900; letter-spacing: 2px; margin: 16px 4px 10px; }
.list-count { font-size: 16px; font-weight: 700; color: #bcd7f5; margin-left: 10px; letter-spacing: 0; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.country-card {
  font-family: inherit; cursor: pointer; background: #fffdf4; border: none; border-radius: 14px;
  padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  box-shadow: 0 4px 12px #0b2c5c30;
}
.country-card:active { transform: translateY(1px); }
.country-card img { width: 64px; height: 45px; object-fit: contain; background: #eef4fa; border-radius: 6px; }
.country-card .cc-zh { font-size: 19px; font-weight: 900; color: var(--ink); }
.country-card .cc-en { font-size: 12.5px; color: #7a8db0; }

/* ---------- 小測驗 ---------- */
#view-quiz { position: absolute; inset: 0 0 76px 0; display: flex; flex-direction: column; overflow-y: auto; }
.quiz-intro { text-align: center; color: #dcefff; font-size: 20px; margin: 8px 0 0; }
.quiz-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; width: 100%; max-width: 1180px; padding: 0 22px; box-sizing: border-box; }
#quiz-groups { display: flex; gap: 22px; justify-content: center; padding: 40px 34px; }
.quiz-group-card {
  font-family: inherit; cursor: pointer; flex: 1; max-width: 430px;
  background: #fffdf4; border: none; border-radius: 24px; padding: 52px 26px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 24px #0b2c5c40;
}
.quiz-group-card:active { transform: translateY(2px); }
.quiz-group-card .qc-title { font-size: 36px; }
.quiz-group-card .qc-desc { font-size: 19px; }
.quiz-sets { display: flex; flex-direction: column; align-items: center; padding-top: 18px; }
#quiz-home { position: relative; }
.quiz-back { position: absolute; top: 8px; left: 14px; z-index: 5; margin: 0; }
.quiz-card {
  font-family: inherit; cursor: pointer; flex: 1; max-width: 430px;
  background: #fffdf4; border: none; border-radius: 22px; padding: 44px 24px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 24px #0b2c5c40;
}
.quiz-card:active { transform: translateY(2px); }
.qc-title { font-size: 27px; font-weight: 900; color: var(--ink); }
.qc-desc { font-size: 16.5px; color: #5a7194; }
#quiz-play { display: flex; flex-direction: column; align-items: center; padding: 14px 30px 26px; flex: 1; width: 100%; box-sizing: border-box; }
#quiz-home { padding-top: 22px; flex: 1; display: flex; flex-direction: column; }
#quiz-groups { flex: 1; align-items: center; }
.quiz-sets { flex: 1; justify-content: center; width: 100%; box-sizing: border-box; }
#quiz-progress { color: #dcefff; font-size: 19px; font-weight: 700; letter-spacing: 1px; margin: 6px 0 12px; }
#quiz-qbox {
  background: #fffdf4; border-radius: 22px; width: min(1080px, 96%);
  padding: 32px 38px; box-shadow: 0 16px 40px #0b2c5c55;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; box-sizing: border-box;
}
#quiz-question { font-size: 32px; font-weight: 900; color: var(--ink); margin: 2px 0 12px; text-align: center; }
#quiz-visual:empty { display: none; }
#quiz-visual { width: 100%; }
#quiz-visual img { width: 300px; height: 200px; object-fit: contain; background: #eef4fa; border-radius: 10px; display: block; margin: 0 auto 18px; }
#quiz-visual img.quiz-photo { width: min(520px, 84%); height: 225px; object-fit: cover; }
#quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.opt-btn {
  font-family: inherit; cursor: pointer; background: #eef4fb; border: 3px solid #c9dcf2;
  border-radius: 14px; padding: 16px; font-size: 24px; font-weight: 800; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 96px;
}
.opt-label { line-height: 1.2; }
.opt-sub { font-size: 14px; font-weight: 700; color: #7a8db0; line-height: 1.15; }
.opt-btn img { width: 72px; height: 50px; object-fit: contain; background: #fff; border-radius: 5px; }
.opt-btn.correct { background: #d3f9d8; border-color: #2f9e44; }
.opt-btn.wrong { background: #ffe3e3; border-color: #e03131; }
.opt-btn:disabled { cursor: default; }
#quiz-feedback { font-size: 20px; font-weight: 800; color: var(--ink); min-height: 26px; margin: 10px 0 6px; text-align: center; }
#quiz-result { text-align: center; padding-top: 56px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#quiz-score { font-size: 54px; font-weight: 900; color: #fff; margin: 0 0 10px; }
#quiz-msg { font-size: 22px; color: #dcefff; margin: 0 0 30px; }
#quiz-result-btns { display: flex; gap: 14px; justify-content: center; }

/* ---------- 認識香港（18 區地圖／港鐵路線圖） ---------- */
#view-hk { position: absolute; inset: 0 0 76px 0; display: flex; flex-direction: column; }
#hk-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px 18px 6px; flex: none; }
#hk-title { text-align: center; margin: 0; font-size: 42px; font-weight: 900; letter-spacing: 3px; color: #fff; text-shadow: 0 3px 0 #17385f66; }
#btn-hk-back { justify-self: start; }
#btn-hk-help { background: #6aa9e6; box-shadow: 0 4px 0 #4785c4; }
.hk-modes { display: flex; gap: 10px; justify-content: center; padding: 4px 0 10px; flex: none; }
.hk-mode-btn {
  font-family: inherit; font-size: 19px; font-weight: 900; cursor: pointer;
  border: 3px solid #ffffff55; background: #ffffff22; color: #dcefff;
  border-radius: 999px; padding: 7px 26px;
}
.hk-mode-btn.on { background: #ffd93b; color: #17385f; border-color: #ffd93b; }
#view-cn { position: absolute; inset: 0 0 76px 0; display: flex; flex-direction: column; }
#view-cnprov { position: absolute; inset: 0 0 76px 0; display: flex; flex-direction: column; }
#cn-topbar, #cnp-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px 18px 6px; flex: none; position: relative; }
#cn-title, #cnp-title { text-align: center; margin: 0; font-size: 42px; font-weight: 900; letter-spacing: 3px; color: #fff; text-shadow: 0 3px 0 #17385f66; }
#btn-cn-back, #btn-cnp-back { justify-self: start; }
#btn-cn-help, #btn-cnp-help { background: #6aa9e6; box-shadow: 0 4px 0 #4785c4; }
#cn-side-card, #cnp-side-card {
  width: 264px; flex: none; background: #fff8dc; border-radius: 24px;
  box-shadow: 0 14px 34px #0b2c5c4d; padding: 16px;
  display: flex; flex-direction: column; min-height: 0;
}
#cn-side-card h2, #cnp-side-card h2 { margin: 2px 0 6px; font-size: 22px; font-weight: 900; }
#cn-list, #cnp-list {
  list-style: none; margin: 0; padding: 0 2px 2px 0;
  display: grid; gap: 8px; align-content: start;
  overflow-y: auto; flex: 1; min-height: 0;
  scrollbar-width: thin; scrollbar-color: #d9c98a transparent;
}
#cn-list .region-head { font-size: 15px; font-weight: 900; color: #96762a; margin: 8px 2px 0; }
#cn-list .region-head:first-child { margin-top: 0; }
.cn-province { stroke: #fff; stroke-linejoin: round; cursor: pointer; }
.cn-province:hover { filter: brightness(1.07); }
.cn-context { stroke: #fff; stroke-linejoin: round; }
.cn-context.clickable { cursor: pointer; }
.cn-context.clickable:hover { filter: brightness(1.07); }
.cn-foreign { fill: #e4e4e4; stroke: #c2c2c2; stroke-width: 0.8; }
.cn-type-tag { margin-left: auto; font-size: 13px; font-weight: 800; color: #96762a; background: #ffe9a8; border-radius: 999px; padding: 2px 9px; flex: none; }
.cn-label { font-weight: 900; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: #ffffff90; stroke-linejoin: round; pointer-events: none; }
.cn-context-label { font-weight: 800; fill: #5b729e; text-anchor: middle; paint-order: stroke; stroke: #ffffff90; pointer-events: none; }
#hk-side-card {
  width: 264px; flex: none; background: #fff8dc; border-radius: 24px;
  box-shadow: 0 14px 34px #0b2c5c4d; padding: 16px;
  display: flex; flex-direction: column; min-height: 0;
}
#hk-side-card h2 { margin: 2px 0 6px; font-size: 22px; font-weight: 900; }
#hk-list {
  list-style: none; margin: 0; padding: 0 2px 2px 0;
  display: grid; gap: 8px; align-content: start;
  overflow-y: auto; flex: 1; min-height: 0;
  scrollbar-width: thin; scrollbar-color: #d9c98a transparent;
}
#hk-list .region-head { font-size: 15px; font-weight: 900; color: #96762a; margin: 8px 2px 0; }
#hk-list .region-head:first-child { margin-top: 0; }
.hk-item, .line-item {
  width: 100%; display: flex; align-items: center; gap: 10px; height: 35px; flex: none;
  border: none; cursor: pointer; background: #fff; border-radius: 14px;
  padding: 8px 10px; font-size: 17px; font-weight: 900; color: var(--ink);
  box-shadow: 0 2px 0 #00000014; text-align: left; font-family: inherit;
}
.hk-item .swatch { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid #fff; box-shadow: 0 0 0 1px #0002; }
.line-item .swatch { flex: none; width: 26px; height: 12px; border-radius: 6px; }
.line-item .line-count { margin-left: auto; font-size: 13px; font-weight: 700; color: #8296b5; }
.line-item.dim { opacity: 0.45; }
.hk-district { stroke: #fff; stroke-linejoin: round; cursor: pointer; }
.hk-district:hover { filter: brightness(1.07); }
.mtr-line { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mtr-station { fill: #fff; stroke-width: 2.2; cursor: pointer; }
.station-label { font-weight: 800; fill: #17385f; paint-order: stroke; stroke: #ffffffcc; stroke-width: 3px; pointer-events: none; }
.lm-pin-circle { fill: #e64980; stroke: #fff; stroke-width: 2.5px; }
.lm-pin-star { fill: #fff; font-size: 12px; font-weight: 900; }
.lm-label { font-weight: 800; fill: #17385f; paint-order: stroke; stroke: #ffffffcc; stroke-width: 3px; pointer-events: none; }
#hk-list .lm-district-head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 900; color: #17385f; margin: 6px 2px 0; }
#hk-list .lm-district-head .swatch { flex: none; width: 16px; height: 16px; border-radius: 5px; border: 2px solid #fff; box-shadow: 0 0 0 1px #0002; }
.lm-item .lm-star { color: #e64980; font-size: 15px; flex: none; }
/* 地區／車站詳情卡：與國家詳情卡同款式（該卡為 ID 選擇器，這裡以 class 補上） */
#hk-detail-overlay, #station-overlay, #landmark-overlay, #cn-detail-overlay, #city-overlay, #cnlm-overlay, #hk-info-overlay, #records-overlay {
  position: absolute; inset: 0; background: #1d3a5f55;
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.detail-card {
  position: relative; background: #fff; border-radius: 28px;
  width: min(560px, 100%); max-height: 92%; overflow: auto;
  padding: 26px 28px; box-shadow: 0 24px 60px #12325e55;
}
#btn-close-hk-detail, #btn-close-station, #btn-close-landmark, #btn-close-cn-detail, #btn-close-city, #btn-close-cnlm, #btn-close-hk-info, #btn-close-records {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px;
  border: none; border-radius: 50%; background: #eef2f7; color: #5b729e;
  font-size: 18px; cursor: pointer;
}
.hk-mtr-dialog #btn-close-hk-info {
  position: sticky; top: 10px; right: auto; display: block; z-index: 2;
  margin: -14px -14px -40px auto;
}
#hkd-chip, #hkmtr-chip { width: 84px; height: 84px; border-radius: 20px; flex: none; box-shadow: 0 2px 10px #0003; }
#hkd-zh, #hkmtr-zh, #st-zh, #lm-zh, #cnd-zh, #ct-zh { font-size: 40px; font-weight: 900; line-height: 1.15; }
#cnd-chip, #ct-chip { width: 84px; height: 84px; border-radius: 20px; flex: none; box-shadow: 0 2px 10px #0003; }
#hkd-en, #hkmtr-en, #st-en, #lm-en, #cnd-en { font-size: 19px; color: #8296b5; font-weight: 700; }
#hk-mtr-card .mtr-card-head { padding-right: 36px; }
.trivia-box p { margin: 0; font-size: 16.5px; line-height: 1.55; }
.station-card { width: min(480px, 100%); }
#st-badge, #lm-badge, #cnlm-badge { font-size: 56px; line-height: 1; }
#st-lines { display: grid; gap: 8px; margin-top: 18px; }
.st-line-row { display: flex; align-items: center; gap: 10px; background: #f2f7fd; border-radius: 12px; padding: 9px 14px; font-size: 17.5px; font-weight: 800; }
.st-line-row .swatch { flex: none; width: 26px; height: 12px; border-radius: 6px; }
#st-district { font-size: 18px; font-weight: 700; margin: 16px 0 12px; }
#lm-district { font-size: 18px; font-weight: 700; margin: 16px 0 0; }
#lm-near { font-size: 16.5px; font-weight: 700; color: #42597d; margin: 10px 0 12px; }
#lm-photo { display: block; width: 100%; height: 245px; object-fit: cover; border-radius: 14px; background: #dcebf5; margin-bottom: 4px; }
#cnlm-photo { display: block; width: 100%; height: 245px; object-fit: cover; border-radius: 14px; background: #dcebf5; margin-bottom: 4px; }
#cnlm-loc { font-size: 17px; color: #5a6b80; font-weight: 700; }
#cnlm-zh { font-size: 30px; font-weight: 900; color: var(--ink); }
#lm-credit a { color: inherit; }
#lm-story-box { background: #e3edfb; }
#lm-best-box { background: #ffdf80; }

/* 省份下鑽（v2.1.0）：省卡大掣／省份城市地圖／星星徽章 */
#btn-cn-goto { display: block; width: 100%; margin-top: 16px; padding: 16px; font-size: 22px; font-weight: 900; color: #fff; background: #e64980; border: none; border-radius: 16px; cursor: pointer; box-shadow: 0 6px 18px #e6498055; }
#btn-cn-goto:active { transform: scale(0.98); }
#ct-badge { font-size: 19px; color: #d99a06; font-weight: 800; }
.cnp-bg { fill: #e4e4e4; stroke: #c2c2c2; stroke-width: 0.8; }
.cnp-unit { stroke: #fff; stroke-linejoin: round; }
.cnp-unit.clickable { cursor: pointer; }
.cnp-unit.clickable:hover { filter: brightness(1.07); }
.cnp-label { font-weight: 700; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: #ffffff90; stroke-linejoin: round; pointer-events: none; }
.cnp-label.key { font-weight: 900; }
.cnp-badge { pointer-events: none; }
.cnp-badge circle { fill: #ffd93b; stroke: #d99a06; stroke-width: 1.6; }
.cnp-badge-star { font-size: 13px; font-weight: 900; text-anchor: middle; dominant-baseline: central; fill: #7a5200; }
.cnp-badge-inner { transform-box: fill-box; transform-origin: center; animation: cnpPulse 1.7s ease-in-out infinite; }
@keyframes cnpPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
.cnp-star { flex: none; font-size: 16px; }
.cnp-flat { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #93a3b1; font-size: 17px; font-weight: 600; }
.cnp-flat .swatch { flex: none; width: 16px; height: 16px; border-radius: 5px; border: 2px solid #fff; box-shadow: 0 0 0 1px #0002; opacity: 0.75; }

/* 省份頁使用說明：深藍卡＋白字（用戶 v2.2.0 指定字體用白色） */
.cnp-underlay { fill: #ffffff; }
.cnp-mode-row { display: flex; gap: 8px; margin-bottom: 10px; }
.cnp-mode-btn { flex: 1; font: inherit; font-size: 18px; font-weight: 900; padding: 10px 0; border-radius: 999px; border: 3px solid #17385f33; background: #ffffff88; color: var(--ink); cursor: pointer; }
.cnp-mode-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.cnp-pin { cursor: pointer; }
.cnp-pin .pin-body { fill: #f76707; stroke: #fff; stroke-width: 2.2; }
.cnp-pin .pin-dot { fill: #fff; }
.cnp-pin .pin-glyph { font-size: 11.5px; font-weight: 900; fill: #f76707; text-anchor: middle; pointer-events: none; }
.cnp-pin .pin-name { font-size: 12.5px; font-weight: 900; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: #ffffffd9; stroke-width: 3.5px; pointer-events: none; }
.cnp-enclave-label { font-size: 12.5px; font-weight: 700; fill: #5a6b80; text-anchor: middle; pointer-events: none; }
.cnp-unit-halo { stroke-linejoin: round; }
.cn-province-halo { stroke-linejoin: round; }

/* 地圖題（FR-14） */
#quiz-visual svg.qmap { width: 100%; height: auto; display: block; margin: 0 auto 10px; border-radius: 14px; }
.qmap-sea { fill: #bfe8fc; }
.qmap-unit { fill: #dcecfb; stroke: #fff; stroke-width: 1.6; }
.qmap-context { fill: #e4e4e4; stroke: #c9c9c9; }
.qmap-target { fill: #ff922b; animation: qmapPulse 0.9s ease-in-out infinite alternate; }
@keyframes qmapPulse { from { fill-opacity: 0.55; } to { fill-opacity: 1; } }
.qmap-tap { cursor: pointer; }
.qmap-tap:hover { filter: brightness(1.08); }
.qmap-unit.qmap-correct { fill: #51cf66; animation: none; }
.qmap-unit.qmap-wrong { fill: #ff6b6b; animation: none; }
.qmap-ring { fill: none; stroke: #f76707; stroke-width: 3.5; animation: qmapPulse 0.9s ease-in-out infinite alternate; pointer-events: none; }
.qmap-pin-body { fill: #f76707; stroke: #fff; stroke-width: 2; }
.qmap-pin-dot { fill: #fff; }

/* 地圖題專用版面（v2.5.1 用戶回饋：地圖愈大愈好、按鈕縮細、iPad 可捲動） */
#view-quiz { -webkit-overflow-scrolling: touch; }
#quiz-qbox.qbox-map { flex: none; justify-content: flex-start; padding: 20px 24px; }
#quiz-qbox.qbox-map #quiz-question { margin-bottom: 6px; }
#quiz-qbox.qbox-map #quiz-visual { max-width: 940px; margin: 0 auto; }
#quiz-qbox.qbox-map.qbox-tap #quiz-visual { max-width: none; }
#quiz-qbox.qbox-map #quiz-options { grid-template-columns: repeat(4, 1fr); gap: 8px; }
#quiz-qbox.qbox-map .opt-btn { min-height: 58px; font-size: 19px; padding: 8px 6px; border-radius: 12px; border-width: 2px; }
#quiz-qbox.qbox-map .opt-sub { font-size: 12px; }
#quiz-qbox.qbox-map #quiz-feedback { margin: 6px 0 2px; min-height: 24px; }

/* 世界之最（FR-15） */
#view-records { position: absolute; inset: 0 0 76px 0; display: flex; flex-direction: column; }
#records-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px 18px 10px; flex: none; }
#records-title { text-align: center; margin: 0; font-size: 42px; font-weight: 900; letter-spacing: 3px; color: #fff; text-shadow: 0 3px 0 #17385f66; }
#btn-records-back { justify-self: start; }
#btn-records {
  position: absolute; top: 22px; right: 22px; z-index: 20;
  font-family: inherit; font-size: 23px; font-weight: 900; color: #17385f;
  background: #ffd93b; border: 3px solid #fff; border-radius: 999px;
  padding: 12px 26px; cursor: pointer; box-shadow: 0 8px 20px #0b2c5c66;
}
#btn-records:active { transform: translateY(2px); }
#records-side {
  width: 264px; flex: none; background: #fff8dc; border-radius: 24px;
  box-shadow: 0 14px 34px #0b2c5c4d; padding: 16px;
  display: flex; flex-direction: column; min-height: 0;
}
#records-side h2 { margin: 2px 0 6px; font-size: 22px; font-weight: 900; }
#records-list { overflow-y: auto; flex: 1; min-height: 110px; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #d9c98a transparent; }
.rec-group { font-size: 15px; font-weight: 900; color: #8a6d1a; margin: 12px 0 6px; }
.rec-item {
  display: flex; flex-direction: row; align-items: center; gap: 8px; height: 35px; flex: none;
  width: 100%; text-align: left; background: #fff; border: none;
  border-radius: 14px; padding: 8px 10px; margin-bottom: 0; cursor: pointer; font-family: inherit;
  box-shadow: 0 2px 0 #00000014;
}
.rec-item.on { background: #fff4e6; }
.rec-item-title { font-size: 17px; font-weight: 900; color: var(--ink); flex: 1; min-width: 0; }
.rec-item-holder { font-size: 13px; font-weight: 700; color: #7a8db0; text-align: right; }
#records-list .rec-item { margin-bottom: 8px; }
#records-list .rec-group { margin: 10px 2px 5px; }
#rec-head { display: flex; gap: 10px; align-items: center; }
#rec-flag { width: 64px; height: 44px; object-fit: contain; background: #fff; border-radius: 6px; flex: none; }
#rec-title { margin: 0; font-size: 21px; font-weight: 900; color: var(--ink); }
#rec-holder { margin: 1px 0 0; font-size: 14px; font-weight: 700; color: #7a8db0; }
#rec-value { margin: 8px 0 4px; font-size: 19px; font-weight: 900; color: #d9480f; }
#rec-text { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink); }
.rec-country { stroke: #fff; stroke-width: 0.7; }
.rec-country.rec-champ { stroke: #c2410c; stroke-width: 1.8; }
.rec-pin-body { fill: #f76707; stroke: #fff; stroke-width: 2; }
.rec-pin-dot { fill: #fff; }
.qmap-dot { stroke: #fff; stroke-width: 1.6; }

#rec-photo { width: 100%; height: 180px; object-fit: cover; border-radius: 14px; display: block; margin-bottom: 4px; }
#rec-credit { margin: 0 0 6px; font-size: 11.5px; color: #9a8a5f; text-align: right; }

/* 世界之最測驗解說卡（FR-17） */
#quiz-explain { background: #fff8dc; border-radius: 16px; padding: 12px 16px; margin: 10px auto 0; max-width: 560px; text-align: left; box-shadow: 0 6px 18px #0b2c5c33; }
.qex-photo { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; display: block; }
.qex-credit { font-size: 11.5px; color: #9a8a5f; text-align: right; margin: 2px 0 0; }
.qex-flag { width: 64px; height: 44px; object-fit: contain; display: block; }
.qex-head { font-weight: 900; font-size: 18.5px; margin: 6px 0 2px; color: var(--ink); }
.qex-value { font-weight: 900; font-size: 16.5px; color: #d9480f; margin: 0 0 4px; }
.qex-text { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink); }

/* 香港之最（FR-18）：側欄卡片與圖釘標籤，規格同世界之最 */
#hkrec-photo, #hkpark-photo, #hkhist-photo-old, #hkhist-photo-now { width: 100%; height: 245px; object-fit: cover; border-radius: 14px; display: block; margin-bottom: 4px; }
#hkrec-head, #hkpark-head { font-weight: 900; font-size: 19px; margin: 4px 0 2px; color: var(--ink); }
#hkrec-value, #hkpark-value { font-weight: 900; font-size: 16.5px; color: #d9480f; margin: 0 0 4px; }
#hkrec-text, #hkpark-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink); }
.hk-rec-pin-label { font-size: 15.5px; font-weight: 900; fill: #d9480f; paint-order: stroke; stroke: #ffffff; stroke-width: 4px; }

#hkpark-see { font-size: 14.5px; color: #5b4a1e; margin: 2px 0; line-height: 1.45; }
.park-item { display: flex; align-items: baseline; gap: 8px; }
.park-item-name { flex: 1; text-align: left; font-size: 17px; font-weight: 900; color: var(--ink); }
.park-item-area { font-size: 13px; color: #8a6d1d; white-space: nowrap; }
.hk-park-label { font-size: 15px; font-weight: 700; fill: #14532d; paint-order: stroke; stroke: rgba(255, 255, 255, 0.88); stroke-width: 3.5px; pointer-events: none; }
.hk-park-label.sel { fill: #d9480f; font-size: 17px; }
/* 香港今昔（FR-21）：啡色水滴釘＋側欄今昔卡片 */
.hs-pin { cursor: pointer; }
.hs-pin-body { fill: #9c6644; stroke: #fff; stroke-width: 2; }
.hs-pin-halo { fill: none; stroke: #e8590c; stroke-width: 2.5; opacity: 0; pointer-events: none; }
.hs-pin.sel .hs-pin-body { fill: #e8590c; stroke: #fff; stroke-width: 2.5; }
.hs-pin.sel .hs-pin-halo { opacity: 1; animation: hsPulse 1.6s ease-in-out infinite; }
@keyframes hsPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.hs-label.sel { fill: #d9480f; }
.hs-pin-glyph { font-size: 12.5px; font-weight: 900; fill: #fff; pointer-events: none; }
.hs-label { font-weight: 700; fill: #6b4423; paint-order: stroke; stroke: rgba(255, 255, 255, 0.9); stroke-width: 3.5px; pointer-events: none; }
#hkhist-head { font-weight: 900; font-size: 19px; margin: 4px 0 2px; color: var(--ink); }
#hkhist-era { font-weight: 900; font-size: 15px; color: #9c6644; margin: 0 0 2px; }
.hist-cap { font-weight: 900; font-size: 14.5px; color: #6b4423; margin: 8px 0 4px; }
#cnlm-credit, #lm-credit, #hkrec-credit, #hkpark-credit,
#hkhist-credit-old, #hkhist-credit-now, #d-photo-credit { font-size: 11.5px; color: #9a8a5f; text-align: right; margin: 0 0 2px; }
#d-photo-credit { line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
#d-photo-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#hkhist-text { margin: 6px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink); }
#hkhist-nowtext { font-size: 14.5px; color: #5b4a1e; margin: 6px 0 0; line-height: 1.5; }
.hist-item { display: flex; align-items: baseline; gap: 8px; }
.hist-item-name { flex: 1; text-align: left; }
.hist-item-era { font-size: 13px; color: #9c6644; white-space: nowrap; }

path.park-boundary { cursor: pointer; }
.hist-item.on { border-color: #9c6644; background: #fdf3e7; }

/* 國旗家族（FR-22） */
#btn-families {
  position: absolute; top: 96px; right: 22px; z-index: 20;
  font-family: inherit; font-size: 23px; font-weight: 900; color: #17385f;
  background: #ffb35c; border: 3px solid #fff; border-radius: 999px;
  padding: 12px 26px; cursor: pointer; box-shadow: 0 8px 20px #0b2c5c66;
}
#btn-families:active { transform: translateY(2px); }
#view-families { position: absolute; inset: 0 0 76px 0; display: flex; flex-direction: column; }
#families-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px 18px 10px; flex: none; }
#families-title { text-align: center; margin: 0; font-size: 42px; font-weight: 900; letter-spacing: 3px; color: #fff; text-shadow: 0 3px 0 #17385f66; }
#btn-families-back { justify-self: start; }
#families-side { width: 264px; flex: none; background: #fff8dc; border-radius: 24px; box-shadow: 0 14px 34px #0b2c5c4d; padding: 16px; display: flex; flex-direction: column; min-height: 0; }
#families-side h2 { margin: 2px 0 6px; font-size: 22px; font-weight: 900; }
#families-list { overflow-y: auto; flex: 1; min-height: 110px; padding-right: 2px; display: grid; gap: 8px; align-content: start; scrollbar-width: thin; scrollbar-color: #d9c98a transparent; }
/* 側欄 item 橫屏通則（用戶 2026-11-14 定案，全站套用）：橫屏（舞台）與細屏流式下，所有 .rec-item 清單（世界之最／香港之最／郊野公園／國旗家族）一律疊行——副字在標題之下左對齊、高度自動，標題過長可見地摺行、絕不截斷；直屏維持單行 35px */
body:not(.fluid) .rec-item, body.fluid.compact .rec-item { flex-direction: column; align-items: flex-start; height: auto; gap: 2px; }
body:not(.fluid) .rec-item-title, body.fluid.compact .rec-item-title { flex: none; }
body:not(.fluid) .rec-item-holder, body.fluid.compact .rec-item-holder { text-align: left; }
/* 同一通則及於 .hk-item／.line-item（今昔長名、中國長地名等）：橫屏改高度自動（下限 35）＋可換行，單行 item 以 line-height 與色塊微調維持恰好 35px，絕不截斷 */
body:not(.fluid) .hk-item, body:not(.fluid) .line-item, body.fluid.compact .hk-item, body.fluid.compact .line-item { height: auto; min-height: 35px; flex-wrap: wrap; line-height: 1.12; }
body:not(.fluid) .hk-item .swatch, body.fluid.compact .hk-item .swatch { width: 19px; height: 19px; }
#fam-pairs h3 { font-size: 16.5px; font-weight: 900; color: #8a6d1a; margin: 12px 0 6px; }
#fam-pair-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.fam-pair-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; max-width: 100%; flex: 0 1 auto; white-space: nowrap; font-family: inherit; font-size: 12.5px; font-weight: 800; background: #fff; border: 2px solid #ead9a0; border-radius: 999px; padding: 4px 8px; cursor: pointer; color: var(--ink); }
.fam-pair-chip.on { border-color: #f76707; background: #fff4e6; }
.fam-stage { flex: 1; min-width: 0; overflow-y: auto; background: #ffffffd9; border-radius: 24px; box-shadow: 0 14px 34px #0b2c5c4d; padding: 20px 22px; }
#fam-name { margin: 0; font-size: 30px; font-weight: 900; color: var(--ink); }
#fam-hook { margin: 4px 0 14px; font-size: 16.5px; font-weight: 700; color: #7a8db0; }
#fam-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; }
#fam-wall.pair-mode { grid-template-columns: 1fr 1fr; }
.fam-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; background: #fff; border: 2px solid #dbe4f0; border-radius: 16px; padding: 12px 8px 10px; cursor: pointer; font-family: inherit; }
.fam-tile img { height: 76px; max-width: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 1px 4px #0003; }
.fam-tile.big img { height: 150px; }
.fam-tile-zh { font-size: 17px; font-weight: 900; color: var(--ink); }
.fam-tile-en { font-size: 12.5px; font-weight: 700; color: #7a8db0; }
.fam-tile-badge { position: absolute; top: 8px; right: 8px; background: #ffd93b; color: #17385f; font-size: 12.5px; font-weight: 900; border-radius: 999px; padding: 2px 8px; }
.fam-info { margin-top: 18px; background: #fff8dc; border: 2px solid #ead9a0; border-radius: 16px; padding: 12px 16px; }
.fam-info h3 { margin: 0 0 6px; font-size: 18px; font-weight: 900; color: #8a6d1a; }
.fam-info p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink); }
.fam-info ul { margin: 0; padding-left: 20px; font-size: 15.5px; line-height: 1.6; color: var(--ink); }

/* 純旗幟選項（家族測驗辨認／特徵題）：旗幟要夠大才看得清（用戶 v2.12.1 指示） */
#quiz-options.flag-opts .opt-btn { padding: 12px; min-height: 0; }
#quiz-options.flag-opts .opt-btn img { width: 100%; max-width: 320px; height: 150px; }

/* ---------- 縮放按鈕（P4） ---------- */
#quiz-visual { position: relative; }

/* ---------- 流式模式（P3）：直屏／手機／窄窗 ---------- */
body.fluid { height: 100dvh; overflow-y: auto; }
body.fluid #stage {
  position: relative; left: auto; top: auto; transform: none;
  width: 100%; height: auto; min-height: 100dvh;
  border-radius: 0; padding-bottom: calc(var(--navh, 76px) + 12px);
}
body.fluid #view-continent, body.fluid #view-records, body.fluid #view-families,
body.fluid #view-list, body.fluid #view-cn, body.fluid #view-cnprov,
body.fluid #view-quiz, body.fluid #view-hk { bottom: var(--navh, 76px); }
/* 直屏測驗頁（用戶 2026-11-14）：三大類卡等高（內容垂直置中）；分組卡改每行 3 張順排，橫屏不變 */
body.fluid #quiz-groups { display: grid; grid-template-columns: repeat(3, 1fr); align-items: stretch; align-content: center; }
body.fluid .quiz-group-card { justify-content: center; max-width: none; }
body.fluid .quiz-cards { grid-template-columns: repeat(3, 1fr); }
/* 直屏香港頁清單間距放寬（用戶 2026-11-14：對照橫屏觀感，item 分開些）：行距 43→49 */
body.fluid #hk-list { gap: 14px; }
body.fluid #view-home { position: relative; inset: auto; height: calc(100dvh - var(--navh, 76px) - 12px); }
body.fluid .continent-layout { flex-direction: column; }
body.fluid .map-wrap { flex: none; width: 100%; height: 54dvh; }
body.fluid .continent-layout aside { width: auto; max-height: none; overflow-y: auto; min-height: 0; }
body.fluid #small-list-card, body.fluid #cn-side-card, body.fluid #cnp-side-card, body.fluid #hk-side-card, body.fluid #records-side, body.fluid #families-side { width: auto; flex: 1; min-height: 0; }
body.fluid .fam-stage { flex: 1.94 1 0; min-height: 0; }
body.fluid #view-hk .map-wrap { flex: 2.2 1 0; height: auto; min-height: 0; }
body.fluid .hk-modes { gap: 8px; padding: 2px 0 8px; }
body.fluid .hk-mode-btn { font-size: 16.5px; padding: 8px 14px; border-width: 2px; white-space: nowrap; }
body.fluid #main-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  gap: 0; flex-wrap: wrap; height: auto; padding: 6px 4px; justify-content: space-evenly;
}
body.fluid .nav-btn { font-size: 17px; letter-spacing: 0; padding: 6px 6px 12px; }
@media (max-width: 599px) {
  body.fluid #stage { padding-bottom: calc(var(--navh, 76px) + 12px); }
  body.fluid #view-home { height: calc(100dvh - var(--navh, 76px) - 12px); }
  body.fluid .map-wrap { height: 46dvh; }
  body.fluid .hk-modes { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; }
  body.fluid .hk-mode-btn { flex: none; white-space: nowrap; }
  body.fluid #topbar, body.fluid #records-topbar, body.fluid #families-topbar,
  body.fluid #hk-topbar, body.fluid #cn-topbar, body.fluid #cnp-topbar {
    gap: 6px; padding: 10px 12px 6px;
  }
  body.fluid #topbar .pill-btn, body.fluid #records-topbar .pill-btn, body.fluid #families-topbar .pill-btn,
  body.fluid #hk-topbar .pill-btn, body.fluid #cn-topbar .pill-btn, body.fluid #cnp-topbar .pill-btn {
    white-space: nowrap; padding: 8px 10px; font-size: 18px;
  }
  body.fluid #page-title, body.fluid #records-title, body.fluid #families-title,
  body.fluid #hk-title, body.fluid #cn-title, body.fluid #cnp-title { font-size: 32px; letter-spacing: 1px; white-space: nowrap; }
  body.fluid #btn-cnp-back { padding: 8px 7px; font-size: 14px; }
  body.fluid .hk-modes { min-width: 0; }
  body.fluid #hkrec-photo, body.fluid #hkpark-photo, body.fluid #hkhist-photo-old, body.fluid #hkhist-photo-now { height: clamp(160px, 55vw, 220px); }
}
@media (max-width: 430px) {
  body.fluid #cn-title { font-size: 24px; }
}

/* G3-P4：七大洲及五大洋共用的視窗固定資訊卡。 */
body.home-info-open, body.custom-modal-open { overflow: hidden !important; overscroll-behavior: none; }
#home-info-dialog {
  width: min(640px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 18px 52px #09244766;
}
#home-info-dialog::backdrop { background: #082d54b8; }
.home-info-card {
  display: flex;
  flex-direction: column;
  max-height: inherit;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: inherit;
  background: #f4fbff;
}
.home-info-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px 12px;
  background: linear-gradient(135deg, #e4f7ff, #fff);
  border-bottom: 2px solid #d3ecfa;
}
#home-info-title { margin: 0; color: #123d70; font-size: 27px; line-height: 1.2; font-weight: 900; }
#home-info-name-en { display: block; margin-top: 3px; color: #52769b; font-size: 16px; font-weight: 800; }
.home-info-card__close {
  display: inline-grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid #d3e3ef;
  border-radius: 50%;
  background: #fff;
  color: #17385f;
  font: inherit;
  font-size: 21px;
  font-weight: 900;
  cursor: pointer;
}
.home-info-card__close:focus-visible,
#home-info-show-map:focus-visible,
#home-info-sources a:focus-visible { outline: 3px solid #f0c92f; outline-offset: 3px; }
.home-info-card__body { min-height: 0; overflow-y: auto; padding: 16px 22px 10px; overscroll-behavior: contain; }
#home-info-illustration {
  display: block;
  width: min(100%, 420px);
  height: clamp(112px, 24vh, 180px);
  margin: 0 auto 12px;
  object-fit: contain;
}
/* Keep intro punctuation on the same regular Huninn face weight as the facts list. */
#home-info-intro { margin: 0 0 12px; color: #17385f; font-size: 18px; line-height: 1.6; font-weight: 400; }
.home-info-card__body h3 { margin: 12px 0 5px; color: #8a6d1a; font-size: 16px; font-weight: 900; }
.home-info-card__section-title { margin-top: 0 !important; }
.home-info-card__stats { margin: 12px 0 15px; padding: 11px 13px; border: 1px solid #cde5f4; border-radius: 14px; background: #eaf7ff; }
.home-info-card__stats h3 { margin: 0 0 7px; }
#home-info-stats-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.home-info-card__stat { min-width: 0; padding: 8px 10px; border-radius: 10px; background: #fff; }
.home-info-card__stat dt { color: #52769b; font-size: 13px; font-weight: 800; }
.home-info-card__stat dd { margin: 2px 0 0; color: #17385f; font-size: 16px; line-height: 1.35; font-weight: 900; }
#home-info-stats-note { margin: 7px 1px 0; color: #52708d; font-size: 12px; line-height: 1.45; }
#home-info-facts, #home-info-sources { margin: 0; padding-left: 23px; color: #23476d; font-size: 16px; line-height: 1.55; }
#home-info-facts li + li, #home-info-sources li + li { margin-top: 5px; }
.home-info-card__sources { margin-top: 13px; padding-top: 8px; border-top: 1px solid #d7e8f2; }
#home-info-sources { font-size: 13px; overflow-wrap: anywhere; }
#home-info-sources a { color: #1a5c91; text-underline-offset: 2px; }
.home-info-card__footer { display: flex; justify-content: center; padding: 10px 20px 16px; border-top: 1px solid #d7e8f2; background: #f4fbff; }
#home-info-show-map { width: min(100%, 420px); min-height: 58px; padding: 12px 30px; border: 2px solid #fff; border-radius: 999px; background: #ffd93b; color: #17385f; font: inherit; font-size: 20px; font-weight: 900; box-shadow: 0 3px 8px #17385f2b; cursor: pointer; }
.home-ocean-hit-target { cursor: pointer; }
#home-ocean-info-hit-layer .home-ocean-hit-target:focus,
#antarctica-hover-target:focus { outline: none; }
.home-layout-label.home-keyboard-focus {
  filter: drop-shadow(0 0 7px #ffd93b) drop-shadow(0 0 2px #17385f);
}
@media (max-width: 600px) {
  #home-info-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
    border-radius: 19px;
  }
  .home-info-card { border-width: 3px; }
  .home-info-card__header { padding: 10px 14px 10px; }
  #home-info-title { font-size: 23px; }
  #home-info-name-en { font-size: 14px; }
  .home-info-card__body { padding: 12px 16px 8px; }
  #home-info-illustration { height: clamp(96px, 19vh, 142px); margin-bottom: 8px; }
  #home-info-intro { font-size: 16.5px; }
  #home-info-stats-list { grid-template-columns: 1fr; gap: 5px; }
  .home-info-card__stat { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); align-items: baseline; gap: 6px; }
  .home-info-card__stat dd { margin: 0; font-size: 15px; }
  #home-info-facts { font-size: 15px; }
  .home-info-card__footer { padding: 8px 14px 12px; }
}
