/* ============================================================
   智慧中華歷史互動系統 — 夜間文物館美學
   墨底 · 鎏金 · 朱砂印 · 宣紙米白 ｜ SEN：大字 · 大掣 · 高對比
   兩個版面：手機版（直向，含 LED 直立）／網頁版（橫向）
   對話頁＝「直播間」：人物影片是主體，其他全部浮在上面
   ============================================================ */
:root {
  --ink: #14110c;
  --ink-2: #1d1812;
  --ink-3: #262017;
  --gold: #c9a45c;
  --gold-hi: #e9c87e;
  --cinnabar: #b5432e;
  --cinnabar-hi: #d05a42;
  --paper: #f2e9d8;
  --paper-dim: #bdb098;
  --bronze: #6d8a74;
  --line: rgba(201, 164, 92, .28);
  --glass: rgba(20, 17, 12, .66);
  --glass-strong: rgba(20, 17, 12, .86);
  --font-display: "Noto Serif TC", serif;
  --font-body: "Noto Sans TC", sans-serif;
  --z-stage: 1; --z-overlay: 10; --z-bar: 20; --z-backdrop: 30; --z-sheet: 40;
  --bar-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(201, 164, 92, .10), transparent 60%),
    radial-gradient(900px 600px at 85% 110%, rgba(181, 67, 46, .07), transparent 55%),
    var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
  min-height: 100vh;
  touch-action: manipulation;
}
::selection { background: var(--cinnabar); color: #fff; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; border-radius: 6px; }
svg.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* 觸控展示機：圖片不可長按另存／拖曳，按鈕文字不可反白 */
.live-media, .host-avatar, .car-slide img, .portrait-frame img { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; }
.live-bar, .chip, .choice-btn, .mode-seg, .icon-btn, .car-arrow, .car-cta { user-select: none; -webkit-touch-callout: none; }

/* ---------- 頂欄（非沉浸頁） ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 24px;
  background: linear-gradient(180deg, rgba(20, 17, 12, .97), rgba(20, 17, 12, .9));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.brand-seal {
  width: 40px; height: 40px; flex: none;
  background: var(--cinnabar); color: #fff;
  font-family: var(--font-display); font-weight: 900; font-size: 22px;
  display: grid; place-items: center; border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 4px 14px rgba(181, 67, 46, .35);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: .06em; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--paper-dim); letter-spacing: .18em; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-link {
  padding: 10px 16px; min-height: 44px; display: grid; place-items: center;
  border-radius: 8px; font-size: 16px; color: var(--paper-dim);
  border: 1px solid transparent; transition: color .2s, background .2s, border-color .2s; white-space: nowrap;
}
.nav-link:hover { color: var(--gold-hi); }
.nav-link.active { color: var(--gold-hi); border-color: var(--line); background: rgba(201, 164, 92, .08); }
.fs-btn {
  min-height: 44px; padding: 8px 14px; border-radius: 8px;
  background: none; border: 1px solid var(--line); color: var(--paper-dim); font-size: 15px; display: flex; align-items: center; gap: 6px;
}
.fs-btn:hover { color: var(--gold-hi); border-color: var(--gold); }
body.immersive .topbar { display: none; }
body.immersive { overflow: hidden; overscroll-behavior: none; }
body.immersive #app { max-width: none; padding: 0; }

#app { max-width: 1280px; margin: 0 auto; padding: 30px 24px 80px; }

/* ---------- 進場動畫 ---------- */
.reveal { opacity: 0; transform: translateY(18px); animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: var(--d, 0ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; opacity: 1; transform: none; } * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* ---------- 首頁 ---------- */
.hero { text-align: center; padding: 28px 0 26px; position: relative; }
.hero-title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(30px, 5vw, 58px); letter-spacing: .08em;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 10px; font-size: 18px; color: var(--paper-dim); }
.hero-badges { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.badge { padding: 6px 14px; border-radius: 999px; font-size: 14px; border: 1px solid var(--line); color: var(--gold); background: rgba(201, 164, 92, .06); letter-spacing: .04em; }

/* 網頁版：人物卡牆 */
.card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; margin-top: 12px; }   /* 170px：闊屏一行六位人物（2026-09-19 加蘇軾） */
.person-card {
  background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
  display: flex; flex-direction: column; cursor: pointer;
}
.person-card:hover { border-color: var(--gold); box-shadow: 0 18px 44px rgba(0, 0, 0, .5), 0 0 0 1px rgba(201, 164, 92, .25); }
.portrait-frame { aspect-ratio: 3/4; overflow: hidden; border-bottom: 1px solid var(--line); background: #0d0b08; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 15%; transition: transform .5s; }
.person-card:hover .portrait-frame img { transform: scale(1.04); }
.person-card-body { padding: 14px 18px 18px; }
.person-field { font-size: 14px; color: var(--bronze); letter-spacing: .06em; }
.person-name { font-family: var(--font-display); font-weight: 900; font-size: 30px; color: var(--gold-hi); line-height: 1.3; }
.person-title { font-size: 15px; color: var(--paper); }
.person-years { font-size: 13px; color: var(--paper-dim); margin-top: 4px; }
.talk-cta { margin-top: 12px; font-size: 16px; color: var(--cinnabar-hi); font-weight: 700; }

/* 手機版：左右掃換人物 */
.carousel { display: none; position: relative; margin: 0 -16px; }
.car-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.car-track::-webkit-scrollbar { display: none; }
.car-slide { flex: 0 0 100%; scroll-snap-align: center; position: relative; height: min(72dvh, 720px); min-height: 440px; overflow: hidden; cursor: pointer; }
.car-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }
.car-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 120px 22px 26px;
  background: linear-gradient(180deg, transparent, rgba(20, 17, 12, .55) 40%, rgba(20, 17, 12, .96));
}
.car-caption .person-name { font-size: 42px; }
.car-caption .person-title { font-size: 17px; }
.car-caption .person-years { font-size: 14px; }
.car-cta {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 0 24px; border-radius: 999px;
  background: var(--gold); color: #221b0e; font-weight: 700; font-size: 18px;
}
.car-arrow {
  position: absolute; top: 40%; width: 52px; height: 52px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--line); color: var(--gold-hi);
  display: grid; place-items: center; z-index: 2;
}
.car-arrow.left { left: 10px; } .car-arrow.right { right: 10px; }
.car-dots { display: flex; justify-content: center; gap: 8px; padding: 14px 0 4px; }
.car-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(242, 233, 216, .25); transition: background .2s, width .2s; }
.car-dots i.on { background: var(--gold-hi); width: 22px; border-radius: 4px; }
.car-hint { text-align: center; font-size: 14px; color: var(--paper-dim); }

