/* ========== 白酒私域小程序 主题样式 ========== */
:root {
  --primary: #8B0000;           /* 深酒红 */
  --primary-light: #A52A2A;     /* 酒红 */
  --primary-dark: #5C0000;      /* 暗酒红 */
  --gold: #D4AF37;              /* 金色 */
  --gold-light: #F4D03F;        /* 浅金 */
  --gold-dark: #B8860B;         /* 暗金 */
  --bg: #FDF8F0;                 /* 米白背景 */
  --bg-warm: #F5EDE0;            /* 暖米色 */
  --card: #FFFFFF;
  --text: #2C1810;               /* 深棕文字 */
  --text-light: #6B5344;         /* 浅棕文字 */
  --text-muted: #A08B7D;         /* 灰棕 */
  --border: #E8DCC8;
  --success: #2E7D32;
  --warning: #E65100;
  --danger: #C62828;
  --shadow: 0 2px 12px rgba(139, 0, 0, 0.08);
  --shadow-lg: 0 4px 24px rgba(139, 0, 0, 0.12);
  /* iOS 刘海屏安全区 */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; width: 100%; font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #eee; color: var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; }
button, input, select, textarea { -webkit-appearance: none; font-family: inherit; }
a { -webkit-touch-callout: none; }

/* ========== 响应式：桌面端自适应居中 + 移动端全屏 ========== */
.phone-wrapper {
  display: flex;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  min-height: 100vh;
  padding: 0;
  background: var(--bg);
}
.phone-frame {
  width: 100%;
  max-width: 768px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  border: none;
}
.phone-frame::before {
  display: none;
}

/* 桌面端 (宽度 > 768px)：居中显示、增加最大宽度、阴影、圆角 */
@media screen and (min-width: 769px) {
  .phone-wrapper {
    align-items: stretch;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 24px;
  }
  .phone-frame {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    height: auto;
    min-height: calc(100vh - 48px);
    min-height: calc(100dvh - 48px);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    overflow: hidden;
  }
}

/* 平板 (769px - 1024px)：放宽最大宽度，使内容更舒展 */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .phone-wrapper {
    padding: 16px;
  }
  .phone-frame {
    max-width: 900px;
    border-radius: 12px;
  }
}

