/* ==================== 全局样式 ==================== */
:root {
  --primary: #FF6B35;
  --primary-light: #FF8C5A;
  --primary-dark: #E55A2B;
  --secondary: #2EC4B6;
  --danger: #E71D36;
  --success: #06D6A0;
  --warning: #FFD166;
  --info: #118AB2;
  --bg: #F5F5F5;
  --card-bg: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --text-lighter: #B2BEC3;
  --border: #E8ECF1;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --transition: 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ==================== 头部导航 ==================== */
.header {
  background: var(--primary);
  color: #fff;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.header-back:hover {
  background: rgba(255, 255, 255, 0.2);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* ==================== 区域选择 ==================== */
.area-nav {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 99;
}

.area-nav::-webkit-scrollbar {
  display: none;
}

.area-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.area-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.area-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ==================== 店铺列表 ==================== */
.store-list {
  padding: 12px 16px;
}

.store-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.store-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.store-info {
  flex: 1;
}

.store-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.store-category-count {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.store-arrow {
  color: var(--text-lighter);
  font-size: 16px;
}

/* ==================== 菜单页面 ==================== */
.menu-page {
  padding-bottom: 80px;
}

.category-nav {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.category-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.menu-items {
  padding: 12px 16px;
}

.menu-category-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 8px 0 10px;
  padding-left: 4px;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--card-bg);
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
}

.menu-item:hover {
  background: #FFF8F5;
}

.menu-item-name {
  font-size: 14px;
  color: var(--text);
  flex: 1;
}

.menu-item-add {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.menu-item-add:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.menu-item-add:active {
  transform: scale(0.95);
}

/* ==================== 购物车底部栏 ==================== */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 200;
}

.cart-bar-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.cart-bar-icon {
  position: relative;
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
}

.cart-bar-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.cart-bar-total {
  font-size: 13px;
  color: var(--text-light);
}

.cart-bar-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.cart-bar-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.cart-bar-btn:hover {
  background: var(--primary-dark);
}

/* ==================== 购物车弹窗 ==================== */
.cart-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.cart-modal {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

.cart-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-modal-title {
  font-size: 17px;
  font-weight: 700;
}

.cart-modal-clear {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
}

.cart-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.cart-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-lighter);
}

.cart-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 500;
}

.cart-item-store {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px;
}

.cart-item-qty button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
}

