/* ==========================================================================
   H5 样式
   原则：浅灰底 + 白卡片分层；品牌橙红只给钱、主按钮和品牌区；4pt 栅格。
   所有 H5 规则限定在 .app 内，后台（.admin）单独一套，互不污染。
   ========================================================================== */

:root {
  /* 品牌：金额、主按钮、品牌区 */
  --brand: #ff4a26;
  --brand-press: #e63b19;
  --brand-ink: #b2361a;      /* 小字品牌色，白底对比 ≥4.5:1 */
  --brand-50: #fff3ee;
  --brand-100: #ffe3d8;
  --brand-grad: linear-gradient(135deg, #ff7b47 0%, #ff4a26 52%, #f2302f 100%);
  --brand-shadow: 0 8px 20px rgba(255, 74, 38, 0.28);

  /* 中性 */
  --bg: #f4f5f7;             /* 页面底 */
  --bg-subtle: #f4f5f7;
  --fill: #f2f3f5;           /* 卡片内的浅色填充 */
  --surface: #ffffff;
  --text: #15171c;
  --text-2: #484f5c;
  --text-3: #6b7280;
  --line: #eef0f3;
  --line-strong: #e1e4ea;

  /* 语义 */
  --success: #0b7a43;
  --success-bg: #e8f6ee;
  --warning: #b45309;
  --warning-bg: #fdf3e3;
  --danger: #d92d20;
  --danger-bg: #fdecea;

  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-15: 15px;
  --fs-17: 17px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-28: 28px;
  --fs-34: 34px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;
  --shadow-1: 0 1px 2px rgba(17, 19, 24, 0.04), 0 2px 10px rgba(17, 19, 24, 0.04);
  --shadow-2: 0 10px 30px rgba(17, 19, 24, 0.14);

  --dur: 180ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --tabbar-h: 56px;
  --tap: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --z-appbar: 20;
  --z-tabbar: 30;
  --z-cta: 40;
  --z-backdrop: 50;
  --z-sheet: 60;
  --z-toast: 80;
}

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

/* 按钮的 display 会覆盖 UA 的 [hidden]，这里显式压回去 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
  font-size: var(--fs-15);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ---------- 骨架 ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-bottom: var(--sp-2);
}
.app > main { flex: 1; }
.app.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--sp-2)); }
.app.is-flush {
  min-height: 100dvh;
  padding-bottom: 0;
  background: #fff;
}

.site-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-4) var(--sp-3);
  color: #9aa1ad;
  font-size: var(--fs-12);
}
.site-footer a { text-decoration: none; }

.appbar {
  position: sticky;
  top: 0;
  z-index: var(--z-appbar);
  padding-top: var(--safe-top);
  background: rgba(244, 245, 247, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.appbar.is-scrolled { border-bottom-color: var(--line-strong); }
.appbar__inner {
  height: 52px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
}
.appbar__title { font-size: var(--fs-20); font-weight: 700; letter-spacing: -0.3px; }
.appbar__back {
  width: var(--tap);
  height: var(--tap);
  margin-left: calc(var(--sp-3) * -1);
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--text);
}
.appbar__aside { margin-left: auto; font-size: var(--fs-13); color: var(--text-3); font-variant-numeric: tabular-nums; }
.appbar__brand { font-size: var(--fs-17); font-weight: 800; letter-spacing: -0.3px; }

.page { padding: var(--sp-2) var(--sp-4) 0; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-tabbar);
  max-width: 480px;
  margin: 0 auto;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1;
  min-height: var(--tap);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: var(--fs-11);
  color: #8a909c;
  transition: color var(--dur) var(--ease);
}
.tabbar a.active { color: var(--brand); font-weight: 600; }
.tabbar svg { width: 23px; height: 23px; }
.tabbar a.active svg { stroke-width: 2; }

/* ---------- 通用 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-1);
}
.card--flush { padding: 0; overflow: hidden; }
.card--flush > .list-item { padding: var(--sp-3) var(--sp-4); }

.row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.stack { display: flex; flex-direction: column; gap: var(--sp-2); }
.muted { color: var(--text-3); }
.small { font-size: var(--fs-13); }
.tiny { font-size: var(--fs-11); }
.mono { font-variant-numeric: tabular-nums; }
.hint { font-size: var(--fs-13); color: var(--text-3); line-height: 1.6; }
.divider { height: 1px; background: var(--line); margin: var(--sp-3) 0; }
.section-title {
  font-size: var(--fs-13);
  color: var(--text-2);
  margin: var(--sp-5) var(--sp-1) var(--sp-2);
  font-weight: 600;
}

/* ---------- 按钮 ---------- */
button, .btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--fs-15);
  font-weight: 600;
  border-radius: var(--r-md);
  padding: 0 var(--sp-5);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: background var(--dur) var(--ease), opacity var(--dur) var(--ease),
    transform 120ms var(--ease);
  touch-action: manipulation;
}
button:active:not(:disabled), .btn:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-secondary { background: var(--fill); color: var(--text); }
.btn-line { background: #fff; color: var(--text); border: 1px solid var(--line-strong); }
.btn-ghost { background: var(--brand-50); color: var(--brand-ink); }
.btn-text { background: none; color: var(--text-2); padding: 0 var(--sp-2); font-weight: 500; }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; font-size: var(--fs-13); padding: 0 var(--sp-3); border-radius: var(--r-sm); }

