/* ========================================
   荔斛有品商城 - H5端样式
   品牌色：自然绿 + 大地色系
======================================== */

:root {
  --primary: #2d7a4f;
  --primary-light: #4fa877;
  --primary-dark: #1a5c38;
  --primary-bg: #f0f7f2;
  --accent: #d4a553;
  --accent-light: #e8c885;
  --danger: #e74c3c;
  --warning: #e67e22;
  --text-main: #1a1a1a;
  --text-secondary: #666;
  --text-light: #999;
  --bg-page: #f5f6f8;
  --bg-card: #ffffff;
  --border: #ececec;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --nav-height: 50px;          /* PC / 桌面端 */
  --nav-height-mobile: 60px;   /* 移动端(微信内置浏览器)更宽,图标文字才不被压扁 */
  --header-height: 48px;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
input, button, textarea { font-family: inherit; border: none; outline: none; }

/* App container */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-page);
  position: relative;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

/* ===== Header ===== */
.app-header {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.app-header.transparent {
  /* 已废弃：顶栏整体隐藏（display:none） */
}

/* ===== Top Bar (首页顶部 logo + 搜索 + 购物车) ===== */
.top-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  z-index: 1000;
}

.top-logo {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  cursor: pointer;
}

.top-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1a5c38, #2d7a4f);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

.top-search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  background: var(--bg-page);
  border-radius: 17px;
  padding: 0 6px 0 12px;
  cursor: text;
}

.top-search-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.top-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  outline: none;
  color: var(--text);
}

.top-search-btn {
  flex-shrink: 0;
  padding: 5px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
}

.top-cart {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.top-cart-icon {
  font-size: 22px;
  line-height: 1;
}

/* 顶部购物车数量角标（和小程序 nav-cart-badge 保持一致：
   top:-8rpx right:-4rpx → px换算；JS 已有 >99 → '99+' 逻辑） */
.top-cart .cart-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  background: #e74c3c;
  color: #fff;
  font-size: 9px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 7px;
  padding: 0 2px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

/* 统一给首页内容让出顶部栏高度 */
#page-home {
  padding-top: 52px;
}

/* 非首页页面有顶部栏被隐藏，统一在 page-view 顶部留出与顶栏等高的占位，避免内容贴顶 */
body.has-top-bar .page-view {
  padding-top: 0;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  background: #fff;
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 999;
}

.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  cursor: pointer;
  transition: color 0.2s;
  color: var(--text-light);
}

.bottom-nav .nav-item.active {
  color: var(--primary);
}

.bottom-nav .nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
  display: block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
/* 彩色 PNG 图标,与小程序原生 tabBar 同一套素材;选中态切 -active 版
   注意:url() 是相对 CSS 文件自身目录(/css/)解析,必须 ../images/,
   否则浏览器会请求 /css/images/tab-*.png(404)。
   为了一次修对、永不复现,这里用绝对根路径 /images/... 摆脱相对路径陷阱。 */
.bottom-nav .nav-item[data-page="home"] .nav-icon { background-image: url(/images/tab-home.png); }
.bottom-nav .nav-item[data-page="home"].active .nav-icon { background-image: url(/images/tab-home-active.png); }
.bottom-nav .nav-item[data-page="products"] .nav-icon { background-image: url(/images/tab-products.png); }
.bottom-nav .nav-item[data-page="products"].active .nav-icon { background-image: url(/images/tab-products-active.png); }
.bottom-nav .nav-item[data-page="cart"] .nav-icon { background-image: url(/images/tab-cart.png); }
.bottom-nav .nav-item[data-page="cart"].active .nav-icon { background-image: url(/images/tab-cart-active.png); }
.bottom-nav .nav-item[data-page="profile"] .nav-icon { background-image: url(/images/tab-profile.png); }
.bottom-nav .nav-item[data-page="profile"].active .nav-icon { background-image: url(/images/tab-profile-active.png); }

.bottom-nav .nav-label {
  font-size: 10px;
}

/* 微信内置浏览器 / 移动端兼容:
   屏幕宽度 <= 768px 时(几乎所有手机/微信内置浏览器),放大底部 nav 的
   图标/文字/高度,避免被压扁影响可读性。
   PC 端(>= 1024px)不触发,桌面端尺寸保持不变。
   注意:root 变量在某些 Android 微信 webview 里无法通过 var(--x) 引用
   媒体查询里的覆盖值,所以这里同时写死 px 而不是 var()。 */
@media (max-width: 768px) {
  .bottom-nav {
    height: calc(60px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav .nav-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
  }
  .bottom-nav .nav-label {
    font-size: 13px;
    line-height: 1.2;
  }
  /* body 底部留白也要同步,否则内容会被新高度的 nav 遮住 */
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
}

.bottom-nav .cart-badge {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(14px);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ===== Page View ===== */
.page-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Home Page ===== */
.home-banner {
  position: relative;
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.home-banner .banner-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a5c38 0%, #2d7a4f 50%, #4fa877 100%);
}

.home-banner .banner-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.3) 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.3) 1px, transparent 1px),
    radial-gradient(circle at 50% 80%, rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 60px 60px;
}

.home-banner .banner-content {
  position: relative;
  z-index: 2;
  padding: 0 24px;
}

.home-banner .banner-title {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.home-banner .banner-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  margin-bottom: 16px;
}

.home-banner .banner-btn {
  display: inline-block;
  padding: 8px 24px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

/* Banner carousel */
.banner-carousel {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.banner-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  opacity: 0;
  transition: opacity 0.5s;
}

.banner-slide.active { opacity: 1; }

.banner-slide .slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.banner-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0) 60%, rgba(0,0,0,.55) 100%);
  z-index: 1;
}

.banner-slide .slide-content {
  position: relative;
  z-index: 2;
}

.banner-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}

.banner-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: all 0.3s;
}

