:root {
  --bg: #0b1020;
  --bg-2: #0f1630;
  --panel: #131b36;
  --panel-2: #18224a;
  --line: #26325e;
  --text: #e8ecff;
  --muted: #9aa5cf;
  --dim: #6c78a6;
  --accent: #39e0c0;
  --accent-2: #7c8cff;
  --peer: #ff6fae;
  --coin: #ffc35c;
  --danger: #ff6b6b;
  --ok: #4fdc8f;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.25; }

.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); letter-spacing: .2em; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: .12em; }
.brand.small { font-size: 16px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 35%, #6ff7dc 0 22%, transparent 23%),
              radial-gradient(circle at 65% 65%, #ff7fb8 0 22%, transparent 23%),
              radial-gradient(circle, #1b2a5c 0 60%, #39e0c0 61% 66%, transparent 67%);
  box-shadow: 0 0 18px rgba(57, 224, 192, .45);
}
.badge { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; transition: transform .08s, background .15s, border-color .15s;
  white-space: nowrap; touch-action: manipulation;
}
.btn:hover { border-color: var(--accent-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, #2bd4b4, #5b74ff); border-color: transparent; color: #061018; font-weight: 700; }
.btn.coin { background: linear-gradient(135deg, #ffd36e, #ff9f43); border-color: transparent; color: #241500; font-weight: 700; }
.btn.danger { border-color: rgba(255, 107, 107, .5); color: #ffb3b3; background: transparent; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.icon { width: 38px; height: 38px; padding: 0; font-size: 18px; background: rgba(19, 27, 54, .9); }

.tabs { display: flex; gap: 4px; background: var(--bg-2); border-radius: 12px; padding: 4px; }
.tab {
  flex: 1; border: 0; background: transparent; color: var(--muted); padding: 8px 6px; border-radius: 9px;
  cursor: pointer; position: relative; font-size: 14px;
}
.tab.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.tab-badge:not(:empty) {
  position: absolute; top: 2px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--peer); color: #fff; font-size: 11px; line-height: 16px;
}

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
input[type=text], input[type=password], input:not([type]), input[type=search] {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(57, 224, 192, .15); }
.form-error { color: var(--danger); min-height: 1.4em; margin: 10px 0 6px; font-size: 13px; }
.fine { font-size: 12px; color: var(--dim); margin: 12px 0 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.modal { position: fixed; inset: 0; background: rgba(4, 7, 18, .72); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { width: min(440px, 100%); max-height: 90vh; overflow: auto; }
.modal-body { margin: 12px 0 16px; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-body textarea { width: 100%; min-height: 96px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }

.toasts { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: toast-in .2s ease-out; }
.toast.ok { border-color: rgba(79, 220, 143, .6); }
.toast.err { border-color: rgba(255, 107, 107, .7); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
