/* ============================================================
   国瓷臻选 · 用户端 H5 样式
   设计基调：深邃青花蓝 + 鎏金 + 移动端优先
   ============================================================ */

:root {
  /* v2 象牙白主题：象牙白底 + 天空蓝 + 海青蓝 */
  --bg-0: #faf3ec;
  --bg-1: #fdf8f2;
  --bg-2: #fffcf7;
  --bg-3: #eaf4fb;
  --bg-4: #bfe0f2;

  --gold-1: #279aae;
  --gold-2: #2b8fcb;
  --gold-3: #1c4e8a;
  --gold-dim: rgba(39, 154, 174, 0.10);

  --text-1: #1c4e8a;
  --text-2: #3e8fbf;
  --text-3: #4fa8d8;

  --green: #2f8a6e;
  --red: #b4453c;
  --blue: #2b8fcb;
  --orange: #b4782a;
  --purple: #6c7bb5;

  --line: #e9e1d5;
  --line-soft: #f0e9de;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(28, 78, 138, 0.08);
  --glow-gold: 0 0 0 3px rgba(39, 154, 174, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(800px 400px at 50% -5%, rgba(79, 142, 247, 0.1), transparent 60%),
    radial-gradient(600px 400px at 50% 110%, rgba(201, 169, 110, 0.05), transparent 60%),
    var(--bg-0);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
img { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 0; height: 0; }

/* ============================================================
   布局：移动端容器（桌面居中限宽）
   ============================================================ */
.phone-wrap {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-1);
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

/* 页面内容区 */
.page {
  min-height: 100vh;
  padding-bottom: 70px; /* 给底部导航留位 */
}
.page.no-tab { padding-bottom: 30px; }

/* ============================================================
   顶部导航
   ============================================================ */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center;
  padding: 14px 16px;
  background: var(--bg-2);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(28, 78, 138, 0.05);
}
.top-bar .back-btn {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--bg-3);
  border: 1px solid var(--bg-4);
  color: var(--gold-2);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.top-bar .title {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px; font-weight: 600; letter-spacing: 1px;
  color: var(--gold-2);
  white-space: nowrap;
  pointer-events: none;
}
/* 右侧插槽按内容自适应宽度，按钮不再被固定 34px 挤出屏幕 */
.top-bar .right-slot {
  margin-left: auto;
  display: flex; align-items: center; justify-content: flex-end;
  flex-shrink: 0;
}

/* ============================================================
   底部导航
   ============================================================ */
.tab-bar {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex;
  background: var(--bg-2);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 100;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
  box-shadow: 0 -2px 14px rgba(28, 78, 138, 0.07);
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 9px 0 8px;
  color: var(--text-3);
  font-size: 10.5px;
  gap: 3px;
  transition: color 0.2s;
}
.tab-item .tab-icon { font-size: 20px; line-height: 1; }
.tab-item.active { color: var(--gold-2); }

/* ============================================================
   首页
   ============================================================ */
.home-header {
  padding: 18px 16px 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.home-logo { font-size: 19px; font-weight: 700; letter-spacing: 2px; color: var(--gold-2); }
.home-logo small { display: block; font-size: 9.5px; color: var(--text-3); letter-spacing: 3px; font-weight: 400; margin-top: 2px; }
.home-user {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-4), var(--bg-3));
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--gold-2);
}

