:root {
  --bg: #f3f4f9; --card: #fff; --ink: #151827; --muted: #626883; --line: #e1e4ee;
  --brand: #e3350d; --brand-2: #b82a0a;
  --c0: #e21b3c; --c1: #1368ce; --c2: #c47f00; --c3: #26890c; --c4: #864cbf; --c5: #0a8f8f;
  --ok: #1f9d55; --bad: #d64545; --r: 18px;
  --shadow: 0 1px 2px rgba(20,24,40,.06), 0 6px 20px rgba(20,24,40,.07);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  min-height: 100vh; min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: .2em 0 .45em; line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.grow { flex: 1; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .08em; }

/* 上方列 */
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: var(--ink); color: #fff; min-height: 48px; }
.topbar:empty { display: none; }
.tb-title { font-size: 1.05rem; }
.tb-code b { font-size: 1.15rem; }
.tb-score { font-weight: 700; }

main { max-width: 720px; margin: 0 auto; padding: 16px; padding-bottom: 40px; }
.host main { max-width: 1180px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-bottom: 14px; }
.join { max-width: 420px; margin: 6vh auto 0; text-align: center; }
.logo { font-size: 48px; }
.field { display: block; text-align: left; margin: 14px 0; }
.field span { display: block; font-weight: 700; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input:not([type]), textarea, select {
  width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: 1.05rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--c1); }
#jcode { font-size: 1.9rem; text-align: center; letter-spacing: .3em; font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 700; cursor: pointer; min-height: 44px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:active:not(:disabled) { background: var(--brand-2); }
.btn.block { display: flex; width: 100%; }
.btn.big { font-size: 1.25rem; padding: 14px 24px; min-height: 58px; }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: .9rem; }
.btn.ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.35); }
.err { color: var(--bad); min-height: 1.5em; margin: .6em 0 0; font-weight: 600; }

