/* ============================================================
   狐小科 H5 · 活泼卡通 · 品牌拟人化 设计系统
   主色: 狐狸橙 #FF6B35 + 渐变搭档 #FF9558
   背景: 奶油米 #FFF8F0
   点缀: 亮黄/薄荷绿/浅蓝/暖红
   角色: 拟人化小狐 🦊 (宇航员主题，详见 /images/mascot-fox.png)
   ============================================================ */

:root {
  /* —— 品牌色 —— */
  --fox: #FF6B35;
  --fox-light: #FF9558;
  --fox-dark: #E5532A;
  --cream: #FFF8F0;
  --yellow: #FFD93D;
  --mint: #6BCB77;
  --blue: #4D96FF;
  --warm-red: #FF6B6B;
  /* —— 兼容旧变量名 —— */
  --primary: #FF6B35;
  --primary-dark: #E5532A;
  --primary-light: #FFF3ED;
  --secondary: #2d3436;
  --success: #6BCB77;
  --warning: #FFD93D;
  --danger: #FF6B6B;
  --gray: #9aa0a6;
  --gray-light: #F3F0EC;
  /* —— 字号 —— */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-xxl: 28px;
  /* —— 圆角 —— */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-pill: 24px;
  --r-card: 18px;
  --radius: 16px;
  /* —— 阴影 —— */
  --shadow-sm: 0 2px 8px rgba(255,107,53,0.08);
  --shadow: 0 6px 18px rgba(255,107,53,0.12);
  --shadow-lg: 0 10px 30px rgba(255,107,53,0.18);
  --shadow-soft: 0 4px 14px rgba(0,0,0,0.06);
  /* —— 动效 —— */
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.18s;
  --t: 0.28s;
  /* —— 安全区 —— */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* —— 字体 —— */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* ===== Reset & Base ===== */
* { margin:0; padding:0; box-sizing:border-box; }
*:focus { outline:none; }
html, body {
  font-family: var(--font);
  font-size: var(--fs-base);
  color: #2b2b2b;
  background: var(--cream);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body { overflow-x:hidden; }
img { display:block; max-width:100%; }
button { border:none; background:none; cursor:pointer; font-family:inherit; color:inherit; -webkit-tap-highlight-color:transparent; }
input, textarea { font-family:inherit; }

/* ===== Keyframes ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideUpBounce { 0% { transform: translateY(100%); } 55% { transform: translateY(-6%); } 100% { transform: translateY(0); } }
@keyframes slideInRight { 0% { transform: translateX(100%); } 60% { transform: translateX(4%); } 100% { transform: translateX(0); } }
@keyframes slideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes popIn { 0% { transform: scale(0.6); opacity:0; } 60% { transform: scale(1.06); opacity:1; } 100% { transform: scale(1); } }
@keyframes foxPeek { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
@keyframes foxRun { 0%,100% { transform: translateY(0) rotate(-6deg); } 25% { transform: translateY(-7px) rotate(5deg); } 50% { transform: translateY(0) rotate(-6deg); } 75% { transform: translateY(-7px) rotate(5deg); } }
@keyframes foxBounce { 0%,100% { transform: translateY(0) rotate(-4deg); } 30% { transform: translateY(-14px) rotate(6deg); } 60% { transform: translateY(-4px) rotate(-2deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes wiggle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes tabPop { 0% { transform: translateY(0) scale(1); } 45% { transform: translateY(-7px) scale(1.18); } 100% { transform: translateY(0) scale(1); } }
@keyframes badgePop { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes toastIn { 0% { transform: translate(-50%,-50%) scale(0.7); opacity:0; } 60% { transform: translate(-50%,-50%) scale(1.04); opacity:1; } 100% { transform: translate(-50%,-50%) scale(1); } }
@keyframes pullSpin { to { transform: rotate(360deg); } }

/* ============================================================
   组件库 · mp-* (Toast / Skeleton / Empty / Badge / Loading / Tabbar)
   ============================================================ */

/* —— mp-toast 居中弹性吐司 + 小狐 —— */
.mp-toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  background: rgba(33,33,33,0.92);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 80vw;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}
.mp-toast.show { animation: toastIn var(--t) var(--bounce) forwards; }
.mp-toast.hide { opacity: 0; transition: opacity 0.3s; }
.mp-toast-fox { width: 24px; height: 24px; object-fit: contain; border-radius: 4px; flex-shrink: 0; }
.mp-toast.is-error .mp-toast-fox { filter: grayscale(0.4) brightness(0.95); }
.mp-toast-msg { line-height: 1.4; }

/* —— mp-skeleton 骨架屏 —— */
.mp-skeleton-wrap { display:grid; grid-template-columns: repeat(2,1fr); gap:10px; }
.mp-skeleton-card {
  background: #fff;
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.mp-skel-img {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(90deg, #efe9e2 25%, #f7f1ea 37%, #efe9e2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.mp-skel-line { height: 12px; border-radius: 6px; margin: 8px 10px; background: linear-gradient(90deg, #efe9e2 25%, #f7f1ea 37%, #efe9e2 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.mp-skel-line.short { width: 50%; }
.mp-skel-line.price { height: 16px; width: 40%; background: linear-gradient(90deg, #ffe0d0 25%, #fff0e6 37%, #ffe0d0 63%); background-size: 400% 100%; }
.mp-skel-body { padding: 10px; }

/* —— mp-empty 空状态 · 小狐托腮 —— */
.mp-empty { text-align:center; padding: 50px 20px; color: var(--gray); }
.mp-empty-fox { width: 96px; height: 96px; object-fit: contain; display:inline-block; margin-bottom: 10px; filter: drop-shadow(0 6px 10px rgba(255,107,53,0.18)); animation: foxPeek 2.6s ease-in-out infinite; }
.mp-empty-text { font-size: var(--fs-md); font-weight: 700; color: #555; margin-bottom: 4px; }
.mp-empty-sub { font-size: var(--fs-sm); color: var(--gray); }

/* —— mp-badge —— */
.mp-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* —— mp-loading 小狐搬运 —— */
.mp-loading { text-align:center; padding: 36px 0; color: var(--gray); }
.mp-loading-fox { width: 56px; height: 56px; object-fit: contain; display:inline-block; animation: foxRun 0.7s ease-in-out infinite; }
.mp-loading p { margin-top: 10px; font-size: var(--fs-sm); }

/* —— mp-tabbar 蹦出小狐 —— */
.tabbar-fox {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t);
  filter: drop-shadow(0 4px 6px rgba(255,107,53,0.3));
}
.tabbar-fox.fox-bounce { opacity: 1; animation: foxBounce 0.6s var(--bounce); }

/* ============================================================
   Topbar 沉浸式顶部导航
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  color: #fff;
  background: linear-gradient(135deg, #FF6B35 0%, #FF9558 100%);
  padding-top: var(--safe-top);
  padding-bottom: 10px;
  box-shadow: 0 4px 16px rgba(255,107,53,0.28);
  overflow: hidden;
}
/* 装饰圆点网格 */
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.2) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: 0.5;
  pointer-events: none;
}
/* 装饰科技 emoji */
.topbar::after {
  content: "⚙️ 💾 🤖";
  position: absolute;
  right: -8px;
  top: 8px;
  font-size: 13px;
  letter-spacing: 8px;
  opacity: 0.18;
  pointer-events: none;
}
.topbar-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
}
.logo { display:flex; align-items:center; gap:8px; }
/* 顶部 logo · 小狐头像（image） */
.logo-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff, #ffe9dd);
  padding: 3px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18), inset 0 -2px 4px rgba(255,107,53,0.18);
  flex-shrink: 0;
  animation: foxPeek 3s ease-in-out infinite;
}
.logo-text { font-size: var(--fs-xl); font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,0.12); }
.logo-sub { font-size: var(--fs-xs); opacity: 0.95; margin-left: 4px; padding: 3px 8px; background: rgba(255,255,255,0.22); border-radius: 20px; }

