/* ============================================================
   扫码点餐 H5 — 顾客点餐端 UI（食欲暖橙系）
   主色   #FF6B1A 食欲橙（主按钮 / 加购 / 选中）
   价格   #E8452C 番茄红（价格 / 金额 / 强调）
   背景   #FFF8F0 暖米白（页面）  #F0E6DA（画布外）
   卡片   #FFFFFF 纯白
   文字   #2B2118 深棕  /  次要 #8A7A6B 暖灰棕
   ============================================================ */
:root {
  --primary: #FF6B1A;
  --primary-dark: #F25E0A;
  --primary-light: #FFF1E6;
  --price: #E8452C;
  --bg: #FFF8F0;
  --bg-deep: #F0E6DA;
  --card: #FFFFFF;
  --card-pure: #FFFFFF;
  --accent: #FF6B1A;      /* 兼容旧引用：主按钮/加购/选中 */
  --accent-dark: #F25E0A;
  --accent2: #FF6B1A;     /* 兼容旧引用 */
  --text: #2B2118;
  --muted: #8A7A6B;
  --line: #F0E6DA;
  --danger: #E8452C;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(255, 107, 26, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* 手机画布：电脑上居中显示，手机上全屏 */
.phone {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

/* ---------- 页头 ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.header .brand { font-size: 20px; font-weight: 700; color: var(--text); }
.header .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.table-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
}
.orders-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  background: var(--primary-light);
  padding: 5px 12px;
  border-radius: 999px;
}
.back {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  font-size: 20px;
  line-height: 30px;
  text-align: center;
  margin-right: 10px;
  color: var(--primary);
}
.header-left { display: flex; align-items: center; }

/* ---------- 选桌页 ---------- */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 10px 16px 30px;
}
.table-chip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .1s;
}
.table-chip:active { transform: scale(.95); background: var(--primary); color: #fff; }

/* ---------- 菜单页 ---------- */
.menu-search { padding: 10px 12px; background: var(--bg); }
.menu-search input {
  width: 100%; box-sizing: border-box;
  padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--text);
  font-size: 14px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.menu-search input:focus { border-color: var(--primary); }
.menu-search input::placeholder { color: var(--muted); }
.menu-wrap { display: flex; height: calc(100vh - 134px); height: calc(100dvh - 134px); }
.cat-nav {
  width: 88px;
  background: var(--card);
  overflow-y: auto;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
}
.cat-item {
  padding: 16px 6px;
  text-align: center;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  border-left: 3px solid transparent;
}
.cat-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  border-left-color: var(--primary);
}
.dish-list {
  flex: 1;
  overflow-y: auto;
  position: relative;
  padding: 4px 12px 20px;
}
.cat-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  color: var(--text);
  font-weight: 700;
  margin: 16px 2px 10px;
}
.cat-title::before {
  content: '';
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}
.dish-card {
  display: flex;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.dish-card.soldout { opacity: .45; }
.dish-img {
  width: 130px; height: 130px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  flex-shrink: 0;
  overflow: hidden;
}
.dish-img img { width: 100%; height: 100%; object-fit: cover; }
.dish-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish-name {
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dish-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 17px;
}
.dish-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dish-price { color: var(--price); font-size: 12px; }
.dish-price b { font-size: 17px; font-weight: 700; }

/* 数量步进器 */
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.step-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
  font-weight: 700;
}
.step-btn.plus { background: var(--primary); color: #fff; }
.step-btn.minus { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.step-btn:active { transform: scale(.9); }
.step-num { min-width: 16px; text-align: center; font-weight: 600; font-size: 14px; }

/* ---------- 悬浮购物车 ---------- */
.cartbar-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; pointer-events: none; }
.cartbar {
  pointer-events: auto;
  max-width: 452px;
  margin: 0 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--text);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 14px;
  box-shadow: 0 6px 20px rgba(43, 33, 24, .3);
  color: #fff;
}
.cart-left { display: flex; align-items: center; gap: 10px; }
.cart-icon {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cart-icon svg { width: 20px; height: 20px; }
.cart-icon .badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--price);
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  line-height: 18px;
  border-radius: 999px;
  text-align: center;
  padding: 0 4px;
}
.cart-total { font-size: 12px; color: #EBD9B4; }
.cart-total b { font-size: 18px; color: #fff; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 22px;
}
.btn-primary:active { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; }
.cart-go { flex-shrink: 0; }

/* ---------- 底部弹出面板 ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(43, 33, 24, .45);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.sheet-head .clear { color: var(--muted); font-size: 13px; }
.sheet-body { overflow-y: auto; flex: 1; }
.sheet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.sheet-row .ci-name { flex: 1; font-weight: 600; }
.sheet-row .ci-price { color: var(--price); font-size: 13px; }
.sheet-go { width: 100%; margin-top: 14px; padding: 13px; font-size: 16px; }

/* ---------- 通用页面 ---------- */
.page { padding: 4px 16px 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.addon-banner {
  margin: 0 16px 10px;
  background: var(--primary-light);
  border: 1px dashed var(--primary);
  color: var(--primary-dark);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
}

/* 确认订单 */
.table-line { display: flex; align-items: center; gap: 10px; }
.table-line span { color: var(--muted); font-size: 15px; }
.table-line b { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.table-line .change-table { margin-left: auto; color: var(--primary); font-size: 13px; }
.confirm-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.confirm-row + .confirm-row { border-top: 1px solid var(--line); }
.ci-emoji { font-size: 20px; }
.ci-name { flex: 1; font-size: 14px; }
.ci-qty { color: var(--muted); font-size: 13px; }
.ci-sub { font-weight: 600; font-size: 14px; min-width: 64px; text-align: right; }
textarea#remark {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  font-size: 16px;   /* ≥16px 防 iOS 聚焦缩放 */
  font-family: inherit;
  color: var(--text);
  outline: none;
  min-height: 44px;
}

/* 底部操作栏（确认页） */
.footer-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--card-pure);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(43, 33, 24, .1);
  z-index: 40;
}
.footer-total { font-size: 13px; color: var(--muted); }
.footer-total b { color: var(--price); font-size: 22px; }
.footer-bar .btn-primary { padding: 12px 34px; }

