:root {
  --brand: #e8543f;
  --brand-dark: #c73b28;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #22252a;
  --text-2: #8a9099;
  --line: #eceef1;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(64px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

/* 顶部头图（完整展示海报 + 品牌标题栏） */
.header {
  background: #fff;
  border-radius: 0 0 20px 20px;
  overflow: hidden;
}
.hero-img { display: block; width: 100%; height: auto; }
.titlebar {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 14px 18px;
}
.titlebar h1 { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.titlebar p { font-size: 13px; opacity: .92; margin-top: 4px; }

/* 分类 tab */
.tabs {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 14px; background: var(--bg);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 6px 14px; border-radius: 16px;
  font-size: 14px; color: var(--text-2); background: #fff;
  border: 1px solid var(--line); white-space: nowrap; cursor: pointer;
  transition: .15s;
}
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

/* 菜单 */
.menu { padding: 4px 14px 20px; }
.cat-title {
  font-size: 15px; font-weight: 700; margin: 16px 4px 8px;
  padding-left: 8px; border-left: 3px solid var(--brand);
}
.dish {
  display: flex; gap: 12px; background: var(--card);
  border-radius: 14px; padding: 12px; margin-bottom: 10px;
  align-items: center;
}
.dish-img {
  width: 62px; height: 62px; border-radius: 12px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; background: #f2f3f5;
}
.dish-info { flex: 1; min-width: 0; }
.dish-name { font-size: 15px; font-weight: 600; }
.dish-desc { font-size: 12px; color: var(--text-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dish-price { font-size: 15px; color: var(--brand); font-weight: 700; margin-top: 6px; }
.dish-price small { font-size: 11px; }

/* 数量控制 */
.stepper { display: flex; align-items: center; gap: 10px; }
.step-btn {
  width: 26px; height: 26px; border-radius: 50%; border: none;
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.step-btn.plus { background: var(--brand); color: #fff; }
.step-btn.minus { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.step-qty { min-width: 18px; text-align: center; font-size: 15px; font-weight: 600; }
.step-qty.empty { display: none; }
.step-btn.minus.hidden { display: none; }

/* 底部购物车条 */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(58px + var(--safe-bottom));
  padding: 0 14px calc(var(--safe-bottom)) 14px;
  display: flex; align-items: center; gap: 12px;
  background: #2b2f36; color: #fff;
}
.cartbar-left { display: flex; align-items: center; gap: 12px; flex: 1; cursor: pointer; }
.cart-icon {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand); display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-top: -14px; box-shadow: 0 4px 12px rgba(232,84,63,.5);
}
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  border-radius: 9px; background: #fff; color: var(--brand);
  font-size: 11px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; padding: 0 4px; border: 2px solid #2b2f36;
}
.cart-total { display: flex; flex-direction: column; }
.total-amount { font-size: 19px; font-weight: 700; }
.total-hint { font-size: 11px; color: #a7adb5; }
.checkout-btn {
  padding: 10px 24px; border: none; border-radius: 22px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.checkout-btn:disabled { background: #565b63; color: #9aa0a8; }

/* 遮罩 */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 45;
  opacity: 0; visibility: hidden; transition: .2s;
}
.mask.show { opacity: 1; visibility: visible; }

/* 购物车抽屉 */
.cart-panel {
  position: fixed; left: 0; right: 0; z-index: 46;
  bottom: calc(58px + var(--safe-bottom));
  background: #fff; border-radius: 16px 16px 0 0;
  transform: translateY(110%); transition: .25s; max-height: 55vh;
  display: flex; flex-direction: column;
  visibility: hidden;
}
.cart-panel.show { transform: translateY(0); visibility: visible; }
.cart-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; font-size: 14px; color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.clear-cart { cursor: pointer; }
.cart-list { overflow-y: auto; padding: 6px 16px 12px; }
.cart-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.cart-row .name { font-size: 14px; }
.cart-row .price { font-size: 13px; color: var(--brand); margin-left: 8px; }
.cart-row .right { display: flex; align-items: center; gap: 10px; }

/* 下单弹窗 */
.order-modal {
  position: fixed; left: 50%; top: 50%; z-index: 50;
  transform: translate(-50%, -50%) scale(.92);
  width: min(92vw, 380px); background: #fff; border-radius: 16px;
  padding: 20px 18px; opacity: 0; visibility: hidden; transition: .2s;
}
.order-modal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.order-modal h2 { font-size: 17px; text-align: center; margin-bottom: 14px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.field em { color: var(--brand); font-style: normal; }
.field input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; background: #fafbfc;
}
.field input:focus { outline: none; border-color: var(--brand); background: #fff; }
.order-summary {
  background: #fafbfc; border-radius: 10px; padding: 10px 12px;
  font-size: 13px; max-height: 130px; overflow-y: auto; margin-bottom: 14px;
}
.order-summary .srow { display: flex; justify-content: space-between; padding: 2px 0; }
.order-summary .stotal { font-weight: 700; color: var(--brand); border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.order-actions { display: flex; gap: 10px; }
.btn-ghost, .btn-primary {
  flex: 1; padding: 12px; border-radius: 24px; font-size: 15px;
  font-weight: 600; cursor: pointer; border: none;
}
.btn-ghost { background: #f0f1f3; color: var(--text); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:disabled { opacity: .6; }

/* toast */
.toast {
  position: fixed; left: 50%; top: 40%; transform: translateX(-50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 20px 26px;
  border-radius: 14px; font-size: 15px; z-index: 60; text-align: center;
  opacity: 0; visibility: hidden; transition: .2s; max-width: 80vw;
}
.toast.show { opacity: 1; visibility: visible; }
.toast .big { font-size: 34px; display: block; margin-bottom: 8px; }
