/* ============================================================
   BOBO臻选 · 统一设计系统（商城页 + 积分中心共用）
   ★ 移动优先：先写手机形态，再用 min-width 断点向桌面渐进增强。
   ★ 零依赖：不引任何外部字体 / 图标 / 框架，离线可用。

   ---------- 这套视觉是怎么想出来的 ----------
   "高端"不是靠加装饰，是靠三件事：
     ① 色少：墨黑 + 暖白 + 一点点香槟金。金色只做点睛（细边框、
        价格旁的装饰线、当前项下划线），面积一大立刻变俗。
     ② 留白：卡片内边距、商品图与文字之间的间距都比常规电商大一号，
        东西显得"敢空着"。
     ③ 字：价格用等宽数字（tabular-nums）对齐，标题用稍紧的字距，
        正文用较松的行高。这三个数字一改，气质就变了。

   ---------- 兼容性约束（改这个文件前必读）----------
   ★ 令牌**只增不改名**：points.html / admin.html 里有硬编码引用
     （如 var(--brand-soft)、var(--circ)、.badge 等）。改名 = 页面白屏。
   ★ --brand 系列语义已从"绿色"改成"墨黑"，但名字保留，
     所以旧页面不会崩，只是跟着一起变高级。
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 主色：墨黑（原先是绿色，名字保留以免旧页面引用失效） */
  --brand:        #1C1C1E;
  --brand-deep:   #0E0E10;
  --brand-soft:   #F0EFEC;
  /* ★ 香槟金：唯一的"贵气"来源，务必克制使用 */
  --gold:         #A8873F;
  --gold-2:       #C9A961;
  --gold-soft:    #F6F0E2;

  /* 背景与文字 */
  --bg:           #F4F3F0;
  --surface:      #FFFFFF;
  --ink:          #17171A;
  --ink-2:        #6B6B70;
  --ink-3:        #9A9A9F;

  /* 功能色（points.html 有硬编码引用，勿改名） */
  --warn:         #9A6B12;
  --warn-soft:    #FAF3E4;
  --danger:       #B03A2E;
  --danger-soft:  #FBEDEB;
  --circ:         #33556F;
  --circ-soft:    #EDF1F5;
  --bonus:        #6B4E7E;
  --bonus-soft:   #F3EFF7;

  /* 线 / 底 */
  --line:         #E6E4DF;
  --line-2:       #EFEDE9;
  --fill:         #F7F6F3;

  /* 形状：比常规大一号的圆角，是"贵"的一部分 */
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;

  /* 阴影：高端感来自"阴影很淡但层次分明"，不是重投影 */
  --sh-1: 0 1px 2px rgba(23,23,26,.035);
  --sh-2: 0 2px 6px rgba(23,23,26,.04), 0 12px 32px rgba(23,23,26,.055);
  --sh-3: 0 6px 22px rgba(23,23,26,.18);
  --sh-gold: 0 6px 20px rgba(168,135,63,.22);

  /* 安全区 */
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* 布局 */
  --tabbar-h: 62px;
  --gutter: 16px;
  /* 字体栈：优先系统中文黑体，最后兜底无衬线 */
  --font: "PingFang SC", -apple-system, "Segoe UI", "Microsoft YaHei",
          system-ui, "Helvetica Neue", sans-serif;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 400 15px/1.6 var(--font);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 21px; letter-spacing: -.3px; }