.banner-dots .dot.active {
  width: 18px;
  border-radius: 3px;
  background: #fff;
}

/* Kingkong zone (quick entries) */
.kingkong-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 0;
  background: #fff;
  margin: 12px;
  margin-top: 16px;
  border-radius: var(--radius);
  padding: 14px 4px 8px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 10;
}

.kingkong-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px 8px;
  cursor: pointer;
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.kingkong-item:active {
  transform: scale(0.92);
}

.kingkong-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 6px;
  position: relative;
}

.kingkong-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 8px;
  border: 1.5px solid #fff;
}

.kingkong-label {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

/* Stats section */
.stats-section {
  display: flex;
  background: #fff;
  margin: 12px;
  border-radius: var(--radius);
  padding: 16px 8px;
  box-shadow: var(--shadow);
}

.stats-section .stat-item {
  flex: 1;
  text-align: center;
}

.stats-section .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.stats-section .stat-unit {
  font-size: 12px;
  color: var(--text-secondary);
}

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

/* Section title */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}

.section-title h3 {
  font-size: 16px;
  font-weight: 600;
}

.section-title .more {
  font-size: 12px;
  color: var(--text-light);
}

/* Values grid */
.values-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px;
  margin-bottom: 8px;
}

.value-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.value-card .value-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.value-card .value-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.value-card .value-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Product card */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px;
}

.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
}

.product-card:active {
  transform: scale(0.97);
}

.product-card .product-img {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
}

.product-card .product-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.product-card .product-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

.product-card .product-info {
  padding: 10px;
}

.product-card .product-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .product-desc {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .product-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.product-card .price-symbol {
  font-size: 12px;
  color: var(--danger);
}

.product-card .price-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
}

.product-card .price-original {
  font-size: 11px;
  color: var(--text-light);
  text-decoration: line-through;
}

.product-card .product-sales {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Category tabs */
.category-tabs {
  display: flex;
  overflow-x: auto;
  background: #fff;
  padding: 8px 12px;
  gap: 8px;
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  -webkit-overflow-scrolling: touch;
}

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

.category-tabs .cat-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-page);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

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

/* Product list page */
.product-list-page {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* ===== Product Detail ===== */
.detail-page {
  background: #fff;
  min-height: 100vh;
}

.detail-banner {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 100px;
  position: relative;
}

.detail-banner .detail-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.detail-banner .back-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 5;
}

/* ===== 子页面通用返回栏（二级/三级页）===== */
.sub-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 4px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.sub-header .sub-back {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  color: var(--primary);
  cursor: pointer;
}
.sub-header .sub-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  /* 抵消左侧返回按钮宽度，让标题视觉居中 */
  margin-right: 40px;
}