/* Banner */
.banner {
  margin: 14px 16px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  height: 170px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(12, 26, 51, 0.85));
}
.banner-text {
  position: absolute; bottom: 16px; left: 18px; right: 18px;
  z-index: 2;
}
.banner-text h2 { font-size: 19px; letter-spacing: 2px; color: #fff; font-weight: 600; }
.banner-text p { font-size: 11.5px; color: rgba(255,255,255,0.75); margin-top: 5px; letter-spacing: 1px; }
.banner-slide { width: 100%; height: 100%; position: relative; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-slide .banner-text { position: absolute; bottom: 16px; left: 18px; right: 18px; z-index: 2; }
.banner-dots {
  position: absolute; bottom: 8px; 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 { background: var(--gold-2); width: 18px; border-radius: 3px; }

/* 分类横滑 */
.cat-scroll {
  display: flex; gap: 10px;
  padding: 6px 16px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cat-chip {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--text-2);
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-chip.active {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #ffffff; font-weight: 600;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(201, 169, 110, 0.35);
}

/* 分区标题 */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 12px;
}
.section-title {
  font-size: 16px; font-weight: 600; color: var(--text-1);
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  width: 3px; height: 15px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
}
.section-more { font-size: 11.5px; color: var(--text-3); }

/* 商品网格 */
.goods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}
.goods-card {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s;
}
.goods-card:active { transform: scale(0.98); }
.goods-img {
  display: block;
  /* 商品图内缩 8px + 圆角，图片不贴卡片边缘，四边都有边界 */
  width: calc(100% - 16px);
  margin: 8px 8px 0;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-3);
}
.goods-info { padding: 11px 12px 13px; }
.goods-name {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.goods-sub {
  font-size: 11px; color: var(--text-3);
  margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.goods-price {
  display: flex; align-items: baseline; gap: 6px;
  margin-top: 8px;
}
.price-num { color: var(--gold-2); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-num::before { content: '¥'; font-size: 11px; margin-right: 1px; }
.silver-tag {
  font-size: 10px; color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--bg-4);
  padding: 1px 6px; border-radius: 4px;
}

/* ============================================================
   卡片通用
   ============================================================ */
.card {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  margin: 12px 16px;
  padding: 16px;
}
.card-title {
  font-size: 14px; font-weight: 600; color: var(--gold-2);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title .sub { font-size: 11px; color: var(--text-3); font-weight: 400; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px;
  border-radius: 24px;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #ffffff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(201, 169, 110, 0.35);
}
.btn-gold:active:not(:disabled) { transform: scale(0.97); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--text-2);
  background: transparent;
}
.btn-block { width: 100%; padding: 13px; font-size: 14.5px; }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 16px; }

/* ============================================================
   表单
   ============================================================ */
.form-item { margin-bottom: 16px; }
.form-item label {
  display: block;
  font-size: 12px; color: var(--text-2);
  margin-bottom: 8px;
}
.input, .textarea {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 12px 14px;
  font-size: 14px;
  transition: border-color 0.2s;
}
.input:focus, .textarea:focus { border-color: var(--gold-1); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { resize: none; min-height: 80px; line-height: 1.6; }

/* ============================================================
   登录注册页
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 40px 28px;
}
.auth-logo { text-align: center; margin-bottom: 40px; }
.auth-logo .mark {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: var(--bg-1); font-weight: 700;
  box-shadow: 0 0 32px rgba(201, 169, 110, 0.35);
}
.auth-logo h1 { font-size: 23px; letter-spacing: 5px; color: var(--gold-2); }
.auth-logo p { font-size: 10.5px; color: var(--text-3); letter-spacing: 3px; margin-top: 8px; }
.auth-tabs {
  display: flex; gap: 24px;
  margin-bottom: 26px;
}
.auth-tab {
  font-size: 15px; color: var(--text-3);
  padding-bottom: 8px;
  position: relative;
}
.auth-tab.active { color: var(--gold-2); font-weight: 600; }
.auth-tab.active::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-3));
}
.auth-link { text-align: center; margin-top: 20px; font-size: 12.5px; color: var(--text-3); }
.auth-link span { color: var(--gold-2); }

/* ============================================================
   钱包页
   ============================================================ */
.wallet-hero {
  margin: 16px;
  padding: 24px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.wallet-hero::after {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-dim), transparent 70%);
}
.wallet-total-label { font-size: 12px; color: var(--text-2); letter-spacing: 1px; }
.wallet-total { font-size: 34px; font-weight: 700; color: var(--gold-2); margin-top: 8px; font-variant-numeric: tabular-nums; }
.wallet-actions { display: flex; gap: 10px; margin-top: 18px; position: relative; z-index: 2; }

/* 三账户卡 */
.account-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 0 16px; }
.account-card {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
}
.account-card .icon { font-size: 20px; margin-bottom: 6px; }
.account-card .val { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.account-card .lbl { font-size: 10.5px; color: var(--text-3); margin-top: 4px; }
.account-card.cash .val { color: var(--text-1); }
.account-card.silver .val { color: var(--text-1); }
.account-card.copper .val { color: var(--gold-2); }

/* 流水条目 */
.record-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.record-item:last-child { border-bottom: none; }
.record-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.record-icon.in { background: rgba(61, 220, 151, 0.12); color: var(--green); }
.record-icon.out { background: rgba(240, 101, 90, 0.12); color: var(--red); }
.record-main { flex: 1; min-width: 0; }
.record-title { font-size: 13px; }
.record-time { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.record-amount { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.record-amount.in { color: var(--green); }
.record-amount.out { color: var(--red); }

/* ============================================================
   档位专区
   ============================================================ */
.tier-card {
  margin: 12px 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-soft);
  overflow: hidden;
  position: relative;
}
.tier-card.featured { border-color: var(--line); box-shadow: 0 0 24px rgba(201, 169, 110, 0.12); }
.tier-head {
  padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.tier-name { font-size: 16px; font-weight: 700; color: var(--gold-2); letter-spacing: 1px; }
.tier-price { font-size: 22px; font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; }
.tier-price::before { content: '¥'; font-size: 13px; margin-right: 2px; color: var(--text-3); }
.tier-price span { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.tier-rates {
  display: flex;
  border-top: 1px solid var(--line-soft);
}
.tier-rate-cell {
  flex: 1;
  text-align: center;
  padding: 10px 2px;
  border-right: 1px solid var(--line-soft);
}
.tier-rate-cell:last-child { border-right: none; }
.tier-rate-cell .rv { font-size: 14px; font-weight: 700; color: var(--gold-2); }
.tier-rate-cell .rl { font-size: 9.5px; color: var(--text-3); margin-top: 2px; }
.tier-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(201, 169, 110, 0.04);
}
.tier-pool { font-size: 11.5px; color: var(--text-2); }
.tier-pool b { color: var(--gold-2); font-size: 13px; }

/* ============================================================
   我的计划
   ============================================================ */
.plan-card {
  margin: 12px 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-soft);
  padding: 16px;
}
.plan-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.plan-tier { font-size: 15px; font-weight: 600; color: var(--gold-2); }
.plan-status { font-size: 11px; }
.plan-nums {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; text-align: center;
  margin-bottom: 12px;
}
.plan-nums .num { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-nums .lbl { font-size: 10px; color: var(--text-3); margin-top: 3px; }
.plan-progress { height: 8px; background: var(--bg-1); border-radius: 4px; overflow: hidden; }
.plan-progress-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-3));
  border-radius: 4px;
  transition: width 0.4s;
}
.plan-progress-text { font-size: 10.5px; color: var(--text-3); margin-top: 6px; text-align: right; }

/* ============================================================
   徽章 / 空态 / 提示
   ============================================================ */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 10.5px;
}
.badge-green { background: rgba(61,220,151,0.13); color: var(--green); border: 1px solid rgba(61,220,151,0.3); }
.badge-red { background: rgba(240,101,90,0.13); color: var(--red); border: 1px solid rgba(240,101,90,0.3); }
.badge-orange { background: rgba(245,166,35,0.13); color: var(--orange); border: 1px solid rgba(245,166,35,0.3); }
.badge-blue { background: rgba(79,142,247,0.13); color: var(--blue); border: 1px solid rgba(79,142,247,0.3); }
.badge-gold { background: var(--gold-dim); color: var(--gold-2); border: 1px solid var(--line); }
.badge-gray { background: rgba(154,168,194,0.1); color: var(--text-2); border: 1px solid var(--line-soft); }

.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty-icon { font-size: 38px; opacity: 0.35; margin-bottom: 12px; }

