:root {
  --bg: #f7f8fa;
  --card: #fff;
  --text: #111;
  --muted: #8a8f98;
  --line: #eceef2;
  --blue: #2f7dff;
  --blue-soft: #eaf1ff;
  --orange: #ff7a1a;
  --danger: #e5484d;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: calc(58px + var(--safe-b));
  --font: "Noto Sans SC", "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #0f172a; }
body {
  font-family: var(--font);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
button { border: 0; background: none; cursor: pointer; color: inherit; }
[hidden] { display: none !important; }

.phone {
  width: min(100%, 430px);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  background: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06);
}

.page {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.page.active { display: flex; }

/* Splash */
.page-splash {
  background: radial-gradient(120% 90% at 50% 10%, #c5daf5, #7eaddf 55%, #5a94d0);
  color: #fff;
  align-items: center;
  justify-content: center;
}
.splash-inner { text-align: center; padding: 24px; width: min(100%, 360px); }
.splash-icon {
  width: 132px; height: 132px; border-radius: 30px;
  box-shadow: 0 16px 30px rgba(20,40,80,.28);
  margin-bottom: 18px;
}
.splash-brand { font-size: 32px; font-weight: 700; letter-spacing: .04em; }
.splash-handle {
  display: inline-block; margin: 10px 0 14px; padding: 6px 12px;
  border-radius: 999px; background: rgba(255,255,255,.18); font-weight: 600; font-size: 14px;
}
.splash-link {
  display: block; color: #fff; text-decoration: none; font-size: 13px; opacity: .92; margin-bottom: 22px;
  word-break: break-all;
}
.splash-enter { width: 100%; }
.btn-store {
  display: block; width: 100%; height: 48px; border-radius: 12px;
  margin-top: 10px; background: #111; color: #fff; font-weight: 700; font-size: 15px;
}
.splash-store-help {
  display: inline-block; margin-top: 14px; color: rgba(255,255,255,.92);
  font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
}

.btn-primary {
  display: block; width: 100%; height: 50px; border-radius: 12px;
  background: var(--blue); color: #fff; font-weight: 700; font-size: 16px;
}
.btn-primary:disabled { opacity: .45; }
.btn-ghost {
  flex: 0 0 auto; padding: 0 12px; height: 48px; border-radius: 10px;
  background: var(--blue-soft); color: var(--blue); font-weight: 600; white-space: nowrap;
}

/* Login */
.page-login { background: #fff; }
.login-deco, .agree-deco {
  position: absolute; right: -20px; top: 40px; width: 140px; height: 140px; opacity: .12;
  background: repeating-linear-gradient(-35deg, transparent, transparent 10px, #2f7dff 10px, #2f7dff 14px);
  pointer-events: none;
}
.icon-btn.abs-tl {
  position: absolute; left: 14px; top: calc(10px + env(safe-area-inset-top, 0));
  width: 36px; height: 36px; font-size: 18px; z-index: 2;
}
.login-body { padding: 72px 22px 28px; position: relative; z-index: 1; }
.hello { font-size: 34px; font-weight: 800; letter-spacing: .02em; }
.welcome { margin: 8px 0 28px; color: #222; font-size: 16px; }
.seg { display: flex; gap: 22px; margin-bottom: 18px; }
.seg-item { padding-bottom: 8px; color: #b0b4bb; font-weight: 600; border-bottom: 3px solid transparent; }
.seg-item.active { color: #111; border-bottom-color: #111; }
.field {
  width: 100%; height: 50px; border: 1px solid #d7dbe3; border-radius: 10px;
  padding: 0 14px; margin-bottom: 12px; outline: none; background: #fff;
}
.field:focus { border-color: var(--blue); }
.field-row { display: flex; gap: 8px; margin-bottom: 12px; }
.field-row .field { margin-bottom: 0; }
.field.grow { flex: 1; }
.dial {
  height: 50px; padding: 0 12px; border: 1px solid #d7dbe3; border-radius: 10px; font-weight: 600;
}
.login-links {
  display: flex; justify-content: space-between; margin: 4px 0 22px; font-size: 14px; font-weight: 600;
}
.link-blue { color: var(--blue); }
.link-dark { color: #222; }

/* Agree */
.page-agree { background: #fff; }
.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top, 0)) 8px 8px;
  min-height: 48px;
}
.nav-bar.solid { border-bottom: 1px solid var(--line); background: #fff; }
.nav-back { width: 40px; height: 40px; font-size: 28px; line-height: 1; }
.nav-title { font-size: 16px; font-weight: 700; }
.nav-right { width: 40px; }
.agree-body { padding: 8px 20px 28px; position: relative; z-index: 1; }
.agree-title { font-size: 28px; font-weight: 800; margin: 8px 0 22px; }
.agree-check {
  display: flex; align-items: center; gap: 8px; margin: 22px 0 18px; color: var(--blue); font-size: 14px;
}
.agree-check input { width: 18px; height: 18px; accent-color: var(--blue); }

/* Main */
.page-main { background: var(--bg); }
.tab-pane {
  display: none; flex: 1; min-height: 0; flex-direction: column;
  padding-bottom: var(--tab-h);
}
.tab-pane.active { display: flex; }
.scroll {
  flex: 1; overflow: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px 20px;
}
.top-bar, .mine-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0)) 16px 10px;
}
.top-title { font-size: 22px; font-weight: 800; }
.top-actions { display: flex; gap: 8px; }
.circle-ico {
  width: 36px; height: 36px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); position: relative; font-size: 14px;
}
.circle-ico .dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  border-radius: 999px; background: #ff3b30; display: none;
}
.circle-ico .dot.on { display: block; }

.hero-card {
  width: 100%; height: 180px; border-radius: 18px; margin: 6px 0 18px;
  background:
    radial-gradient(circle at 70% 0%, rgba(180,120,255,.55), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(255,255,255,.25), transparent 30%),
    linear-gradient(160deg, #1a1a1f, #0c0c10 60%);
  color: #fff; position: relative; overflow: hidden; text-align: left; padding: 16px;
}
.hero-card-tag { font-size: 13px; opacity: .92; }
.hero-card-hand { position: absolute; left: 50%; top: 48%; transform: translate(-50%,-50%); font-size: 42px; opacity: .9; }
.hero-card-brands {
  position: absolute; right: 16px; bottom: 14px; display: flex; align-items: center; gap: 10px; font-size: 13px;
}
.hero-card-brands i { width: 1px; height: 14px; background: rgba(255,255,255,.4); display: inline-block; }
.hero-card-brands .mc { color: #ff6a3d; letter-spacing: -2px; }

.action-row {
  display: grid; gap: 8px; margin-bottom: 18px;
}
.action-row.five { grid-template-columns: repeat(5, 1fr); }
.action-row.three { grid-template-columns: repeat(3, 1fr); max-width: 320px; margin-left: auto; margin-right: auto; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12px; color: #333; font-weight: 500;
}
.act-ico {
  width: 46px; height: 46px; border-radius: 999px; background: #f1f2f5;
  display: grid; place-items: center; font-size: 14px;
}
.act.round .act-circle {
  width: 56px; height: 56px; border-radius: 999px; border: 1.5px solid #d8dde6;
  display: grid; place-items: center; font-size: 18px; background: #fff;
}
.section { margin-top: 8px; }
.sec-tit { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.empty {
  padding: 40px 0; text-align: center; color: var(--muted);
}
.empty-ico { font-size: 48px; opacity: .35; margin-bottom: 8px; }
.bill-list, .asset-list { display: flex; flex-direction: column; gap: 8px; }
.bill-item, .asset-item {
  background: #fff; border-radius: 12px; padding: 14px; display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--line);
}
.asset-item .left { display: flex; gap: 10px; align-items: center; }
.asset-ico {
  width: 36px; height: 36px; border-radius: 999px; background: #111; color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}

/* Wallet */
.wallet-tabs {
  display: flex; gap: 24px; padding: calc(12px + env(safe-area-inset-top, 0)) 16px 0;
  border-bottom: 1px solid transparent;
}
.wtab { padding-bottom: 10px; font-size: 18px; font-weight: 700; color: #b0b4bb; border-bottom: 3px solid transparent; }
.wtab.active { color: #111; border-bottom-color: #111; }
.balance-box { text-align: center; padding: 36px 0 22px; }
.bal-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.bal-amount { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.fx-card { background: #fff; border-radius: 16px; padding: 18px; border: 1px solid var(--line); margin-top: 16px; }
.fx-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #f5f6f8; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.fx-row input {
  border: 0; background: transparent; text-align: right; font-size: 18px; font-weight: 700; width: 140px; outline: none;
}
.fx-swap { display: block; margin: 0 auto 10px; width: 40px; height: 40px; border-radius: 999px; background: #f1f2f5; font-size: 18px; }
.fx-rate { color: var(--muted); font-size: 12px; margin: 4px 0 14px; }

/* Mine */
.mine-scroll { padding-top: 0; }
.mine-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 52px; height: 52px; border-radius: 999px; background: #111; color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.mine-name { font-size: 15px; font-weight: 700; max-width: 200px; word-break: break-all; }
.mine-uid { font-size: 12px; color: var(--muted); margin-top: 4px; }
.copy-uid { margin-left: 4px; color: var(--muted); }
.safe-banner {
  margin: 8px 16px 12px; width: calc(100% - 32px); display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, #3b82f6, #2563eb); color: #fff; border-radius: 14px; padding: 16px;
  text-align: left;
}
.safe-ico { font-size: 22px; }
.safe-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.safe-txt b { font-size: 16px; }
.safe-txt small { opacity: .9; font-size: 12px; }

.list-card {
  margin: 0 16px 12px; background: #fff; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
}
.list-card.flat { border: 0; border-radius: 0; }
.list-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 16px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px;
}
.list-row:last-child { border-bottom: 0; }
.list-row .li { width: 22px; text-align: center; }
.list-row span:last-child { margin-left: auto; color: #c4c8d0; }
.list-row strong { margin-left: auto; margin-right: 6px; color: #666; font-weight: 600; font-size: 14px; }
.list-row em.orange { margin-left: auto; margin-right: 6px; color: var(--orange); font-style: normal; font-size: 13px; font-weight: 600; }
.list-row.danger { color: var(--danger); }
.badge-num {
  margin-left: auto; margin-right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ff3b30; color: #fff !important; font-size: 10px; font-weight: 700;
  display: inline-grid; place-items: center;
}

/* Tabbar */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  height: var(--tab-h); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  position: relative; color: #9aa0a8; font-size: 11px; font-weight: 600;
}
.tab.active { color: #111; }
.tab-ico { font-size: 20px; line-height: 1; }
.tab-badge {
  position: absolute; top: 6px; right: calc(50% - 22px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: #ff3b30; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px;
}

/* Sub */
.page-sub { background: #fff; }
.sub-body { padding: 16px 18px 28px; flex: 1; overflow: auto; }
.sub-body h2 { font-size: 18px; margin-bottom: 10px; }
.sub-body p { color: #555; line-height: 1.7; font-size: 14px; margin-bottom: 10px; }
.qr-box {
  width: 200px; height: 200px; margin: 20px auto; border: 1px solid var(--line); border-radius: 12px;
  display: grid; place-items: center; background:
    repeating-conic-gradient(#111 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
  position: relative;
}
.qr-box::after {
  content: "小白商贸"; position: absolute; inset: 40px; background: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.form-stack .field { margin-bottom: 12px; }

.toast {
  position: absolute; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translateX(-50%);
  z-index: 50; background: rgba(17,24,39,.92); color: #fff; padding: 10px 16px;
  border-radius: 999px; font-size: 13px; white-space: nowrap; max-width: 90%;
}