/* 宽屏桌面 (宽度 > 1200px)：居中容器更宽，充分利用屏幕空间 */
@media screen and (min-width: 1200px) {
  .phone-frame {
    max-width: 900px;
  }
}
.status-bar {
  height: 54px;
  padding: 0 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  padding-top: 14px;
}
.status-bar .time { font-size: 14px; }
.status-bar .icons { display: flex; gap: 6px; align-items: center; }
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.app-content::-webkit-scrollbar { width: 0; }
.tab-bar {
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  flex-shrink: 0;
  padding-bottom: 4px;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-size: 10px;
}
.tab-item.active { color: var(--primary); }
.tab-item svg { width: 24px; height: 24px; }
.tab-item .tab-badge {
  position: relative;
}
.tab-item .badge {
  position: absolute;
  top: -4px; right: -8px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

/* ========== 页面容器 ========== */
.page { display: none; min-height: 100%; }
.page.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ========== 顶部导航 ========== */
.nav-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
/* 分类页 nav-bar 扩展为深红大背景区，与首页风格一致 */
#page-list .nav-bar {
  height: auto;
  min-height: 44px;
  padding: 12px 16px 42px;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 50%, #3D0000 100%);
  position: relative;
  overflow: hidden;
  align-items: flex-start;
  padding-top: 12px;
}
#page-list .nav-bar::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 28px;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
}
#page-list .nav-bar > span {
  padding-top: 10px;
}
#page-list .nav-bar .nav-back {
  top: 22px;
  transform: none;
}
.nav-bar.back {
  background: #fff;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.nav-bar .nav-back {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.nav-bar .nav-back svg { width: 22px; height: 22px; }
.nav-bar .nav-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* ========== 首页 ========== */
.home-header {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 50%, #3D0000 100%);
  padding: 12px 16px 42px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.home-header::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 28px;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
}
.home-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 0px;
}
.logo-img {
  width: 80px; height: auto;
  display: block;
  background: transparent;
  object-fit: contain;
}
.home-logo p { font-size: 15px; opacity: 0.85; margin: 0; letter-spacing: 0.5px; font-weight: 500; text-align: right; white-space: nowrap; }
.search-bar {
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
.search-bar svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 首页Banner */
.banner-section {
  padding: 0 16px;
  margin-top: -28px;
  position: relative;
  z-index: 2;
}
.banner {
  background: linear-gradient(135deg, #FFF8DC 0%, #FFE4B5 100%);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(212,175,55,0.3);
}
.banner-text { flex: 1; }
.banner-text .tag {
  display: inline-block;
  background: var(--primary);
  color: var(--gold-light);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  font-weight: 600;
}
.banner-text h3 { font-size: 15px; color: var(--primary-dark); margin-bottom: 4px; }
.banner-text p { font-size: 11px; color: var(--text-light); }
.banner-icon {
  width: 56px; height: 56px;
  background: rgba(212,175,55,0.2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}

/* 快捷入口 */
.quick-entries {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 20px 16px;
}
.quick-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}
.quick-entry:active { transform: scale(0.95); }
.entry-icon {
  width: 44px; height: 44px;
  background: var(--bg-warm);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.quick-entry span { font-size: 11px; color: var(--text-light); }

/* 板块标题 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 3px; height: 16px;
  background: linear-gradient(180deg, var(--primary), var(--gold));
  border-radius: 2px;
}
.section-more {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center;
}

/* 商品网格 */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}
.product-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.product-card:active { transform: scale(0.98); }
.product-img {
  width: 100%;
  height: 160px;
  background: var(--bg-warm);
  position: relative;
  overflow: hidden;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--gold-light);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.product-info { padding: 10px; }
.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}
.product-spec {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-price {
  color: var(--primary);
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.product-price .sym { font-size: 11px; }
.product-price .num { font-size: 16px; }
.product-original {
  color: var(--text-muted);
  font-size: 10px;
  text-decoration: line-through;
  margin-left: 4px;
}
.add-cart-btn {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 0 2px 8px rgba(139,0,0,0.25);
}
.add-cart-btn:active { transform: scale(1.15); }
.product-sales {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========== 商品列表页 ========== */
.list-header {
  background: #fff;
  margin: -22px 16px 0;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 2;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -2px 12px rgba(139,0,0,0.08);
}
.list-search {
  flex: 1;
  height: 34px;
  background: var(--bg-warm);
  border-radius: 17px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.list-search input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 13px;
  color: var(--text);
}
.filter-tabs {
  display: flex;
  background: #fff;
  margin: 0 16px;
  padding: 0 14px;
  gap: 16px;
  overflow-x: auto;
  position: relative;
  z-index: 2;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-light);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}
.filter-tab.active {
  color: var(--primary);
  font-weight: 600;
}
.filter-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.sort-bar {
  display: flex;
  background: #fff;
  margin: 0 16px;
  padding: 8px 14px 12px;
  font-size: 12px;
  gap: 16px;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 18px rgba(139,0,0,0.10);
  position: relative;
  z-index: 2;
  margin-bottom: 12px;
}
.sort-item {
  color: var(--text-light);
  cursor: pointer;
  display: flex; align-items: center; gap: 2px;
}
.sort-item.active { color: var(--primary); font-weight: 600; }

/* ========== 商品详情页 ========== */
.detail-img {
  width: 100%;
  height: 320px;
  background: var(--bg-warm);
  position: relative;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-back {
  position: absolute;
  top: 12px; left: 12px;
  width: 36px; height: 36px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  cursor: pointer;
  z-index: 5;
}
.detail-info {
  background: var(--card);
  padding: 16px;
  margin-top: -16px;
  border-radius: 16px 16px 0 0;
  position: relative;
}
.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.detail-price {
  color: var(--primary);
  font-weight: 800;
}
.detail-price .sym { font-size: 16px; }
.detail-price .num { font-size: 28px; }
.detail-original {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: line-through;
}
.detail-save {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--primary-dark);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.detail-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.detail-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-warm);
  color: var(--text-light);
}
.detail-tag.hot { background: rgba(139,0,0,0.08); color: var(--primary); }
.detail-subinfo {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.section-card {
  background: var(--card);
  margin-top: 10px;
  padding: 16px;
}
.section-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.spec-row {
  display: flex;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--border);
}
.spec-row:last-child { border-bottom: none; }
.spec-label {
  width: 80px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.spec-value {
  color: var(--text);
  flex: 1;
}
.detail-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
}
.detail-bottom-bar {
  height: 60px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
}
.bottom-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  color: var(--text-light);
  font-size: 10px;
  gap: 2px;
  cursor: pointer;
  position: relative;
}
.bottom-icon-btn svg { width: 22px; height: 22px; }
.btn-cart, .btn-buy {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 21px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cart {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--primary-dark);
}
.btn-buy {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(139,0,0,0.25);
}
.btn-cart:active, .btn-buy:active { transform: scale(0.98); }

/* ========== 购物车页 ========== */
.cart-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 12px 16px 40px;
  position: relative;
  overflow: hidden;
}
.cart-header::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 28px;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
}
.cart-header h2 { font-size: 18px; margin-bottom: 2px; }
.cart-header p { font-size: 12px; opacity: 0.8; }
.cart-list { padding: 0 16px 12px; margin-top: -16px; position: relative; z-index: 2; }
.cart-item {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.cart-check {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 28px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.cart-check.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-size: 12px;
}
.cart-img {
  width: 80px; height: 80px;
  background: var(--bg-warm);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.cart-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.cart-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-spec { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.cart-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.cart-price {
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}
.quantity-ctrl {
  display: flex;
  align-items: center;
  background: var(--bg-warm);
  border-radius: 16px;
  overflow: hidden;
}
.qty-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
}
.qty-num {
  width: 36px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}
.qty-num-input {
  width: 44px;
  height: 28px;
  padding: 0 2px;
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  -moz-appearance: textfield;
  box-sizing: border-box;
}
.qty-num-input::-webkit-outer-spin-button,
.qty-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-num-input:focus {
  border-color: var(--primary);
}
.cart-empty {
  padding: 60px 20px;
  text-align: center;
}
.cart-empty .empty-icon {
  font-size: 64px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.cart-empty p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.btn-primary {
  display: inline-block;
  padding: 10px 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139,0,0,0.2);
}
.btn-primary:active { transform: scale(0.98); }
.cart-checkout-bar {
  position: sticky;
  bottom: 56px;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.checkout-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-light);
  cursor: pointer;
}
.checkout-check .cart-check { margin-top: 0; }
.checkout-total {
  flex: 1;
  text-align: right;
}
.checkout-label { font-size: 12px; color: var(--text-light); }
.checkout-amount {
  color: var(--primary);
  font-weight: 800;
  font-size: 18px;
}
.checkout-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.checkout-btn:disabled {
  background: #ccc;
  box-shadow: none;
}

/* ========== 下单页面 ========== */
.address-card {
  background: linear-gradient(135deg, #FFF8F0 0%, #FFE8D6 100%);
  margin: 12px 16px;
  padding: 16px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(139,0,0,0.06);
  transition: box-shadow 0.25s;
}
.address-card:active {
  box-shadow: 0 1px 6px rgba(139,0,0,0.1);
}
.address-card::before {
  content: '';
  position: absolute;
  top: -10px; right: 30px;
  width: 40px; height: 40px;
  border: 8px dotted rgba(139,0,0,0.08);
  border-radius: 50%;
}
.address-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--primary) 0 8px, transparent 8px 16px, var(--primary-light) 16px 24px, transparent 24px 32px);
  opacity: 0.5;
}
.address-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.address-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.address-phone { font-size: 14px; color: var(--text-light); }
.address-detail {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
  padding-left: 26px;
  position: relative;
}
.address-detail::before {
  content: '📍';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 16px;
}
/* 地址未填写时的空状态提示 */
.address-empty-hint {
  display: flex;
  align-items: center;
  gap: 10px;
}
.address-empty-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(139,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.address-empty-text {
  flex: 1;
}
.address-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.address-empty-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.address-edit-btn {
  font-size: 12px;
  color: var(--primary);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(139,0,0,0.06);
  transition: background 0.2s;
  flex-shrink: 0;
}
.address-edit-btn:active {
  background: rgba(139,0,0,0.12);
}
.order-section {
  background: #fff;
  margin: 12px 16px;
  border-radius: 12px;
  padding: 12px 16px;
}
.order-section-title {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.order-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.order-item:last-child { border-bottom: none; }
.order-item-img {
  width: 64px; height: 64px;
  background: var(--bg-warm);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.order-item-img img { width: 100%; height: 100%; object-fit: cover; }
.order-item-info { flex: 1; }
.order-item-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.order-item-spec {
  font-size: 11px;
  color: var(--text-muted);
}
.order-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.order-item-price { color: var(--primary); font-weight: 700; }
.order-item-qty { font-size: 12px; color: var(--text-muted); }
.remark-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}
.remark-label {
  font-size: 13px;
  color: var(--text-light);
  width: 60px;
  flex-shrink: 0;
  padding-top: 6px;
}
.remark-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  min-height: 72px;
  resize: none;
  outline: none;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
}
.remark-input:focus { border-color: var(--primary); }

/* ========== 未成年禁酒警示 + 年龄承诺勾选 ========== */
.age-confirm-wrap {
  background: linear-gradient(135deg, #FFF5F5, #FFEBEE) !important;
  border: 1px solid rgba(198, 40, 40, 0.25) !important;
  border-radius: 12px;
}
.age-warn-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(198, 40, 40, 0.06);
  border-left: 3px solid var(--danger);
  border-radius: 8px;
}
.age-warn-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.age-warn-text { flex: 1; }
.age-warn-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
  line-height: 1.4;
}
.age-warn-sub {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 3px;
  line-height: 1.5;
}
.age-confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 4px 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.age-confirm-row input[type="checkbox"] {
  position: absolute;
  width: 0; height: 0;
  opacity: 0;
  pointer-events: none;
}
.age-check-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 1px;
  background: #fff;
  position: relative;
  transition: all 0.18s ease;
}
.age-confirm-row input:checked + .age-check-box {
  background: var(--primary);
  border-color: var(--primary);
}
.age-confirm-row input:checked + .age-check-box::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.age-confirm-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.55;
  flex: 1;
  font-weight: 500;
}
.age-tips {
  display: flex;
  gap: 16px;
  padding: 8px 4px 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1px dashed rgba(198, 40, 40, 0.15);
  margin-top: 4px;
}
.age-tips span { display: flex; align-items: center; gap: 4px; }

