/* =====================================================================
   base.css — 设计令牌 / 重置 / 壳层（顶栏、视图、底部 Tab）
   电商活力风·浅底；基准 360px；320px 不溢出
   ===================================================================== */
:root {
  --bg: #F6F7FB; --card: #FFFFFF; --line: #EEF0F5; --line-2: #E3E6EE;
  --tx: #1F2333; --tx-2: #8A8FA3; --tx-3: #B4B8C8;
  --p1: #FF6B35; --p2: #FF3D71; --grad: linear-gradient(135deg, #FF6B35 0%, #FF3D71 100%);
  --a1: #7C4DFF; --a2: #448AFF; --grad-2: linear-gradient(135deg, #7C4DFF 0%, #448AFF 100%);
  --gold: #F5A623; --ok: #16A34A; --err: #EF4444; --warn: #F59E0B;
  --p-soft: #FFF1EA; --a-soft: #F1EEFF; --gold-soft: #FFF6E5; --ok-soft: #ECFDF3; --err-soft: #FEF2F2;
  --shadow: 0 6px 24px rgba(31, 35, 51, .06); --shadow-2: 0 10px 30px rgba(31, 35, 51, .10);
  --glow: 0 8px 20px rgba(255, 92, 80, .32); --glow-2: 0 8px 20px rgba(98, 108, 255, .3);
  --r: 16px; --r-sm: 12px; --r-xs: 8px;
  --top-h: 52px; --tab-h: 56px; --sa-b: env(safe-area-inset-bottom, 0px); --sa-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.22, 1, .36, 1); --ease-b: cubic-bezier(.34, 1.56, .64, 1);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 14px/1.5 var(--font); min-height: 100vh; overflow-x: hidden; overscroll-behavior-y: contain; -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { outline: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.hide { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.tx2 { color: var(--tx-2); }
.tx3 { color: var(--tx-3); }
.pos { color: var(--ok); }
.neg { color: var(--err); }
.gold { color: var(--gold); }
.primary { color: var(--p2); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.b { font-weight: 700; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mb12 { margin-bottom: 12px; }
.break { word-break: break-all; }

/* ---------- 壳层 ---------- */
.shell { position: relative; width: 100%; max-width: 560px; margin: 0 auto; min-height: 100vh; }
.view { padding: calc(var(--top-h) + var(--sa-t) + 10px) 12px calc(var(--tab-h) + var(--sa-b) + 16px); min-height: 100vh; }
.view.no-tab { padding-bottom: calc(var(--sa-b) + 24px); }
.view.bleed { padding-top: 0; }
.page { animation: pageIn .32s var(--ease) both; }
.page.from-left { animation-name: pageInLeft; }
.page.pop { animation-name: pageInPop; }

/* ---------- 顶栏 ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; background: rgba(255, 255, 255, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(31, 35, 51, .05); padding-top: var(--sa-t); transition: background .25s, box-shadow .25s; }
.topbar.sub { background: rgba(255, 255, 255, .96); }
.topbar.ghost { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar.ghost .topbar-title, .topbar.ghost .icon-btn { color: #fff; }
.topbar-in { max-width: 560px; margin: 0 auto; height: var(--top-h); display: flex; align-items: center; padding: 0 8px 0 10px; gap: 6px; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-logo { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: var(--glow); flex: none; }
.brand-logo img { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: 16px; letter-spacing: .5px; }
.brand-text small { font-size: 10px; color: var(--tx-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar.sub .brand { display: none; }
.topbar-title { flex: 1; text-align: center; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 40px; }
.topbar.sub .topbar-title { padding-right: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; min-width: 40px; justify-content: flex-end; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--tx); position: relative; overflow: hidden; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { background: rgba(31, 35, 51, .06); }

/* ---------- 底部 Tab ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tab-h) + var(--sa-b)); padding-bottom: var(--sa-b); background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid rgba(31, 35, 51, .06); display: flex; max-width: 560px; margin: 0 auto; transition: transform .3s var(--ease); }
.tabbar.hide-tab { transform: translateY(110%); pointer-events: none; visibility: hidden; transition: transform .3s var(--ease), visibility 0s .3s; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--tx-2); font-size: 11px; position: relative; overflow: hidden; height: var(--tab-h); }
.tab-ic { width: 24px; height: 24px; transition: transform .35s var(--ease-b), color .2s; }
.tab-ic svg { width: 24px; height: 24px; }
.tab.on { color: var(--p2); font-weight: 600; }
.tab.on .tab-ic { animation: tabBounce .45s var(--ease-b); color: var(--p2); }
.tab-glow { position: absolute; top: 0; left: 0; width: 25%; height: 3px; pointer-events: none; transition: left .35s var(--ease-b); }
.tab-glow::after { content: ""; position: absolute; left: 50%; top: 0; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 3px 3px; background: var(--grad); box-shadow: 0 2px 8px rgba(255, 61, 113, .5); }

/* ---------- 下拉刷新 ---------- */
.ptr { position: fixed; top: calc(var(--top-h) + var(--sa-t)); left: 0; right: 0; z-index: 39; display: flex; justify-content: center; align-items: center; gap: 8px; height: 40px; font-size: 12px; color: var(--tx-2); opacity: 0; transform: translateY(-40px); transition: opacity .2s, transform .2s; pointer-events: none; }
.ptr.show { opacity: 1; transform: translateY(0); }
.ptr-ring { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--p2); transform: rotate(var(--rot, 0deg)); }
.ptr.loading .ptr-ring { animation: spin .7s linear infinite; }

/* ---------- 标题/区块 ---------- */
.sec { margin: 16px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.sec h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.sec h3::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--grad); }
.sec .more { font-size: 12px; color: var(--tx-2); display: flex; align-items: center; gap: 2px; }
.sec .more svg { width: 14px; height: 14px; }
.page-h1 { font-size: 20px; font-weight: 800; margin: 6px 0 2px; }
.page-sub { color: var(--tx-2); font-size: 13px; margin-bottom: 14px; }

/* ---------- 320px 微调 ---------- */
@media (max-width: 340px) {
  .view { padding-left: 10px; padding-right: 10px; }
  .brand-text small { display: none; }
}
