/* ===== 烧烤摊点菜系统 · 响应式样式 ===== */
:root {
  --brand: #c2410c;
  --brand-dark: #9a3412;
  --brand-light: #ffedd5;
  --accent: #f59e0b;
  --green: #16a34a;
  --green-light: #dcfce7;
  --green-text: #15803d;   /* 绿色文字：4.9:1（--green 仅 3.3:1） */
  --red: #dc2626;
  --red-light: #fee2e2;
  --blue: #2563eb;
  --ink: #1c1917;
  --ink-2: #57534e;
  --ink-3: #6f6a65;   /* 辅助信息：白底 5.35:1 / 米底 5.01:1 / 浅橙底 4.67:1（原 #a8a29e 仅 2.52:1） */
  --ink-4: #a8a29e;   /* 仅用于纯装饰/占位，不承载信息 */
  --line: #e7e5e4;
  --bg: #faf7f4;
  --card: #ffffff;
  /* 层次：卡片 / 悬浮件 / 弹窗，三档 */
  --elev-1: 0 1px 2px rgba(28, 25, 23, .05);
  --elev-2: 0 4px 14px rgba(28, 25, 23, .09);
  --elev-3: 0 16px 44px rgba(28, 25, 23, .18);
  --shadow: var(--elev-1);
  /* 间距：4px 基准 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px;
  /* 字号：5 级 + 徽标档 */
  --fs-2xs: 11px; --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 16px; --fs-xl: 26px;
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
small { font-size: 12px; }

/* ---------- 框架 ---------- */
.app { min-height: 100vh; }
.topbar {
  height: 60px;
  background: linear-gradient(100deg, #9a3412, #c2410c 55%, #ea580c);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(154, 52, 18, .25);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; letter-spacing: .5px; }
.brand-text small { opacity: .82; font-size: 11px; }
.topbar-status { display: flex; align-items: center; gap: 12px; }
.net-badge {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
}
.icon-btn {
  background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 9px;
  width: 34px; height: 34px; font-size: 16px; display: grid; place-items: center;
}
.icon-btn:hover { background: rgba(255,255,255,.25); }

.layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar {
  width: 196px; flex: 0 0 196px; background: #fff; border-right: 1px solid var(--line);
  padding: 14px 10px; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; margin-bottom: 4px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); font-size: 14px; text-align: left;
}
.nav-item .nav-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 17px; width: 20px; line-height: 1; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 700; }
.nav-item .nav-count {
  margin-left: auto; background: var(--brand); color: #fff; border-radius: 10px;
  font-size: 11px; min-width: 20px; text-align: center; padding: 0 5px;
}
.main { flex: 1; min-width: 0; padding: 20px 24px 40px; }
.bottom-nav { display: none; }

/* ---------- 通用组件 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 22px; }
.page-sub { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 按钮四档（每屏最多一个 primary）：
   .btn = secondary（白底描边） · .btn-primary · .btn-ghost = tertiary · .btn-danger */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: var(--radius-sm); padding: 8px 14px; font-size: 13px; font-weight: 600;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: var(--red-light); border-color: var(--red); color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: var(--fs-xs); border-radius: var(--radius-sm); }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--elev-1); }