.cart-item-qty button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cart-item-qty span {
  font-size: 15px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-item-delete {
  background: none;
  border: none;
  color: var(--text-lighter);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.cart-item-delete:hover {
  color: var(--danger);
}

/* ==================== 提交订单弹窗 ==================== */
.order-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.order-modal {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px;
  animation: slideUp 0.3s ease;
}

.order-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.order-summary {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.order-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.order-summary-item .store-tag {
  color: var(--primary);
  font-size: 11px;
}

.order-form-group {
  margin-bottom: 14px;
}

.order-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
  display: block;
}

.order-form-input,
.order-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  transition: var(--transition);
  font-family: inherit;
  background: var(--bg);
}

.order-form-input:focus,
.order-form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.order-form-textarea {
  resize: none;
  height: 70px;
}

.order-submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.order-submit-btn:hover {
  background: var(--primary-dark);
}

/* ==================== 按钮样式 ==================== */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ==================== 订单卡片 ==================== */
.order-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.order-card-id {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

.order-card-time {
  font-size: 12px;
  color: var(--text-lighter);
}

.badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-warning {
  background: #FFF3CD;
  color: #856404;
}

.badge-info {
  background: #D1ECF1;
  color: #0C5460;
}

.badge-primary {
  background: #CCE5FF;
  color: #004085;
}

.badge-success {
  background: #D4EDDA;
  color: #155724;
}

.badge-danger {
  background: #F8D7DA;
  color: #721C24;
}

.badge-secondary {
  background: #E2E3E5;
  color: #383D41;
}

.order-card-customer {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.order-card-note {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.order-card-items {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  font-size: 13px;
}

.order-card-item {
  padding: 2px 0;
  color: var(--text);
}

.order-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ==================== 订单筛选标签 ==================== */
.order-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 99;
}

.order-tabs::-webkit-scrollbar {
  display: none;
}

.order-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.order-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.order-tab .count {
  margin-left: 4px;
  font-size: 11px;
}

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: var(--success);
  color: #fff;
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

.toast-info {
  background: var(--info);
  color: #fff;
}

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-lighter);
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 15px;
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

/* ==================== 页面容器 ==================== */
.page {
  display: none;
  padding-bottom: 80px;
}

.page.active {
  display: block;
}

/* ==================== 商户端额外样式 ==================== */
.merchant-header {
  background: linear-gradient(135deg, #2D3436, #636E72);
}

.merchant-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.stat-item {
  text-align: center;
  padding: 8px 4px;
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* 更新提示动画 */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.new-order-badge {
  animation: pulse 1s infinite;
}

/* 订单详情 */
.order-detail-store {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.order-detail-area {
  font-size: 12px;
  color: var(--text-light);
}

/* 搜索框 */
.search-box {
  padding: 10px 16px;
  background: #fff;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  font-size: 14px;
  background: var(--bg);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-lighter);
  font-size: 15px;
  pointer-events: none;
}

/* 响应式 - 针对大屏 */
@media (min-width: 768px) {
  body {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ==================== 商家端顶部视图切换 ==================== */
.merchant-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.merchant-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.merchant-tab.active {
  color: var(--primary);
}

.merchant-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.merchant-view {
  display: none;
}

.merchant-view.active {
  display: block;
}

/* ==================== 菜单管理样式 ==================== */
.menu-mgr-nav {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.menu-mgr-nav::-webkit-scrollbar {
  display: none;
}

.menu-mgr-area-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.menu-mgr-area-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.menu-mgr-store-bar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.menu-mgr-select {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.menu-mgr-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* 分类管理 */
.menu-mgr-category {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.menu-mgr-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #FFF8F5;
  border-bottom: 1px solid var(--border);
}

.menu-mgr-cat-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.menu-mgr-cat-actions {
  display: flex;
  gap: 6px;
}

.menu-mgr-cat-actions button {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-light);
}

.menu-mgr-cat-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.menu-mgr-cat-actions .btn-del-cat {
  color: var(--danger);
  border-color: transparent;
}

.menu-mgr-cat-actions .btn-del-cat:hover {
  background: #FFF0F0;
  border-color: var(--danger);
}

/* 菜品项 */
.menu-mgr-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  transition: var(--transition);
}

.menu-mgr-item:last-child {
  border-bottom: none;
}

.menu-mgr-item:hover {
  background: #FAFAFA;
}

.menu-mgr-item-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1.5px dashed var(--border);
  transition: var(--transition);
}

.menu-mgr-item-img:hover {
  border-color: var(--primary);
}

.menu-mgr-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-mgr-item-img .img-placeholder {
  font-size: 20px;
  color: var(--text-lighter);
}

.menu-mgr-item-img .img-edit-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 9px;
  text-align: center;
  padding: 2px 0;
  opacity: 0;
  transition: var(--transition);
}

.menu-mgr-item-img:hover .img-edit-hint {
  opacity: 1;
}

.menu-mgr-item-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.menu-mgr-item-del {
  background: none;
  border: none;
  color: var(--text-lighter);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  transition: var(--transition);
  flex-shrink: 0;
}

.menu-mgr-item-del:hover {
  color: var(--danger);
}

/* 添加菜品 / 分类行 */
.menu-mgr-add-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

.menu-mgr-add-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
}

.menu-mgr-add-row input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.menu-mgr-add-row button {
  flex-shrink: 0;
}

/* 底部操作栏 */
.menu-mgr-bottom-bar {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
}

.menu-mgr-bottom-bar button {
  flex: 1;
}

/* 图片预览弹窗 */
.img-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.img-preview-overlay img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: var(--radius);
}

.img-preview-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 顾客端菜单图片样式 */
.menu-item-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg);
  margin-right: 10px;
}

