/* 布局：左侧导航 + 顶栏 + 排工主区（左列 散客/排工队列，右侧 时间轴）；手机端底部导航、只看「此刻」。 */
:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --line: #e1e5ea;
  --line-strong: #cdd3da;
  --fg: #17202a;
  --muted: #566170;
  --accent: #1d5a84;
  --accent-fg: #ffffff;
  --accent-soft: #e4eef6;
  --accent-line: #a9c4de;
  --ok-bg: #e5f2ea;
  --ok-fg: #1d5c35;
  --ok-line: #b9d8c3;
  --busy-bg: #e3edf7;
  --busy-fg: #1d4f73;
  --busy-line: #a9c4de;
  --req-bg: #eee8f7;
  --req-fg: #4b2e83;
  --req-line: #c9b8e6;
  --rest-bg: #fbf0d9;
  --rest-fg: #7a4e00;
  --rest-line: #e8cf96;
  --off-bg: #eceef1;
  --off-fg: #4a5260;
  --late-bg: #fdeadb;
  --late-fg: #93330e;
  --late-line: #e9a57a;
  --danger: #b42318;
  --now: #c2410c;
  --overlay: rgba(15, 20, 26, 0.38);
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.14);
  --font-ui: 'IBM Plex Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f141a; --surface: #161d25; --surface-2: #1b232d; --line: #2a3440; --line-strong: #3a4654;
    --fg: #e6ebf1; --muted: #9aa6b4; --accent: #6ca8d6; --accent-fg: #0b1b28; --accent-soft: #1a2b3a; --accent-line: #2f5574;
    --ok-bg: #17301f; --ok-fg: #8fd3a6; --ok-line: #2c5a3b; --busy-bg: #172a3b; --busy-fg: #8ec0e8; --busy-line: #2f5574;
    --req-bg: #261e38; --req-fg: #c7b2f0; --req-line: #4a3a70; --rest-bg: #33280f; --rest-fg: #e9c46a; --rest-line: #6b5420;
    --off-bg: #222a33; --off-fg: #a5b0bc; --late-bg: #3a1e12; --late-fg: #f3a77c; --late-line: #7a3a1c;
    --danger: #f2786b; --now: #f08a4b; --overlay: rgba(0, 0, 0, 0.55); --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f141a; --surface: #161d25; --surface-2: #1b232d; --line: #2a3440; --line-strong: #3a4654;
  --fg: #e6ebf1; --muted: #9aa6b4; --accent: #6ca8d6; --accent-fg: #0b1b28; --accent-soft: #1a2b3a; --accent-line: #2f5574;
  --ok-bg: #17301f; --ok-fg: #8fd3a6; --ok-line: #2c5a3b; --busy-bg: #172a3b; --busy-fg: #8ec0e8; --busy-line: #2f5574;
  --req-bg: #261e38; --req-fg: #c7b2f0; --req-line: #4a3a70; --rest-bg: #33280f; --rest-fg: #e9c46a; --rest-line: #6b5420;
  --off-bg: #222a33; --off-fg: #a5b0bc; --late-bg: #3a1e12; --late-fg: #f3a77c; --late-line: #7a3a1c;
  --danger: #f2786b; --now: #f08a4b; --overlay: rgba(0, 0, 0, 0.55); --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; text-wrap: balance; }