/* 好問題牆 */
.gq-wall { margin-top: 36px; border: 1px solid var(--line); border-radius: 14px; background: rgba(201, 164, 92, .04); padding: 18px 0 20px; overflow: hidden; }
.gq-wall-head { display: flex; align-items: baseline; gap: 12px; padding: 0 22px 12px; flex-wrap: wrap; }
.seal-mini { width: 34px; height: 34px; border-radius: 6px; background: var(--cinnabar); color: #fff; font-family: var(--font-display); font-weight: 900; display: grid; place-items: center; align-self: center; }
.gq-wall-head h2 { font-family: var(--font-display); font-size: 22px; color: var(--gold-hi); letter-spacing: .1em; }
.gq-hint { font-size: 14px; color: var(--paper-dim); }
.gq-track { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.gq-strip { display: flex; gap: 16px; width: max-content; animation: scroll 46s linear infinite; padding: 0 16px; }
.gq-track:hover .gq-strip { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }
/* 首頁「可配合的撥款」：沿用好問題牆的卡片外框 */
.grant-band { margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; background: rgba(201, 164, 92, .04); padding: 18px 22px 20px; }
.grant-band .gq-wall-head { padding: 0 0 14px; }
.grant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.grant-card { border: 1px solid var(--line); border-radius: 12px; background: var(--glass); padding: 16px 18px; min-width: 0; }
.grant-kicker { font-size: 13px; letter-spacing: .12em; color: var(--bronze); margin-bottom: 6px; }
.grant-card h3 { font-family: var(--font-display); font-size: 18px; line-height: 1.45; color: var(--gold-hi); margin: 0 0 6px; }
.grant-meta { font-size: 14px; color: var(--gold); margin-bottom: 8px; }
.grant-card p { font-size: 15px; line-height: 1.7; color: var(--paper); margin: 0; }
.grant-cta { margin: 16px 0 0; font-size: 15px; line-height: 1.7; color: var(--paper-dim); }
.grant-cta a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.grant-cta a:hover { color: var(--gold-hi); }
.gq { flex: none; max-width: 380px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: 16px; }
.gq-person { color: var(--cinnabar-hi); font-weight: 700; margin-right: 6px; }
.gq-note { display: block; margin-top: 6px; font-size: 14px; color: var(--bronze); }

/* ---------- 通用視圖標題 ---------- */
.view-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 4vw, 44px); color: var(--gold-hi); letter-spacing: .08em; }
.view-sub { color: var(--paper-dim); margin-top: 8px; max-width: 720px; font-size: 18px; }
.tl-intro { padding: 8px 0 22px; }

