/* ===== 顾客扫码点单页 =====
   令牌来源：public/css/base.css（= 营销 Ops UI 标准 v1.1 · profiles.h5）
   本文件禁止写裸色值；要么用 var(--...)，要么回 base.css 加令牌。
*/
body { background: var(--color-bg); }

.ch {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--color-accent);   /* 金色细分隔线：Ops 品牌语言 */
}
.ch-inner { display: flex; align-items: center; justify-content: space-between; max-width: 640px; margin: 0 auto; }
.ch h1 { font-size: var(--font-size-6); font-weight: 700; letter-spacing: .5px; color: var(--color-primary); }
.ch-status { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: var(--font-size-3); color: var(--color-text-muted); }
.ch-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone-success-fg); }
.ch-status .dot.off { background: var(--tone-warning-fg); }
.ch-track {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch-target);
  background: var(--color-surface); color: var(--color-primary); border-radius: var(--radius-tag);
  padding: 7px 16px; font-size: var(--font-size-3); border: 1px solid var(--color-primary-soft-border);
}

.ann {
  max-width: 640px; margin: 10px auto 0; padding: 8px 14px;
  background: var(--tone-info-bg); color: var(--tone-info-fg); font-size: var(--font-size-3);
  border-radius: var(--radius-control); width: calc(100% - 24px);
}

/* 分类 */
.cats {
  max-width: 640px; margin: 0 auto; padding: 12px 12px 4px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch-target);
  flex: 0 0 auto; padding: 8px 16px; border-radius: var(--radius-tag);
  background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text-muted);
  font-size: var(--font-size-4); font-weight: 500; transition: all .15s;
}
.cat-chip.active { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }

/* 菜单 */
.menu {
  max-width: 640px; margin: 0 auto; padding: 12px 12px 96px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.item {
  background: var(--color-surface); border-radius: var(--radius-card); padding: 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow-card); min-height: 110px; position: relative;
}
.item-name { font-size: var(--font-size-5); font-weight: 600; }
.item-desc { font-size: var(--font-size-2); color: var(--color-text-muted); margin: 3px 0 8px; min-height: 18px; }
.item-price { color: var(--color-primary); font-size: var(--font-size-5); font-weight: 700; }

/* ---------- 免费模式（show_price=0）：把"免费"说出来，而不是留白让人猜 ----------
   金色 = Ops 品牌点缀色（--color-accent），文字用 info tone 保证对比度 */
.free-badge {
  background: var(--color-accent-soft); border: 1px solid var(--tone-info-bd);
  color: var(--tone-info-fg); font-size: var(--font-size-2); font-weight: 600; padding: 1px 8px;
  border-radius: var(--radius-tag); margin-left: 4px; letter-spacing: .5px;
}
.item-price.free-tag {
  display: inline-block; background: var(--color-accent-soft); color: var(--tone-info-fg);
  border: 1px solid var(--tone-info-bd);
  font-size: var(--font-size-3); font-weight: 700; padding: 1px 9px; border-radius: var(--radius-tag);
  letter-spacing: 1px;
}
.free-line {
  margin: 8px 0 2px; padding: 6px 12px; border-radius: var(--radius-control);
  background: var(--color-accent-soft); color: var(--tone-info-fg);
  border: 1px solid var(--tone-info-bd);
  font-size: var(--font-size-3); font-weight: 600;
}
.item-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.add-btn {
  width: var(--touch-target); height: var(--touch-target); border-radius: 50%; background: var(--color-primary);
  color: var(--color-on-primary); font-size: var(--font-size-7); line-height: 1; display: flex;
  align-items: center; justify-content: center; transition: background .15s;
}
.add-btn:hover { background: var(--color-primary-hover); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: var(--touch-target); height: var(--touch-target); border-radius: 50%; background: var(--color-primary-soft);
  color: var(--color-primary); font-size: var(--font-size-5); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.stepper .qty { font-size: var(--font-size-5); font-weight: 700; min-width: 24px; text-align: center; }

.empty { text-align: center; color: var(--color-text-muted); padding: 60px 20px; font-size: var(--font-size-5); }
.foot { text-align: center; color: var(--color-text-faint); font-size: var(--font-size-2); padding: 8px 0 20px; }

/* 底部购物车条 */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--color-bg-transparent), var(--color-bg) 40%);
  display: flex; justify-content: center;
}
.cartbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: min(100%, 620px); background: var(--color-primary-hover); color: var(--color-on-primary);
  border-radius: var(--radius-tag); padding: 8px 8px 8px 18px; box-shadow: var(--shadow-overlay);
}
.cartbar-info { font-size: var(--font-size-4); }
.cartbar-info b { font-size: var(--font-size-6); color: var(--color-accent-on-dark); }
.cartbar-btn { border-radius: var(--radius-tag); }

