* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #f3f5fb;
  --text: #1d2433;
  --sub: #8b91a1;
  --sub-2: #b3b8c6;
  --line: #eef0f5;
  --primary: #3b78f5;
  --primary-2: #6198ff;
  --green: #22b573;
  --red: #f0564a;
  --orange: #f5a524;
  --card: #fff;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom);
}
html, body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: linear-gradient(180deg, #e7ecfc 0, #f3f5fb 320px) no-repeat, var(--bg);
}
a { color: inherit; text-decoration: none; }
button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; }
.num { font-family: "DIN Alternate", "DIN", "Roboto", "Helvetica Neue", Arial, sans-serif; }
.hidden { display: none !important; }

/* ---------- 导航栏 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  height: 50px; display: flex; align-items: center;
  padding: 0 12px;
}
.navbar.solid { background: rgba(240, 243, 251, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.navbar .back { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; margin-left: -6px; }
.navbar .back svg { width: 22px; height: 22px; }
.navbar .title { font-size: 19px; font-weight: 600; letter-spacing: .5px; }
.navbar .logo { font-size: 20px; margin-right: 6px; }

.page { padding: 6px 16px calc(28px + var(--safe-b)); }
.page.has-tabbar { padding-bottom: calc(96px + var(--safe-b)); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(60, 80, 140, .05); }
.glass { background: rgba(255, 255, 255, .62); border: 1px solid rgba(255, 255, 255, .8); border-radius: var(--radius); }

/* ---------- 按钮 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  height: 48px; border-radius: 12px; font-size: 17px; font-weight: 500; width: 100%;
  transition: transform .1s, opacity .2s;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn-primary { color: #fff; background: linear-gradient(180deg, var(--primary-2), var(--primary)); box-shadow: 0 6px 16px rgba(59, 120, 245, .3); }
.btn-ghost { color: #5b6275; height: 40px; font-size: 15px; }
.btn-line { color: var(--primary); border: 1px solid rgba(59, 120, 245, .4); background: #fff; }
.btn-gold { color: #5b3a0a; background: linear-gradient(90deg, #ffe7b0, #f6c46a); box-shadow: 0 6px 16px rgba(214, 160, 60, .3); }
.btn-lime { color: #1d2433; background: linear-gradient(180deg, #c9f56a, #a6e33d); border-radius: 26px; font-weight: 600; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-pill-dark {
  display: inline-flex; align-items: center; gap: 2px;
  height: 30px; padding: 0 12px 0 14px; border-radius: 16px;
  color: #fff; font-size: 13px;
  background: linear-gradient(90deg, #8a8fa3, #5d6275);
  box-shadow: 0 3px 8px rgba(60, 66, 90, .25);
}
.pill-star {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 14px 0 6px; border-radius: 16px;
  background: linear-gradient(90deg, #eef0f5, #dfe3ec);
  font-size: 15px; font-weight: 600; color: #2a3142;
  white-space: nowrap; flex-shrink: 0;
}
.pill-star svg { width: 30px; height: 30px; margin-top: -6px; }

/* ---------- 底部 tabbar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 60;
  height: calc(64px + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: rgba(255, 255, 255, .96);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(40, 60, 120, .06);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #9aa0ae; font-size: 11px; }
.tabbar a svg { width: 28px; height: 28px; }
.tabbar a.active { color: var(--primary); }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(70, 76, 92, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 0 44px; opacity: 0; transition: opacity .2s;
}
.mask.show { opacity: 1; }
.mask.sheet { align-items: flex-end; padding: 0; }
.dialog {
  position: relative; width: 100%; max-width: 340px;
  border-radius: 22px; padding: 26px 22px 22px;
  background: linear-gradient(180deg, #e9eeff 0, #dce5ff 100%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 20px 50px rgba(30, 50, 110, .2);
  transform: scale(.92); transition: transform .2s;
}
.mask.show .dialog { transform: scale(1); }
.dialog .close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, .8); color: #9aa0ae; font-size: 18px; line-height: 30px; text-align: center;
}
.dialog .d-title { font-size: 19px; font-weight: 700; text-align: center; margin-bottom: 14px; }
.dialog .d-body { font-size: 14px; color: #4b5263; line-height: 1.7; }
.dialog .d-box { background: rgba(255, 255, 255, .75); border: 1px solid #fff; border-radius: 14px; padding: 14px; }
.dialog .d-actions { display: flex; gap: 12px; margin-top: 20px; }
.dialog .d-actions .btn { height: 44px; font-size: 16px; }
.dialog .d-actions .btn-cancel { background: rgba(255, 255, 255, .85); color: #5b6275; }

.sheet-panel {
  width: 100%; max-width: 480px; background: #fff;
  border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + var(--safe-b));
  transform: translateY(100%); transition: transform .25s;
}
.mask.show .sheet-panel { transform: translateY(0); }

.fail-ic { font-size: 52px; text-align: center; line-height: 1; margin: -4px 0 10px; }
.fail-box { text-align: center; padding: 18px 12px !important; }
.fail-box p { font-size: 16px; color: #2a3142; font-weight: 500; }
.fail-box b { color: var(--red); }
.fail-sub { display: inline-block; margin-top: 10px; padding: 3px 12px; border-radius: 12px; background: #e6e9f0; color: #6b7285; font-size: 13px; }
.fail-tip { text-align: center; font-size: 12px; color: var(--sub); margin-top: 12px; }
.fail-btns { margin-top: 16px; }
.fail-btns .btn-ghost { margin-top: 6px; }

.toast {
  position: fixed; left: 50%; top: 45%; z-index: 200;
  transform: translate(-50%, -50%);
  background: rgba(20, 24, 36, .82); color: #fff;
  padding: 10px 18px; border-radius: 10px; font-size: 14px; max-width: 70%; text-align: center;
  animation: toastIn .2s;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -40%); } }

.loading { text-align: center; color: var(--sub); padding: 40px 0; }

/* ---------- 通用区块标题 ---------- */
.sec-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.sec-title h3 { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; }
.sec-title h3::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--primary); }
.sec-title .more { color: #5b6275; font-size: 13px; display: flex; align-items: center; }

.arrow-r { display: inline-block; width: 7px; height: 7px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); margin-left: 4px; }

/* 列表 */
.cell { display: flex; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.cell:last-child { border-bottom: 0; }
.cell .ic { width: 26px; font-size: 20px; margin-right: 10px; text-align: center; }
.cell .label { flex: 1; }
.cell .val { color: var(--sub); font-size: 13px; margin-right: 6px; }
.cell .go { color: #b3b8c6; font-size: 14px; }

.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
