/* ================================================================
 * 素月珠宝 · 高端珠宝设计系统
 * 设计哲学：克制即奢华 — 以留白塑造空间感，以排版建立层次，以细节传递品质
 * ================================================================ */
:root {
  /* ---- 品牌色彩（OKLCH 感知均匀色彩空间） ---- */
  --brand: oklch(54% 0.115 80);
  --brand-2: oklch(72% 0.105 88);
  --brand-hover: oklch(47% 0.115 78);
  --brand-grad: linear-gradient(135deg, oklch(78% 0.11 90), oklch(56% 0.12 76));
  --brand-soft: oklch(94% 0.035 85);
  --brand-tint: oklch(96% 0.022 85);
  --gold-line: oklch(84% 0.07 88);

  /* 语义色 */
  --green: oklch(55% 0.13 150);
  --blue: oklch(55% 0.12 240);
  --success: oklch(55% 0.13 150);
  --success-soft: oklch(95% 0.04 150);
  --warning: oklch(70% 0.14 75);
  --warning-soft: oklch(96% 0.04 75);
  --error: oklch(55% 0.18 25);
  --error-soft: oklch(95% 0.04 25);
  --info: oklch(55% 0.12 240);
  --info-soft: oklch(95% 0.04 240);

  /* 中性色：暖灰调（微陶土色调，与品牌色潜意识关联） */
  --ink: oklch(24% 0.006 70);
  --ink-2: oklch(43% 0.006 70);
  --ink-3: oklch(62% 0.005 70);
  --ink-4: oklch(78% 0.004 70);
  --bg: oklch(97.5% 0.01 82);
  --bg-2: oklch(95% 0.012 84);
  --card: oklch(99.4% 0.006 82);
  --line: oklch(91% 0.008 82);

  /* 排版 */
  --font-display: 'Cormorant Garamond', 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Menlo', 'Consolas', monospace;

  /* 模块化字号（完美四度 1.333） */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.333rem;
  --text-xl: 1.777rem;
  --text-2xl: 2.369rem;

  /* 间距（8pt 基准） */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* 圆角 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* 阴影（极轻、有方向感） */
  --shadow-xs: 0 1px 2px oklch(20% 0.01 35 / 0.04);
  --shadow-sm: 0 2px 8px oklch(20% 0.01 35 / 0.05);
  --shadow: 0 2px 8px oklch(20% 0.01 35 / 0.05);
  --shadow-md: 0 4px 16px oklch(20% 0.01 35 / 0.06);
  --shadow-lg: 0 12px 32px oklch(20% 0.01 35 / 0.08);
  --shadow-brand: 0 8px 24px oklch(58% 0.14 35 / 0.2);

  /* 过渡 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur: 280ms;
  --dur-slow: 450ms;

  --maxw: 1200px;
  --header-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  background-image: radial-gradient(130% 55% at 50% -8%, oklch(97% 0.03 85), transparent 60%);
  background-repeat: no-repeat;
  font-family: var(--font-body); font-size: var(--text-base); line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; -webkit-touch-callout: none; }
button { font-family: inherit; -webkit-appearance: none; appearance: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font-family: inherit; font-size: 16px; -webkit-appearance: none; appearance: none; }
input:focus, textarea:focus, select:focus { outline: none; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-4); }
.hide { display: none !important; }

/* ---------- 顶部导航（常驻顶栏第一层） ----------
   滚动稳定性三要点：
   1) 高度 = 内容高度 + 安全区，安全区只把栏“撑高”，不挤占内容（否则 iPhone 上 logo 会被裁切）；
   2) 纯色不透明底 + 独立合成层：滚动时不会被内容重绘/半透明模糊带着抖；
   3) 与下方筛选栏共用同一套 top 计算，两栏严丝合缝，中间不会裂出缝让内容穿过去。 */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: oklch(99% 0.004 82);
  border-bottom: 1px solid var(--gold-line);
  box-shadow: 0 1px 0 oklch(100% 0 0 / 0.7) inset;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.topbar-inner { max-width: var(--maxw); height: 100%; margin: 0 auto; padding: 0 var(--space-4); display: flex; align-items: center; gap: var(--space-3); }
.logo { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; white-space: nowrap; letter-spacing: 0.04em; color: var(--ink); }
.logo-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 800; font-family: var(--font-display);
  box-shadow: 0 2px 10px oklch(60% 0.12 78 / 0.4);
}
.logo-img { height: 32px; max-width: 150px; width: auto; object-fit: contain; border-radius: 6px; display: none; flex-shrink: 0; }
.qr-block img { max-width: 200px; max-height: 130px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 4px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: var(--space-2);
  background: var(--bg-2); border-radius: var(--radius-full);
  padding: 8px 16px; max-width: 360px;
  transition: all var(--dur-fast) var(--ease);
}
.search-box:focus-within { background: var(--card); box-shadow: var(--shadow-xs), 0 0 0 1.5px var(--brand); }
.search-box input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 16px; }
.search-box .ico, .search-box svg { color: var(--ink-3); width: 16px; height: 16px; }
.nav-links { display: none; gap: var(--space-4); margin-left: auto; }
.nav-links a { position: relative; padding: var(--space-2) 2px; font-size: var(--text-sm); font-weight: 500; color: var(--ink-3); transition: all var(--dur-fast) var(--ease); }
.nav-links a.on { color: var(--brand); font-weight: 700; }
.nav-links a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--brand); }
.nav-links a:hover { color: var(--brand); }
.nav-links a.logged { color: var(--brand); }
.nav-links a svg { vertical-align: -2px; margin-right: 3px; }
@media (min-width: 860px) { .nav-links { display: flex; } .search-box { max-width: 300px; }}