/* ---------- 朝代時間軸 ---------- */
.tl-scroller { position: relative; overflow-x: auto; padding: 30px 4px 26px; scroll-snap-type: x proximity; }
.tl-axis { position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold) 8%, var(--gold) 92%, transparent); opacity: .5; }
.tl-track { display: flex; gap: 20px; width: max-content; padding: 0 8px; }
.tl-card {
  width: 300px; flex: none; scroll-snap-align: start;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
  border: 1px solid var(--line); border-radius: 14px; position: relative;
  transition: border-color .25s;
}
.tl-card::before { content: ""; position: absolute; top: -19px; left: 26px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.tl-card.open, .tl-card:hover { border-color: var(--gold); }
.tl-head { padding: 20px 22px 16px; cursor: pointer; min-height: 64px; }
.tl-name { font-family: var(--font-display); font-weight: 900; font-size: 34px; color: var(--gold-hi); line-height: 1.2; }
.tl-years { font-size: 13px; color: var(--paper-dim); margin-top: 2px; }
.tl-tag { font-size: 16px; color: var(--paper); margin-top: 8px; }
.tl-head::after { content: "展開 ▾"; display: block; margin-top: 10px; font-size: 14px; color: var(--bronze); }
.tl-card.open .tl-head::after { content: "收起 ▴"; }
.tl-detail { display: none; padding: 0 22px 20px; border-top: 1px dashed var(--line); }
.tl-card.open .tl-detail { display: block; }
.tl-detail dl div { margin-top: 12px; }
.tl-detail dt { color: var(--cinnabar-hi); font-weight: 700; font-size: 15px; letter-spacing: .12em; }
.tl-detail dd { font-size: 15.5px; color: var(--paper); }
.tl-people { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tl-person { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 6px; font-size: 15px; background: rgba(201, 164, 92, .07); min-height: 44px; }
.tl-person img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.tl-person:hover { border-color: var(--gold); color: var(--gold-hi); }
.tl-noppl { font-size: 13.5px; color: var(--paper-dim); }
.listen-btn {
  margin-top: 10px; min-height: 44px; padding: 6px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(201, 164, 92, .08); color: var(--gold); font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
}
.listen-btn:hover { border-color: var(--gold); color: var(--gold-hi); }

/* ============================================================
   直播間（人物對話頁 ＋ 故事模式）
   手機版：影片鋪滿全屏，簡介左上、工具右上、對話浮在下方
   網頁版：三欄 ［簡介｜影片（最大）｜對話］
   ============================================================ */
.live { position: fixed; inset: 0; background: #0b0907; overflow: hidden; color: var(--paper); }
.live-bg {
  position: absolute; inset: -40px; z-index: 0; background-size: cover; background-position: center 20%;
  filter: blur(34px) brightness(.32) saturate(.9); transform: scale(1.06);
}
.live-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 9, 7, .35), rgba(11, 9, 7, .55)); }
.live-stage { position: absolute; z-index: var(--z-stage); overflow: hidden; background: #0b0907; }
.live-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.live-video { opacity: 0; transition: opacity .12s linear; pointer-events: none; }
.live-stage.talking .live-video.ready { opacity: 1; }
.stage-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; box-shadow: 0 0 0 2px var(--gold) inset, 0 0 46px rgba(201, 164, 92, .42) inset; z-index: 2; }
.live-stage.talking .stage-glow { opacity: 1; animation: pulse 1.6s ease-in-out infinite; }
/* 思考中過場（2026-09-23）：提問後到開口之間，舞台下方顯示「某某思考中」＋三點跳動，金框慢速呼吸 */
.stage-think { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; border-radius: 999px; background: rgba(20, 17, 12, .74); border: 1px solid rgba(201, 164, 92, .5); color: var(--paper);
  font-size: clamp(17px, 1.8vw, 26px); white-space: nowrap; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.stage-think[hidden] { display: none; }
.think-dots { display: inline-flex; gap: 7px; }
.think-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: thinkDot 1.2s ease-in-out infinite; }
.think-dots i:nth-child(2) { animation-delay: .2s; }
.think-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes thinkDot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-8px); opacity: 1; } }
.live-stage.thinking .stage-glow { opacity: .6; animation: pulse 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .think-dots i { animation: none; opacity: .8; } .live-stage.thinking .stage-glow { animation: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px var(--gold-hi) inset, 0 0 70px rgba(233, 200, 126, .55) inset; } }

/* 自動播放被擋：點一下開始 */
.tap-start {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 26px; border-radius: 999px;
  background: var(--gold); color: #221b0e; font-weight: 700; font-size: 20px; border: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: pulse-gold 1.6s ease-in-out infinite;
}
@keyframes pulse-gold { 50% { box-shadow: 0 0 0 14px rgba(201, 164, 92, .18); } }
body.shot .tap-start { display: none !important; }

/* 影像遮罩（標書：內建圖案；正式版可自訂上載） */
.live[data-mask="arch"] .live-stage { clip-path: inset(0 round 46% 46% 0 0 / 30% 30% 0 0); }
.live[data-mask="scroll"] .live-stage { clip-path: inset(2% 3% round 18px); }
.live[data-mask="fan"] .live-stage { clip-path: ellipse(50% 50% at 50% 50%); }
.live[data-mask="arch"] .live-stage, .live[data-mask="scroll"] .live-stage, .live[data-mask="fan"] .live-stage { background: transparent; }

/* 安全模式：只准點選批核問題 */
.live.safe .bar-form, .live.safe .bar-mic { display: none; }
.live.safe .bar-btn { flex: 1; justify-content: center; }
.live.safe .bar-btn span { display: inline !important; }

/* 放大檢視 */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; cursor: zoom-out; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.lightbox-cap { font-family: var(--font-display); font-size: 22px; color: var(--gold-hi); text-align: center; }
.lightbox-cap span { display: block; font-family: var(--font-body); font-size: 14px; color: var(--paper-dim); margin-top: 4px; }
.host-avatar-btn { background: none; border: none; padding: 0; border-radius: 50%; cursor: zoom-in; flex: none; display: block; }