.price-breakdown {
  padding: 12px 0;
}
.price-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-light);
}
.price-row.total {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  margin-top: 4px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
}
.price-row.total .val { color: var(--primary); font-size: 18px; font-weight: 800; }
.submit-bar {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.submit-bar .total-label { font-size: 13px; color: var(--text-light); }
.submit-bar .total-price { color: var(--primary); font-weight: 800; font-size: 20px; }
.submit-btn {
  padding: 12px 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(139,0,0,0.3);
}

/* ========== 我的页面 ========== */
.profile-header {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 60%, #2D0000 100%);
  padding: 12px 16px 42px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.profile-header::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 28px;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
}
.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
}
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  border: 3px solid rgba(255,255,255,0.3);
}
.profile-info { flex: 1; }
.profile-info h2 { font-size: 18px; margin-bottom: 4px; }
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--primary-dark);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 700;
}
.profile-stats {
  display: flex;
  justify-content: space-around;
  padding: 20px 16px;
  background: #fff;
  margin: -40px 16px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}
.profile-stat { text-align: center; cursor: pointer; }
.profile-stat .num {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}
.profile-stat .label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.orders-shortcut {
  background: #fff;
  margin: -16px 16px 12px;
  border-radius: 12px;
  padding: 16px;
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-lg);
}
.orders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.orders-header h3 { font-size: 15px; }
.orders-header a { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.order-types {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.order-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}
.order-type-icon {
  width: 40px; height: 40px;
  background: var(--bg-warm);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.order-type-name { font-size: 11px; color: var(--text-light); }
.order-type-dot {
  position: absolute;
  top: 2px; right: 50%;
  transform: translateX(18px);
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
}
.menu-list {
  background: #fff;
  margin: 0 16px 16px;
  border-radius: 12px;
  overflow: hidden;
}
.menu-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg-warm); }
.menu-icon {
  width: 28px; height: 28px;
  background: var(--bg-warm);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  margin-right: 12px;
  flex-shrink: 0;
}
.menu-text { flex: 1; font-size: 14px; color: var(--text); }
.menu-arrow { color: var(--text-muted); font-size: 18px; }

