:root {
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  color: #172522;
  background: #fff;
  font-synthesis: none;
  --ink: #172522;
  --muted: #66766e;
  --line: #dae3dc;
  --soft: #f6f8f5;
  --green: #176b45;
  --green-soft: #e9f5ed;
  --amber: #925308;
  --amber-soft: #fff3dc;
  --red: #b4342d;
  --red-soft: #fff0ee;
  --blue: #155f86;
  --blue-soft: #eaf5fa;
  --shadow: 0 10px 30px rgba(24, 50, 33, .055);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #fff; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #80bca0; outline-offset: 2px; }
a { color: var(--green); }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.app-shell { min-height: 100vh; }
.connection-banner { display: none; background: #b4342d; color: #fff; padding: 9px 18px; text-align: center; font-size: 12px; font-weight: 750; }
.connection-banner.visible { display: block; }
.topbar { display: flex; align-items: center; gap: 25px; min-height: 72px; padding: 10px max(24px, calc((100vw - 1520px)/2)); border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { background: #213c2b; color: #fff; border-radius: 10px; width: 37px; height: 37px; display: grid; place-items: center; font-size: 16px; font-weight: 900; letter-spacing: -.1em; padding-right: 2px; }
.brand b { font-size: 15px; display: block; line-height: 1.05; }
.brand small { color: #7c8c81; font-size: 9px; letter-spacing: .14em; }
.nav { display: flex; align-items: center; gap: 5px; }
.nav button { border: 0; background: none; color: #52675b; border-radius: 10px; font-weight: 750; font-size: 14px; padding: 11px 15px; white-space: nowrap; }
.nav button:hover { background: var(--soft); }
.nav button.active { background: var(--green-soft); color: var(--green); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.sync-state { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--muted); font-size: 12px; }
.sync-state i { height: 8px; width: 8px; border-radius: 50%; background: #23a667; }
.sync-state.offline i { background: #d04e47; }
.container { max-width: 1520px; margin: 0 auto; padding: 26px 24px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 0 0 22px; }
.page-head h1 { margin: 0; font-size: clamp(25px, 2.6vw, 33px); font-weight: 860; letter-spacing: -.04em; }
.page-head p { color: var(--muted); margin: 6px 0 0; font-size: 13px; line-height: 1.55; }
.eyebrow { color: #7b9b83; text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .19em; margin-bottom: 6px; }
.head-actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 750; min-height: 39px; }
.btn:hover:not(:disabled) { border-color: #9ebbab; background: #f8fbf8; }
.btn.primary { color: #fff; border-color: var(--green); background: var(--green); }
.btn.primary:hover:not(:disabled) { background: #115535; }
.btn.ghost { border-color: transparent; }
.btn.warn { color: var(--amber); border-color: #efdcbb; background: var(--amber-soft); }
.btn.danger { color: var(--red); border-color: #f2d3d0; background: var(--red-soft); }
.btn.small { min-height: 30px; padding: 6px 10px; border-radius: 8px; font-size: 11px; }
.btn.big { min-height: 48px; font-size: 15px; }
.panel { border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.panel.pad { padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 16px; }
.muted { color: var(--muted); }
.minor { color: #839188; font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; font-size: 11px; line-height: 1.2; border-radius: 7px; font-weight: 760; white-space: nowrap; background: var(--soft); color: #52645a; }
.badge.green { color: var(--green); background: var(--green-soft); }
.badge.amber { color: var(--amber); background: var(--amber-soft); }
.badge.red { color: var(--red); background: var(--red-soft); }
.badge.blue { color: var(--blue); background: var(--blue-soft); }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 325px; align-items: start; gap: 18px; }
.sticky { position: sticky; top: 92px; }
.table-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 10px; }
.zone-label { color: #799080; font-size: 12px; font-weight: 750; margin: 19px 0 10px; display: flex; align-items: center; gap: 10px; }
.zone-label:first-child { margin-top: 0; }
.zone-label:after { content: ''; height: 1px; background: var(--line); flex: 1; }
.table-card { min-height: 116px; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; padding: 13px; transition: .15s; }
.table-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #9dbda8; }
.table-card.open { border-color: #a8c9b1; background: #f5fbf5; }
.table-card.complete { border-color: #93c5a6; background: #ecf8ef; }
.table-card.overdue { border-color: #e6ac8b; background: #fff9f0; }
.table-card.late { border-color: #e9a19c; background: #fff6f4; }
.table-top { display: flex; justify-content: space-between; align-items: start; gap: 6px; }
.table-num { font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -.05em; }
.table-bottom { margin-top: 18px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.table-bottom strong { color: var(--ink); }
.takeaway-entry { width: 100%; min-height: 63px; border: 2px dashed #9fcab0; border-radius: 12px; background: #f3fbf5; color: var(--green); font-weight: 850; font-size: 15px; margin-bottom: 14px; }
.takeaway-entry:hover { background: #e7f5ea; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #e9eee9; }
.list-row:last-child { border-bottom: 0; }
.list-row b { display: block; font-size: 13px; }
.list-row small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.empty { border: 1px dashed #cbd9cd; background: #fafcf9; color: var(--muted); border-radius: 13px; padding: 29px; text-align: center; line-height: 1.6; font-size: 13px; }
.order-columns { display: grid; grid-template-columns: minmax(0,1fr) 355px; gap: 18px; align-items: start; }
.order-status { padding: 18px; margin-bottom: 15px; }
.service-headline { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.service-headline strong { font-size: 29px; letter-spacing: -.05em; }
.service-headline small { color: var(--muted); }
.order-items { margin-top: 13px; display: grid; gap: 7px; }
.ordered-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 11px; background: var(--soft); border-radius: 9px; align-items: center; }
.ordered-line .line-main { font-weight: 750; font-size: 13px; }
.ordered-line .line-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { flex: 1 1 240px; width: 100%; min-width: 0; }
.field-input, .search, .field select, .field textarea { border: 1px solid #cbd9cf; background: #fff; border-radius: 9px; color: var(--ink); padding: 10px 12px; outline: 0; }
.field-input:focus, .search:focus, .field select:focus, .field textarea:focus { border-color: #69a883; }
.categories { display: flex; gap: 6px; overflow: auto; padding-bottom: 13px; }
.category { border: 1px solid var(--line); background: #fff; color: #5e7063; border-radius: 99px; padding: 7px 11px; white-space: nowrap; font-size: 12px; font-weight: 700; }
.category.active { color: #fff; border-color: var(--green); background: var(--green); }
.menu-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.menu-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; min-height: 135px; gap: 10px; }
.menu-card.soldout { background: #f8f8f7; }
.menu-name { font-size: 15px; font-weight: 820; }
.menu-fr { color: #7c8c81; font-size: 11px; margin-top: 3px; line-height: 1.3; }
.menu-card-bottom { display: flex; justify-content: space-between; align-items: end; gap: 6px; }
.price { font-weight: 820; font-size: 14px; }
.add-button { border: 1px solid var(--green); background: var(--green-soft); color: var(--green); border-radius: 9px; min-width: 35px; height: 34px; font-size: 19px; line-height: 1; font-weight: 800; }
.add-button:hover { background: #d9ecdf; }
.basket { padding: 18px; }
.basket-row { padding: 11px 0; border-bottom: 1px solid var(--line); }
.basket-row:first-child { padding-top: 0; }
.basket-row:last-child { border-bottom: 0; }
.basket-row-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 780; font-size: 13px; }
.quantity { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.quantity button { width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.quantity strong { min-width: 15px; text-align: center; }
.basket-row input { width: 100%; margin-top: 9px; }
.quick-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.quick-tag { border: 1px solid var(--line); border-radius: 99px; padding: 5px 8px; color: #52675b; background: #fff; font-size: 10px; }
.quick-tag.active { color: var(--green); background: var(--green-soft); border-color: #8cbea0; font-weight: 800; }
.total { display: flex; justify-content: space-between; align-items: center; margin: 15px 0; padding-top: 15px; border-top: 1px solid var(--line); }
.total b { font-size: 19px; }
.basket-actions { display: grid; gap: 8px; }
.basket-actions .btn { width: 100%; }
.hint { color: var(--muted); font-size: 11px; line-height: 1.55; }
.kitchen-tools { display: flex; gap: 8px; align-items: center; }
.kitchen-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 14px; align-items: start; }
.kitchen-list { display: grid; grid-template-columns: repeat(4,minmax(180px,1fr)); gap: 11px; align-items: start; }
.kitchen-card { border: 2px solid #b8d0bf; background: #fff; border-radius: 14px; overflow: hidden; }
.kitchen-card.overdue { border-color: #eeb576; background: #fffaf1; }
.kitchen-card.late { border-color: #e57b74; background: #fff8f7; }
.kitchen-card.rush { animation: rush-border 850ms linear infinite; }
@keyframes rush-border {
  0%, 100% { border-color: #b42318; box-shadow: 0 0 0 0 #dc262633; }
  50% { border-color: #ff2115; box-shadow: 0 0 0 6px #dc262633; }
}
.kitchen-card-head { padding: 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 9px; align-items: start; }
.kitchen-code { font-size: 31px; font-weight: 900; line-height: 1; letter-spacing: -.05em; }
.kitchen-meta { text-align: right; color: var(--muted); font-size: 11px; line-height: 1.55; }
.kitchen-meta b { color: var(--green); font-size: 13px; }

/* 断档提醒：这桌上过菜、还有菜没出，就一直显示，不是到点才弹出来的警报。
   数字从第一分钟就在，颜色才是在催 —— 门槛是后台「上道出菜后断档」那一栏，翻倍变深红。 */
.kitchen-stall { display: flex; align-items: center; gap: 12px; padding: 9px 14px;
  border-bottom: 1px solid var(--line); background: var(--soft); color: var(--ink); }
.kitchen-stall-what { flex: 1 1 auto; min-width: 0; }
.kitchen-stall-what small { display: block; font-size: 12px; opacity: .85; }
.kitchen-stall-what strong { display: block; font-size: 20px; font-weight: 900; line-height: 1.25; }
.kitchen-stall-time { flex: 0 0 auto; text-align: right; }
.kitchen-stall-time small { display: block; font-size: 11px; opacity: .85; }
.kitchen-stall-time b { display: block; font-size: 26px; font-weight: 900; line-height: 1.05; }
.kitchen-stall.overdue { background: var(--amber); color: #fff; border-bottom-color: var(--amber); }
.kitchen-stall.late { background: var(--red); color: #fff; border-bottom-color: var(--red); }

.kitchen-lines { padding: 4px 12px 11px; }
.kitchen-line { padding: 11px 2px; border-bottom: 1px solid var(--line); }
.kitchen-line:last-child { border-bottom: 0; }
.kitchen-dish { display: flex; justify-content: space-between; gap: 7px; font-size: 18px; font-weight: 900; line-height: 1.3; }
.kitchen-dish span:last-child { white-space: nowrap; }
.kitchen-dish-status { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.kitchen-note { margin-top: 7px; font-size: 13px; font-weight: 800; color: var(--red); line-height: 1.4; }
.kitchen-line-meta { display: flex; gap: 5px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.kitchen-wait-time { padding: 5px 8px; border-radius: 7px; background: #fff3d6; color: #765000; font-size: 12px; font-weight: 850; white-space: nowrap; }
.kitchen-aggregate { padding: 16px; }
.aggregate-row { border-bottom: 1px solid var(--line); padding: 9px 0; }
.aggregate-row:last-child { border: 0; }
.aggregate-row b { display: flex; justify-content: space-between; font-size: 13px; }
.aggregate-row small { color: var(--muted); font-size: 10px; }
#kitchen-screen:fullscreen { position: relative; background: #fff; padding: 18px; overflow: auto; }
#kitchen-screen:fullscreen.kitchen-layout { grid-template-columns: minmax(0,1fr) 310px; align-items: start; }
#kitchen-screen:fullscreen .kitchen-list { grid-template-columns: repeat(auto-fill,minmax(250px,1fr)); gap: 16px; }
#kitchen-screen:fullscreen .kitchen-aggregate { display: block; position: sticky; top: 18px; }
#kitchen-screen:fullscreen .kitchen-code { font-size: 43px; }
#kitchen-screen:fullscreen .kitchen-dish { font-size: 27px; }
#kitchen-screen:fullscreen .kitchen-wait-time { font-size: 16px; padding: 7px 10px; }
#kitchen-screen:fullscreen .kitchen-note { font-size: 19px; }
#kitchen-screen:fullscreen .kitchen-line { padding: 16px 2px; }
.expo-grid { display: grid; grid-template-columns: repeat(3,minmax(260px,1fr)); gap: 13px; }
.expo-card { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.expo-card.overdue { border-color: #e8bc91; }
.expo-card.late { border-color: #e5a5a0; }
.expo-card.complete { border-color: #9bcbae; background: #fcfffc; }
.expo-head { display: flex; justify-content: space-between; align-items: start; gap: 8px; border-bottom: 1px solid var(--line); padding: 15px; }
.expo-code { font-weight: 900; font-size: 28px; line-height: 1; }
.expo-code-fr { margin-top: 5px; color: var(--muted); font-size: 11px; }
.expo-meta { margin-top: 7px; font-size: 11px; color: var(--muted); }
.expo-content { padding: 4px 13px 12px; }
.expo-line { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.expo-line:last-child { border-bottom: 0; }
.expo-line.drink { background: var(--blue-soft); border: 1px solid #c7e4f0; border-radius: 9px; padding: 10px; margin: 7px 0; }
.expo-name { font-size: 15px; font-weight: 820; }
.expo-fr { color: var(--muted); font-size: 11px; margin-top: 2px; }
.expo-note { color: var(--red); font-size: 11px; font-weight: 700; margin-top: 5px; }
.expo-qty { color: var(--muted); font-size: 11px; margin-top: 5px; }
.expo-foot { padding: 12px 13px; border-top: 1px solid var(--line); background: #fbfcfa; display: grid; gap: 8px; }
.expo-foot .btn { width: 100%; }
.undo { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid #e8d09d; background: #fffae9; color: #75510b; margin-bottom: 14px; font-size: 12px; }
.kitchen-alerts { position: fixed; z-index: 45; top: 90px; right: 24px; width: min(440px,calc(100vw - 32px)); display: grid; gap: 10px; pointer-events: none; }
.kitchen-alert { border: 4px solid #bd1717; border-radius: 15px; background: #fff1f0; color: #741414; padding: 17px 20px; box-shadow: 0 14px 44px #8d000055; animation: alert-flash 620ms steps(2,end) infinite; }
.kitchen-alert strong { display: block; font-size: 20px; }
.kitchen-alert-dish { margin-top: 5px; font-size: 21px; font-weight: 900; line-height: 1.35; }
.kitchen-alert small { display: block; margin-top: 6px; font-size: 12px; font-weight: 800; }
@keyframes alert-flash { 0%,100% { background: #fff1f0; border-color: #bd1717; } 50% { background: #ffd0cc; border-color: #ff1515; } }
.admin-tabs { display: flex; gap: 5px; overflow: auto; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 17px; }
.admin-tabs button { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.admin-tabs button.active { color: var(--green); background: var(--green-soft); }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 15px; }
.stat { padding: 17px; }
.stat strong { display: block; font-size: 27px; margin: 8px 0 2px; }
.stat small { color: var(--muted); }
.manage-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.manage-card { padding: 12px; border: 1px solid var(--line); border-radius: 11px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.manage-card b { display: block; font-size: 13px; }
.manage-card small { color: var(--muted); font-size: 10px; }
.manage-card .row-actions { justify-content: end; }
.employee-card { align-items: center; }
.employee-card b { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-gate { max-width: 500px; padding: 22px; }
.actor-name { color: #53665a; font-size: 11px; font-weight: 750; white-space: nowrap; }
.stock-input { width: 73px; min-width: 0; padding: 7px 8px; text-align: center; }
.log-row { display: grid; grid-template-columns: 150px 75px 90px 1fr; gap: 9px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.5; }
.log-row:last-child { border-bottom: 0; }
.log-row span:first-child { color: var(--muted); }
.history-row { display: grid; grid-template-columns: 140px 110px 1fr auto; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); align-items: center; font-size: 12px; }
.history-row:last-child { border-bottom: 0; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(18, 37, 25, .48); display: grid; place-items: center; padding: 15px; z-index: 50; }
.modal { width: min(560px,100%); max-height: min(90vh,900px); overflow: auto; background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 25px 80px #17251f42; }
.modal-head { display: flex; justify-content: space-between; gap: 9px; align-items: start; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-head p { color: var(--muted); font-size: 12px; margin: 5px 0 0; }
.modal-close { border: 0; background: var(--soft); border-radius: 8px; padding: 6px 10px; color: var(--muted); }
.field { display: grid; gap: 6px; margin: 11px 0; }
.field label { font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 64px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.modal-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.receipt { border: 1px dashed #aebcad; border-radius: 10px; max-width: 370px; margin: 0 auto; padding: 17px; font-family: "Courier New", monospace; font-size: 12px; }
.receipt h2 { text-align: center; font-size: 19px; margin: 0 0 8px; }
.receipt-rule { border-top: 1px dashed #9dab9d; margin: 9px 0; }
.receipt-line { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.receipt-note { color: var(--muted); font-size: 10px; padding-left: 6px; }
.login-shell { min-height: 100vh; background: #f7faf7; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px,100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 25px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 23px; margin: 14px 0 5px; }
.login-card p { color: var(--muted); font-size: 13px; line-height: 1.5; }
#toast-root { position: fixed; right: 16px; bottom: 17px; z-index: 100; display: grid; gap: 6px; }
.toast { background: #1e3928; color: #fff; padding: 11px 14px; box-shadow: var(--shadow); border-radius: 9px; font-size: 12px; max-width: min(350px,calc(100vw - 32px)); }
.toast.error { background: #ac3c34; }
#print-root { display: none; }
@media (max-width: 1200px) {
  .table-grid { grid-template-columns: repeat(4,minmax(115px,1fr)); }
  .kitchen-list { grid-template-columns: repeat(3,minmax(170px,1fr)); }
  .expo-grid { grid-template-columns: repeat(2,minmax(250px,1fr)); }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; }
  .nav { order: 2; }
  .top-actions { order: 3; flex: 1 0 100%; width: 100%; margin-left: 0; padding-right: 0; justify-content: flex-end; margin-top: 18px; }
}
@media (max-width: 1000px) {
  .topbar { padding: 9px 18px; gap: 12px; }
  .nav { gap: 1px; }
  .nav button { font-size: 12px; padding: 9px 9px; }
  .split-layout, .order-columns { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .kitchen-layout { grid-template-columns: 1fr; }
  .kitchen-aggregate { display: none; }
  #kitchen-screen:fullscreen.kitchen-layout { grid-template-columns: minmax(0,1fr) 260px; }
  #kitchen-screen:fullscreen .kitchen-aggregate { display: block; }
  .container { padding: 20px 18px 85px; }
}
@media (max-width: 680px) {
  .topbar { position: static; gap: 7px; flex-wrap: wrap; }
  .brand { width: auto; }
  .nav { order: 3; width: 100%; overflow: auto; }
  .nav button { flex: 1; }
  .top-actions { position: static; order: 2; flex: 1 0 100%; width: 100%; justify-content: flex-end; margin-left: 0; margin-top: 18px; }
  .sync-state { display: none; }
  .page-head { align-items: start; flex-direction: column; }
  .table-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .table-card { min-height: 101px; padding: 10px; }
  .table-num { font-size: 25px; }
  .table-bottom { margin-top: 11px; }
  .menu-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kitchen-list, .expo-grid, .manage-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .history-row { grid-template-columns: 1fr 1fr; }
  .log-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 430px) {
  .table-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .container { padding: 16px 13px 72px; }
  .modal { padding: 17px; }
}
@media print {
  body > :not(#print-root) { display: none !important; }
  #print-root { display: block; }
  #print-root .receipt { border: 0; width: 80mm; max-width: none; margin: 0; padding: 0; }
  @page { margin: 3mm; size: 80mm auto; }
}

/* ---- 手机端适配:防止内容撑宽页面 ---- */
@media (max-width: 680px) {
  /* 原来这里有 html,body{overflow-x:hidden}。它会让 body 变成滚动容器，
     里面所有 position:sticky 全部失效（类别条就是因此粘不住）。
     真正的溢出已经在各处用 min-width:0 修掉了，这条不再需要。 */
  html, body { max-width: 100%; }
  body { min-width: 0; }
  .app-shell { max-width: 100%; }
  .container, .container > *, .panel, .panel > * { min-width: 0; }
  .categories { min-width: 0; max-width: 100%; }
  .topbar { gap: 8px; padding: 8px 13px; }
  .brand small { display: none; }
  .brand { min-width: 0; flex: 1 1 auto; }
  .actor-name { display: none; }
  .nav { min-width: 0; }
  .nav button { flex: 1 1 0; min-width: 0; padding: 10px 4px; font-size: 13px; }
  .order-columns, .split-layout { grid-template-columns: minmax(0,1fr); }
  .order-columns > *, .split-layout > * { min-width: 0; }
  .ordered-line { flex-wrap: wrap; row-gap: 6px; }
  .ordered-line > * { min-width: 0; }
  .menu-card * { min-width: 0; overflow-wrap: anywhere; }
  table { max-width: 100%; }
}

/* ---- 出菜口:已上桌 / 已退 的对比 ---- */
.expo-line.done { background: #eef4ef; border-left: 4px solid #86b89a; border-radius: 8px;
  padding-left: 10px; margin: 5px 0; opacity: .5; }
.expo-line.done .expo-name { text-decoration: line-through; }
.expo-line.voided { opacity: .42; }
.expo-line.voided .expo-name { text-decoration: line-through; }

/* ---- 出菜口:今日已完单 ---- */
.expo-done { margin-bottom: 14px; }
.expo-done-head { display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 15px; font-size: 15px; font-weight: 750; text-align: left; }
.expo-done-head .minor { margin-left: auto; font-weight: 600; }
.expo-done-list { display: grid; gap: 6px; margin-top: 8px; }
.expo-done-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; }
.expo-done-row.cashed { opacity: .5; }
.expo-done-row.cashed b { text-decoration: line-through; }
.expo-done-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  flex: 1 1 auto; min-width: 0; border: 0; background: none; padding: 0;
  font-size: 14px; text-align: left; }
.expo-done-main .minor { margin-left: auto; white-space: nowrap; }

/* ---- 点单:整张菜品卡可点 ---- */
.menu-card[data-action] { cursor: pointer; }
.menu-card[data-action]:active { background: #f4faf5; border-color: #9ec9ad; }

/* ---- 出菜口:已上齐折叠区 ---- */
.expo-served { margin-bottom: 14px; }
.expo-served-head { display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 15px; font-size: 15px; font-weight: 750; text-align: left; }
.expo-served-head .minor { margin-left: auto; font-weight: 600; }
.expo-served-brief { display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  padding: 9px 4px 0; }
.expo-served-chip { border: 0; font-size: 13px; padding: 6px 12px; }

/* ===================================================================
   出菜口重做：字大、留白紧、中法对比清楚
   放在文件末尾，覆盖上面的旧规则
   =================================================================== */

/* 宽屏自动多排几列，别把卡片拉成一片空白 */
.expo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.expo-card { border: 2px solid #d3ded6; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.expo-card.overdue { border-color: #e8a85f; }
.expo-card.late { border-color: #dd5a52; }

.expo-head { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; border-bottom: 2px solid #eef2ee; padding: 12px 14px; }
.expo-code { font-weight: 900; font-size: 30px; line-height: 1.05; letter-spacing: -.02em;
  display: flex; align-items: center; }
.expo-meta { margin-top: 5px; font-size: 13px; color: #6b7c72; }
.expo-seq { display: inline-grid; place-items: center; width: 27px; height: 27px; margin-right: 9px;
  background: var(--green); color: #fff; font-size: 15px; font-weight: 900; border-radius: 99px; flex: none; }
.expo-pending { font-size: 19px; font-weight: 900; white-space: nowrap; padding: 7px 12px;
  border-radius: 9px; background: #fde9c8; color: #7d4a06; }
.expo-pending.clear { background: var(--green-soft); color: var(--green); font-size: 16px; }

.expo-content { padding: 8px 10px; display: grid; gap: 7px; }

/* 还没上的菜：整行就是按钮 */
.expo-line { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 11px; border: 0; border-radius: 11px; background: #f7faf7; margin: 0; }
.expo-line.tappable { cursor: pointer; background: #fff; border: 2px solid #c6ddcd;
  -webkit-tap-highlight-color: transparent; user-select: none; transition: background .08s, transform .07s; }
.expo-line.tappable:hover { background: var(--green-soft); border-color: #93c5a6; }
.expo-line.tappable:active { background: #cfe8da; transform: scale(.985); }
.expo-line.tappable:focus-visible { outline: 3px solid #80bca0; outline-offset: 2px; }
.expo-line.drink { background: var(--blue-soft); border-color: #a9d6e8; }
.expo-line.drink:active { background: #c6e4f1; }
.expo-line-text { min-width: 0; flex: 1; }
.expo-line-side { display: flex; align-items: center; gap: 8px; flex: none; }

.expo-name { font-size: 24px; font-weight: 880; line-height: 1.2; letter-spacing: -.02em;
  color: var(--ink); overflow-wrap: anywhere; }
.expo-x { font-size: 24px; font-weight: 900; margin-left: 9px; color: var(--green); }
.expo-fr { color: #55685d; font-size: 16px; margin-top: 3px; line-height: 1.3; overflow-wrap: anywhere; }
.expo-note { color: #b4342d; font-size: 17px; font-weight: 820; margin-top: 6px; line-height: 1.35; }

.expo-flag { display: inline-block; margin: 6px 6px 0 0; padding: 4px 9px; border-radius: 7px;
  font-size: 13px; font-weight: 820; }
.expo-flag.drink { background: #d9edf7; color: #155f86; }
.expo-flag.add { background: var(--green-soft); color: var(--green); }
.expo-flag.rush { background: #ffe0dd; color: #b4342d; }
.expo-flag.ok { background: var(--green-soft); color: var(--green); font-size: 15px; padding: 6px 11px; }
.expo-flag.void { background: #f0eceb; color: #8a7b79; font-size: 15px; padding: 6px 11px; }
.expo-go { font-size: 17px; font-weight: 850; color: var(--green); white-space: nowrap; }
.expo-all-btn { min-height: 52px; font-size: 16px; font-weight: 850; padding: 0 15px;
  border: 2px solid var(--green); color: var(--green); background: var(--green-soft); white-space: nowrap; }
.expo-undo-btn { min-height: 38px; font-size: 14px; padding: 0 12px; }

/* 已上的菜折叠起来 */
.expo-done-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 11px 13px; border: 1px dashed #c6d2c8; border-radius: 10px;
  background: #f3f6f3; color: #5d6f64; font-size: 16px; font-weight: 800; }
.expo-caret { font-size: 14px; font-weight: 750; color: #7b8c81; }
.expo-line.done { background: #f1f4f1; opacity: .72; }
.expo-line.done .expo-name { font-size: 19px; text-decoration: line-through; color: #5f6f66; }
.expo-line.done .expo-x { font-size: 19px; color: #6f8277; }
.expo-line.done .expo-fr { font-size: 14px; }
.expo-line.done.voided { opacity: .5; }

.expo-foot { padding: 11px 12px; border-top: 2px solid #eef2ee; background: #fbfcfa; display: grid; gap: 8px; }
.expo-main-btn { min-height: 60px; font-size: 20px; font-weight: 880; width: 100%; }
.expo-foot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.expo-foot-row .btn { min-height: 50px; font-size: 16px; font-weight: 820; width: 100%; }
.expo-hint { font-size: 14px; color: #6b7c72; line-height: 1.45; }

/* ===================================================================
   后厨：等待时间看得见，同菜汇总看得见
   =================================================================== */
.kitchen-seq { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 10px;
  background: var(--green); color: #fff; font-size: 18px; font-weight: 900; border-radius: 99px;
  vertical-align: middle; }
.kitchen-wait-time { padding: 7px 12px; border-radius: 9px; font-size: 20px; font-weight: 900;
  background: #e8efe9; color: #3c4f44; white-space: nowrap; }
.kitchen-wait-time.warn { background: #ffb02e; color: #3d2600; }
.kitchen-wait-time.late { background: #d91f11; color: #fff; animation: wait-pulse 1s ease-in-out infinite; }
@keyframes wait-pulse { 0%,100% { background: #d91f11; } 50% { background: #ff4034; } }

.kitchen-aggregate { padding: 16px; }
.kitchen-aggregate h2 { font-size: 22px; }
.aggregate-row { border-bottom: 1px solid var(--line); padding: 12px 0; }
.aggregate-row b { display: flex; justify-content: space-between; gap: 10px; font-size: 22px;
  font-weight: 880; line-height: 1.25; }
.aggregate-row small { color: #6b7c72; font-size: 14px; line-height: 1.4; display: block; margin-top: 4px; }
#kitchen-screen:fullscreen .aggregate-row b { font-size: 26px; }
#kitchen-screen:fullscreen .kitchen-wait-time { font-size: 24px; padding: 8px 14px; }

/* ===================================================================
   开台人数：直接点，不弹键盘
   =================================================================== */
.covers-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-top: 4px; }
.covers-btn { min-height: 52px; border: 2px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 11px; font-size: 20px; font-weight: 850; -webkit-tap-highlight-color: transparent; }
.covers-btn:hover { border-color: #93c5a6; background: var(--green-soft); }
.covers-btn.active { border-color: var(--green); background: var(--green); color: #fff; }
.covers-more { margin-top: 9px; }

@media (max-width: 680px) {
  .expo-grid { grid-template-columns: 1fr; }
  .expo-name { font-size: 21px; }
  .expo-foot-row { grid-template-columns: 1fr; }
  .covers-pick { grid-template-columns: repeat(4, 1fr); }
}

/* 后厨菜名要比计时器大，层级才对 */
.kitchen-dish { font-size: 23px; line-height: 1.25; }
.kitchen-note { font-size: 16px; margin-top: 8px; }
.kitchen-code { font-size: 28px; }
.kitchen-line { padding: 13px 2px; }
#kitchen-screen:fullscreen .kitchen-dish { font-size: 30px; }
.expo-grid-sub { margin-top: 10px; }

/* ===== 第五节 2/3/5/6/8 ===== */

/* 8 · 法语加大（只改字号，字重和颜色不动） */
.expo-fr { font-size: 19px; }
.expo-line.done .expo-fr { font-size: 16px; }

/* 3 · 再来一份 */
.expo-plus-btn { min-height: 46px; min-width: 50px; padding: 0 12px; font-size: 19px;
  font-weight: 900; border: 2px solid #b9d3c3; background: #fff; color: var(--green); }
.expo-plus-btn:hover { background: var(--green-soft); border-color: var(--green); }
.expo-plus-btn:active { background: #cfe8da; transform: scale(.94); }
.expo-line.done .expo-plus-btn { min-height: 38px; min-width: 42px; font-size: 16px; }

/* 2 · 等结账横幅：只有桌号 + 完单，金额在展开后的卡片里 */
.expo-paybar { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.expo-pay { display: flex; align-items: stretch; border: 2px solid #9ec9ae;
  border-radius: 12px; overflow: hidden; background: #fff; }
/* 金额拿掉后这条只剩桌号，会缩到 40px 上下 —— 低于 44px 就不好点了，
   所以给个 54px 底高，顺便和右边「完单」按钮齐平。 */
.expo-pay-main { display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; min-height: 54px;
  padding: 9px 15px; border: 0; background: var(--green-soft); color: var(--ink); text-align: left; }
.expo-pay-main b { font-size: 19px; font-weight: 900; line-height: 1.1; }
.expo-pay-done { align-self: stretch; display: flex; align-items: center; justify-content: center;
  border: 0; border-left: 2px solid #9ec9ae; border-radius: 0; white-space: nowrap;
  padding: 0 17px; font-size: 16px; font-weight: 850; background: #fff; color: var(--green); }
.expo-pay-done:hover { background: var(--green); color: #fff; }
.expo-served-head b { font-size: 18px; }

/* 5 · 后厨打包单区分（只换边框和加标签，卡片底色不动） */
.kitchen-card.takeaway { border-color: #6d28b8; border-width: 3px; }
.kind-tag { display: inline-block; vertical-align: middle; margin-right: 9px; padding: 4px 10px;
  border-radius: 8px; font-size: 15px; font-weight: 880; }
.kind-tag.away { background: #6d28b8; color: #fff; }

/* 6 · 同菜汇总：桌号放大成色块，堂食绿 / 打包紫 */
.aggregate-row { padding: 14px 0; }
.agg-split { display: inline-block; margin-top: 6px; font-size: 15px; font-weight: 800;
  color: #5d6f64; background: #eef2ee; border-radius: 7px; padding: 3px 9px; }
.agg-split.away { background: #f1e7fd; color: #5b279e; }
.agg-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.agg-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 11px;
  border-radius: 9px; font-size: 20px; font-weight: 900; line-height: 1; }
.agg-chip i { font-style: normal; font-size: 15px; font-weight: 800; opacity: .78; }
.agg-chip.here { background: #dcebe1; color: #14512f; }
.agg-chip.away { background: #6d28b8; color: #fff; }
#kitchen-screen:fullscreen .agg-chip { font-size: 24px; padding: 7px 13px; }
#kitchen-screen:fullscreen .kind-tag { font-size: 18px; }

.expo-flag.changing { background: #ffe6c7; color: #8a4b05; }

/* ===================================================================
   整行点击 = 上菜（高频）。＋／− 收在「改」后面，展开后落在行外，互不抢位
   =================================================================== */
.expo-row { display: grid; gap: 0; }

.expo-line { display: flex; justify-content: space-between; align-items: center;
  gap: 14px; padding: 13px 12px; border-radius: 11px;
  background: #f7faf7; border: 2px solid #dfe8e2; }
.expo-line.tappable { cursor: pointer; background: #fff; border-color: #c6ddcd;
  -webkit-tap-highlight-color: transparent; user-select: none;
  transition: background .08s, transform .07s; }
.expo-line.tappable:hover { background: var(--green-soft); border-color: #93c5a6; }
.expo-line.tappable:active { background: #cfe8da; transform: scale(.985); }
.expo-line.tappable:focus-visible { outline: 3px solid #80bca0; outline-offset: 2px; }
.expo-line.drink { background: var(--blue-soft); border-color: #a9d6e8; }
.expo-line.drink:active { background: #c6e4f1; }
.expo-line.changing { background: #fff6ec; border-color: #e8bc91; }

.expo-line-side { display: flex; align-items: center; gap: 14px; flex: none; }
.expo-go { display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-size: 18px; font-weight: 880; color: var(--green); white-space: nowrap; }
.expo-go small { font-size: 11px; font-weight: 700; opacity: .7; }

.expo-serveall-btn { display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; min-width: 86px; min-height: 62px; padding: 0 13px;
  border: 2px solid var(--green); border-radius: 12px; background: var(--green-soft);
  color: var(--green); font-size: 16px; font-weight: 880; line-height: 1.1; }
.expo-serveall-btn:active { background: #cfe8da; transform: scale(.96); }
.expo-serveall-btn small { font-size: 11px; font-weight: 700; opacity: .8; }
.expo-serveall-btn:disabled { opacity: .35; }

/* 「改」：唯一会和整行点击相邻的按钮，所以给足尺寸和间距 */
.expo-edit-toggle { min-width: 58px; min-height: 58px; border-radius: 12px;
  border: 2px solid #ccd8d0; background: #fff; color: #5d6f64;
  font-size: 18px; font-weight: 850; }
.expo-edit-toggle:active { background: #eef2ee; transform: scale(.94); }
.expo-edit-toggle.on { border-color: var(--green); background: var(--green-soft); color: var(--green); }

/* 展开后的增减条：在行的外面 */
.expo-edit { display: flex; gap: 9px; align-items: stretch;
  margin: 7px 0 0; padding: 10px; border-radius: 11px;
  background: #f1f5f2; border: 2px dashed #c6d2c8; }
.expo-edit-btn { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; min-height: 60px; border-radius: 11px;
  font-size: 17px; font-weight: 870; line-height: 1.15; background: #fff; }
.expo-edit-btn small { font-size: 11px; font-weight: 700; opacity: .72; }
.expo-edit-btn.minus { border: 2px solid #e0b4af; color: var(--red); }
.expo-edit-btn.minus:active { background: #ffd9d4; transform: scale(.97); }
.expo-edit-btn.plus { border: 2px solid #b9d3c3; color: var(--green); }
.expo-edit-btn.plus:active { background: #cfe8da; transform: scale(.97); }
.expo-edit-btn:disabled { opacity: .35; }
.expo-edit-close { min-width: 64px; min-height: 60px; border-radius: 11px;
  border: 0; background: transparent; color: #6b7c72; font-size: 15px; font-weight: 800; }

/* 已上的菜：整行不可点，−／＋ 直接放，48px */
.expo-line.done { background: #f4f7f5; border-color: #dde5e0; }
.expo-step { display: flex; gap: 8px; }
.expo-step-btn { min-width: 48px; min-height: 48px; border-radius: 11px;
  font-size: 21px; font-weight: 900; line-height: 1; background: #fff; }
.expo-step-btn.minus { border: 2px solid #e0b4af; color: var(--red); }
.expo-step-btn.minus:active { background: #ffd9d4; transform: scale(.94); }
.expo-step-btn.plus { border: 2px solid #b9d3c3; color: var(--green); }
.expo-step-btn.plus:active { background: #cfe8da; transform: scale(.94); }

.expo-content { display: grid; gap: 9px; }

@media (max-width: 680px) {
  .expo-line { flex-direction: column; align-items: stretch; gap: 11px; }
  .expo-line-side { justify-content: space-between; }
  .expo-edit { flex-wrap: wrap; }
  .expo-edit-btn { min-width: 44%; }
}

/* 等结账：金额占据右上角最显眼的位置 */
.expo-pending.clear { display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  background: var(--green-soft); color: var(--green); padding: 7px 13px; text-align: right; }
.expo-pending.clear small { font-size: 11px; font-weight: 750; opacity: .75; }
.expo-total { font-size: 23px; font-weight: 900; letter-spacing: -.02em; line-height: 1.05; }
.expo-served-hint { margin-top: 7px; font-size: 14px; color: #6b7c72; line-height: 1.45; }

/* 后厨菜名再加大：隔着灶台、手上在忙、只能抖一眼 */
.kitchen-dish { font-size: 30px; font-weight: 900; line-height: 1.2; letter-spacing: -.01em; }
.kitchen-dish span:last-child { font-size: 32px; }
.kitchen-note { font-size: 19px; font-weight: 820; }
.kitchen-line { padding: 16px 2px; }
#kitchen-screen:fullscreen .kitchen-dish { font-size: 42px; }
#kitchen-screen:fullscreen .kitchen-dish span:last-child { font-size: 44px; }
#kitchen-screen:fullscreen .kitchen-note { font-size: 24px; }

/* ===================================================================
   手机点单：菜篮原来在 7700px 处，要滚九屏才够得着。
   改成固定在屏幕底部的一条，份数 / 金额 / 下单始终在手边。
   电脑和平板上右边本来就有常驻菜篮，这条不出现。
   =================================================================== */
.order-bar { display: none; }

@media (max-width: 900px) {
  .order-bar { display: flex; gap: 10px; align-items: stretch;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
    border-top: 2px solid var(--line); box-shadow: 0 -6px 22px rgba(24,50,33,.1); }
  .order-bar-view { display: flex; flex-direction: column; align-items: flex-start;
    justify-content: center; gap: 1px; min-height: 56px; padding: 0 16px;
    border: 2px solid var(--line); border-radius: 12px; background: var(--soft); color: var(--ink); }
  .order-bar-view b { font-size: 16px; font-weight: 880; line-height: 1.1; }
  .order-bar-view span { font-size: 19px; font-weight: 900; color: var(--green); line-height: 1.1; }
  .order-bar-view:disabled { opacity: .45; }
  .order-bar-go { flex: 1; min-height: 56px; font-size: 18px; font-weight: 880; }
  /* 给固定条让出位置，别挡住最后几道菜 */
  main.container { padding-bottom: 92px; }
  /* 类别条跟着滚，找菜时不会丢 */
  .categories { position: sticky; top: var(--topbar-h, 64px); z-index: 12; background: #fff;
    padding: 9px 0; margin: 0 -2px; box-shadow: 0 6px 12px -8px rgba(24,50,33,.25); }
}