h2 { font-size: 16px; letter-spacing: -.1px; }
a { color: var(--gold); text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
/* 没有底部 Tab 的页面（积分中心）不用给 Tab 留白 */
body.no-tab { padding-bottom: 24px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
/* ★ 数字一律等宽：价格、积分、销量对齐后整页整齐度立刻上一个台阶 */
.num, .amt, .v, .pr, .stat .v, .flow-row .v { font-variant-numeric: tabular-nums; }
.dim { color: var(--ink-2); }
.tiny { font-size: 12px; }
.hide { display: none !important; }

/* ---------- 顶部栏 ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-2);
  padding: 12px var(--gutter) 10px;
}
.appbar .row {
  display: flex; align-items: center; gap: 10px;
  max-width: 960px; margin: 0 auto;
}
.brand {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 19px; font-weight: 700; letter-spacing: .6px;
}
.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 0 0 3px var(--gold-soft);
  align-self: center;
}
.brand small {
  font-size: 11px; font-weight: 500; letter-spacing: 1.5px;
  color: var(--ink-3); text-transform: uppercase;
}
.who-chip {
  margin-left: auto; max-width: 46%; overflow: hidden;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--fill); color: var(--ink-2);
  font-size: 12px; white-space: nowrap; text-overflow: ellipsis;
}
.who-chip b { color: var(--ink); font-weight: 600; }
.who-chip.on { background: var(--gold-soft); color: var(--gold); }
.who-chip.on b { color: var(--gold); }

/* 搜索 */
.searchbar { position: relative; margin: 10px auto 0; max-width: 960px; }
.searchbar .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; opacity: .42; pointer-events: none;
}
.searchbar input {
  width: 100%; height: 42px; padding: 0 44px 0 38px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--fill); font-size: 14px; outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar input:focus {
  background: var(--surface);
  border-color: var(--gold-2); box-shadow: 0 0 0 3px var(--gold-soft);
}
.searchbar .clr {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-3); font-size: 16px; cursor: pointer;
}

/* ---------- 视图容器 ---------- */
.view {
  max-width: 960px; margin: 0 auto;
  padding: 12px var(--gutter) 8px;
  animation: view-in .24s ease both;
}
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1), var(--sh-2);
  padding: 16px;
  margin-bottom: 14px;
}
.card-hd {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.card-hd h2 { font-size: 16px; }
/* ★ 标题左侧那道金线：整页最高级的 1 个细节，用了就够，别再加 */
.card-hd h2::before {
  content: ''; display: inline-block; vertical-align: 1px;
  width: 3px; height: 13px; margin-right: 8px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
}
.card-hd .n { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* 区块标题 */
.sec-title {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 2px 12px;
}
.sec-title h1 { font-size: 21px; letter-spacing: -.3px; }
.sec-title .n { font-size: 12px; color: var(--ink-3); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font-size: 14px; letter-spacing: .2px; cursor: pointer;
  transition: transform .08s, background .18s, border-color .18s, box-shadow .18s;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(160deg, #2A2A2E, var(--brand-deep));
  border-color: transparent; color: #fff; font-weight: 600;
  letter-spacing: .5px;
  box-shadow: var(--sh-3);
}
.btn.ghost { background: var(--gold-soft); border-color: transparent; color: var(--gold); font-weight: 600; }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); font-weight: 600; }
.btn.gold { background: linear-gradient(160deg, var(--gold-2), var(--gold)); border-color: transparent; color: #fff; font-weight: 600; }
.btn.sm { min-height: 34px; padding: 0 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn.lg { min-height: 50px; font-size: 15px; border-radius: var(--r-md); }
.btn.block { width: 100%; }
.btn.round { width: 44px; min-width: 44px; padding: 0; border-radius: 50%; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field > label {
  display: block; font-size: 12px; color: var(--ink-2);
  margin: 0 0 6px 2px; letter-spacing: .3px;
}
.input, input.input, select.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--fill); font-size: 15px; outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  appearance: none; -webkit-appearance: none;
  height: auto; margin: 0;
}
input.input:focus, select.input:focus {
  background: var(--surface);
  border-color: var(--gold-2); box-shadow: 0 0 0 3px var(--gold-soft);
}
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--ink-2); line-height: 1.65; margin-top: 8px; }