/* 外框 */
.app { display: flex; height: 100%; min-height: 0; }
.rail { flex: 0 0 76px; background: var(--surface-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding-block: 10px; gap: 2px; }
.rail button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; position: relative; }
.rail button[aria-current='page'] { color: var(--accent); font-weight: 600; }
.rail button[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail .badge { position: absolute; top: 4px; right: 16px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .grow { flex: 1; }
.content { flex: 1; min-height: 0; overflow: auto; }
.bottomnav { display: none; }

/* 通用控件 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--fg); font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.big { min-height: 44px; font-size: 15px; padding: 0 16px; }
.btn.sm { min-height: 28px; padding: 0 9px; font-size: 12px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; color: var(--muted); font-size: 13px; min-height: 30px; }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
select.input, input.input, textarea.input { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); }
textarea.input { min-height: 64px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field > span { font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 5px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.chip.ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip.busy { background: var(--busy-bg); color: var(--busy-fg); }
.chip.req { background: var(--req-bg); color: var(--req-fg); }
.chip.rest { background: var(--rest-bg); color: var(--rest-fg); }
.chip.off { background: var(--off-bg); color: var(--off-fg); }
.chip.late { background: var(--late-bg); color: var(--late-fg); }
.chip.line { border-color: var(--line-strong); color: var(--muted); }
.chip.next { background: var(--accent); color: var(--accent-fg); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--now); color: var(--surface); font-size: 11px; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* 排工页 */
.schedule { display: flex; flex-direction: column; min-height: 100%; }
.alerts { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.alert { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; border: 1px solid; }
.alert.late { background: var(--late-bg); border-color: var(--late-line); color: var(--late-fg); }
.alert.info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--busy-fg); }
.alert strong { font-weight: 600; }
.alert .grow { flex: 1; min-width: 8px; }
.alert .btn:not(.primary) { color: var(--fg); }
.sched-body { display: flex; flex-wrap: wrap; flex: 1; align-items: stretch; }
.leftcol { flex: 1 1 300px; max-width: 360px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.rightcol { flex: 999 1 560px; min-width: 0; background: var(--surface); display: flex; flex-direction: column; }

.walkin { margin: 12px; padding: 12px; border-radius: 10px; background: var(--ok-bg); border: 1px solid var(--ok-line); }
.walkin h3 { font-size: 15px; color: var(--ok-fg); }
.walkin .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.walkin ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.walkin li { display: flex; align-items: center; gap: 6px; }
.walkin li .when { margin-left: auto; text-align: right; }
.walkin li.now .when { color: var(--ok-fg); }
.walkin li.dim { color: var(--muted); }

.queue-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px 8px; }
.queue-tools { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.qrow.next { background: var(--accent-soft); }
.qrow.dragging { opacity: 0.4; }
.qrow.dropbefore { box-shadow: inset 0 2px 0 var(--accent); }
.qrow .pos { width: 18px; text-align: right; font-size: 12px; color: var(--muted); }
.qrow .who { flex: 1; min-width: 0; }
.qrow .name { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.qrow .name b { font-size: 14px; }
.qrow .note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.qrow .grip { cursor: grab; color: var(--muted); border: 0; background: transparent; padding: 4px 2px; }
.qrow .namebtn { border: 0; background: transparent; padding: 0; font-weight: 600; font-size: 14px; text-align: left; }
.outq { padding: 10px 12px 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

.menu { position: absolute; z-index: 30; min-width: 180px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.menu button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; font-size: 13px; }
.menu button:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }

/* 时间轴 */
.tl-wrap { overflow-x: auto; flex: 1; }
.tl { position: relative; min-width: 880px; }
.tl-row { display: flex; }
.tl-label { flex: 0 0 132px; padding: 8px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; background: var(--surface); position: sticky; left: 0; z-index: 2; }
.tl-label b { display: block; }
.tl-label .st { font-size: 11px; }
.tl-track { position: relative; flex: 1; border-bottom: 1px solid var(--line); min-height: 58px; cursor: copy; }
.tl-hours { display: flex; position: sticky; top: 0; z-index: 3; background: var(--surface); }
.tl-hours .tl-label { min-height: 0; padding: 6px 12px; font-size: 12px; color: var(--muted); }
.tl-hours .ticks { position: relative; flex: 1; height: 28px; border-bottom: 1px solid var(--line); }
.tl-hours .ticks span { position: absolute; top: 7px; font-size: 11px; color: var(--muted); transform: translateX(3px); }
.tl-grid { position: absolute; inset: 0; pointer-events: none; }
.tl-grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: 0.6; }
.blk { position: absolute; border-radius: 6px; border: 1px solid; padding: 4px 7px; font-size: 12px; line-height: 1.3; overflow: hidden; text-align: left; cursor: pointer; white-space: nowrap; }
.blk b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.blk .s { overflow: hidden; text-overflow: ellipsis; display: block; }
.blk.done { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
.blk.active { background: var(--busy-bg); border-color: var(--busy-line); color: var(--busy-fg); }
.blk.req { background: var(--req-bg); border-color: var(--req-line); color: var(--req-fg); }
.blk.normal { background: var(--surface); border: 1px dashed var(--accent-line); color: var(--busy-fg); }
.blk.pending { background: var(--surface); border: 1px dashed var(--muted); color: var(--muted); }
.blk.late { background: var(--late-bg); border-color: var(--late-line); color: var(--late-fg); }
.blk.released { background: repeating-linear-gradient(135deg, var(--off-bg) 0 5px, transparent 5px 10px); border-color: var(--line-strong); color: var(--muted); }
.blk.unavail { background: repeating-linear-gradient(135deg, var(--rest-bg) 0 5px, transparent 5px 10px); border-color: var(--rest-line); color: var(--rest-fg); cursor: default; }
.tl-off { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--off-bg) 0 5px, transparent 5px 10px); opacity: 0.8; pointer-events: none; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--now); z-index: 4; pointer-events: none; }
.tl-now span { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); background: var(--now); color: var(--surface); font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 3px; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; }
.tl-row.unassigned .tl-label, .tl-row.unassigned .tl-track { background: var(--surface-2); }

