:root {
  --bg: #1b1b1c;
  --bg2: #121214;
  --card: #232325;
  --card2: #2a2a2c;
  --text: #f5f5f5;
  --muted: #999999;
  --green: #48ff91;
  --green-text: #041208;
  --orange: #f97316;
  --orange2: #ea580c;
  --border: #4c4d4e;
  --radius: 14px;
  --tab-h: 60px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
.hidden { display: none !important; }
img { display: block; max-width: 100%; }

.app {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  background: var(--bg);
  position: relative;
}

.page { padding: 10px 14px 0; min-height: calc(100vh - var(--tab-h)); }
.page.hidden { display: none; }
.page.no-tab { min-height: 100vh; padding-bottom: 24px; }

/* login */
#page-login {
  background: radial-gradient(circle at 20% 10%, rgba(72,255,145,.08), transparent 40%),
              radial-gradient(circle at 80% 0%, rgba(59,130,246,.08), transparent 35%),
              var(--bg);
}
.login-wrap { padding: 8vh 0 24px; }
.brand { text-align: center; margin-bottom: 24px; }
.brand-logo-img { height: 42px; margin: 0 auto 10px; object-fit: contain; }
.brand-sub { color: var(--muted); font-size: 12px; }
.login-card { background: rgba(35,35,37,.92); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #1b1b1c;
  color: var(--text);
  outline: none;
}
.field input:focus { border-color: var(--green); }
.btn { width: 100%; padding: 13px; border-radius: 12px; font-weight: 600; }
.btn-primary { background: var(--green); color: var(--green-text); }
.error { color: #ff6b6b; font-size: 13px; margin: 10px 0 0; }

/* home header */
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px 12px; }
.logo-img { height: 28px; object-fit: contain; }
.lang {
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
}

/* asset card */
.asset-card {
  background: linear-gradient(180deg, #2a2a2c 0%, #232325 100%);
  border: 1px solid #333;
  border-radius: 18px;
  padding: 18px 16px 16px;
}
.asset-label { color: var(--muted); font-size: 13px; }
.asset-total { font-size: 32px; font-weight: 700; margin: 6px 0 18px; letter-spacing: .3px; }
.asset-total small { font-size: 14px; color: var(--muted); font-weight: 500; }
.asset-row { display: flex; justify-content: space-between; gap: 12px; }
.asset-row div { flex: 1; }
.muted { color: var(--muted); font-size: 12px; display: block; margin-bottom: 4px; }
.green { color: var(--green); }

/* action grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.action-item .icon-box {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #2f2f31;
  font-size: 26px;
  color: #fff;
}
.action-item.primary .icon-box { background: var(--green); color: var(--green-text); }
.action-item.primary { color: var(--text); }

/* info cards */
.info-list { display: grid; gap: 10px; }
.info-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 10px;
  background: #232325;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 10px 12px;
  min-height: 72px;
}
.info-thumb { width: 64px; height: 64px; object-fit: contain; }
.info-text div { font-size: 14px; font-weight: 500; }
.info-text small { color: var(--muted); font-size: 12px; }
.info-num { font-size: 24px; font-weight: 700; text-align: right; }
.info-num small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }

.switch { position: relative; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0;
  background: #444;
  border-radius: 999px;
  transition: .2s;
}
.switch span:before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}

/* hall */
.hall-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 13px;
}
.hall-top .bal { color: var(--muted); }
.hall-top .bal strong { color: var(--text); margin-left: 6px; }
.sub-tabs { display: flex; gap: 18px; padding: 8px 4px 16px; }
.sub-tabs span { color: var(--muted); padding-bottom: 8px; font-size: 15px; }
.sub-tabs span.active { color: var(--text); border-bottom: 2px solid var(--green); }
.empty-state { text-align: center; padding: 16vh 20px 0; color: var(--muted); }
.empty-img { width: 120px; margin: 0 auto 14px; opacity: .95; }

/* orders */
.page-title { font-size: 18px; font-weight: 600; padding: 8px 4px 14px; }
.orders-list { display: grid; gap: 10px; }
.order-card {
  background: #232325;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 14px;
}
.order-card .row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 14px; }
.order-card .status { color: var(--green); font-size: 12px; }
.order-card .status.done { color: var(--muted); }

/* profile */
.profile-header {
  background: linear-gradient(135deg, var(--orange2), var(--orange));
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 12px;
}
.profile-email { font-size: 14px; opacity: .95; word-break: break-all; }
.profile-badge { font-size: 24px; font-weight: 700; margin: 8px 0 4px; }
.profile-brand { font-size: 13px; opacity: .85; }
.profit-bar {
  display: flex;
  justify-content: space-between;
  background: #232325;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.profit-bar strong { font-size: 18px; }
.menu-list { display: grid; gap: 8px; margin-bottom: 16px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #232325;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 14px 16px;
}
.menu-item .ri { font-size: 20px; color: #cbd5e1; }
.menu-item .arrow { margin-left: auto; color: var(--muted); }
.logout { margin-top: 8px; }

/* deposit */
.nav-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 16px;
  font-size: 18px;
  font-weight: 600;
}
.back { font-size: 22px; padding: 4px 8px; color: var(--text); }
.network-tabs { display: flex; gap: 18px; margin-bottom: 18px; }
.network-tabs span { color: var(--muted); padding-bottom: 8px; font-size: 15px; }
.network-tabs span.active { color: var(--green); border-bottom: 2px solid var(--green); }
.qr-box { text-align: center; }
.qr-frame {
  width: 200px; height: 200px;
  margin: 0 auto 16px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  place-items: center;
}
.qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.address-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2a2a2c;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.address-bar code {
  flex: 1;
  font-size: 11px;
  word-break: break-all;
  color: #d1d5db;
}
.copy {
  background: var(--green);
  color: var(--green-text);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
}
.tips { color: var(--muted); font-size: 13px; line-height: 1.7; padding-left: 18px; margin-top: 20px; }

/* tabbar */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  height: var(--tab-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}
.tabbar button i { font-size: 22px; font-style: normal; }
.tabbar button.active { color: var(--green); }

/* floating side buttons */
.float-tools {
  position: fixed;
  right: max(8px, calc(50% - 215px + 8px));
  bottom: calc(var(--tab-h) + 80px);
  display: grid;
  gap: 10px;
  z-index: 15;
}
.float-tools button {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(35,35,37,.95);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.float-tools img { width: 22px; height: 22px; object-fit: contain; }

@media (min-width: 431px) {
  .app { box-shadow: 0 0 0 1px var(--border); }
}
