: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;
}

.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(3, 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: 14px 6px;
  font-weight: 700;
}

.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(5, 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; }

.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;
}

.fake-qr {
  width: 180px;
  height: 180px;
  margin: 12px auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  background: #fff;
  padding: 10px;
}

.fake-qr i {
  background: #134e4a;
  display: block;
}

.fake-qr i.off { background: #fff; }

.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);
}

.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;
}

.me-head { display: flex; align-items: center; gap: 12px; }

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

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