/* ---------- 公告条 ---------- */
.notice-bar { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); font-size: var(--text-xs); color: var(--ink-2); overflow: hidden; }
.notice-bar .tag { flex-shrink: 0; background: var(--brand-grad); color: #fff; font-weight: 700; border-radius: var(--radius-full); padding: 2px var(--space-3); font-size: 11px; letter-spacing: 0.06em; }
.notice-bar .txt { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.notice-bar .txt .marquee { display: inline-block; padding-left: 100%; animation: marquee-left 18s linear infinite; }
.notice-bar .txt .marquee:hover { animation-play-state: paused; }
@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(-100%); }}

/* ---------- 底部导航（手机） ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex; background: oklch(99% 0.004 82 / 0.94); backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--gold-line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-2) 0; min-height: 48px; font-size: 12px; font-weight: 500; color: var(--ink-3); transition: color var(--dur-fast) var(--ease); }
.tabbar a .ti { font-size: 21px; line-height: 1; }
.tabbar a.on { color: var(--brand); }
.tabbar a svg { width: 24px; height: 24px; display: block; }
.tabbar a.logged .ti { position: relative; }
.tabbar a.logged .ti::after { content: ''; position: absolute; top: -2px; right: -6px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); border: 1.5px solid var(--card); }
@media (min-width: 860px) { .tabbar { display: none; }}
@media (max-width: 859px) { body { padding-bottom: 62px; } body.has-buybar { padding-bottom: 76px; }}

/* ---------- 轮播图 ---------- */
.swiper { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); margin-top: var(--space-3); }
.swiper-track { display: flex; transition: transform var(--dur-slow) var(--ease); touch-action: pan-y; }
.swiper-item { flex: 0 0 100%; }
.swiper-item img { width: 100%; aspect-ratio: 2.45 / 1; object-fit: cover; }
.swiper-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
/* 圆点：半透明白 + 深色描边，深浅底图上都能看清（占位图是浅底，纯白点会消失） */
.swiper-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(100% 0 0 / 0.7); box-shadow: 0 0 0 1px oklch(0% 0 0 / 0.18);
  transition: all var(--dur) var(--ease);
}
.swiper-dots i.on { width: 20px; border-radius: 999px; background: var(--brand); }

/* ---------- 区块标题 ---------- */
.section { margin-top: var(--space-6); }
/* 区块标题：整块居中（含底部金色短线），「清除筛选」绝对定位在右侧，不参与居中计算 */
.sec-head {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-bottom: var(--space-4); padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line); position: relative;
}
.sec-head::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: -1px; width: 38px; height: 2px; border-radius: 2px; background: var(--brand-grad); }
.sec-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: var(--space-2); letter-spacing: 0.06em; }
.sec-title .accent { color: var(--brand); }
.sec-sub { font-size: var(--text-xs); color: var(--ink-3); margin-top: 2px; letter-spacing: 0.04em; }
.sec-more { position: absolute; right: 0; bottom: var(--space-3); color: var(--ink-3); font-size: var(--text-xs); display: flex; align-items: center; gap: 2px; transition: color var(--dur-fast) var(--ease); letter-spacing: 0.04em; }
.sec-more:hover { color: var(--brand); }