@media (hover: hover) {
  .btn-primary:hover { background: var(--brand-press); }
  .btn-secondary:hover { background: #eaecef; }
  .btn-line:hover { background: var(--fill); }
}

/* ---------- 表单 ---------- */
input, textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* 16px 以下 iOS 聚焦会放大整页 */
  color: var(--text);
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 12px var(--sp-3);
  min-height: 48px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
input:focus, textarea:focus, select:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 74, 38, 0.12);
}
input[type="checkbox"] { min-height: 0; padding: 0; accent-color: var(--brand); }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: none; }
input::placeholder, textarea::placeholder { color: #9aa1ad; }
textarea { resize: none; line-height: 1.55; }
.field-label { font-size: var(--fs-13); color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field-error { font-size: var(--fs-13); color: var(--danger); margin-top: var(--sp-1); }
.field-help { margin: 6px 0 0; font-size: var(--fs-12); color: var(--text-3); line-height: 1.6; }
.field-help b { color: var(--text); }

.form-row { margin-bottom: var(--sp-4); }
.code-row { display: flex; gap: var(--sp-2); }
.code-row > input { flex: 1; min-width: 0; }
.code-row > button { flex: none; min-width: 112px; padding: 0 var(--sp-3); font-variant-numeric: tabular-nums; }
.code-row > button:disabled { color: var(--text-3); }
.code-row > button { flex: none; white-space: nowrap; min-width: 96px; padding: 0 var(--sp-3); }

/* ---------- 首页 ---------- */
.home__hero {
  position: relative;
  padding: calc(var(--safe-top) + var(--sp-4)) var(--sp-5) 64px;
  background: var(--brand-grad);
  color: #fff;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  overflow: hidden;
  transition: padding var(--dur) var(--ease);
}
/* 右上角的柔光圆，给品牌区一点纵深 */
.home__hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.home__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-17);
  font-weight: 800;
  letter-spacing: -0.2px;
}
.home__logo {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #fff;
  color: var(--brand);
  font-size: var(--fs-15);
  font-weight: 800;
}
.home h1 {
  margin: var(--sp-6) 0 var(--sp-1);
  font-size: var(--fs-28);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.25;
}
.home__sub { margin: 0; font-size: var(--fs-13); color: rgba(255, 255, 255, 0.86); }
.home.has-result .home__hero { padding-bottom: 52px; }
.home.has-result .home__hero h1 { margin-top: var(--sp-3); font-size: var(--fs-20); }
.home.has-result .home__sub { display: none; }

.home__body { position: relative; z-index: 1; margin-top: -40px; padding: 0 var(--sp-4); }

.search-box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px;
  background: #fff;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(17, 19, 24, 0.1);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-box:focus-within {
  border-color: rgba(255, 74, 38, 0.5);
  box-shadow: 0 10px 30px rgba(17, 19, 24, 0.1), 0 0 0 3px rgba(255, 74, 38, 0.1);
}
.search-box textarea {
  border: 0;
  padding: 10px var(--sp-2) 10px var(--sp-2);
  min-height: 52px;
  min-width: 0;
  background: transparent;
  box-shadow: none;
}
.search-box textarea:focus { box-shadow: none; background: transparent; }
.search-box > button {
  flex: none;
  min-height: 48px;
  padding: 0 var(--sp-5);
  white-space: nowrap;
  border-radius: var(--r-md);
  box-shadow: var(--brand-shadow);
}

