/* Deep Sea Trivia — 依 Google Stitch 設計稿（專案 5722966402256523926）實作 */
@font-face { font-family: "Inter"; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/inter.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+2212; }
@font-face { font-family: "Jakarta"; font-weight: 600 800; font-display: swap; src: url(/assets/fonts/jakarta.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2191, U+2193, U+2212; }

:root {
  --bg-0: #000b1a; --bg-1: #00132c; --bg-2: #0a2e55;
  --ink: #e8f4ff; --ink-2: #bcc8cf; --ink-3: #8fa9c7; --ink-4: #5d7594;
  --cyan: #4fd1ff; --cyan-soft: rgba(79, 209, 255, .14);
  --amber: #ffb547; --amber-2: #f59e0b; --amber-ink: #2a1a00; --amber-soft: rgba(255, 181, 71, .14);
  --green: #4ade80;
  --danger: #ff8a80;
  --glass: rgba(13, 32, 57, .62); --glass-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .12); --line-2: rgba(79, 209, 255, .28);
  --r: 12px; --r-lg: 18px;
  --sans: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --head: "Jakarta", "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg-0); }
body {
  font-family: var(--sans); color: var(--ink); font-size: 15px; line-height: 1.5;
  background: radial-gradient(120% 70% at 50% -10%, #0f3a66 0%, var(--bg-1) 45%, var(--bg-0) 100%) fixed;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--head); letter-spacing: -.01em; margin: 0; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- 共用元件 ---------- */
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--glass-2); color: var(--ink); font-weight: 600; font-size: 14px; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; text-decoration: none !important;
}
.btn:hover { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .22); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #ffc56a, var(--amber-2)); color: var(--amber-ink); border-color: transparent; box-shadow: 0 8px 24px rgba(245, 158, 11, .25); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 10px 30px rgba(245, 158, 11, .35); }
.btn.cyan { background: var(--cyan); color: #00222e; border-color: transparent; box-shadow: 0 8px 24px rgba(79, 209, 255, .25); }
.btn.lg { height: 52px; font-size: 16px; border-radius: 14px; }
.btn.icon { width: 40px; padding: 0; }
.btn.danger:hover { color: var(--danger); border-color: rgba(255, 138, 128, .45); background: rgba(255, 138, 128, .08); }
.btn.on { background: var(--amber-soft); border-color: rgba(255, 181, 71, .6); color: #ffd99a; }
.field { display: grid; gap: 8px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--ink-4); }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: rgba(0, 10, 26, .55); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.input::placeholder { color: var(--ink-4); }
textarea.input { height: auto; min-height: 220px; padding: 12px 14px; resize: vertical; font-family: var(--mono); font-size: 14px; line-height: 1.75; }
.input-wrap { position: relative; }
.input-wrap > svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-wrap .input { padding-left: 42px; padding-right: 44px; }
.input-wrap .peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink-3); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.input-wrap .peek:hover { color: var(--ink); background: var(--glass-2); }
.err { color: var(--danger); min-height: 1.3em; font-size: 13px; margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); color: var(--ink-2); background: var(--glass-2); white-space: nowrap; }
.pill.cyan { color: var(--cyan); border-color: var(--line-2); background: var(--cyan-soft); }
.pill.amber { color: var(--amber); border-color: rgba(255, 181, 71, .4); background: var(--amber-soft); }
.code-chip { font-family: var(--mono); font-weight: 700; letter-spacing: .08em; color: var(--amber); border: 1px solid rgba(255, 181, 71, .4); background: var(--amber-soft); border-radius: 7px; padding: 1px 8px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; box-shadow: 0 0 0 3px rgba(255, 138, 128, .18); }
.dot.live { background: var(--green); box-shadow: 0 0 0 3px rgba(74, 222, 128, .18); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(74, 222, 128, .05); } }
.kbd { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(79, 209, 255, .12); color: var(--cyan); border: 1px solid var(--line-2); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--head); font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none !important; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }

/* ---------- 海洋背景（登入 / 輸入代碼頁） ---------- */
.ocean-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ocean-bg::before { content: ""; position: absolute; left: 0; right: 0; top: 54%; bottom: 0; background: linear-gradient(180deg, rgba(10, 74, 122, .55), rgba(0, 11, 26, .2) 60%, transparent); }
.ocean-bg .line { position: absolute; left: 0; right: 0; top: 54%; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--cyan) 70%, transparent); box-shadow: 0 0 30px 6px rgba(79, 209, 255, .35); opacity: .6; }
.ocean-bg .glow { position: absolute; left: 50%; top: 54%; width: 90vw; height: 40vh; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(79, 209, 255, .22), transparent); }
.ocean-bg span { position: absolute; font-family: var(--head); font-weight: 700; color: rgba(79, 209, 255, .22); filter: blur(1.5px); animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateY(-8px); } to { transform: translateY(8px); } }

/* ---------- 登入 / 加入 ---------- */
.center-page { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); padding: 36px 32px 28px; text-align: center; }
.auth-card .pill { margin-bottom: 18px; }
.auth-card .logo { width: 64px; height: 64px; margin: 0 auto 14px; display: block; filter: drop-shadow(0 8px 24px rgba(255, 181, 71, .35)); }
.auth-card h1 { font-size: 26px; }
.auth-card .sub { color: var(--ink-3); font-size: 14px; margin: 6px 0 0; }
.auth-card form { display: grid; gap: 14px; margin-top: 26px; text-align: left; }
.auth-card .alt { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.code-input { text-align: center; font-family: var(--mono); font-size: 32px; height: 64px; letter-spacing: .4em; text-transform: uppercase; font-weight: 800; color: var(--amber); padding-left: .4em; }
.page-foot { position: fixed; left: 24px; right: 24px; bottom: 16px; display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-4); pointer-events: none; }

