/* 文資地圖集 — 樣式
   配色、字型、深色模式沿用文資知識網站（Cultural_Heritage/assets/css/site.css）的變數。 */
:root {
  --paper: #f6f1e7; --paper-2: #efe7d8; --card: #fffdf8; --ink: #2b2521; --muted: #6c6058; --line: #e0d5c3;
  --hinoki: #a8714a; --hinoki-2: #d9b48f; --peach: #df6f57; --peach-ink: #fff7f4; --mint: #cfe8dd; --mint-2: #9ccdb8;
  --sun: #f2b632; --teal: #1d6f73; --teal-ink: #effafa; --good: #2f7d4f; --bad: #b8452f;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 8px 24px rgba(60, 40, 20, .10);
  --shadow-lg: 0 2px 6px rgba(60, 40, 20, .10), 0 18px 48px rgba(60, 40, 20, .18);
  --f-display: "LXGW WenKai TC", "Kaiti TC", "BiauKai", "DFKai-SB", serif;
  --f-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --r: 14px; --hdr: 56px;
  --gl: max(16px, env(safe-area-inset-left, 0px)); --gr: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17130f; --paper-2: #1e1914; --card: #241e18; --ink: #efe6da; --muted: #b5a797; --line: #3a3128;
    --hinoki: #d6a27a; --hinoki-2: #6e4f37; --peach: #f08b74; --peach-ink: #2a0f08; --mint: #24453a; --mint-2: #3d6f5d;
    --teal: #6cc4c4; --teal-ink: #082222; --good: #6fcf97; --bad: #f08a72;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 18px 48px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.3; margin: 0; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: var(--gl); padding-right: var(--gr); }
.muted { color: var(--muted); }

/* ---------- 頂端列 ---------- */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--hdr); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 14px; padding: 0 var(--gr) 0 var(--gl); }
.brand { flex: none; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--f-display); font-size: 1.15rem; font-weight: 700; white-space: nowrap; }
.brand img { border-radius: 8px; }
.brand small { font-size: .78rem; color: var(--muted); font-weight: 400; margin-left: 8px; font-family: var(--f-body); }
.layer-tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; }
.layer-tabs a { flex: none; font-size: .9rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; }
.layer-tabs a[aria-current="page"] { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
.top-links { flex: none; display: flex; gap: 14px; font-size: .9rem; margin-left: auto; }
.top-links a { text-decoration: none; white-space: nowrap; }
.top-links a:hover { text-decoration: underline; }
/* 回文資知識網站的按鈕，手機上也保留 */
.top-links { align-items: center; }
.top-links a.home-link { color: var(--teal); border: 1.5px solid var(--teal); border-radius: 999px; font-weight: 700; padding: 3px 12px; }
.top-links a.home-link:hover, .top-links a.home-link:focus-visible { background: var(--teal); color: var(--paper); text-decoration: none; }

/* ---------- 地圖舞台 ---------- */
.stage { height: calc(100vh - var(--hdr)); height: calc(100dvh - var(--hdr)); display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.mapbox { position: relative; min-height: 0; background: var(--paper-2); }
#map { position: absolute; inset: 0; }
.maplibregl-map { font-family: var(--f-body); }
.maplibregl-ctrl-attrib { font-size: 11px; }
.map-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); z-index: 5; background: var(--paper-2); }
.jump { position: absolute; top: 10px; right: 52px; z-index: 3; }
.jump select { font-size: .85rem; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }

/* 圖例（同時是計數器） */
.legend-slot { position: absolute; top: 10px; left: 10px; z-index: 3; max-width: min(250px, calc(100% - 20px)); }
.legend { background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font-size: .85rem; max-height: calc(100dvh - var(--hdr) - 250px); overflow: auto; }
.legend > summary { cursor: pointer; padding: 7px 12px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.legend > summary::-webkit-details-marker { display: none; }
.legend > summary::after { content: "▾"; color: var(--muted); }
.legend:not([open]) > summary::after { content: "▸"; }
.legend > summary b { font-family: var(--f-display); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.legend-body { padding: 0 12px 10px; }
.lg-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 7px; align-items: center; line-height: 1.75; }
.lg-row i { width: 11px; height: 11px; border-radius: 50%; background: var(--c); display: block; }
.lg-row i.ring { background: transparent; border: 2px solid var(--muted); }
.lg-row span.n { font-variant-numeric: tabular-nums; color: var(--muted); }
.lg-row.off { opacity: .42; }
.lg-check { display: flex; gap: 7px; align-items: center; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); cursor: pointer; }
.lg-check input { accent-color: var(--teal); width: 15px; height: 15px; }
.lg-counties { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.lg-counties > summary { cursor: pointer; color: var(--teal); }
.cty { display: grid; grid-template-columns: 4.6em 1fr 2.6em; gap: 6px; align-items: center; font-size: .78rem; line-height: 1.55; }
.cty .bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.cty .bar i { display: block; height: 100%; background: var(--peach); border-radius: 4px; }
.cty span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* 文資卡片 */
.card { position: absolute; z-index: 4; right: 10px; top: 50px; width: min(340px, calc(100% - 20px)); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 14px 16px 16px; border-top: 5px solid var(--c, var(--hinoki)); }
.card h3 { font-size: 1.25rem; padding-right: 28px; }
.card .eyebrow { font-size: .8rem; color: var(--hinoki); font-weight: 700; }
.card .yt { margin-top: 6px; font-size: .92rem; }
.card .sum { margin-top: 6px; color: var(--muted); font-size: .92rem; }
.card .meta { margin-top: 6px; font-size: .8rem; color: var(--muted); }
.card .badge { display: inline-block; font-size: .72rem; padding: 0 7px; border-radius: 999px; border: 1px solid var(--hinoki); color: var(--hinoki); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.card .x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; font-size: 1.2rem; color: var(--muted); }
.card .x:hover { background: var(--paper-2); }
.btn { display: inline-block; margin-top: 12px; padding: 7px 16px; border-radius: 999px; background: var(--teal); color: var(--teal-ink); text-decoration: none; font-weight: 700; font-size: .92rem; border: 0; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }

/* ---------- 下方控制面板（時間軸） ---------- */
.panel { background: var(--card); border-top: 1px solid var(--line); padding: 10px var(--gr) max(10px, env(safe-area-inset-bottom, 0px)) var(--gl); box-shadow: 0 -4px 18px rgba(60,40,20,.08); position: relative; z-index: 6; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); flex: none; }
.seg button { border: 0; background: transparent; padding: 4px 14px; cursor: pointer; font-size: .9rem; }
.seg button[aria-pressed="true"] { background: var(--peach); color: #fff; font-weight: 700; }
.tl-now { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tl-now small { font-family: var(--f-body); font-size: .85rem; font-weight: 700; margin-left: 8px; padding: 1px 10px; border-radius: 999px; color: #fff; background: var(--c, var(--hinoki)); vertical-align: 3px; }
.tl-count { font-size: .88rem; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.tl-count b { color: var(--ink); font-size: 1.05rem; }
.tl-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; margin-top: 8px; }
.tl-play { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--teal); color: var(--teal-ink); cursor: pointer; font-size: 1.1rem; display: grid; place-items: center; }
.tl-play:hover { filter: brightness(1.1); }
.tl-speed { font-size: .85rem; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); margin-top: 8px; }
.tl-track { position: relative; height: 46px; }
.tl-track canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 6px; }
.tl-track input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.tl-track input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 100%; }
.tl-track input[type=range]::-moz-range-track { background: transparent; height: 100%; }
.tl-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 46px; border-radius: 7px; background: var(--ink); border: 3px solid var(--card); box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.tl-track input[type=range]::-moz-range-thumb { width: 9px; height: 40px; border-radius: 7px; background: var(--ink); border: 3px solid var(--card); box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.tl-marks { position: relative; height: 20px; margin: 0 7px; }
.tl-marks button { position: absolute; top: 0; transform: translateX(-50%); width: 20px; height: 20px; padding: 0; border: 0; background: transparent; cursor: pointer; color: var(--peach); font-size: .8rem; line-height: 20px; }
.tl-marks button.on { color: var(--ink); }
.tl-ticks { position: relative; height: 18px; margin: 0 7px; font-size: .72rem; color: var(--muted); }
.tl-ticks span { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); }
.tl-ticks span.l { transform: none; }
.tl-cap { margin-top: 4px; font-size: .9rem; min-height: 3.1em; line-height: 1.55; }
.tl-cap b { color: var(--hinoki); }