/* 弹窗与抽屉 */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow: auto; }
.dialog { width: 100%; max-width: 520px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 10vh); }
.dialog header, .drawer header { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dialog header h2, .drawer header h2 { font-size: 16px; font-weight: 600; }
.dialog .body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog footer, .drawer footer { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.x { margin-left: auto; border: 0; background: transparent; font-size: 20px; line-height: 1; width: 32px; height: 32px; border-radius: 6px; color: var(--muted); }
.drawer-ov { position: fixed; inset: 0; background: var(--overlay); z-index: 40; display: flex; justify-content: flex-end; }
.drawer { width: 100%; max-width: 420px; height: 100%; background: var(--surface); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.drawer .body { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check { padding: 9px 11px; border-radius: 8px; border: 1px solid; font-size: 13px; }
.check.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-fg); }
.check.bad { background: var(--late-bg); border-color: var(--late-line); color: var(--late-fg); }
.check .sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cand { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cand:last-child { border-bottom: 0; }
.cand.rec { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; }
.cand .who { flex: 1; min-width: 0; }
.cand .why { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cand.no .who b { color: var(--muted); }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); }
.log b { color: var(--fg); font-weight: 500; }

.toast-wrap { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border-radius: 10px; background: var(--fg); color: var(--bg); box-shadow: var(--shadow); font-size: 13px; }
.toast.err { background: var(--late-bg); color: var(--late-fg); border: 1px solid var(--late-line); }
.toast .msg { flex: 1; min-width: 0; }
.toast button { border: 0; background: transparent; color: inherit; font-weight: 700; text-decoration: underline; padding: 0; }

/* 其他页面 */
.page { padding: 20px 16px 40px; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page h1 { font-size: 22px; font-weight: 600; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 13px; }
table.list th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--surface-2); }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.mode { text-align: left; padding: 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.mode[aria-pressed='true'] { border: 2px solid var(--accent); padding: 15px; }
.mode b { font-size: 16px; }
.mode .k { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.setrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.setrow:first-child { border-top: 0; }
.setrow .lbl { flex: 1; min-width: 0; }
.setrow .lbl small { display: block; color: var(--muted); font-size: 12px; }
.switch { width: 42px; height: 24px; border-radius: 12px; border: 0; background: var(--line-strong); position: relative; flex: 0 0 auto; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch[aria-checked='true'] { background: var(--accent); }
.switch[aria-checked='true']::after { left: 21px; }
.skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skills label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: 13px; color: var(--fg); }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 16px; background: var(--rest-bg); color: var(--rest-fg); font-size: 12px; border-bottom: 1px solid var(--rest-line); }
.demo-bar .btn { min-height: 26px; font-size: 12px; color: var(--fg); }

@media (max-width: 899px) {
  .rail { display: none; }
  .bottomnav { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border: 0; background: transparent; font-size: 11px; color: var(--muted); position: relative; }
  .bottomnav button[aria-current='page'] { color: var(--accent); font-weight: 600; }
  .bottomnav .badge { position: absolute; top: 2px; right: calc(50% - 22px); }
  .app { flex-direction: column; }
  .main { order: 0; }
  .leftcol { max-width: none; border-right: 0; }
  .topbar { padding: 8px 16px; }
  .hide-sm { display: none !important; }
  .qrow .btn { min-height: 44px; min-width: 72px; font-size: 15px; }
  .drawer { max-width: none; }
}
@media (min-width: 900px) { .show-sm { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* 待到店 */
.arrivals { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.arr-list { display: flex; flex-direction: column; gap: 6px; }
.arr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.arr .who { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: transparent; padding: 0; text-align: left; }
.arr .who span { font-size: 12px; }
.arr .btn { min-height: 40px; }
/* 清洁时间尾巴 */
.tl-clean { position: absolute; border-radius: 0 6px 6px 0; background: repeating-linear-gradient(90deg, var(--line-strong) 0 2px, transparent 2px 5px); opacity: 0.7; pointer-events: none; }
.tl-clean-sw { display: inline-block; width: 16px; height: 10px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 2px, transparent 2px 5px); }
.clock { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.clock b { font-size: 16px; color: var(--fg); }
.chip.soon { background: var(--rest-bg); color: var(--rest-fg); }

/* 设置页 */
.settings { display: flex; min-height: 100%; }
.set-nav { flex: 0 0 260px; border-right: 1px solid var(--line); background: var(--surface-2); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.set-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; background: var(--surface); color: var(--muted); margin-bottom: 6px; }
.set-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13px; color: var(--fg); }
.set-h { font-size: 12px; font-weight: 600; color: var(--muted); padding: 14px 12px 6px; }
.set-nav > button, .set-hits button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 7px; font-size: 14px; color: var(--fg); min-height: 40px; }
.set-nav > button:hover, .set-hits button:hover { background: var(--off-bg); }
.set-nav > button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.set-nav .v { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.set-nav .chev { display: none; color: var(--muted); }
.set-hits { display: flex; flex-direction: column; gap: 2px; }
.set-hits button { flex-direction: column; align-items: flex-start; gap: 1px; }
.set-hits button span { font-size: 12px; color: var(--muted); }
.set-main { flex: 1; min-width: 0; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 14px; max-width: 960px; }
.set-main > div { display: flex; flex-direction: column; gap: 14px; }
.set-back { display: none; align-self: flex-start; border: 0; background: transparent; color: var(--accent); font-size: 15px; padding: 4px 0; }
.set-todo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-radius: 10px; background: var(--rest-bg); border: 1px solid var(--rest-line); color: var(--rest-fg); font-size: 13px; }
.set-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.set-head h1 { font-size: 20px; font-weight: 600; }
.set-head .muted { font-size: 13px; }
.card-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 14px 16px 8px; font-size: 15px; font-weight: 600; }
.card-t .muted { font-size: 12px; font-weight: 400; }
.set-more { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; padding: 12px 16px; font-size: 14px; color: var(--accent); text-align: left; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (max-width: 899px) {
  .settings { flex-direction: column; }
  .set-nav { flex: none; border-right: 0; background: var(--bg); padding: 12px 16px; }
  .set-nav > button { background: var(--surface); border-radius: 0; border-bottom: 1px solid var(--line); min-height: 50px; font-size: 15px; }
  .set-nav > button.on { background: var(--surface); color: var(--fg); font-weight: 400; }
  .set-nav .chev { display: inline; }
  .settings.has-group .set-nav { display: none; }
  .settings:not(.has-group) .set-main { display: none; }
  .set-back { display: inline-block; }
  .set-main { padding: 12px 16px 32px; }
}

/* 房间设置 */
.room-row { display: grid; grid-template-columns: minmax(110px, 1fr) 130px auto minmax(140px, 1fr) auto; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.room-row .seg button { padding: 5px 9px; }
.room-svc summary { cursor: pointer; font-size: 13px; color: var(--accent); list-style: none; }
.room-svc summary::-webkit-details-marker { display: none; }
.room-svc[open] { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.ai-say { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 699px) {
  .room-row { grid-template-columns: 1fr 1fr; row-gap: 6px; }
  .room-row > .seg { grid-column: 1 / -1; }
  .room-row > span.muted { display: none; }
  .room-row > .room-svc { grid-column: 1; }
  .room-row > .room-svc[open] { grid-column: 1 / -1; }
  .room-row > button { justify-self: end; }
}
.room-note { margin-top: 4px; font-weight: 600; }

/* 排工页 · 房间 */
.rooms { margin: 0 12px 12px; }
.rooms-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.rooms-h .muted { font-size: 12px; }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.room { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); text-align: left; font-size: 12px; min-height: 52px; color: var(--fg); }
.room:disabled { cursor: default; opacity: 1; }
.room .rn { font-weight: 600; font-size: 13px; }
.room .rn small { font-weight: 400; color: var(--muted); }
.room .rs { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.room.free { background: var(--ok-bg); border-color: var(--ok-line); }
.room.free .rs { color: var(--ok-fg); }
.room.used { background: var(--busy-bg); border-color: transparent; }
.room.part { background: var(--rest-bg); border-color: var(--rest-line); }

/* 今天提前收工 */
.daybar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 6px 16px; font-size: 13px; background: var(--surface); border-bottom: 1px solid var(--line); }
.daybar > span { flex: 1; min-width: 0; }
.daybar.on { background: var(--rest-bg); color: var(--rest-fg); border-bottom-color: var(--rest-line); }
.chip.count { background: var(--accent-soft); color: var(--accent); }
.start-list { display: flex; flex-direction: column; gap: 4px; }
.start-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.start-row .n { width: 22px; text-align: right; color: var(--muted); }
.start-row .nm { flex: 1; }

/* 日报 */
.report { padding: 20px 16px 40px; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.rep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rep-head h1 { font-size: 20px; font-weight: 600; }
.rep-head h1 .muted { font-size: 14px; font-weight: 400; }
.rep-alerts { padding: 10px 14px; border-radius: 10px; background: var(--late-bg); border: 1px solid var(--late-line); color: var(--late-fg); font-size: 13px; }
.rep-alerts ul { margin: 4px 0 0; padding-left: 18px; }
.rep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 600; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.warn { border-color: var(--late-line); background: var(--late-bg); }
.kpi.warn .v, .kpi.warn .s { color: var(--late-fg); }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl .r { text-align: right; }
.tbl tr.sub td { color: var(--muted); font-size: 12px; }
.tbl td.warn { color: var(--late-fg); font-weight: 600; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl tr.void td { color: var(--muted); text-decoration: line-through; }
.rep-row { display: flex; align-items: center; gap: 8px; padding: 6px 16px; font-size: 13px; }
.rep-row .grow, .grow { flex: 1; min-width: 0; }
.rep-kv { padding: 0 16px 10px; grid-template-columns: 130px 1fr; }
.inline-edit { display: inline-flex; gap: 6px; margin-left: 10px; }
.inline-edit .input { width: 80px; padding: 3px 6px; min-height: 28px; }

/* 结账 */
.co-lines { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.co-lines .row { display: flex; justify-content: space-between; gap: 12px; }
.co-lines .row.sub { color: var(--muted); font-size: 13px; padding-left: 12px; }
.co-lines .row.disc { color: var(--ok-fg); }
.co-lines .row.total { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; font-weight: 600; font-size: 16px; }
.co-offers { display: flex; flex-direction: column; gap: 6px; }
.co-offer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.co-offer.on { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid var(--ok-line); font-weight: 600; }
.co-methods { display: flex; flex-wrap: wrap; gap: 6px; }
.co-pay { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.co-pay .nm { min-width: 72px; }
.co-pay .input { width: 110px; }
.co-tip { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--req-bg); color: var(--fg); font-size: 13px; }
.co-who { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.pend { margin: 0 12px 12px; padding: 10px 12px; border-radius: 10px; background: var(--req-bg); border: 1px solid var(--line); }
.pend h3 { font-size: 14px; margin-bottom: 6px; }
.pend .rep-row { padding: 4px 0; }

.pm-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.2fr) auto auto; gap: 8px; align-items: center; }
.punch-row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); font-size: 13px; }
.punch-row > .input:first-child { width: 140px; }
@media (max-width: 699px) { .pm-row { grid-template-columns: 1fr 1fr; } }

/* ---------- 开店向导：字大、按钮大、一屏一件事 ---------- */
.wiz { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: var(--bg); font-size: 18px; line-height: 1.55; }
.wiz-in { max-width: 560px; margin: 0 auto; padding: 18px 20px 0; min-height: 100%; display: flex; flex-direction: column; }
.wiz-top { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.wiz-step { color: var(--muted); font-size: 16px; }
.wiz-link { border: 0; background: transparent; color: var(--accent); font-size: 18px; padding: 8px 4px; min-height: 44px; }
.wiz-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 6px 0 26px; }
.wiz-bar i { height: 6px; border-radius: 3px; background: var(--line); }
.wiz-bar i.done { background: var(--accent-line); }
.wiz-bar i.now { background: var(--accent); }
.wiz h1 { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 700; letter-spacing: 0.01em; }
.wiz-hint { margin: 10px 0 0; color: var(--muted); font-size: 18px; }
.wiz-body { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; }
.wiz-field { display: flex; flex-direction: column; gap: 8px; font-size: 17px; color: var(--muted); }
.wiz-input { width: 100%; min-height: 58px; padding: 0 16px; border: 2px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--fg); font: 500 20px/1.2 var(--font-ui); }
.wiz-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.wiz-input { appearance: auto; }
.wiz-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wiz-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wiz-svc { display: grid; grid-template-columns: 1fr 9.5em; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.wiz-svc.on { border-color: var(--accent-line); }
.wiz-svc.custom { grid-template-columns: 1fr; }
.wiz-svc-name { font-size: 19px; font-weight: 600; }
.wiz-svc-row { display: grid; grid-template-columns: 1fr 9.5em auto; gap: 10px; align-items: center; }
.wiz-price { position: relative; display: block; }
.wiz-price span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; pointer-events: none; }
.wiz-price .wiz-input { padding-left: 32px; }
.wiz-price .wiz-input::placeholder { font-size: 15px; }
.wiz-add { min-height: 56px; border: 2px dashed var(--line-strong); border-radius: 14px; background: transparent; color: var(--accent); font-size: 18px; font-weight: 600; }
.wiz-pick { min-height: 64px; border-radius: 14px; border: 2px solid transparent; font-size: 20px; font-weight: 700; }
.wiz-pick.f { background: var(--req-bg); color: var(--req-fg); border-color: var(--req-line); }
.wiz-pick.m { background: var(--busy-bg); color: var(--busy-fg); border-color: var(--busy-line); }
.wiz-pick:disabled { opacity: 0.45; }
.wiz-count { margin: 6px 0 0; color: var(--muted); font-size: 17px; }
.wiz-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wiz-people li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 8px 0 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.wiz-people b { font-size: 20px; }
.wiz-g { font-size: 16px; font-weight: 600; min-width: 44px; min-height: 36px; padding: 2px 12px; border-radius: 999px; border: 1px solid transparent; }
.wiz-g.f { background: var(--req-bg); color: var(--req-fg); border-color: var(--req-line); }
.wiz-g.m { background: var(--busy-bg); color: var(--busy-fg); border-color: var(--busy-line); }
.wiz-line { display: block; }
.wiz-nowrap { white-space: nowrap; }
.wiz-people .wiz-x { margin-left: auto; }
.wiz-x { min-height: 48px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; color: var(--danger); font-size: 17px; }
.wiz-stepper { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); }
.wiz-stepper > div:first-child { display: flex; flex-direction: column; }
.wiz-stepper b { font-size: 21px; }
.wiz-stepper span { color: var(--muted); font-size: 16px; }
.wiz-num { display: flex; align-items: center; gap: 6px; flex: none; }
.wiz-num button { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface-2); color: var(--fg); font-size: 28px; line-height: 1; }
.wiz-num button:disabled { opacity: 0.35; }
.wiz-num output { min-width: 2.2em; text-align: center; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wiz-choices { display: flex; flex-direction: column; gap: 12px; }
.wiz-choice { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 18px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--fg); }
.wiz-choice b { display: block; font-size: 21px; }
.wiz-choice small { display: block; margin-top: 4px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.wiz-choice.on { border-color: var(--accent); background: var(--accent-soft); }
.wiz-dot { flex: none; width: 26px; height: 26px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.wiz-choice.on .wiz-dot { border: 8px solid var(--accent); }
.wiz-review { margin: 0; display: flex; flex-direction: column; }
.wiz-review div { display: grid; grid-template-columns: 5em 1fr auto; gap: 10px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.wiz-review dt { color: var(--muted); font-size: 17px; }
.wiz-review dd { margin: 0; font-size: 19px; font-weight: 500; word-break: break-word; }
.wiz-review .wiz-link { min-height: 40px; padding: 4px 10px; }
.wiz-foot { position: sticky; bottom: 0; margin-top: auto; padding: 18px 0 20px; background: linear-gradient(to bottom, transparent, var(--bg) 22px); }
.wiz-err { margin: 0 0 10px; color: var(--danger); font-size: 18px; font-weight: 600; }
.wiz-next { width: 100%; min-height: 62px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-fg); font-size: 22px; font-weight: 700; }
.wiz-next:disabled { opacity: 0.6; }
.wiz-calm { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 15px; }
.wiz button:focus-visible, .wiz-input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 420px) {
  .wiz h1 { font-size: 25px; }
  .wiz-svc { grid-template-columns: 1fr; gap: 8px; }
  .wiz-svc-row { grid-template-columns: 1fr 1fr; }
  .wiz-svc-row .wiz-x { grid-column: 1 / -1; justify-self: end; }
  .wiz-num button { width: 50px; height: 50px; }
}

/* ---------- 登录 ---------- */
.login .wiz-in { padding-top: 28px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; margin-bottom: 36px; }
.login-brand b { color: #0e6b5a; }
.login-email { word-break: break-all; color: var(--fg); }
.login-code { font-size: 32px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.login-code::placeholder { letter-spacing: 0.2em; }
.login-more { display: flex; justify-content: space-between; margin-top: 8px; }
.login-more .wiz-link:disabled { color: var(--muted); }
.acct { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; }
.acct b { font-size: 15px; }