/* ========== 订单列表 ========== */
.order-status-tabs {
  display: flex;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}
.order-status-tab {
  flex: 1;
  padding: 12px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
  position: relative;
}
.order-status-tab.active {
  color: var(--primary);
  font-weight: 600;
}
.order-status-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.orders-list { padding: 12px; }
.order-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.order-no { font-size: 12px; color: var(--text-muted); }
.order-status { font-size: 13px; font-weight: 600; }
.order-status.pending { color: var(--warning); }
.order-status.confirmed { color: var(--primary); }
.order-status.shipping { color: #1565C0; }
.order-status.completed { color: var(--success); }
.order-status.cancelled { color: var(--text-muted); }
.order-card-items {
  padding: 4px 0;
}
.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
.order-total-text { font-size: 12px; color: var(--text-light); }
.order-total-text .amount { color: var(--primary); font-weight: 700; font-size: 15px; }
.order-actions { display: flex; gap: 8px; }
.order-btn {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-light);
  cursor: pointer;
}
.order-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-color: var(--primary);
}
.order-btn.gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--primary-dark);
  border-color: var(--gold);
}

/* ========== Toast 提示 ========== */
.toast {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 9999;
  animation: toastIn 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -40%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ========== 卡片式提示 ========== */
.cart-toast {
  --toast-accent: #2E7D32;
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translateX(-50%) translateY(-16px) scale(0.92);
  background: rgba(255,255,255,0.99);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 16px 48px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.05), 0 0 0 1px rgba(255,255,255,0.5) inset;
  padding: 18px 22px 18px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.34,1.56,0.64,1), transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  max-width: calc(100vw - 48px);
  overflow: hidden;
}
.cart-toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--toast-accent);
  border-radius: 18px 0 0 18px;
}
.cart-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.cart-toast-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--toast-accent), color-mix(in srgb, var(--toast-accent) 72%, #fff));
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--toast-accent) 45%, transparent);
  border: 2px solid rgba(255,255,255,0.85);
}
.cart-toast-body {
  flex: 1;
  min-width: 0;
}
.cart-toast-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: 0.3px;
}
.cart-toast-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
.cart-toast-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--toast-accent);
  background: color-mix(in srgb, var(--toast-accent) 12%, transparent);
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: maskFadeIn 0.2s;
}
.modal-mask.show { display: flex; }
@keyframes maskFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  width: 100%;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  animation: slideUp 0.25s ease;
  max-height: 70%;
  overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 20px;
  z-index: 10;
}