/* ---------- 分段控件 ---------- */
.seg {
  display: flex; gap: 4px; padding: 4px;
  background: var(--fill); border-radius: var(--r-md);
  border: 1px solid var(--line-2);
}
.seg .seg-i {
  flex: 1; min-height: 36px; padding: 0 8px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--ink-2); font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s;
}
.seg .seg-i.on {
  background: var(--surface); color: var(--ink);
  font-weight: 600; box-shadow: var(--sh-1);
}

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; line-height: 1.7;
  background: var(--fill); color: var(--ink-2);
}
.badge.s-created   { background: var(--warn-soft);  color: var(--warn); }
.badge.s-paid      { background: var(--circ-soft);  color: var(--circ); }
.badge.s-shipped   { background: var(--bonus-soft); color: var(--bonus); }
.badge.s-completed { background: var(--brand-soft);  color: var(--ink); }
.badge.s-refunded  { background: var(--fill);       color: var(--ink-3); }
.badge.b-circ      { background: var(--circ-soft);  color: var(--circ); }
.badge.b-bonus     { background: var(--bonus-soft); color: var(--bonus); }
.badge.b-warn      { background: var(--warn-soft);  color: var(--warn); }
.badge.b-ok        { background: var(--brand-soft); color: var(--ink); }
/* ★ 金牌徽章：只给"臻选"标记用 */
.badge.b-gold      { background: var(--gold-soft);  color: var(--gold); letter-spacing: .5px; }

/* ---------- 分类横滑 ---------- */
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 38px; padding: 0 15px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s;
}
.chip .n { font-size: 11px; opacity: .6; }
.chip.on {
  background: var(--brand); border-color: var(--brand);
  color: #fff; font-weight: 600;
}
.chip.on .n { opacity: .75; }

/* ---------- 商品网格 ---------- */
.goods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gcard {
  position: relative;
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform .14s, box-shadow .2s;
}
.gcard:hover { box-shadow: var(--sh-2); }
.gcard:active { transform: scale(.985); }

/* ★ 商品图：真图优先（<img>），没有图才回退 emoji。
   两者都塞进同一个 .thumb 里，所以尺寸/裁切规则只需维护一份。 */
.gcard .thumb {
  position: relative;
  aspect-ratio: 1 / 1; overflow: hidden;
  background: var(--fill);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; line-height: 1;
}
.gcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gcard .body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.gcard .nm {
  font-size: 14px; font-weight: 600; line-height: 1.42; letter-spacing: -.1px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 40px;
}
.gcard .meta { font-size: 11px; color: var(--ink-3); }
.gcard .ds {
  font-size: 11px; color: var(--ink-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.gcard .prow {
  display: flex; align-items: baseline; gap: 6px; margin-top: auto; padding-top: 7px;
}
.gcard .pr {
  font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -.4px;
}
.gcard .og { font-size: 11px; color: var(--ink-3); text-decoration: line-through; }
.gcard .st { font-size: 11px; color: var(--ink-3); }
.gcard .add {
  position: absolute; right: 10px; bottom: 10px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--brand);
  color: #fff; font-size: 18px; line-height: 34px; text-align: center;
  cursor: pointer; box-shadow: 0 4px 14px rgba(23,23,26,.24);
  transition: transform .1s, background .18s;
}
.gcard .add:hover { background: var(--gold); }
.gcard .add:active { transform: scale(.9); }
.gcard .picked {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  min-width: 24px; height: 24px; padding: 0 8px;
  border-radius: var(--r-pill); background: rgba(14,14,16,.86); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 24px; text-align: center;
}
/* 折扣角标（原价存在时才出现） */
.gcard .off {
  position: absolute; right: 0; top: 0; z-index: 2;
  padding: 3px 10px 3px 12px;
  border-radius: 0 0 0 12px;
  background: linear-gradient(160deg, var(--gold-2), var(--gold));
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .3px;
}
.gcard.out { opacity: .78; }
.gcard.out .thumb img { filter: grayscale(1); opacity: .7; }
.gcard.out .pr { color: var(--ink-3); }
.gcard.out .add { background: var(--fill); color: var(--ink-3); box-shadow: none; cursor: not-allowed; }

/* ---------- ★ 商品详情页 ---------- */
.detail { padding-bottom: 96px; }
.detail-hero {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--fill); box-shadow: var(--sh-1);
}
.detail-hero img { width: 100%; display: block; aspect-ratio: 1 / 1; object-fit: cover; }
.detail-hero .fallback {
  aspect-ratio: 1 / 1; display: flex; align-items: center;
  justify-content: center; font-size: 96px;
}
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 4px; margin-bottom: 10px;
  border: 0; background: transparent; color: var(--ink-2);
  font-size: 13px; cursor: pointer;
}
.detail-back:active { opacity: .6; }