/* ---------- 分类宫格 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); background: var(--card); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-2); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.cat-grid .cat { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-2); border-radius: var(--radius); transition: transform var(--dur-fast) var(--ease); cursor: pointer; }
.cat-grid .cat:active { transform: scale(0.94); }
.cat-ico { width: 54px; height: 54px; border-radius: 50%; background: var(--brand-soft); font-size: 26px; display: flex; align-items: center; justify-content: center; transition: all var(--dur) var(--ease); box-shadow: inset 0 0 0 1px oklch(88% 0.06 88); }
.cat-grid .cat:hover .cat-ico { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px oklch(60% 0.12 78 / 0.4); transform: translateY(-2px); }
.cat-grid .cat span { font-size: var(--text-xs); font-weight: 500; color: var(--ink-2); letter-spacing: 0.04em; }
@media (min-width: 860px) { .cat-grid { grid-template-columns: repeat(6, 1fr); }}

/* ---------- 商品网格：编辑式通栏栅格（细线分隔，无卡片阴影） ---------- */
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (min-width: 640px) { .goods-grid { grid-template-columns: repeat(3, 1fr); }}
@media (min-width: 980px) { .goods-grid { grid-template-columns: repeat(4, 1fr); }}
.goods-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 639px) { .goods-grid.cols-3 { grid-template-columns: 1fr 1fr; }}

.goods-card {
  background: #fff; border: 0; border-radius: 0; box-shadow: none;
  display: block; cursor: pointer; position: relative;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background var(--dur-fast) var(--ease);
}
.goods-card:active { background: var(--bg-2); }
/* 每行最后一个去掉右侧分隔线，避免外缘多一道线 */
.goods-grid > .goods-card:nth-child(2n) { border-right: 0; }
@media (min-width: 640px) {
  .goods-grid:not(.cols-3) > .goods-card:nth-child(2n) { border-right: 1px solid var(--line); }
  .goods-grid:not(.cols-3) > .goods-card:nth-child(3n) { border-right: 0; }}
@media (min-width: 980px) {
  .goods-grid:not(.cols-3) > .goods-card:nth-child(3n) { border-right: 1px solid var(--line); }
  .goods-grid:not(.cols-3) > .goods-card:nth-child(4n) { border-right: 0; }}

/* 图片区：白底、完整显示（不裁切），多图可左右滑动 */
.goods-card .pic { position: relative; overflow: hidden; background: #fff; }
.pic-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pic-track::-webkit-scrollbar { display: none; }
.pic-track img {
  flex: 0 0 100%; width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff;
  scroll-snap-align: start; padding: 6%;
  transition: transform var(--dur-slow) var(--ease-out-expo);
}
@media (hover: hover) { .goods-card:hover .pic-track img { transform: scale(1.03); }}

/* 图片轮播圆点：固定占位，保证单图/多图卡片的文案行对齐 */
.pic-dots { display: flex; justify-content: center; align-items: center; gap: 5px; height: 15px; margin-top: 10px; }
.pic-dots i { width: 5px; height: 5px; border-radius: 50%; background: oklch(82% 0.004 70); transition: background var(--dur-fast) var(--ease); }
.pic-dots i.on { background: var(--ink); }

/* 文案区：居中、衬线体（英文系列名 + 中文品名） */
.goods-card .info { padding: 10px 14px 20px; text-align: center; }
.g-name { display: flex; flex-direction: column; gap: 3px; }
.g-en {
  font-family: var(--font-display); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-2); line-height: 1.5; font-weight: 500;
}
.g-cn {
  font-family: var(--font-display); font-size: 14px; font-weight: 600; line-height: 1.5;
  color: var(--ink); letter-spacing: 0.04em;
  /* 固定两行高度，保证同一行卡片的价格基线对齐 */
  min-height: 3em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.g-price {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  margin-top: 9px; font-family: var(--font-display); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.g-price .cur { font-size: 11px; font-weight: 500; }
.g-price .num { font-size: 16px; font-weight: 600; letter-spacing: 0.03em; }
.g-price .dec { font-size: 11px; font-weight: 500; }

/* 非首页场景（后台预览等）沿用旧卡片样式 */
.price { font-family: var(--font-display); color: var(--brand); font-weight: 700; font-size: clamp(16px, 4vw, 20px); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.price::before { content: '¥'; font-size: var(--text-xs); font-weight: 600; margin-right: 1px; }
.goods-card .price-row { display: flex; align-items: baseline; gap: var(--space-2); margin-top: var(--space-2); }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: var(--radius-full); padding: 0.7rem 1.4rem;
  font-size: var(--text-sm); font-weight: 600; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  line-height: 1.4; font-family: var(--font-body);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-brand); border-radius: var(--radius); min-height: 44px; font-weight: 700; }
.btn-primary:hover { filter: brightness(1.04); }
.btn-ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); border-radius: var(--radius); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: #fff; color: var(--error); border: 1px solid var(--error); border-radius: var(--radius-sm); }
.btn-danger:hover { background: var(--error-soft); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: var(--text-xs); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 16px; height: 16px; vertical-align: -2px; margin-right: 3px; }
.btn-sm svg { width: 14px; height: 14px; }