.menu-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-item-content {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

/* ==================== 收货地址样式 ==================== */

/* 头部地址按钮 */
.header-addr-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.header-addr-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 地址选择卡片（下单弹窗中） */
.addr-select-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
}

.addr-select-card:hover {
  border-color: var(--primary);
}

.addr-select-placeholder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-light);
  font-size: 14px;
}

.addr-select-info {
  line-height: 1.6;
}

.addr-select-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.addr-select-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.addr-select-phone {
  font-size: 13px;
  color: var(--text-light);
}

.addr-select-dorm {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 2px;
}

/* 地址选择器弹窗中的卡片 */
.addr-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.addr-card:hover {
  border-color: var(--primary-light);
}

.addr-card.selected {
  border-color: var(--primary);
  background: #FFF8F5;
}

.addr-card-body {
  flex: 1;
}

.addr-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.addr-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.addr-card-phone {
  font-size: 13px;
  color: var(--text-light);
}

.addr-card-tag {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-weight: 500;
}

.addr-card-dorm {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

.addr-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 10px;
}

/* 地址管理页卡片 */
.addr-manage-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.addr-manage-body {
  margin-bottom: 10px;
}

.addr-manage-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.addr-manage-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.addr-manage-phone {
  font-size: 14px;
  color: var(--text-light);
}

.addr-manage-dorm {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

.addr-manage-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 商家端订单卡中的宿舍地址 */
.order-card-dorm {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

/* ==================== 底部导航栏 ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.1);
  display: flex;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  z-index: 250;
  box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.06);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
  transition: transform 0.2s;
}

.bottom-nav-label {
  font-size: 10px;
  color: var(--text-lighter);
  font-weight: 500;
  transition: var(--transition);
}

.bottom-nav-item.active .bottom-nav-label {
  color: var(--primary);
  font-weight: 600;
}

.bottom-nav-item:active .bottom-nav-icon {
  transform: scale(0.85);
}

.bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: 50%;
  margin-right: -22px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 4px;
  border: 1.5px solid #fff;
}

/* ==================== App 弹窗 ==================== */
.app-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.app-modal {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

.app-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.app-modal-title {
  font-size: 17px;
  font-weight: 700;
}

.app-modal-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

.app-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}

.app-modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ==================== 安全区域适配 ==================== */
@supports (padding: max(0px)) {
  .header {
    padding-top: max(16px, env(safe-area-inset-top));
  }
  .page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ==================== 触摸反馈 ==================== */
@media (hover: none) {
  .store-card:active,
  .menu-item:active,
  .addr-card:active,
  .bottom-nav-item:active {
    opacity: 0.7;
  }
  .menu-item-add:active {
    transform: scale(0.9) !important;
  }
}

/* ==================== 下拉刷新提示 ==================== */
.pull-indicator {
  text-align: center;
  padding: 12px;
  color: var(--text-lighter);
  font-size: 13px;
  display: none;
}

.pull-indicator.show {
  display: block;
}

/* ==================== 订单状态标签（顾客端） ==================== */
.order-status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ==================== 我的页面 ==================== */
.profile-card {
  background: linear-gradient(135deg, #FF6B35, #FF8C5A);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.profile-phone {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 2px;
}

.profile-role {
  font-size: 11px;
  opacity: 0.75;
  background: rgba(255, 255, 255, 0.2);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
}

.profile-menu {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  transition: 0.15s;
  border-bottom: 1px solid #F0F0F0;
}

.profile-menu-item:last-child {
  border-bottom: none;
}

.profile-menu-item:active {
  background: #FAFAFA;
}

.profile-menu-icon {
  font-size: 20px;
  margin-right: 12px;
  width: 28px;
  text-align: center;
}

.profile-menu-text {
  flex: 1;
  font-size: 15px;
  color: #2D3436;
}

.profile-menu-arrow {
  font-size: 18px;
  color: #B2BEC3;
}

.profile-version {
  text-align: center;
  font-size: 12px;
  color: #B2BEC3;
  padding: 16px 0;
}