:root {
  --bg: #f3f5f7; --surface: #ffffff; --ink: #142030; --muted: #5a6779; --line: #d8dee6;
  --sign: #1452a3; --sign-ink: #ffffff; --chip: #eef2f6;
  --ok: #2b8a3e; --ok-bg: #e3f3e6; --warn: #b7791f; --warn-bg: #fdf0d5; --bad: #c92a2a; --bad-bg: #fde4e4; --off: #7b8794; --off-bg: #eceff2;
  --font-ui: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-num: "Barlow Condensed", "Arial Narrow", "Noto Sans TC", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141b; --surface: #16202b; --ink: #e5ecf4; --muted: #9eb0c3; --line: #2a3747; --sign: #4c8fe8; --sign-ink: #0b1220; --chip: #1f2a37;
    --ok: #5ccf74; --ok-bg: #173323; --warn: #e3ac52; --warn-bg: #3a2e14; --bad: #ff7b7b; --bad-bg: #3d1c1c; --off: #8a97a5; --off-bg: #222c37;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141b; --surface: #16202b; --ink: #e5ecf4; --muted: #9eb0c3; --line: #2a3747; --sign: #4c8fe8; --sign-ink: #0b1220; --chip: #1f2a37;
  --ok: #5ccf74; --ok-bg: #173323; --warn: #e3ac52; --warn-bg: #3a2e14; --bad: #ff7b7b; --bad-bg: #3d1c1c; --off: #8a97a5; --off-bg: #222c37;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 16px; line-height: 1.55;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.wrap { max-width: 860px; margin: 0 auto; display: grid; gap: 16px; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(22px, 5vw, 30px); }
h2 { font-size: 19px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--sign); }
button { font: inherit; color: inherit; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.top { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.login-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: end; background: var(--ok-bg, #e3f3e6); color: var(--ink); border: 1px solid color-mix(in srgb, var(--ok, #2b8a3e) 45%, transparent); border-radius: 999px; padding: 6px 12px; font-size: 14px; line-height: 1.3; }
.login-badge:empty { display: none; }
.login-badge .lb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok, #2b8a3e); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok, #2b8a3e) 25%, transparent); }
.login-badge.out { background: var(--chip, #eef2f6); border-color: var(--line, #d8dee6); }
.login-badge.out .lb-dot { background: var(--off, #7b8794); box-shadow: none; }
.login-badge button, .login-badge a { background: none; border: 0; padding: 0; color: var(--sign, #1452a3); text-decoration: underline; cursor: pointer; font: inherit; font-weight: 700; }

.psign { flex: none; width: 44px; height: 44px; border-radius: 9px; background: var(--sign); color: var(--sign-ink); display: grid; place-items: center; font-family: var(--font-num); font-weight: 700; font-size: 30px;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sign-ink) 85%, transparent), inset 0 0 0 4px var(--sign); }
.eyebrow { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; }
.btn { appearance: none; border: 0; border-radius: 10px; background: var(--sign); color: var(--sign-ink); padding: 12px 18px; font-weight: 700; cursor: pointer; min-height: 48px; }
.btn.ghost { background: var(--chip); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.linkish { background: none; border: 0; padding: 0; color: var(--sign); text-decoration: underline; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.st-open { color: var(--ok); background: var(--ok-bg); }
.st-busy { color: var(--warn); background: var(--warn-bg); }
.st-full { color: var(--bad); background: var(--bad-bg); }
.st-closed, .st-unknown, .st-paused { color: var(--off); background: var(--off-bg); }
.seg { display: flex; gap: 4px; background: var(--chip); border-radius: 12px; padding: 4px; overflow-x: auto; }
.seg button { flex: 1 0 auto; border: 0; background: none; padding: 10px 12px; border-radius: 9px; font-weight: 700; cursor: pointer; min-height: 44px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
.notice { border-radius: 12px; padding: 12px 14px; background: var(--warn-bg); color: var(--ink); font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--surface); border-radius: 12px; padding: 12px 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 6px 20px rgb(0 0 0 / .3); max-width: calc(100vw - 32px); }
.toast button { background: none; border: 0; color: inherit; text-decoration: underline; font-weight: 700; cursor: pointer; padding: 6px; }
.login { text-align: center; justify-items: center; padding: 28px 18px; }
.login .gbtn { min-height: 44px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
footer { font-size: 13px; color: var(--muted); text-align: center; }
:focus-visible { outline: 3px solid var(--sign); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