/* ---------- 商品详情 ---------- */
.detail-swiper .swiper-item img { aspect-ratio: 1; }
@media (min-width: 860px) {
  .detail-layout { display: grid; grid-template-columns: 500px 1fr; gap: var(--space-6); align-items: start; margin-top: var(--space-4); }
  .detail-layout .swiper { margin-top: 0; }
  .detail-layout .price-panel { margin-top: 0; }}
.price-panel {
  background: var(--card); padding: var(--space-4); border-radius: var(--radius-lg);
  border: 1px solid var(--line); margin-top: -1.5rem; position: relative; z-index: 5;
  box-shadow: var(--shadow-md);
}
.price-panel .p-row { display: flex; align-items: baseline; gap: var(--space-2); }
.price-panel .price { font-size: var(--text-2xl); }
.price-panel .name { margin: var(--space-2) 0 0; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; line-height: 1.3; }
.price-panel .name-en { font-family: var(--font-display); font-size: 11.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); margin-top: var(--space-2); }
.price-panel .meta { display: flex; gap: var(--space-3); color: var(--ink-3); font-size: var(--text-xs); margin-top: var(--space-2); flex-wrap: wrap; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: var(--space-4); margin-top: var(--space-3); box-shadow: var(--shadow-sm); }
.card h4 { margin: 0 0 var(--space-2); font-size: var(--text-sm); font-weight: 600; }
.intro-text { white-space: pre-wrap; color: var(--ink-2); font-size: var(--text-sm); line-height: 1.7; }
.detail-imgs img { border-radius: var(--radius); margin-top: var(--space-3); }