/* ---------- 說明與頁尾 ---------- */
.about { padding-top: 34px; padding-bottom: 34px; }
.about h2 { font-size: 1.5rem; margin-bottom: 12px; }
.about h3 { font-size: 1.1rem; margin: 20px 0 6px; }
.about ul { margin: 0; padding-left: 1.3em; }
.about li { margin: 4px 0; }
.about .note { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--sun); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.about p.muted { margin-top: 14px; font-size: .88rem; }
.foot { border-top: 1px solid var(--line); background: var(--paper-2); font-size: .85rem; color: var(--muted); padding: 18px 0 calc(18px + env(safe-area-inset-bottom, 0px)); }
.foot .wrap { display: flex; flex-direction: column; gap: 4px; }

/* ---------- 手機 ---------- */
@media (max-width: 720px) {
  .brand small, .top-links a[target] { display: none; }
  .topbar-inner { gap: 8px; }
  .tl-now { font-size: 1.25rem; }
  .tl-count { margin-left: 0; width: 100%; order: 5; }
  .tl-row { gap: 8px; }
  .tl-speed { display: none; }
  .tl-cap { font-size: .84rem; min-height: 4.6em; }
  .legend { font-size: .8rem; max-height: calc(100dvh - var(--hdr) - 330px); }
  .card { top: auto; bottom: 8px; right: 8px; left: 8px; width: auto; max-height: 70%; overflow: auto; }
  .jump { right: 48px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- 圖層：它挺過了什麼 ---------- */
.sv-tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--bad); color: var(--bad); white-space: nowrap; }
.sv-pick { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 220px; }
.sv-pick select { flex: 1; min-width: 0; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font-size: .9rem; }
.sv-pick button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: 1.1rem; line-height: 1; flex: none; }
.sv-cap { min-height: 4.7em; margin-top: 8px; }
.sv-method { color: var(--muted); }
.sv-epi { font-size: 26px; line-height: 1; color: #111; text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 0 2px #fff; pointer-events: none; }
.sv-box { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: var(--paper); border: 1px dashed var(--line); font-size: .88rem; line-height: 1.6; }
.sv-box .sv-tag { margin-bottom: 4px; }
.sv-box ul { list-style: none; margin: 6px 0 0; padding: 0; }
.sv-box li i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.sv-sm { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.card { max-height: calc(100% - 60px); overflow: auto; }
@media (max-width: 720px) { .sv-cap { min-height: 6.2em; } .tl-head .sv-tag { order: 6; } }

/* ---------- 圖層：文資風險地圖 ---------- */
.rk-seg { flex-wrap: wrap; border-radius: 16px; }
.rk-seg button { padding: 4px 11px; }
.rk-scen { font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.rk-scen select { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); }
.sv-box ul.rk-list { list-style: disc; padding-left: 1.2em; }
.rk-list li { margin: 3px 0; }

/* ---------- 圖層：3D 文資島 ---------- */
.is-more { font-size: .88rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.is-more:hover { text-decoration: underline; }
.is-acts { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 8px; }
.is-acts button { font-size: .85rem; min-width: 36px; min-height: 32px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; white-space: nowrap; }
.is-acts .is-main { font-weight: 700; border-color: var(--teal); color: var(--teal); background: var(--card); }
.is-acts button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
.is-cam { margin-left: auto; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.is-cap { margin-top: 6px; min-height: 0; }
.is-cap .sv-method { display: block; font-size: .82rem; }
.is-tiers { display: flex; gap: 10px; align-items: flex-end; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: .76rem; color: var(--muted); line-height: 1.3; }
.is-tiers > span { align-self: center; font-weight: 700; }
.is-tiers div { display: flex; gap: 4px; align-items: flex-end; min-width: 0; }
.is-tiers i { flex: none; width: 5px; border-radius: 2px 2px 0 0; background: var(--hinoki); }
/* 地名：地形上不放底圖文字，用細字標縣市與高山；拉近後隱藏 */
.is-lab { font-family: var(--f-display); font-size: .95rem; color: #5b4a38; letter-spacing: .2em; text-shadow: 0 0 3px rgba(246,241,231,.95), 0 0 8px rgba(246,241,231,.8); pointer-events: none; white-space: nowrap; }
.is-lab.peak { font-family: var(--f-body); font-size: .72rem; letter-spacing: .05em; color: #6e5a46; }
.is-lab.peak::before { content: "▲ "; font-size: .6rem; }
.is-near .is-lab { display: none; }
.is-year { position: absolute; z-index: 4; top: 10px; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; color: var(--ink); text-shadow: 0 0 6px var(--paper), 0 0 14px var(--paper); max-width: calc(100% - 20px); }
.is-year b { display: block; font-family: var(--f-display); font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.is-year span { display: inline-block; margin-top: 4px; padding: 0 12px; border-radius: 999px; background: var(--c); color: #fff; font-weight: 700; font-size: .9rem; text-shadow: none; }
.is-year small { display: block; margin-top: 4px; font-size: .85rem; font-weight: 700; }
.is-tour { position: absolute; z-index: 5; left: 10px; bottom: 34px; width: min(380px, calc(100% - 20px)); background: color-mix(in srgb, var(--card) 96%, transparent); border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 12px 14px; font-size: .92rem; line-height: 1.65; }
.is-tour h3 { font-size: 1.2rem; margin: 2px 0 4px; }
.is-tour-k { font-size: .78rem; color: var(--muted); font-weight: 700; }
.is-tour p b { color: var(--hinoki); }
.is-tour-nav { display: flex; gap: 8px; margin-top: 10px; }
.is-tour-nav button { flex: 1; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: .88rem; }
.is-tour-nav button.go { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); font-weight: 700; }
.is-tour-nav button:disabled { opacity: .4; cursor: default; }
.is-toast { position: absolute; z-index: 7; left: 50%; bottom: 14px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 20px); background: var(--ink); color: var(--paper); border-radius: 12px; padding: 9px 14px; font-size: .9rem; box-shadow: var(--shadow-lg); }
.is-toast button { margin-left: 8px; padding: 2px 12px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; font-size: .85rem; }
@media (prefers-color-scheme: dark) {
  .is-lab { color: #e4d6c3; text-shadow: 0 0 3px rgba(15,21,27,.95), 0 0 8px rgba(15,21,27,.8); }
  .is-lab.peak { color: #cdbda8; }
}
@media (max-width: 720px) {
  .is-cap { font-size: .82rem; }
  .is-cap .sv-method { display: none; }
  .is-cam { margin-left: 0; width: 100%; }
  .is-acts button { min-height: 38px; }
  .is-acts .is-main { flex: 1 1 40%; }
  .is-cam button { flex: 1 1 auto; padding: 3px 8px; }
  .is-cam button[data-cam="left"], .is-cam button[data-cam="right"] { flex: 0 0 44px; }
  .is-more { font-size: .82rem; }
  .is-lab { font-size: .8rem; letter-spacing: .1em; }
  .is-year b { font-size: 2.2rem; }
  .is-year small { font-size: .78rem; }
  .is-tour h3 { font-size: 1.05rem; margin: 0 0 2px; }
  .is-tour-nav { margin-top: 8px; }
  .is-tour-nav button { min-height: 38px; }
  .is-intro, .is-cap { display: none; }        /* 手機：說明文字放「資料說明」，面板只留操作，地圖區才夠高 */
}

/* 3D 文資島：海拔 */
.is-lv { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; font-size: .88rem; }
.is-lv input { flex: 1; min-width: 160px; accent-color: var(--teal); }
.is-lv b { font-variant-numeric: tabular-nums; }
.is-dist { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.is-db { display: grid; grid-template-columns: 5.6em 1fr 2.8em; column-gap: 6px; align-items: center; font-size: .74rem; line-height: 1.25; margin-top: 3px; }
.is-db span { grid-row: span 2; color: var(--muted); }
.is-db i { display: block; height: 7px; border-radius: 3px; min-width: 2px; }
.is-db i.land { background: var(--line); }
.is-db b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.is-db b.land { font-weight: 400; color: var(--muted); }
.is-top { margin: 4px 0 0; padding-left: 1.4em; font-size: .78rem; line-height: 1.5; }
.is-top button { border: 0; background: none; padding: 0; color: var(--teal); cursor: pointer; text-align: left; font-size: inherit; }
.is-q { margin-left: 4px; font-size: .68rem; padding: 0 5px; border-radius: 999px; border: 1px solid var(--bad); color: var(--bad); white-space: nowrap; }
@media (max-width: 720px) { /* 手機：頂端列分兩行，站名與連結一行、圖層分頁一行 */
  :root { --hdr: 94px; }
  .topbar-inner { flex-wrap: wrap; align-content: center; gap: 4px 8px; }
  .layer-tabs { order: 3; flex: 1 0 100%; }
}

/* 3D 文資島：旁白（Allan × 阿拉蕾）。對話都放在下方面板，不蓋住地圖 */
.panel.is-touring > :not(.is-tour) { display: none; }
.panel .is-tour { position: static; width: auto; max-width: 980px; box-shadow: none; border: 0; border-left: 4px solid var(--teal); border-radius: 8px; background: transparent; padding: 0 0 0 12px; font-size: .9rem; line-height: 1.6; }
.panel:has(#isGrowSay:not([hidden])) .is-cap { display: none; }   /* 播放時對話取代說明文字，面板高度不跳動 */
.panel #isGrowSay { margin-top: 8px; max-width: 980px; }
.is-say { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.is-say img { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--paper-2); border: 2px solid var(--line); }
.is-say[data-who="A"] img { border-color: var(--teal); }
.is-say[data-who="R"] img { border-color: var(--peach); }
.is-say p { background: var(--paper); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 6px 10px; font-size: .9rem; line-height: 1.6; }
.is-say p b { display: block; font-size: .72rem; color: var(--muted); }
.is-tour .is-fact { font-size: .86rem; color: var(--muted); }
.is-tour-nav .is-voice, .is-cam .is-voice { flex: 0 0 auto; min-width: 40px; }
.is-invite { position: absolute; z-index: 5; left: 10px; bottom: 34px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); background: color-mix(in srgb, var(--card) 96%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: 5px 6px 5px 6px; box-shadow: var(--shadow-lg); font-size: .88rem; }
.is-invite img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--paper-2); }
.is-invite img + img { margin-left: -14px; }
.is-invite p { line-height: 1.35; }
.is-invite p b { display: block; }
.is-invite .go { white-space: nowrap; border: 0; border-radius: 999px; background: var(--teal); color: var(--teal-ink); font-weight: 700; padding: 7px 14px; cursor: pointer; }
.is-invite .x { border: 0; background: none; color: var(--muted); font-size: 1.2rem; width: 30px; height: 30px; cursor: pointer; }
@media (max-width: 720px) {
  .panel .is-tour.talking .is-fact { display: none; }     /* 手機：講話時只看字幕，事實文字在不講話時顯示 */
  .is-say p { font-size: .86rem; }
  .panel .is-tour { font-size: .86rem; padding-left: 10px; }
  .is-invite { left: 8px; right: 8px; bottom: 8px; border-radius: 16px; font-size: .82rem; }
}

/* 平面分頁的「Allan 和阿拉蕾說故事」（assets/js/story.js；卡片與對話沿用 3D 文資島的 .is-tour、.is-say） */
.st-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 2px 13px 2px 4px; border-radius: 999px; border: 1px solid var(--teal); background: var(--card); color: var(--teal); font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.st-btn img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--paper-2); }
.st-btn img + img { margin-left: -11px; }
.st-btn[aria-pressed="true"] { background: var(--teal); color: var(--teal-ink); }
.tl-count + .st-btn { margin-left: 0; }
.sv-tag + .st-btn { margin-left: auto; }
@media (max-width: 720px) {
  .tl-head .st-btn { order: 7; }
  .tl-head .tl-count + .st-btn { order: 4; margin-left: auto; }
}