/* 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(28, 28, 30, .45); z-index: 90;
}
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91;
  background: var(--color-surface); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 78vh; display: flex; flex-direction: column;
  animation: slide-up .25s ease; max-width: 640px; margin: 0 auto;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-head h3 { font-size: var(--font-size-6); }
.icon-btn { font-size: var(--font-size-5); color: var(--color-text-muted); padding: 6px; }
.cart-items { overflow-y: auto; flex: 1; }
.cart-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px dashed var(--color-border);
}
.cart-row .name { font-size: var(--font-size-4); font-weight: 600; }
.cart-row .sub { font-size: var(--font-size-2); color: var(--color-text-muted); }
.cart-row .row-right { display: flex; align-items: center; gap: 14px; }
.cart-row .row-total { font-size: var(--font-size-4); font-weight: 700; color: var(--color-primary); }
.cart-form { margin-top: 12px; }
.cart-form .field { margin-bottom: 8px; }
.cart-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--color-border);
}
.cart-foot .total { font-size: var(--font-size-4); }
.cart-foot .total b { font-size: var(--font-size-6); color: var(--color-primary); }

/* 下单成功 / 订单状态 */
.status {
  position: fixed; inset: 0; z-index: 95; background: rgba(28, 28, 30, .5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.status-card {
  background: var(--color-surface); border-radius: var(--radius-card); padding: 28px 22px;
  width: min(92vw, 420px); text-align: center; box-shadow: var(--shadow-overlay);
  max-height: 88vh; overflow: auto;
}
.status-ok {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--color-primary-soft); color: var(--color-primary); font-size: var(--font-size-8);
  display: flex; align-items: center; justify-content: center;
}
.status-card h3 { font-size: var(--font-size-6); margin-bottom: 8px; }
/* 顾客端不显示取餐号（茶水由客服端到客户面前），原来的 .pickup 大号数字样式已删掉 */
.sno { font-size: var(--font-size-3); color: var(--color-text-muted); margin: 4px 0 10px; }
.sline { margin: 6px 0 12px; }
.sitems { text-align: left; margin: 10px 0; padding: 10px 14px; background: var(--color-surface-muted); border-radius: var(--radius-control); }
.sitems li { display: flex; justify-content: space-between; font-size: var(--font-size-4); padding: 4px 0; list-style: none; }
.snote { font-size: var(--font-size-3); color: var(--tone-warning-fg); background: var(--tone-warning-bg); padding: 8px 12px; border-radius: var(--radius-control); margin-bottom: 12px; }
.status-card .btn-primary, .status-card .btn-plain { width: 100%; margin-top: 8px; }

/* 查单 */
#trackResult { margin-top: 6px; font-size: var(--font-size-4); }
.tr-order { background: var(--color-surface-muted); border-radius: var(--radius-control); padding: 10px 12px; }
.tr-order .tr-row { display: flex; justify-content: space-between; padding: 3px 0; }
.tr-order .tr-row b { color: var(--color-primary); }

/* 售完（今日估清） */
.item.soldout { opacity: .55; }
.item .soldout-badge {
  display: inline-block; font-size: var(--font-size-1); color: var(--color-on-primary); background: var(--color-danger-solid);
  border-radius: var(--radius-tag); padding: 2px 8px; margin-bottom: 6px;
}

/* 查询码展示 */
.stoken {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: var(--font-size-3); color: var(--color-text-muted); margin-bottom: 10px;
}
.stoken code {
  background: var(--color-primary-soft); border: 1px dashed var(--color-primary-soft-border);
  border-radius: var(--radius-small); padding: 2px 8px; font-size: var(--font-size-3);
  color: var(--color-primary); user-select: all;
}
.stoken button {
  border: 1px solid var(--color-border); background: var(--color-surface);
  border-radius: var(--radius-small); font-size: var(--font-size-2); padding: 2px 10px; cursor: pointer;
}

/* ---------- 顾客端：商品图片 / 规格选择 ---------- */
.item-img { width: 74px; height: 74px; object-fit: cover; border-radius: var(--radius-control); flex: 0 0 auto; }
.item-main { flex: 1 1 auto; min-width: 0; }
.spec-line { font-size: var(--font-size-2); color: var(--color-primary); margin-top: 2px; font-weight: 600; }

.spec-mask {
  position: fixed; inset: 0; background: rgba(28, 28, 30, .45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 999;
}
.spec-modal {
  background: var(--color-surface); width: 100%; max-width: 520px;
  border-radius: var(--radius-card) var(--radius-card) 0 0; padding: 16px 16px 20px;
  max-height: 84vh; overflow-y: auto;
  animation: specUp .18s ease-out;
}
@keyframes specUp { from { transform: translateY(14px); opacity: .6 } to { transform: none; opacity: 1 } }
.spec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.spec-head h3 { margin: 0; font-size: var(--font-size-6); }
.spec-x { border: 0; background: transparent; font-size: var(--font-size-6); color: var(--color-text-muted); cursor: pointer; padding: 4px 8px; }
.spec-group { margin: 12px 0; }
.spec-label { font-size: var(--font-size-3); color: var(--color-text-secondary); margin-bottom: 8px; font-weight: 600; }
.spec-label .req { color: var(--tone-error-fg); font-size: var(--font-size-1); font-weight: 500; margin-left: 6px; }
.spec-label .opt-tag { color: var(--color-text-muted); font-size: var(--font-size-1); font-weight: 400; margin-left: 6px; }
.spec-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-opt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 64px; min-height: var(--touch-target); padding: 9px 14px; border-radius: var(--radius-tag);
  border: 1px solid var(--color-border-soft); background: var(--color-surface); color: var(--color-text);
  font-size: var(--font-size-4); cursor: pointer;
}
.spec-opt.on { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); font-weight: 700; }
.spec-actions { display: flex; gap: 10px; margin-top: 16px; }
.spec-actions .btn-plain { flex: 0 0 96px; }
.spec-actions .btn-primary { flex: 1 1 auto; padding: 13px; border-radius: var(--radius-control); border: 0; background: var(--color-primary); color: var(--color-on-primary); font-size: var(--font-size-5); font-weight: 700; cursor: pointer; }
.spec-actions .btn-primary:disabled { background: var(--color-disabled-bg); cursor: not-allowed; }
/* 「选规格」需要比圆形 + 号宽的按钮（否则三个字会溢出成一个"规"字） */
.add-btn.add-btn-wide {
  width: auto; min-width: 96px; height: var(--touch-target); padding: 0 16px;
  border-radius: var(--radius-tag); font-size: var(--font-size-3); font-weight: 700; letter-spacing: .5px;
}
/* ---------- 顾客端：制作进展 / 我的 ---------- */
.steps { display: flex; gap: 6px; margin: 12px 0 4px; }
.steps .step {
  flex: 1; text-align: center; font-size: var(--font-size-1); color: var(--color-text-muted);
  border-top: 3px solid var(--color-border-soft); padding-top: 6px;
}
.steps .step i {
  display: block; font-style: normal; font-weight: 700; font-size: var(--font-size-3);
  color: var(--color-text-faint); margin-bottom: 2px;
}
.steps .step.on { border-top-color: var(--color-primary); color: var(--color-primary); font-weight: 700; }
.steps .step.on i { color: var(--color-primary); }
.sitems .spec-tag { color: var(--tone-error-fg); background: var(--tone-error-bg); padding: 1px 6px; border-radius: 4px; font-size: var(--font-size-2); }

.my-modal { max-height: 80vh; overflow-y: auto; }
.my-list { max-height: 60vh; overflow-y: auto; }
.my-row {
  border: 1px solid var(--color-border); border-radius: var(--radius-control); padding: 12px;
  margin-bottom: 10px; cursor: pointer; background: var(--color-surface);
}
.my-row:active { background: var(--color-surface-muted); }
.my-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
/* 顾客端不显示取餐号，原来的 .my-pickup 样式已删掉 */
.my-items { font-size: var(--font-size-3); color: var(--color-text-secondary); line-height: 1.5; }
.my-meta { display: flex; justify-content: space-between; gap: 8px; font-size: var(--font-size-1); color: var(--color-text-muted); margin-top: 6px; }
.my-note { font-size: var(--font-size-2); color: var(--tone-error-fg); margin-top: 4px; }

/* 蓝乐服务 logo：顾客页品牌背书（不抢占案名主标题） */
.ch-logo { display: block; height: 18px; width: auto; margin-bottom: 5px; }