.loading { text-align: center; padding: 50px 0; color: var(--text-3); font-size: 13px; }
.loading::after {
  content: '';
  display: block;
  width: 26px; height: 26px;
  margin: 12px auto 0;
  border: 3px solid var(--line-soft);
  border-top-color: var(--gold-1);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.gc-toast {
  position: fixed;
  top: 60px; left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 20px;
  display: flex; align-items: center; gap: 9px;
  box-shadow: var(--shadow);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s;
  font-size: 13px;
  max-width: 84vw;
}
.gc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.gc-toast-icon {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.gc-toast-success .gc-toast-icon { background: rgba(61,220,151,0.2); color: var(--green); }
.gc-toast-error .gc-toast-icon { background: rgba(240,101,90,0.2); color: var(--red); }
.gc-toast-info .gc-toast-icon { background: rgba(79,142,247,0.2); color: var(--blue); }

/* 底部弹层（下单/提现等） */
.sheet-mask {
  position: fixed; inset: 0;
  background: rgba(4, 8, 18, 0.75);
  backdrop-filter: blur(3px);
  z-index: 500;
  opacity: 0;
  transition: opacity 0.25s;
}
.sheet-mask.show { opacity: 1; }
.sheet {
  position: fixed; bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 480px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--line);
  z-index: 501;
  max-height: 85vh;
  overflow-y: auto;
  transition: transform 0.3s;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.show { transform: translateX(-50%) translateY(0); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 12px;
  font-size: 15px; font-weight: 600; color: var(--gold-2);
  position: sticky; top: 0;
  background: inherit;
}
.sheet-close { color: var(--text-3); font-size: 18px; padding: 2px 8px; }
.sheet-body { padding: 0 18px 22px; }

/* 商品详情 */
.detail-img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.detail-body { padding: 18px 16px; }
.detail-name { font-size: 18px; font-weight: 700; line-height: 1.4; }
.detail-sub { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.detail-price-row { display: flex; align-items: baseline; gap: 12px; margin-top: 14px; }
.detail-price { font-size: 26px; font-weight: 700; color: var(--gold-2); }
.detail-price::before { content: '¥'; font-size: 15px; }
.detail-silver { font-size: 12px; color: var(--text-3); }
.detail-desc { font-size: 13px; color: var(--text-2); line-height: 1.9; margin-top: 18px; white-space: pre-wrap; }
.detail-footer {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg-2);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 100;
}
.detail-footer .btn { flex: 1; }

/* 数量步进器 */
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.stepper button {
  width: 34px; height: 34px;
  background: var(--bg-1);
  color: var(--gold-2);
  font-size: 17px;
}
.stepper .qty { width: 48px; text-align: center; font-size: 14px; font-weight: 600; background: var(--bg-2); line-height: 34px; }

/* 列表通用 */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.list-item:last-child { border-bottom: none; }

/* 团队页 */
.team-stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px; }
.team-stat .item {
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 16px 8px;
  text-align: center;
}
.team-stat .num { font-size: 20px; font-weight: 700; color: var(--gold-2); }
.team-stat .lbl { font-size: 10.5px; color: var(--text-3); margin-top: 4px; }

.invite-card {
  margin: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  text-align: center;
}
.invite-code {
  font-size: 30px; font-weight: 700; letter-spacing: 8px;
  color: var(--gold-2);
  margin: 10px 0 16px;
  font-variant-numeric: tabular-nums;
}

/* 我的页 */
.mine-header {
  padding: 30px 20px 24px;
  display: flex; align-items: center; gap: 14px;
}
.mine-avatar {
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--bg-1); font-weight: 700;
}
.mine-name { font-size: 17px; font-weight: 600; }
.mine-phone { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.mine-level { margin-left: auto; }

.menu-list { margin: 12px 16px; border-radius: var(--radius); background: linear-gradient(160deg, var(--bg-2), var(--bg-1)); border: 1px solid var(--line-soft); overflow: hidden; }
.menu-item {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  transition: background 0.15s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg-3); }
.menu-item .mi { font-size: 17px; width: 24px; text-align: center; }
.menu-item .arrow { margin-left: auto; color: var(--text-3); font-size: 14px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.35s ease both; }

/* ============================================================
   即时通讯（用户端）
   ============================================================ */
.tab-icon { position: relative; }
.tab-dot {
  position: absolute; top: -6px; right: -13px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: #d23c3c; color: #fff;
  font-size: 10px; line-height: 16px; text-align: center;
  display: none; font-weight: 600;
}