/* ---------- 商品图点击放大查看原图 ---------- */
.zoom-badge {
  position: absolute; right: 10px; top: 10px; z-index: 3;
  display: inline-flex; align-items: center; gap: 4px;
  background: oklch(18% 0.01 60 / 0.5); color: #fff;
  border: 1px solid oklch(75% 0.09 82 / 0.45); border-radius: 999px;
  padding: 4px 10px; font-size: 11.5px; letter-spacing: 0.02em;
  backdrop-filter: blur(6px); pointer-events: none;
}
.zoom-badge svg { width: 13px; height: 13px; }
.img-viewer {
  position: fixed; inset: 0; z-index: 1000; display: none; flex-direction: column;
  background: oklch(12% 0.012 60 / 0.97); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.22s var(--ease);
  padding-top: env(safe-area-inset-top);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.img-viewer.show { display: flex; opacity: 1; }
.iv-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; flex-shrink: 0; }
.iv-count { font-family: var(--font-display); font-size: 14px; letter-spacing: 0.1em; color: oklch(86% 0.07 82); }
.iv-close {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  border: 1px solid oklch(75% 0.09 82 / 0.45); background: oklch(100% 0 0 / 0.08);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; -webkit-tap-highlight-color: transparent;
}
.iv-close:active { transform: scale(0.94); }
.iv-stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.iv-img { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center center; will-change: transform; transition: transform 0.2s var(--ease); -webkit-user-drag: none; }
.iv-img.dragging { transition: none; }
.iv-hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  color: oklch(100% 0 0 / 0.6); font-size: 11.5px; letter-spacing: 0.04em;
  background: oklch(0% 0 0 / 0.35); padding: 4px 12px; border-radius: 999px; pointer-events: none;
}
.iv-thumbs { display: flex; gap: 8px; justify-content: flex-start; padding: 10px 16px; overflow-x: auto; flex-shrink: 0; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.iv-thumb {
  width: 54px; height: 54px; flex: 0 0 auto; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 1.5px solid transparent; opacity: 0.5; background: #fff; transition: all 0.18s var(--ease);
}
.iv-thumb.on { opacity: 1; border-color: var(--brand); box-shadow: 0 0 0 2px oklch(75% 0.09 82 / 0.25); }
.iv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.iv-foot { text-align: center; color: oklch(100% 0 0 / 0.5); font-size: 11.5px; padding: 0 16px calc(12px + env(safe-area-inset-bottom)); flex-shrink: 0; }

/* ---------- 商品详情底部「联系客服」导航栏（iOS 安全区适配） ---------- */
.p-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex; gap: 10px; background: oklch(99% 0.004 82 / 0.96);
  backdrop-filter: blur(20px) saturate(1.5); border-top: 1px solid var(--gold-line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
.p-bar .p-contact {
  flex: 1; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: 0; border-radius: var(--radius); background: var(--brand-grad); color: #fff;
  font-size: var(--text-base); font-weight: 700; box-shadow: var(--shadow-brand);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.p-bar .p-contact svg { width: 22px; height: 22px; flex-shrink: 0; }
.p-bar .p-contact:active { transform: scale(0.98); }
.p-bar .p-contact__txt { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.25; text-align: center; }
.p-bar .p-contact__title { font-size: var(--text-base); font-weight: 700; letter-spacing: 0.06em; }
.p-bar .p-contact__hint { font-size: 11px; font-weight: 400; opacity: 0.85; margin-top: 2px; letter-spacing: 0.03em; }
body.has-pbar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (min-width: 860px) {
  body.has-pbar { padding-bottom: 0; }
  .p-bar { position: sticky; bottom: 0; }}
@media (min-width: 860px) {}

/* ---------- 表单 ---------- */
.form-item { margin-bottom: var(--space-4); }
.form-item label { display: block; font-size: var(--text-xs); font-weight: 600; margin-bottom: var(--space-2); color: var(--ink-2); letter-spacing: 0.03em; }
.form-item label i { color: var(--brand); font-style: normal; margin-right: 2px; }
.input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem 0.8rem; outline: 0; transition: all var(--dur-fast) var(--ease); background: var(--bg-2); font-size: 16px; color: var(--ink); }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder { color: var(--ink-3); }
textarea.input { resize: vertical; min-height: 74px; }
.err-tip { color: var(--error); font-size: var(--text-xs); margin-top: var(--space-1); }

/* 登录 / 注册切换为下划线标签（仅用于账号页，不影响支付页付款方式） */
.auth-tabs { border-bottom: 1px solid var(--line); gap: 24px; margin: 0 0 18px !important; }
.qr-modal { text-align: center; max-width: 320px; }
.qr-modal h3 { margin-bottom: 14px; }
.qr-modal .qr-img { display: block; margin: 0 auto; width: 200px; max-width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--line); background: #fff; padding: 10px; box-shadow: var(--shadow-sm); }

/* ---------- Toast / Loading / Empty ---------- */
#toast { position: fixed; top: 44%; left: 50%; transform: translate(-50%, -50%) scale(0.92); display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: linear-gradient(135deg, rgba(42,34,25,0.94), rgba(26,21,15,0.94)); color: #f6efe2; padding: 12px 20px; border-radius: 999px; border: 1px solid rgba(212,175,110,0.55); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.02em; z-index: 999; opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); max-width: 82vw; text-align: center; box-shadow: 0 10px 32px rgba(0,0,0,0.38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
#toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.page-loading { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: var(--space-3); padding: 70px 0; color: var(--ink-3); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); }}
.empty { text-align: center; padding: 56px var(--space-6); color: var(--ink-3); }
.empty .e-ico { font-size: 46px; margin-bottom: var(--space-3); }
.empty p { margin: var(--space-1) 0 var(--space-4); font-size: var(--text-sm); }
.fade-in { animation: fadeIn var(--dur) var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; }}

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: oklch(15% 0.01 35 / 0.5); z-index: 300; display: flex; align-items: center; justify-content: center; padding: var(--space-6); opacity: 0; pointer-events: none; transition: opacity var(--dur-fast); }
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal { background: var(--card); border-radius: var(--radius-xl); padding: var(--space-6); width: 100%; max-width: 420px; transform: translateY(14px); transition: transform var(--dur) var(--ease-out-expo); }
.modal-mask.show .modal { transform: none; }
.modal h3 { margin: 0 0 var(--space-4); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.footer { text-align: center; color: var(--ink-3); font-size: var(--text-xs); padding: var(--space-8) 0 var(--space-6); position: relative; letter-spacing: 0.04em; }
.footer::before { content: ''; display: block; width: 44px; height: 1px; background: var(--gold-line); margin: 0 auto var(--space-4); }

/* ---------- 返回按钮 ---------- */
.back-btn { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bg-2); color: var(--ink); font-size: 0; line-height: 1; flex-shrink: 0; text-decoration: none; transition: all var(--dur-fast) var(--ease); cursor: pointer; }
.back-btn:active { background: var(--brand-soft); color: var(--brand); }
.back-btn:hover { background: var(--brand-soft); color: var(--brand); }
.back-btn svg { width: 18px; height: 18px; display: block; }