/* 成功页 */
.success-wrap { text-align: center; padding: 60px 20px 20px; }
.success-icon {
  width: 76px; height: 76px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 40px;
  line-height: 76px;
}
.pickup-no {
  margin: 0 auto 14px;
  font-size: 14px;
  color: var(--muted);
}
.pickup-no b {
  display: inline-block;
  min-width: 64px;
  margin-left: 6px;
  padding: 4px 14px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 26px;
  letter-spacing: 2px;
}
.success-wrap h2 { color: var(--text); margin-bottom: 6px; }
.success-wrap p { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.success-btns { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.btn-ghost {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  border-radius: 999px;
  padding: 11px 34px;
  background: var(--card);
}

/* 订单列表 / 详情 */
.order-card { position: relative; }
.order-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-no { font-size: 12px; color: var(--muted); }
.status-pill {
  font-size: 12px;
  color: var(--primary-dark);
  background: var(--primary-light);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 500;
}
.order-summary { font-size: 14px; font-weight: 600; }
.order-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }
.order-total { color: var(--text); }
.order-total b { color: var(--price); font-size: 16px; }
.detail-block-title { font-size: 13px; color: var(--muted); font-weight: 600; margin: 2px 2px 8px; }
.detail-actions { display: flex; gap: 12px; padding: 6px 16px 10px; flex-wrap: wrap; }
.detail-actions .btn-primary, .detail-actions .btn-ghost { flex: 1; text-align: center; padding: 12px 0; }

/* ===== 结账提示（2026-10-02）：本店到前台结账，防顾客误以为下单=已支付 ===== */
/* 黄色提示条：成功页横幅 + 详情页底部常驻条共用（店主选定样式） */
.pay-banner {
  background: #FAC775;
  color: #412402;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}
/* 详情页合计下方红字（仅未结账时显示） */
.pay-hint { text-align: center; color: var(--danger); font-size: 13px; font-weight: 600; margin: 10px 0 2px; }
/* 下单成功页弹窗强提醒 */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(43, 33, 24, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-card {
  background: var(--card); border-radius: 14px;
  padding: 20px 16px; width: 100%; max-width: 320px; text-align: center;
}
.modal-card h3 { font-size: 16px; margin-bottom: 6px; }
.modal-card p { font-size: 14px; line-height: 1.7; margin-bottom: 14px; }
.pay-strong { color: var(--danger); }

/* ===== 大众点评打卡送饮品（2026-10-03）：下单成功页底部活动卡片 ===== */
.dp-card {
  margin: 18px auto 0;
  max-width: 340px;
  background: var(--card);
  border: 1px solid #FAC775;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
}
.dp-title { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.dp-desc { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.dp-desc b { color: var(--text); }
.dp-btn {
  display: block; width: 100%;
  background: var(--primary); color: #fff;
  border-radius: 20px; padding: 10px 0;
  font-size: 14px; font-weight: 600; letter-spacing: 1px;
}
.dp-btn:active { background: var(--primary-dark); }
.dp-note { font-size: 11px; color: var(--muted); margin: 8px 0 0; text-align: center; }

/* 空状态 */
.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty .empty-icon { font-size: 52px; margin-bottom: 12px; }

/* Toast */
.toast {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(43, 33, 24, .88);
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 99;
  max-width: 78%;
  text-align: center;
}

/* ===== V2：订单状态 / 未上桌 / 同桌共享 ===== */
.status-pill.closed { background: #ECEFF1; color: #78909C; }
.shared-tag {
  font-size: 11px;
  color: #fff;
  background: var(--primary, #FF6B1A);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 500;
  margin-right: auto;
}
.unserved-badge {
  display: inline-block;
  font-size: 10px;
  color: #fff;
  background: var(--price);
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 1px;
  font-weight: 400;
}
.unserved-hint { color: var(--price); font-weight: 600; }
.join-info { padding: 4px 2px 12px; }
.join-summary { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.join-meta { font-size: 12px; color: var(--muted); }
.join-btn { display: block; width: 100%; margin-top: 10px; text-align: center; padding: 13px; border-radius: 999px; font-size: 15px; font-weight: 600; cursor: pointer; }
.join-btn.btn-primary { border: none; }
.join-btn.btn-ghost { background: transparent; border: 1px solid var(--muted); color: var(--text); }

/* ===== 规格选择 ===== */
.spec-btn {
  border: none; background: var(--primary); color: #fff;
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600;
  position: relative; cursor: pointer;
  flex-shrink: 0; white-space: nowrap;   /* 大图版式下防被价格挤成两行 */
}
.spec-count {
  display: inline-block; min-width: 16px; height: 16px; line-height: 16px;
  background: #fff; color: var(--primary); border-radius: 999px;
  font-size: 10px; font-style: normal; padding: 0 4px; vertical-align: 1px;
}
.spec-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* 规格弹层（升级版：图 + 胶囊 + 数量 + 加入购物车） */
.spec-head { align-items: flex-start; border-bottom: none; gap: 12px; }
.spec-thumb {
  width: 72px; height: 72px;
  border-radius: 10px;
  background: var(--primary-light);
  overflow: hidden;
  flex-shrink: 0;
}
.spec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.spec-info { flex: 1; min-width: 0; }
.spec-info b { display: block; font-size: 16px; }
.spec-info .spec-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.spec-info .spec-price { display: block; color: var(--price); font-size: 18px; font-weight: 700; margin-top: 4px; }
.spec-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--muted);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.spec-body { padding: 14px 0 4px; }
.spec-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.spec-caps { display: flex; flex-wrap: wrap; gap: 10px; }
.spec-cap {
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}
.spec-cap.active {
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.spec-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 4px;
}
.spec-qty-row .spec-label { margin-bottom: 0; }
.spec-qty-row .stepper { gap: 14px; }
.spec-qty-row .step-btn { width: 28px; height: 28px; }
