/* ============================================================
 * 玉鲜笙甄选 · 手机 H5 设计系统
 * Token 对齐 DESIGN.md / PRD V1.0 第 4 章视觉规范
 * 基准宽度 375px，适配 320–430px
 * ============================================================ */

:root {
  /* 品牌色 */
  --primary: #1668E3;
  --primary-dark: #0E3A8C;
  --primary-light: #EAF2FF;
  --primary-link: #40A9FF;
  --accent: #FF7D00;
  --success: #00B42A;
  --danger: #F53F3F;
  --star: #FFB400;

  /* 中性色 */
  --text: #1D2129;
  --text-2: #4E5969;
  --text-3: #86909C;
  --line: #E5E6EB;
  --bg: #F7F8FA;
  --card: #FFFFFF;

  /* 圆角 */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;

  /* 间距 */
  --gutter: 16px;
  --nav-h: 56px;
  --tab-h: 56px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.icon-sm { width: 18px !important; height: 18px !important; }
.icon-lg { width: 28px !important; height: 28px !important; }
html, body { margin: 0; padding: 0; width: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { display: none; }

/* 图标：默认描边风格 */
.icon { width: 24px; height: 24px; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon.fill { fill: currentColor; stroke: none; }
/* 收藏选中态：红色实心爱心 */
.mini-action .icon.is-fav, .fav-del .icon.is-fav { color: var(--danger); }

/* ==================== 布局骨架 ==================== */
.page { min-height: 100vh; min-height: 100dvh; padding-top: var(--nav-h); padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 8px); }
.page.no-tab { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); }
.with-tabbar { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 76px); }
.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.pt-safe { padding-top: env(safe-area-inset-top, 0px); }
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* 顶部导航栏 */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: var(--gutter); padding-right: var(--gutter);
  background: rgba(247, 248, 250, .88);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(229, 230, 235, .7);
}
.navbar .nav-left, .navbar .nav-right { display: flex; align-items: center; gap: 6px; min-width: 44px; }
.navbar .nav-right { justify-content: flex-end; }
.navbar .nav-title { font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
.navbar .nav-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--text); }
.navbar .nav-btn:active { opacity: .6; }
.navbar .badge-dot { position: absolute; top: 8px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--bg); }