.detect-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: var(--sp-3) var(--sp-1) 0;
  font-size: var(--fs-13);
  color: var(--text-2);
}
.detect-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.detect-chip--warn { color: var(--warning); }
.detect-chip--warn i { background: var(--warning); }

.home__history { margin-top: var(--sp-2); }
.history-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.history-chip {
  max-width: 100%;
  min-height: 34px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  background: #fff;
  box-shadow: var(--shadow-1);
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home__intro { margin-top: var(--sp-2); }
.home.has-result .home__intro { display: none; }

.steps { margin: 0; padding: var(--sp-2) var(--sp-4); list-style: none; }
.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15.5px;
  top: 48px;
  bottom: -6px;
  width: 1px;
  background: var(--brand-100);
}
.steps__num {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand);
  font-size: var(--fs-15);
  font-style: normal;
  font-weight: 800;
}
.steps b { display: block; font-size: var(--fs-15); font-weight: 600; line-height: 1.4; }
.steps span { display: block; margin-top: 2px; font-size: var(--fs-13); color: var(--text-3); line-height: 1.55; }

.platform-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-2);
}
.platform-row__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-12);
  color: var(--text-2);
  font-weight: 500;
}
.platform-row__item img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(17, 19, 24, 0.1);
}

/* ---------- 商品 ---------- */
.thumb {
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: var(--r-md);
  background: var(--fill);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-plat {
  color: #fff;
  font-size: var(--fs-11);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  line-height: 1.6;
}
/* 商品轻详情：大图可左右滑，价格和返利紧跟图片下方 */
.pd { padding: 0; overflow: hidden; }
.pd__gallery { position: relative; aspect-ratio: 1 / 1; max-height: 56vh; width: 100%; background: #fff; }
.pd__track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.pd__track::-webkit-scrollbar { display: none; }
.pd__track > img, .pd__noimg { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; }
.pd__track > img { object-fit: contain; }
.pd__noimg { display: grid; place-items: center; background: var(--fill); }
.pd__count {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  padding: 2px 10px;
  border-radius: var(--r-full);
  background: rgba(17, 19, 24, 0.45);
  color: #fff;
  font-size: var(--fs-12);
  font-variant-numeric: tabular-nums;
}
.pd__body { padding: var(--sp-4); border-top: 1px solid var(--line); }
.pd__pricebar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.pd__price { color: var(--text); font-size: var(--fs-15); font-weight: 700; font-variant-numeric: tabular-nums; }
.pd__price b { font-size: var(--fs-28); letter-spacing: -0.5px; }
.pd__price s { margin-left: 6px; color: var(--text-3); font-size: var(--fs-13); font-weight: 400; }
.pd__rebate {
  flex: none;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: var(--brand-grad);
  color: #fff;
  font-size: var(--fs-15);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--brand-shadow);
}
.pd__rebate small { margin-right: 4px; font-size: var(--fs-12); font-weight: 500; opacity: 0.9; }
.pd__rebate b { font-size: var(--fs-20); }
.pd__title { margin: var(--sp-3) 0 0; font-size: var(--fs-15); font-weight: 600; line-height: 1.5; }
.pd__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-3); }
.pd__tags:empty { display: none; }
.pd__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: var(--sp-3);
  color: var(--text-3);
  font-size: var(--fs-12);
}
.pd__meta i { font-style: normal; opacity: 0.5; }
.pd__highlight {
  margin: var(--sp-3) 0 0;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--fill);
  color: var(--text-2);
  font-size: var(--fs-13);
  line-height: 1.6;
}
.pd__note { margin: var(--sp-3) 0 0; color: var(--text-3); font-size: var(--fs-12); }
.price { display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-13); color: var(--text-3); }
.price b { color: var(--text); font-size: var(--fs-17); font-weight: 700; font-variant-numeric: tabular-nums; }
.price s { font-size: var(--fs-12); text-decoration: line-through; }

