:root {
  --primary: #ff5a36;
  --primary-dark: #e8431f;
  --accent: #ffb347;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #222;
  --muted: #8a8f99;
  --line: #ececf0;
  --green: #2bb673;
  --blue: #2f80ed;
  --orange: #f2994a;
  --red: #eb5757;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.topbar .sub { font-size: 12px; opacity: .9; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.topbtn { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.topbtn:active { background: rgba(255,255,255,.3); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #ffd2c2; display: inline-block; }
.status-dot.on { background: #b6ffce; }

/* ---------- category nav (顾客端：左侧竖排) ---------- */
.layout { display: flex; align-items: flex-start; }
.catnav {
  position: sticky; top: 56px; z-index: 40;
  flex: 0 0 88px; align-self: flex-start;
  display: flex; flex-direction: column; gap: 8px;
  height: calc(100vh - 56px); overflow-y: auto;
  padding: 12px 8px; background: var(--card);
  border-right: 1px solid var(--line);
  scrollbar-width: none;
}
.catnav::-webkit-scrollbar { display: none; }
.catnav button {
  border: none; background: var(--bg); color: var(--muted);
  padding: 10px 4px; border-radius: 12px; font-size: 13px; line-height: 1.35;
  text-align: center; white-space: normal; word-break: break-word;
  transition: .15s;
}
.catnav button.active { background: var(--primary); color: #fff; font-weight: 600; }

/* ---------- dish list ---------- */
.section-title { padding: 16px 16px 8px; font-weight: 700; font-size: 15px; color: var(--text); }
.dish {
  display: flex; gap: 12px; padding: 14px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); align-items: center;
}
.dish .thumb {
  width: 60px; height: 60px; border-radius: 12px; flex: 0 0 60px;
  background: linear-gradient(135deg, #ffd9c9, #ffe9b0);
  display: flex; align-items: center; justify-content: center; font-size: 26px; overflow: hidden;
}
.dish .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dish .info { flex: 1; min-width: 0; }
.dish .name { font-weight: 600; font-size: 16px; }
.dish .desc { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish .price { color: var(--primary); font-weight: 700; margin-top: 4px; }
.dish .price small { color: var(--muted); font-weight: 400; }
.dish.unavailable { opacity: .5; }
.dish.unavailable .add { display: none; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 30px; height: 30px; border-radius: 50%; border: none; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.stepper .minus { background: var(--bg); color: var(--primary); border: 1px solid var(--line); }
.stepper .plus { background: var(--primary); color: #fff; }
.stepper .qty { min-width: 18px; text-align: center; font-weight: 600; }
.add {
  background: var(--primary); color: #fff; border: none; border-radius: 20px;
  padding: 8px 16px; font-size: 14px; font-weight: 600;
}

/* ---------- cart bar ---------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: #2b2b33; color: #fff; display: flex; align-items: center;
  padding: 10px 16px; gap: 12px;
}
.cartbar .icon { position: relative; font-size: 26px; }
.cartbar .badge {
  position: absolute; top: -6px; right: -10px; background: var(--primary);
  color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.cartbar .total { flex: 1; }
.cartbar .total b { font-size: 20px; }
.cartbar .total small { display: block; color: #b9b9c2; font-size: 12px; }
.cartbar .total .cart-promo { color: #ffd76a; }
.modal .grand.promo-row { font-size: 14px; }
.modal .grand.promo-row b { color: var(--red); }
.cart-modal #cartItems { max-height: 46vh; overflow-y: auto; }
.cartbar .checkout {
  background: var(--primary); color: #fff; border: none; border-radius: 24px;
  padding: 12px 26px; font-size: 15px; font-weight: 700;
}
.cartbar.hidden { display: none; }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: none; align-items: flex-end; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0;
  max-height: 86vh; overflow-y: auto; padding: 18px; animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity:.6 } to { transform: translateY(0); opacity:1 } }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.modal .row .nm { flex: 1; }
.modal .row .qt { color: var(--muted); margin: 0 12px; }
.modal .row .pr { font-weight: 600; }
.modal .field { margin: 14px 0; }
.modal label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.modal input, .modal select, .modal textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit;
}
.modal .actions { display: flex; gap: 10px; margin-top: 16px; }
.btn { flex: 1; padding: 13px; border-radius: 12px; border: none; font-size: 15px; font-weight: 700; }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn-primary { background: var(--primary); color: #fff; }
.modal .grand { display: flex; justify-content: space-between; font-size: 17px; font-weight: 700; margin-top: 12px; }
.modal .grand b { color: var(--primary); }

.success { text-align: center; padding: 20px 0; }
.success .ok { font-size: 54px; }
.success h3 { margin: 10px 0 4px; }
.success p { color: var(--muted); }
.pay-prompt {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 14px auto 4px; padding: 12px 16px; border-radius: 12px; max-width: 300px;
  font-size: 15px; font-weight: 700; color: #8a5a00;
  background: linear-gradient(135deg, #fff6e0, #ffe9b8); border: 1px dashed var(--accent);
}
.pay-prompt .pp-icon { font-size: 20px; }

/* ---------- merchant layout ---------- */
.tabs { display: flex; background: var(--card); position: sticky; top: 56px; z-index: 40; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; border: none; background: none; padding: 13px 4px; font-size: 14px; color: var(--muted);
  border-bottom: 3px solid transparent; font-weight: 600;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.page { display: none; padding: 14px; max-width: 920px; margin: 0 auto; }
.page.active { display: block; }

/* order cards */
.order {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 12px; border-left: 5px solid var(--muted);
}
.order.pending { border-left-color: var(--orange); }
.order.preparing { border-left-color: var(--blue); }
.order.completed { border-left-color: var(--green); }
.order.cancelled { border-left-color: var(--red); opacity: .65; }
.order .head { display: flex; justify-content: space-between; align-items: center; }
.order .table { font-weight: 700; font-size: 16px; }
.order .time { color: var(--muted); font-size: 12px; }
.order .items { margin: 8px 0; }
.order .items div { display: flex; justify-content: space-between; font-size: 14px; padding: 2px 0; }
.order .items .oitem { justify-content: flex-start; align-items: center; gap: 8px; }
.order .items .oitem .nm { flex: 1; min-width: 0; }
.order .items .oitem .qt { color: var(--muted); margin: 0 2px; }
.order .items .oitem .pr { font-weight: 600; margin-right: 4px; }
.order .items .oitem .nm .rt { font-style: normal; font-size: 11px; color: var(--red); background: #ffeaea; border-radius: 6px; padding: 0 5px; margin-left: 4px; white-space: nowrap; }
.item-refund { border: 1px solid var(--red); background: #fff; color: var(--red); border-radius: 7px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
.item-refund:hover { background: var(--red); color: #fff; }
.refunded-tag { font-size: 11px; color: var(--red); }
.order .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.order .amt { font-size: 18px; font-weight: 700; color: var(--primary); }
.badge-status { font-size: 12px; padding: 3px 10px; border-radius: 12px; color: #fff; }
.badge-status.pending { background: var(--orange); }
.badge-status.preparing { background: var(--blue); }
.badge-status.completed { background: var(--green); }
.badge-status.cancelled { background: var(--red); }
.order .ops { display: flex; gap: 8px; margin-top: 10px; }
.order .ops button { flex: 1; padding: 9px; border-radius: 9px; border: none; font-weight: 600; font-size: 14px; }
.op-ok { background: var(--green); color: #fff; }
.op-prep { background: var(--blue); color: #fff; }
.op-cancel { background: var(--bg); color: var(--red); border: 1px solid var(--line); }
.flash { animation: flash 1s ease; }
@keyframes flash { 0% { background: #fff6e9; } 100% { background: var(--card); } }
/* 新订单显眼标记：10 分钟内的新待处理订单（红框 + 脉冲徽章），到点或状态变更后消失 */
.order.new-order { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 77, 77, .14); }
.order .head-badges { display: flex; align-items: center; gap: 6px; }
.badge-new { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px; color: #fff; background: var(--red); animation: badge-pulse 1.2s ease-in-out infinite; }
@keyframes badge-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .55; } }

/* menu manage */
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.toolbar .grow { flex: 1; min-width: 120px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cat-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; box-shadow: var(--shadow); }
.cat-chip .ct { font-weight: 600; }
.cat-chip .cn { font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 7px; }
.cat-chip .cat-del { border: none; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 999px; }
.cat-chip .cat-del:hover { color: #fff; background: var(--red); }
.cat-chip .cat-rename { border: none; background: var(--bg); color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; padding: 3px 6px; border-radius: 6px; }
.cat-chip .cat-rename:hover { color: var(--primary); background: #ffe9e1; }
.search-count { font-size: 13px; color: var(--muted); white-space: nowrap; align-self: center; }
/* 分类可点击进入 + 当前进入高亮 */
.cat-chip .cat-enter { cursor: pointer; }
.cat-chip .cat-enter:hover { color: var(--primary); }
.cat-chip.active { border-color: var(--primary); background: #fff1ec; }
.cat-chip.active .ct { color: var(--primary); }
/* 分类内排序视图条 */
.cat-view-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.cat-view-bar .cv-title { font-weight: 700; font-size: 14px; }
.cat-view-bar .cv-hint { font-size: 12px; color: var(--muted); margin-left: auto; }
/* 菜品卡排序箭头 */
.mcard .top .reorder { display: inline-flex; gap: 4px; }
.mcard .top .reorder .mini { padding: 4px 8px; line-height: 1; }
.mcard .top .reorder .mini:disabled { opacity: .3; cursor: not-allowed; }
.mcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.mcard.pinned { border-left: 4px solid var(--accent); }
.mcard .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mcard .top > div { flex: 1; min-width: 0; }
.mcard .mc-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: var(--bg); border: 1px solid var(--line); }
.pin-tag { display: inline-block; background: var(--accent); color: #5a3b00; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
.mcard .mini.pin-on { background: var(--accent); color: #5a3b00; border-color: var(--accent); }
.cat-move { border: none; background: var(--bg); color: var(--muted); font-size: 11px; line-height: 1; cursor: pointer; padding: 3px 5px; border-radius: 6px; }
.cat-move:hover:not(:disabled) { color: var(--primary); background: #ffe9e1; }
.cat-move:disabled { opacity: .3; cursor: not-allowed; }
.mcard .nm { font-weight: 700; font-size: 16px; }
.mcard .cat { font-size: 12px; color: var(--muted); }
.mcard .desc { font-size: 12px; color: var(--muted); margin: 6px 0; min-height: 16px; }
.mcard .price-edit { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.mcard .price-edit input { width: 90px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.mcard .ops { display: flex; gap: 8px; align-items: center; }
.switch { position: relative; width: 42px; height: 24px; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: #ccc; border-radius: 24px; transition: .2s; }
.switch input:checked + .slider { background: var(--green); }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider::before { transform: translateX(18px); }
.mini { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.mini.danger { color: var(--red); }
.mini.off { color: var(--muted); opacity: .55; }

/* analytics */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.kpi .v { font-size: 24px; font-weight: 800; color: var(--primary); }
.kpi .l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.panel h4 { margin: 0 0 12px; font-size: 15px; }
.range-sel { display: flex; gap: 8px; margin-bottom: 12px; }
.range-sel button { border: 1px solid var(--line); background: var(--bg); border-radius: 20px; padding: 7px 18px; font-size: 14px; color: var(--muted); }
.range-sel button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chart-box { position: relative; height: 260px; }
.tdlist { list-style: none; padding: 0; margin: 0; }
.tdlist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tdlist .bar { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.tdlist .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.tdlist .nm { width: 90px; font-size: 14px; }
.tdlist .vl { width: 64px; text-align: right; font-size: 13px; color: var(--muted); }

/* 各菜品销量表 */
.sales-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sales-table th, .sales-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.sales-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.sales-table th.num, .sales-table td.num { text-align: right; white-space: nowrap; }
.sales-table td.num { font-variant-numeric: tabular-nums; }
.sales-table .c-no { width: 34px; color: var(--muted); font-size: 13px; }
.sales-table tbody tr:hover { background: var(--bg); }

/* 自动打印开关 */
.auto-print { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; }

/* 小票（打印专用） */
.receipt { display: none; }
.receipt .r-shop { font-size: 18px; font-weight: 800; text-align: center; }
.receipt .r-sub { text-align: center; font-size: 13px; color: #555; margin-bottom: 6px; }
.receipt .r-meta { display: flex; justify-content: space-between; font-size: 13px; }
.receipt .r-time { font-size: 12px; color: #555; margin: 2px 0 6px; }
.receipt .r-line { border-top: 1px dashed #000; margin: 6px 0; }
.receipt .r-head, .receipt .r-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.receipt .r-head { font-weight: 700; border-bottom: 1px solid #000; padding-bottom: 3px; margin-bottom: 4px; }
.receipt .r-name { flex: 1; }
.receipt .r-q { width: 84px; text-align: right; }
.receipt .r-amt { width: 60px; text-align: right; }
.receipt .r-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 15px; margin-top: 6px; }
.receipt .r-foot { text-align: center; font-size: 12px; color: #555; margin-top: 10px; }

@media print {
  body * { visibility: hidden !important; }
  #receipt, #receipt * { visibility: visible !important; }
  #receipt {
    display: block !important;
    position: absolute; left: 0; top: 0; width: 72mm;
    padding: 0; margin: 0; background: #fff; color: #000;
    font-family: "Courier New", "Microsoft YaHei", monospace;
  }
}

/* 编辑菜品弹窗（独立类，避免覆盖通用 .modal-mask 的默认 display:none） */
.edit-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 360px;
  padding: 20px 22px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .fld { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.modal .fld input, .modal .fld select { padding: 9px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; color: #222; background: #fff; }
.modal .fld.row { flex-direction: row; align-items: center; gap: 8px; color: #222; }
.modal .fld.row input { width: 16px; height: 16px; }
.modal-ops { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* 库存清零弹窗：分类 / 菜品 / 共享池勾选保留 */
#stockResetMask .modal { max-width: 460px; }
.sr-tip { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.sr-sec { margin-bottom: 12px; }
.sr-sec-t { font-size: 13px; font-weight: 700; color: #444; margin-bottom: 6px; }
.sr-list { max-height: 168px; overflow-y: auto; border: 1px solid #eee; border-radius: 10px; padding: 6px 8px; }
.sr-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 14px; cursor: pointer; border-bottom: 1px dashed #f2f2f2; }
.sr-row:last-child { border-bottom: none; }
.sr-row input { width: 16px; height: 16px; flex: 0 0 auto; cursor: pointer; }
.sr-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-row i { font-style: normal; font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.sr-empty { font-size: 13px; color: var(--muted); padding: 10px 2px; }
.sr-sum { font-size: 13px; color: #444; background: #fff8e6; border: 1px solid #ffe1a8; border-radius: 10px; padding: 9px 12px; margin: 4px 0 14px; line-height: 1.6; }
.sr-sum b { color: var(--red); }

/* 我的订单（顾客端） */
.my-orders-modal { max-width: 440px; }
.mo-empty { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; padding: 26px 10px; }
.mo-loading { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0; }
.mo-order { border: 1px solid #eee; border-left: 4px solid var(--muted); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.mo-order.st-pending { border-left-color: var(--orange); }
.mo-order.st-preparing { border-left-color: var(--blue); }
.mo-order.st-completed { border-left-color: var(--green); }
.mo-order.st-cancelled { border-left-color: var(--red); opacity: .7; }
.mo-order.st-lost { border-left-color: #ccc; opacity: .65; }
.mo-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mo-id { font-weight: 700; font-size: 14px; }
.mo-status { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; background: #f2f3f5; color: #555; }
.mo-order.st-pending .mo-status { background: #fff1e0; color: #c77700; }
.mo-order.st-preparing .mo-status { background: #e8f1ff; color: #2470c7; }
.mo-order.st-completed .mo-status { background: #e6f9ec; color: #1a9e4b; }
.mo-order.st-cancelled .mo-status { background: #ffeaea; color: #d33; }
.mo-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mo-items { font-size: 13px; color: #333; margin-top: 6px; line-height: 1.6; word-break: break-all; }
.mo-amt { font-size: 16px; font-weight: 700; color: var(--primary); margin-top: 6px; }
.mo-amt s { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.mo-lookup { border-top: 1px dashed #e5e5e5; margin-top: 14px; padding-top: 12px; }
.mo-lookup-t { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.mo-lookup-row { display: flex; gap: 8px; }
.mo-lookup-row input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; }
.mo-lookup-row button { flex: 0 0 auto; padding: 9px 14px; font-size: 13px; }
/* 收款码展示区（下单成功弹窗 / 我的订单共用） */
.mo-qr-tip { font-size: 13px; color: #333; text-align: center; margin-bottom: 8px; }
.mo-qr-tip b { color: var(--primary); font-size: 15px; }
.mo-qr { text-align: center; }
.mo-qr img { width: 200px; height: 200px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mo-qr-guide { font-size: 12px; color: var(--muted); line-height: 1.7; text-align: center; margin: 8px 0 10px; }
/* 下单成功弹窗里的收款码区 */
.sp-pay { margin: 12px 0 4px; }
/* 「或者扫描您面前的收款码进行支付」：全弹窗最醒目的行动指令（实心胶囊 + 微脉冲） */
.sp-scan-tip {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 12px 0 6px; padding: 12px 14px;
  border-radius: 999px;
  background: var(--green); color: #fff;
  font-size: 17px; font-weight: 800; letter-spacing: .5px;
  box-shadow: 0 6px 18px rgba(43, 182, 115, .38);
  animation: sp-tip-pulse 1.6s ease-in-out infinite;
}
.sp-scan-tip b { font-weight: 800; }
.sp-scan-icon { font-size: 19px; line-height: 1; }
@keyframes sp-tip-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 6px 18px rgba(43, 182, 115, .38); }
  50% { transform: scale(1.025); box-shadow: 0 8px 24px rgba(43, 182, 115, .55); }
}
/* 商家端收款设置面板 */
.payqr-panel h4 .pool-hint { font-weight: 400; }
.payqr-empty { font-size: 12px; color: #c77700; margin: 8px 0 0; }

/* qr */
.qrbox { text-align: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.qrbox img { width: 280px; height: 280px; border: 1px solid var(--line); border-radius: 12px; }
.qrbox .url { margin-top: 14px; font-size: 14px; color: var(--muted); word-break: break-all; }
.qrbox .tip { margin-top: 6px; font-size: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.container { flex: 1; min-width: 0; max-width: 720px; margin: 0 auto; padding-bottom: 90px; }
.mtop { padding-top: 8px; }

/* ---------- 菜品图片上传 ---------- */
.file-btn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border: 1px solid var(--bd); border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; flex: 0 0 auto; }
.file-btn input[type=file] { display: none; }
.img-prev { margin: 6px 0; display: inline-flex; align-items: center; gap: 8px; }
.img-prev img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.img-x { border: none; background: var(--red); color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 14px; line-height: 1; cursor: pointer; }

/* ---------- 商家登录层 ---------- */
body.login-mode .topbar, body.login-mode .tabs { display: none !important; }
.login-wrap { position: fixed; inset: 0; z-index: 100; background: linear-gradient(135deg, #fff3ef, #fdf6ec); display: none; align-items: center; justify-content: center; padding: 20px; }
.login-box { background: #fff; border-radius: 18px; box-shadow: 0 16px 50px rgba(0,0,0,.14); width: 100%; max-width: 330px; padding: 30px 26px 24px; text-align: center; }
.login-box .lg-logo { font-size: 40px; line-height: 1; }
.login-box h3 { margin: 12px 0 4px; font-size: 19px; }
.login-box .lg-tip { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.login-box input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; text-align: center; letter-spacing: 1px; }
.login-box .btn { width: 100%; margin-top: 12px; padding: 12px; font-size: 15px; }
.login-box .lg-err { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 8px; }
.login-box .lg-help { font-size: 11px; color: var(--muted); margin-top: 14px; line-height: 1.6; }

/* ---------- 顾客端销量 ---------- */
.dish .sales { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--orange); background: #fff6e9; border-radius: 6px; padding: 1px 7px; }

/* ---------- 订单项：退菜 + 折扣 ---------- */
.order .items .oi { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 14px; padding: 2px 0; }
.order .foot .amt-strike { font-size: 13px; color: var(--muted); text-decoration: line-through; margin-right: 8px; }
.order .foot .amt-cut { font-size: 12px; color: var(--red); margin-left: 8px; }
.op-discount { background: var(--accent); color: #5a3b00; }
.order .refunded-tag { display: inline-block; font-size: 11px; }

/* ---------- 后台销量快捷修改 ---------- */
.mcard .sales-edit { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.mcard .sales-edit input { width: 100px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- 店铺管理 ---------- */
.shop-now { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.sn-item { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.sn-item b { font-size: 15px; color: #222; }
.sn-ops { display: flex; gap: 8px; margin-left: auto; }
.shop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.shop-row.cur { background: #fff8f5; border-radius: 10px; padding: 12px; border-bottom: none; }
.sr-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sr-main b { font-size: 15px; }
.sr-code { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 2px 8px; }
.badge-cur { font-size: 11px; color: var(--green); border: 1px solid var(--green); border-radius: 999px; padding: 1px 8px; }
.badge-admin { font-size: 11px; color: #fff; background: #b3451b; border-radius: 999px; padding: 1px 8px; }
.badge-sub { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.sr-ops { display: flex; gap: 8px; }

/* ---------- 结账折扣 ---------- */
.dis-preview { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 10px; }
.dis-preview > div { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13px; color: var(--muted); }
.dis-preview b { font-size: 14px; color: #222; }
.dis-preview > div:last-child b { font-size: 20px; color: var(--primary); }
.qr-shop { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.qr-shop select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.panel .tip code { background: var(--bg); border-radius: 4px; padding: 1px 5px; }

/* ---------- 置顶菜品：鲜艳底色（顾客端）---------- */
.dish.pinned {
  background: linear-gradient(135deg, #fff1bf, #ffd76a);
  border-bottom: 1px solid #f2c94c;
  border-left: 4px solid #f2994a;
}
.dish.pinned .price { color: #d4380d; }

/* ---------- 库存 / 售罄 / 下架 ---------- */
.dish .stock-tag { display: inline-block; margin-top: 4px; font-size: 12px; color: #b25e09; background: #fff3d6; border-radius: 6px; padding: 1px 7px; }
.dish .soldout-tag { display: inline-block; margin-top: 4px; font-size: 12px; color: #fff; background: #9aa0aa; border-radius: 6px; padding: 1px 8px; }
.stepper .chip { font-size: 12px; padding: 5px 10px; border-radius: 14px; white-space: nowrap; }
.stepper .soldout-chip { color: #fff; background: #9aa0aa; }
.stepper .off-chip { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }

/* ---------- 结算：扫码支付提示 ---------- */
.pay-notice {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  color: #8a5a00; background: linear-gradient(135deg, #fff6e0, #ffe9b8); border: 1px dashed var(--accent);
  text-align: center; font-weight: 600;
}
.row-opts { display: block; font-style: normal; font-size: 12px; color: var(--orange); margin-top: 2px; }

/* ---------- 菜品详情弹窗（备注 / 数量 / 附加选项）---------- */
.dm-modal { max-width: 460px; }
.dm-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.dm-thumb {
  width: 72px; height: 72px; border-radius: 14px; flex: 0 0 72px; overflow: hidden;
  background: linear-gradient(135deg, #ffd9c9, #ffe9b0);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
}
.dm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dm-title { flex: 1; min-width: 0; }
.dm-title h3 { margin: 0 0 4px; }
.dm-price { color: var(--primary); font-weight: 800; font-size: 18px; }
.dm-price s { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.dm-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 4px 0 12px; }
.opt-group { margin-bottom: 14px; }
.opt-name { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.opt-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 20px; padding: 7px 14px; font-size: 14px;
}
.opt-chip i { font-style: normal; color: var(--primary); font-size: 12px; margin-left: 3px; }
.opt-chip.sel { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.opt-chip.sel i { color: #ffe; }
.dm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.dm-qty { display: flex; align-items: center; gap: 12px; }
.dm-qty .qbtn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: var(--primary); font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.dm-qty span { min-width: 20px; text-align: center; font-weight: 700; font-size: 16px; }
.dm-foot .btn { flex: 1; }

/* ---------- 后台：库存 / 售罄 ---------- */
.mcard .stock-edit { display: flex; align-items: center; gap: 6px; margin: 8px 0; }
.mcard .stock-edit input { width: 100px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.mcard .stock-edit input:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.stock0-tag { display: inline-block; background: #9aa0aa; color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
.pool-tag { display: inline-block; background: #e8f3ff; color: #1677ff; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }

/* ---------- 后台：共享库存池 ---------- */
.pool-panel h4 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pool-hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.pool-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; background: var(--bg); }
.pool-row .pool-name { flex: 1 1 160px; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: var(--card); }
.pool-row .pool-stock-lb { font-size: 13px; color: var(--muted); }
.pool-row .pool-stock { width: 90px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: var(--card); }
.pool-row .pool-bound { flex: 1 1 100%; font-size: 12px; color: var(--muted); }
.pool-fld { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pool-fld .fld-label { font-size: 13px; color: var(--muted); }
.pool-fld select { flex: 1; min-width: 140px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: var(--card); }
.pool-fld .pool-hint { flex: 1 1 100%; }

/* ---------- 后台：共享库存页 ---------- */
.sp-sec-title { font-size: 14px; font-weight: 700; margin: 4px 2px 10px; }
.sp-guide { font-size: 12px; color: var(--muted); line-height: 1.8; background: var(--bg); border-radius: 8px; padding: 9px 12px; margin: 0 0 12px; }
.sp-guide b { color: var(--text); }
.sp-builder { display: flex; gap: 14px; flex-wrap: wrap; }
.sp-col { flex: 1 1 280px; min-width: 250px; }
.sp-sub-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.dish-picker { max-height: 380px; overflow-y: auto; padding-right: 4px; }
.picker-cat { margin-bottom: 12px; }
.picker-cat .pc-name { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.picker-list { display: flex; flex-direction: column; gap: 5px; }
.sp-dish-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; font-size: 14px; }
.sp-dish-row:hover { border-color: var(--primary); }
.sp-dish-row.sel { background: #fff1ee; border-color: var(--primary); }
.sp-dish-row input { accent-color: var(--primary); width: 16px; height: 16px; flex: 0 0 auto; cursor: pointer; }
.sp-dish-row .sd-name { font-weight: 600; }
#spSelectedList { max-height: 380px; overflow-y: auto; }
.sp-sel-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; }
.sp-sel-row .ss-name { font-size: 14px; font-weight: 600; }
.sp-sel-row .ss-lb { font-size: 12px; color: var(--muted); }
.sp-sel-row .ss-consume { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: var(--card); }
.sp-sel-row .mini { margin-left: auto; }
.pool-card .pc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pool-card .pc-name { flex: 1 1 160px; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.pool-card .pc-stock-lb { font-size: 13px; color: var(--muted); }
.pool-card .pc-stock { width: 90px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.pc-members { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.member-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.member-row .m-name { font-size: 14px; font-weight: 600; }
.member-row .m-consume-lb { font-size: 12px; color: var(--muted); }
.member-row .m-price { font-size: 12px; color: var(--muted); }
.member-row .m-consume { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: var(--card); }
.member-row .mini { margin-left: auto; }
.pc-empty { font-size: 12px; color: var(--muted); padding: 4px 2px; }
.pc-add { margin-top: 10px; }
.pc-addbox { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
#spCreate:disabled { opacity: .5; cursor: not-allowed; }
.ord-opt { font-weight: 800; color: #d4380d; background: #ffeede; border-radius: 5px; padding: 0 4px; }
.r-opt { font-style: normal; color: #666; }

/* ---------- 后台：附加选项编辑器 ---------- */
.opt-edit-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--bg); }
.oeg-head { display: flex; gap: 8px; margin-bottom: 8px; }
.oeg-head input { flex: 1; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.oeg-choices { display: flex; flex-direction: column; gap: 6px; }
.oeg-choice { display: flex; gap: 6px; align-items: center; }
.oeg-choice input[type=text] { flex: 1; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
.oeg-choice input[type=number] { width: 84px; padding: 8px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; }