.topbar-right { display:flex; align-items:center; gap:6px; }
.btn-icon {
  position: relative;
  color: #fff;
  padding: 7px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.18);
  transition: transform var(--t-fast) var(--bounce), background var(--t-fast);
}
.btn-icon:active { transform: scale(0.86); background: rgba(255,255,255,0.32); }
/* 胶囊菜单按钮 ··· 模拟小程序原生胶囊 */
.mp-capsule-menu {
  width: auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.28);
}
.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--warm-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  animation: badgePop var(--t) var(--bounce);
}

/* —— 搜索栏 —— */
.search-bar { padding: 0 14px 8px; position: relative; z-index: 2; }
.search-bar::before {
  content: "🔍";
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  z-index: 3;
  pointer-events: none;
}
.search-bar input {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 20px;
  padding: 0 18px 0 40px;
  font-size: var(--fs-base);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

/* —— 分类标签 —— */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 0 14px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  z-index: 2;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 18px;
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all var(--t-fast) var(--bounce);
}
.cat-tab:active { transform: scale(0.92); }
.cat-tab.active {
  background: #fff;
  color: var(--fox);
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0,0,0,0.14);
  transform: scale(1.04);
}

/* ============================================================
   主内容 / 产品网格
   ============================================================ */
.main-content {
  padding: 12px;
  padding-bottom: calc(72px + var(--safe-bottom));
  position: relative;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
/* 下拉刷新指示器 */
.pull-refresh {
  position: absolute;
  top: -44px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 5;
  opacity: 0;
  transition: opacity var(--t), transform var(--t);
}
.pull-refresh.show { opacity: 1; }
.pull-fox { width: 26px; height: 26px; object-fit: contain; }
.pull-refresh.spinning .pull-fox { animation: pullSpin 0.8s linear infinite; }
/* 上拉加载更多底部 */
.load-more {
  text-align: center;
  padding: 18px 0 6px;
  color: var(--gray);
  font-size: var(--fs-sm);
}
.load-more .lm-fox { width: 20px; height: 20px; object-fit: contain; display:inline-block; vertical-align: -4px; animation: foxPeek 1.6s ease-in-out infinite; margin-right: 4px; }

/* —— 产品卡片 —— */
.product-card {
  background: #fff;
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform var(--t-fast) var(--bounce), box-shadow var(--t);
}
.product-card:active { transform: scale(0.96); box-shadow: var(--shadow-sm); }
.product-card .img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #fff5ee, #f7ece3);
  overflow: hidden;
}
.product-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 图片懒加载占位 · 小狐头像 */
.img-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/images/mascot-fox.png') center/40% no-repeat;
  opacity: 0.22;
  z-index: 0;
  pointer-events: none;
}
.img-wrap img { position: relative; z-index: 1; }
.product-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #fff;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.tag-new { background: var(--warm-red); }
.tag-hot { background: var(--fox); }
.product-info { padding: 9px 11px 11px; }
.product-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 36px;
  margin-bottom: 4px;
}
.product-model {
  font-size: var(--fs-xs);
  color: var(--gray);
  margin-bottom: 6px;
}
.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-price {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--fox);
}
.product-price small { font-size: var(--fs-sm); font-weight: 500; }
.add-cart-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fox), var(--fox-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 300;
  box-shadow: 0 3px 8px rgba(255,107,53,0.4);
  transition: transform var(--t-fast) var(--bounce), box-shadow var(--t-fast);
}
.add-cart-btn:active { transform: scale(0.78) rotate(90deg); box-shadow: 0 1px 4px rgba(255,107,53,0.4); }