/* 底部 TabBar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -1px 8px rgba(0,0,0,.03);
}
.tabbar .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11px; position: relative; }
.tabbar .tab.active { color: var(--primary); font-weight: 600; }
.tabbar .tab .icon { width: 25px; height: 25px; }
.tabbar .tab .cart-badge {
  position: absolute; top: 4px; left: calc(50% + 6px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-full);
  background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}

/* ==================== 通用组件 ==================== */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: 0 1px 8px rgba(0,0,0,.04); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 12px; }
.section-title h2 { font-size: 16px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-title h2::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--primary); }
.section-title .more { color: var(--text-2); font-size: 12px; display: flex; align-items: center; gap: 2px; }
.section-title .more .icon { width: 14px; height: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 20px; border-radius: var(--r-md); font-weight: 500; transition: transform .12s, opacity .12s; user-select: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { background: #A8C7F0; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--primary); color: var(--primary); }
.btn-light { background: var(--primary-light); color: var(--primary); }
.btn-gray { background: var(--line); color: var(--text-2); }
.btn-danger { background: #fff; border: 1px solid var(--danger); color: var(--danger); }
.btn-block { width: 100%; }
.btn-lg { height: 48px; font-size: 16px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 12px; border-radius: var(--r-full); }

.tag { display: inline-block; padding: 2px 8px; border-radius: var(--r-sm); font-size: 11px; line-height: 1.4; }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-accent { background: #FFF0E3; color: var(--accent); }
.tag-gray { background: #F2F3F5; color: var(--text-2); }
.tag-danger { background: #FFECE8; color: var(--danger); }
.tag-success { background: #E8FFEA; color: var(--success); }

.price { color: var(--accent); font-weight: 600; }
.price .yuan { font-size: .7em; font-weight: 500; }
.price-ref { color: var(--text-3); text-decoration: line-through; font-size: 12px; }

/* 数量步进器 */
.stepper { display: inline-flex; align-items: center; border-radius: var(--r-md); overflow: hidden; background: var(--bg); }
.stepper button { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--text); }
.stepper button:disabled { color: #C9CDD4; }
.stepper button .icon { width: 16px; height: 16px; }
.stepper .num { min-width: 34px; text-align: center; font-size: 14px; }

/* 圆形勾选框 */
.checkbox { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--text-3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s; }
.checkbox.checked { background: var(--primary); border-color: var(--primary); color: #fff; }
.checkbox .icon { width: 14px; height: 14px; stroke-width: 2.5; opacity: 0; }
.checkbox.checked .icon { opacity: 1; }

/* 空状态 */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--text-3); text-align: center; }
.empty .icon { width: 72px; height: 72px; color: #C9D8F0; stroke-width: 1.2; margin-bottom: 16px; }
.empty p { margin: 0 0 20px; font-size: 14px; }

/* 骨架屏 */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton { background: linear-gradient(90deg, #F2F3F5 25%, #E8EAEE 50%, #F2F3F5 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md); }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.95);
  z-index: 200; background: rgba(29,33,41,.86); color: #fff; padding: 11px 18px;
  border-radius: 10px; font-size: 14px; max-width: 78%; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; animation: fadeIn .2s; }
.modal-mask.center { align-items: center; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet { width: 100%; max-width: 480px; background: #fff; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom, 0px)); animation: slideUp .25s ease-out; max-height: 85vh; overflow-y: auto; }
.modal-mask.center .modal-sheet { border-radius: var(--r-xl); width: 86%; max-width: 340px; animation: popIn .2s; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes popIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text-2); text-align: center; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* 表单 */
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 8px; font-weight: 500; }
.input, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: #fff; outline: none; transition: border-color .15s;
}
.input:focus, .textarea:focus { border-color: var(--primary); }
.textarea { min-height: 90px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }

/* 分割线 */
.divider { height: 1px; background: var(--line); margin: 12px 0; }

/* ==================== 首页 ==================== */
.home-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 12px; }
.home-brand { font-size: 20px; font-weight: 700; color: var(--primary-dark); letter-spacing: -.5px; }
.home-header .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; }
.home-header .avatar .icon { width: 20px; height: 20px; }

.search-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.search-input { flex: 1; height: 40px; background: #fff; border-radius: var(--r-full); display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--text-3); }
.search-input .icon { width: 18px; height: 18px; }
.search-input span { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.service-fab { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.service-fab .badge-dot { top: 6px; right: 6px; }

/* 轮播 */
.banner { height: 176px; border-radius: var(--r-xl); overflow: hidden; position: relative; background-size: cover; background-position: center; }
.banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.62) 0%, rgba(0,0,0,.18) 50%, transparent 100%); }
.banner-inner { position: absolute; inset: 0; z-index: 1; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.banner-tag { align-self: flex-start; background: var(--accent); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: var(--r-full); font-weight: 500; }
.banner-inner h2 { font-size: 22px; margin: 8px 0 4px; font-weight: 700; letter-spacing: -.5px; }
.banner-inner p { font-size: 12px; margin: 0; opacity: .92; }
.banner-dots { position: absolute; bottom: 14px; right: 16px; z-index: 2; display: flex; gap: 5px; }
.banner-dots span { width: 6px; height: 6px; border-radius: var(--r-full); background: rgba(255,255,255,.5); transition: all .2s; }
.banner-dots span.active { width: 16px; background: #fff; }

/* 金刚区 */
.kingkong { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 6px; padding: 18px 4px; }
.kingkong .kk-item { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; color: var(--text); }
.kk-icon { width: 48px; height: 48px; border-radius: 16px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.kk-icon .icon { width: 24px; height: 24px; }
.kk-icon.has-img { background: transparent; overflow: hidden; }
.kk-icon.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 商品瀑布流 */
.goods-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.goods-card { background: #fff; border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 1px 8px rgba(0,0,0,.04); display: flex; flex-direction: column; }
.goods-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #F2F3F5; position: relative; }
.goods-img .corner-tag { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: var(--r-sm); }
.goods-body { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.goods-title { font-size: 13px; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.goods-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.goods-tags .tag { font-size: 10px; padding: 1px 6px; }
.goods-bottom { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 2px; }
.goods-price { font-size: 18px; font-weight: 700; color: var(--accent); }
.goods-price .yuan { font-size: 12px; }
.goods-sales { font-size: 11px; color: var(--text-3); }
.add-cart-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.add-cart-btn .icon { width: 18px; height: 18px; }
/* 首页为您甄选：瀑布流，图片按原始比例，卡片不跨列断裂 */
.goods-grid.waterfall { display: block; column-count: 2; column-gap: 12px; }
.goods-grid.waterfall .goods-card { break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid; margin-bottom: 12px; display: inline-block; width: 100%; }
.goods-grid.waterfall .goods-img { aspect-ratio: auto; height: auto; }
.goods-grid.waterfall .goods-img img { width: 100%; height: auto; object-fit: initial; }
.load-more { text-align: center; color: var(--text-3); font-size: 12px; padding: 20px 0; }

/* ==================== 分类页 ==================== */
.cat-search-wrap { position: sticky; top: calc(var(--nav-h) + env(safe-area-inset-top, 0px)); z-index: 30; background: var(--bg); padding: 8px 0 10px; }
.cat-layout { display: flex; gap: 10px; align-items: flex-start; }
.cat-nav { width: 84px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; position: sticky; top: calc(var(--nav-h) + 62px); }
.cat-nav button { padding: 14px 6px; border-radius: var(--r-md); font-size: 12px; color: var(--text-2); background: transparent; text-align: center; }
.cat-nav button.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.cat-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.cat-banner { height: 108px; border-radius: var(--r-lg); background-size: cover; background-position: center; position: relative; overflow: hidden; padding: 14px; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.cat-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.6), transparent); }
.cat-banner > * { position: relative; z-index: 1; }
.cat-banner .tag { align-self: flex-start; }
.cat-banner h3 { font-size: 16px; margin: 6px 0 2px; }
.cat-banner p { font-size: 11px; margin: 0; opacity: .9; }
.cat-panel { background: #fff; border-radius: var(--r-lg); padding: 14px; }
.cat-panel h3 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }
.subcat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 6px; }
.subcat { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; }
.subcat img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #F2F3F5; }
.brand-list { display: flex; flex-direction: column; gap: 8px; }
.brand-item { display: flex; align-items: center; gap: 10px; padding: 8px; background: var(--bg); border-radius: var(--r-md); }
.brand-item img { width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover; }
.brand-item b { font-size: 13px; display: block; }
.brand-item span { font-size: 11px; color: var(--text-3); }

/* ==================== 购物车 ==================== */
.cart-topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 14px; }
.cart-topbar h1 { font-size: 17px; margin: 0; font-weight: 600; }
.cart-topbar button { color: var(--text-2); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.free-ship-banner { background: var(--primary-light); border-radius: var(--r-lg); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; color: var(--primary); margin-bottom: 14px; }
.free-ship-banner .ship-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.free-ship-banner .ship-icon .icon { width: 18px; height: 18px; }
.free-ship-banner b { font-size: 13px; display: block; color: var(--text); }
.free-ship-banner small { font-size: 11px; color: var(--text-2); }
.cart-item { background: #fff; border-radius: var(--r-lg); padding: 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cart-item img { width: 80px; height: 80px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info .name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-info .spec { font-size: 11px; color: var(--text-3); margin: 3px 0 8px; }
.cart-item-info .rowbottom { display: flex; align-items: center; justify-content: space-between; }
.cart-item.invalid { opacity: .55; }
.cart-item.invalid img { filter: grayscale(1); }
.invalid-header { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; font-size: 13px; color: var(--text-2); }
.invalid-header button { color: var(--primary); font-size: 12px; }
.checkout-bar { position: fixed; left: 0; right: 0; bottom: var(--tab-h); z-index: 40; background: rgba(255,255,255,.95); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 10px var(--gutter); display: flex; align-items: center; justify-content: space-between; }
.checkout-bar .total { font-size: 12px; color: var(--text-2); }
.checkout-bar .total b { display: block; font-size: 18px; color: var(--accent); }
.checkout-bar .total small { font-size: 10px; color: var(--text-3); }

/* ==================== 我的 ==================== */
.profile-header { background: linear-gradient(135deg, var(--primary-light), #F4F7FF 60%, #fff); border-radius: var(--r-lg); padding: 18px; display: flex; align-items: center; justify-content: space-between; position: relative; overflow: hidden; }
.profile-header::before { content: ''; position: absolute; right: -30px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(22,104,227,.06); }
.profile-header .avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); flex-shrink: 0; }
/* 未登录占位头像：div 内嵌图标，需 flex 居中（img 头像不受影响） */
.profile-header div.avatar { display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; }
.profile-header div.avatar .icon { width: 30px; height: 30px; }
.profile-user { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.profile-user h2 { font-size: 18px; margin: 0; font-weight: 600; }
.profile-user p { font-size: 12px; color: var(--text-2); margin: 2px 0 0; }
.order-entry { display: grid; grid-template-columns: repeat(5, 1fr); padding: 18px 6px; }
.order-entry .item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; position: relative; }
.order-entry .item .icon { width: 26px; height: 26px; color: var(--primary); }
.order-entry .item .num { position: absolute; top: -4px; right: calc(50% - 21px); min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: var(--r-full); background: var(--danger); color: #fff; font-size: 10px; }
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 4px; padding: 16px 6px; }
.tool-item { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 11px; position: relative; }
.tool-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.tool-icon.primary { background: var(--primary-light); color: var(--primary); }
.tool-icon .icon { width: 20px; height: 20px; }
.tool-item .dot { position: absolute; top: 2px; right: calc(50% - 22px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
/* 消息列表未读红点：紧贴图标右上角 */
.msg-dot { position: absolute; top: 1px; right: 1px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff; }

/* ==================== 商品详情 ==================== */
.detail-gallery { width: 100%; aspect-ratio: 1; background: #fff; position: relative; overflow: hidden; }
.detail-gallery .slide { width: 100%; height: 100%; object-fit: cover; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.85); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; color: var(--text); box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.gallery-nav.prev { left: 12px; } .gallery-nav.next { right: 12px; }
.gallery-index { position: absolute; bottom: 14px; right: 14px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: var(--r-full); }
.detail-price-card { padding: 16px; background: #fff; border-radius: var(--r-lg); }
.detail-price-row { display: flex; align-items: baseline; justify-content: space-between; }
.detail-price { font-size: 26px; font-weight: 700; color: var(--accent); letter-spacing: -.5px; }
.detail-price .yuan { font-size: 15px; }
.detail-sales { font-size: 12px; color: var(--text-2); }
.detail-title { font-size: 16px; font-weight: 600; line-height: 1.4; margin: 10px 0 6px; }
.detail-subtitle { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.service-row { display: flex; align-items: center; justify-content: space-between; background: var(--primary-light); border-radius: var(--r-lg); padding: 12px; color: var(--primary); font-size: 12px; }
.service-row span { display: flex; align-items: center; gap: 5px; }
.service-row .icon { width: 16px; height: 16px; }
.service-row .sep { color: rgba(22,104,227,.3); }
.info-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; font-size: 13px; }
.info-row .label { color: var(--text-2); width: 44px; flex-shrink: 0; }
.info-row .value { flex: 1; }
.info-row .icon { width: 16px; height: 16px; color: var(--text-3); }
.param-list { background: var(--bg); border-radius: var(--r-md); padding: 4px 12px; }
.param-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.param-row:last-child { border-bottom: 0; }
.param-row span:first-child { color: var(--text-2); }
.review-card { background: var(--bg); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; }
.review-user { display: flex; align-items: center; justify-content: space-between; }
.review-user .u { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.review-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.review-stars { display: flex; color: var(--star); }
.review-stars .icon { width: 14px; height: 14px; }
.review-text { font-size: 13px; line-height: 1.5; margin: 10px 0; }
.review-imgs { display: flex; gap: 8px; }
.review-imgs img { width: 72px; height: 72px; border-radius: var(--r-sm); object-fit: cover; }
.detail-footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 12px; }
.mini-action { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--text-2); min-width: 40px; }
.mini-action .icon { width: 22px; height: 22px; }
.detail-footer .buy-btns { flex: 1; display: flex; gap: 8px; min-width: 0; }
.detail-footer .buy-btns .btn { flex: 1; border-radius: var(--r-full); height: 40px; padding: 0 6px; font-size: 13px; white-space: nowrap; }

/* SKU 弹窗选项 */
.spec-group { margin-bottom: 18px; }
.spec-group .label { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.spec-options { display: flex; flex-wrap: wrap; gap: 10px; }
.spec-option { padding: 8px 14px; border-radius: var(--r-md); background: var(--bg); font-size: 13px; border: 1px solid transparent; }
.spec-option.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); font-weight: 500; }
.spec-option.disabled { color: #C9CDD4; background: #F7F8FA; text-decoration: line-through; }

/* ==================== 订单 / 通用列表 ==================== */
.status-tabs { display: flex; gap: 20px; overflow-x: auto; padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.status-tabs button { font-size: 14px; color: var(--text-2); white-space: nowrap; padding: 4px 0; position: relative; }
.status-tabs button.active { color: var(--primary); font-weight: 600; }
.status-tabs button.active::after { content: ''; position: absolute; bottom: -13px; left: 50%; transform: translateX(-50%); width: 20px; height: 3px; border-radius: 2px; background: var(--primary); }
.order-card { background: #fff; border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; }
.order-card .head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.order-card .head .status { font-size: 13px; font-weight: 600; }
.status-waitpay { color: var(--accent); } .status-shipping { color: var(--primary); }
.status-done { color: var(--text-3); } .status-after { color: var(--danger); }
.order-product { display: flex; gap: 12px; padding: 12px 0; }
.order-product img { width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; }
.order-product .info { flex: 1; min-width: 0; }
.order-product .name { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.order-product .spec { font-size: 11px; color: var(--text-3); margin: 4px 0; }
.order-card .foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.order-card .amount { font-size: 12px; color: var(--text-2); }
.order-card .amount b { color: var(--text); font-size: 14px; }
.order-card .order-ops { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: nowrap; }
.order-card .order-ops .btn { flex: 0 0 auto; padding: 0 12px; }

/* 时间轴 */
.timeline { padding: 4px 0; }
.timeline-item { display: flex; gap: 12px; position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line); flex-shrink: 0; margin-top: 3px; z-index: 1; }
.timeline-item.done .timeline-dot { background: var(--primary); }
.timeline-item.current .timeline-dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); }
.timeline-body { flex: 1; }
.timeline-body .t { font-size: 13px; }
.timeline-body .time { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* 包裹 */
.package-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; }
.package-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; margin-bottom: 10px; }

/* 设置列表 */
.setting-group { background: #fff; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px; }
.setting-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.setting-item:last-child { border-bottom: 0; }
.setting-item .left { display: flex; align-items: center; gap: 10px; }
.setting-item .left .icon { width: 19px; height: 19px; color: var(--text-2); }
.setting-item .right { color: var(--text-3); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.setting-item .right .icon { width: 15px; height: 15px; }

/* 地址卡片 */
.address-card { background: #fff; border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; position: relative; }
.address-card .name { font-size: 15px; font-weight: 600; }
.address-card .phone { font-size: 13px; color: var(--text-2); margin-left: 10px; }
.address-card .addr { font-size: 13px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.address-card .tag-default { margin-left: 8px; }
.address-card .ops { display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.address-card .ops span { display: flex; align-items: center; gap: 4px; }
.address-card .ops .icon { width: 16px; height: 16px; }

/* 结算页 */
.checkout-address { background: #fff; border-radius: var(--r-lg); padding: 16px; display: flex; align-items: center; gap: 12px; }
.checkout-address .pin { color: var(--primary); }
.checkout-address .info { flex: 1; }
.checkout-address .info b { font-size: 15px; }
.checkout-address .info p { font-size: 12px; color: var(--text-2); margin: 4px 0 0; }
.fee-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.fee-row.total { font-size: 15px; font-weight: 600; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 8px; }
.fee-row.total b { color: var(--accent); font-size: 20px; }
.pay-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: #fff; border-top: 1px solid var(--line); padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.pay-bar .sum { font-size: 12px; color: var(--text-2); }
.pay-bar .sum b { display: block; font-size: 18px; color: var(--accent); }
.pay-method { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.pay-method .wx-icon { width: 36px; height: 36px; border-radius: var(--r-md); background: #07C160; color: #fff; display: flex; align-items: center; justify-content: center; }
.pay-method .wx-icon .icon { width: 22px; height: 22px; }

/* 支付结果 */
.result-page { display: flex; flex-direction: column; align-items: center; padding: 60px 20px 40px; text-align: center; }
.result-icon { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.result-icon.success { background: #E8FFEA; color: var(--success); }
.result-icon.fail { background: #FFECE8; color: var(--danger); }
.result-icon .icon { width: 44px; height: 44px; stroke-width: 2.5; }

/* 搜索页 */
.search-page-searchbar { display: flex; align-items: center; gap: 8px; padding: 6px 0 12px; }
.search-box { flex: 1; height: 38px; background: #fff; border-radius: var(--r-full); display: flex; align-items: center; padding: 0 12px; gap: 8px; }
.search-box .icon { width: 18px; height: 18px; color: var(--text-3); }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; }
.hot-words { display: flex; flex-wrap: wrap; gap: 10px; }
.hot-word { padding: 6px 14px; background: #fff; border-radius: var(--r-full); font-size: 13px; color: var(--text-2); }
.hot-word .rank { color: var(--accent); font-weight: 600; margin-right: 6px; }
.history-words { display: flex; flex-wrap: wrap; gap: 8px; }
.history-word { padding: 5px 12px; background: #fff; border-radius: var(--r-full); font-size: 12px; color: var(--text-2); }

/* 评价投稿 */
.rate-stars { display: flex; gap: 8px; }
.rate-stars .icon { width: 32px; height: 32px; color: var(--line); }
.rate-stars .icon.on { color: var(--star); }
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.upload-cell { aspect-ratio: 1; border: 1px dashed var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-3); font-size: 11px; gap: 4px; background: #fff; }
.upload-cell .icon { width: 24px; height: 24px; }
.upload-cell img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-md); }

/* 登录页 */
.login-page { min-height: 100vh; min-height: 100dvh; background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 45%); padding: 0 var(--gutter); }
.login-logo { text-align: center; padding: 60px 0 40px; }
.login-logo .logo-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(22,104,227,.25); }
.login-logo .logo-icon .icon { width: 40px; height: 40px; }
.login-logo h1 { font-size: 22px; margin: 16px 0 4px; }
.login-logo p { font-size: 13px; color: var(--text-2); margin: 0; }
.login-form { background: #fff; border-radius: var(--r-xl); padding: 24px 20px; box-shadow: 0 4px 20px rgba(0,0,0,.05); }
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; }
.code-btn { min-width: 110px; border-radius: var(--r-md); color: var(--primary); font-size: 13px; border: 1px solid var(--primary); background: #fff; }
.code-btn:disabled { color: var(--text-3); border-color: var(--line); }
.login-tip { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 20px; line-height: 1.6; }
.login-demo { background: #FFF9E8; border: 1px solid #FFE7A8; border-radius: var(--r-md); padding: 12px; font-size: 12px; color: #8A6D00; margin-bottom: 16px; line-height: 1.6; }

/* ===== 设置子页：开关 / 提示 / 头像 ===== */
.switch { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .18s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s; }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.setting-item .left small { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; font-weight: 400; }
.setting-hint { font-size: 12px; color: var(--text-3); line-height: 1.7; padding: 4px 6px; }
.profile-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.security-banner { display: flex; align-items: center; gap: 12px; background: var(--primary-light); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; color: var(--primary); }
.security-banner .icon { width: 30px; height: 30px; }
.security-banner b { display: block; font-size: 15px; }
.security-banner span { font-size: 12px; color: var(--text-2); }

/* ===== 关于玉鲜笙 ===== */
.about-wrap { padding-top: 4px; }
.about-hero { text-align: center; padding: 24px 0 20px; }
.about-hero img { width: 76px; height: 76px; border-radius: 18px; object-fit: cover; box-shadow: 0 4px 16px rgba(22,104,227,.18); }
.about-hero h1 { font-size: 20px; margin: 14px 0 6px; }
.about-hero p { font-size: 13px; color: var(--text-2); margin: 0; }
.about-ver { display: inline-block; margin-top: 10px; font-size: 11px; color: var(--primary); background: var(--primary-light); padding: 3px 10px; border-radius: 10px; }
.about-intro { background: #fff; border-radius: var(--r-lg); padding: 16px; font-size: 13px; color: var(--text-2); line-height: 1.8; }
.about-intro p { margin: 0 0 10px; }
.about-intro p:last-child { margin-bottom: 0; }
.about-promises { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.about-promise { background: #fff; border-radius: var(--r-lg); padding: 14px; text-align: center; }
.about-promise .icon { width: 26px; height: 26px; color: var(--primary); }
.about-promise b { display: block; font-size: 13px; margin: 6px 0 2px; }
.about-promise span { font-size: 11px; color: var(--text-3); }
.about-copy { text-align: center; font-size: 11px; color: var(--text-3); line-height: 1.8; margin-top: 24px; }

/* ===== 协议文档页 ===== */
.doc-wrap { padding-top: 4px; }
.doc-head { background: #fff; border-radius: var(--r-lg); padding: 18px 16px; margin-bottom: 12px; }
.doc-title-row { display: flex; align-items: center; gap: 10px; }
.doc-title-row .icon { width: 24px; height: 24px; color: var(--primary); }
.doc-title-row h1 { font-size: 18px; margin: 0; }
.doc-meta { font-size: 12px; color: var(--text-3); margin: 10px 0 12px; }
.doc-versions { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-version { font-size: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--r-full); color: var(--text-2); background: #fff; }
.doc-version.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.doc-body { background: #fff; border-radius: var(--r-lg); padding: 18px 16px; }
.doc-h { font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
.doc-h:first-child { margin-top: 0; }
.doc-p { font-size: 13px; line-height: 1.85; color: var(--text-2); margin: 0; text-align: justify; }
.doc-foot { text-align: center; font-size: 11px; color: var(--text-3); margin: 20px 0; }

/* 响应式：大屏居中模拟手机 */
@media (min-width: 500px) {
  body { background: #E9EBF0; }
  #app { max-width: 430px; margin: 0 auto; background: var(--bg); min-height: 100vh; box-shadow: 0 0 30px rgba(0,0,0,.08); position: relative; }
  .navbar, .tabbar, .toast, .checkout-bar, .detail-footer, .pay-bar { max-width: 430px; left: 50%; transform: translateX(-50%); }
  .toast { transform: translate(-50%, -50%); }
  .toast.show { transform: translate(-50%, -50%); }
}