/* 簡介卡（左上） */
.host-card {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 8px 8px; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(201, 164, 92, .25);
  max-width: 100%;
}
.host-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: center 12%; border: 2px solid var(--gold); flex: none; }
.host-meta { min-width: 0; line-height: 1.3; }
.host-name { font-family: var(--font-display); font-weight: 900; font-size: 24px; color: var(--gold-hi); display: flex; align-items: center; gap: 8px; }
.host-sub { font-size: 13.5px; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host-sub2 { font-size: 12.5px; color: var(--paper-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host-live {
  font-family: var(--font-body); font-weight: 500; font-size: 12px; color: #fff; letter-spacing: .04em; white-space: nowrap; flex: none;
  padding: 2px 9px; border-radius: 999px; background: var(--cinnabar); display: none; align-items: center; gap: 5px;
}
.host-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
.live-stage.talking ~ .live-side .host-live, .live.talking .host-live { display: inline-flex; }
@keyframes blink { 50% { opacity: .35; } }
.icon-btn {
  width: 48px; height: 48px; flex: none; border-radius: 50%;
  background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(201, 164, 92, .25);
  color: var(--paper); display: grid; place-items: center; transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--gold-hi); border-color: var(--gold); }
.live-back { margin-right: 2px; }

/* 右上工具：簡易／詳細 ＋ 全屏 */
.live-tools { display: flex; align-items: center; gap: 8px; }
.mode-seg { display: flex; border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(201, 164, 92, .25); padding: 3px; }
.mode-seg button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: none; background: none; color: var(--paper-dim); font-size: 15px; white-space: nowrap; transition: background .2s, color .2s; }
.mode-seg button.on { background: var(--gold); color: #221b0e; font-weight: 700; }
.sheet-mode { gap: 8px; flex-wrap: wrap; }                 /* 簡易／詳細與粵語／普通話並排（2026-09-23） */
.nav .lang-seg { align-self: center; }

/* 對話區 */
.bubbles { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.bubbles > :first-child { margin-top: auto; }   /* 對話由下而上堆疊（直播公屏感），仍可向上捲動 */
.bubble { max-width: 92%; padding: 12px 16px; border-radius: 16px; font-size: 18px; line-height: 1.6; position: relative; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.bubble.me { align-self: flex-end; background: rgba(181, 67, 46, .92); color: #fff; border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: var(--glass); border: 1px solid rgba(201, 164, 92, .3); border-bottom-left-radius: 5px; }
.bubble.them-thinking { align-self: flex-start; background: var(--glass); color: var(--paper-dim); font-size: 16px; animation: blink 1.2s infinite; }
.bubble.is-thinking .bubble-text { color: var(--paper-dim); animation: blink 1.2s infinite; }
.bubble.is-thinking .listen-btn { display: none; }
.bubble .listen-btn { margin-top: 8px; min-height: 36px; padding: 4px 12px; font-size: 14px; }
.src-tag { position: absolute; top: -9px; right: 12px; font-size: 11.5px; padding: 1px 9px; border-radius: 999px; background: var(--ink-3); border: 1px solid var(--line); color: var(--gold); }

/* 底部操作列：問題抽屜 ＋ 打字 ＋ 按住說話 */
.live-bar { display: flex; align-items: center; gap: 8px; }
.bar-btn, .bar-mic {
  min-height: 56px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(201, 164, 92, .35); color: var(--paper); font-size: 16px; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s;
}
.bar-btn:hover, .bar-mic:hover { border-color: var(--gold); color: var(--gold-hi); }
.bar-btn.on { background: var(--gold); color: #221b0e; border-color: var(--gold); }
.bar-form { flex: 1; min-width: 0; display: flex; align-items: center; background: var(--glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(201, 164, 92, .35); border-radius: 999px; padding-left: 6px; }
#askInput, #sceneInput { flex: 1; min-width: 0; min-height: 54px; padding: 0 6px 0 14px; font-size: 17px; font-family: inherit; color: var(--paper); background: none; border: none; outline: none; }
#askInput::placeholder, #sceneInput::placeholder { color: var(--paper-dim); }
#askInput:focus-visible, #sceneInput:focus-visible { outline: none; }
.bar-form:focus-within { border-color: var(--gold); }
.bar-send { width: 48px; height: 48px; flex: none; border-radius: 50%; border: none; background: var(--gold); color: #221b0e; display: grid; place-items: center; margin: 3px; }
.bar-send:hover { background: var(--gold-hi); }
.bar-mic.listening { background: var(--cinnabar); border-color: var(--cinnabar-hi); color: #fff; animation: pulse-red 1s infinite; }
@keyframes pulse-red { 50% { box-shadow: 0 0 0 8px rgba(181, 67, 46, .25); } }
.bar-mic:disabled { opacity: .5; }
.demo-hint { font-size: 14px; color: var(--paper-dim); min-height: 1.4em; padding: 0 6px; }

/* 問題抽屜（手機版由下方升起；網頁版置中浮層） */
.sheet-backdrop { position: absolute; inset: 0; z-index: var(--z-backdrop); background: rgba(0, 0, 0, .45); }
.sheet {
  position: absolute; z-index: var(--z-sheet);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(201, 164, 92, .35);
  display: flex; flex-direction: column; overflow: hidden;
  animation: sheet-up .22s cubic-bezier(.2, .7, .2, 1);
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.sheet-title { font-family: var(--font-display); font-size: 20px; color: var(--gold-hi); margin-right: auto; }
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 14px; overflow-y: auto; overscroll-behavior: contain; }
.chip {
  min-height: 64px; padding: 10px 14px; text-align: left;
  font-size: 17px; line-height: 1.4; color: var(--paper);
  background: rgba(38, 32, 23, .9);
  border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, color .2s;
}
.chip:hover { border-color: var(--gold); color: var(--gold-hi); }
.sheet-foot { padding: 8px 14px 12px; font-size: 13.5px; color: var(--paper-dim); border-top: 1px solid var(--line); }
.chip-lesson { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; border-color: var(--gold); color: var(--gold-hi); background: rgba(201, 164, 92, .12); font-weight: 700; }
.scene-bar { margin-top: 4px; }
/* 多對一：邀請另一位人物 */
.sheet-duo { padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.sheet-duo-title { font-size: 14px; color: var(--paper-dim); margin-bottom: 8px; }
.duo-row { display: flex; flex-wrap: wrap; gap: 8px; }
.duo-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 4px 14px 4px 5px; border-radius: 999px; border: 1px solid var(--line); background: rgba(38, 32, 23, .9); color: var(--paper); font-size: 15px; transition: border-color .2s, color .2s, background .2s; }
.duo-btn img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: center 12%; }
.duo-btn.on { border-color: var(--gold); color: var(--gold-hi); background: rgba(201, 164, 92, .14); }
.duo-btn:not(:has(img)) { padding-left: 14px; }
.guest-pill { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--gold-hi); }
.guest-pill img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; object-position: center 12%; border: 1px solid var(--gold); }
.guest-pill.now::after { content: "正在回答"; color: #fff; background: var(--cinnabar); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.pill-x { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--paper-dim); display: grid; place-items: center; }
.pill-x svg { width: 14px; height: 14px; }
.who-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #221b0e; background: var(--gold); border-radius: 999px; padding: 1px 10px 1px 2px; margin-bottom: 6px; }
.who-tag img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; object-position: center 12%; }

/* 故事模式：選項、進度、結尾卡 */
.choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }   /* 欄寬固定為容器寬：開放題操作列不會把整欄撐出畫面 */
.choice-btn {
  min-height: 64px; padding: 12px 18px; text-align: left;
  font-size: 18px; line-height: 1.4; color: var(--paper);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 164, 92, .35); border-radius: 14px; transition: border-color .2s, color .2s, opacity .2s;
}
.choice-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-hi); }
.choice-btn:disabled { opacity: .35; }
.choice-btn.next-btn { background: var(--gold); color: #221b0e; font-weight: 700; border-color: var(--gold); text-align: center; }
.choice-btn.next-btn:hover:not(:disabled) { background: var(--gold-hi); color: #221b0e; }
.chips-label { font-size: 15px; color: var(--paper-dim); padding: 0 4px; }
.story-progress { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.story-progress li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--paper-dim); background: var(--glass); border: 1px solid rgba(201, 164, 92, .2); border-radius: 999px; padding: 4px 10px 4px 4px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.story-progress li span { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; }
.story-progress li.done { color: var(--bronze); }
.story-progress li.done span { background: var(--bronze); color: #fff; border-color: var(--bronze); }
.story-progress li.now { color: var(--gold-hi); border-color: var(--gold); }
.story-progress li.now span { background: var(--gold); color: #221b0e; border-color: var(--gold); }
.story-kicker { font-size: 13px; color: var(--bronze); letter-spacing: .08em; }
.story-end { display: flex; flex-direction: column; gap: 10px; }
.story-end-head { font-family: var(--font-display); font-size: 20px; color: var(--gold-hi); }
.story-steps { margin: 0 0 0 22px; font-size: 17px; color: var(--paper); background: var(--glass); border: 1px solid rgba(201, 164, 92, .25); border-radius: 12px; padding: 12px 14px 12px 34px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.story-steps li { margin-top: 4px; }
.story-again { display: inline-block; font-size: 15px; color: var(--bronze); border-bottom: 1px dashed var(--bronze); }

/* ---------- 手機版（直向；LED 直立亦用此版） ---------- */
@media (orientation: portrait), (max-width: 759px) {
  .live-stage { inset: 0; }
  .live-bg { display: none; }
  .live-side-left { position: absolute; top: 12px; left: 12px; right: 72px; z-index: var(--z-overlay); display: flex; align-items: center; gap: 8px; }
  .live-tools { position: absolute; top: 12px; right: 12px; z-index: calc(var(--z-bar) + 1); }
  .live-tools .mode-seg { display: none; }          /* 手機版：簡易／詳細放在問題抽屜內 */
  .sheet-mode { display: block; }
  .live-panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: var(--z-bar);
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, rgba(11, 9, 7, .55) 45%, rgba(11, 9, 7, .82));
  }
  .bubbles { max-height: 42dvh; padding: 28px 2px 2px; mask-image: linear-gradient(180deg, transparent, #000 18%); }
  .bubble { font-size: 17px; padding: 10px 14px; }
  .bar-btn { padding: 0 14px; }
  @media (max-width: 480px) { .bar-btn span { display: none; } .bar-btn { width: 56px; padding: 0; justify-content: center; } }
  .sheet { left: 0; right: 0; bottom: 0; max-height: 72dvh; border-radius: 22px 22px 0 0; border-bottom: none; padding-bottom: env(safe-area-inset-bottom); }
  .sheet-head { flex-wrap: wrap; }
  .sheet-title { flex: 1 1 auto; white-space: nowrap; }
  .sheet-mode { order: 3; width: 100%; padding-top: 8px; }   /* 手機版：簡易／詳細另起一行，標題不折行 */
  .story-side { position: absolute; top: 12px; left: 12px; right: 64px; z-index: var(--z-overlay); display: flex; flex-direction: column; gap: 8px; }
  .story-side .host-card { border-radius: 18px; align-items: flex-start; padding: 10px 14px 10px 10px; }
  .story-side .host-name { font-size: 20px; line-height: 1.25; }
  .story-side .host-avatar { width: 44px; height: 44px; }
  .story-side .story-kicker { font-size: 12px; }
  .story-progress { display: none; }
  .story-end { max-height: 50dvh; overflow-y: auto; }
  .live-panel:has(.story-end:not([hidden])) .bubbles { max-height: 22dvh; }   /* 結尾卡出現時對話區讓位，人物不被整塊遮住 */
}

/* ---------- 網頁版（橫向） ---------- */
@media (orientation: landscape) and (min-width: 760px) {
  .live { display: grid; grid-template-columns: minmax(240px, 1fr) auto minmax(320px, 1.25fr); grid-template-rows: 100dvh; gap: 0; }
  .live-stage { position: relative; grid-column: 2; grid-row: 1; height: 100dvh; aspect-ratio: 9 / 16; box-shadow: 0 0 80px rgba(0, 0, 0, .6); }
  .live-side-left { grid-column: 1; grid-row: 1; z-index: var(--z-overlay); padding: 20px 16px 20px 22px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
  .host-card { border-radius: 18px; flex-direction: column; align-items: flex-start; padding: 18px 20px; gap: 10px; width: 100%; max-width: 360px; }
  .host-avatar { width: 72px; height: 72px; }
  .host-name { font-size: 34px; }
  .host-sub { font-size: 16px; white-space: normal; }
  .host-sub2 { font-size: 14.5px; white-space: normal; }
  .live-back { position: absolute; top: 20px; left: 22px; }
  .host-card { margin-top: 62px; }
  .live-tools { position: absolute; top: 20px; right: 22px; z-index: calc(var(--z-bar) + 1); }   /* 右欄對話面板全高（--z-bar），控制列要壓在其上才點得到；仍低於問題面板遮罩 */
  .sheet-mode { display: none; }                     /* 網頁版：簡易／詳細在右上角 */
  .live-panel {
    grid-column: 3; grid-row: 1; z-index: var(--z-bar); min-width: 0; min-height: 0;
    display: flex; flex-direction: column; gap: 10px;
    padding: 84px 24px 20px 20px;
  }
  .bubbles { flex: 1; min-height: 0; padding: 6px 4px; mask-image: linear-gradient(180deg, transparent, #000 6%); }
  .bubble { font-size: 19px; max-width: 94%; }
  .bar-btn span, .bar-mic span { display: inline; }
  .sheet { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, 92vw); max-height: 82dvh; border-radius: 18px; }
  .chips { grid-template-columns: repeat(3, 1fr); }
  .story-side { grid-column: 1; grid-row: 1; z-index: var(--z-overlay); padding: 96px 16px 20px 22px; display: flex; flex-direction: column; gap: 12px; }
  .story-side .host-card { margin-top: 0; }
  .story-progress { flex-direction: column; align-items: stretch; }
  .story-progress li { font-size: 15px; padding: 6px 12px 6px 6px; }
}

/* LED 直立（大屏）：手機版放大一級 */
@media (orientation: portrait) and (min-width: 900px) {
  body { font-size: 22px; }
  .topbar { padding: 14px 24px; }
  .brand-seal { width: 52px; height: 52px; font-size: 28px; }
  .brand-name { font-size: 26px; }
  .nav-link { font-size: 21px; min-height: 56px; }
  .fs-btn { min-height: 56px; }
  .hero-title { font-size: 64px; }
  .hero-sub { font-size: 22px; }
  .car-hint { font-size: 19px; }
  .gq { font-size: 20px; max-width: 480px; }
  .gq-wall-head h2 { font-size: 28px; }
  .host-avatar { width: 72px; height: 72px; }
  .host-name { font-size: 36px; }
  .host-sub { font-size: 19px; } .host-sub2 { font-size: 17px; }
  .icon-btn { width: 64px; height: 64px; }
  .mode-seg button { min-height: 52px; font-size: 20px; padding: 0 20px; }
  .bubbles { max-height: 40dvh; }
  .bubble { font-size: 26px; padding: 16px 22px; }
  .bar-btn, .bar-mic { min-height: 76px; font-size: 22px; padding: 0 24px; }
  #askInput, #sceneInput { min-height: 74px; font-size: 22px; }
  .bar-send { width: 64px; height: 64px; }
  .chip { min-height: 92px; font-size: 24px; }
  .sheet-title { font-size: 28px; }
  .choice-btn { min-height: 92px; font-size: 26px; }
  .story-steps { font-size: 22px; }
  .car-slide { height: min(70dvh, 1400px); }
  .car-caption .person-name { font-size: 64px; }
  .car-cta { min-height: 80px; font-size: 26px; }
}

/* ---------- 資訊素養館 ---------- */
.lit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.lit-card { background: linear-gradient(180deg, var(--ink-2), var(--ink-3)); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px; }
.lit-status { display: inline-block; font-size: 13px; color: var(--bronze); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; margin-bottom: 12px; }
.lit-card h3 { font-family: var(--font-display); font-size: 26px; color: var(--gold-hi); }
.lit-theme { color: var(--cinnabar-hi); font-size: 15px; margin: 4px 0 10px; }
.lit-card p { font-size: 16.5px; }
.lit-steps { margin: 14px 0 0 22px; font-size: 16px; color: var(--paper); }
.lit-steps li { margin-top: 6px; }
.lit-sen { margin-top: 16px; font-size: 14.5px; color: var(--bronze); border-top: 1px dashed var(--line); padding-top: 12px; }
.lit-guide { display: flex; align-items: center; gap: 12px; margin: 10px 0 12px; }
.lit-guide img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: top; border: 1px solid var(--line); }
.lit-guide b { color: var(--gold-hi); font-size: 17px; }
.lit-guide small { display: block; color: var(--paper-dim); font-size: 13px; }
.lit-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.lit-tag { font-size: 12.5px; color: var(--bronze); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.lit-start { display: inline-flex; align-items: center; margin-top: 16px; min-height: 56px; padding: 12px 26px; border-radius: 12px; background: var(--gold); color: #221b0e; font-weight: 700; font-size: 18px; }
.lit-start:hover { background: var(--gold-hi); }
.lit-scheme { margin-top: 30px; border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; background: rgba(201, 164, 92, .04); }
.lit-scheme h2 { font-family: var(--font-display); font-size: 22px; color: var(--gold-hi); }
.lit-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.lit-flow span { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-size: 15px; background: var(--ink-2); }
.lit-flow i { color: var(--bronze); font-style: normal; }
.lit-note { margin-top: 12px; font-size: 14.5px; color: var(--paper-dim); }

/* ---------- 管理介面 ---------- */
.admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.adm-panel { background: linear-gradient(180deg, var(--ink-2), var(--ink-3)); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; overflow-x: auto; }
.adm-panel h3 { font-family: var(--font-display); font-size: 22px; color: var(--gold-hi); margin-bottom: 12px; }
.adm-sub { font-size: 15px; color: var(--paper-dim); margin-bottom: 10px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.adm-table th, .adm-table td { padding: 10px 10px; text-align: left; border-bottom: 1px solid rgba(201, 164, 92, .14); }
.adm-table th { color: var(--paper-dim); font-weight: 500; font-size: 13.5px; }
.adm-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.adm-ok { color: var(--bronze); font-size: 14px; border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }
.adm-btn { min-height: 40px; padding: 4px 16px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--paper-dim); }
.adm-note { margin-top: 14px; font-size: 14px; color: var(--paper-dim); }
.adm-col { display: grid; gap: 22px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(201, 164, 92, .14); cursor: pointer; }
.set-row span { font-size: 16px; }
.set-row small { display: block; font-size: 13px; color: var(--paper-dim); }
.set-row select { min-height: 44px; padding: 6px 12px; font-size: 15px; font-family: inherit; color: var(--paper); background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; }
.set-row input[type="checkbox"] { width: 26px; height: 26px; accent-color: var(--gold); flex: none; }
.bar-row { margin-top: 12px; }
.bar-q { font-size: 15px; }
.bar { position: relative; height: 30px; margin-top: 5px; background: rgba(201, 164, 92, .08); border-radius: 6px; overflow: hidden; display: flex; align-items: center; }
.bar i { position: absolute; inset: 0; width: var(--w); background: linear-gradient(90deg, var(--gold), var(--gold-hi)); border-radius: 6px; }
.bar b { position: relative; margin-left: auto; padding-right: 10px; font-size: 13px; color: var(--paper); }

/* ---------- 非沉浸頁的手機版排版 ---------- */
@media (max-width: 759px), (orientation: portrait) {
  .topbar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .brand-sub { display: none; }
  .brand-name { font-size: 17px; }
  .nav { width: 100%; order: 3; justify-content: space-between; gap: 4px; }
  .nav-link { flex: 1; padding: 8px 4px; font-size: 15px; }
  .fs-btn span { display: none; }
  .fs-btn { padding: 8px 10px; }
  #app { padding: 16px 16px 60px; }
  .hero { padding: 10px 0 14px; }
  .hero-sub { font-size: 16px; }
  .hero-sub br { display: none; }
  .hero-badges { display: none; }
  .card-row { display: none; }
  .carousel { display: block; }
  .gq-wall { margin-top: 26px; }
  .admin-grid { grid-template-columns: 1fr; }
  .lit-card { padding: 20px 18px; }
}
@media (max-width: 1024px) and (orientation: landscape) { .admin-grid { grid-template-columns: 1fr; } }

/* ============================================================
   試用碼：狀態按鈕、試用碼視窗、系統提示氣泡、課業開放題上鎖版本、網站頁腳
   ============================================================ */
/* 狀態按鈕：頂欄沿用 .nav-link；每段文字各自成行內區塊（窄屏兩行時只在段與段之間換行） */
button.nav-link { background: none; font-family: inherit; font-weight: inherit; line-height: inherit; }
.trial-label > span { display: inline-block; }
.nav-link.trial-btn[data-state="active"] { color: var(--gold); }
.nav-link.trial-btn[data-state="used_up"], .nav-link.trial-btn[data-state="expired"] { color: var(--cinnabar-hi); }
.trial-live {
  min-height: 48px; padding: 0 16px; border-radius: 999px; white-space: nowrap;
  background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(201, 164, 92, .25);
  color: var(--paper); font-size: 15px; line-height: 1.25; transition: color .2s, border-color .2s;
  user-select: none; -webkit-touch-callout: none;
}
.trial-live:hover { color: var(--gold-hi); border-color: var(--gold); }
.trial-live[data-state="active"] { color: var(--gold-hi); }
.trial-live[data-state="used_up"], .trial-live[data-state="expired"] { color: #f2a592; border-color: rgba(208, 90, 66, .6); }

/* 視窗（層級高於問題面板與頂欄） */
.trial-overlay {
  position: fixed; inset: 0; z-index: 80; display: flex; padding: 16px;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: rgba(0, 0, 0, .6); animation: fade .2s;
}
body.trial-open { overflow: hidden; }
.trial-dialog {
  position: relative; margin: auto; width: 100%; max-width: 540px; padding: 22px 22px 16px; border-radius: 18px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 164, 92, .35); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  color: var(--paper); font-size: 16px; line-height: 1.65; overflow-wrap: anywhere;
  animation: sheet-up .22s cubic-bezier(.2, .7, .2, 1);
}
.trial-dialog:focus { outline: none; }
.trial-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; }
.trial-title { min-height: 44px; padding-right: 52px; display: flex; align-items: center; font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.35; letter-spacing: .04em; color: var(--gold-hi); }
.trial-body > p, .trial-form > p { margin-top: 10px; }
.trial-reason { padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(201, 164, 92, .45); background: rgba(201, 164, 92, .12); color: var(--gold-hi); font-weight: 500; }
.trial-list { margin: 6px 0 0 1.4em; }
.trial-list li { margin-top: 2px; }
.trial-form { display: flex; flex-direction: column; margin-top: 12px; }
.trial-field-label { margin: 10px 0 4px; font-size: 15px; color: var(--paper-dim); }
.trial-input {
  width: 100%; min-height: 50px; padding: 8px 14px; border-radius: 10px;
  font-family: inherit; font-size: 18px; color: var(--paper); background: rgba(11, 9, 7, .7); border: 1px solid rgba(201, 164, 92, .35);
}
.trial-input::placeholder { color: rgba(189, 176, 152, .6); }
.trial-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 164, 92, .22); }
.trial-code { letter-spacing: .08em; text-transform: uppercase; }
.trial-error { padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(208, 90, 66, .55); background: rgba(181, 67, 46, .16); color: #f4b3a4; font-size: 15px; }
.trial-note { font-size: 14.5px; color: var(--paper-dim); }
.trial-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.trial-primary, .trial-secondary { min-height: 52px; padding: 0 22px; border-radius: 12px; font-family: inherit; font-size: 17px; }
.trial-primary { border: 1px solid var(--gold); background: var(--gold); color: #221b0e; font-weight: 700; }
.trial-primary:hover { background: var(--gold-hi); }
.trial-primary:disabled { opacity: .6; }
.trial-secondary { border: 1px solid rgba(201, 164, 92, .45); background: none; color: var(--paper); }
.trial-secondary:hover { border-color: var(--gold); color: var(--gold-hi); }
.trial-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin-top: 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(201, 164, 92, .06); }
.trial-facts dt { font-size: 15px; color: var(--paper-dim); }
.trial-facts dd { min-width: 0; font-weight: 500; color: var(--paper); }
.trial-note a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.trial-error a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.trial-subtitle { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .04em; color: var(--gold-hi); }
.trial-guide { margin: 6px 0 0; padding-left: 1.6em; }
.trial-guide li { margin-top: 8px; padding-left: 2px; }
.trial-guide li::marker { color: var(--gold); font-weight: 700; }
.trial-guide strong { display: block; font-weight: 700; color: var(--gold-hi); }
.trial-guide span { display: block; font-size: 15px; line-height: 1.6; color: var(--paper); }
.trial-foot { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .6em; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--paper-dim); }
.trial-foot a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.trial-foot a:hover { color: var(--gold-hi); }

/* 對話中的系統提示（不發聲、不經人物聲線） */
.bubble.sys { align-self: center; max-width: 94%; padding: 8px 16px; border-radius: 12px; font-size: .86em; line-height: 1.5; text-align: center; color: var(--paper); background: rgba(11, 9, 7, .82); border: 1px dashed rgba(208, 90, 66, .6); }

/* 課業開放題上鎖版本 */
.scene-bar.is-locked .bar-form { opacity: .55; }
.scene-lock { display: grid; gap: 8px; }
.scene-lock-hint { padding: 0 4px; font-size: 15px; color: var(--paper); }
.scene-lock-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.scene-lock-actions .choice-btn { text-align: center; }
.choice-btn.scene-unlock { background: var(--gold); border-color: var(--gold); color: #221b0e; font-weight: 700; }
.choice-btn.scene-unlock:hover:not(:disabled) { background: var(--gold-hi); color: #221b0e; }

/* 網站頁腳（非直播頁） */
.site-foot { width: min(1232px, calc(100% - 48px)); margin: 0 auto; padding: 18px 0 34px; border-top: 1px solid var(--line); text-align: center; font-size: 14px; line-height: 1.7; color: var(--paper-dim); }
.site-foot a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.site-foot a:hover { color: var(--gold-hi); }
body.immersive .site-foot { display: none; }

/* 手機版／直立：人物頁頂行已被簡介卡佔用 → 狀態按鈕排在全屏按鈕下方，窄身兩行；故事頁頂行左邊只有返回鍵 → 與全屏鍵同一行 */
@media (orientation: portrait), (max-width: 759px) {
  .live-tools { flex-direction: column; align-items: flex-end; }
  .live-tools .trial-live { order: 2; width: 48px; min-height: 44px; padding: 5px 2px; border-radius: 14px; white-space: normal; font-size: 12.5px; text-align: center; }
  .story-side ~ .live-tools { flex-direction: row; align-items: center; }
  .story-side ~ .live-tools .trial-live { order: 0; width: auto; min-height: 48px; padding: 0 14px; border-radius: 999px; white-space: nowrap; font-size: 14px; }
  .site-foot { width: calc(100% - 32px); padding: 16px 0 28px; font-size: 13.5px; }
}
@media (max-width: 480px) {
  .trial-dialog { padding: 18px 16px 14px; }
  .trial-title { font-size: 21px; }
  .trial-actions > button { flex: 1 1 auto; }
}
/* LED 直立（大屏）：放大一級 */
@media (orientation: portrait) and (min-width: 900px) {
  .live-tools .trial-live { width: 64px; min-height: 60px; font-size: 17px; border-radius: 18px; }
  .story-side ~ .live-tools .trial-live { width: auto; min-height: 64px; padding: 0 20px; border-radius: 999px; font-size: 20px; }
  .trial-dialog { max-width: 760px; padding: 30px 32px 22px; font-size: 21px; }
  .trial-title { font-size: 32px; }
  .trial-input { min-height: 64px; font-size: 24px; }
  .trial-primary, .trial-secondary { min-height: 64px; font-size: 22px; }
  .trial-note, .trial-error, .trial-field-label, .trial-facts dt, .trial-guide span { font-size: 19px; }
  .trial-subtitle { font-size: 26px; }
  .trial-foot, .site-foot { font-size: 17px; }
  .scene-lock-hint { font-size: 21px; }
}
/* 學校專用網站（js/site.js 有 school；2026-10-05）：頂欄品牌下方「某某學校專用」。手機版原本隱藏品牌副題，學校網站只留學校名稱一行 */
.site-school .brand-school { color: var(--gold); }
@media (max-width: 759px), (orientation: portrait) {
  .site-school .brand-sub { display: block; font-size: 11.5px; letter-spacing: .08em; line-height: 1.4; white-space: nowrap; }
  .site-school .brand-kit { display: none; }
  .site-school .brand > span:last-child br { display: none; }
}