/* —— Loading & Empty (兼容旧类名) —— */
.loading { text-align:center; padding: 40px 0; color: var(--gray); }
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--gray-light);
  border-top-color: var(--fox);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 10px;
}
.empty-state {
  text-align: center;
  padding: 60px 0;
  color: var(--gray);
}

/* ============================================================
   弹窗系统 (底部弹出 + 弹性回弹)
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.modal-content {
  background: #fff;
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  border-radius: var(--r-md) var(--r-md) 0 0;
  overflow-y: auto;
  position: relative;
  animation: slideUpBounce 0.4s var(--bounce);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 10;
  transition: transform var(--t-fast) var(--bounce), background var(--t-fast);
}
.modal-close:active { transform: scale(0.85) rotate(90deg); background: rgba(0,0,0,0.12); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #f0ece8;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
}
.modal-header h2 { font-size: var(--fs-lg); font-weight: 700; }

/* ============================================================
   产品详情
   ============================================================ */
.product-detail-modal { max-height: 95vh; }
.detail-gallery {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #fff5ee, #f7ece3);
  position: relative;
  overflow: hidden;
}
.detail-gallery img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}
.detail-gallery::before {
  content: "🦊";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 70px;
  opacity: 0.15;
  z-index: 0;
}
.detail-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.detail-thumbs::-webkit-scrollbar { display: none; }
.detail-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: transform var(--t-fast) var(--bounce);
}
.detail-thumb:active { transform: scale(0.9); }
.detail-thumb.active { border-color: var(--fox); transform: scale(1.06); }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { padding: 0 16px 20px; }
.detail-name {
  font-size: var(--fs-xl);
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.4;
}
.detail-tags { display: flex; gap: 6px; margin-bottom: 10px; }
.detail-tag {
  padding: 2px 9px;
  border-radius: 10px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #fff;
}
.detail-price {
  font-size: var(--fs-xxl);
  font-weight: 800;
  color: var(--fox);
  margin-bottom: 14px;
}
.detail-price small { font-size: var(--fs-base); font-weight: 500; color: var(--gray); }
.detail-specs {
  background: var(--primary-light);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.spec-row {
  display: flex;
  font-size: var(--fs-sm);
  padding: 5px 0;
}
.spec-label {
  color: var(--gray);
  width: 80px;
  flex-shrink: 0;
}
.spec-value { flex: 1; font-weight: 500; }
.detail-section-title {
  font-size: var(--fs-md);
  font-weight: 700;
  margin: 14px 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--fox);
}
.detail-remarks {
  font-size: var(--fs-sm);
  color: #666;
  line-height: 1.6;
  padding: 10px 12px;
  background: #faf6f1;
  border-radius: var(--r-sm);
}

