:root {
  --bg: #f3faf7;
  --card: #fff;
  --text: #134e4a;
  --muted: #5b7c78;
  --line: #d7ebe4;
  --brand: #0f766e;
  --brand-2: #115e59;
  --in: #0f766e;
  --out: #b45309;
  --nav-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #c5ddd6;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

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

.topbar {
  background: linear-gradient(160deg, #0f766e, #14786f 60%, #0b5f58);
  color: #fff;
  padding: 12px 14px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-btn {
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 0 2px 0 0;
  flex-shrink: 0;
}

.sim-tag {
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 3px;
  padding: 1px 5px;
}

#page-title {
  margin: 0;
  flex: 1;
  font-size: 18px;
}

.topbar-cash {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.sub {
  margin: 8px 0 0;
  font-size: 12px;
  opacity: .85;
}

#app { padding: 12px; }

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(15, 118, 110, .06);
}

.search {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 22px;
  padding: 10px 14px;
  font-size: 14px;
}

.search-list { margin: 8px 0 0; padding: 0; list-style: none; }
.search-list li { padding: 8px 4px; color: var(--brand); }

.hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.hero button, .grid button, .list-btn, .submit, .ghost {
  font: inherit;
  cursor: pointer;
}

.hero button {
  border: 0;
  background: #e7f6f2;
  color: var(--brand-2);
  border-radius: 12px;
  padding: 12px 4px;
  font-weight: 700;
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.grid button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 8px 0;
}

.grid .ico {
  width: 40px;
  height: 40px;
  margin: 0 auto 6px;
  border-radius: 12px;
  background: #d1fae5;
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.notice {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.notice:last-child { border-bottom: 0; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: #b45309; margin: 8px 0; min-height: 1.2em; }
.ok { color: var(--brand); }

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(430px, 100%);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.tabbar a {
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
}

.tabbar a.on { color: var(--brand); font-weight: 700; }
.tabbar[hidden] { display: none; }

.field {
  width: 100%;
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}

.submit, .ghost {
  width: 100%;
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
}

.submit {
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.code-card {
  background: #10221f;
  color: #ecfdf5;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}

.real-qr {
  width: min(82vw, 300px);
  max-width: 100%;
  margin: 12px auto;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}

.real-qr svg,
.real-qr img { width: 100%; height: auto; display: block; border-radius: 8px; }

.qr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.qr-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
}

.qr-tabs button.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.qr-actions .ghost { margin-top: 0; padding: 10px 6px; font-size: 13px; }

.qr-stand {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  color: #fff;
}

.qr-stand[hidden] { display: none; }

.qr-stand-pad {
  width: min(86vw, 360px);
  background: #fff;
  border-radius: 18px;
  padding: 18px;
}

.qr-stand-pad svg,
.qr-stand-pad img { width: 100%; height: auto; display: block; }

.qr-stand-name { margin: 0; font-size: 18px; font-weight: 700; }
.qr-stand-tip { margin: 0; font-size: 13px; opacity: .8; }
.qr-stand .ghost { width: min(86vw, 360px); color: #fff; background: transparent; border-color: rgba(255,255,255,.35); }

.code-text {
  font-size: 12px;
  word-break: break-all;
  opacity: .9;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row-btn {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
}

.amt-out { color: var(--out); font-weight: 700; }
.amt-in { color: var(--in); font-weight: 700; }

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  border: 0;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-lg { width: 88px; height: 88px; font-size: 36px; margin: 0 auto 12px; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.me-head { display: flex; align-items: center; gap: 12px; }
.me-who { min-width: 0; }
.me-user-edit {
  display: block;
  margin-top: 4px;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
}
.me-bal {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.me-bal strong { font-size: 22px; }
.demo-box { margin-top: 12px; color: var(--muted); font-size: 13px; }
.demo-box summary { cursor: pointer; }
.demo-box .ghost { margin-top: 8px; }

.me-group {
  padding: 0;
  overflow: hidden;
}

.me-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  font: inherit;
  text-align: left;
  color: inherit;
  text-decoration: none;
}

.me-item:last-child { border-bottom: 0; }
.me-item span { color: var(--muted); font-size: 12px; }

.me-label {
  margin: 4px 4px 8px;
  font-size: 12px;
  color: var(--muted);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chips button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 6px 10px;
}
.chips button.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.home-cash { text-align: left; }
.home-cash-hide {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 0;
}
.home-cash strong { display: block; font-size: 28px; margin: 6px 0 12px; }
.home-cash-actions { display: flex; gap: 8px; }
.home-cash-actions button {
  flex: 1;
  border: 1px solid var(--line);
  background: #f3faf7;
  border-radius: 10px;
  padding: 8px;
  font: inherit;
}

.empty { text-align: center; color: var(--muted); padding: 28px 8px; }

.shell.wealth-on {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.shell.wealth-on #app {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wealth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.wealth-tabs button {
  border: 0;
  background: transparent;
  padding: 10px;
  color: var(--muted);
  font: inherit;
}

.wealth-tabs button.on {
  color: var(--brand);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--brand);
}

.junbao-frame {
  flex: 1;
  width: 100%;
  border: 0;
  min-height: 0;
  background: #fff;
}

.user-chip {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
}

.sim-tag.dark {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
  margin-left: 4px;
}

.admin-shell { padding-bottom: 24px; }
.admin-main { padding: 12px; }

.admin-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-jumps[hidden] { display: none; }

.admin-jumps button {
  border: 1px solid rgba(255,255,255,.75);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
}

.admin-jumps button:active { background: rgba(255,255,255,.28); }
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 0;
}

.admin-nav button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
}

.admin-nav button.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.overview-grid strong { font-size: 20px; }

.admin-user {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.admin-actions button {
  font: inherit;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
}
