/* 炙巷食谱 顾客点餐页 - 移动端优先，暖橙主题（与 APP 同配色） */
:root {
  --primary: #E85D04;
  --primary-dim: #DC2F02;
  --primary-light: #FF8C42;
  --bg: #FBF7F4;
  --surface: #FFFFFF;
  --surface-variant: #F5EDE6;
  --card: #F0E6DC;
  --navbar: #FFFFFF;
  --navbar-border: #E8DDD2;
  --text-primary: #2C1810;
  --text-secondary: #6B5E53;
  --text-muted: #A89888;
  --success: #2D6A4F;
  --warning: #E09F3E;
  --error: #C1121F;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 15px;
}

.hidden { display: none !important; }

/* ============ 语言选择页 ============ */
.lang-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: var(--bg);
  text-align: center;
}
.lang-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(44,24,16,0.12);
}
.lang-brand { font-size: 28px; font-weight: 800; line-height: 1.3; }
.lang-brand span { font-size: 15px; font-weight: 700; color: var(--text-secondary); letter-spacing: 1px; }
.lang-hint { font-size: 14px; color: var(--text-muted); margin: 8px 0 12px; }
.lang-btn-big {
  width: 220px;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  border: 1px solid var(--navbar-border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
}
.lang-btn-big:active { transform: scale(0.98); background: var(--surface-variant); }

/* ============ 主界面 ============ */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg);
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--navbar);
  border-bottom: 1px solid var(--navbar-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.topbar-title { flex: 1; }
.tb-name { font-size: 18px; font-weight: 800; }
.tb-sub { font-size: 11px; color: var(--text-secondary); letter-spacing: 0.5px; }
.cart-btn {
  position: relative;
  font-size: 24px;
  background: var(--surface-variant);
  border: none;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
}
.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* 桌号条 */
.table-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.table-no { font-size: 16px; font-weight: 800; letter-spacing: 1px; }

/* 广告轮播 */
.ad-carousel {
  margin: 12px 16px 0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--card);
}
.ad-track {
  display: flex;
  transition: transform 0.5s ease;
}
.ad-slide {
  flex: 0 0 100%;
  min-width: 100%;
}
.ad-img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  display: block;
  background: var(--card);
}
.ad-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.ad-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background 0.3s;
}
.ad-dot.active { background: #fff; width: 18px; border-radius: 4px; }

/* 内容区 */
.content { flex: 1; overflow-y: auto; padding: 12px 16px 140px; }

/* 标题 */
.page-title {
  font-size: 20px;
  font-weight: 800;
  margin: 8px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title .back-btn {
  font-size: 22px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--navbar-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

/* 菜品网格（菜单列表） */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.menu-card {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(44,24,16,0.06);
  border: 1px solid var(--navbar-border);
}
.menu-card:active { transform: scale(0.98); }
.menu-img {
  width: 100%;
  height: 130px;
  background: var(--surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  object-fit: cover;
}
.menu-card-body { padding: 10px 12px 12px; }
.menu-name { font-size: 15px; font-weight: 700; }
.menu-price { font-size: 14px; font-weight: 800; color: var(--primary); margin-top: 4px; }

/* 菜品详情页 */
.dish-img {
  width: 100%;
  height: 200px;
  background: var(--surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  border-radius: 14px;
  object-fit: cover;
}
.dish-name { font-size: 20px; font-weight: 800; margin: 14px 0 4px; }
.dish-price { font-size: 16px; font-weight: 800; color: var(--primary); }

/* 口味步进器 */
.flavor-section { margin-top: 16px; }
.flavor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--navbar-border);
}
.flavor-label { font-size: 15px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 16px; }
.qty-btn {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: none;
  background: var(--surface-variant);
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
}
.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-val { font-size: 17px; font-weight: 800; min-width: 22px; text-align: center; }

/* 备注 */
.note-label { font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.note-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--navbar-border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-primary);
  resize: none;
  min-height: 72px;
}
.note-input:focus { outline: none; border-color: var(--primary); }

/* 底部导航栏 */
.bottom-nav {
  display: flex;
  background: var(--navbar);
  border-top: 1px solid var(--navbar-border);
  position: sticky;
  bottom: 0;
  z-index: 55;
  padding-bottom: env(safe-area-inset-bottom);
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}
.bn-icon { font-size: 22px; line-height: 1; }
.bn-label { font-size: 12px; font-weight: 600; }
.bn-item.active { color: var(--primary); }

/* 底部操作栏 */
.bottom-bar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: var(--navbar);
  border-top: 1px solid var(--navbar-border);
  position: sticky;
  bottom: 0;
  z-index: 50;
}
.fixed-bottom {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 -4px 16px rgba(44,24,16,0.08);
  z-index: 60;
}.btn-primary {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary:disabled { background: var(--text-muted); opacity: 0.6; cursor: not-allowed; }

/* 购物车页 */
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--navbar-border);
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 15px; font-weight: 700; }
.cart-item-flavors { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.cart-item-note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.cart-item-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.cart-edit-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface-variant);
  border: 1px solid var(--navbar-border);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}
.cart-edit-btn:active { transform: scale(0.96); }
.cart-ordered-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
  background: #E7F2EC;
  border-radius: 8px;
  padding: 4px 8px;
  white-space: nowrap;
}
.cart-item-qty { font-size: 13px; color: var(--text-secondary); }
.cart-item-amt { font-size: 15px; font-weight: 800; color: var(--primary); margin-top: 2px; }

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-size: 16px;
}
.cart-total-row .total-label { font-weight: 700; }
.cart-total-row .total-amt { font-size: 22px; font-weight: 800; color: var(--primary); }

.cart-empty { text-align: center; color: var(--text-muted); padding: 60px 0; font-size: 15px; }

/* 成功提示弹窗 */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(44,24,16,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-box {
  background: var(--surface);
  border-radius: 18px;
  padding: 26px 22px;
  width: 340px;
  max-width: 88vw;
  text-align: center;
}
.modal-icon { font-size: 52px; }
.modal-title { font-size: 18px; font-weight: 800; margin: 10px 0 8px; }
.modal-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.5; }
