/* 語音導覽頁（/voice/shop/、/voice/customer/）：仿影片播放器（voice-player.js）＋章節與文字稿 */
.voice { padding: 28px 0 72px; }
.voice-wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 14px; padding: 0; list-style: none; font-size: .9rem; color: var(--muted-ink); }
.crumbs li + li::before { content: '›'; margin-right: 10px; color: var(--tan-line); }
.crumbs a { color: var(--green-deep); font-weight: 700; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ── 播放器外框 ── */
.vp { position: relative; margin-inline: auto; color: #fff; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.vp-screen { position: relative; overflow: hidden; border-radius: 18px; background: #1f2925; box-shadow: 0 24px 60px rgba(40, 50, 45, .28); }
.vp[data-format="landscape"] .vp-screen { width: 100%; aspect-ratio: 16 / 9; }
/* 直式：寬度跟著螢幕寬度（扣掉左右留白），高度依 9:16。不看螢幕高度：Safari 網址列伸縮只改變高度，寬度固定播放器就不會跳動；
   以前限制高度在 82svh 時，16:9 的矮手機（iPhone 6s Plus）播放器只剩約 280px 寬，控制列右側的 CC、畫質、全螢幕鈕被切掉。
   代價是矮手機上播放器比可見範圍高，訪客往下捲即可看到控制列 */
.vp[data-format="portrait"] .vp-screen { width: 100%; aspect-ratio: 9 / 16; }
.vp.is-fs { display: grid; place-items: center; width: 100%; height: 100%; background: #000; }
.vp.is-fs .vp-screen { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; background: #000; }
.vp-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.vp-hit { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.vp.is-idle, .vp.is-idle .vp-hit { cursor: none; }
.vp button { font: inherit; color: inherit; }
.vp svg { fill: currentColor; stroke: none; }

/* 載入中 */
.vp-spinner { position: absolute; left: 50%; top: 50%; z-index: 2; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .25); border-top-color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; animation: vp-spin .8s linear infinite; }
.vp.is-loading .vp-spinner { opacity: 1; transition-delay: .25s; }
@keyframes vp-spin { to { transform: rotate(360deg); } }

/* 中央大播放鈕（未開始、暫停、結束） */
.vp-big {
    position: absolute; left: 50%; top: 50%; z-index: 3; width: 88px; height: 88px; margin: -44px 0 0 -44px; border: 0; border-radius: 50%;
    display: grid; place-items: center; background: rgba(180, 89, 57, .92); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); cursor: pointer;
    transition: transform .2s, opacity .2s, visibility .2s;
}
.vp-big svg { width: 40px; height: 40px; margin-left: 5px; }
.vp-big:hover { transform: scale(1.08); }
.vp.is-playing .vp-big, .vp.is-loading .vp-big, .vp.is-ended .vp-big { opacity: 0; visibility: hidden; }

/* 「點擊開啟聲音」 */
.vp-unmute {
    position: absolute; right: 16px; top: 16px; z-index: 4; display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 18px 10px 14px; border: 0; border-radius: 999px; background: rgba(28, 36, 32, .82); box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    font-weight: 900; font-size: 1rem; letter-spacing: .04em; cursor: pointer; animation: vp-nudge 2.4s ease-in-out 1s infinite;
}
.vp-unmute svg { width: 22px; height: 22px; }
.vp-unmute:hover { background: rgba(180, 89, 57, .95); animation: none; }
.vp-unmute[hidden] { display: none; }
.vp-unmute.is-wait { animation: none; cursor: default; }   /* 旁白下載中：圖示換成小載入圈 */
.vp-unmute.is-wait:hover { background: rgba(28, 36, 32, .82); }
.vp-unmute.is-wait svg { display: none; }
.vp-pct { font-variant-numeric: tabular-nums; }   /* 百分比變動時膠囊寬度不跳動 */
.vp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }   /* 只給讀屏的播報區 */
.vp-unmute.is-wait::before { content: ''; width: 16px; height: 16px; margin: 0 3px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: vp-spin .8s linear infinite; }
@keyframes vp-nudge { 0%, 70%, 100% { transform: none; } 80% { transform: scale(1.06); } 90% { transform: scale(.98); } }

/* 結束畫面 */
.vp-end { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(25, 34, 30, .72); text-align: center; padding: 16px; }
.vp-end[hidden] { display: none; }
.vp-replay { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; border: 2px solid rgba(255, 255, 255, .8); border-radius: 999px; background: none; font-weight: 900; cursor: pointer; }
.vp-replay svg { width: 22px; height: 22px; }
.vp-replay:hover { background: rgba(255, 255, 255, .14); }
.vp-next { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 999px; background: var(--orange-btn); color: #fff; font-weight: 900; text-decoration: none; }
.vp-next:hover { background: var(--orange-btn-dark); }

/* ── 下載目前的影片（進度畫面的樣式在 video-download.css）：輸出中只留畫面和進度，頁面上的段落、單元選單不能點 ── */
.vdl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.vdl[hidden] { display: none; }
.vdl-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--green-deep); color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.vdl-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vdl-btn:hover { background: #33564a; }
.vdl-btn:disabled { opacity: .55; cursor: default; }
.vdl-desc { font-size: .9rem; color: var(--muted-ink); }
.vdl-msg { flex-basis: 100%; margin: 0; font-size: .9rem; line-height: 1.6; color: var(--orange-ink); }
.vp.is-exporting .vp-ui, .vp.is-exporting .vp-big, .vp.is-exporting .vp-unmute, .vp.is-exporting .vp-end, .vp.is-exporting .vp-spinner { display: none; }
.vp.is-exporting .vp-hit { cursor: default; }
.vp-exporting .vep, .vp-exporting .voice-cols { opacity: .5; pointer-events: none; }

/* ── 控制列 ── */
.vp-ui {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 26px 14px 8px;
    background: linear-gradient(transparent, rgba(15, 20, 18, .72)); transition: opacity .3s, visibility .3s;
}
.vp.is-idle .vp-ui { opacity: 0; visibility: hidden; }
.vp-row { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.vp-row button {
    display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 10px;
    background: none; cursor: pointer; opacity: .92;
}
.vp-row button:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.vp-row button svg { width: 26px; height: 26px; }
.vp-row button[hidden] { display: none; }
.vp .i-pause, .vp.is-playing .i-play, .vp .i-sound, .vp.is-muted .i-sound { display: none; }
.vp.is-playing .i-pause, .vp:not(.is-muted) .i-sound, .vp.is-muted .i-muted { display: block; }
.vp:not(.is-muted) .i-muted { display: none; }
.vp .i-fs-exit, .vp.is-fs .i-fs, .vp.is-float .i-fs { display: none; }
.vp.is-fs .i-fs-exit, .vp.is-float .i-fs-exit { display: block; }

/* 懸浮模式（不支援 Fullscreen API 的瀏覽器，如 iPhone，voice-player.js）：畫面固定在視窗中央，大小與位置由程式依可用空間設定；
   深色底的 padding 就是四周留白（12px＋安全區域），點深色底不退出。不用 inset（iOS 14.5 以前不支援） */
.vp-float-bg {
    position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 99; background: rgba(15, 20, 18, .97);
    padding: calc(12px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
}
.vp-float-bg[hidden] { display: none; }
.vp.is-float .vp-screen { position: fixed; z-index: 100; margin: 0; aspect-ratio: auto; }
/* 懸浮時圓角縮小、控制列離右邊與底邊遠一點：手機版控制列只離邊 6px／4px，右下角的全螢幕（退出）鈕會被 18px 圓角切到 */
.vp.is-float .vp-screen { border-radius: 10px; }
.vp.is-float .vp-ui { padding-right: 12px; padding-bottom: 8px; padding-left: 12px; }
html.vp-float-open, html.vp-float-open body { overflow: hidden; }
.vp-vol { display: flex; align-items: center; }
.vp-volume { width: 0; opacity: 0; margin: 0; accent-color: var(--orange); transition: width .25s, opacity .25s, margin .25s; }
.vp-vol:hover .vp-volume, .vp-volume:focus-visible { width: 76px; opacity: 1; margin: 0 8px 0 2px; }
@media (hover: none) { .vp-volume { display: none; } }   /* 觸控裝置用實體音量鍵（iOS 不允許網頁調音量） */
.vp-time { padding: 0 8px; font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vp-chap { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; opacity: .85; }
.vp-chap::before { content: '・'; opacity: .6; }
.vp-cc { font-weight: 900 !important; font-size: .82rem !important; letter-spacing: .04em; }
.vp-cc span { padding: 2px 5px; border: 2px solid currentColor; border-radius: 5px; }
.vp-cc[aria-pressed="false"] { opacity: .55 !important; }
.vp-cc[aria-pressed="true"] span { background: #fff; color: #1f2925; border-color: #fff; }

/* 畫質（齒輪鈕＋選單）：4K／純語音（voice-player.js） */
.vp-qbtn { position: relative; }
.vp-qbadge { position: absolute; right: 1px; top: 5px; padding: 0 3px; border-radius: 3px; background: var(--orange-btn); color: #fff; font-size: .58rem; font-weight: 900; line-height: 1.35; letter-spacing: 0; pointer-events: none; }
.vp-qbtn[aria-expanded="true"] svg { transform: rotate(30deg); }
.vp-qbtn svg { transition: transform .25s; }
.vp-qmenu { position: absolute; right: 12px; bottom: 100%; z-index: 6; min-width: 150px; margin-bottom: 4px; padding: 6px; border-radius: 12px; background: rgba(20, 27, 24, .94); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.vp-qmenu[hidden] { display: none; }
.vp-qtitle { margin: 2px 8px 6px; font-size: .78rem; font-weight: 700; opacity: .7; }
.vp-qmenu button, .vpf-qmenu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px;
    background: none; font-weight: 700; font-size: .95rem; text-align: left; cursor: pointer;
}
.vp-qmenu button::before, .vpf-qmenu button::before { content: ''; width: 1em; text-align: center; }
.vp-qmenu button[aria-checked="true"]::before, .vpf-qmenu button[aria-checked="true"]::before { content: '✓'; }
.vp-qmenu button:hover, .vp-qmenu button:focus-visible { background: rgba(255, 255, 255, .14); outline: none; }
.vp.is-idle .vp-qmenu { display: none; }

/* 進度條（每段一節） */
.vp-progress { position: relative; height: 18px; margin: 0 6px 2px; cursor: pointer; touch-action: none; }
.vp-progress:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; border-radius: 4px; }
.vp-seg { position: absolute; top: 7px; height: 4px; padding-right: 3px; background-clip: content-box; transition: top .15s, height .15s; }
.vp-seg::before { content: ''; position: absolute; left: 0; right: 3px; top: 0; bottom: 0; border-radius: 2px; background: rgba(255, 255, 255, .32); }
.vp-seg i { position: absolute; left: 0; right: 3px; top: 0; bottom: 0; border-radius: 2px; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }
.vp-progress:hover .vp-seg, .vp.is-scrubbing .vp-seg { top: 6px; height: 6px; }
.vp-knob { position: absolute; top: 9px; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); transform: scale(0); transition: transform .15s; pointer-events: none; }
.vp-progress:hover .vp-knob, .vp-progress:focus-visible .vp-knob, .vp.is-scrubbing .vp-knob { transform: none; }
.vp-tip { position: absolute; bottom: 24px; transform: translateX(-50%);   /* 不用 translate 獨立屬性（Chrome 104 以前不支援） */ padding: 6px 10px; border-radius: 8px; background: rgba(15, 20, 18, .88); font-size: .8rem; line-height: 1.35; white-space: nowrap; text-align: center; opacity: 0; pointer-events: none; transition: opacity .15s; }
.vp-tip b { display: block; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .vp-progress:hover .vp-tip { opacity: 1; } }
.vp.is-scrubbing .vp-tip { opacity: 1; }

/* 畫面較小（手機直式 9:16 畫面寬約 350px）：控制列精簡 */
@media (max-width: 600px) {
    .vp-ui { padding: 22px 6px 4px; }
    .vp-row button { width: 40px; height: 40px; }
    .vp-row button svg { width: 24px; height: 24px; }
    .vp-chap { display: none; }
    .vp-time { margin-right: auto; }
    .vp-unmute { right: 10px; top: 10px; padding: 8px 14px 8px 12px; font-size: .92rem; }
}

/* ── 影片下方：標題、說明、章節、文字稿 ── */
.voice-info { margin-top: 22px; }
.voice-info h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 900; line-height: 1.3; color: var(--green-deep); }
.voice-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 10px; font-size: .92rem; color: var(--muted-ink); }
.voice-meta span + span::before { content: '・'; margin-right: 14px; opacity: .6; margin-left: -14px; }
.voice-desc { max-width: 760px; }
.voice-other { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 18px; border-radius: 999px; background: var(--green-soft); color: var(--green-deep); font-weight: 900; text-decoration: none; }
.voice-other:hover { background: #d8e6d9; }
.voice-other svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; }
/* 使用教學頁：看總集或挑單元（sync-voice.py 產生清單，voice-player.js 頁內切換、?ep= 直達單集） */
.vm-ep { font-weight: 900; color: var(--orange-ink); }
.vep { margin-top: 26px; }
.vep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.vep-head h2 { margin: 0 auto 0 0; }
.vep-copy { padding: 7px 16px; border: 1.5px solid var(--tan-line); border-radius: 999px; background: #fff; color: var(--green-deep); font: inherit; font-size: .9rem; font-weight: 900; cursor: pointer; }
.vep-copy:hover { background: var(--green-soft); }
.vep-copy[hidden] { display: none; }
.vep-copied { font-size: .88rem; font-weight: 700; color: var(--green-deep); }
.vep-copied:empty { display: none; }
.vep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.vep-list a {
    display: grid; grid-template-columns: 3.2em 1fr auto; align-items: baseline; gap: 8px; height: 100%; padding: 10px 12px; border-radius: 10px;
    color: var(--ink); font-weight: 700; text-decoration: none;
}
.vep-list a:hover { background: var(--green-soft); }
.vep-list a[aria-current] { background: #fdebe2; color: var(--orange-ink); }
.vep-no { font-weight: 900; color: var(--orange-ink); }
.vep-dur { font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--muted-ink); }
.vep-tip { margin-top: 10px; font-size: .85rem; color: var(--muted-ink); }
.voice-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; margin-top: 30px; align-items: start; }
@media (max-width: 860px) { .voice-cols { grid-template-columns: 1fr; } }
.voice-box { padding: 20px 22px; border: 1.5px solid var(--tan-line); border-radius: var(--radius); background: var(--paper); }
.voice-box h2 { margin-bottom: 12px; font-size: 1.15rem; font-weight: 900; color: var(--green-deep); }
.vchapters { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; counter-reset: ch; }
.vchapters button {
    display: grid; grid-template-columns: 3.4em 1fr; align-items: baseline; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
    background: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer;
}
.vchapters button:hover { background: var(--green-soft); }
.vchapters button[aria-current] { background: #fdebe2; color: var(--orange-ink); }
.vc-time { font-variant-numeric: tabular-nums; color: var(--orange-ink); font-weight: 900; }
.vtranscript summary { cursor: pointer; font-size: 1.15rem; font-weight: 900; color: var(--green-deep); }
.vtranscript[open] summary { margin-bottom: 8px; }
.vtranscript section + section { margin-top: 14px; }
.vtranscript h3 { display: flex; gap: 10px; align-items: baseline; font-size: 1rem; font-weight: 900; color: var(--ink-strong); }
.vtranscript h3 span { font-variant-numeric: tabular-nums; font-size: .88rem; color: var(--orange-ink); }
.vtranscript p { margin-top: 4px; line-height: 1.8; }
.voice-note { margin-top: 18px; font-size: .85rem; color: var(--muted-ink); }

/* ── 純語音播放器（voice-fallback.js，舊瀏覽器跑不動影片播放器時）：插圖＋目前這一句＋內建播放列
   只用舊瀏覽器也支援的寫法（不用 aspect-ratio、min()、inset 等），在 Firefox 68 也能正常排版 ── */
.vp.vp-fallback { color: var(--ink); user-select: auto; -webkit-user-select: auto; }
.vpf[hidden] { display: none; }
.vpf-head { position: relative; display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; margin: 0 0 10px; padding: 8px 8px 8px 14px; border-radius: 10px; background: #fdebe2; }
.vpf-note { -webkit-flex: 1; flex: 1; margin: 0; color: var(--orange-ink); font-size: .95rem; font-weight: 700; }
/* 畫質選單（只在使用者自己選純語音時出現，voice-fallback.js） */
.vpf-q { position: relative; }
.vpf-q[hidden] { display: none; }
.vp .vpf-qbtn { padding: 5px 12px; border: 1.5px solid var(--tan-line); border-radius: 999px; background: #fff; color: var(--green-deep); font-size: .88rem; font-weight: 900; cursor: pointer; }
.vpf-qmenu { position: absolute; right: 0; top: 100%; z-index: 6; min-width: 140px; margin-top: 6px; padding: 6px; border: 1.5px solid var(--tan-line); border-radius: 12px; background: #fff; box-shadow: 0 10px 26px rgba(40, 50, 45, .18); }
.vpf-qmenu[hidden] { display: none; }
.vp .vpf-qmenu button { color: var(--ink); }
.vpf-qmenu button:hover, .vpf-qmenu button:focus { background: var(--green-soft); outline: none; }
.vpf-art { position: relative; overflow: hidden; border-radius: 18px; background: var(--paper); box-shadow: 0 16px 40px rgba(40, 50, 45, .18); }
.vpf-art img { display: block; width: 100%; height: auto; max-height: 56vh; object-fit: cover; }
.vp .vpf-start {   /* 加 .vp 才蓋得過 .vp button 的 color: inherit */
    position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
    padding: 14px 28px; border: 0; border-radius: 999px; background: var(--orange-btn); color: #fff;
    font-size: 1.1rem; font-weight: 900; cursor: pointer; box-shadow: 0 8px 22px rgba(180, 89, 57, .4); white-space: nowrap;
}
.vp .vpf-start[hidden] { display: none; }
/* 字幕框固定高度（電腦 2 行、手機 3 行），換句時下方播放列不跳動；高度用 rem，縮小字級時框不變。
   上下內距 12px×2＋框線 1.5px×2＝27px。一句超出時 voice-fallback.js 加 .is-long 縮小該句字級 */
.vpf-cap {
    display: -webkit-box; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center;
    height: calc(3.45rem + 27px); overflow: hidden;   /* 2 行 × 1.15rem × 行高 1.5 */
    margin: 12px 0; padding: 12px 16px; border: 1.5px solid var(--tan-line); border-radius: 14px;
    background: #fbefdd; color: var(--green-deep); font-size: 1.15rem; font-weight: 700; line-height: 1.5; text-align: center;
}
.vpf-cap.is-long { font-size: .95rem; }
@media (max-width: 560px) {
    .vpf-cap { height: calc(4.725rem + 27px); font-size: 1.05rem; }   /* 3 行 × 1.05rem × 1.5 */
    .vpf-cap.is-long { font-size: .9rem; }
    .vpf-art img { margin: -.7875rem 0; }   /* 插圖上下各裁半行，共少一行字幕高（1.05rem × 1.5） */
}
.vpf-audio { display: block; width: 100%; }