/* —— 数量选择器 —— */
.qty-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gray-light);
  border-radius: var(--r-md);
  margin: 14px 0;
}
.qty-label { font-size: var(--fs-md); font-weight: 700; }
.qty-controls { display: flex; align-items: center; gap: 12px; }
.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform var(--t-fast) var(--bounce);
}
.qty-btn:active { transform: scale(0.85); }
.qty-input {
  width: 50px;
  text-align: center;
  font-size: var(--fs-lg);
  font-weight: 700;
  border: none;
  background: transparent;
}

/* —— 底部操作栏 + 按钮 —— */
.detail-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(16px + var(--safe-bottom));
  position: sticky;
  bottom: 0;
  background: #fff;
  box-shadow: 0 -3px 12px rgba(0,0,0,0.06);
}
.btn-primary {
  background: linear-gradient(135deg, var(--fox), var(--fox-light));
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: var(--fs-md);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255,107,53,0.35);
  transition: transform var(--t-fast) var(--bounce), box-shadow var(--t-fast);
}
.btn-primary:active { transform: scale(0.95); box-shadow: 0 2px 6px rgba(255,107,53,0.35); }
.btn-primary:disabled { opacity: 0.6; }
.btn-secondary {
  background: #fff;
  color: var(--fox);
  border: 2px solid var(--fox);
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: var(--fs-md);
  font-weight: 700;
  transition: transform var(--t-fast) var(--bounce), background var(--t-fast);
}
.btn-secondary:active { transform: scale(0.95); background: var(--primary-light); }
.btn-large { flex: 1; padding: 13px; font-size: var(--fs-lg); }
.btn-block { width: 100%; display:block; }

/* ============================================================
   购物车
   ============================================================ */
.cart-modal { max-height: 85vh; }
.cart-items { padding: 8px 0; }
.cart-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
  border-bottom: 1px solid #f5f1ec;
  transition: background var(--t-fast);
}
.cart-item:active { background: var(--cream); }
.cart-item img {
  width: 60px;
  height: 60px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #f9f5f0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-model { font-size: var(--fs-sm); color: var(--gray); }
.cart-item-price { font-size: var(--fs-md); font-weight: 800; color: var(--fox); margin-top: 4px; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-light);
  border-radius: var(--r-sm);
  padding: 2px;
}
.cart-qty-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-base);
  font-weight: 700;
  border-radius: 6px;
  transition: transform var(--t-fast) var(--bounce);
}
.cart-qty-btn:active { transform: scale(0.82); background: #fff; }
.cart-qty-val { min-width: 24px; text-align: center; font-size: var(--fs-base); font-weight: 700; }
.cart-item-remove {
  width: 28px;
  height: 28px;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: transform var(--t-fast) var(--bounce), color var(--t-fast);
}
.cart-item-remove:active { transform: scale(0.82); color: var(--warm-red); }
.cart-empty { text-align: center; padding: 60px 0; color: var(--gray); }
.cart-empty p { margin-top: 10px; }
.cart-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  border-top: 1px solid #f0ece8;
  position: sticky;
  bottom: 0;
  background: #fff;
}
.cart-total { flex: 1; display: flex; flex-direction: column; }
.cart-total .label { font-size: var(--fs-sm); color: var(--gray); }
.cart-total .amount { font-size: var(--fs-xl); font-weight: 800; color: var(--fox); }

