/* 康哥肉夹馍 - 顾客点餐端样式（新版移动优先） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 确保 hidden 属性始终生效（防止 .sheet 等 display 规则覆盖） */
[hidden] { display: none !important; }

:root {
  --brand: #E8590C;
  --brand-deep: #C23F0A;
  --brand-soft: #FFF1E6;
  --bg: #F7F3EC;
  --card: #FFFFFF;
  --ink: #2B1B12;
  --muted: #9B8D7D;
  --line: #F0E8DC;
  --ok: #1E9E5A;
  --warn: #D97706;
  --gray: #B4A795;
  --shadow: 0 2px 12px rgba(43, 27, 18, .06);
  --shadow-lg: 0 8px 28px rgba(43, 27, 18, .12);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 74px; }

/* ---- 顶部 ---- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; border-radius: 13px; object-fit: cover; box-shadow: var(--shadow); }
.brand-text h1 { font-size: 18px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.brand-text p { font-size: 11px; color: var(--muted); letter-spacing: .3px; }

/* ---- 公告 ---- */
.notice {
  margin: 10px 14px 0;
  background: #FFF7ED;
  border: 1px solid #FBE3C8;
  color: var(--warn);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.6;
}

/* ---- 首页取餐提醒卡 ---- */
.pickup-card {
  margin: 12px 14px 2px;
  border-radius: 18px;
  padding: 16px 18px;
  color: #fff;
  background: linear-gradient(135deg, #3A2417 0%, #6B3410 55%, #B4550E 100%);
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.pickup-card::after {
  content: ""; position: absolute; right: -30px; top: -40px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.pickup-card::before {
  content: ""; position: absolute; right: 30px; bottom: -50px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255, 255, 255, .05);
}
.pickup-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.pickup-label { font-size: 12px; opacity: .85; letter-spacing: 1px; }
.pickup-status {
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.pickup-status.s0 { background: rgba(255, 214, 130, .22); color: #FFD982; }
.pickup-status.s1 { background: rgba(120, 255, 170, .2); color: #7BFFB0; }
.pickup-status.s2 { background: rgba(255, 255, 255, .16); color: rgba(255,255,255,.7); }
.pickup-no { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; position: relative; z-index: 1; }
.pickup-no small { font-size: 12px; opacity: .75; }
.pickup-no b { font-size: 40px; font-weight: 800; letter-spacing: 3px; line-height: 1.1; }
.pickup-meta { margin-top: 8px; font-size: 12.5px; opacity: .85; position: relative; z-index: 1; }

/* ---- 分类标签 ---- */
.cat-tabs {
  position: sticky; top: 65px; z-index: 20;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 14px 8px;
  background: var(--bg);
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs .chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.cat-tabs .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(232, 89, 12, .25); }

/* ---- 菜单 ---- */
.menu-sec { padding: 2px 14px 0; }
.menu-sec h2 {
  font-size: 15px; font-weight: 800;
  margin: 14px 0 10px;
  display: flex; align-items: center; gap: 6px;
}
.menu-sec h2::before { content: ""; width: 4px; height: 16px; background: linear-gradient(180deg, var(--brand), var(--brand-deep)); border-radius: 2px; }

.item-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(240, 232, 220, .6);
}
.item-thumb {
  width: 86px; height: 86px; border-radius: 13px;
  object-fit: cover; flex-shrink: 0;
  background: var(--brand-soft);
  box-shadow: 0 1px 6px rgba(43, 27, 18, .08);
}
.item-info { min-width: 0; flex: 1; }
.item-name { font-size: 15.5px; font-weight: 700; }
.item-desc { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-price { font-size: 17px; font-weight: 800; color: var(--brand); margin-top: 5px; }
.item-price small { font-size: 12px; font-weight: 500; }
.item-card.off { opacity: .55; }
.badge-off {
  display: inline-block; margin-left: 6px; vertical-align: 1px;
  font-size: 10px; color: #fff; background: var(--gray);
  border-radius: 5px; padding: 1px 7px; font-weight: 400;
}
.item-opt-tip {
  display: inline-block; margin-left: 6px; vertical-align: 1px;
  font-size: 10px; color: var(--brand); background: var(--brand-soft);
  border-radius: 5px; padding: 1px 7px; font-weight: 500;
}

/* ---- 数量步进器 ---- */
.stepper { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.step-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--brand); background: #fff; color: var(--brand);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s ease;
}
.step-btn.minus { color: var(--muted); border-color: var(--line); }
.step-qty { min-width: 26px; text-align: center; font-size: 15px; font-weight: 700; }
.step-btn.add { background: var(--brand); color: #fff; width: 34px; height: 34px; box-shadow: 0 4px 10px rgba(232, 89, 12, .3); }

/* ---- 通用按钮 ---- */
.btn {
  border: 0; border-radius: 13px; cursor: pointer;
  font-size: 15px; font-weight: 700;
  padding: 12px 20px;
  font-family: inherit;
  transition: all .12s ease;
}
.btn-primary { background: linear-gradient(135deg, #F2700C, #E14B0A); color: #fff; box-shadow: 0 6px 16px rgba(232, 89, 12, .3); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 3px 8px rgba(232, 89, 12, .25); }
.btn-ghost { background: var(--brand-soft); color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.link { border: 0; background: none; color: var(--brand); font-size: 13px; cursor: pointer; padding: 4px; font-family: inherit; }

/* ---- 底部导航 ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  margin: 0 auto; max-width: 520px;
  display: flex;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; cursor: pointer;
  font-family: inherit;
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
  border-radius: 12px;
  transition: color .15s ease;
}
.tab svg { width: 23px; height: 23px; }
.tab.on { color: var(--brand); }

/* ---- 底部购物车栏 ---- */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 39;
  margin: 0 auto; max-width: 520px;
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.cart-bar .btn { padding: 11px 22px; }
.cart-info {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: none; border: 0; text-align: left; cursor: pointer; padding: 0;
  font-family: inherit;
}
.cart-count {
  background: linear-gradient(135deg, #F2700C, #E14B0A); color: #fff;
  min-width: 28px; height: 28px; border-radius: 999px;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 9px;
  box-shadow: 0 3px 8px rgba(232, 89, 12, .3);
}
.cart-total { font-size: 18px; font-weight: 800; color: var(--ink); }
.cart-empty-tip { flex: 1; font-size: 14px; color: var(--muted); }

/* ---- 遮罩 / 弹层 ---- */
.mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30, 20, 12, .55);
  margin: 0 auto; max-width: 520px;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  margin: 0 auto; max-width: 520px;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 84vh;
  display: flex; flex-direction: column;
  box-shadow: 0 -8px 30px rgba(43, 27, 18, .14);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { font-size: 16.5px; font-weight: 800; }
.sheet-body { overflow-y: auto; flex: 1; padding: 12px 0; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sheet-foot .sum { font-size: 14px; color: var(--muted); }
.sheet-foot .sum b { font-size: 18px; color: var(--brand); }

/* ---- 购物车条目 ---- */
.cart-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; }
.cart-item-info .n { font-size: 14.5px; font-weight: 700; }
.cart-item-info .p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cart-item-price { font-size: 14px; font-weight: 700; color: var(--brand); min-width: 70px; text-align: right; }

/* ---- 表单 ---- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 13px; font-size: 15px; font-family: inherit;
  background: #FFFDF9; color: var(--ink);
  outline: none;
  transition: border-color .15s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip {
  padding: 8px 15px; border-radius: 11px;
  background: #F8F3EA; border: 1px solid var(--line);
  font-size: 13px; cursor: pointer;
  transition: all .15s ease;
}
.chips .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.chips .chip.disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }

.pay-tip { font-size: 12px; color: var(--muted); text-align: center; margin-top: 4px; }

/* ---- 成功页 ---- */
.sheet-ok { align-items: center; text-align: center; }
.ok-mark {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #2FB872, #1E9E5A); color: #fff;
  font-size: 33px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 6px auto 12px;
  box-shadow: 0 8px 20px rgba(30, 158, 90, .3);
}
.ok-title { font-size: 20px; font-weight: 800; }
.ok-sub { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.ok-card {
  width: 100%; background: var(--brand-soft);
  border-radius: 14px; padding: 13px 15px;
}
.ok-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.ok-row span { color: var(--muted); }
.ok-row b { color: var(--ink); font-weight: 800; }
.ok-items { width: 100%; text-align: left; margin-top: 12px; }
.ok-items .line { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; color: var(--ink); }
.ok-items .line span { color: var(--muted); }
.ok-actions { display: flex; gap: 10px; width: 100%; margin-top: 14px; }
.ok-actions .btn { flex: 1; }

/* ---- 订单页 ---- */
.page-title { font-size: 17px; font-weight: 800; padding: 14px 16px 6px; }
.query-box { display: flex; gap: 10px; padding: 12px 16px; }
.query-box input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 13px;
  padding: 12px 13px; font-size: 15px; background: var(--card); outline: none;
}
.query-box input:focus { border-color: var(--brand); }

.ord-card { background: var(--card); border-radius: 16px; padding: 14px 15px; margin: 0 14px 10px; box-shadow: var(--shadow); border: 1px solid rgba(240,232,220,.6); }
.ord-head { display: flex; align-items: center; justify-content: space-between; }
.ord-no { font-size: 14.5px; font-weight: 800; letter-spacing: .5px; }
.ord-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ord-items { font-size: 13px; color: var(--ink); margin-top: 9px; background: var(--bg); border-radius: 11px; padding: 9px 11px; }
.ord-items .line { display: flex; justify-content: space-between; padding: 3px 0; }
.ord-note { font-size: 12px; color: var(--warn); margin-top: 7px; }
.ord-total { text-align: right; font-size: 14px; margin-top: 7px; }
.ord-total b { color: var(--brand); font-size: 16px; }
.ord-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 44px 0; }
.ord-empty b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }

/* ---- 状态徽标 ---- */
.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 4px 11px;
}
.badge.s0 { background: #FFF3DE; color: var(--warn); }
.badge.s1 { background: #E3F9EC; color: var(--ok); }
.badge.s2 { background: #F2EEE7; color: var(--gray); }

/* ---- 空态 ---- */
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 48px 0; }

/* ---- 配料弹层 ---- */
.opt-sec-title { font-size: 13.5px; font-weight: 800; color: var(--ink); margin: 6px 0 2px; }
.opt-sec-title:not(:first-child) { margin-top: 16px; }
.opt-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 2px; border-bottom: 1px solid var(--line);
}
.opt-row:last-child { border-bottom: 0; }
.opt-label { display: flex; align-items: baseline; gap: 8px; }
.opt-name { font-size: 15px; font-weight: 600; }
.opt-price { font-size: 13px; color: var(--brand); font-weight: 700; }
.opt-check {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--line); background: #fff;
  color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .12s ease;
}
.opt-check.on { background: var(--brand); border-color: var(--brand); box-shadow: 0 3px 8px rgba(232, 89, 12, .28); }
.opt-switch {
  display: flex; gap: 0;
  background: #F6F0E6;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.opt-switch .chip {
  flex: 1; min-width: 60px;
  padding: 8px 0;
  border: 0; border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none; appearance: none;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.opt-switch .chip.on {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232, 89, 12, .35);
}

/* ---- 我的（个人中心） ---- */
.mine-head {
  display: flex; align-items: center; gap: 13px;
  margin: 14px 14px 12px;
  padding: 18px 15px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(240,232,220,.6);
}
.mine-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, #F2700C, #C23F0A); color: #fff;
  font-size: 22px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(232, 89, 12, .3);
}
.mine-info { min-width: 0; flex: 1; }
.mine-name { font-size: 17px; font-weight: 800; word-break: break-all; }
.mine-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
#logoutBtn { flex-shrink: 0; }

/* ---- 全屏登录 / 注册 ---- */
.auth-page {
  position: fixed; inset: 0; z-index: 80;
  margin: 0 auto; max-width: 520px;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.auth-page-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px 6px;
  color: var(--ink);
}
.auth-back {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.auth-back svg { width: 20px; height: 20px; }
.auth-title { font-size: 16px; font-weight: 800; }
.auth-head-side { width: 38px; }
.auth-tabs {
  display: flex; gap: 0;
  margin: 14px 16px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow);
}
.auth-tabs .chip {
  flex: 1;
  border: 0; border-radius: 999px;
  padding: 11px 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.auth-tabs .chip.on {
  background: linear-gradient(135deg, #F2700C, #E14B0A);
  color: #fff;
  box-shadow: 0 4px 12px rgba(232, 89, 12, .3);
}
.auth-body { padding: 0 16px 30px; flex: 1; }
.auth-panel {
  background: var(--card);
  padding: 20px 16px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(240,232,220,.6);
}
.btn-block { width: 100%; }
.auth-tip { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 24px; }

/* 桌面端居中留白 */
@media (min-width: 560px) {
  .app { box-shadow: 0 0 30px rgba(43, 27, 18, .05); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