.im-page-head { padding: 22px 18px 8px; }
.im-page-title { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.im-page-sub { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.im-conv-list { padding: 6px 14px 0; }

.im-conv-item {
  display: flex; gap: 12px; align-items: center;
  padding: 13px 12px; margin-top: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.im-conv-item:active { background: var(--bg-3); }
.im-avatar {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-4));
  color: var(--gold-2); font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.im-avatar img { width: 100%; height: 100%; object-fit: cover; }
.im-conv-main { flex: 1; min-width: 0; }
.im-conv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.im-conv-name { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-conv-time { font-size: 10.5px; color: var(--text-3); flex-shrink: 0; }
.im-conv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 5px; }
.im-conv-msg { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #d23c3c; color: #fff; font-size: 10.5px; line-height: 18px; text-align: center; flex-shrink: 0;
}

/* 聊天页 */
.im-chat { position: relative; }
.im-msgs {
  height: calc(100vh - 58px);
  overflow-y: auto; padding: 16px 14px 96px;
  -webkit-overflow-scrolling: touch;
}
.im-row { display: flex; flex-direction: column; margin-bottom: 14px; }
.im-row.mine { align-items: flex-end; }
.im-row.other { align-items: flex-start; }
.im-bubble-wrap { max-width: 78%; }
.im-text-bubble {
  padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.65;
  background: var(--bg-2); color: var(--text-1);
  border: 1px solid var(--line-soft);
  word-break: break-word; white-space: pre-wrap;
}
.im-row.mine .im-text-bubble {
  background: var(--gold-1);
  color: #ffffff; border-color: var(--gold-1); border-bottom-right-radius: 5px;
}
.im-row.other .im-text-bubble { border-bottom-left-radius: 5px; }
.im-time { font-size: 10px; color: var(--text-3); margin-top: 5px; }
.im-img { max-width: 62vw; max-height: 260px; border-radius: 12px; display: block; }
.im-empty-tip { text-align: center; color: var(--text-3); font-size: 12px; padding: 40px 0; }

.im-order-card {
  min-width: 220px; max-width: 76vw;
  background: rgba(19, 38, 75, 0.96);
  border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 13px;
}
.im-order-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--gold-2); padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.im-order-no { color: var(--text-3); font-size: 11px; }
.im-order-line { font-size: 12.5px; color: var(--text-2); margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-order-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.im-order-amount { font-size: 15px; font-weight: 700; color: var(--gold-1); }

.im-input-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 120;
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px calc(env(safe-area-inset-bottom, 0px) + 9px);
  background: var(--bg-1);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.im-tool-btn {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--bg-3); border: 1px solid var(--line-soft);
  color: var(--gold-2); font-size: 16px; cursor: pointer;
}
.im-text {
  flex: 1; height: 38px; border-radius: 19px; padding: 0 14px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text-1); font-size: 14px; outline: none; min-width: 0;
}
.im-text:focus { border-color: var(--gold-3); }
.im-send {
  height: 38px; padding: 0 17px; border-radius: 19px; border: none;
  background: var(--gold-1);
  color: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.im-order-pick {
  padding: 12px 14px; margin-bottom: 9px;
  background: var(--bg-1); border: 1px solid var(--line-soft); border-radius: 10px;
}
.im-order-pick:active { border-color: var(--gold-3); }

/* 即时通讯：我的页右上角客服 + 消息空态按钮 */
.mine-acts{ margin-left:auto; display:flex; flex-direction:column; align-items:flex-end; gap:9px; }
.mine-acts .mine-level{ margin-left:0; }
.mine-cs{ display:flex; align-items:center; gap:5px; padding:4px 10px 4px 8px; border-radius:14px;
  background:rgba(217,179,112,.12); border:1px solid rgba(217,179,112,.45);
  color:var(--gold-2,#D9B370); font-size:11px; }
.mine-cs svg{ width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:1.6;
  stroke-linecap:round; stroke-linejoin:round; }
.im-empty-btn{ display:inline-block; margin-top:18px; padding:9px 22px; border-radius:20px;
  border:1px solid var(--line-soft); color:var(--text-2); font-size:12.5px; }

/* 商品详情：京东式底部操作栏 */
.detail-back-fab{ position:fixed; top:12px; left:max(12px, calc(50% - 228px)); z-index:101;
  width:32px; height:32px; border-radius:50%; border:0; background:rgba(10,20,35,.55);
  color:#fff; font-size:20px; line-height:1; backdrop-filter:blur(6px); }
.df-ic{ flex:0 0 42px; display:flex; flex-direction:column; align-items:center; gap:3px;
  background:none; border:0; padding:0; color:var(--text-3); font-size:9.5px; }
.df-ic svg{ width:19px; height:19px; stroke:currentColor; fill:none; stroke-width:1.6;
  stroke-linecap:round; stroke-linejoin:round; }
.detail-footer{ gap:6px; }
.detail-footer .btn{ font-size:12.5px; padding:0 10px; }

/* IM P0：在线状态 / 送达与已读回执 */
.im-online-dot { display:inline-block; width:6px; height:6px; background:#19c37d; border-radius:50%; margin-left:5px; vertical-align:middle; }
.im-chat-status { text-align:center; font-size:11px; color:var(--text-3,#9aa0a6); padding:6px 0 0; }
.im-chat-status.on { color:#19c37d; }
.im-ack { margin-left:6px; font-size:10px; color:var(--text-3,#9aa0a6); }
.im-ack.read { color:#19c37d; }
.im-ack.fail { color:#e5484d; }
.im-row.im-failed { cursor:pointer; }
.im-row.im-failed .im-text-bubble, .im-row.im-failed .im-img { opacity:.55; }
/* ==IM_P1_START== */
/* ============================================================
   IM P1（用户端）：语音 / 文件 / 短视频 / 卡片 / 撤回 / 设置
   ============================================================ */
.im-more {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-soft);
  background: rgba(46, 81, 152, 0.35); color: var(--gold-2);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.im-mute, .im-pin {
  display: inline-block; margin-left: 5px; padding: 0 5px;
  font-size: 9.5px; font-style: normal; line-height: 15px; border-radius: 4px;
  color: var(--text-3); background: rgba(46, 81, 152, 0.35); vertical-align: 1px;
}
.im-pin { color: var(--gold-2); background: rgba(201, 162, 74, 0.16); }

.im-chat-status.rec { color: #e07070; font-weight: 600; }
.im-tool-btn.rec {
  background: rgba(210, 60, 60, 0.25); border-color: #d23c3c; color: #ff9c9c;
}
.im-row .im-bubble-wrap { max-width: 78%; }
.im-recalled {
  display: inline-block; padding: 6px 12px; border-radius: 10px;
  font-size: 12px; color: var(--text-3);
  background: rgba(46, 81, 152, 0.18); border: 1px dashed var(--line-soft);
}
.im-voice {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: 14px; border: 1px solid var(--line-soft);
  background: rgba(36, 65, 122, 0.85); color: var(--text-1); cursor: pointer;
}
.im-row.mine .im-voice {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #1a1409; border-color: transparent; border-bottom-right-radius: 5px;
}
.im-row.other .im-voice { border-bottom-left-radius: 5px; }
.im-voice.playing { box-shadow: 0 0 0 2px rgba(201, 162, 74, 0.55); }
.im-voice-ic { font-size: 14px; }
.im-voice-wave {
  flex: 1; height: 2px; min-width: 26px;
  background: linear-gradient(90deg, currentColor, transparent); opacity: 0.55;
}
.im-voice-dur { font-size: 11.5px; opacity: 0.85; }

.im-video { max-width: 62vw; max-height: 260px; border-radius: 12px; display: block; background: #000; }
.im-file {
  display: flex; align-items: center; gap: 10px; max-width: 68vw;
  padding: 10px 12px; border-radius: 12px; text-decoration: none;
  background: rgba(19, 38, 75, 0.96); border: 1px solid var(--line);
  color: var(--text-1);
}
.im-row.mine .im-file { background: rgba(30, 52, 96, 0.96); }
.im-file-ic {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201, 162, 74, 0.16); color: var(--gold-2); font-size: 17px;
}
.im-file-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.im-file-main b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-file-main em { font-style: normal; font-size: 10.5px; color: var(--text-3); }

.im-card {
  width: 62vw; max-width: 260px; border-radius: 13px; overflow: hidden;
  background: rgba(19, 38, 75, 0.97); border: 1px solid var(--line);
  cursor: pointer;
}
.im-card-head { padding: 8px 11px 0; }
.im-card-tag { font-size: 10.5px; color: var(--gold-2); letter-spacing: 0.5px; }
.im-card-body { display: flex; gap: 9px; padding: 9px 11px; }
.im-card-img {
  width: 62px; height: 62px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
  background: var(--bg-3); color: var(--text-3); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.im-card-img.ph { display: flex; }
.im-card-info { min-width: 0; flex: 1; }
.im-card-name { font-size: 13px; font-weight: 600; line-height: 1.45; max-height: 2.9em; overflow: hidden; }
.im-card-price { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--gold-1); }
.im-card-desc { margin-top: 5px; font-size: 11.5px; color: var(--text-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.im-card-foot { padding: 7px 11px; border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--text-3); text-align: right; }

.im-set-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; border-bottom: 1px solid var(--line-soft);
  font-size: 14px; color: var(--text-1); cursor: pointer;
}
.im-set-row:last-child { border-bottom: none; }
.im-set-row i { font-style: normal; font-size: 12px; color: var(--text-3); }
.im-set-row i.on { color: var(--gold-2); }
.im-set-row.danger span { color: #e07070; }
/* ==IM_P1_END== */


/* 移动端性能：常驻栏位关闭实时背景模糊（背景色已接近不透明，视觉差异极小），并启用惯性滚动 */
@media (max-width: 768px) {
  .top-bar, .tab-bar, .im-input-bar, .sheet-mask, .sheet, .detail-back-fab {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .page, .im-msgs, .sheet-body { -webkit-overflow-scrolling: touch; }
}

/* ===== v2 ivory theme overlay ===== */
html, body { background: var(--bg-0) !important; color: var(--text-1) !important; }
body { background-image: none !important; }
::selection { background: var(--bg-4); color: var(--text-1); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #dbe7ee; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }
::-webkit-scrollbar-track { background: transparent; }
/* ===== end v2 ===== */

/* v2 contrast fix */
.btn-gold{color:#fff!important;box-shadow:0 4px 14px rgba(39,154,174,.22)!important;}

/* v2 mall self */
.mall-self-card{margin-top:14px;background:linear-gradient(135deg,var(--bg-3),var(--bg-2));border:1px solid var(--bg-4);}
.mall-self-head{display:flex;align-items:center;gap:10px}
.mall-self-logo{width:38px;height:38px;border-radius:10px;background:var(--gold-1);color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0}
.mall-self-name{font-size:15px;font-weight:600;color:var(--text-1)}
.mall-self-tag{font-size:10px;background:var(--gold-dim);color:var(--gold-1);border-radius:99px;padding:1px 6px;margin-left:4px}
.mall-self-desc{font-size:11px;color:var(--text-2);margin-top:3px}
.mall-self-arrow{color:var(--gold-2);font-size:20px}
.mall-channels{display:flex;gap:8px;margin-top:12px}
.mall-ch{border:1px solid var(--line);background:var(--bg-2);color:var(--text-2);font-size:12px;padding:5px 14px;border-radius:99px}
.mall-ch.on{background:var(--gold-1);border-color:var(--gold-1);color:#fff;font-weight:600}

/* ============================================================
   v4 版式（2026-11-20）：首页 搜索/公告/分类宫格/自营卡/推荐双列
   我的：账户双卡 + 计划进度 + 分组菜单
   ============================================================ */
.home-search{
  display:flex;align-items:center;gap:8px;
  height:38px;margin:0 16px 12px;padding:0 14px;
  background:var(--bg-2);border:1px solid var(--line);border-radius:19px;
}
.hs-icon{font-size:16px;color:var(--text-3);line-height:1}
.home-search input{
  flex:1;border:none;outline:none;background:transparent;
  font-size:13px;color:var(--text-1);font-family:inherit;
}
.home-search input::placeholder{color:var(--text-3)}

.notice-bar{
  display:flex;align-items:center;gap:8px;
  margin:12px 16px 0;padding:9px 12px;cursor:pointer;
  background:var(--bg-2);border:1px solid var(--line);border-radius:10px;
}
.notice-tag{
  flex-shrink:0;font-size:10px;line-height:16px;padding:0 6px;border-radius:4px;
  color:#fff;background:var(--gold-1);
}
.notice-text{
  flex:1;font-size:12.5px;color:var(--text-1);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.notice-arrow{color:var(--text-3);font-size:15px;line-height:1}

.cat-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:14px 4px;
  margin:12px 16px 0;padding:14px 6px;
  background:var(--bg-2);border:1px solid var(--line);border-radius:14px;
}
.cat-cell{display:flex;flex-direction:column;align-items:center;gap:7px;cursor:pointer}
.cat-icon{
  width:46px;height:46px;border-radius:14px;overflow:hidden;
  background:var(--bg-3);color:var(--gold-2);
  display:flex;align-items:center;justify-content:center;font-size:17px;
  transition:background .15s;
}
.cat-icon img{width:100%;height:100%;object-fit:cover}
.cat-name{font-size:11.5px;color:var(--text-2);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cat-cell.active .cat-icon{background:var(--bg-4)}
.cat-cell.active .cat-name{color:var(--gold-3);font-weight:600}

.self-card{
  display:flex;align-items:center;gap:12px;
  margin:12px 16px 0;padding:12px 14px;cursor:pointer;
  background:var(--bg-2);border:1px solid var(--line);border-radius:14px;
}
.self-logo{
  width:44px;height:44px;border-radius:12px;flex-shrink:0;
  background:var(--bg-3);color:var(--gold-2);
  display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;
}
.self-meta{flex:1;min-width:0}
.self-name{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:var(--text-1)}
.self-tag{
  font-size:10px;font-weight:400;line-height:15px;padding:0 5px;border-radius:4px;
  color:var(--gold-1);background:var(--bg-3);border:1px solid var(--bg-4);
}
.self-sub{font-size:11.5px;color:var(--text-3);margin-top:3px}
.self-enter{font-size:12px;color:var(--gold-2);flex-shrink:0}

.sec-row{display:flex;align-items:center;justify-content:space-between;margin:18px 16px 10px}
.sec-title{font-size:15.5px;font-weight:600;color:var(--text-1)}
.sec-more{font-size:12px;color:var(--text-3);cursor:pointer}

/* 商品卡：平铺、细边框 */
.goods-card{background:var(--bg-2);border:1px solid var(--line);border-radius:12px;box-shadow:none;overflow:hidden}
.goods-card .goods-img{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;background:var(--bg-3)}
.goods-info{padding:8px 10px 10px}
.goods-name{font-size:12.5px;font-weight:500;color:var(--text-1);line-height:1.4}
.goods-sub{font-size:11px;color:var(--text-3);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.goods-price{display:flex;align-items:baseline;gap:6px;margin-top:7px;flex-wrap:wrap}
.goods-price .price-num{font-size:15px;font-weight:700;color:var(--gold-2)}
.silver-tag{font-size:10px;color:var(--text-3)}

/* 我的：用户卡 */
.mine-header{display:flex;align-items:center;gap:12px;padding:16px}
.mine-info{flex:1;min-width:0}
.mine-sub{font-size:11.5px;color:var(--text-3);margin-top:4px}
.mine-tags{display:flex;align-items:center;gap:5px;margin-top:5px;flex-wrap:wrap}
.id-tag{display:inline-flex;align-items:center;height:18px;padding:0 7px;border-radius:9px;font-size:10.5px;line-height:1;border:1px solid transparent;white-space:nowrap}
.id-tag.t-plain{color:var(--text-3);background:var(--bg-3);border-color:var(--bg-4)}
.id-tag.t-agent{color:#1c4e8a;background:rgba(43,143,203,.12);border-color:rgba(43,143,203,.28)}
.id-tag.t-share{color:#8a6a1c;background:rgba(200,160,60,.14);border-color:rgba(200,160,60,.3)}
.mine-level{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex-shrink:0}

/* 我的：账户双卡 */
.account-grid.two{grid-template-columns:repeat(2,1fr);margin:0 16px;gap:10px}
.account-card{border-radius:12px;padding:14px 16px;border:1px solid var(--line);background:var(--bg-2)}
.account-card .val{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--text-1)}
.account-card .lbl{font-size:11.5px;color:var(--text-3);margin-top:4px}
.account-card.copper{border-color:var(--line)}
.account-card.silver{border-color:var(--line)}
.account-card.cash{background:var(--bg-3);border-color:var(--bg-4)}
.asset-row{
  display:flex;align-items:center;justify-content:space-between;
  margin:10px 16px 0;padding:10px 14px;border-radius:10px;
  background:var(--bg-2);border:1px solid var(--line);
  font-size:12px;color:var(--text-2);
}
.asset-row b{color:var(--text-1);font-weight:600}

/* 我的：计划进度卡 */
.plan-card{
  margin:12px 16px 0;padding:14px 16px;cursor:pointer;
  background:var(--bg-2);border:1px solid var(--line);border-radius:14px;
}
.pc-head{display:flex;align-items:center;justify-content:space-between;font-size:13px;font-weight:600;color:var(--text-1)}
.pc-main{font-size:19px;font-weight:700;color:var(--text-1);margin-top:10px;font-variant-numeric:tabular-nums}
.pc-main small{font-size:11.5px;font-weight:400;color:var(--text-3);margin-left:8px}
.pc-bar{height:6px;border-radius:3px;background:var(--bg-3);overflow:hidden;margin-top:10px}
.pc-bar i{display:block;height:100%;background:var(--gold-1);border-radius:3px}
.pc-foot{display:flex;align-items:center;justify-content:space-between;margin-top:9px;font-size:11px;color:var(--text-3)}

/* 我的：分组菜单 */
.menu-group{
  margin:12px 16px 0;background:var(--bg-2);
  border:1px solid var(--line);border-radius:14px;overflow:hidden;
}
.mg-head{
  display:flex;align-items:center;gap:6px;
  padding:11px 14px;border-bottom:1px solid var(--line-soft);
  font-size:13px;font-weight:600;color:var(--text-1);
}
.mg-tag{font-size:10.5px;font-weight:400;color:var(--gold-1);background:var(--bg-3);border-radius:4px;padding:1px 6px}
.menu-group .menu-item{
  display:flex;align-items:center;gap:8px;
  padding:12px 14px;font-size:13px;color:var(--text-1);
  border-bottom:1px solid var(--line-soft);background:transparent;
}
.menu-group .menu-item:last-child{border-bottom:none}
.menu-group .menu-item .mi{display:none}
.mi-val{margin-left:auto;font-size:11.5px;color:var(--text-3)}
.menu-group .menu-item .arrow{margin-left:auto;color:var(--text-3);font-size:14px}
.menu-group .menu-item .mi-val + .arrow{margin-left:4px}

/* ============================================================
   v5「我的」紧凑版式：资产合并卡 + 计划条 + 功能宫格
   ============================================================ */
.mine-header.compact{padding:14px 16px 8px}
.mine-gear{
  width:30px;height:30px;border-radius:50%;flex-shrink:0;
  border:1px solid var(--line);background:var(--bg-2);
  display:flex;align-items:center;justify-content:center;
  font-size:14px;color:var(--text-3);
}
.mine-gear:active{background:var(--bg-3)}

.asset-card{
  margin:6px 16px 0;border-radius:14px;overflow:hidden;
  background:var(--bg-2);border:1px solid var(--line);
}
.asset-cells{display:flex}
.acell{
  flex:1;text-align:center;padding:14px 4px 12px;
  border-right:1px solid var(--line-soft);
}
.acell:last-child{border-right:none}
.acell b{
  display:block;font-size:17px;font-weight:700;color:var(--gold-2);
  font-variant-numeric:tabular-nums;letter-spacing:.2px;
}
.acell span{display:block;font-size:11px;color:var(--text-3);margin-top:3px}
.asset-foot{
  display:flex;align-items:center;justify-content:space-between;
  padding:9px 14px;border-top:1px solid var(--line-soft);
  font-size:11.5px;color:var(--text-3);
}
.asset-foot b{color:var(--text-1);font-weight:600;font-variant-numeric:tabular-nums}
.asset-link{font-size:11.5px;color:var(--gold-2)}

.plan-strip{
  display:flex;align-items:center;gap:12px;
  margin:10px 16px 0;padding:12px 14px;border-radius:14px;
  background:var(--bg-2);border:1px solid var(--line);
  cursor:pointer;
}
.ps-main{flex:1;min-width:0}
.ps-k{font-size:11.5px;color:var(--text-3);display:flex;align-items:center;gap:6px}
.ps-st{
  font-size:10px;color:var(--gold-1);background:var(--bg-3);
  border-radius:3px;padding:0 5px;line-height:15px;
}
.ps-st-warn{color:#c2410c;background:#fdece0}
.ps-d{
  font-size:15px;font-weight:700;color:var(--text-1);
  margin-top:5px;font-variant-numeric:tabular-nums;
}
.ps-bar{height:5px;border-radius:3px;background:var(--bg-3);overflow:hidden;margin-top:7px}
.ps-bar i{display:block;height:100%;background:var(--gold-1);border-radius:3px}
.ps-go{flex-shrink:0;font-size:11.5px;color:var(--gold-2)}

.func-title{
  margin:16px 16px 8px;font-size:13px;font-weight:600;color:var(--text-1);
}
.func-grid{
  display:grid;grid-template-columns:repeat(4,1fr);
  margin:0 16px;padding:10px 4px 12px;
  background:var(--bg-2);border:1px solid var(--line);border-radius:14px;
  row-gap:4px;
}
.func-item{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:7px 0;font-size:11px;color:var(--text-2);
}
.func-item i{
  position:relative;width:34px;height:34px;border-radius:11px;
  background:var(--bg-3);color:var(--gold-2);
  display:flex;align-items:center;justify-content:center;
  font-style:normal;font-size:13px;
}
.func-item:active i{background:var(--bg-4)}
.fdot{
  position:absolute;top:5px;right:7px;width:6px;height:6px;border-radius:50%;
  background:#d23c3c;
}
.mine-ver{
  text-align:center;padding:16px 0 26px;
  font-size:10.5px;color:var(--text-3);letter-spacing:1px;
}

/* ============================================================
   v6 金霖直营页（底部导航第 3 格）
   ============================================================ */
.store-hero{
  display:flex;align-items:center;gap:12px;
  margin:12px 16px 0;padding:14px;
  background:var(--bg-2);border:1px solid var(--line);border-radius:14px;
}
.store-logo{
  width:48px;height:48px;flex-shrink:0;border-radius:14px;
  background:var(--bg-3);color:var(--gold-2);
  display:flex;align-items:center;justify-content:center;
  font-size:20px;font-weight:700;
}
.store-meta{flex:1;min-width:0}
.store-name{
  font-size:15px;font-weight:700;color:var(--text-1);
  display:flex;align-items:center;gap:6px;
}
.store-tag{
  font-size:10px;font-weight:400;padding:1px 6px;border-radius:6px;
  background:var(--bg-3);border:1px solid var(--bg-4);color:var(--text-3);
}
.store-sub{font-size:11.5px;color:var(--text-3);margin-top:4px}
.store-count{flex-shrink:0;font-size:11.5px;color:var(--text-3)}
.store-count b{color:var(--gold-2);font-size:14px}

.store-chips{
  display:flex;gap:8px;overflow-x:auto;
  padding:12px 16px 2px;
  -webkit-overflow-scrolling:touch;
}
.store-chips::-webkit-scrollbar{display:none}
.store-chip{
  flex:none;padding:6px 14px;border-radius:999px;
  background:var(--bg-2);border:1px solid var(--line);
  font-size:12.5px;color:var(--text-2);
}
.store-chip.on{
  background:var(--bg-3);border-color:var(--bg-4);
  color:var(--gold-2);font-weight:600;
}

/* 5 格导航：字号略收，保证「金霖」等标签不换行 */
.tab-bar .tab-item{font-size:10px;padding:8px 0 7px}
.tab-bar .tab-item .tab-icon{font-size:19px}

/* 邀请链接带入提示 */
.invite-tip{
  margin:-4px 0 14px;
  padding:8px 12px;
  border-radius:10px;
  background:var(--bg-3);
  border:1px solid var(--bg-4);
  color:var(--text-2);
  font-size:12px;
  line-height:18px;
}


/* ============ 金币支付 / 分页（v6） ============ */
.pay-opts{display:flex;gap:9px}
.pay-opt{flex:1;border:1px solid var(--line);background:var(--bg-1);border-radius:11px;padding:10px 11px}
.pay-opt.on{border-color:var(--bg-4);background:var(--bg-3);box-shadow:inset 0 0 0 1px var(--bg-4)}
.pay-opt .po-t{font-size:13px;font-weight:600;color:var(--text-1)}
.pay-opt .po-s{font-size:10.5px;color:var(--text-3);margin-top:3px}
.pay-opt .po-b{font-size:11px;color:var(--text-2);margin-top:6px;font-weight:600}
.pay-sum{background:var(--bg-1);border:1px solid var(--line);border-radius:11px;padding:10px 12px;margin:12px 0 14px}
.pay-sum .ps-line{display:flex;justify-content:space-between;font-size:12px;color:var(--text-2);padding:4px 0}
.pay-sum .ps-line.ps-all{border-top:1px dashed var(--line);margin-top:5px;padding-top:8px;font-size:13px;color:var(--text-1);font-weight:600}
.pager{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 4px 4px;border-top:1px solid var(--line-soft);margin-top:8px}
.pg-btn{height:30px;padding:0 12px;border-radius:9px;font-size:12px;background:var(--bg-3);color:var(--text-2);border:1px solid var(--bg-4)}
.pg-btn:disabled{opacity:.42}
.pg-info{font-size:11px;color:var(--text-3)}

/* ============================================================
   全部分类页 + 商品详情相册/长图（v20261121）
   ============================================================ */

/* 首页分类宫格：全部分类入口 */
.cat-icon-all { background: var(--bg-3); }
.cat-icon-all span { font-size: 20px; color: var(--gold-2); }

/* 分类页：左右分栏 */
.cats-page {
  display: flex; flex-direction: column;
  height: calc(100vh - 62px);
  background: var(--bg-0);
}
.cats-search {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 12px 8px; padding: 0 12px;
  height: 38px; border-radius: 19px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.cats-search .cs-icon { font-size: 16px; color: var(--text-3); }
.cats-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 13px; color: var(--text-1);
}
.cats-body { flex: 1; display: flex; min-height: 0; }
.cats-side {
  width: 92px; flex-shrink: 0; overflow-y: auto;
  background: var(--bg-1); border-right: 1px solid var(--line-soft);
  padding-bottom: 20px;
}
.cats-side-item {
  padding: 15px 6px; text-align: center;
  font-size: 12.5px; color: var(--text-2);
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.cats-side-item.active {
  background: var(--bg-2); color: var(--text-1);
  font-weight: 600; border-left-color: var(--gold-2);
}
.cats-main { flex: 1; overflow-y: auto; padding: 12px 12px 60px; min-width: 0; }
.cats-hero {
  padding: 14px 14px 16px; margin-bottom: 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--bg-4);
}
.cats-hero .ch-title { font-size: 16px; font-weight: 700; color: var(--text-1); }
.cats-hero .ch-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.cats-sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cats-sub {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 6px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line-soft);
  transition: transform .15s, border-color .15s;
}
.cats-sub:active { transform: scale(.97); border-color: var(--bg-4); }
.cats-sub-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); overflow: hidden;
}
.cats-sub-icon img { width: 100%; height: 100%; object-fit: cover; }
.cats-sub-icon span { font-size: 18px; font-weight: 600; color: var(--gold-2); }
.cats-sub-name { font-size: 12.5px; color: var(--text-1); text-align: center; line-height: 17px; }
.cats-sub-head {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 2px 12px;
}
.cats-back {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-2);
  color: var(--text-1); font-size: 20px; line-height: 1;
}
.csh-name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.csh-path { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.cats-goods { padding: 0; }

/* 商品详情：主图相册 */
.detail-gallery {
  position: relative; width: 100%;
  background: var(--bg-3);
  overflow: hidden;
}
.dg-track {
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dg-track::-webkit-scrollbar { display: none; }
.dg-img {
  width: 100%; flex: 0 0 100%;
  aspect-ratio: 1; object-fit: cover;
  scroll-snap-align: center;
  background: var(--bg-3);
  display: block;
}
.dg-count {
  position: absolute; right: 12px; bottom: 12px;
  padding: 3px 10px; border-radius: 12px;
  background: rgba(20, 40, 60, .55); color: #fff;
  font-size: 11.5px; letter-spacing: .5px;
}
.dg-dots {
  position: absolute; left: 0; right: 0; bottom: 14px;
  display: flex; justify-content: center; gap: 6px;
  pointer-events: none;
}
.dg-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  pointer-events: auto; transition: width .2s, background .2s;
}
.dg-dot.active { width: 16px; border-radius: 3px; background: #fff; }

/* 商品详情：详情长图 */
.detail-divider {
  height: 8px; margin: 16px -16px 14px;
  background: var(--bg-0);
}
.detail-section-title {
  font-size: 14px; font-weight: 700; color: var(--text-1);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.detail-section-title::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
}
.detail-long {
  margin: 14px -16px 0;
  display: flex; flex-direction: column;
}
.detail-long-img {
  display: block; width: 100%; height: auto;
  background: var(--bg-3);
}

/* 付款凭证查看器 */
.img-viewer { position: fixed; inset: 0; z-index: 9999; background: rgba(6, 12, 20, .96); display: flex; flex-direction: column; touch-action: none; }
.iv-top { height: 54px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; color: #fff; }
.iv-count { font-size: 13px; opacity: .85; letter-spacing: .5px; }
.iv-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.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; user-select: none; -webkit-user-drag: none; }
.iv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 56px; border: 0; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; z-index: 2; }
.iv-prev { left: 10px; }
.iv-next { right: 10px; }
.iv-bar { height: 68px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding-bottom: env(safe-area-inset-bottom); }
.iv-bar button { min-width: 44px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #fff; font-size: 14px; cursor: pointer; }
.iv-pct { min-width: 52px; text-align: center; color: #fff; font-size: 12.5px; opacity: .85; }

/* ============================================================
   夜间模式（用户手动切换，本地保存；不跟随时间自动切换）
   ============================================================ */
html[data-theme="dark"] {
  --bg-0: #0d1520;
  --bg-1: #111b27;
  --bg-2: #16222f;
  --bg-3: #1c2c3d;
  --bg-4: #28405a;

  --gold-1: #37b3c7;
  --gold-2: #4ea9e2;
  --gold-3: #7cc4ef;
  --gold-dim: rgba(55, 179, 199, 0.16);

  --text-1: #e6eef7;
  --text-2: #a9bed4;
  --text-3: #7f97b0;

  --green: #45b389;
  --red: #e0756d;
  --blue: #4ea9e2;
  --orange: #d9a15c;
  --purple: #8f9cd4;

  --line: #233244;
  --line-soft: #1b2836;

  --shadow: 0 6px 20px rgba(0, 0, 0, 0.38);
  --glow-gold: 0 0 0 3px rgba(55, 179, 199, 0.18);
}
html[data-theme="dark"] body { background-image: none; }
html[data-theme="dark"] .phone-wrap { box-shadow: 0 0 60px rgba(0, 0, 0, 0.75); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2a3d52; }
html[data-theme="dark"] .top-bar { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
html[data-theme="dark"] .theme-switch i { background: #e9f1fa; }

/* 我的 · 夜间模式开关 */
.theme-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 12px 16px; padding: 14px 16px;
  background: linear-gradient(160deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
}
.theme-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.theme-ico {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--gold-dim); color: var(--gold-2);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.theme-title { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.theme-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.theme-switch {
  width: 46px; height: 26px; border-radius: 13px; flex-shrink: 0; position: relative;
  border: 1px solid var(--line); background: var(--bg-3); cursor: pointer;
  transition: background .2s, border-color .2s;
}
.theme-switch i {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  transition: transform .2s;
}
.theme-switch.on { background: var(--gold-1); border-color: var(--gold-1); }
.theme-switch.on i { transform: translateX(20px); }

/* 兑换区银豆价格 */
.ex-price { color: #7f9dc0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
html[data-theme="dark"] .ex-price { color: var(--text-2); }
html[data-theme="dark"] .id-tag.t-agent { color: #bfe3ff; background: rgba(78, 169, 226, .18); border-color: rgba(78, 169, 226, .32); }
html[data-theme="dark"] .ps-st-warn { color: #ffb98a; background: rgba(217, 161, 92, .18); }