/* ---------- 管理后台样式（保留兼容，仅微调） ---------- */
.admin-layout { display: flex; min-height: 100dvh; }
.admin-sidebar { width: 220px; background: var(--ink); color: #fff; padding: var(--space-6) 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-main { flex: 1; padding: var(--space-6); }
.admin-sidebar h2 { font-family: var(--font-display); padding: 0 var(--space-6); margin-bottom: var(--space-6); font-size: var(--text-lg); }
.admin-sidebar a { display: block; padding: var(--space-3) var(--space-6); color: oklch(70% 0.005 35); font-size: var(--text-sm); transition: all var(--dur-fast) var(--ease); }
.admin-sidebar a.on, .admin-sidebar a:hover { background: oklch(28% 0.01 35); color: #fff; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.admin-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); }
.admin-stat .label { font-size: var(--text-xs); color: var(--ink-3); }
.admin-stat .value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; margin-top: var(--space-2); font-variant-numeric: tabular-nums; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
.admin-table th, .admin-table td { padding: var(--space-3); text-align: left; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.admin-table th { background: var(--bg-2); font-weight: 600; color: var(--ink-2); font-size: var(--text-xs); }
@media (max-width: 859px) { .admin-layout { flex-direction: column; } .admin-sidebar { width: 100%; height: auto; position: relative; }}

/* ============================================================
 * 移动端适配（≤859px 手机竖屏，覆盖主流 375–428px）
 * 原则：双列高效 · 拇指友好 · 视觉舒适
 * ============================================================ */

/* ---------- 顶部筛选导航（常驻顶栏第二层）：全部 / 价格 / 新品 / 筛选 ----------
   它紧贴导航栏下沿常驻，滚动到任何位置都不位移；
   top 里的安全区算法必须与 .topbar 的高度算法保持一致，否则两栏之间会露出一条缝。 */
.filter-wrap {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 90;
  background: var(--bg);
  transform: translateZ(0);
  backface-visibility: hidden;
}
.filter-tabs {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.filter-tabs .ft {
  position: relative; flex: 1 1 0; min-width: 0; min-height: 50px;
  border: 0; background: transparent; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-family: inherit; font-size: var(--text-sm); font-weight: 500;
  color: var(--ink); letter-spacing: 0.08em; cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.filter-tabs .ft + .ft::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 18px; background: var(--line);
}
.filter-tabs .ft.on { font-weight: 700; }
.filter-tabs .ft:active { opacity: 0.55; }
.filter-tabs .ft .ft-sort svg { display: block; width: 9px; height: 13px; }
.filter-tabs .ft .ft-sort .p-up, .filter-tabs .ft .ft-sort .p-dn { fill: var(--ink-3); transition: fill var(--dur-fast) var(--ease); }
.filter-tabs .ft .ft-chev svg { display: block; width: 12px; height: 12px; color: var(--ink-3); transition: transform var(--dur) var(--ease), color var(--dur-fast) var(--ease); }
.filter-tabs .ft[data-state="asc"] .p-up, .filter-tabs .ft[data-state="desc"] .p-dn { fill: var(--ink); }
.filter-tabs .ft[data-state="asc"] .p-dn, .filter-tabs .ft[data-state="desc"] .p-up { fill: oklch(85% 0.004 70); }
.filter-tabs .ft.open .ft-chev svg { transform: rotate(180deg); color: var(--ink); }

/* 价格区间面板：从筛选栏下方展开（非弹窗），下方内容压暗 */
.filter-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--card); overflow: hidden; max-height: 0;
  transition: max-height var(--dur-slow) var(--ease-out-expo);
  box-shadow: 0 14px 30px oklch(20% 0.01 35 / 0.1);
}
.filter-panel.open { max-height: 480px; }
.fp-inner { max-width: 620px; margin: 0 auto; padding: 1.4rem 1rem 1.5rem; }
.fp-title { font-size: var(--text-sm); color: var(--ink); letter-spacing: 0.06em; margin-bottom: 1.1rem; }
.fp-inputs { display: flex; align-items: center; gap: var(--space-3); margin-bottom: 1.5rem; }
.fp-input {
  flex: 1 1 0; min-width: 0; height: 34px; padding: 0; border: 0; border-bottom: 1px solid transparent;
  background: transparent; text-align: center; color: var(--ink);
  font-size: var(--text-base); font-weight: 500; letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums; transition: border-color var(--dur-fast) var(--ease);
}
.fp-input::placeholder { color: var(--ink-3); font-weight: 400; letter-spacing: 0.08em; }
.fp-input:focus { border-bottom-color: var(--ink); }
.fp-input::-webkit-outer-spin-button, .fp-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fp-input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.fp-dash { flex: 0 0 44px; height: 1px; background: var(--ink-4); }

.range-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1.6rem; }
.range-chips .chip {
  flex: 0 0 auto; min-height: 40px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-2); color: var(--ink); border: 1px solid transparent;
  border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer;
  letter-spacing: 0.06em; font-variant-numeric: tabular-nums;
  transition: all var(--dur-fast) var(--ease);
}
.range-chips .chip:active { transform: scale(0.96); }
.range-chips .chip.on { background: var(--ink); color: #fff; }

.fp-actions { display: flex; }
.fp-actions .fp-btn {
  flex: 1 1 0; min-height: 50px; border-radius: 0; border: 1px solid var(--ink);
  font-family: inherit; font-size: var(--text-base); font-weight: 500;
  letter-spacing: 0.16em; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.fp-actions .fp-reset { background: var(--card); color: var(--ink); }
.fp-actions .fp-reset:active { background: var(--bg-2); }
.fp-actions .fp-confirm {
  background: var(--ink); color: #fff; border-color: var(--ink); margin-left: -1px;
  /* 右上角斜切，呼应珠宝切面的品牌细节 */
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.fp-actions .fp-confirm:active { background: oklch(34% 0.006 70); }

.filter-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: oklch(14% 0.01 60 / 0.5);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease);
}
.filter-scrim.show { opacity: 1; pointer-events: auto; }

@media (min-width: 860px) {
  .filter-wrap { padding-top: var(--space-2); }
  .filter-tabs { border-top: 0; }
  .filter-tabs .ft { flex: 0 1 160px; }
  .filter-panel { max-width: 620px; margin: 0 auto; }
}

/* ---------- 手机竖屏专属微调 ---------- */
@media (max-width: 859px) {
  /* 区块间距收紧，减少留白浪费，一屏多看商品 */
  .section { margin-top: var(--space-4); }
  .sec-head { margin-bottom: var(--space-3); }

  /* 商品网格：双列通栏栅格，细线分隔（贴近参考稿的编辑式排版） */
  .goods-grid { gap: 0; }
  .goods-card .info { padding: 8px 10px 18px; }
  .g-en { font-size: 10px; letter-spacing: 0.15em; }
  .g-cn { font-size: 13px; line-height: 1.45; }
  .g-price .num { font-size: 15px; }
  .pic-track img { padding: 5%; }

  /* 分类宫格更紧凑 */
  .cat-grid { gap: 4px; padding: 14px 6px; }
  .cat-ico { width: 46px; height: 46px; font-size: 22px; }
  .cat-grid .cat { padding: 8px 2px; }

  /* 主操作按钮 ≥48px 拇指友好点击区 */
  .btn:not(.btn-sm) { min-height: 48px; }
  .modal .btn { min-height: 48px; }

  /* 详情页价格面板更贴底边 */
  .price-panel { margin-top: -1rem; padding: var(--space-4) var(--space-4) var(--space-3); }}

/* ---------- 超小屏（≤360px）兜底 ---------- */
@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .goods-card .info { padding: 8px 8px 16px; }
  .g-cn { font-size: 12.5px; }
  .filter-tabs .ft { font-size: 13px; letter-spacing: 0.04em; }
}