/* 支付弹窗 */
.pay-methods { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.pay-method {
  display: flex;
  align-items: center;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.pay-method.selected { border-color: var(--primary); background: rgba(139,0,0,0.03); }
.pay-icon {
  width: 36px; height: 36px;
  background: var(--bg-warm);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-right: 12px;
}
.pay-info { flex: 1; }
.pay-name { font-size: 14px; font-weight: 600; }
.pay-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pay-check {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.pay-method.selected .pay-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-size: 12px;
}
.modal-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(139,0,0,0.25);
}

/* 地址表单样式 */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}
.form-row {
  display: flex;
  flex-direction: column;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  letter-spacing: 0.3px;
}
.required {
  color: #e53935;
  margin-right: 4px;
  font-size: 14px;
}
.form-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-warm);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
.form-input:focus {
  border-color: var(--primary);
  background: var(--bg);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}
.form-input:disabled {
  opacity: 0.5;
  pointer-events: none;
}
textarea.form-input {
  min-height: 88px;
  resize: none;
  line-height: 1.6;
}
.input-with-icon {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.25s;
}
.input-with-icon:focus-within .input-icon {
  opacity: 1;
}
.input-with-icon .form-input {
  padding-left: 42px;
}
.modal-drag-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.15);
  margin: 0 auto 16px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.modal-btn.secondary {
  flex: 1;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-light);
  box-shadow: none;
}
.modal-btn.primary {
  flex: 2;
}
.modal-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.modal-btn:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