/* ---------- Dashboard ---------- */
.topnav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(0, 14, 36, .72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topnav .spacer { flex: 1; }
.dash { max-width: 1240px; margin: 0 auto; padding: 40px 32px 64px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.dash-head h1 { font-size: 40px; line-height: 1.15; margin-top: 12px; }
.dash-head p { color: var(--ink-3); margin: 8px 0 0; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash, .topnav { padding-left: 18px; padding-right: 18px; } }
.card { padding: 26px; }
.card-head { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.card-head .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--cyan-soft); color: var(--cyan); border: 1px solid var(--line-2); flex: none; }
.card-head h2 { font-size: 20px; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.card-head .grow { flex: 1; min-width: 0; }
.create { display: grid; gap: 20px; }
.linkish { background: none; border: 0; padding: 0; color: var(--amber); font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.linkish:hover { text-decoration: underline; }
.room-list { display: grid; gap: 14px; }
.room { display: flex; align-items: center; gap: 16px; padding: 18px 18px 18px 20px; border-radius: 16px; background: rgba(0, 10, 26, .35); border: 1px solid var(--line); transition: border-color .2s, background .2s, transform .2s; }
.room:hover { border-color: var(--line-2); background: rgba(79, 209, 255, .05); }
.room.latest { border-color: var(--line-2); box-shadow: inset 0 0 0 1px rgba(79, 209, 255, .08), 0 0 40px rgba(79, 209, 255, .06); }
.room .meta { flex: 1; min-width: 0; display: grid; gap: 8px; }
.room .title { font-family: var(--head); font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 10px; align-items: center; }
.room .title span:last-child { overflow: hidden; text-overflow: ellipsis; }
.room .sub { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--ink-3); }
.room .sub > span { display: inline-flex; align-items: center; gap: 5px; }
.room .sub svg.i { width: 14px; height: 14px; }
.room .actions { display: flex; gap: 8px; flex: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 16px; }
.tip { margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: rgba(0, 10, 26, .35); border: 1px solid var(--line); font-size: 13px; color: var(--ink-3); display: flex; gap: 12px; }
.tip b { color: var(--ink); }
@media (max-width: 560px) { .room { flex-direction: column; align-items: stretch; } .room .actions .btn.primary { flex: 1; } }

/* =====================================================
   講者舞台：一律 100vh、不捲動
   ===================================================== */
html.stage-html, html.stage-html body { overflow: hidden; overscroll-behavior: none; }
.stage { position: fixed; inset: 0; overflow: hidden; overflow: clip; user-select: none; }
.stage.idle { cursor: none; }

.sea-bg { position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 0%, #0b2a4d 0%, #020d20 55%, #010714 100%); }
.stars { position: absolute; inset: 0 0 auto 0; height: var(--wl, 52%); background-image: radial-gradient(1px 1px at 12% 22%, rgba(255,255,255,.5), transparent), radial-gradient(1px 1px at 33% 64%, rgba(255,255,255,.35), transparent), radial-gradient(1px 1px at 58% 18%, rgba(255,255,255,.4), transparent), radial-gradient(1.5px 1.5px at 76% 42%, rgba(255,255,255,.45), transparent), radial-gradient(1px 1px at 88% 12%, rgba(255,255,255,.3), transparent), radial-gradient(1px 1px at 22% 82%, rgba(255,255,255,.25), transparent), radial-gradient(1px 1px at 66% 76%, rgba(255,255,255,.3), transparent); transition: height 1.6s cubic-bezier(.22,.8,.25,1); }
.water {
  position: absolute; left: 0; right: 0; bottom: 0; top: var(--wl, 52%);
  background: radial-gradient(70% 45% at 50% 0%, rgba(79, 209, 255, .2), transparent 70%), linear-gradient(180deg, #0b4775 0%, #073560 18%, #04234a 50%, #021230 80%, #010a1c 100%);
  transition: top 1.6s cubic-bezier(.22, .8, .25, 1);
  overflow-x: clip;
}
.water .wave { position: absolute; left: 0; width: 200%; height: 46px; top: -32px; animation: wave 16s linear infinite; }
.water .wave.w2 { top: -24px; animation-duration: 26s; animation-direction: reverse; }
.water .shine { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, rgba(160, 235, 255, .9) 25%, rgba(160, 235, 255, .9) 75%, transparent); box-shadow: 0 0 24px 4px rgba(79, 209, 255, .45); opacity: .7; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.water .rays { position: absolute; inset: 0; background: repeating-linear-gradient(100deg, rgba(180, 235, 255, .045) 0 34px, transparent 34px 110px); -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); mask-image: linear-gradient(180deg, #000, transparent 75%); animation: rays 20s ease-in-out infinite alternate; }
@keyframes rays { from { transform: translateX(-3%); } to { transform: translateX(3%); } }
.water .wl-label { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); z-index: 3; }
.wl-label { font-family: var(--mono); font-size: 11px; letter-spacing: .25em; color: rgba(190, 235, 255, .75); padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(2, 18, 40, .8); white-space: nowrap; }
.bubble { position: absolute; bottom: -20px; border-radius: 50%; border: 1px solid rgba(180, 230, 255, .35); background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, .03)); animation: bubble linear infinite; }
@keyframes bubble { from { transform: translateY(0); opacity: 0; } 10% { opacity: .9; } to { transform: translateY(calc(-1 * var(--h, 400px))); opacity: 0; } }
#bubbles { position: absolute; inset: 0; overflow: hidden; }

/* 頂列：永遠單行 */
.topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 40; height: 68px; display: flex; align-items: center; gap: 14px; padding: 0 22px; background: linear-gradient(180deg, rgba(1, 8, 22, .85), rgba(1, 8, 22, 0)); }
.live-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .3); color: #9ff0bf; font-weight: 700; font-size: 12px; letter-spacing: .14em; flex: none; }
.live-pill.off { background: rgba(255, 138, 128, .1); border-color: rgba(255, 138, 128, .3); color: #ffc2bb; }
.topbar .title { font-family: var(--head); font-weight: 800; font-size: clamp(18px, 1.7vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.stat { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-3); white-space: nowrap; flex: none; }
.stat b { font-family: var(--head); font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat.amber b { color: var(--amber); }
.stat svg.i { width: 16px; height: 16px; color: var(--cyan); }
.topbar .spacer { flex: 1 1 0; min-width: 0; }
.tools { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(13, 32, 57, .55); border: 1px solid var(--line); backdrop-filter: blur(12px); flex: none; transition: opacity .4s; }
.tool { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.tool:hover { background: rgba(255, 255, 255, .09); color: var(--ink); }
.tool.on { background: var(--amber-soft); color: #ffd99a; }
.tool .lbl { display: none; }
@media (min-width: 1500px) { .tool .lbl { display: inline; } }
.tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.stage.idle .tools, .stage.idle .help { opacity: 0; }
@media (max-width: 900px) { .stat .t { display: none; } }

/* 名詞 */
#termLayer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.term { position: absolute; left: 0; top: 0; transform-origin: 0 0; border: 0; background: none; padding: 0; color: inherit; cursor: default; pointer-events: auto; transition: transform 1.9s cubic-bezier(.2, .75, .25, 1), opacity .8s; will-change: transform; font-family: var(--head); }
.term .bob { display: inline-flex; align-items: center; gap: 10px; animation: bob var(--d, 6s) ease-in-out var(--dl, 0s) infinite alternate; transition: background .5s, box-shadow .5s, color .5s, padding .5s, opacity .8s, filter .8s; }
@keyframes bob { from { transform: translateY(-5px) rotate(-.5deg); } to { transform: translateY(5px) rotate(.5deg); } }
.term .txt { white-space: nowrap; }
.term .badge { display: none; }
.term .ck { display: none; }
/* 水下：純文字、依深度不同大小與透明度 */
.term.sea .bob { padding: 4px 8px; opacity: var(--op, .6); filter: blur(var(--bl, 0px)); }
.term.sea .txt { font-size: 20px; font-weight: 600; color: #a9dcff; text-shadow: 0 0 14px rgba(79, 209, 255, .35); }
.term.sea.explained .bob { opacity: .75; filter: none; padding: 5px 12px 5px 10px; border-radius: 999px; border: 1px solid rgba(74, 222, 128, .25); background: rgba(74, 222, 128, .06); }
.term.sea.explained .txt { color: #b9d6ea; text-shadow: none; }
.term.sea.explained .ck { display: inline-flex; color: var(--green); }
.term.sea.explained .ck svg { width: 18px; height: 18px; }
/* 水面上：毛玻璃白膠囊 + 琥珀票數 */
.term.risen { z-index: 10; cursor: pointer; }
.term.risen .bob { padding: 12px 14px 12px 26px; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(222, 238, 252, .92)); color: #06213d; box-shadow: 0 14px 40px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .7) inset, 0 0 34px rgba(79, 209, 255, .18); animation-duration: 4.6s; }
.term.risen .txt { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.term.risen .badge { display: inline-flex; align-items: center; gap: 3px; font-family: var(--head); font-size: 20px; font-weight: 800; padding: 3px 14px; border-radius: 999px; background: linear-gradient(180deg, #ffc66b, var(--amber)); color: var(--amber-ink); font-variant-numeric: tabular-nums; }
.term.risen.top .bob { background: linear-gradient(180deg, #fffaf0, #ffe9c4); box-shadow: 0 14px 44px rgba(0, 0, 0, .4), 0 0 0 3px var(--amber) inset, 0 0 60px rgba(255, 181, 71, .45); }
.term.risen:hover .bob, .term.risen:focus-visible .bob { box-shadow: 0 14px 40px rgba(0, 0, 0, .4), 0 0 0 3px var(--cyan) inset, 0 0 40px rgba(79, 209, 255, .4); }
.term.risen:focus-visible { outline: none; }
.badge.bump { animation: bump .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 40% { transform: scale(1.45); } }
.term.leaving { opacity: 0; }
.term .rank { display: none; }

.surface-cap { position: absolute; left: 50%; transform: translateX(-50%); top: 78px; z-index: 6; display: inline-flex; align-items: center; gap: 10px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(2, 14, 34, .55); font-size: 13px; color: var(--ink-2); letter-spacing: .08em; white-space: nowrap; transition: opacity .6s; }
.surface-cap i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.empty-hint { position: absolute; left: 0; right: 0; text-align: center; z-index: 6; pointer-events: none; transition: opacity .6s; }
.empty-hint .big { font-family: var(--head); font-weight: 700; font-size: clamp(22px, 2.4vw, 34px); color: var(--ink); }
.empty-hint .small { margin-top: 8px; color: var(--ink-3); font-size: clamp(14px, 1.2vw, 18px); }

/* QR 卡 */
.qr-card { position: absolute; right: 22px; top: 82px; z-index: 30; width: var(--qrw, 260px); padding: 18px; cursor: zoom-in; text-align: center; transition: opacity .4s, transform .4s; }
.qr-card.hidden { opacity: 0; transform: translateX(30px); pointer-events: none; }
.qr-card .qh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 13px; font-weight: 700; color: var(--amber); }
.qr-card .qh span { display: inline-flex; align-items: center; gap: 8px; }
.qr-card .qh i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.qr-card img { width: 100%; aspect-ratio: 1; display: block; background: #fff; border-radius: 14px; padding: 10px; }
.qr-card .cl { margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.qr-card .code { margin-top: 6px; display: flex; justify-content: space-around; padding: 8px 6px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, .45); background: var(--amber-soft); font-family: var(--head); font-weight: 800; font-size: 28px; color: var(--amber); }
.qr-card .url { margin-top: 12px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-card .cap { margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.qr-card .lock { margin-top: 12px; padding: 8px; border-radius: 10px; background: var(--amber-soft); color: #ffd99a; font-size: 13px; font-weight: 600; }

.help { position: absolute; left: 22px; bottom: 18px; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: rgba(2, 14, 34, .6); border: 1px solid var(--line); font-size: 12px; color: var(--ink-3); transition: opacity .4s; white-space: nowrap; }
.help .s { opacity: .4; }

/* 大 QR */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(1, 8, 22, .9); backdrop-filter: blur(10px); cursor: zoom-out; }
.qr-big { display: flex; align-items: center; gap: 6vw; padding: 4vh 5vw; }
.qr-big img { height: min(70vh, 46vw); aspect-ratio: 1; background: #fff; border-radius: 26px; padding: 18px; box-shadow: 0 0 80px rgba(79, 209, 255, .25); }
.qr-big .side { display: grid; gap: 2.4vh; text-align: left; }
.qr-big .k { font-size: clamp(16px, 1.6vw, 24px); color: var(--ink-3); }
.qr-big .t { font-family: var(--head); font-weight: 800; font-size: clamp(30px, 3.6vw, 60px); line-height: 1.15; }
.qr-big .u { font-family: var(--mono); font-size: clamp(16px, 1.8vw, 28px); color: var(--cyan); }
.qr-big .code { font-family: var(--head); font-weight: 800; font-size: clamp(44px, 6vw, 100px); letter-spacing: .25em; color: var(--amber); text-shadow: 0 0 40px rgba(255, 181, 71, .35); }

/* 編輯抽屜 */
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100% - 24px)); z-index: 90; padding: 24px; display: flex; flex-direction: column; gap: 16px; transform: translateX(110%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); user-select: text; }
.drawer.open { transform: none; }
.drawer .field.grow { flex: 1; min-height: 0; grid-template-rows: auto 1fr; }
.drawer textarea.input { min-height: 0; height: 100%; resize: none; }
.drawer .row { display: flex; gap: 10px; justify-content: flex-end; }
.drawer h2 { font-size: 20px; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 120; transform: translate(-50%, 30px); opacity: 0; display: flex; gap: 14px; align-items: center; padding: 10px 10px 10px 18px; transition: transform .3s, opacity .3s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.banner { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: rgba(1, 8, 22, .92); }

/* =====================================================
   聽眾手機頁：App shell，整頁不捲動，名詞自動縮放塞滿一屏
   ===================================================== */
html.aud-html, html.aud-html body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.aud { height: 100vh; height: 100dvh; max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; padding: max(14px, env(safe-area-inset-top)) 16px 0; }
.aud-top { display: flex; justify-content: space-between; align-items: center; }
.aud-top .conn { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.aud-head { margin: 14px 0 12px; }
.aud-head .over { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--cyan); letter-spacing: .04em; }
.aud-head h1 { font-size: clamp(22px, 6.4vw, 30px); line-height: 1.2; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.aud-head p { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); }
.lock-banner { margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255, 181, 71, .5); background: var(--amber-soft); color: #ffd99a; font-size: 13px; }
.cloud { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior: contain; scrollbar-width: none; font-size: var(--fs, 17px); margin: 0 -16px; }
.cloud::-webkit-scrollbar { display: none; }
.pg { flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; display: flex; flex-wrap: wrap; align-content: flex-start; gap: calc(var(--fs, 17px) * .55); padding: 2px 16px 12px; }
.pager { flex: none; display: flex; justify-content: center; align-items: center; gap: 8px; height: 26px; font-size: 12px; color: var(--ink-3); }
.pager button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .25); cursor: pointer; transition: width .25s, background .25s; }
.pager button.on { width: 22px; background: var(--cyan); }
.pager .sw { margin-left: 6px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: .45em; max-width: 100%;
  min-height: 2.6em; padding: .45em .55em .45em .95em; border-radius: 999px; cursor: pointer; touch-action: manipulation;
  background: rgba(13, 32, 57, .7); border: 1px solid var(--line); color: var(--ink);
  font-family: var(--head); font-weight: 700; font-size: 1em; line-height: 1.2; text-align: left;
  transition: background .2s, border-color .2s, transform .12s, box-shadow .2s, opacity .2s;
}
.chip:active { transform: scale(.96); }
.chip .name { overflow-wrap: anywhere; }
.chip .n { font-family: var(--sans); font-size: .68em; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip .st { width: 1.55em; height: 1.55em; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--line-2); color: var(--cyan); background: var(--cyan-soft); }
.chip .st svg { width: .9em; height: .9em; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chip .st .ok { display: none; }
.chip[aria-pressed="true"] { background: linear-gradient(180deg, rgba(255, 181, 71, .28), rgba(255, 181, 71, .14)); border-color: var(--amber); box-shadow: 0 0 22px rgba(255, 181, 71, .22); color: #fff3df; }
.chip[aria-pressed="true"] .n { color: #ffd99a; }
.chip[aria-pressed="true"] .st { background: var(--amber); border-color: transparent; color: var(--amber-ink); }
.chip[aria-pressed="true"] .st .ok { display: block; }
.chip[aria-pressed="true"] .st .plus { display: none; }
.chip.explained:not([aria-pressed="true"]) { opacity: .6; border-color: rgba(74, 222, 128, .3); }
.chip.explained:not([aria-pressed="true"]) .st { border-color: rgba(74, 222, 128, .4); background: rgba(74, 222, 128, .1); color: var(--green); }
.chip.explained:not([aria-pressed="true"]) .st .ok { display: block; }
.chip.explained:not([aria-pressed="true"]) .st .plus { display: none; }
.chip[disabled] { opacity: .4; cursor: not-allowed; }
.chip.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 50% { transform: scale(1.08); } }
.aud-foot { flex: none; margin: 0 -16px; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); background: rgba(0, 10, 26, .85); border-top: 1px solid var(--line); backdrop-filter: blur(14px); display: flex; align-items: center; gap: 12px; }
.aud-foot .cnt { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 18px; color: var(--amber); border: 1px solid rgba(255, 181, 71, .45); background: var(--amber-soft); }
.aud-foot .tx { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.aud-foot .tx small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.aud-foot .legend { display: flex; gap: 10px; font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.aud-foot .legend span { display: inline-flex; align-items: center; gap: 4px; }
.aud-foot .legend i { width: 8px; height: 8px; border-radius: 50%; }
.empty-cloud { margin: auto; text-align: center; color: var(--ink-3); }
@media (max-height: 700px) {
  .aud-head { margin: 10px 0 8px; }
  .aud-head p, .aud-head .over { display: none; }
  .aud-head h1 { font-size: 21px; -webkit-line-clamp: 1; }
  .aud-foot { padding-top: 9px; padding-bottom: max(9px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .term .bob, .wave, .rays, .bubble, .ocean-bg span, .dot.live { animation: none !important; }
  .term { transition-duration: .4s; }
}
