:root {
  --bg: #0b0f17;
  --bg-soft: #0f1521;
  --panel: #151c2b;
  --panel-2: #1a2333;
  --line: #24304a;
  --text: #e8eefb;
  --muted: #8d9ab3;
  --blue: #3b7bf6;
  --blue-soft: #1e3a6e;
  --green: #35c46a;
  --red: #f2564d;
  --orange: #f0a23c;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 22px 18px 60px; }
.wrap-narrow { max-width: 460px; margin: 0 auto; padding: 60px 18px; }

.topbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 18px;
  height: 56px; display: flex; align-items: center; gap: 18px;
}
.brand { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a, .nav button {
  color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: 13px;
  background: transparent; border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav button:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--panel); color: var(--text); border-color: var(--line); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.card-title .tag { font-size: 12px; color: var(--muted); font-weight: 400; }

.grid { display: grid; gap: 12px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.stat {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.stat .k { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.stat .v { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.stat .v.sm { font-size: 16px; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 6px; }

.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-blue { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
select option { background: var(--bg-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 14px;
  font-family: inherit; transition: .15s;
}
.btn:hover { border-color: var(--blue); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: transparent; border-color: #6b2b2b; color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; border: 1px solid; }
.badge-green { color: var(--green); border-color: #235c39; background: rgba(53,196,106,.08); }
.badge-red { color: var(--red); border-color: #6b2b2b; background: rgba(242,86,77,.08); }
.badge-gray { color: var(--muted); border-color: var(--line); }
.badge-blue { color: var(--blue); border-color: #24406f; background: rgba(59,123,246,.1); }
.badge-orange { color: var(--orange); border-color: #6d4a19; background: rgba(240,162,60,.08); }

.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-120%);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 20px; border-radius: 10px; z-index: 999; transition: .25s; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: #235c39; }
.toast.err { border-color: #6b2b2b; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 8px 15px; border-radius: 10px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.tabs button:hover { color: var(--text); background: var(--panel); }
.tabs button.active { background: var(--panel); border-color: var(--line); color: var(--text); }
.tabpane { display: none; }
.tabpane.active { display: block; }

.hero { text-align: center; padding: 56px 18px 30px; }
.hero h1 { font-size: 34px; margin: 0 0 12px; letter-spacing: -.5px; }
.hero p { color: var(--muted); font-size: 15px; margin: 0 auto; max-width: 620px; line-height: 1.8; }
.price-card { text-align: center; padding: 22px 18px; }
.price-card .amount { font-size: 30px; font-weight: 800; color: var(--blue); }
.price-card .amount small { font-size: 14px; font-weight: 400; color: var(--muted); }
.price-card ul { list-style: none; padding: 0; margin: 14px 0 0; text-align: left; color: var(--muted); font-size: 13px; line-height: 2; }

.empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }
.row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hr { height: 1px; background: var(--line); margin: 16px 0; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 0 10px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-bg.show { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 520px; max-height: 86vh; overflow: auto; }
