/* ==========================================================================
   返利宝 · H5 样式
   原则：白底、单一品牌色（橙色只给钱和主按钮）、4pt 栅格、6 级字号。
   所有 H5 规则限定在 .app 内，后台（.admin）单独一套，互不污染。
   ========================================================================== */

:root {
  /* 品牌：只用于金额、主按钮、焦点环 */
  --brand: #ff4d2d;
  --brand-press: #e63e1f;
  --brand-ink: #b23c1a;      /* 小字品牌色，白底对比 ≥4.5:1 */
  --brand-50: #fff4f0;       /* 券标签底色 */

  /* 中性 */
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --surface: #ffffff;
  --text: #111318;
  --text-2: #4a5160;
  --text-3: #6b7280;
  --line: #eceef2;
  --line-strong: #dfe3e9;

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

  /* 字号：6 级，不再出现 12.5 / 13.5 / 14.5 这种半级 */
  --fs-11: 11px;
  --fs-13: 13px;
  --fs-15: 15px;
  --fs-17: 17px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-34: 34px;

  /* 间距：4pt */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* 圆角 4 级 / 阴影 2 级 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-full: 999px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-2: 0 8px 24px rgba(16, 24, 40, 0.12);

  --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%;
}

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

/* ---------- 骨架 ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: var(--sp-6);
}
.app.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--sp-6)); }

.appbar {
  position: sticky;
  top: 0;
  z-index: var(--z-appbar);
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.appbar.is-scrolled { border-bottom-color: var(--line); }
.appbar__inner {
  height: var(--tap);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
}
.appbar__title { font-size: var(--fs-17); font-weight: 600; letter-spacing: -0.2px; }
.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__brand { font-size: var(--fs-17); font-weight: 800; letter-spacing: -0.3px; }
.appbar__brand span { color: var(--brand); }

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

/* ---------- 底部导航（唯一导航，顶栏不再重复） ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-tabbar);
  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(12px);
  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: 2px;
  font-size: var(--fs-11);
  color: var(--text-3);
}
.tabbar a.active { color: var(--text); font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; }

/* ---------- 通用 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.card--flush { padding: 0; overflow: hidden; }

.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-3);
  margin: var(--sp-5) 0 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);
  touch-action: manipulation;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-secondary { background: var(--bg-subtle); color: var(--text); border: 1px solid var(--line); }
.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: 36px; 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, .btn-line:hover { background: var(--bg-subtle); }
}

/* ---------- 表单 ---------- */
input, textarea, select {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* 16px 以下 iOS 聚焦会放大整页 */
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 12px var(--sp-3);
  min-height: var(--tap);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 77, 45, 0.12);
}
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: var(--sp-1); font-weight: 500; }
.field-error { font-size: var(--fs-13); color: var(--danger); margin-top: var(--sp-1); }
.form-row { margin-bottom: var(--sp-3); }
.code-row { display: flex; gap: var(--sp-2); }
.code-row > input { flex: 1; min-width: 0; }
.code-row > button { flex: none; white-space: nowrap; min-width: 96px; padding: 0 var(--sp-3); }

/* ---------- 首页 ---------- */
.home { padding: calc(var(--sp-4) + var(--safe-top)) var(--sp-4) 0; }
.home__hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(46vh, 380px);
  transition: min-height var(--dur) var(--ease);
}
.home.has-result .home__hero { min-height: 0; }
.home__head { margin-bottom: var(--sp-5); }
.home h1 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-24);
  font-weight: 700;
  letter-spacing: -0.5px;
}
.home__sub { margin: 0; font-size: var(--fs-13); color: var(--text-3); }

.search-box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 77, 45, 0.1);
}
.search-box textarea {
  border: 0;
  padding: 10px var(--sp-2) 10px var(--sp-3);
  min-height: 48px;
  min-width: 0;
  background: transparent;
  box-shadow: none;
}
.search-box textarea:focus { box-shadow: none; }
.search-box > button {
  flex: none;
  padding: 0 var(--sp-4);
  white-space: nowrap;
}
.home__history .section-title { margin-top: var(--sp-4); }

.detect-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-3);
  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-6); }
.history-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.history-chip {
  max-width: 100%;
  min-height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home__platforms { margin-top: var(--sp-6); font-size: var(--fs-13); color: var(--text-3); }

.help { margin-top: var(--sp-6); border-top: 1px solid var(--line); padding-top: var(--sp-4); }
.help summary {
  list-style: none;
  cursor: pointer;
  font-size: var(--fs-13);
  color: var(--text-2);
  font-weight: 500;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: "›"; color: var(--text-3); transition: transform var(--dur); }
.help[open] summary::after { transform: rotate(90deg); }
.help ol { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); font-size: var(--fs-13); color: var(--text-3); line-height: 1.9; }

