/* 配色沿用新竹站與原型：淺色、深色各一組，版面只認變數名 */
:root {
  --bg: #f6f4ef; --card: #fff; --ink: #1d1c1a; --muted: #6b6760; --line: #dcd8cf; --chip: #eceff5;
  --ok: #2e7d32; --re: #4a5f8a; --gm: #b26a00; --pl: #b3261e; --off: #8a867d;
  --ok-bg: #edf6ee; --re-bg: #eef1f7; --gm-bg: #f7ecd9; --pl-bg: #f8e3e1; --off-bg: #efede8;
  --accent: #4a5f8a; --accent-ink: #fff; --warn-bg: #fff6e0; --warn-line: #e9c46a; --shadow: 0 6px 24px rgba(0,0,0,.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181a; --card: #222326; --ink: #ecebe6; --muted: #a09c93; --line: #3a3b40; --chip: #2d3038;
    --ok: #7bc47f; --re: #8fa7d6; --gm: #e0a84a; --pl: #f28b82; --off: #8d8a84;
    --ok-bg: #1f2b20; --re-bg: #262b36; --gm-bg: #332b1e; --pl-bg: #33221f; --off-bg: #2a2a2c;
    --accent: #8fa7d6; --accent-ink: #101318; --warn-bg: #33291a; --warn-line: #7a5c1e; --shadow: 0 6px 24px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #17181a; --card: #222326; --ink: #ecebe6; --muted: #a09c93; --line: #3a3b40; --chip: #2d3038;
  --ok: #7bc47f; --re: #8fa7d6; --gm: #e0a84a; --pl: #f28b82; --off: #8d8a84;
  --ok-bg: #1f2b20; --re-bg: #262b36; --gm-bg: #332b1e; --pl-bg: #33221f; --off-bg: #2a2a2c;
  --accent: #8fa7d6; --accent-ink: #101318; --warn-bg: #33291a; --warn-line: #7a5c1e; --shadow: 0 6px 24px rgba(0,0,0,.5);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.55 "Segoe UI", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif; padding-bottom: 72px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; font-size: 17px; white-space: nowrap; }
.beta { font-size: 11px; font-weight: 700; color: var(--gm); border: 1px solid var(--gm); border-radius: 999px; padding: 0 7px; margin-left: 4px; vertical-align: 2px; }
.desk-nav { display: none; gap: 4px; }
.desk-nav button { background: none; border: 0; padding: 6px 12px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; }
.desk-nav button.on { background: var(--chip); color: var(--ink); }
.me { margin-left: auto; background: var(--chip); border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600; white-space: nowrap; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px 30px; }
main.wide { max-width: 1100px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; background: none; border: 0; padding: 7px 0 9px; font-size: 11.5px; color: var(--muted); cursor: pointer; min-height: 56px; }
.tabs button i { display: block; font-style: normal; font-size: 19px; line-height: 1.2; }
.tabs button.on { color: var(--accent); font-weight: 700; }
@media (min-width: 900px) { body { padding-bottom: 0; } .tabs { display: none; } .desk-nav { display: flex; } }
h1 { font-size: 21px; margin: 4px 0 2px; }
h2 { font-size: 15px; margin: 20px 0 8px; color: var(--muted); }
.sub, .m { color: var(--muted); font-size: 13.5px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.card.dash { border-style: dashed; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.t { font-weight: 700; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--chip); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.gm { background: var(--gm-bg); color: var(--gm); }
.pill.pl { background: var(--pl-bg); color: var(--pl); } .pill.off { background: var(--off-bg); color: var(--off); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }
a.btn { text-decoration: none; box-sizing: border-box; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.plain { background: var(--chip); color: var(--ink); }
.btn.danger { background: transparent; color: var(--pl); border: 1px solid var(--pl); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.line { background: #06c755 !important; color: #fff !important; }
label.f { display: block; font-size: 12.5px; color: var(--muted); margin: 10px 0 4px; }
input.i, select.i { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); padding: 8px 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13.5px; min-height: 32px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; margin: 10px 0; }
.err { color: var(--pl); font-size: 13.5px; margin-top: 6px; }
.link-box { word-break: break-all; background: var(--chip); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-top: 8px; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--card); }
table.tb th, table.tb td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
table.tb th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.tbw { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.lvl { display: inline-flex; align-items: center; gap: 6px; }
.lvl b { min-width: 22px; text-align: center; }
.menu { position: fixed; z-index: 41; right: 12px; top: 54px; width: 260px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; }
.scrim { position: fixed; inset: 0; z-index: 40; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: 90vw; box-shadow: var(--shadow); }
@media (min-width: 900px) { .toast { bottom: 24px; } }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; margin: 6px 0; }

/* 挑劇本 */
.scen-wrap { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .scen-wrap { grid-template-columns: 280px 1fr; } .filters { position: sticky; top: 70px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; } .filters summary { display: none; } }
.fsec { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
.fsec:first-child { margin-top: 0; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; padding: 2px 0; }
.check input { width: 18px; height: 18px; }
.res { margin-top: 4px; }
.res div { padding: 8px 10px; border: 1px solid var(--line); border-top: 0; cursor: pointer; background: var(--card); }
.res div:first-child { border-top: 1px solid var(--line); border-radius: 9px 9px 0 0; }
.res div:last-child { border-radius: 0 0 9px 9px; }
.res div:only-child { border-radius: 9px; }
.res div:hover { background: var(--chip); }
.season { margin-bottom: 18px; }
.season-h { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.tile { border-radius: 9px; padding: 7px 9px; border: 1px solid var(--line); border-left-width: 4px; background: var(--card); cursor: pointer; font-size: 13px; line-height: 1.35; }
.tile b { display: block; }
.tile .m { font-size: 11.5px; }
.tile.ok { border-left-color: var(--ok); }
.tile.re { border-left-color: var(--re); background: var(--re-bg); }
.tile.gm { border-left-color: var(--gm); background: var(--gm-bg); }
.tile.pl { border-left-color: var(--pl); background: var(--pl-bg); }
.tile.pl b { text-decoration: line-through; color: var(--muted); }
.tile.sel { outline: 2px solid var(--accent); }
.pill.re { background: var(--re-bg); color: var(--re); }
.scrim { background: rgba(0,0,0,.3); }
.menu ~ .scrim, .scrim:has(+ .menu) { background: transparent; }
.drawer { position: fixed; z-index: 41; background: var(--card); box-shadow: var(--shadow); overflow: auto; left: 0; right: 0; bottom: 0; max-height: 82vh; border-radius: 16px 16px 0 0; padding: 16px 18px 28px; }
@media (min-width: 900px) { .drawer { left: auto; top: 0; bottom: 0; width: 420px; max-height: none; border-radius: 0; } }
/* 公開首頁、新手入門 */
.hero { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 16px 18px; margin: 6px 0 8px; }
.hero h1 { font-size: 24px; margin: 0 0 6px; }
.hero p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.stat .big { font-size: 28px; }
.steps { display: grid; gap: 10px; margin-top: 8px; }
.steps img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }

/* 開桌報名 */
.pill.full { background: var(--gm); color: #fff; }
.tfilter { margin: 8px 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: var(--card); border: 0; padding: 5px 14px; cursor: pointer; font-size: 13.5px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
h2.tday { color: var(--ink); font-size: 15px; margin-top: 18px; }
.tcard { cursor: pointer; }
.tcard:hover { border-color: var(--accent); }
.tcard.dim { opacity: .55; }
.tc-when { color: var(--accent); font-size: 13px; font-weight: 700; }
.tc-title { font-size: 16.5px; font-weight: 700; margin: 2px 0; }
.seatbar { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--ok); }
.dots i.on { background: var(--ok); }
.calnav { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cw { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.cd { min-height: 58px; background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 3px 5px; font-size: 12px; display: flex; flex-direction: column; }
.cd.empty-cd { background: transparent; border: 0; }
.cd b { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cd.has { cursor: pointer; border-color: var(--accent); }
.cd.has b { color: var(--ink); }
.cd.today b { color: var(--accent); }
.cd.sel { outline: 2px solid var(--accent); }
.cd .cn { font-weight: 700; }
.cd .co { color: var(--ok); font-size: 11px; }
.tdetail { display: grid; gap: 0 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .tdetail { grid-template-columns: 1fr 340px; grid-template-areas: "a b" "c b"; }
  .tdetail .ta { grid-area: a; } .tdetail .tb2 { grid-area: b; } .tdetail .tc { grid-area: c; }
  .tdetail .tb2 > .signbox { position: sticky; top: 70px; }
}
.facts > div { display: flex; gap: 10px; padding: 4px 0; align-items: center; flex-wrap: wrap; }
.fk { flex: 0 0 38px; color: var(--muted); font-size: 13px; }
.signbox { border: 2px solid var(--accent); }
.sb-big { font-size: 18px; font-weight: 800; }
.sb-big.ok { color: var(--ok); } .sb-big.re { color: var(--re); } .sb-big.off { color: var(--muted); }
.warn { color: var(--gm); font-size: 13px; margin-top: 4px; }
.roster { padding: 4px 14px; }
.rr { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rr:last-child { border-bottom: 0; }
.rn { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--chip); text-align: center; font-size: 12px; line-height: 22px; font-weight: 700; margin-top: 1px; }
/* 手機上報名鈕黏在底部分頁列上方（照 StartPlaying），捲到哪都按得到 */
@media (max-width: 899px) {
  .stick { position: fixed; left: 0; right: 0; bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 19; background: var(--card); border-top: 1px solid var(--line); padding: 0 16px 10px; }
  main:has(.stick) { padding-bottom: 90px; }
}