/* 数量选择弹窗 */
.sku-img {
  width: 96px; height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-warm);
  flex-shrink: 0;
}
.sku-img img { width: 100%; height: 100%; object-fit: cover; }
.sku-header { display: flex; gap: 14px; margin-bottom: 16px; position: relative; }
.sku-info .sku-price {
  color: var(--primary);
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 6px;
}
.sku-info .sku-stock {
  font-size: 12px;
  color: var(--text-muted);
}
.sku-info .sku-selected {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  background: var(--bg-warm);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.quantity-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.quantity-label { font-size: 14px; }
.quantity-section .quantity-ctrl { background: var(--bg-warm); }

/* ================================================================
   ======================== 移动端适配 ============================
   ================================================================ */

/* ---------- 移动端：屏幕宽度 ≤ 768px（手机全屏模式） ---------- */
@media screen and (max-width: 768px) {
  html, body {
    background: var(--bg);
    overflow-x: hidden;
  }

  /* 移动端：去除桌面端外壳，全屏显示 */
  .phone-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    padding: 0;
    gap: 0;
    background: var(--bg);
  }

  .phone-frame {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg);
    position: relative;
  }

  /* 隐藏桌面端的刘海/外壳装饰 */
  .phone-frame::before {
    display: none;
  }

  /* ---------- 状态栏已移除，安全区由内容区顶部处理 ---------- */
  .status-bar { display: none; }
  .home-header {
    padding: calc(12px + var(--safe-top)) calc(16px + var(--safe-left)) 42px calc(16px + var(--safe-right));
  }

  /* ---------- 内容区域 ---------- */
  .app-content {
    flex: 1;
    min-height: 0;
  }

  /* ---------- 底部 Tab Bar：安全区适配 ---------- */
  .tab-bar {
    height: calc(56px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
  }

  /* ---------- 详情页底部操作栏 ---------- */
  .detail-bottom-bar {
    padding-bottom: var(--safe-bottom) !important;
    padding-left: var(--safe-left) !important;
    padding-right: var(--safe-right) !important;
  }

  /* ---------- 提交订单底部栏 ---------- */
  .submit-bar {
    padding-bottom: var(--safe-bottom) !important;
    padding-left: var(--safe-left) !important;
    padding-right: var(--safe-right) !important;
    padding-top: 10px;
  }

  /* ---------- 顶部导航：安全区 ---------- */
  .nav-bar {
    height: calc(44px + var(--safe-top));
    padding-top: var(--safe-top);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    font-size: 16px;
  }
  /* 分类页 nav-bar：扩展高度 + 安全区适配 */
  #page-list .nav-bar {
    height: auto;
    min-height: auto;
    padding: calc(12px + var(--safe-top)) calc(16px + var(--safe-left)) 42px calc(16px + var(--safe-right));
  }
  #page-list .nav-bar > span {
    padding-top: 10px;
  }
  #page-list .nav-bar .nav-back {
    left: calc(12px + var(--safe-left));
    top: calc(22px + var(--safe-top));
  }
  .nav-bar .nav-back {
    left: calc(12px + var(--safe-left));
  }

  /* ---------- Banner（首页活动横幅） ---------- */
  .banner {
    border-radius: 14px;
    margin: 12px;
    padding: 16px 18px;
    gap: 14px;
  }
  .banner-text h3 {
    font-size: 17px;
    line-height: 1.3;
  }
  .banner-text p {
    font-size: 12px;
    margin-top: 4px;
  }
  .banner-icon {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }

  /* ---------- 快捷入口 ---------- */
  .quick-entries {
    gap: 8px;
    padding: 16px 14px;
  }
  .quick-entry {
    padding: 8px 4px;
  }
  .quick-entry .entry-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 10px;
  }
  .quick-entry span {
    font-size: 12px;
    margin-top: 4px;
  }

  /* ---------- 分区标题 ---------- */
  .section-header {
    padding: 16px 14px 10px;
  }
  .section-header .section-title {
    font-size: 16px;
  }
  .section-header .section-more {
    font-size: 12px;
  }

  /* ---------- 商品卡片 ---------- */
  .products-grid {
    gap: 10px;
    padding: 0 14px;
  }
  .product-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .product-card .product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
  }
  .product-card .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .product-card .product-info {
    padding: 10px;
  }
  .product-card .product-name {
    font-size: 14px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
  }
  .product-card .product-spec {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
  }
  .product-card .product-bottom {
    margin-top: 8px;
    align-items: center;
  }
  .product-card .product-price {
    font-size: 16px;
  }
  .product-card .product-price .sym {
    font-size: 12px;
  }
  .product-card .product-price .num {
    font-size: 16px;
  }
  .product-card .product-original {
    font-size: 11px;
  }
  .product-card .add-cart-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 24px;
  }
  .product-card .product-sales {
    font-size: 11px;
    margin-top: 6px;
  }

  /* ---------- 分类/筛选标签 ---------- */
  .filter-tabs {
    padding: 0 14px;
    margin: 0 14px;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab {
    padding: 10px 0;
    font-size: 13px;
  }
  .list-header {
    margin: -22px 14px 0;
    padding: 10px 12px;
  }
  .sort-bar {
    margin: 0 14px;
    padding: 6px 12px 10px;
    margin-bottom: 10px;
  }

  /* ---------- 商品详情页 ---------- */
  .detail-img {
    width: 100%;
    aspect-ratio: 1 / 1;
  }
  .detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .detail-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    top: calc(var(--safe-top) + 10px);
  }
  .detail-info {
    padding: 14px;
  }
  .detail-price .sym { font-size: 14px; }
  .detail-price .num { font-size: 26px; }
  .detail-original { font-size: 13px; }
  .detail-save { font-size: 12px; padding: 3px 8px; }
  .detail-title { font-size: 17px; margin-top: 10px; }
  .detail-tags { gap: 6px; margin-top: 10px; }
  .detail-tags .tag { font-size: 11px; padding: 3px 8px; }
  .detail-subinfo { margin-top: 10px; font-size: 12px; gap: 8px; }
  .section-card {
    margin: 10px 14px;
    padding: 14px;
    border-radius: 12px;
  }
  .section-card-title { font-size: 15px; margin-bottom: 10px; }

  /* ---------- 详情页底部按钮 ---------- */
  .detail-bottom-bar {
    height: calc(60px + var(--safe-bottom));
    gap: 6px;
    padding: 8px 10px calc(8px + var(--safe-bottom));
  }
  .bottom-icon-btn { gap: 2px; font-size: 10px; }
  .bottom-icon-btn svg { width: 22px; height: 22px; }
  .btn-cart, .btn-buy {
    height: 44px;
    font-size: 14px;
    border-radius: 22px;
    font-weight: 600;
  }

  /* ---------- 购物车 ---------- */
  .cart-header {
    padding: calc(12px + var(--safe-top)) 14px 40px;
  }
  .cart-header h2 { font-size: 20px; }
  .cart-header p { font-size: 12px; margin-top: 4px; }
  .cart-list { padding: 0 14px 12px; }

  .cart-item {
    padding: 12px 14px;
    gap: 12px;
  }
  .cart-item img {
    width: 84px;
    height: 84px;
    border-radius: 10px;
  }
  .cart-item .cart-info .cart-name {
    font-size: 14px;
    line-height: 1.3;
    min-height: 36px;
  }
  .cart-item .cart-info .cart-spec {
    font-size: 11px;
    margin-top: 4px;
  }
  .cart-item .cart-info .cart-bottom {
    margin-top: 8px;
  }
  .cart-item .cart-info .cart-price {
    font-size: 15px;
  }
  .quantity-ctrl {
    border-radius: 8px;
  }
  .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  .qty-num-input,
  .qty-num {
    width: 40px;
    min-width: 40px;
    height: 28px;
    font-size: 14px;
  }

  /* ---------- 空状态 ---------- */
  .empty-state {
    padding: 80px 20px;
  }
  .empty-state .empty-icon {
    width: 80px;
    height: 80px;
    font-size: 40px;
    margin-bottom: 16px;
  }
  .empty-state .empty-title { font-size: 15px; }
  .empty-state .empty-desc { font-size: 12px; }
  .empty-state .empty-btn {
    padding: 10px 24px;
    border-radius: 22px;
    font-size: 14px;
    margin-top: 20px;
  }

  /* ---------- 结算页 ---------- */
  #checkoutAddress {
    margin: 12px 14px 0;
    padding: 14px;
    border-radius: 12px;
  }
  .order-section {
    margin: 12px 14px 0;
    padding: 14px;
    border-radius: 12px;
  }
  .order-section-title { font-size: 14px; margin-bottom: 10px; }
  .delivery-option {
    padding: 12px;
    border-radius: 10px;
  }
  .checkout-item {
    gap: 10px;
    padding: 8px 0;
  }
  .checkout-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
  }
  .checkout-item .ci-name {
    font-size: 13px;
    min-height: 34px;
    line-height: 1.3;
  }
  .checkout-item .ci-spec {
    font-size: 11px;
    margin-top: 4px;
  }
  .checkout-item .ci-right .ci-price {
    font-size: 14px;
  }
  .remark-row {
    gap: 10px;
  }
  .remark-label {
    font-size: 13px;
    width: 70px;
    flex-shrink: 0;
  }
  .remark-input {
    font-size: 13px;
    padding: 8px 10px;
    min-height: 80px;
    border-radius: 8px;
  }
  .price-breakdown {
    gap: 8px;
  }
  .price-breakdown .pb-row {
    font-size: 13px;
  }
  .price-breakdown .pb-total {
    padding-top: 10px;
    margin-top: 8px;
  }
  .price-breakdown .pb-total .pb-label {
    font-size: 14px;
  }
  .price-breakdown .pb-total .pb-value {
    font-size: 18px;
  }

  .submit-bar {
    height: calc(64px + var(--safe-bottom));
    padding: 0 14px calc(10px + var(--safe-bottom));
  }
  .submit-bar .total-label {
    font-size: 12px;
  }
  .submit-bar .total-price {
    font-size: 20px;
  }
  .submit-btn {
    padding: 0 28px;
    height: 44px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
  }

  /* ---------- 订单列表 ---------- */
  .order-status-tabs {
    padding: 10px 14px;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .order-status-tabs::-webkit-scrollbar { display: none; }
  .order-status-tab {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 16px;
    flex-shrink: 0;
  }

  .orders-list {
    padding: 10px 14px;
    gap: 10px;
  }
  .order-card {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
  }
  .order-card-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
  }
  .order-no { font-size: 12px; }
  .order-status { font-size: 13px; }
  .order-card-items { gap: 10px; }
  .order-card-footer {
    padding-top: 10px;
    margin-top: 10px;
  }
  .order-total-text { font-size: 12px; }
  .order-total-text .amount {
    font-size: 16px;
  }
  .order-actions {
    gap: 8px;
  }
  .order-btn {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    min-height: 30px;
  }

  /* ---------- 我的页面 ---------- */
  .profile-header {
    padding: calc(12px + var(--safe-top)) 14px 42px;
  }
  .profile-top {
    gap: 12px;
  }
  .profile-top .avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 24px;
  }
  .profile-top .profile-info h2 {
    font-size: 18px;
  }
  .vip-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-top: 6px;
    display: inline-block;
  }
  .profile-stats {
    margin: -24px 14px 0;
    padding: 16px;
    border-radius: 12px;
  }
  .profile-stat .num {
    font-size: 20px;
  }
  .profile-stat .label {
    font-size: 12px;
    margin-top: 4px;
  }

  .orders-shortcut {
    margin: -16px 14px 12px;
    padding: 14px;
    border-radius: 12px;
  }
  .orders-shortcut .orders-header {
    margin-bottom: 14px;
  }
  .orders-shortcut .orders-header h3 {
    font-size: 15px;
  }
  .orders-shortcut .orders-header a {
    font-size: 12px;
  }
  .order-types {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .order-type {
    padding: 10px 4px;
    border-radius: 10px;
    gap: 6px;
  }
  .order-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
  }
  .order-type-name {
    font-size: 11px;
  }

  .menu-list {
    margin: 14px;
    border-radius: 12px;
    overflow: hidden;
  }
  .menu-item {
    padding: 14px;
    gap: 12px;
    min-height: 52px;
    font-size: 14px;
  }
  .menu-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 16px;
  }
  .menu-arrow {
    font-size: 18px;
    color: var(--text-muted);
  }

  /* ---------- 弹窗通用 ---------- */
  .modal-mask {
    padding: 0;
    z-index: 9999;
    align-items: flex-end;
    justify-content: center;
  }
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    padding: 20px 18px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
    animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .modal-close {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .modal-btn {
    height: 46px;
    border-radius: 23px;
    font-size: 15px;
    font-weight: 600;
  }

  /* ---------- SKU 弹窗 ---------- */
  .sku-header {
    gap: 12px;
    margin-bottom: 10px;
  }
  .sku-header .sku-img {
    width: 88px;
    height: 88px;
    border-radius: 10px;
    margin-top: -30px;
    box-shadow: var(--shadow-lg);
  }
  .sku-header .sku-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
  }
  .sku-info {
    flex: 1;
    padding-top: 8px;
  }
  .sku-info .sku-price {
    font-size: 20px;
  }
  .sku-info .sku-stock {
    font-size: 12px;
    margin-top: 4px;
  }
  .sku-info .sku-selected {
    font-size: 11px;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 4px;
  }
  .quantity-section {
    padding: 14px 0;
  }
  .quantity-section .quantity-label {
    font-size: 14px;
  }

  /* ---------- 收货地址弹窗 ---------- */
  .address-modal .modal-content {
    padding: 20px 18px calc(20px + var(--safe-bottom));
  }
  .remark-input {
    border: 1px solid var(--border);
    background: var(--bg-warm);
    outline: none;
    transition: border-color 0.2s;
  }
  .remark-input:focus {
    border-color: var(--primary-light);
  }
}