/* 登录页：返回按钮绝对定位融入全屏渐变（白色箭头） */
.login-back {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 12px;
  z-index: 10;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* AI 客服整屏布局：返回栏 + 聊天区占满整屏
   注意：必须加 .active 后缀，否则 #page-aichat 的 display:flex 会覆盖
   .page-view {display:none}，导致 aichat 在所有页面都露出 sub-header/副标题 */
#page-aichat.active { display: flex; flex-direction: column; height: 100vh; }
#page-aichat.active .ai-chat-page { height: auto; flex: 1; min-height: 0; }

.detail-info {
  padding: 16px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  margin-top: -16px;
  position: relative;
  z-index: 2;
}

.detail-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.detail-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.detail-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-price .price-current {
  color: var(--danger);
  font-weight: 700;
}

.detail-price .price-symbol {
  font-size: 14px;
}

.detail-price .price-value {
  font-size: 28px;
}

.detail-price .price-original {
  font-size: 13px;
  color: var(--text-light);
  text-decoration: line-through;
}

.detail-stats {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.detail-stats .stat {
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-stats .stat strong {
  color: var(--text-main);
}

.detail-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-features .feature-tag {
  padding: 4px 10px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 4px;
  font-size: 11px;
}

.detail-section {
  margin-bottom: 16px;
}

.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
}

.detail-section p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.detail-specs {
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.detail-specs .spec-row {
  display: flex;
  padding: 4px 0;
  font-size: 13px;
}

.detail-specs .spec-label {
  width: 80px;
  color: var(--text-light);
}

.detail-specs .spec-value {
  flex: 1;
  color: var(--text-main);
}

/* Detail bottom bar */
.detail-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 8px;
  z-index: 200;
  gap: 6px;
  box-sizing: border-box;
}

.detail-bottom-bar .icon-btn {
  width: 52px;
  min-width: 52px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  gap: 1px;
}

.detail-bottom-bar .icon-btn .icon {
  font-size: 20px;
  line-height: 1;
}

.detail-bottom-bar .icon-btn .label {
  font-size: 10px;
  color: var(--text-light);
  line-height: 1;
}

.detail-bottom-bar .add-cart-btn {
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.detail-bottom-bar .buy-now-btn {
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* ===== Cart Page ===== */
.cart-page {
  padding-bottom: 80px;
}

.cart-empty {
  text-align: center;
  padding: 80px 20px;
}

.cart-empty .empty-icon {
  font-size: 60px;
  margin-bottom: 16px;
}

.cart-empty .empty-text {
  color: var(--text-light);
  margin-bottom: 16px;
}

.cart-empty .empty-btn {
  display: inline-block;
  padding: 8px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

.cart-list {
  padding: 12px;
}

.cart-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

.cart-item .check-box {
  width: 20px;
  height: 20px;
  border: 2px solid #ddd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 12px;
  color: #fff;
  transition: all 0.2s;
}

.cart-item .check-box.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.cart-item .cart-product-img {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item .cart-product-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

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

.cart-item .cart-product-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item .cart-product-spec {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.cart-item .cart-product-price {
  color: var(--danger);
  font-weight: 700;
  font-size: 15px;
}

.cart-item .qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-item .qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
}

.cart-item .qty-value {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

/* Cart bottom bar */
.cart-bottom-bar {
  position: fixed;
  bottom: var(--nav-height);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 200;
}

.cart-bottom-bar .select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.cart-bottom-bar .total-info {
  flex: 1;
  text-align: right;
  margin-right: 12px;
}

.cart-bottom-bar .total-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.cart-bottom-bar .total-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
}

.cart-bottom-bar .checkout-btn {
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.cart-bottom-bar .checkout-btn:disabled {
  background: #ccc;
}

/* ===== Profile Page ===== */
.profile-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, #4a9d6e 100%);
  padding: 18px 20px 22px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.profile-bg-deco {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  pointer-events: none;
  z-index: 0;
}
.profile-bg-deco:not(.profile-bg-deco-2) {
  width: 200px; height: 200px;
  top: -70px; right: -50px;
}
.profile-bg-deco-2 {
  width: 130px; height: 130px;
  bottom: -40px; left: -30px;
  background: rgba(255,255,255,0.08);
}
.profile-main {
  position: relative; z-index: 1;
  display: flex; align-items: center;
}
.profile-avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  border: 3px solid rgba(255,255,255,0.55);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar.has-img { background: transparent; font-size: 0; }
.profile-divider {
  width: 1px;
  height: 46px;
  background: rgba(255,255,255,0.35);
  margin: 0 16px;
  flex-shrink: 0;
}
.profile-info {
  flex: 1; min-width: 0;
}
.profile-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex; align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.3;
}
.profile-sub {
  font-size: 13px;
  opacity: 0.85;
}
.profile-action {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, transform .2s;
}
.profile-action:hover { background: rgba(255,255,255,0.32); transform: rotate(30deg); }


.profile-orders {
  background: #fff;
  margin: 12px;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.profile-orders .orders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.profile-orders .orders-header h4 {
  font-size: 15px;
  font-weight: 600;
}

.profile-orders .orders-header .more {
  font-size: 12px;
  color: var(--text-light);
}

.profile-orders .order-status-grid {
  display: flex;
  gap: 8px;
}

.profile-orders .order-status-item {
  flex: 1;
  text-align: center;
  cursor: pointer;
}

.profile-orders .order-status-item .status-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.profile-orders .order-status-item .status-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.profile-menu {
  background: #fff;
  margin: 0 12px 12px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-menu .menu-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

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

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

.profile-menu .menu-item .menu-label {
  flex: 1;
  font-size: 14px;
}

.profile-menu .menu-item .menu-arrow {
  color: var(--text-light);
  font-size: 12px;
}

/* ===== AI 客服 ===== */
/* ===== AI 客服整页 ===== */
.ai-chat-page {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--header-height));
  background: #f6f8f7;
  position: relative;
}
.ai-chat-sub {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; font-size: 12.5px; color: var(--text-light);
  background: #eef5f0; border-bottom: 1px solid var(--border);
}
.ai-chat-sub span { font-size: 14px; }
.ai-chat-body { flex: 1; overflow-y: auto; padding: 14px 14px 6px; background: #f6f8f7; }
.ai-msg { display: flex; margin-bottom: 12px; }
.ai-msg-bot { justify-content: flex-start; }
.ai-msg-user { justify-content: flex-end; }
.ai-bubble {
  max-width: 78%; padding: 9px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.ai-msg-bot .ai-bubble {
  background: #fff; color: #333; border: 1px solid #eef0ee; border-top-left-radius: 4px;
}
.ai-msg-user .ai-bubble {
  background: var(--primary); color: #fff; border-top-right-radius: 4px;
}
.ai-msg-user .ai-bubble.ai-img {
  padding: 4px; background: #fff; border: 1px solid #d6e6dc;
}
.ai-msg-user .ai-bubble.ai-img img {
  display: block; max-width: 200px; max-height: 200px;
  border-radius: 10px; object-fit: cover;
}
.ai-typing { display: flex; gap: 4px; align-items: center; }
.ai-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #c4c9c4;
  animation: ai-blink 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ai-blink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* 底部快捷：图标卡片 + 文本气泡 */
.ai-chat-quick {
  background: #fff; border-top: 1px solid var(--border); padding: 10px 8px 6px;
}
.ai-quick-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 0 4px 8px;
}
.ai-quick-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 4px 8px; border-radius: 12px;
  background: #f4f8f5; cursor: pointer; user-select: none;
  transition: transform .08s ease;
}
.ai-quick-card:active { transform: scale(0.96); background: #e6f0e9; }
.ai-quick-card .q-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 6px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.ai-quick-card .q-ico-order    { background: linear-gradient(135deg,#fff3e0,#ffe0b2); }
.ai-quick-card .q-ico-aftersale{ background: linear-gradient(135deg,#e3f2fd,#bbdefb); }
.ai-quick-card .q-ico-human    { background: linear-gradient(135deg,#ede7f6,#d1c4e9); }
.ai-quick-card .q-label {
  font-size: 12px; color: #444; font-weight: 500;
}
.ai-quick-bubbles {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px;
  border-top: 1px dashed #eee; padding-top: 8px;
}
.ai-quick-item {
  font-size: 12px; color: var(--primary); background: #eef7f1;
  padding: 5px 10px; border-radius: 14px; cursor: pointer;
}
.ai-quick-item:active { background: #dcefe2; }

/* 输入栏：+ / 输入 / 发送 */
.ai-input-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border); background: #fff;
}
.ai-plus-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: #f4f8f5;
  color: var(--primary); font-size: 22px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; padding: 0;
}
.ai-plus-btn:active { background: #e6f0e9; }
.ai-input-bar input {
  flex: 1; height: 36px; border: 1px solid var(--border); border-radius: 18px;
  padding: 0 14px; font-size: 13.5px; outline: none; background: #fff;
}
.ai-input-bar input:focus { border-color: var(--primary); }
.ai-send-btn {
  height: 36px; padding: 0 16px; border: none;
  background: var(--primary); color: #fff; border-radius: 18px;
  font-size: 13.5px; cursor: pointer; flex-shrink: 0;
}
.ai-send-btn:active { opacity: .85; }

/* "+" 弹层 */
.ai-plus-popover {
  position: absolute; left: 12px; bottom: 60px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  min-width: 150px; z-index: 5; overflow: hidden;
  animation: aiPopIn .15s ease-out;
}
@keyframes aiPopIn { from { transform: translateY(6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.ai-plus-item {
  padding: 11px 14px; font-size: 13.5px; color: #333;
  border-bottom: 1px solid #f1f3f1; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
.ai-plus-item:last-child { border-bottom: none; }
.ai-plus-item:active { background: #f4f8f5; }
.ai-plus-cancel { color: #999; justify-content: center; background: #f8faf8; }

/* 表情面板 */
.ai-emoji-panel {
  background: #fff; border-top: 1px solid var(--border);
  padding: 10px 8px 6px; max-height: 200px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.ai-emoji-item {
  font-size: 22px; text-align: center; padding: 6px 0;
  border-radius: 8px; cursor: pointer; user-select: none;
}
.ai-emoji-item:active { background: #f0f5f1; }

/* ===== Base Page ===== */
.base-hero {
  height: 220px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.base-hero .hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a5c38, #2d7a4f, #4fa877);
}

.base-hero .hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.1) 0, rgba(255,255,255,0.1) 2px, transparent 2px, transparent 20px);
}

.base-hero .hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding: 0 24px;
}

.base-hero .hero-label {
  font-size: 11px;
  letter-spacing: 3px;
  opacity: 0.7;
  margin-bottom: 8px;
}

.base-hero .hero-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.base-hero .hero-sub {
  font-size: 13px;
  opacity: 0.8;
  line-height: 1.6;
}

.base-content {
  padding: 20px 16px;
}

.base-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.base-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}

.base-section p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.base-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.base-features .feature-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.base-features .feature-item::before {
  content: '✓';
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

.base-zones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.base-zones .zone-card {
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.base-zones .zone-card .zone-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.base-zones .zone-card .zone-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.calendar-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.calendar-item {
  display: flex;
  gap: 12px;
  padding-bottom: 20px;
  position: relative;
}

.calendar-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.calendar-item .season-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  z-index: 1;
}

.calendar-item .cal-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.calendar-item .cal-content p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

/* ===== Checkout Page ===== */
.checkout-page {
  padding: 12px;
  padding-bottom: 80px;
}

.checkout-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.checkout-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
}

.ship-warning {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #a4321f;
  background: #fdecea;
  border: 1px solid #f5c6c0;
  border-radius: 8px;
}

.address-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.address-card .addr-icon {
  font-size: 24px;
}

.address-card .addr-info {
  flex: 1;
}

.address-card .addr-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.address-card .addr-detail {
  font-size: 12px;
  color: var(--text-secondary);
}

.checkout-product {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.checkout-product:last-child {
  border-bottom: none;
}

.checkout-product .cp-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}
/* 商品图铺满容器，不留品类色背景 */
.checkout-product .cp-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.checkout-product .cp-info {
  flex: 1;
}

.checkout-product .cp-name {
  font-size: 13px;
  font-weight: 600;
}

.checkout-product .cp-spec {
  font-size: 11px;
  color: var(--text-light);
}

.checkout-product .cp-price {
  text-align: right;
}

.checkout-product .cp-price .price {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
}

.checkout-product .cp-price .qty {
  font-size: 11px;
  color: var(--text-light);
}

.checkout-summary {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}

.checkout-summary .total {
  font-weight: 700;
}

.checkout-summary .total .price {
  color: var(--danger);
  font-size: 18px;
}

.payment-methods {
  display: flex;
  gap: 12px;
}

.payment-methods .pay-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.payment-methods .pay-option.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.payment-methods .pay-icon {
  font-size: 20px;
}

.checkout-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
}

.checkout-bottom-bar .pay-amount {
  font-size: 12px;
  color: var(--text-secondary);
}

.checkout-bottom-bar .pay-amount .amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--danger);
}

.checkout-bottom-bar .pay-btn {
  padding: 10px 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Address List Page ===== */
.address-list-page {
  padding: 12px;
  padding-bottom: 100px;
}

.address-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  position: relative;
}

.address-item .ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.address-item .ai-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.address-item .ai-phone {
  font-size: 13px;
  color: var(--text-secondary);
}

.address-item .ai-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--primary);
  color: #fff;
}

.address-item .ai-detail {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.address-item .ai-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.address-item .ai-action {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.address-item .ai-action.set-default {
  color: var(--primary);
}

.address-item .ai-action.is-default {
  color: var(--text-light);
}

.address-item .ai-action.delete {
  margin-left: auto;
  color: var(--danger);
}

.address-item .ai-edit {
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.address-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

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

.address-empty .ae-text {
  font-size: 14px;
  margin-bottom: 20px;
}

.address-add-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(45,122,79,0.3);
}

/* ===== Address Edit Page ===== */
.address-edit-page {
  padding: 12px;
}

.address-edit-page .form-group {
  background: #fff;
  border-radius: var(--radius);
  padding: 0 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.address-edit-page .form-row {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.address-edit-page .form-row:last-child {
  border-bottom: none;
}

.address-edit-page .form-label {
  width: 80px;
  font-size: 14px;
  color: var(--text-main);
  flex-shrink: 0;
}

.address-edit-page .form-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-main);
  background: transparent;
}

.address-edit-page .form-input::placeholder {
  color: var(--text-light);
}

.address-edit-page .form-textarea {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-main);
  background: transparent;
  resize: none;
  min-height: 60px;
  font-family: inherit;
}

.address-edit-page .form-region {
  display: flex;
  gap: 8px;
  width: 100%;
}

.address-edit-page .form-region select {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  color: var(--text-main);
  background: #fff;
  outline: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.address-edit-page .default-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.address-edit-page .default-row .label {
  font-size: 14px;
  color: var(--text-main);
}

.address-edit-page .toggle-switch {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #ddd;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.address-edit-page .toggle-switch.on {
  background: var(--primary);
}

.address-edit-page .toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: left 0.2s;
}

.address-edit-page .toggle-switch.on::after {
  left: 22px;
}

.address-edit-page .save-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  z-index: 200;
  box-sizing: border-box;
}

.save-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  z-index: 200;
  box-sizing: border-box;
}

.save-btn {
  flex: 1;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Checkout address selector ===== */
.address-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.address-selector.empty {
  justify-content: center;
  padding: 20px;
}

.address-selector .as-add {
  text-align: center;
  color: var(--primary);
  font-size: 14px;
}

/* ===== Order Page ===== */
.order-tabs {
  display: flex;
  background: #fff;
  position: sticky;
  top: var(--header-height);
  z-index: 50;
}

.order-tabs .order-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
}

.order-tabs .order-tab.active {
  color: var(--primary);
  font-weight: 600;
}

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

.order-list {
  padding: 12px;
}

.order-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

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

.order-card .order-no {
  font-size: 11px;
  color: var(--text-light);
}

.order-card .order-status {
  font-size: 12px;
  font-weight: 600;
}

.order-card .order-status.pending { color: var(--warning); }
.order-card .order-status.paid { color: var(--primary); }
.order-card .order-status.shipped { color: #2980b9; }
.order-card .order-status.completed { color: var(--text-light); }

.order-card .order-product {
  display: flex;
  gap: 10px;
  padding: 8px 0;
}

.order-card .order-product .op-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}
/* 商品图铺满 50×50 容器，不留品类色背景 */
.order-card .order-product .op-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.order-card .order-product .op-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.order-card .order-product .op-info {
  flex: 1;
}

.order-card .order-product .op-name {
  font-size: 13px;
  font-weight: 600;
}

.order-card .order-product .op-spec {
  font-size: 11px;
  color: var(--text-light);
}

.order-card .order-product .op-price {
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
}

.order-card .order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.order-card .order-total {
  font-size: 13px;
}

.order-card .order-total .total-price {
  font-weight: 700;
  color: var(--danger);
}

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

.order-card .order-actions .action-btn {
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
}

.order-card .order-actions .action-btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: toastIn 0.3s ease;
  pointer-events: none;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -40%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 5000;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  animation: slideUp 0.3s ease;
}

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

.modal-content .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-content .modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-content .modal-close {
  font-size: 20px;
  color: var(--text-light);
  cursor: pointer;
}

/* ===== Order Detail (fullpage modal) ===== */
.modal-content.fullpage {
  max-width: 480px;
  max-height: 92vh;
  padding: 0;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-content.fullpage .modal-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 0;
}
.modal-content.fullpage .modal-title { font-size: 16px; }
.order-detail {
  padding: 14px 16px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.od-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px;
  border-radius: 12px;
  color: #fff;
  margin-bottom: 14px;
}
.od-banner-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.od-banner-title { font-size: 17px; font-weight: 600; }
.od-banner-sub { font-size: 12px; opacity: 0.85; margin-top: 4px; }
.od-banner.status-pending  { background: linear-gradient(135deg,#f59e0b,#d97706); }
.od-banner.status-paid     { background: linear-gradient(135deg,#2d7a4f,#4fa877); }
.od-banner.status-shipped  { background: linear-gradient(135deg,#2980b9,#3498db); }
.od-banner.status-completed{ background: linear-gradient(135deg,#6b7280,#9ca3af); }
.od-banner.status-cancelled{ background: linear-gradient(135deg,#9ca3af,#d1d5db); }

.od-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.od-block-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.od-block-meta { font-size: 11px; color: var(--text-light); font-weight: 400; }
.od-empty { color: var(--text-light); font-size: 12px; padding: 8px 0; }
.od-block.od-ship { background: #f0f7f2; border-left: 3px solid var(--primary); }
.od-block.od-ship .od-block-title { color: var(--primary-dark); font-weight: 600; }

.od-addr-row { display: flex; align-items: center; gap: 12px; font-size: 14px; margin-bottom: 4px; }
.od-addr-name { font-weight: 600; }
.od-addr-phone { color: var(--text-secondary); font-size: 13px; }
.od-addr-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.od-items { display: flex; flex-direction: column; gap: 12px; }
.od-item {
  display: flex; gap: 10px; align-items: flex-start;
  /* 订单详情里整行可点击跳商品详情：可点击 + 微弱高亮给反馈 */
  cursor: pointer;
  margin: 0 -8px; padding: 8px;
  border-radius: 8px;
  transition: background 0.15s;
}
.od-item:active { background: var(--bg); }
.od-item-img {
  width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  overflow: hidden;
}
.od-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.od-item-info { flex: 1; min-width: 0; }
.od-item-name {
  font-size: 13px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.od-item-spec { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.od-item-price { text-align: right; flex-shrink: 0; }
.od-item-unit { font-size: 13px; font-weight: 600; }
.od-item-sub  { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.od-item-money { color: var(--text); font-weight: 500; }

.od-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 6px 0;
  color: var(--text-secondary);
}
.od-row-total {
  border-top: 1px solid var(--border);
  margin-top: 6px; padding-top: 10px;
  font-size: 14px; color: var(--text);
}
.od-total { color: var(--danger); font-size: 17px; font-weight: 700; }
.od-discount { color: var(--danger); }
.od-id {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f0f7f3;
}
.od-id:active { background: #e3f0e9; }

.od-actions {
  display: flex; gap: 10px;
  padding-top: 6px;
}
.od-btn {
  flex: 1;
  text-align: center;
  padding: 11px 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
}
.od-btn:active { transform: scale(0.97); }
.od-btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.od-btn-primary:active { background: var(--primary-dark); }

/* 订单列表卡片可点击反馈 */
.order-card { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.order-card:active { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.order-more-items {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  padding: 8px 0 4px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #fff;
  gap: 8px;
}

.search-bar .search-input {
  flex: 1;
  height: 36px;
  background: var(--bg-page);
  border-radius: 18px;
  padding: 0 16px;
  font-size: 13px;
}

.search-bar .search-btn {
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 18px;
  font-size: 13px;
  cursor: pointer;
}

/* ===== Loading ===== */
.loading-more {
  text-align: center;
  padding: 16px;
  color: var(--text-light);
  font-size: 12px;
}

.no-more {
  text-align: center;
  padding: 16px;
  color: var(--text-light);
  font-size: 12px;
}

.no-more::before, .no-more::after {
  content: '—';
  margin: 0 8px;
  opacity: 0.5;
}

/* ===== Brand Banner ===== */
.brand-banner {
  background: linear-gradient(135deg, var(--primary-bg) 0%, #fff 100%);
  margin: 12px;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}

.brand-banner .brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}

.brand-banner .brand-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
}

.brand-banner .brand-text p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Safe area */
.safe-bottom { height: env(safe-area-inset-bottom, 0px); }

/* ===== Login / Register Page ===== */
/* ===================== 登录/注册页背景重做 ===================== */
.login-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% 0%, #3a9560 0%, transparent 60%),
    linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 35%, #f0f7f2 62%, #f8fbf5 100%);
  color: var(--text-main);
}

/* 装饰层：浮在背景上的光斑 + 远山 + 叶脉 */
.login-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
}
.login-blob-1 {
  width: 320px; height: 320px;
  top: -80px; left: -90px;
  background: radial-gradient(circle, rgba(255,255,255,0.35), rgba(255,255,255,0) 70%);
}
.login-blob-2 {
  width: 260px; height: 260px;
  top: 60px; right: -80px;
  background: radial-gradient(circle, rgba(212,165,83,0.45), rgba(212,165,83,0) 70%);
}
.login-blob-3 {
  width: 380px; height: 380px;
  top: 280px; left: 30%;
  background: radial-gradient(circle, rgba(255,255,255,0.18), rgba(255,255,255,0) 70%);
}
.login-leaves,
.login-mountains {
  position: absolute;
  left: 0; width: 100%;
  pointer-events: none;
}
.login-leaves { top: 60px; height: 200px; opacity: 0.9; }
.login-mountains { bottom: 56%; height: 220px; }

/* Hero 区 */
.login-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 56px 20px 36px;
  color: #fff;
}
.login-logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
}
.login-logo-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow:
    0 0 0 8px rgba(255,255,255,0.08),
    0 8px 30px rgba(26,92,56,0.35);
  animation: loginRing 3.6s ease-in-out infinite;
}
@keyframes loginRing {
  0%,100% { transform: scale(1); opacity: 0.85; }
  50%     { transform: scale(1.06); opacity: 1; }
}
.login-logo {
  position: relative;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #e8f3ec 100%);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 800;
  box-shadow:
    inset 0 -4px 12px rgba(26,92,56,0.18),
    0 12px 30px rgba(26,92,56,0.35);
  letter-spacing: -1px;
}
.login-brand {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.login-slogan {
  font-size: 12px;
  opacity: 0.92;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.login-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}
.login-tag {
  display: inline-block;
  padding: 5px 10px;
  font-size: 11px;
  color: #fff;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* 表单区 */
.login-form-wrap {
  position: relative;
  z-index: 1;
  padding: 8px 20px 28px;
}
/* 浮在背景上的表单卡片 */
.login-form-wrap .form-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 22px 18px 18px;
  box-shadow:
    0 10px 30px rgba(26,92,56,0.10),
    0 2px 6px rgba(0,0,0,0.04);
  position: relative;
}
.login-form-wrap .form-card::before {
  content: "";
  position: absolute;
  top: -1px; left: 18px; right: 18px;
  height: 3px;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, transparent, var(--primary-light) 30%, var(--accent) 50%, var(--primary-light) 70%, transparent);
  opacity: 0.7;
}
/* 表单项阴影更柔和 */
.login-form-wrap .form-item {
  background: #fafdfb;
  border: 1px solid #e6efe9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-form-wrap .form-item:focus-within {
  border-color: var(--primary-light);
  background: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 0 0 3px rgba(79,168,119,0.12);
}
/* 注册页底部安全承诺带 */
.login-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.5px;
}
.login-trust-dot {
  color: var(--primary-light);
  font-weight: 700;
}

.form-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
  text-align: center;
}

.form-item {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 24px;
  padding: 0 16px;
  margin-bottom: 14px;
  height: 48px;
  box-shadow: var(--shadow);
  gap: 10px;
}

.form-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.form-input {
  flex: 1;
  height: 100%;
  background: transparent;
  font-size: 14px;
  color: var(--text-main);
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-item-code {
  gap: 8px;
}

.form-item-code .form-input {
  flex: 1;
}

.code-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.code-btn:active {
  opacity: 0.7;
}

.code-btn.disabled {
  color: var(--text-light);
  background: var(--border);
  pointer-events: none;
}

.reg-identity-hint {
  font-size: 12px;
  color: var(--text-light);
  background: var(--primary-bg);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.6;
}

.profile-identity-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
  font-weight: 600;
}

.profile-identity-badge.agent {
  background: linear-gradient(135deg, #ff9d3c, #e67e22);
  color: #fff;
}

.profile-identity-badge.normal {
  background: rgba(255,255,255,0.22);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
}

.agent-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.5;
  color: #fff;
  background: linear-gradient(135deg, #e67e22, #d35400);
  border-radius: 4px;
  vertical-align: middle;
}

.agent-tag-lg {
  margin-left: 8px;
  padding: 3px 10px;
  font-size: 12px;
}

.form-btn {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 0 4px 16px rgba(45,122,79,0.3);
  transition: transform 0.2s;
}

.form-btn:active {
  transform: scale(0.97);
}

.form-link {
  text-align: center;
  font-size: 13px;
  color: var(--primary);
  margin-top: 16px;
  cursor: pointer;
}

.form-divider {
  display: flex;
  align-items: center;
  margin: 24px 0 16px;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-divider span {
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-light);
}

.social-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  gap: 6px;
  padding: 8px;
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.social-icon.wechat {
  background: #07c160;
}

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

/* 商品详情图片画廊（单图占满 + 自动轮播） */
.detail-gallery { position: relative; width: 100%; height: 100%; overflow: hidden; }
.detail-gallery-track { display: flex; width: 100%; height: 100%; transition: transform .4s ease; }
.detail-gallery-img { flex: 0 0 100%; width: 100%; height: 100%; max-width: 100%; border-radius: 0; box-shadow: none; object-fit: cover; display: block; }
.detail-gallery-dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 5px; z-index: 2; }
.detail-gallery-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.45); transition: all .25s ease; }
.detail-gallery-dot.active { width: 18px; border-radius: 3px; background: #fff; }

/* 多规格选择 */
.sku-list { display: flex; flex-wrap: wrap; gap: 10px; }
.sku-item {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 100px;
  transition: all .18s ease;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.sku-item:active { transform: scale(.96); }
.sku-item .sku-name { font-size: 14px; font-weight: 600; color: var(--text-main); }
.sku-item .sku-price { font-size: 13px; font-weight: 600; color: #e2574c; }
.sku-item.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 2px 10px rgba(45,122,79,.18);
}
.sku-item.active .sku-name { color: var(--primary-dark); }
.sku-item.active .sku-price { color: var(--primary); }
.sku-item.active::after {
  content: '✓';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 18px;
  height: 18px;
  border-radius: 0 11px 0 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* 详情页"已选规格"提示条（点击唤起弹层） */
.spec-pick-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
}
.spec-pick-hint:active { transform: scale(.98); }
.spec-pick-hint .sph-label {
  font-size: 12px;
  color: var(--text-light);
  flex: 0 0 auto;
}
.spec-pick-hint .sph-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spec-pick-hint .sph-arrow { color: var(--text-light); font-size: 16px; }

/* 规格选择弹层 */
.sku-modal { position: relative; padding-top: 6px; }
.sku-modal .modal-close { position: absolute; top: 0; right: 0; }
.sku-modal-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.sku-modal-head .smh-img {
  width: 72px; height: 72px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.sku-modal-head .smh-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sku-modal-head .smh-img span { font-size: 36px; }
.sku-modal-head .smh-price { font-size: 20px; font-weight: 700; color: #e2574c; }
.sku-modal-head .smh-price .sym { font-size: 13px; margin-right: 1px; }
.sku-modal-head .smh-stock { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.sku-modal-title {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--primary);
}
.sku-modal-confirm {
  width: 100%; height: 44px; margin-top: 18px; border: none; border-radius: 22px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.sku-modal-confirm:active { opacity: .85; }

/* SKU 弹窗：已选摘要 + 数量步进器 */
.sku-modal .smh-picked {
  font-size: 12px; color: var(--text-secondary); margin-top: 6px;
}
.sku-modal-qty {
  display: flex; align-items: center; gap: 8px;
  height: 36px; margin-top: 4px;
}
.sku-modal-qty .smq-btn {
  width: 32px; height: 32px; line-height: 30px; text-align: center;
  border-radius: 8px; background: var(--bg-page);
  font-size: 18px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; user-select: none; box-sizing: border-box;
  border: 1px solid var(--border, #eee);
}
.sku-modal-qty .smq-btn.disabled {
  color: #ccc; background: #fafafa; cursor: not-allowed;
  border-color: #f0f0f0;
}
.sku-modal-qty .smq-input {
  width: 64px; height: 32px; border-radius: 8px; border: 1px solid var(--border, #eee);
  text-align: center; font-size: 15px; font-weight: 600; color: var(--text-main);
  background: #fff; outline: none; box-sizing: border-box;
  -moz-appearance: textfield;
}
.sku-modal-qty .smq-input::-webkit-outer-spin-button,
.sku-modal-qty .smq-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sku-modal-qty .smq-input:focus { border-color: var(--primary); }
.sku-modal-qty .smq-stock {
  margin-left: 8px; font-size: 12px; color: var(--text-light);
}

/* 商品详情富文本 */
.detail-rich { font-size: 14px; line-height: 1.9; color: var(--text); word-break: break-word; }
.detail-rich img { max-width: 100%; height: auto; border-radius: 0; margin: 0; display: block; }
.detail-rich h1, .detail-rich h2, .detail-rich h3 { font-size: 16px; margin: 14px 0 8px; color: var(--text); }
.detail-rich p { margin: 8px 0; }
.detail-rich ul, .detail-rich ol { padding-left: 22px; margin: 8px 0; }
.detail-rich a { color: var(--primary); text-decoration: underline; }

/* 产品详情懒加载占位（首屏快读时 detail 区显示，等 /api/products/:id/full 回来再二次渲染） */
.detail-rich-loading { padding: 28px 16px; text-align: center; color: var(--text-secondary, #888); font-size: 13px; }
.detail-rich-loading .loading-spin { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 8px; border: 2px solid rgba(45,122,79,0.2); border-top-color: var(--primary, #2d7a4f); border-radius: 50%; animation: detail-spin 0.8s linear infinite; }
@keyframes detail-spin { to { transform: rotate(360deg); } }

/* ===== 分享海报 ===== */
.share-page { padding: 14px 14px 30px; }
.share-card { position: relative; border-radius: 18px; overflow: hidden; box-shadow: 0 12px 30px rgba(15, 78, 45, 0.16); margin-bottom: 16px; }
.share-card-bg { position: absolute; inset: 0; background: linear-gradient(135deg, #1a5c38 0%, #2d7a4f 50%, #4fa877 100%); }
.share-card-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.18), transparent 50%), radial-gradient(circle at 10% 90%, rgba(255,255,255,0.12), transparent 50%); }
.share-card-body { position: relative; padding: 18px 16px 22px; color: #fff; }
.share-card-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.share-logo { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #2d7a4f; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; box-shadow: 0 4px 10px rgba(0,0,0,0.18); }
.share-brand-text { font-size: 16px; font-weight: 600; }
.share-card-title { font-size: 13px; opacity: 0.92; margin-bottom: 12px; }
.share-card-poster {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(0,0,0,0.22);
  background: #fff;
  color: var(--text);
}
.poster-inner { padding: 16px 14px 12px; background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 60%); }
.poster-top { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid #e5e7eb; }
.poster-brand { font-size: 14px; font-weight: 700; color: #1f2937; }
.poster-tag { font-size: 11px; color: #6b7280; }
.poster-mid { display: flex; align-items: center; gap: 12px; padding: 14px 0 12px; }
.poster-info { flex: 1; min-width: 0; }
.poster-name { font-size: 15px; font-weight: 700; color: #1f2937; line-height: 1.3; }
.poster-code-label { font-size: 11px; color: #6b7280; margin-top: 6px; }
.poster-code { font-size: 26px; font-weight: 700; color: #2d7a4f; letter-spacing: 2px; font-family: 'SFMono-Regular', Consolas, monospace; line-height: 1.2; margin: 4px 0 6px; }
.poster-tip { font-size: 11px; color: #9ca3af; line-height: 1.5; }
.poster-qr-wrap { width: 96px; height: 96px; flex-shrink: 0; background: #fff; border-radius: 8px; border: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.poster-qr { width: 100%; height: 100%; object-fit: contain; }
.poster-qr-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #6b7280; text-align: center; padding: 6px; word-break: break-all; }
.poster-bottom { padding-top: 10px; border-top: 1px solid #e5e7eb; text-align: center; }
.poster-slogan { font-size: 12px; color: #2d7a4f; font-weight: 600; }

.share-section { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.share-section-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.share-code-row { display: flex; align-items: center; gap: 10px; }
.share-code-big { flex: 1; font-size: 24px; font-weight: 700; color: #2d7a4f; letter-spacing: 3px; font-family: 'SFMono-Regular', Consolas, monospace; background: #f0fdf4; padding: 10px 14px; border-radius: 10px; text-align: center; border: 1px solid #d1fadf; }
.share-link-row { display: flex; align-items: center; gap: 10px; }
.share-link-input { flex: 1; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 12px; color: var(--text-secondary); background: #f9fafb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-copy-btn { background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.share-copy-btn:active { transform: scale(.96); }
.share-tip { font-size: 11px; color: var(--text-light); margin-top: 8px; line-height: 1.5; }
.share-actions { margin: 14px 0; }
.share-action-btn { width: 100%; padding: 13px 0; border-radius: 12px; font-size: 15px; font-weight: 600; border: none; cursor: pointer; }
.share-action-btn.primary { background: linear-gradient(135deg, #2d7a4f, #4fa877); color: #fff; box-shadow: 0 8px 16px rgba(45,122,79,0.25); }
.share-action-btn:active { transform: scale(.98); }
.share-stats { background: #fff; border-radius: 14px; padding: 16px; display: flex; align-items: center; justify-content: space-around; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.share-stat-item { text-align: center; }
.share-stat-value { font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.share-stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.share-stat-line { width: 1px; height: 32px; background: var(--border); }

/* ===== 编辑资料（头像 + 昵称）===== */
.ep-preview {
  width: 88px; height: 88px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 50px;
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  overflow: hidden;
}
.ep-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-upload-btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 18px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 6px;
}
.ep-upload-btn:hover { background: var(--primary); color: #fff; }
.ep-clear-btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--border);
  color: var(--text-light);
  border-radius: 18px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
}
.ep-clear-btn:hover { color: var(--danger); border-color: var(--danger); }
.ep-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.ep-emoji-btn {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: #f7f7f7;
  border: 1.5px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .12s;
}
.ep-emoji-btn:hover { transform: translateY(-1px); }
.ep-emoji-btn.active {
  background: #fff5ec;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(212,98,45,0.18);
}

/* ===== 商品/分类首屏骨架（"正在加载商品…"） =====
   之前 init 同步阶段直接渲染了 data.js 默认商品（占位），被后端真实数据替换时形成肉眼可见的闪烁。
   现在 init 先 await 后端数据再 render，首屏过渡用一个 loading 骨架（不在显位置扰动用户感知）。 */
.grid-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 16px;
  color: var(--text-light, #888);
  font-size: 13px;
  position: relative;
}
.grid-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid rgba(45,122,79,.18);
  border-top-color: var(--primary, #2d7a4f);
  border-radius: 50%;
  vertical-align: -2px;
  animation: grid-loading-spin .8s linear infinite;
}
@keyframes grid-loading-spin {
  to { transform: rotate(360deg); }
}

.cat-tabs-loading {
  padding: 12px 16px;
  color: var(--text-light, #888);
  font-size: 13px;
}

.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 16px;
  color: var(--text-light, #888);
  font-size: 14px;
}