/* ============================================================
   结算
   ============================================================ */
.checkout-modal { max-height: 92vh; }
.checkout-body { padding: 16px; padding-bottom: calc(16px + var(--safe-bottom)); }
.auto-fill-notice {
  background: #e8f8ed;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: var(--fs-sm);
  color: var(--mint);
  border: 1px solid #bce8c8;
}
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-bottom: 5px;
  color: #333;
}
.required { color: var(--danger); }
.form-group input, .form-group textarea {
  width: 100%;
  border: 1.5px solid #ece6df;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: var(--fs-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  background: #fffdfb;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--fox);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}
.order-summary {
  background: var(--gray-light);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-top: 14px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: var(--fs-sm);
}
.summary-row.total {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--fox);
  border-top: 1px dashed #d8cfc4;
  padding-top: 8px;
  margin-top: 4px;
}
.checkout-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  padding-bottom: calc(16px + var(--safe-bottom));
  border-top: 1px solid #f0ece8;
  position: sticky;
  bottom: 0;
  background: #fff;
}

/* ============================================================
   成功页 · 小狐举 ✓ 庆祝
   ============================================================ */
.success-modal {
  max-width: 400px;
  max-height: 440px;
  text-align: center;
  padding: 40px 30px;
  border-radius: var(--r-lg);
  align-self: center;
  animation: popIn 0.45s var(--bounce);
}
.success-icon {
  font-size: 60px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.success-icon .success-fox { width: 90px; height: 90px; object-fit: contain; display:inline-block; animation: foxBounce 0.9s var(--bounce); }
.success-icon .success-emoji { animation: wiggle 0.6s ease-in-out infinite; }
.success-modal h2 { font-size: var(--fs-xl); margin-bottom: 8px; }
.success-msg { color: #666; margin-bottom: 16px; }
.order-no-display {
  background: var(--primary-light);
  border-radius: var(--r-sm);
  padding: 10px;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--fox);
  margin-bottom: 20px;
}
.success-actions { display: flex; gap: 10px; justify-content: center; }

/* ============================================================
   订单页 (从右滑入)
   ============================================================ */
.page-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--cream);
  z-index: 999;
  overflow-y: auto;
  animation: slideInRight 0.34s var(--bounce);
}
.page-content {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
}
.orders-list { padding: 12px; padding-bottom: calc(24px + var(--safe-bottom)); }
.order-card {
  background: #fff;
  border-radius: var(--r-card);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.order-no { font-size: var(--fs-sm); font-weight: 700; color: #333; }
.order-status {
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}
.status-pending { background: #fff3e0; color: #f57c00; }
.status-confirmed { background: #e3f2fd; color: #1976d2; }
.status-shipping { background: #e8f5e9; color: #388e3c; }
.status-completed { background: #f3e5f5; color: #7b1fa2; }
.status-rejected { background: #ffebee; color: #c62828; }
.order-items-mini {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.order-items-mini::-webkit-scrollbar { display: none; }
.order-item-mini {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #f9f5f0;
}
.order-item-mini img { width: 100%; height: 100%; object-fit: cover; }
.order-item-names {
  font-size: var(--fs-sm);
  color: #666;
  margin-bottom: 8px;
  line-height: 1.4;
}
.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #f5f1ec;
}
.order-amount { font-size: var(--fs-lg); font-weight: 800; color: var(--fox); }
.order-date { font-size: var(--fs-sm); color: var(--gray); }
.order-logistics {
  margin-top: 8px;
  padding: 8px 10px;
  background: #e8f5e9;
  border-radius: 6px;
  font-size: var(--fs-sm);
  color: #388e3c;
}

/* ============================================================
   订单详情页 · 品牌色 + 后台四段式布局
   ============================================================ */
.order-detail-body {
  padding: 12px;
  padding-bottom: calc(24px + var(--safe-bottom));
}
.order-detail-section {
  background: #fff;
  border-radius: var(--r-card);
  padding: 14px 14px 14px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--fox);
}
.order-detail-section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--fox);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.order-detail-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--fox);
  border-radius: 2px;
}
.order-detail-meta { display: grid; grid-template-columns: 90px 1fr; row-gap: 8px; column-gap: 10px; font-size: var(--fs-sm); }
.order-detail-meta dt { color: var(--gray); }
.order-detail-meta dd { color: #333; margin: 0; word-break: break-all; }
.order-detail-meta .status-tag {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 12px;
}

.order-detail-items-table {
  border-top: 1px solid #f3eee8;
  margin-top: 6px;
}
.order-detail-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #f3eee8;
  align-items: flex-start;
}
.order-detail-item:last-child { border-bottom: none; }
.order-detail-item-img {
  width: 48px; height: 48px;
  border-radius: 8px;
  background: #f9f5f0;
  object-fit: cover;
}
.order-detail-item-info { min-width: 0; }
.order-detail-item-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #333;
  line-height: 1.35;
  margin-bottom: 4px;
}
.order-detail-item-model {
  font-size: 12px;
  color: var(--gray);
}
.order-detail-item-prices {
  font-size: 12px;
  color: var(--gray);
  text-align: right;
  white-space: nowrap;
}
.order-detail-item-prices .unit-price { display: block; }
.order-detail-item-prices .qty { display: block; color: #999; }
.order-detail-item-prices .subtotal {
  display: block;
  color: var(--fox);
  font-weight: 700;
  font-size: var(--fs-base);
  margin-top: 2px;
}

.order-detail-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: var(--fs-sm);
  color: #555;
}
.order-detail-amount-row.discount { color: #ff5252; }
.order-detail-amount-row.total {
  border-top: 1.5px dashed #f3eee8;
  margin-top: 6px;
  padding-top: 12px;
  font-weight: 800;
  font-size: var(--fs-base);
  color: #333;
}
.order-detail-amount-row.total .amount {
  color: var(--fox);
  font-size: var(--fs-xl);
  font-weight: 800;
}

.order-detail-actions {
  margin-top: 6px;
  display: flex;
  gap: 10px;
}
.order-detail-actions .btn-primary,
.order-detail-actions .btn-secondary {
  flex: 1;
  padding: 12px;
  font-size: 14px;
}

.btn-back {
  background: rgba(255,255,255,0.6);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  position: absolute;
  left: 12px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s;
}
.btn-back:active { background: rgba(255,255,255,0.85); transform: scale(0.94); }

/* 列表卡的尾部按钮行（查看详情 + 下载发货清单） */
.order-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f5f1ec;
}
.order-card-actions button {
  flex: 1;
  padding: 8px;
  font-size: 13px;
  border-radius: 10px;
}

/* ============================================================
   底部 Tabbar · 图标+文字+选中弹性+小狐蹦出
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  display: flex;
  box-shadow: 0 -3px 14px rgba(0,0,0,0.08);
  z-index: 100;
  max-width: 500px;
  margin: 0 auto;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--gray);
  font-size: var(--fs-xs);
  transition: color var(--t-fast);
  position: relative;
}
.nav-item svg { transition: transform var(--t-fast) var(--bounce); }
.nav-item:active svg { transform: scale(0.85); }
.nav-item.active { color: var(--fox); }
.nav-item.active svg { animation: tabPop 0.4s var(--bounce); }
.nav-item.active::before {
  content: "";
  position: absolute;
  top: 4px;
  width: 24px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--fox), var(--fox-light));
}

/* ============================================================
   分享海报弹窗
   ============================================================ */
.share-modal {
  width: 360px;
  max-width: 92vw;
  padding: 22px 20px calc(24px + var(--safe-bottom));
  text-align: center;
  border-radius: var(--r-lg);
}
.share-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: 16px;
  color: #2b2b2b;
}
.poster-wrap {
  background: #f5f1ec;
  border-radius: var(--r-md);
  padding: 10px;
  display: flex;
  justify-content: center;
}
.share-poster {
  width: 240px;
  max-width: 100%;
  border-radius: var(--r-sm);
  display: block;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.share-tip {
  font-size: 12.5px;
  color: #999;
  margin: 14px 4px 16px;
  line-height: 1.6;
}
.share-actions { margin-top: 4px; }

/* ============================================================
   响应式
   ============================================================ */
@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .mp-skeleton-wrap { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .mp-skeleton-wrap { grid-template-columns: repeat(4, 1fr); }
}