/* 价格区 */
.detail-buy { position: relative; }
.detail-buy .pricebox {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
}
.detail-buy .now {
  font-size: 32px; font-weight: 700; color: var(--ink);
  letter-spacing: -1px; line-height: 1.1;
}
.detail-buy .was { font-size: 13px; color: var(--ink-3); text-decoration: line-through; padding-bottom: 5px; }
.detail-buy .save {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--gold-soft); color: var(--gold); margin-bottom: 5px;
}
.detail-buy h1 { font-size: 21px; line-height: 1.4; margin-bottom: 8px; letter-spacing: -.2px; }
.detail-buy .sub { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* 规格表 */
.spec-table { display: flex; flex-direction: column; }
.spec-table .tr {
  display: flex; gap: 14px; padding: 10px 0;
  border-bottom: 1px solid var(--line-2); font-size: 13px;
}
.spec-table .tr:last-child { border-bottom: 0; }
.spec-table .th {
  flex: none; width: 76px; color: var(--ink-3); letter-spacing: .5px;
}
.spec-table .td { flex: 1; color: var(--ink); }

/* 亮点条目 */
.hl { display: flex; flex-direction: column; gap: 2px; }
.hl .li {
  display: flex; gap: 10px; padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px; color: var(--ink-2); line-height: 1.6;
}
.hl .li:last-child { border-bottom: 0; }
.hl .li::before {
  content: ''; flex: none; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); margin-top: 8px;
}

/* 详情页吸底购买栏 */
.buybar {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  z-index: 26;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line-2);
  padding: 10px var(--gutter);
  box-shadow: 0 -6px 20px rgba(23,23,26,.05);
}
.buybar .in {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
}
.buybar .qty { display: flex; align-items: center; gap: 8px; flex: none; }
.buybar .qty .lb { font-size: 12px; color: var(--ink-2); }
.buybar .btn { flex: 1; }