/* ---------- 商品 ---------- */
.product { display: flex; gap: var(--sp-3); }
.thumb {
  width: 88px;
  height: 88px;
  flex: none;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 6px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); }
.thumb-plat {
  color: #fff;
  font-size: var(--fs-11);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-full);
  line-height: 1.6;
}
.product h3 {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-15);
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price { display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-13); color: var(--text-3); }
.price b { color: var(--brand); font-size: var(--fs-17); font-weight: 700; }
.price s { font-size: var(--fs-13); text-decoration: line-through; }

.rebate-panel {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--brand-50);
  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); }
.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-2) 0 0;
  background: linear-gradient(to top, var(--bg) 70%, rgba(255, 255, 255, 0));
}
.sticky-cta > button { width: 100%; }
.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) 0 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-2);
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  color: var(--text-2);
  font-size: var(--fs-13);
  font-weight: 500;
}
.sort-btn::after { content: "⇅"; font-size: var(--fs-13); opacity: 0.6; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.item-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
  text-align: left;
  padding: 0;
  display: block;
  min-height: 0;
  font-weight: 400;
}
.item-card__img {
  aspect-ratio: 16 / 10;
  width: 100%;
  background: var(--bg-subtle);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.item-card__img img { width: 100%; height: 100%; object-fit: cover; }
.item-card__body { padding: 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__rebate { font-size: var(--fs-15); font-weight: 700; color: var(--brand); }

/* ---------- 分段控件 / 标签 ---------- */
.segmented {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(to right, #000 94%, transparent);
  mask-image: linear-gradient(to right, #000 94%, transparent);
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: none;
  min-height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: var(--fs-13);
  font-weight: 500;
  scroll-snap-align: start;
}
.segmented button.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
  font-weight: 600;
}
.segmented .count { opacity: 0.65; margin-left: 4px; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-full);
  font-size: var(--fs-11);
  font-weight: 600;
  background: var(--brand-50);
  color: var(--brand-ink);
  white-space: nowrap;
}
.badge.gray { background: var(--bg-subtle); 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; }

.order-card {
  display: flex;
  gap: var(--sp-3);
  width: 100%;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  min-height: 0;
  font-weight: 400;
}
.order-card:last-child { border-bottom: 0; }
.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 {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-4);
  background: #fff;
}
.balance-card .label { font-size: var(--fs-13); color: var(--text-3); }
.balance-card .amount {
  font-size: var(--fs-34);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.balance-card .amount small { font-size: var(--fs-17); font-weight: 700; margin-right: 2px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-top: var(--sp-4); }
.metrics .metric { text-align: left; }
.metrics .k { font-size: var(--fs-11); color: var(--text-3); }
.metrics .v { font-size: var(--fs-15); font-weight: 600; font-variant-numeric: tabular-nums; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.stat { background: var(--bg-subtle); 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-height: 82dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-2);
  padding: 0 var(--sp-4) calc(var(--sp-4) + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform var(--dur) 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-3);
}
.sheet__title { font-size: var(--fs-17); font-weight: 600; margin: 0 0 var(--sp-3); }
.sheet__actions { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4); }

.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);
  background: var(--bg-subtle);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  user-select: all;
}

/* ---------- 状态 ---------- */
.empty-state, .error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-4);
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-13);
}
.empty-state strong, .error-state strong { font-size: var(--fs-15); color: var(--text); font-weight: 600; }
.empty-state .btn, .error-state .btn { margin-top: var(--sp-2); }
.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: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: var(--fs-13);
  margin-bottom: var(--sp-3);
}
.notice .btn { margin-left: auto; color: var(--warning); font-size: var(--fs-13); min-height: 32px; }

.skeleton { background: var(--bg-subtle); border-radius: var(--r-sm); position: relative; overflow: hidden; }
.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: 16 / 10; border-radius: var(--r-md); }
.skeleton--line { height: 56px; margin-bottom: 8px; border-radius: var(--r-md); }

.spin {
  width: 16px;
  height: 16px;
  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: #1a1d24;
  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-5) 0; }
.auth h1 { margin: 0 0 var(--sp-2); font-size: var(--fs-24); font-weight: 700; letter-spacing: -0.4px; }
.auth__sub { margin: 0 0 var(--sp-6); font-size: var(--fs-13); color: var(--text-3); }
.auth .form-row { margin-bottom: var(--sp-3); }
.auth .code-row { display: flex; gap: var(--sp-2); }
.auth .code-row input { flex: 1; }
.auth .code-row .btn { flex: none; min-width: 104px; }
.auth__foot { margin-top: var(--sp-5); font-size: var(--fs-13); color: var(--text-3); line-height: 1.7; }
.auth__dev {
  margin-top: var(--sp-6);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  font-size: var(--fs-11);
  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; }
.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) {
  .app { max-width: 480px; }
  body { background: var(--bg-subtle); }
  .app { background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