.net { position: sticky; top: 0; z-index: 5; background: #fff4d6; color: #7a5200; text-align: center; padding: 6px; font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 20; max-width: calc(100vw - 32px); box-shadow: var(--shadow); font-weight: 600; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #e7e9f3; font-weight: 800; font-size: .92rem; }
.big-emoji { font-size: 56px; line-height: 1.1; }
.statline { font-size: 1.12rem; }

/* 題目與選項 */
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.qtext { font-size: 1.35rem; font-weight: 800; background: #fff; border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 12px; word-break: break-word; }
.timer { height: 12px; background: #e1e4ee; border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.timer > div { height: 100%; width: 100%; background: var(--c1); transition: width .1s linear; }
.timer.hurry > div { background: var(--bad); }
.left { font-size: 1.7rem; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.opts { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .opts { grid-template-columns: 1fr 1fr; } }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 70px; padding: 12px 16px;
  border: 0; border-radius: 14px; color: #fff; font-size: 1.18rem; font-weight: 800; text-align: left;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); text-shadow: 0 1px 2px rgba(0,0,0,.3);
  outline: 4px solid transparent; outline-offset: 3px; transition: transform .08s, opacity .15s, outline-color .15s;
}
button.opt { cursor: pointer; }
button.opt:active { transform: scale(.98); }
.c0 { background: var(--c0); } .c1 { background: var(--c1); } .c2 { background: var(--c2); } .c3 { background: var(--c3); }
.c4 { background: var(--c4); } .c5 { background: var(--c5); }
.shape { font-size: 1.4rem; width: 1.6em; text-align: center; flex: none; }
.otext { word-break: break-word; }
.has-sel .opt:not(.sel) { opacity: .42; }
.opt.sel { outline-color: var(--ink); transform: scale(1.01); }
.opt.sel::after { content: '✓'; margin-left: auto; font-size: 1.5rem; }
.hint { text-align: center; color: var(--muted); margin-top: 14px; font-weight: 600; }
button.opt:disabled { cursor: default; color: #fff; }
.opts.locked .opt:not(.sel) { opacity: .3; }
.send-area { margin-top: 16px; }
.send-state { text-align: center; color: var(--muted); font-weight: 700; margin: 10px 0 0; }
.send-state.ok { color: var(--ok); font-size: 1.1rem; }
p.warn { text-align: center; margin: 10px 0 0; padding: 10px; border-radius: 12px; background: #fde8e8; color: var(--bad); font-weight: 900; font-size: 1.15rem; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.chip.me { background: var(--brand); color: #fff; }

/* 主持首頁：場次清單、金鑰、題庫 */
.setup { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
.setup .card { margin-bottom: 0; }
.room-list { list-style: none; margin: 0; padding: 0; }
.room-list li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.room-list li:last-child { border-bottom: 0; }
.room-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: none; border: 0; padding: 12px 4px; cursor: pointer; }
.room-open b { font-size: 1.05rem; }
.room-open:hover b { color: var(--c1); }
.chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-x { border: 0; background: rgba(0,0,0,.08); color: inherit; border-radius: 50%; width: 22px; height: 22px; line-height: 22px; padding: 0; cursor: pointer; font-size: 14px; }
.chip-x:hover { background: var(--bad); color: #fff; }
.keyrow { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.keyrow code { background: #f1f2f7; padding: 6px 10px; border-radius: 8px; }
.keyrow input { flex: 1; min-width: 200px; padding: 8px 10px; font-size: .95rem; }
.bank-panel { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- v5：主控台 ---------- */
.topbar-inner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { color: #cfd3e6; text-decoration: none; padding: 6px 12px; border-radius: 10px; font-weight: 700; }
.tabs a.on, .tabs a:hover { background: rgba(255,255,255,.14); color: #fff; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 800; background: #eceef6; color: var(--muted); white-space: nowrap; }
.badge.ok { background: #e3f5ea; color: #16733f; }
.badge.off { background: #fde8e8; color: #a33; }
.badge.warn { background: #fff4d6; color: #7a5200; }
.topbar .badge.ok { background: rgba(31,157,85,.25); color: #b9f0cf; }
.topbar .badge.off { background: rgba(214,69,69,.3); color: #ffd0d0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-between.wrap { flex-wrap: wrap; }
.linklike { background: none; border: 0; color: var(--c1); font-weight: 700; cursor: pointer; padding: 8px; }
.btn.danger { color: var(--bad); border-color: #f3c5c5; }
.banner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; background: #fff4d6; color: #7a5200; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 800; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-grid .card { margin-bottom: 0; }
.stat { text-align: center; }
.stat-v { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat-k { color: var(--muted); font-weight: 700; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; align-items: center; gap: 10px; }
.bar-k { font-weight: 700; word-break: break-word; }
.bar { height: 14px; background: #eceef6; border-radius: 99px; overflow: hidden; display: block; }
.bar > span { display: block; height: 100%; background: var(--c1); border-radius: 99px; }
.bar.good > span { background: var(--ok); }
.bar-v { color: var(--muted); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.missed { padding-left: 1.4em; margin: 0; }
.missed li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.missed li:last-child { border-bottom: 0; }
.missed-q { font-weight: 800; margin-bottom: 4px; }
.bad-txt { color: var(--bad); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.toolbar input { flex: 1; min-width: 180px; }
.toolbar select { width: auto; }
.new-room { border: 2px dashed var(--line); border-radius: 14px; padding: 4px 14px 14px; margin: 12px 0; }
.room-list a.room-open { color: inherit; text-decoration: none; }
.title-input { font-size: 1.4rem; font-weight: 900; border-color: transparent; padding-left: 0; background: transparent; }
.title-input:hover, .title-input:focus { border-color: var(--line); padding-left: 10px; background: #fff; }
.settings .field { max-width: 460px; }
.switch-row { display: flex; align-items: center; gap: 8px; font-weight: 700; flex-wrap: wrap; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--ok); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tbl th { color: var(--muted); font-size: .88rem; }
.tbl input { width: 18px; height: 18px; }
.qstat { padding: 12px 0; border-bottom: 1px solid var(--line); }
.qstat:last-child { border-bottom: 0; }
.qstat-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.bank-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.card.inner { box-shadow: none; border: 1px solid var(--line); margin: 0; }
.bank-preview { margin: 10px 0 0; padding-left: 1.4em; }
.bank-preview li { padding: 4px 0; }
.bank-preview .muted { display: block; }

/* 控場 */
.ctl-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 1.4fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .ctl-grid { grid-template-columns: 1fr; } }
.act-list { list-style: none; margin: 0 0 8px; padding: 0; }
.act-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.act-list li:last-child { border-bottom: 0; }
.act-btns { display: flex; gap: 6px; align-items: center; }
.qr.qr-md svg { width: min(240px, 60vw); }
.qr.qr-sm svg { width: min(170px, 45vw); }
.code-mid { font-size: 2rem; font-weight: 900; letter-spacing: .12em; margin-bottom: 12px; }
.round-picks { display: grid; gap: 6px; margin: 8px 0; }
.pick { display: flex; align-items: center; gap: 8px; }
.pick input { width: 18px; height: 18px; }
.opt.live-correct { outline-color: #fff; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18), 0 0 0 4px var(--ok); }
.console .hq .qtext { font-size: 1.3rem; }

/* ---------- v5：投影頁 ---------- */
body.screen { background: #10131f; color: #fff; }
body.screen main { max-width: 1400px; padding: 24px 32px; }
body.screen .card { background: #1b2033; color: #fff; box-shadow: none; }
body.screen .muted, body.screen .rank-list .muted { color: #a9afc7; }
body.screen .rank-list li { border-color: #2c3350; }
body.screen .qtext { background: #fff; color: var(--ink); font-size: clamp(1.6rem, 3.4vw, 3rem); text-align: center; padding: 26px; }
body.screen .pill { background: #2c3350; color: #fff; font-size: 1.1rem; padding: 6px 16px; }
body.screen .opt { min-height: 96px; font-size: clamp(1.2rem, 2.4vw, 2rem); }
body.screen .clock { width: 140px; height: 140px; font-size: 4rem; }
body.screen .answered { color: #a9afc7; }
body.screen .answered b { color: #fff; font-size: 3.4rem; }
body.screen .chip, body.screen .scr-side .chip { background: #2c3350; color: #fff; font-weight: 800; opacity: 1; }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: #fff; }
body.screen .join .muted, body.screen .join { color: var(--ink); }
body.screen .join { background: #fff; }
body.screen .banner { background: #5a3d00; color: #ffe29a; }
.opts.veil .opt { opacity: .25; }
.scr-lobby { display: grid; grid-template-columns: minmax(300px, 1fr) 1.3fr; gap: 40px; align-items: center; min-height: 86vh; }
@media (max-width: 900px) { .scr-lobby { grid-template-columns: 1fr; } }
.scr-join { background: #fff; color: var(--ink); border-radius: 24px; padding: 28px; text-align: center; }
.scr-join .url { color: var(--muted); }
.qr.qr-lg svg { width: min(420px, 70vw); height: auto; display: block; margin: 0 auto; }
.scr-title { font-size: clamp(2rem, 4vw, 3.4rem); margin: 0 0 8px; }
.scr-sub { font-size: clamp(1.1rem, 2vw, 1.6rem); color: #cfd3e6; margin: 0 0 22px; }
.big-chips .chip { font-size: 1.15rem; padding: 8px 16px; }
.scr-center { text-align: center; min-height: 86vh; display: flex; flex-direction: column; justify-content: center; }
.scr-center .podium { max-width: 1000px; margin: 20px auto; width: 100%; }
body.screen .pod .pscore { color: #cfd3e6; }
.big-list { max-width: 900px; margin: 0 auto; width: 100%; text-align: left; font-size: 1.3rem; }
.fs-hint { position: fixed; right: 16px; bottom: 16px; background: rgba(255,255,255,.12); color: #cfd3e6; padding: 6px 12px; border-radius: 10px; font-size: .9rem; transition: opacity 1s; }
.fs-hint.hide { opacity: 0; }
body:not(.screen) .fs-hint { display: none; }
.ready { text-align: center; padding: 28px 0; }
.ready-num { font-size: 110px; font-weight: 900; line-height: 1; color: var(--brand); }
.result { text-align: center; border-radius: var(--r); padding: 28px 20px; color: #fff; margin-bottom: 14px; }
.result.ok { background: var(--ok); } .result.bad { background: var(--bad); } .result.none { background: #6b7089; }
.points { font-size: 2.8rem; font-weight: 900; }

/* 頒獎台 */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 10px; margin: 18px 0; }
.pod { text-align: center; min-width: 0; }
.pod .medal { font-size: 40px; }
.pod .pname { font-weight: 900; font-size: 1.1rem; word-break: break-all; }
.pod .pname.me { color: var(--brand); }
.pod .pscore { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .95rem; }
.pod .step { margin-top: 8px; border-radius: 12px 12px 0 0; color: #fff; font-weight: 900; font-size: 2rem; display: flex; align-items: center; justify-content: center; }
.p1 .step { height: 140px; background: #d4a017; } .p2 .step { height: 100px; background: #9aa3b5; } .p3 .step { height: 72px; background: #b87333; }
.podium.big .pname { font-size: clamp(1.1rem, 2.6vw, 2rem); }
.podium.big .medal { font-size: clamp(40px, 6vw, 72px); }
.podium.big .p1 .step { height: clamp(140px, 22vh, 240px); } .podium.big .p2 .step { height: clamp(100px, 15vh, 170px); } .podium.big .p3 .step { height: clamp(72px, 10vh, 120px); }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; }

/* 主持端 */
.lobby { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .lobby { grid-template-columns: 1fr; } }
.join-panel { text-align: center; }
.qr svg { width: min(320px, 72vw); height: auto; display: block; margin: 8px auto; }
.code-big { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 900; letter-spacing: .14em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.url { font-weight: 700; word-break: break-all; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; margin-bottom: 16px; }
.chip { background: #eef0f7; border-radius: 999px; padding: 6px 14px; font-weight: 700; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.qsum { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); margin-bottom: 12px; }
.host .qtext { font-size: clamp(1.4rem, 3.2vw, 2.5rem); text-align: center; padding: 22px; }
.hq-mid { display: flex; align-items: center; justify-content: center; gap: 32px; margin: 6px 0 18px; }
.clock { width: 116px; height: 116px; border-radius: 50%; background: var(--c1); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 3.2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.clock.ready { background: var(--brand); } .clock.hurry { background: var(--bad); } .clock.done { background: #6b7089; }
.answered { text-align: center; font-weight: 700; color: var(--muted); }
.answered b { display: block; font-size: 2.8rem; line-height: 1; color: var(--ink); }
.host .opt { min-height: 84px; font-size: clamp(1.1rem, 2.2vw, 1.7rem); }
.opt .cnt { margin-left: auto; background: rgba(0,0,0,.24); border-radius: 999px; padding: 2px 12px; font-size: 1rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.opts.result .opt:not(.correct) { opacity: .35; }
.opts.result .opt.correct { outline-color: var(--ink); }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.actions.left { justify-content: flex-start; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; } }

/* 題目編輯 */
.import-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.paste { margin-top: 12px; }
.paste textarea { font-family: ui-monospace, Consolas, monospace; font-size: .95rem; }
.qcard { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.qc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.qc-head select { width: auto; padding: 6px 10px; font-size: .95rem; }
.icon { border: 1px solid var(--line); background: #fff; border-radius: 10px; min-width: 42px; min-height: 42px; cursor: pointer; font-size: 1rem; }
.icon:disabled { opacity: .35; cursor: default; }
.qcard textarea { resize: vertical; margin-bottom: 10px; }
.qopts { display: grid; gap: 8px; }
@media (min-width: 720px) { .qopts { grid-template-columns: 1fr 1fr; } }
.qopt { display: flex; align-items: center; gap: 8px; border-radius: 12px; padding: 6px 8px; background: #f6f7fb; border-left: 8px solid; }
.qopt.is-correct { background: #e3f5ea; box-shadow: 0 0 0 2px var(--ok) inset; }
.qopt .cor { display: flex; align-items: center; gap: 4px; cursor: pointer; flex: none; }
.qopt .cor input { width: 22px; height: 22px; accent-color: var(--ok); margin: 0; }
.qopt input[type=text] { padding: 8px 10px; font-size: 1rem; }
.ed-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 14px 0 12px; background: linear-gradient(rgba(243,244,249,0), var(--bg) 35%); z-index: 3; }

/* ---------- v6：投票／評分／文字雲 ---------- */
.poll-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: -4px 0 12px; }
.poll-meta .badge { line-height: 1.7; }
.poll-bars { display: grid; gap: 12px; }
.pbar-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.shape-sm { width: 1.6em; height: 1.6em; border-radius: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; flex: none; }
.shape-sm.s0 { background: var(--c0); } .shape-sm.s1 { background: var(--c1); } .shape-sm.s2 { background: var(--c2); }
.shape-sm.s3 { background: var(--c3); } .shape-sm.s4 { background: var(--c4); } .shape-sm.s5 { background: var(--c5); }
.pbar-label { flex: 1; font-weight: 800; word-break: break-word; }
.pbar-num { color: var(--muted); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pbar-track { display: block; height: 18px; background: #eceef6; border-radius: 99px; overflow: hidden; }
.pbar-fill { display: block; height: 100%; border-radius: 99px; transition: width .5s ease; min-width: 0; }
.pbar-fill.rate { background: #d4a017; }
.poll-names { color: var(--muted); font-size: .88rem; margin-top: 4px; word-break: break-word; }
.poll-foot { color: var(--muted); text-align: center; font-weight: 700; font-size: .92rem; margin: 12px 0 0; }
.poll-bars.big { gap: 18px; }
.poll-bars.big .pbar-top { font-size: clamp(1.1rem, 2.2vw, 1.8rem); }
.poll-bars.big .shape-sm { font-size: 1.2rem; }
.poll-bars.big .pbar-track { height: clamp(22px, 3.4vh, 38px); }
.rating-res { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.rating-res .poll-foot { grid-column: 1 / -1; }
.rating-avg { text-align: center; }
.rating-avg b { display: block; font-size: 3rem; line-height: 1; color: #b88700; font-variant-numeric: tabular-nums; }
.rating-avg span { color: var(--muted); font-weight: 700; }
.rating-bars { display: grid; gap: 8px; }
.rbar { display: grid; grid-template-columns: 2ch 1fr 3ch; gap: 10px; align-items: center; }
.rbar-k { font-weight: 900; text-align: center; }
.rbar-v { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.rbar .poll-names { grid-column: 2 / -1; margin-top: -4px; }
.rating-res.big .rating-avg b { font-size: clamp(4rem, 10vw, 8rem); }
.rating-res.big .rating-avg span { font-size: 1.3rem; }
.rating-res.big .rbar { font-size: 1.6rem; grid-template-columns: 2ch 1fr 4ch; }
.rating-res.big .pbar-track { height: clamp(22px, 3.4vh, 38px); }
.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; min-height: 140px; padding: 10px; }
.cloud.empty { color: var(--muted); font-weight: 700; }
.cloud.big { min-height: 52vh; gap: 10px 34px; }
.cw { position: relative; font-weight: 900; line-height: 1.15; word-break: break-all; }
.cw sup { font-size: .5em; color: var(--muted); margin-left: 2px; }
.cw0 { color: var(--c0); } .cw1 { color: var(--c1); } .cw2 { color: var(--c2); } .cw3 { color: var(--c3); } .cw4 { color: var(--c4); } .cw5 { color: var(--c5); }
.cw-x { font-size: .8rem; vertical-align: top; margin-left: 2px; border: 0; background: rgba(0,0,0,.08); color: var(--ink); border-radius: 50%; width: 22px; height: 22px; line-height: 22px; padding: 0; cursor: pointer; }
.cw-x:hover { background: var(--bad); color: #fff; }
.poll-wait { text-align: center; padding: 12vh 0; font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 900; }
.poll-wait span { font-size: .5em; color: #a9afc7; }
.scr-poll { max-width: 1200px; margin: 0 auto; }
body.screen .pbar-track { background: #2c3350; }
body.screen .pbar-num, body.screen .poll-foot, body.screen .rating-avg span, body.screen .rbar-v, body.screen .cw sup { color: #cfd3e6; }
body.screen .rating-avg b { color: #ffc93c; }
body.screen .cw0 { color: #ff6b81; } body.screen .cw1 { color: #5aa9ff; } body.screen .cw2 { color: #ffc93c; }
body.screen .cw3 { color: #6fdc52; } body.screen .cw4 { color: #c39bff; } body.screen .cw5 { color: #3fe0d0; }
/* 手機作答 */
.rate-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rate-btn { min-height: 76px; border-radius: 14px; border: 0; background: #d4a017; color: #fff; font-size: 2rem; font-weight: 900; cursor: pointer; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); outline: 4px solid transparent; outline-offset: 3px; }
.rate-btn:disabled { cursor: default; }
.rate-btn.sel { outline-color: var(--ink); transform: scale(1.04); }
.has-sel .rate-btn:not(.sel) { opacity: .42; }
.locked .rate-btn:not(.sel) { opacity: .3; }
.rate-ends { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-weight: 700; font-size: .92rem; margin-top: 8px; }
.wc-inputs { display: grid; gap: 10px; }
.wc-inputs input { font-size: 1.25rem; text-align: center; }
.wc-inputs input:disabled { background: #f1f2f7; color: var(--ink); }
.opts.multi .opt.sel::after { content: '☑'; }
/* 題目編輯 */
.qcard { border-left: 6px solid #d6d9e6; }
.qcard.qt-quiz { border-left-color: var(--brand); } .qcard.qt-single, .qcard.qt-multi { border-left-color: var(--c1); }
.qcard.qt-rating { border-left-color: #d4a017; } .qcard.qt-wordcloud { border-left-color: var(--c4); }
.qc-head .qtype-sel { font-weight: 800; }
.flag-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; font-weight: 700; font-size: .95rem; }
.flag-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.flag-row input { width: 20px; height: 20px; accent-color: var(--c1); }
.inline-field { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-top: 6px; }
.inline-field input[type=text] { flex: 1; padding: 8px 10px; font-size: 1rem; }
input[type=number] { width: 90px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: 1rem; }

/* ---------- v7：Q&A 提問 ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 12px; background: #e7e9f3; }
.seg button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font-weight: 800; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg small { font-weight: 600; opacity: .85; }
.seg.dark { background: rgba(255,255,255,.12); }
.seg.dark button { color: #cfd3e6; }
.seg.dark button.on { background: #fff; color: var(--ink); }
.tbadge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .78rem; line-height: 20px; text-align: center; }
.ptabs { display: flex; margin-bottom: 12px; }
.ptabs button { flex: 1; justify-content: center; padding: 10px; font-size: 1.05rem; }
.qa-hint { background: #eef4ff; color: var(--c1); border-radius: 10px; padding: 8px 12px; font-weight: 800; }
.qa-compose textarea { resize: vertical; margin-bottom: 8px; }
.qa-name { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.qa-name input { width: 20px; height: 20px; accent-color: var(--c1); }
.qa-sort, .qa-tabs { display: flex; margin: 4px 0 12px; }
.qa-sort button, .qa-tabs button { flex: 1; justify-content: center; }
.qa-list, .qa-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.qa-item, .qa-row { display: flex; align-items: flex-start; gap: 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; }
.card .qa-row { box-shadow: none; border: 1px solid var(--line); }
.qa-item.mine { border-left: 5px solid var(--c1); }
.qa-item.pending { opacity: .75; }
.qa-vote { flex: none; display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 6px 4px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); font-weight: 900; line-height: 1.1; cursor: pointer; }
.qa-vote b { font-size: 1.15rem; color: var(--ink); }
.qa-vote.voted { border-color: var(--brand); background: #fff1ec; color: var(--brand); }
.qa-vote.voted b { color: var(--brand); }
.qa-vote:disabled { cursor: default; opacity: .6; }
.qa-body, .qa-main { flex: 1; min-width: 0; }
.qa-text { font-weight: 800; font-size: 1.05rem; word-break: break-word; }
.qa-meta { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.qa-meta .badge { margin-left: 4px; }
.qa-reply { margin-top: 6px; background: #f1f5ff; border-radius: 10px; padding: 8px 10px; font-size: .95rem; word-break: break-word; }
.qa-votes { flex: none; min-width: 48px; text-align: center; color: var(--muted); font-weight: 900; }
.qa-votes b { display: block; font-size: 1.3rem; color: var(--ink); }
.qa-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.qa-row.focused { box-shadow: 0 0 0 3px var(--c1), var(--shadow); }
.focus-tag { color: var(--c1); }
.qa-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.qa-edit textarea { margin-top: 8px; }
/* 投影：Q&A 牆與聚焦單題 */
.scr-qa { min-height: 86vh; }
.scr-qa-head { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-bottom: 18px; }
.scr-qa-join { display: flex; align-items: center; gap: 14px; background: #fff; color: var(--ink); border-radius: 18px; padding: 12px 18px; }
body.screen .scr-qa-join .muted { color: var(--muted); }
.scr-qa-join .code-mid { margin: 0; }
.qr.qr-xs svg { width: 110px; height: auto; margin: 0; }
.qa-wall { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.qa-wall li { display: flex; align-items: center; gap: 18px; background: #1b2033; border-radius: 16px; padding: 14px 22px; font-size: clamp(1.2rem, 2.2vw, 1.9rem); }
.qa-wv { flex: none; min-width: 3.6em; font-weight: 900; color: #ffc93c; }
.qa-wt { flex: 1; font-weight: 800; word-break: break-word; }
.qa-wn { flex: none; color: #a9afc7; font-size: .8em; }
.qa-wall li.qa-empty { justify-content: center; color: #a9afc7; }
.qa-focus { background: #fff; color: var(--ink); border-radius: 28px; padding: 6vh 5vw; max-width: 1200px; margin: 0 auto; }
.qa-focus-text { font-size: clamp(2rem, 5vw, 4.4rem); font-weight: 900; line-height: 1.3; word-break: break-word; }
.qa-focus-meta { margin-top: 3vh; color: var(--muted); font-size: clamp(1.2rem, 2.4vw, 2rem); font-weight: 800; }