.rebate-panel {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #fff1ea 0%, #fff7f3 100%);
  border: 1px solid var(--brand-100);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
}
.rebate-panel .label { font-size: var(--fs-13); color: var(--brand-ink); font-weight: 500; }
.rebate-panel .amount {
  font-size: var(--fs-34);
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.rebate-panel .amount small { font-size: var(--fs-17); font-weight: 700; margin-right: 2px; }

.sticky-cta {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--sp-2));
  z-index: var(--z-cta);
  padding: var(--sp-3) 0 0;
  background: linear-gradient(to top, var(--bg) 72%, rgba(244, 245, 247, 0));
}
.sticky-cta > button {
  width: 100%;
  min-height: 52px;
  font-size: var(--fs-17);
  border-radius: var(--r-lg);
  box-shadow: var(--brand-shadow);
}
.sticky-cta .hint { text-align: center; margin-top: var(--sp-2); }

/* 搜索结果 */
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--sp-4) var(--sp-1) var(--sp-2);
  font-size: var(--fs-13);
  color: var(--text-3);
}
.result-head b { color: var(--text); font-weight: 600; }
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  background: #fff;
  box-shadow: var(--shadow-1);
  color: var(--text-2);
  font-size: var(--fs-13);
  font-weight: 500;
}
.sort-btn::after { content: "⇅"; font-size: var(--fs-12); opacity: 0.6; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* 列表底部：加载中 / 没有更多了 / 重试，同时是滑到底自动加载的触发点 */
.list-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 56px;
  color: var(--text-3);
  font-size: var(--fs-12);
}
.list-foot .spin { width: 14px; height: 14px; border-color: rgba(0, 0, 0, 0.12); border-top-color: var(--brand); }
.item-card {
  border: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-1);
  text-align: left;
  padding: 0;
  display: block;
  min-height: 0;
  font-weight: 400;
}
.item-card__img {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--fill);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.item-card__img img { width: 100%; height: 100%; object-fit: cover; }
.item-card__body { padding: 10px var(--sp-3) var(--sp-3); display: flex; flex-direction: column; gap: 6px; }
.item-card__title {
  font-size: var(--fs-13);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.item-card__meta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-11); color: var(--text-3); }
.item-card__dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.item-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.item-card__price { font-size: var(--fs-13); color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.item-card__rebate {
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--brand-50);
  color: var(--brand);
  font-size: var(--fs-13);
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- 分段控件 / 标签 ---------- */
.segmented {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: none;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--r-full);
  background: #fff;
  color: var(--text-2);
  font-size: var(--fs-13);
  font-weight: 500;
  scroll-snap-align: start;
}
.card .segmented button { background: var(--fill); }
.segmented button.active {
  background: var(--text);
  color: #fff;
  font-weight: 600;
}
.segmented .count { opacity: 0.6; margin-left: 4px; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: var(--fs-11);
  font-weight: 600;
  background: var(--brand-50);
  color: var(--brand-ink);
  white-space: nowrap;
}
.badge.gray { background: var(--fill); color: var(--text-3); }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.warn { background: var(--warning-bg); color: var(--warning); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- 列表 / 订单卡 ---------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }
.list-item .title { font-size: var(--fs-15); font-weight: 600; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }

.order-card {
  display: flex;
  gap: var(--sp-3);
  width: 100%;
  text-align: left;
  padding: 14px var(--sp-4);
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  min-height: 0;
  font-weight: 400;
}
.order-card:active:not(:disabled) { transform: none; background: var(--fill); }
.order-card:last-child { border-bottom: 0; }
.order-card .thumb { border-radius: 10px; }
.order-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.order-card__title {
  font-size: var(--fs-15);
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-card__meta { font-size: var(--fs-11); color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.order-card__right { flex: none; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.order-card__rebate { font-size: var(--fs-17); font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }

/* ---------- 钱包 ---------- */
.balance-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 12px 28px rgba(242, 48, 47, 0.24);
}
.balance-card::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -60px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.balance-card > * { position: relative; z-index: 1; }
.balance-card .label { font-size: var(--fs-13); color: rgba(255, 255, 255, 0.86); }
.balance-card .amount {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.balance-card .amount small { font-size: var(--fs-20); font-weight: 700; margin-right: 2px; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.metrics .metric { text-align: left; }
.metrics .k { font-size: var(--fs-12); color: rgba(255, 255, 255, 0.78); }
.metrics .v { font-size: var(--fs-17); font-weight: 700; font-variant-numeric: tabular-nums; }
.wallet-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}
.wallet-actions > button { width: 100%; min-width: 0; padding: 0 var(--sp-3); white-space: nowrap; min-height: 46px; }
.balance-card .btn-primary { background: #fff; color: var(--brand); }
@media (hover: hover) { .balance-card .btn-primary:hover { background: #fff6f2; } }
.withdraw-help-btn {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}
.withdraw-help-btn__mark {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: var(--fs-12);
  font-weight: 800;
  line-height: 1;
}
@media (hover: hover) {
  .withdraw-help-btn:hover { background: rgba(255, 255, 255, 0.24); }
}
.balance-card .hint { color: rgba(255, 255, 255, 0.86); }
.balance-card .hint:empty { display: none; }

.withdraw-guide__intro { margin-bottom: var(--sp-4); }
.withdraw-guide__eyebrow {
  margin-bottom: var(--sp-1);
  color: var(--brand-ink);
  font-size: var(--fs-11);
  font-weight: 700;
}
.withdraw-guide__title { margin-bottom: var(--sp-2); }
.withdraw-guide__intro p {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-13);
  line-height: 1.7;
}
.withdraw-guide__status {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: var(--fs-13);
  line-height: 1.6;
}
.withdraw-guide__status.is-ready { background: var(--success-bg); color: var(--success); }
.withdraw-guide__status > span { flex: none; font-weight: 600; }
.withdraw-guide__status > strong { min-width: 0; font-weight: 600; }
.withdraw-guide__limits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.withdraw-guide__limits div { min-width: 0; }
.withdraw-guide__limits span {
  display: block;
  color: var(--text-3);
  font-size: var(--fs-11);
}
.withdraw-guide__limits strong {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-13);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.withdraw-guide__section { margin-top: var(--sp-5); }
.withdraw-guide__section h4 { margin: 0 0 var(--sp-3); font-size: var(--fs-15); }
.withdraw-guide__section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}
.withdraw-guide__section-head span {
  color: var(--text-3);
  font-size: var(--fs-11);
}
.withdraw-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.withdraw-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--sp-3);
  min-height: 72px;
}
.withdraw-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 28px;
  bottom: 4px;
  width: 1px;
  background: var(--line-strong);
}
.withdraw-steps__num {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--fs-11);
  font-weight: 700;
}
.withdraw-steps li strong { font-size: var(--fs-13); }
.withdraw-steps li p {
  margin: 2px 0 var(--sp-3);
  color: var(--text-3);
  font-size: var(--fs-13);
  line-height: 1.65;
}
.withdraw-faq { border-top: 1px solid var(--line); }
.withdraw-faq:last-child { border-bottom: 1px solid var(--line); }
.withdraw-faq summary {
  min-height: var(--tap);
  padding: var(--sp-3) 28px var(--sp-3) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  position: relative;
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-13);
  font-weight: 600;
  line-height: 1.6;
}
.withdraw-faq summary::-webkit-details-marker { display: none; }
.withdraw-faq summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 12px;
  color: var(--text-3);
  font-size: var(--fs-20);
  font-weight: 400;
  line-height: 1;
}
.withdraw-faq[open] summary::after { content: "−"; }
.withdraw-faq__q { flex: none; color: var(--brand-ink); font-weight: 700; }
.withdraw-faq__a {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: var(--sp-2);
  padding: 0 28px var(--sp-4) 0;
  color: var(--text-2);
  font-size: var(--fs-13);
  line-height: 1.7;
}
.withdraw-faq__a > span { color: var(--text-3); font-weight: 700; }
.withdraw-faq__a p { margin: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.stat { background: var(--fill); border-radius: var(--r-md); padding: var(--sp-3); }
.stat .k { font-size: var(--fs-11); color: var(--text-3); }
.stat .v { font-size: var(--fs-20); font-weight: 700; margin-top: 2px; }
.row--start { justify-content: flex-start; flex-wrap: wrap; }


/* ---------- 弹层 ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(17, 19, 24, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-sheet);
  max-width: 480px;
  margin: 0 auto;
  max-height: 84dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-2);
  padding: 0 var(--sp-5) calc(var(--sp-5) + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 240ms var(--ease);
}
.sheet.open { transform: translateY(0); }
.sheet__grip {
  width: 36px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--line-strong);
  margin: var(--sp-2) auto var(--sp-4);
}
.sheet__title { font-size: var(--fs-20); font-weight: 700; margin: 0 0 var(--sp-3); letter-spacing: -0.3px; }
.sheet__actions { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-5); }
.sheet__actions .btn-primary { min-height: 50px; border-radius: var(--r-lg); }

.copy-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-15);
  line-height: 1.6;
  word-break: break-all;
  padding: var(--sp-3) var(--sp-4);
  background: var(--brand-50);
  border: 1px dashed rgba(255, 74, 38, 0.4);
  border-radius: var(--r-md);
  color: var(--brand-ink);
  user-select: all;
}

/* ---------- 状态 ---------- */
.empty-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-2);
  padding: 40px var(--sp-5);
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-13);
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.empty-state::before, .error-state::before {
  content: "";
  width: 64px;
  height: 64px;
  margin-bottom: var(--sp-2);
  border-radius: 50%;
  background: var(--brand-50) center / 30px no-repeat;
}
.empty-state::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff4a26' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12l2 4v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7z'/%3E%3Cpath d='M4 7h16M9 11a3 3 0 0 0 6 0'/%3E%3C/svg%3E");
}
.error-state::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff4a26' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E");
}
.empty-state strong, .error-state strong { font-size: var(--fs-17); color: var(--text); font-weight: 600; }
.empty-state .btn, .error-state .btn,
.empty-state button, .error-state button { margin-top: var(--sp-3); min-width: 120px; }
.empty-state .btn-primary { box-shadow: var(--brand-shadow); }
.empty { padding: var(--sp-6) 0; text-align: center; color: var(--text-3); font-size: var(--fs-13); }

