:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --card2: #22262f;
  --line: #2c313c;
  --text: #e8eaf0;
  --muted: #8b93a3;
  --gold: #e8b04b;
  --gold2: #f5c76a;
  --green: #3ecf8e;
  --red: #ff6b6b;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, "PingFang SC", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 24px;
}

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #161922, #0f1115);
}
.brand { font-size: 20px; font-weight: 700; color: var(--gold2); }
.brand .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.balance { font-size: 14px; color: var(--green); font-weight: 600; }
.balance b { color: var(--green); }

.tabs {
  display: flex; gap: 6px; padding: 10px 12px;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
  border-bottom: 1px solid var(--line);
}
.tab {
  flex: 1; padding: 9px 0; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--muted); font-size: 14px; cursor: pointer;
}
.tab.active { background: var(--gold); color: #17130a; font-weight: 700; border-color: var(--gold); }

main { padding: 12px; }
.panel { display: none; }
.panel.active { display: block; }

.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cat {
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 13px; cursor: pointer;
}
.cat.active { border-color: var(--gold); color: var(--gold2); font-weight: 600; }

.plans { display: flex; flex-direction: column; gap: 10px; }
.plan {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px;
}
.plan .name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.plan .meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.plan .row { display: flex; align-items: center; justify-content: space-between; }
.plan .price { font-size: 16px; color: var(--gold2); font-weight: 700; }
.plan .buy {
  padding: 7px 14px; border: none; border-radius: 9px; background: var(--gold);
  color: #17130a; font-weight: 700; font-size: 13px; cursor: pointer;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.label { font-size: 13px; color: var(--muted); }
.addr {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
  word-break: break-all; color: var(--text); background: var(--card2);
  padding: 10px; border-radius: 9px; border: 1px solid var(--line);
}
.input {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font-size: 14px;
}
.input:focus { outline: none; border-color: var(--gold); }
.btn {
  width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: var(--gold); color: #17130a; font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn.ghost { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.msg { font-size: 13px; min-height: 18px; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--card2); color: var(--text); padding: 10px 16px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; border: 1px solid var(--line);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