/* ---------- 小屏手机（≤ 375px，如 iPhone SE） ---------- */
@media screen and (max-width: 375px) {
  .banner { padding: 14px; gap: 10px; }
  .banner-text h3 { font-size: 15px; }
  .quick-entries { gap: 6px; padding: 12px; }
  .quick-entry .entry-icon { width: 34px; height: 34px; font-size: 16px; }
  .products-grid { gap: 8px; padding: 0 12px; }
  .product-card .product-info { padding: 8px; }
  .product-card .product-name { font-size: 13px; min-height: 34px; }
  .product-card .product-price .num { font-size: 15px; }
  .section-header { padding: 14px 12px 8px; }
  .section-header .section-title { font-size: 15px; }
  .detail-price .num { font-size: 24px; }
  .detail-title { font-size: 16px; }
  .submit-btn { padding: 0 20px; font-size: 14px; }
}

/* ---------- 大屏手机/平板（414px - 768px） ---------- */
@media screen and (min-width: 414px) and (max-width: 768px) {
  .banner { padding: 20px; gap: 16px; }
  .banner-text h3 { font-size: 19px; }
  .banner-text p { font-size: 13px; }
  .banner-icon { width: 64px; height: 64px; font-size: 30px; }
  .product-card .product-name { font-size: 15px; }
  .product-card .product-price .num { font-size: 18px; }
}