.notice {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: var(--fs-13);
  margin-bottom: var(--sp-3);
}
.notice .btn, .notice button { margin-left: auto; color: var(--warning); font-size: var(--fs-13); min-height: 32px; }

.skeleton { background: #e9ebef; border-radius: var(--r-sm); position: relative; overflow: hidden; }
.card .skeleton { background: var(--fill); }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton--text { height: 14px; margin-bottom: 8px; }
.skeleton--title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton--img { aspect-ratio: 1 / 1; border-radius: var(--r-md); }
.skeleton--line { height: 56px; margin-bottom: 8px; border-radius: var(--r-md); }

.spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + var(--sp-3));
  transform: translate(-50%, -8px);
  z-index: var(--z-toast);
  max-width: 82%;
  padding: 10px var(--sp-4);
  border-radius: var(--r-full);
  background: rgba(21, 23, 28, 0.92);
  color: #fff;
  font-size: var(--fs-13);
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast--err { background: var(--danger); }
.toast__icon { font-weight: 700; }

/* ---------- 登录 ---------- */
.auth { padding: calc(var(--sp-8) + var(--safe-top)) var(--sp-4) 0; }
.auth__head { padding: 0 var(--sp-1); margin-bottom: var(--sp-5); }
.auth__logo {
  width: 52px;
  height: 52px;
  margin-bottom: var(--sp-4);
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--brand-grad);
  color: #fff;
  font-size: var(--fs-24);
  font-weight: 800;
  box-shadow: var(--brand-shadow);
}
.auth h1 { margin: 0 0 var(--sp-1); font-size: var(--fs-28); font-weight: 800; letter-spacing: -0.6px; }
.auth__sub { margin: 0; font-size: var(--fs-13); color: var(--text-3); }
.auth__panel { padding: var(--sp-5) var(--sp-4); }
.auth__agree {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-13);
  color: var(--text-2);
  line-height: 1.6;
}
.auth__agree input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.auth #submit { min-height: 50px; font-size: var(--fs-17); border-radius: var(--r-lg); box-shadow: var(--brand-shadow); }
.auth__invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  background: var(--brand-50);
  font-size: var(--fs-13);
  color: var(--text-2);
}
.auth__invite b { color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.5px; }
.auth__invite-ask { display: block; margin: 0 0 var(--sp-3) calc(var(--sp-2) * -1); color: var(--text-3); }
.auth__switch { margin: var(--sp-3) 0 0; text-align: center; font-size: var(--fs-13); color: var(--text-3); }
.auth__switch .btn-text { color: var(--brand-ink); padding: 0 var(--sp-1); min-height: 0; }
.auth__browse { display: block; margin-top: var(--sp-4); text-align: center; font-size: var(--fs-13); color: var(--text-2); text-decoration: none; }
.auth__foot { margin-top: var(--sp-5); font-size: var(--fs-12); color: #9aa1ad; line-height: 1.7; text-align: center; }

/* ---------- 微信转 App 交接 ---------- */
.handoff {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  background: #fff;
}
.handoff--taobao { --handoff-radius: var(--r-full); --handoff-num-radius: 50%; }
.handoff--pdd { --handoff-radius: 7px; --handoff-num-radius: 8px; }

.handoff__wechat {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.handoff__guideBand {
  position: relative;
  min-height: clamp(188px, 28dvh, 260px);
  padding: var(--safe-top) var(--sp-5) 0;
  display: flex;
  align-items: center;
  background: var(--platform-color);
  color: #fff;
}
.handoff__guideContent {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}
.handoff__steps {
  --handoff-step-gap: clamp(18px, 3dvh, 28px);
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.handoff__steps li {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 40px;
}
.handoff__steps li + li { margin-top: var(--handoff-step-gap); }
.handoff__steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 30px;
  width: 1px;
  height: calc(var(--handoff-step-gap) + 22px);
  background: #fff;
  opacity: 0.38;
}
.handoff__num {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--handoff-num-radius, 8px);
  color: #fff;
  font-size: var(--fs-11);
  font-weight: 700;
}
.handoff__stepText {
  min-width: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.handoff__dots {
  margin-left: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 700;
  vertical-align: 1px;
}
.handoff__arrow {
  position: absolute;
  top: 16px;
  right: 8px;
  width: 64px;
  height: 64px;
  fill: none;
  color: #fff;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
  transform-origin: 62% 20%;
  will-change: transform, opacity;
  animation: handoff-arrow-guide 1.35s ease-in-out infinite;
}
.handoff__arrow path {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 10px;
  stroke-linejoin: round;
  paint-order: stroke fill;
}
@keyframes handoff-arrow-guide {
  0%,
  100% {
    opacity: 0.76;
    transform: translateY(2px) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-7px) scale(1.04);
  }
}
.handoff__appIdentity {
  flex: 1;
  min-height: 0;
  padding: 0 var(--sp-5) calc(var(--safe-bottom) + 32px);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.handoff__icon {
  width: clamp(88px, 24vw, 108px);
  height: clamp(88px, 24vw, 108px);
  display: block;
  border-radius: clamp(21px, 6vw, 27px);
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(17, 19, 24, 0.14);
}
.handoff__icon--fallback {
  display: grid;
  place-items: center;
  background: var(--platform-color);
  color: #fff;
  font-size: var(--fs-34);
  font-weight: 700;
}
.handoff__appName {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
.handoff__browser {
  --handoff-browser-icon-size: clamp(114.4px, 31.2vw, 130.4px);
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100dvh;
  padding: calc(var(--safe-top) + 48px) var(--sp-5) calc(var(--safe-bottom) + 40px);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
}
.handoff__icon--browser {
  flex: 0 0 auto;
  width: var(--handoff-browser-icon-size);
  height: var(--handoff-browser-icon-size);
  border: 0;
  border-radius: clamp(34px, 9.5vw, 39px);
  background: #fff;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
  transform: translateY(-24px);
}
.handoff__launch {
  width: clamp(185px, calc(51vw - 12px), 209px);
  max-width: 100%;
  min-height: 56px;
  padding: 0 var(--sp-5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--handoff-radius, var(--r-md));
  background: var(--platform-button-color, var(--platform-color));
  color: var(--platform-button-text, #fff);
  font-family: inherit;
  font-size: var(--fs-17);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}
.handoff__browser .handoff__launch {
  flex: 0 0 auto;
  width: var(--handoff-browser-icon-size);
  max-width: var(--handoff-browser-icon-size);
  padding: 0 var(--sp-1);
  background: var(--platform-button-color, var(--platform-color));
  color: var(--platform-button-text, #fff);
  min-height: 48px;
  font-size: clamp(16px, 4.7vw, 20px);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}
.handoff__launch:active { filter: brightness(0.92); }
.handoff--expired {
  padding: calc(var(--safe-top) + 48px) var(--sp-5) calc(var(--safe-bottom) + 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.handoff__expired { width: 100%; max-width: 320px; margin: 0 auto; }
.handoff__expired h1 {
  margin: 0;
  font-size: var(--fs-20);
  font-weight: 700;
}
.handoff__expired p {
  margin: var(--sp-2) 0 var(--sp-6);
  color: var(--text-3);
  font-size: var(--fs-13);
}
.handoff__expired .handoff__launch {
  background: var(--text);
  border-radius: var(--r-md);
}

@media (max-height: 640px) {
  .handoff__guideBand { min-height: 176px; }
  .handoff__steps { --handoff-step-gap: 16px; }
  .handoff__appIdentity {
    padding-bottom: calc(var(--safe-bottom) + 20px);
    gap: 10px;
  }
  .handoff__appIdentity .handoff__icon {
    width: 84px;
    height: 84px;
    border-radius: 21px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .app.is-flush { max-width: none; box-shadow: none; }
  .handoff__guideBand { min-height: 148px; }
}

.account-page { padding-top: var(--sp-2); }
.account-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-15);
}
.account-line:first-child { padding-top: 2px; }
.account-line:last-child { border-bottom: 0; padding-bottom: 2px; }
.account-line b { text-align: right; word-break: break-all; font-weight: 600; font-variant-numeric: tabular-nums; }
.account-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.account-actions .btn, .account-actions button { width: 100%; }
.account-tip { margin: calc(var(--sp-1) * -1) var(--sp-1) var(--sp-3); font-size: var(--fs-12); }

/* ---------- 我的 ---------- */
.link-row { color: inherit; text-decoration: none; }
.link-row .title { margin-bottom: 0; }
.me-orders { margin-top: var(--sp-3); }
.me-orders__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
  color: inherit;
  text-decoration: none;
}
.me-orders__head .title { font-size: var(--fs-15); font-weight: 600; }
.me-orders__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-1); }
.me-orders__grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) 0;
  border-radius: var(--r-md);
  color: inherit;
  text-decoration: none;
}
.me-orders__grid a:active { background: var(--fill); }
.me-orders__grid b { font-size: var(--fs-20); font-weight: 700; font-variant-numeric: tabular-nums; }
.me-orders__grid span { font-size: var(--fs-12); color: var(--text-3); }

/* ---------- 后台（独立一套，只跟随 token） ---------- */
.admin {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-8);
  background: var(--bg-subtle);
  min-height: 100dvh;
}
.admin h1 { font-size: var(--fs-20); margin: 0 0 var(--sp-1); }
.admin .card { box-shadow: none; border: 1px solid var(--line); }
.admin .row { flex-wrap: wrap; }
.admin input, .admin select { font-size: var(--fs-13); min-height: 38px; padding: 8px 10px; }
.admin .btn { min-height: 38px; font-size: var(--fs-13); padding: 0 var(--sp-3); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
.table-wrap th, .table-wrap td { padding: 10px var(--sp-3); text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap th { color: var(--text-3); font-weight: 600; background: var(--bg-subtle); white-space: nowrap; }
.table-wrap tr:last-child td { border-bottom: 0; }
.admin .list-item .title { font-size: var(--fs-13); }
.admin .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin .row--start { justify-content: flex-start; }

@media (max-width: 720px) {
  .admin .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin { padding: var(--sp-4) var(--sp-3) var(--sp-8); }
}

/* ---------- 适配 ---------- */
@media (min-width: 600px) {
  body { background: #e9ebef; }
  .app:not(.is-flush) { box-shadow: 0 0 0 1px var(--line-strong); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 邀请好友 / 我的团队 ---------- */
.invite-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.invite-code__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-28);
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--brand-ink);
}
.invite-link { margin-top: var(--sp-3); font-size: var(--fs-13); }
.invite-poster { display: block; width: 100%; max-width: 320px; margin: var(--sp-3) auto 0; border-radius: var(--r-lg); box-shadow: 0 8px 24px rgba(21, 23, 28, 0.12); }
.invite-poster-wrap { text-align: center; }
.team-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.team-stats .stat { text-align: center; }
.team-tag { font-size: var(--fs-12); color: var(--text-3); }
