:root {
  color-scheme: light;
  --ink: #20302f;
  --muted: #6d7570;
  --line: #e5e1d8;
  --surface: #fffdf9;
  --canvas: #f5f0e8;
  --accent: #bb6040;
  --accent-dark: #914329;
  --blue: #245b58;
  font-family: Inter, "Noto Sans TC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 0 0, #fffaf1 0, transparent 38%), var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.shell { width: min(100%, 620px); min-height: 100vh; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 20px max(34px, env(safe-area-inset-bottom)); }
.auth-panel { margin-top: 9vh; padding: 32px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 20px 60px rgba(52, 48, 35, .09); }
.brand-mark { width: 48px; height: 48px; display: flex; align-items: end; gap: 5px; padding: 11px; background: var(--ink); border-radius: 16px; }
.brand-mark span { display: block; width: 8px; border-radius: 8px; background: #f7d6b7; }
.brand-mark span:first-child { height: 16px; }
.brand-mark span:last-child { height: 27px; background: #e89269; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 8vw, 38px); letter-spacing: -.05em; }
h2 { margin-bottom: 8px; font-size: 21px; letter-spacing: -.025em; }
.eyebrow { margin: 14px 0 4px; color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.muted { color: var(--muted); line-height: 1.65; }
.tabs, .admin-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 24px 0 18px; padding: 4px; background: #ebe8e0; border-radius: 13px; }
.tab { border: 0; border-radius: 9px; padding: 10px; background: transparent; color: var(--muted); }
.tab.active, .admin-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px rgba(52, 48, 35, .08); font-weight: 850; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: #4f5852; font-size: 13px; font-weight: 800; }
input, select { width: 100%; min-height: 48px; border: 1px solid #d9d6cd; border-radius: 12px; padding: 0 13px; background: var(--surface); color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 91, 88, .12); }
.primary, .secondary, .quiet { min-height: 46px; border-radius: 12px; border: 0; padding: 0 16px; font-weight: 850; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.secondary { background: var(--surface); color: var(--blue); border: 1px solid #bfcfca; }
.quiet { background: transparent; color: var(--muted); }
.full { width: 100%; margin-top: 12px; }
.error { min-height: 20px; margin: 12px 0 0; color: #b42318; font-size: 13px; }
.code-card { margin: 12px 0; padding: 16px; border-radius: 14px; background: #fff2d8; border: 1px solid #e8c982; color: #594814; word-break: break-all; line-height: 1.55; }
.user-list { display: grid; gap: 10px; }
.user-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-actions { display: flex; gap: 6px; margin-top: 8px; }
.user-actions button { min-height: 34px; border: 1px solid #d7d2c8; border-radius: 9px; background: var(--surface); color: #49566a; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; margin-bottom: 16px; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.operator-note { margin-top: 6px; color: #9a3412; font-size: 13px; line-height: 1.4; }
.topbar h1 { margin: 0; font-size: 30px; }
.topbar .eyebrow { margin-top: 0; }
.card, .device-card, .batch-banner { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 10px 28px rgba(52, 48, 35, .035); }
.device-list { display: grid; gap: 12px; }
.device-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; }
.phone-icon { width: 48px; height: 48px; display: grid; place-items: center; background: #e7efea; border-radius: 15px; font-size: 25px; }
.device-name { font-size: 16px; font-weight: 850; }
.device-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.round-input { width: 68px; min-height: 42px; text-align: center; font-size: 18px; font-weight: 800; }
.state { display: inline-flex; margin-top: 7px; padding: 4px 8px; border-radius: 999px; background: #e7efea; color: var(--blue); font-size: 11px; font-weight: 800; }
.stop-button { grid-column: 2 / 4; min-height: 40px; border: 1px solid #f0b8aa; background: #fff6f3; color: #a73520; border-radius: 11px; font-weight: 800; }
.batch-banner { margin-bottom: 12px; color: #315752; line-height: 1.55; background: #edf4ef; border-color: #cde0d4; }
.card { margin-top: 12px; }
.card-heading { display: flex; justify-content: space-between; }
.admin-nav { width: 100%; margin-top: 0; }
.admin-tab { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 0; border-radius: 9px; padding: 8px; background: transparent; color: var(--muted); font-size: 13px; }
.admin-panel { display: grid; gap: 12px; }
.admin-panel .card { margin-top: 0; }
.admin-intro { padding: 10px 4px 2px; }
.admin-intro .eyebrow { margin-top: 0; }
dialog { width: min(calc(100% - 28px), 500px); border: 0; border-radius: 22px; padding: 0; box-shadow: 0 24px 70px rgba(15, 25, 40, .24); }
dialog::backdrop { background: rgba(18, 25, 38, .5); backdrop-filter: blur(3px); }
.dialog-card { padding: 22px; }
.summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.total { margin: 16px 0; font-size: 17px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
@media (max-width: 380px) { .device-card { grid-template-columns: 42px 1fr auto; } .shell { padding-inline: 12px; } .auth-panel { padding-inline: 20px; } .admin-tab { font-size: 12px; } }