/* ---------- 超窄屏（≤ 340px） ---------- */
@media screen and (max-width: 340px) {
  .banner-text h3 { font-size: 15px; }
  .filter-tab {
    padding: 5px 12px;
    font-size: 12px;
  }
  .sku-header .sku-img {
    width: 76px;
    height: 76px;
  }
  .sku-info .sku-price {
    font-size: 18px;
  }
}

/* ---------- 横屏模式限制 ---------- */
@media screen and (orientation: landscape) and (max-width: 900px) {
  .phone-frame {
    max-height: 100vh;
  }
  .modal-content {
    max-height: 80vh;
  }
}

/* ---------- Toast 适配 ---------- */
.toast {
  max-width: calc(100vw - 40px);
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(120px + var(--safe-bottom));
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
}

/* ---------- 禁用文字选中（移动端体验） ---------- */
.nav-bar, .tab-bar, .filter-tab, .order-status-tab,
.bottom-icon-btn, .qty-btn, .add-cart-btn,
.menu-item, .modal-close, .order-type, .quick-entry {
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- 按钮点击反馈 ---------- */
button, .submit-btn, .modal-btn, .btn-cart, .btn-buy,
.order-btn, .empty-btn, .delivery-option,
.filter-tab, .order-status-tab, .menu-item,
.add-cart-btn, .qty-btn, .tab-item {
  transition: opacity 0.12s ease, transform 0.12s ease;
}
button:active, .submit-btn:active, .modal-btn:active,
.btn-cart:active, .btn-buy:active,
.order-btn:active, .empty-btn:active {
  opacity: 0.75;
  transform: scale(0.97);
}
.delivery-option:active, .filter-tab:active,
.order-status-tab:active, .menu-item:active,
.tab-item:active {
  opacity: 0.8;
}