.card-pad { padding: var(--sp-4); }
.card-title { font-size: var(--fs-md); font-weight: 700; display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.muted { color: var(--ink-3); }
.tiny { font-size: var(--fs-xs); }
.strong { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; line-height: 1.6; }
.badge-qr { background: #dbeafe; color: #1d4ed8; }
.badge-pos { background: #fef3c7; color: #92400e; }
.badge-new { background: var(--brand-light); color: var(--brand-dark); }
.badge-done { background: var(--green-light); color: #15803d; }
.badge-warn { background: var(--red-light); color: var(--red); }
.badge-gray { background: #f5f5f4; color: var(--ink-2); }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty .empty-icon { font-size: 36px; display: block; margin-bottom: 8px; }

/* ---------- 首页 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 16px 18px; border-left: 3px solid var(--brand-light); }
.stat-label { font-size: 12px; color: var(--ink-2); }
.stat-value { font-size: var(--fs-xl); font-weight: 800; line-height: 1.25; margin-top: var(--sp-1); }
.stat-value.warn { color: var(--brand); }
.stat-foot { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.entry-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.entry-card {
  padding: 18px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); transition: .15s;
}
.entry-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 8px 22px rgba(194,65,12,.12); }
.entry-icon { font-size: 26px; display: block; margin-bottom: 8px; }
.entry-name { font-weight: 700; font-size: 15px; }
.entry-desc { color: var(--ink-3); font-size: 12px; margin-top: 2px; }

.home-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-no { width: 22px; height: 22px; border-radius: 7px; background: var(--brand-light); color: var(--brand-dark); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.rank-name { flex: 1; }
.rank-bar { height: 7px; background: var(--bg); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.rank-bar > i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.rank-num { font-weight: 700; color: var(--brand-dark); }

/* ---------- 桌台 ---------- */
.table-grid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  align-items: stretch;
}
.table-card { padding: var(--sp-4); position: relative; border-left: 4px solid var(--green); display: flex; flex-direction: column; }
.table-card.busy { border-left-color: var(--brand); }
.table-card.qr { border-left-color: var(--blue); }
.table-head { display: flex; justify-content: space-between; align-items: center; }
.table-no { font-size: var(--fs-md); font-weight: 800; }
.table-meta { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; align-items: center; min-height: 22px; }
.table-amount { font-size: 20px; font-weight: 800; color: var(--brand-dark); }
.table-amount.is-empty { font-size: 18px; color: var(--ink-4); }

/* 操作区：贴底对齐、单行不换行；主操作吃剩余宽度，撤台用图标按钮省宽 */
.table-actions { display: flex; gap: 6px; flex-wrap: nowrap; margin-top: auto; padding-top: 10px; }
.table-actions .btn { margin-top: 0; white-space: nowrap; }
.table-actions .grow { flex: 1 1 auto; min-width: 0; }
.btn-icon { width: 32px; flex: 0 0 32px; padding: 0; font-size: 14px; }
.qc-mini {
  font-size: 11px; font-weight: 700; color: var(--brand-dark); background: var(--brand-light);
  border-radius: 8px; padding: 0 6px; white-space: nowrap;
}

/* ---------- 点菜 ---------- */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.round-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.round-tab {
  border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 14px;
  font-size: 13px; color: var(--ink-2); font-weight: 600;
}
.round-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.round-tab .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.round-tab .dot.new { background: var(--accent); }
.round-tab .dot.done { background: var(--green); }

.cat-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 12px; scrollbar-width: thin; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 20px;
  padding: 5px 14px; font-size: 13px; white-space: nowrap;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.dish-card {
  border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px;
  display: flex; flex-direction: column; gap: 8px; transition: .15s;
}
.dish-card:hover { border-color: var(--brand); }
.dish-emoji { font-size: 30px; height: 42px; display: grid; place-items: center; background: var(--bg); border-radius: 9px; }
.dish-name { font-weight: 700; font-size: 14px; }
.dish-desc { font-size: 11px; color: var(--ink-3); min-height: 16px; }
.dish-bottom { display: flex; align-items: center; justify-content: space-between; }
.dish-price { color: var(--brand-dark); font-weight: 800; }
.dish-price small { font-weight: 400; color: var(--ink-3); }

.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button {
  width: 26px; height: 28px; border: 0; background: var(--bg); color: var(--brand-dark);
  font-size: 16px; font-weight: 700; line-height: 1;
}
.stepper button:hover { background: var(--brand-light); }
.stepper input {
  width: 34px; height: 28px; border: 0; text-align: center; font-weight: 700;
  color: var(--ink); background: #fff; padding: 0; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-panel { position: sticky; top: 78px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cart-list { flex: 1; overflow-y: auto; min-height: 80px; }
.cart-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.cart-row .cart-name { flex: 1; min-width: 0; }
.cart-row .cart-name strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-row .cart-note { font-size: 11px; color: var(--ink-3); }
.cart-row .cart-sum { font-weight: 700; font-size: 13px; min-width: 46px; text-align: right; }
.cart-foot { padding-top: 12px; border-top: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.cart-total span:last-child { color: var(--brand-dark); }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- 出菜看板 v2 ----------
 * 视觉降噪三条规则：
 *   1. 来源（扫码/现场）只在桌头与单头出现，行内不再重复；
 *   2. 进度条只在「部分出齐」时渲染，且为单色（不再橙→绿渐变）；
 *   3. 已出齐的行降级为单行，去掉进度条与禁用按钮，只留撤销。
 */
.board-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.board-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.board-count { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); }
.board-count b { color: var(--ink); }

/* auto-fit：单桌时铺满整行，多桌时自动两列 */
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: var(--sp-4); align-items: start; }
.board-table { overflow: hidden; }

.board-table-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.bth-no { font-size: var(--fs-md); font-weight: 800; }
.bth-sp { flex: 1 1 auto; }
.bth-pending {
  font-size: var(--fs-sm); font-weight: 800; color: var(--brand-dark);
  background: var(--brand-light); border-radius: 8px; padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}

.board-round { border-bottom: 1px solid #f3efeb; }
.board-round:last-child { border-bottom: 0; }
.board-round-head {
  padding: 7px 16px; background: #fbfaf9; border-bottom: 1px solid #f5f1ed;
  display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--ink-2);
}
.brh-label { font-weight: 700; }
.brh-label i { font-style: normal; font-weight: 400; color: var(--ink-3); margin-left: 7px; }
.brh-sp { flex: 1 1 auto; }
.brh-all { height: 26px; padding: 0 10px; font-size: var(--fs-xs); }
/* 本单来源：比 .badge 更轻，避免单头比桌头还重 */
.brh-src {
  flex: 0 0 auto; font-size: var(--fs-2xs); font-weight: 700; line-height: 17px;
  padding: 0 6px; border-radius: 6px; white-space: nowrap;
}
.brh-src.is-qr { color: #1d4ed8; background: #dbeafe; }
.brh-src.is-pos { color: #92400e; background: #fef3c7; }
.brh-all:disabled { opacity: .4; }

/* 一行一菜 */
.k-row { padding: 9px 16px; border-top: 1px solid #f6f2ee; }
.k-row:first-of-type { border-top: 0; }
.k-row.is-late { background: #fffbfa; box-shadow: inset 3px 0 0 var(--red); }
.k-row.is-done { padding-top: 5px; padding-bottom: 5px; background: #fcfcfb; }

/* 一行到底：菜名 — 标记 —（弹性）— 数量 — 操作；放不下时操作整体换到下一行右对齐 */
.k-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.k-name {
  flex: 0 1 auto; min-width: 0; font-weight: 700; font-size: var(--fs-base);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.k-row.is-done .k-name { font-weight: 600; color: var(--ink-2); }
.k-sp { flex: 1 1 auto; min-width: 6px; }
.k-flag {
  flex: 0 0 auto; font-size: var(--fs-2xs); font-weight: 700; line-height: 17px; padding: 0 6px;
  border-radius: 6px; color: #92400e; background: #fef3c7; white-space: nowrap;
}
.k-flag.is-late { color: #b91c1c; background: #fee2e2; }
.k-count { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.k-count.is-done { display: inline-flex; align-items: center; gap: 3px; color: var(--green-text); font-weight: 600; }
.k-pending {
  flex: 0 0 auto; font-size: var(--fs-xs); font-weight: 800; line-height: 18px; padding: 0 7px; border-radius: 6px;
  color: var(--brand-dark); background: var(--brand-light); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.k-bar { height: 3px; background: #f1ede9; border-radius: 2px; overflow: hidden; margin-top: 7px; }
.k-bar > i { display: block; height: 100%; background: var(--brand); border-radius: 2px; transition: width .25s; }
.k-note {
  display: inline-block; margin-top: 6px; font-size: var(--fs-xs); line-height: 18px;
  color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 0 7px;
}

.k-ops { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: auto; }
/* 常态「出菜」用描边：橙色实心只留给催菜 / 超时的行，颜色即优先级 */
.k-serve { border-color: #f3c9ab; color: var(--brand-dark); font-weight: 700; background: #fff; }
.k-serve:hover { background: var(--brand-light); color: var(--brand-dark); }
.k-ops > * { flex: 0 0 auto; }
.k-undo {
  display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; cursor: pointer;
  font-size: var(--fs-xs); color: var(--ink-3); padding: 3px 6px; border-radius: 6px;
}
.k-undo:hover { color: var(--ink); background: #f2eeea; }
.k-more-btn {
  width: 30px; height: 28px; flex: 0 0 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink-3);
}
.k-more-btn.is-open { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); }
.k-more {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px;
  padding: 8px; background: #faf8f6; border-radius: var(--radius-sm);
}

/* ---------- 顾客扫码端 ---------- */
.customer-wrap { max-width: 780px; margin: 0 auto; }
.customer-hero {
  background: linear-gradient(120deg, #7c2d12, #c2410c); color: #fff; border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.customer-hero h2 { font-size: 20px; }
.customer-hero p { margin: 4px 0 0; opacity: .85; font-size: 13px; }
.customer-progress { margin-top: 12px; background: rgba(255,255,255,.15); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.customer-cart { position: sticky; bottom: 12px; margin-top: 14px; }

/* ---------- 结账 / 报表 ---------- */
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th, .detail-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.detail-table th { background: #fafaf9; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.detail-table td.num, .detail-table th.num { text-align: right; }
.round-divider { background: var(--brand-light); font-weight: 700; color: var(--brand-dark); }
.sum-line { display: flex; justify-content: space-between; padding: 7px 0; }
.sum-line.total { font-size: 19px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.sum-line.total span:last-child { color: var(--brand-dark); }
.recv-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); margin-top: 4px; }
.recv-line label { font-weight: 700; white-space: nowrap; }
.recv-input-wrap { display: flex; align-items: center; gap: 6px; }
.recv-cur { font-weight: 800; color: var(--brand-dark); }
.recv-input-wrap input { width: 110px; text-align: right; font-size: 17px; font-weight: 800; padding: 6px 8px; border: 1px solid var(--brand); border-radius: 8px; background: #fff; color: var(--brand-dark); }
.recv-more { color: var(--green-text) !important; font-weight: 700; }
.recv-less { color: var(--red) !important; font-weight: 700; }
.paycode-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.paycode-row:last-child { border-bottom: none; }
.paycode-label { font-weight: 700; margin-right: auto; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 10px 0 16px; }
.pay-opt { border: 1px solid var(--line); border-radius: 10px; padding: 12px 6px; text-align: center; background: #fff; }
.pay-opt.active { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); font-weight: 700; }
.pay-opt .pay-icon { font-size: 20px; display: block; }
.pay-opt .pay-tag { display: block; font-size: 10px; font-weight: 400; color: var(--ink-3); margin-top: 2px; }

/* ---------- 收款方式管理（设置页） ---------- */
.pay-method-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.pay-method-row.is-off { background: #fafaf9; }
.pm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pm-head-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pm-name { font-weight: 700; font-size: 15px; }
.pm-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--brand-light); color: var(--brand-dark); font-size: 10px; font-weight: 600; vertical-align: 1px; }
.pm-ops { display: inline-flex; gap: 4px; margin-left: auto; }
.pm-ops .btn { padding: 3px 8px; font-size: 12px; }
.pm-icon-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pm-icon-pick .btn { padding: 4px 9px; font-size: 15px; }
.pm-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.pm-check input { margin-top: 2px; width: 16px; height: 16px; flex: 0 0 auto; }
.pm-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.pm-sub .btn { padding: 4px 10px; font-size: 12px; }
.pm-hint { flex: 1 0 100%; font-size: 12px; color: var(--ink-3); line-height: 1.6; }

/* 开关：aria-checked 为唯一状态源，disabled 表示当前不可配置 */
.switch { position: relative; width: 46px; height: 26px; flex: 0 0 auto; border: 0; padding: 0; border-radius: 999px; background: #d6d3d1; cursor: pointer; transition: background .18s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .22); transition: left .18s; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"] i { left: 23px; }
.switch:disabled { opacity: .4; cursor: not-allowed; }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 键盘/远程桌面用户：所有可交互元件都有清晰的焦点环 */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [role="button"]:focus-visible, [data-act]:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- 设置 ---------- */
.settings-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.form-row { display: flex; gap: 8px; margin-bottom: 10px; }
.form-row input, .form-row select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; flex: 1; min-width: 0; background: #fff;
}
.form-row input:focus, .form-row select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(194, 65, 12, .16);
}
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th, .mini-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.mini-table th { color: var(--ink-2); font-size: 12px; }

/* 菜品添加表单：带标签的网格，避免窄屏挤压 */
.dish-form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; margin-bottom: 14px; }
.df-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.df-field > span { font-size: 11px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.df-field input, .df-field select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; font-size: 14px; min-width: 0; }
.df-field input:focus, .df-field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(194, 65, 12, .16);
}
.df-name { grid-column: span 2; }
.df-add { height: 38px; white-space: nowrap; }

/* 菜品表格：桌面保持表格，窄屏转卡片 */
.dish-table .dc-emoji { font-size: 18px; width: 34px; }
.dish-table .dc-ops { white-space: nowrap; }
.dish-table .dc-ops .btn { margin: 2px; }

/* 分类管理行 */
.cat-manage-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cat-manage-row:last-of-type { border-bottom: none; }
.cat-manage-name { font-weight: 600; margin-right: auto; }

/* ---------- 二维码 ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.qr-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; background: #fff; }
.qr-card canvas { width: 120px; height: 120px; image-rendering: pixelated; }
.qr-card .qr-no { font-weight: 800; margin-top: 6px; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.modal-mask {
  position: absolute; inset: 0; background: rgba(28,25,23,.45); pointer-events: auto;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 16px; width: min(520px, 100%); max-height: 90vh; overflow-y: auto;
  box-shadow: var(--elev-3); padding: 20px;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close { border: 0; background: var(--bg); width: 28px; height: 28px; border-radius: 8px; font-size: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast-root { position: fixed; top: 72px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: slideIn .2s ease;
}
.toast.ok { background: #15803d; }
.toast.err { background: var(--red); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.scan-box {
  height: 160px; border-radius: 12px; background: linear-gradient(135deg, #292524, #57534e);
  display: grid; place-items: center; color: #fff; position: relative; overflow: hidden; margin-bottom: 14px;
}
.scan-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.scan-line {
  position: absolute; left: 10%; right: 10%; height: 3px; background: #f87171;
  box-shadow: 0 0 12px 3px rgba(248,113,113,.7); animation: scan 1.4s ease-in-out infinite alternate;
}
@keyframes scan { from { top: 12%; } to { top: 86%; } }
.recognize-result { display: flex; align-items: center; gap: 14px; background: var(--bg); border-radius: 12px; padding: 14px; }
.recognize-result .r-emoji { font-size: 36px; }
.recognize-result .r-info { flex: 1; }
.recognize-result .r-conf { font-size: 12px; color: var(--green-text); }

/* ---------- 手机端点菜悬浮栏 / 清单抽屉 ---------- */
.mobile-cart-bar { display: none; }
@keyframes sheetUp { from { transform: translateY(24%); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------- 响应式断点 ---------- */
/* 平板(768-1099)：保留侧边栏 + 紧凑布局，仅调整内容列数 */
@media (max-width: 1099px) {
  .main { padding: 16px 16px 40px; }
  .stats-grid, .entry-grid, .report-grid { grid-template-columns: repeat(2, 1fr); }
  .order-layout, .checkout-grid, .settings-cols { grid-template-columns: minmax(0, 1fr); }
  .cart-panel { position: static; max-height: none; }
  .board-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  /* 手机：隐藏侧栏，启用底部导航（5 项高频操作） */
  .sidebar { display: none; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: #fff; border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    justify-content: center;
  }
  /* 五项等宽平分（flex:1 1 0），图标与文字各自水平居中；
     图标区固定 22px 高，即使某项没有徽标，五项文字基线也齐平 */
  .bottom-nav .nav-item {
    flex: 1 1 0; min-width: 0; width: auto; margin: 0;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 5px 2px; font-size: 11px; line-height: 1.25;
    text-align: center; border-radius: 9px;
  }
  /* 注意排除 .nav-count：:not(.nav-icon) 的特异性 (0,3,1) 高于 .nav-count 的 display:none，
     会把本应隐藏的徽标重新显示出来并撑歪底栏 */
  .bottom-nav .nav-item > span:not(.nav-icon):not(.nav-count) {
    display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .bottom-nav .nav-item .nav-icon { display: flex; width: auto; height: 22px; font-size: 18px; }
  .bottom-nav .nav-item .nav-count { display: none; }
  /* 触屏没有 hover，用按压反馈代替（避免 hover 状态粘在最后点击项上） */
  .bottom-nav .nav-item:hover { background: transparent; }
  .bottom-nav .nav-item:active { background: var(--bg); }
  .bottom-nav .nav-item.active:hover { background: var(--brand-light); }
  .topbar { padding: 0 12px; height: 54px; }
  .brand-text strong { font-size: 14px; }
  .brand-text small { display: none; }
  .net-badge { display: none; }
  .main { padding: 14px 12px 92px; }
  .page-title { font-size: 19px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 21px; }
  .entry-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .entry-card { padding: 13px; }
  .home-cols, .report-cols { grid-template-columns: 1fr; }
  .table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .table-card { padding: 12px; }
  .table-actions { gap: 5px; }
  .btn-icon { flex-basis: 30px; width: 30px; }
  .dish-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pay-grid { grid-template-columns: 1fr 1fr 1fr; }
  .detail-table { font-size: 12px; }
  .detail-table th, .detail-table td { padding: 6px 5px; }

  /* 设置页：添加菜品表单两列，菜品列表改卡片式 */
  .dish-form { grid-template-columns: 1fr 1fr; gap: 10px 8px; }
  .df-name { grid-column: span 2; }
  .df-add { grid-column: span 2; }
  .dish-table thead { display: none; }
  .dish-table, .dish-table tbody, .dish-table tr, .dish-table td { display: block; width: 100%; }
  .dish-table tr { position: relative; padding: 10px 10px 10px 44px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
  .dish-table td { border: none; padding: 2px 0; text-align: left !important; }
  .dish-table td[data-label]:not(.dc-emoji):not(.dc-ops)::before { content: attr(data-label) '：'; color: var(--ink-3); font-size: 11px; }
  .dish-table .dc-emoji { position: absolute; left: 10px; top: 12px; width: auto; font-size: 20px; }
  .dish-table .dc-ops { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
  .dish-table .dc-ops .btn { margin: 0; }

  .toast-root { left: 12px; right: 12px; top: 62px; }
  .toast { text-align: center; }
  .board-table-head, .board-round-head, .k-row { padding-left: 12px; padding-right: 12px; }
  .k-ops { gap: 5px; }
  .k-row.is-done .k-line { gap: 5px; }
  .brh-all { height: 30px; }
  .k-more-btn { width: 34px; height: 32px; flex-basis: 34px; }

  /* 点菜页：底部悬浮购物车取代页尾清单 */
  .page-order { padding-bottom: 150px !important; }
  .page-order .cart-panel { display: none; }
  .mobile-cart-bar {
    display: flex; position: fixed; left: 8px; right: 8px;
    bottom: calc(66px + env(safe-area-inset-bottom));
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 8px 28px rgba(28, 25, 23, .18); padding: 9px 12px;
    align-items: center; gap: 8px; z-index: 55;
  }
  .mcb-info { flex: 1; min-width: 0; }
  .mcb-label { font-size: 11px; color: var(--ink-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mcb-total { font-size: 19px; font-weight: 800; color: var(--brand-dark); line-height: 1.3; }
  .modal-mask.sheet-mask { align-items: flex-end; padding: 0; }
  .modal-card.sheet {
    width: 100%; max-width: none; max-height: 82vh; border-radius: 18px 18px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom)); animation: sheetUp .22s ease;
  }
  .modal-card.sheet .modal-foot { flex-wrap: wrap; }
  .modal-card.sheet .modal-foot .btn { flex: 1; padding-left: 6px; padding-right: 6px; }
  .modal-card.sheet .cart-list { max-height: 48vh; }

  /* 菜品卡片：步进器加大并独占一行，方便手指点击 */
  .dish-card .dish-bottom { flex-direction: column; align-items: stretch; gap: 7px; }
  .dish-card .stepper { justify-content: space-between; }
  .dish-card .stepper button { width: 38px; height: 34px; font-size: 18px; }
  .dish-card .stepper input { flex: 1; width: auto; height: 34px; font-size: 15px; }
  .round-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .round-tabs::-webkit-scrollbar { display: none; }
  .round-tab { flex: 0 0 auto; }
}

@media print {
  .topbar, .sidebar, .bottom-nav, .page-actions, .modal-root, .toast-root { display: none !important; }
  .main { padding: 0; }
  .card { box-shadow: none; }
}

/* ---------- 现场点菜：每道菜独占一行 ---------- */
.dish-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.dish-list .dish-card { flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; min-width: 0; }
.dish-list .dish-card > div:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; }
.dish-list .dish-emoji { flex: 0 0 44px; width: 44px; height: 44px; font-size: 24px; }
.dish-list .dish-name, .dish-list .dish-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dish-list .dish-card .dish-bottom { flex-direction: row; align-items: center; gap: 14px; flex: 0 0 auto; }
.dish-list .dish-price { min-width: 64px; text-align: right; }
.dish-list .dish-card .stepper { justify-content: flex-start; }
.dish-list .dish-card .stepper button { width: 30px; height: 30px; font-size: 16px; }
.dish-list .dish-card .stepper input { width: 36px; height: 30px; }
@media (max-width: 767px) {
  .dish-list .dish-card { gap: 8px; padding: 9px 10px; }
  .dish-list .dish-emoji { flex-basis: 38px; width: 38px; height: 38px; font-size: 21px; }
  .dish-list .dish-card .dish-bottom { gap: 8px; }
  .dish-list .dish-price { min-width: 56px; font-size: 13px; }
  .dish-list .dish-card .stepper button { width: 34px; height: 32px; font-size: 18px; }
  .dish-list .dish-card .stepper input { width: 34px; height: 32px; }
}

/* ---------- 多店：店铺名 + 绑定页 ---------- */
#shop-name-line { display: none; color: #fff; font-weight: 600; opacity: .85 !important; }
@media (max-width: 767px) {
  #shop-name-line {
    display: block !important; font-size: 11px; max-width: 52vw;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .brand-text strong { font-size: 15px; }
  #shop-badge { display: none !important; }
  .brand-sub { display: none; }
}
.bind-screen { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 20px; }
.bind-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 36px 28px; max-width: 380px; width: 100%; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.bind-card h2 { margin: 12px 0 8px; font-size: 20px; }
.bind-card p { font-size: 13px; line-height: 1.7; margin: 0 0 20px; }
.bind-form { display: flex; gap: 8px; }
.bind-form input { flex: 1; min-width: 0; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 16px; letter-spacing: 2px; text-align: center; text-transform: uppercase; }
.bind-form .btn { flex: 0 0 auto; }

/* ===== 现场点菜：布局优化（工具栏 / 菜品行 / 本单菜品） ===== */
.order-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.order-toolbar .round-tabs { margin-bottom: 0; flex: 1 1 320px; min-width: 0; }

.qc-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 20px; padding: 5px 12px 5px 10px; font-size: 13px; line-height: 1.4;
}
.qc-chip-k { font-size: 11px; color: var(--ink-3); }
.qc-chip strong { font-family: ui-monospace, Menlo, monospace; font-size: 15px; letter-spacing: 2px; color: var(--brand-dark); }
.qc-chip.active { border-color: var(--brand); background: var(--brand-light); }
.qc-caret { font-size: 10px; color: var(--ink-4); }
.qc-detail {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--brand-light); border: 1px solid var(--brand); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 12px;
}
.qc-code { font-size: 24px; font-weight: 800; letter-spacing: 6px; color: var(--brand-dark); line-height: 1.35; }

.round-tab .rt-pending { margin-left: 6px; font-size: 11px; background: #fef3c7; color: #92400e; border-radius: 8px; padding: 0 5px; }
.round-tab .rt-done { margin-left: 6px; font-size: 11px; background: var(--green-light); color: #15803d; border-radius: 8px; padding: 0 5px; }
.round-tab.active .rt-pending, .round-tab.active .rt-done { background: rgba(255, 255, 255, .92); }

.order-hint { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }

.dish-add {
  flex: 0 0 auto; width: 36px; height: 32px; border-radius: 9px; line-height: 1;
  border: 1px solid var(--brand); background: var(--brand-light); color: var(--brand-dark);
  font-size: 18px; font-weight: 700;
}
.dish-card.is-picked { border-color: #f3c9ab; background: #fffdfa; box-shadow: inset 3px 0 0 var(--brand); }

.order-layout { grid-template-columns: minmax(0, 1fr) clamp(352px, 26vw, 400px); }
/* 宽屏菜品两列：单行卡片至少 380px，窄屏自动退回一列 */
.dish-list { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }

.cart-panel {
  padding: 14px 16px;
  /* 用 max-height 而不是固定高度：清单短时卡片跟着内容收（按钮就在下面），
     清单长时列表内部滚动，合计与按钮始终可见 */
  max-height: calc(100vh - 96px);
}
.cart-head, .cart-foot { flex: 0 0 auto; }
.cart-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  margin: 0 -16px; padding: 0 16px;
  scrollbar-gutter: stable;
}
.cart-row {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name amount" "meta qty";
  gap: 6px 10px; padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.cart-row:last-child { border-bottom: 0; }
.cart-name { grid-area: name; min-width: 0; }
.cart-name strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-sum { grid-area: amount; font-weight: 700; font-size: 14px; white-space: nowrap; text-align: right; }
.cart-meta { grid-area: meta; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.cart-qty { grid-area: qty; display: flex; align-items: center; gap: 4px; justify-self: end; }
.cart-unit, .cart-served { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.cart-note-btn { padding: 2px 5px; font-size: 12px; line-height: 1; }

.badge-pending { background: #fef3c7; color: #92400e; }
.tag-note {
  font-size: 11px; background: #fef9c3; color: #854d0e; border: 1px solid #fde68a;
  border-radius: 6px; padding: 0 5px; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-checkout { background: #fff; border: 1px solid var(--brand); color: var(--brand-dark); font-weight: 700; height: 40px; }

@media (max-width: 1099px) {
  /* 新规则写在文件末尾，必须在同一断点重申单列，否则会盖掉前面的媒体查询 */
  .order-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-panel { height: auto; max-height: none; padding: 16px; }
  .cart-list { margin: 0; padding: 0; }
  .order-toolbar { gap: 8px; }
}
@media (max-width: 767px) {
  .dish-add { width: 40px; height: 34px; font-size: 19px; }
  .qc-detail { padding: 10px 12px; }
  .qc-code { font-size: 22px; }
  .order-toolbar .round-tabs { flex-basis: 100%; }
}


/* ==========================================================================
   设计系统 v2：控件统一 / 空态 / 断点 / 触控 / 窄屏宽表
   （统一追加在末尾，若在某断点需要不同表现，必须在该断点内重申）
   ========================================================================== */

/* ---------- 表单控件：统一高度 32 / 移动 40，圆角 --radius-sm ---------- */
.form-row input, .form-row select,
.df-field input, .df-field select,
#recv-amt, #shop-code-input, #table-count, #rush-min, .recv-input-wrap input {
  height: 32px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: var(--fs-base); background: #fff;
}
/* 原生 select / date 的自定义外观（同色 chevron，不依赖系统控件） */
.df-field select, .form-row select, select, input[type="date"] {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%23716c67' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  padding-right: 26px !important;
}
input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
  display: inline-block; vertical-align: -3px; position: relative;
}
input[type="checkbox"]:checked { background: var(--brand); border-color: var(--brand); }
input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 4.5px; top: 1.5px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(42deg);
}

/* ---------- 空态：图标 + 说明 + 可选动作 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; }
.empty .empty-icon { font-size: 26px; line-height: 1; opacity: .75; }
.empty .empty-hint { font-size: var(--fs-xs); color: var(--ink-4); }
.empty .btn { margin-top: 6px; }

/* ---------- 层次：吸底条/悬浮件 ---------- */
.mobile-cart-bar { box-shadow: var(--elev-2); }

/* ---------- 平板横屏：侧栏收成图标态（1024–1279） ---------- */
@media (min-width: 1024px) and (max-width: 1279px) {
  .sidebar { width: 68px; flex: 0 0 68px; padding: 12px 8px; overflow: visible; }
  .nav-item { justify-content: center; padding: 11px 0; position: relative; }
  .nav-item > span:not(.nav-icon) { display: none; }
  .nav-item .nav-icon { font-size: 19px; width: auto; }
  .nav-item .nav-count {
    position: absolute; top: 4px; right: 6px; min-width: 16px; font-size: 10px; padding: 0 3px;
    border: 2px solid #fff; line-height: 1.35;
  }
  .main { padding: 18px 20px 40px; }
}

/* ---------- 移动端触控目标：主操作 44，次操作 36 ---------- */
@media (max-width: 767px) {
  .btn { min-height: 40px; padding: 9px 14px; }
  .btn-sm { min-height: 36px; padding: 7px 12px; font-size: var(--fs-sm); }
  .btn-lg { min-height: 46px; }
  .icon-btn { width: 40px; height: 40px; }
  .stepper button { width: 38px; height: 36px; }
  .stepper input { height: 36px; font-size: var(--fs-base); }
  .modal-close { width: 36px; height: 36px; }
  .form-row input, .form-row select, .df-field input, .df-field select,
  #recv-amt, #shop-code-input, #table-count, #rush-min { height: 40px; }
  .table-card { padding: var(--sp-3); }
  /* 空闲卡的「—」在小屏属于噪音，金额位直接省略 */
  .table-amount.is-empty { display: none; }
}

/* ---------- 窄屏宽表：分单明细改为卡片堆叠，免横向滚动 ---------- */
@media (max-width: 767px) {
  .detail-table { font-size: var(--fs-sm); }
  .detail-table thead { display: none; }
  .detail-table, .detail-table tbody, .detail-table tr, .detail-table td { display: block; width: 100%; }
  .detail-table tr {
    border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
    margin-bottom: 8px; background: #fff;
  }
  .detail-table tr:last-child { margin-bottom: 0; }
  .detail-table td { border: 0; padding: 2px 0; text-align: left !important; display: flex; justify-content: space-between; gap: 10px; }
  .detail-table td::before { content: attr(data-label); color: var(--ink-3); font-size: var(--fs-xs); flex: 0 0 auto; }
  .detail-table td:first-child { font-weight: 700; padding: 0 0 6px; border-bottom: 1px dashed var(--line); margin-bottom: 4px; }
  .detail-table td:first-child::before { display: none; }
  .detail-table td.num { text-align: right !important; }
  /* 窄屏只保留会变化的信息：零值行与单价不占行高 */
  .detail-table td[data-zero="1"], .detail-table td[data-compact] { display: none; }
  .detail-table tr { padding: 7px 10px; margin-bottom: 6px; }
  .detail-table td { padding: 1px 0; }
  .detail-table tr.round-divider {
    border: 0; background: var(--brand-light); padding: 6px 10px; border-radius: 8px; margin: 0 0 8px;
  }
  .detail-table tr.round-divider td { padding: 0; display: block; font-size: var(--fs-xs); }
  .detail-table tr.round-divider td::before { display: none; }
}


/* ---------- 图标系统：与文字基线对齐，颜色跟随语义 ---------- */
.ico { flex: 0 0 auto; vertical-align: -2px; }
.card-title .ico { color: var(--brand-dark); }
.nav-item .ico { color: var(--ink-2); }
.nav-item.active .ico { color: var(--brand-dark); }
.entry-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--brand-dark); }
.btn .ico { margin-right: 1px; }
.empty .empty-icon .ico { color: var(--ink-4); }



/* ---------- 待点菜单（点了「＋ 加单」但还没点菜） ---------- */
.round-tab.is-draft {
  border-style: dashed; border-color: var(--brand); color: var(--brand-dark);
  background: var(--brand-light); font-weight: 700;
}
.round-tab.is-draft.active { background: var(--brand-light); color: var(--brand-dark); border-color: var(--brand); }
.round-tab.is-draft .dot.new { background: var(--brand); }

/* 页头上的「离开这一单」类动作：结账用描边避免与「加单」抢主次 */
.btn-checkout-head { border-color: #f3c9ab; color: var(--brand-dark); font-weight: 700; }
.btn-checkout-head:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); }

/* 手机端：出菜看板走底部导航，页头不再重复；结账走清单抽屉底部 */
@media (max-width: 767px) {
  .page-actions .act-leave { display: none; }
}