/* ---------- 购物车行 ---------- */
.crow {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 0; border-bottom: 1px solid var(--line-2);
}
.crow:last-child { border-bottom: 0; }
.crow .ic {
  width: 48px; height: 48px; flex: none; border-radius: var(--r-sm);
  background: var(--fill); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.crow .ic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crow .info { flex: 1; min-width: 0; }
.crow .nm { font-size: 14px; font-weight: 600; line-height: 1.4; }
.crow .sub { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.crow .del {
  border: 0; background: transparent; color: var(--ink-3);
  font-size: 15px; cursor: pointer; padding: 4px;
}
.stepper { display: flex; align-items: center; gap: 2px; flex: none; }
.stepper button {
  width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.stepper button:active { background: var(--fill); }
.stepper span { min-width: 26px; text-align: center; font-size: 14px; font-weight: 600; }

/* ---------- 结算栏 ---------- */
.paybar {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  z-index: 25;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line-2);
  padding: 10px var(--gutter) calc(10px);
  box-shadow: 0 -6px 20px rgba(23,23,26,.05);
}
.paybar .in {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.paybar .sum { flex: 1; min-width: 0; }
.paybar .sum .lab { font-size: 12px; color: var(--ink-2); }
.paybar .sum .amt { font-size: 23px; font-weight: 700; color: var(--ink); line-height: 1.2; letter-spacing: -.5px; }
.paybar .sum .qt {
  font-size: 11px; color: var(--ink-3); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.paybar .btn { flex: none; min-width: 118px; }

/* ---------- 订单卡 ---------- */
.ocard {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px; margin-bottom: 10px; background: var(--surface);
}
.ocard .hd { display: flex; align-items: center; gap: 8px; }
.ocard .no { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--ink-3); }
.ocard .bd {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  margin-top: 9px;
}
.ocard .who { font-size: 12px; color: var(--ink-2); }
.ocard .amt { font-size: 17px; font-weight: 700; }
.ocard .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ocard .acts .btn { flex: 1; min-width: 84px; }

/* ---------- 指标卡（积分中心）---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--sh-1); padding: 13px 14px; position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--line);
}
.stat.circ::before  { background: var(--circ); }
.stat.bonus::before { background: var(--bonus); }
.stat.warnb::before { background: var(--warn); }
.stat.ok::before    { background: var(--gold); }
.stat .k { font-size: 12px; color: var(--ink-2); }
.stat .v { font-size: 23px; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.stat.circ .v  { color: var(--circ); }
.stat.bonus .v { color: var(--bonus); }
.stat.warnb .v { color: var(--warn); }
.stat.ok .v    { color: var(--ink); }
.stat .t { font-size: 11px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }

/* ---------- 流水卡片流（替代宽表）---------- */
.flow { display: flex; flex-direction: column; gap: 8px; }
.flow-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; background: var(--surface);
}
.flow-row .l { flex: 1; min-width: 0; }
.flow-row .t1 { font-size: 13px; font-weight: 600; }
.flow-row .t2 { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.flow-row .v { font-size: 15px; font-weight: 700; }
.flow-row .v.pos { color: var(--ink); }
.flow-row .v.neg { color: var(--danger); }

/* ---------- 流水类型标签（积分中心）---------- */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--fill); color: var(--ink-2);
}
.tag.spend_circ, .tag.spend_bonus { background: var(--danger-soft); color: var(--danger); }
.tag.child_refund { background: var(--danger-soft); color: var(--danger); }
.tag.adjust_circ  { background: var(--circ-soft);  color: var(--circ); }
.tag.child_earn   { background: var(--gold-soft);  color: var(--gold); }
.tag.overflow_out { background: var(--gold-soft);  color: var(--gold); }
.tag.overflow_in  { background: var(--warn-soft);  color: var(--warn); }
.tag.adjust       { background: var(--bonus-soft); color: var(--bonus); }
.ok  { color: var(--ink); font-weight: 600; }
.bad { color: var(--danger); }

/* ---------- 列表行（我的 / 入口）---------- */
.lrow {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 2px; border-bottom: 1px solid var(--line-2);
  color: var(--ink); text-decoration: none;
}
.lrow:last-child { border-bottom: 0; }
.lrow .ic { font-size: 18px; width: 24px; text-align: center; }
.lrow .tx { flex: 1; font-size: 15px; }
.lrow .go { color: var(--ink-3); font-size: 14px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--ink-2); }
.empty .em { font-size: 40px; display: block; margin-bottom: 10px; opacity: .8; }
.empty .t { font-size: 14px; }
.empty .s { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.empty .btn { margin-top: 16px; }

/* ---------- 骨架屏 ---------- */
.sk {
  background: linear-gradient(90deg, #EEEDE9 25%, #F7F6F3 37%, #EEEDE9 63%);
  background-size: 400% 100%;
  animation: sk 1.2s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-card { border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--sh-1); }
.sk-thumb { aspect-ratio: 1 / 1; }
.sk-line { height: 12px; margin: 9px 12px; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }
.sk-chip { width: 84px; height: 34px; border-radius: var(--r-pill); flex: none; }

/* ---------- 账户卡（我的）---------- */
.acct { display: flex; align-items: center; gap: 12px; }
.acct .av {
  width: 50px; height: 50px; flex: none; border-radius: 50%;
  background: linear-gradient(150deg, #2A2A2E, var(--brand-deep));
  color: var(--gold-2); font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(201,169,97,.4);
}
.acct .info { flex: 1; min-width: 0; }
.acct .nm { font-size: 16px; font-weight: 600; }
.acct .id { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.acct .inv { font-size: 13px; color: var(--ink-2); margin-top: 5px; }
.acct .inv b { color: var(--ink); font-family: ui-monospace, Consolas, monospace; letter-spacing: .5px; }
.acct .inv .btn { margin-left: 6px; vertical-align: middle; }

/* ---------- 余额双卡（我的）---------- */
.me-bal { display: flex; gap: 10px; margin-top: 12px; }
.me-bal .b {
  flex: 1; padding: 13px 14px; border-radius: var(--r-md);
  background: var(--fill); position: relative; overflow: hidden;
}
.me-bal .b::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.me-bal .b:first-child::before { background: var(--circ); }
.me-bal .b:last-child::before { background: var(--bonus); }
.me-bal .k { font-size: 12px; color: var(--ink-2); }
.me-bal .v { font-size: 25px; font-weight: 700; line-height: 1.25; }
.me-bal .v.circ { color: var(--circ); }
.me-bal .v.bonus { color: var(--bonus); }
.me-bal .t { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 验证码行 ---------- */
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { flex: none; min-width: 104px; padding: 0 12px; font-size: 14px; }

/* ---------- 吸底栏留位 ---------- */
#view-cart { padding-bottom: 100px; }
#view-detail { padding-bottom: 100px; }
@media (min-width: 1024px) {
  #view-cart { padding-bottom: 20px; }
  #view-detail { padding-bottom: 20px; }
}

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 0 6px; }
.pager .pg { font-size: 13px; color: var(--ink-2); }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line-2);
}
.tab {
  flex: 1; position: relative; border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: 11px; cursor: pointer; padding: 0;
}
.tab .ic { font-size: 21px; line-height: 1; filter: grayscale(1); opacity: .5; transition: transform .18s, opacity .18s; }
.tab.on { color: var(--ink); font-weight: 600; }
.tab.on .ic { filter: none; opacity: 1; transform: translateY(-1px) scale(1.06); }
.tab .dot {
  position: absolute; top: 6px; left: 50%; margin-left: 6px;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--gold); color: #fff;
  font-size: 10px; line-height: 17px; text-align: center; font-weight: 700;
  box-shadow: 0 0 0 2px #fff;
}
.tab .dot.bump { animation: bump .34s ease; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  max-width: 82vw; z-index: 90;
  background: rgba(14,14,16,.94); color: #fff;
  padding: 12px 18px; border-radius: var(--r-md);
  font-size: 14px; line-height: 1.45;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 28px rgba(14,14,16,.3);
  text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ---------- 警告条 ---------- */
.warnbar {
  display: none;
  background: var(--warn-soft); border: 1px solid #EBDCBA; color: #6E4C0C;
  border-radius: var(--r-md); padding: 12px 14px;
  font-size: 12px; line-height: 1.7; margin-bottom: 14px;
}

/* ============================================================
   断点：平板 600px+
   ============================================================ */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .goods { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .gcard .nm { font-size: 15px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  /* 详情页在平板起变成左右两栏：图左，信息右 */
  .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .detail-hero { position: sticky; top: 92px; }
}

/* ============================================================
   断点：桌面 1024px+ —— 底部 Tab 转左侧导航
   ============================================================ */
@media (min-width: 1024px) {
  body { padding-bottom: 28px; padding-left: 212px; }
  .tabbar {
    top: 0; bottom: 0; left: 0; right: auto;
    width: 212px; height: 100vh; padding-bottom: 0;
    flex-direction: column; justify-content: flex-start;
    gap: 4px; padding-top: 18px;
    border-top: 0; border-right: 1px solid var(--line-2);
    background: rgba(255,255,255,.97);
  }
  .tab {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 10px;
    height: 46px; padding: 0 18px; margin: 2px 12px;
    border-radius: var(--r-md); font-size: 14px;
  }
  .tab.on { background: var(--brand-soft); }
  .tab.on::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
  }
  .tab .dot { top: 8px; left: auto; right: 12px; margin-left: 0; box-shadow: none; }
  .appbar { padding-left: calc(212px + var(--gutter)); }
  .appbar .row, .searchbar, .view, .paybar .in, .buybar .in { max-width: 880px; }
  .appbar .row, .searchbar { margin-left: 0; }
  /* 结算栏在桌面不吸视口底部，跟着内容走 */
  .paybar, .buybar {
    position: sticky; bottom: 12px;
    border-radius: var(--r-lg); border: 1px solid var(--line);
    margin: 0 var(--gutter) 12px; padding: 12px 18px;
    box-shadow: var(--sh-2);
  }
  .view { padding-bottom: 20px; }
  .goods { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   登录门 / 注册 / 资料弹窗（2026-10-07 新增）
   ★ 复用现有 --gold / --line / --r-lg 等变量，不引入新色板。
   ============================================================ */

/* ---------- 登录门：按需弹出的整页浮层（点「我的」/ 去结算 / 点顶栏「未登录」）
   打开网站默认是看不到它的 —— 首页、分类、搜索、详情、购物车、订单都免登录。 ---------- */
.authgate {
  position: fixed; inset: 0; z-index: 90;
  display: none;
  overflow-y: auto;
  background:
    radial-gradient(1200px 420px at 50% -10%, var(--gold-soft), transparent 70%),
    var(--bg, #FAF9F7);
}
.authgate.on { display: block; }
.authwrap {
  max-width: 420px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 46px) var(--gutter) 40px;
}
/* 登录门右上角的 ✕：只关掉这一层，人留在原来那一页继续逛 */
.gate-x {
  /* fixed 而不是 absolute：门是可滚动的，✕ 要一直贴在右上角，不能跟着表单滚走。
     right 用 max() 是为了在宽屏上跟中间那张 420px 的卡片右边缘对齐。 */
  position: fixed; z-index: 1;
  right: max(14px, calc(50% - 196px));
  top: calc(env(safe-area-inset-top) + 12px);
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-2); background: #fff;
  color: var(--ink-2); font-size: 15px; line-height: 1;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.gate-x:active { background: var(--fill); }
.authbrand {
  display: flex; align-items: center; gap: 8px;
  justify-content: center; margin-bottom: 22px;
  font-weight: 800; font-size: 22px; letter-spacing: .5px;
  color: var(--brand);
}
.authbrand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
}
.authbrand small {
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  color: var(--ink-3); text-transform: uppercase; margin-top: 4px;
}
.authgate .card { box-shadow: var(--sh-2); }
/* 登录门里的分段控件留点上下间距 */
.authgate .seg { margin-bottom: 4px; }

/* 注册面板的"无推荐人"勾选 */
.authcheck {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; user-select: none;
}
.authcheck input { width: 16px; height: 16px; accent-color: var(--gold); }

/* ---------- 通用编辑弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(23,23,26,.42);
  padding: var(--gutter);
}
.modal.on { display: flex; }
.modal-card {
  width: 100%; max-width: 380px;
  background: var(--card, #fff);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: 18px;
}
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.modal-hd h3 { font-size: 16px; margin: 0; }
.modal-x {
  border: none; background: transparent; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--ink-3);
  padding: 4px 6px; border-radius: 8px;
}
.modal-x:active { background: var(--brand-soft); }

/* 省/市/区 三联下拉 */
.region-row { display: flex; gap: 8px; }
.region-row select { flex: 1; min-width: 0; }
