:root {
  --bg: #07080d;
  --bg-elev: #0d1018;
  --bg-card: rgba(14, 18, 28, 0.82);
  --line: rgba(0, 229, 192, 0.14);
  --line-strong: rgba(0, 229, 192, 0.35);
  --cyan: #00e5c0;
  --cyan-dim: rgba(0, 229, 192, 0.12);
  --blue: #4d7cff;
  --blue-dim: rgba(77, 124, 255, 0.14);
  --text: #e8eef9;
  --muted: #8b96ad;
  --faint: #5c677d;
  --up: #3dffb0;
  --down: #ff4d6a;
  --warn: #f5c15a;
  --shadow: 0 0 0 1px rgba(0, 229, 192, 0.08), 0 18px 50px rgba(0, 0, 0, 0.45);
  --mono: "IBM Plex Mono", "ui-monospace", "SFMono-Regular", "Menlo", "Consolas", monospace;
  --sans: "IBM Plex Sans", "HarmonyOS Sans SC", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  min-height: 100vh;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

.bg-grid, .bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.bg-grid {
  background-image:
    linear-gradient(rgba(77, 124, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 124, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}
.bg-glow {
  background:
    radial-gradient(800px 320px at 15% -10%, rgba(0, 229, 192, 0.14), transparent 60%),
    radial-gradient(700px 280px at 90% 0%, rgba(77, 124, 255, 0.16), transparent 55%);
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 14px;
  margin-bottom: 8px;
  background: linear-gradient(180deg, rgba(7, 8, 13, 0.94), rgba(7, 8, 13, 0.72) 70%, transparent);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark {
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(0, 229, 192, 0.16), rgba(77, 124, 255, 0.12));
  box-shadow: 0 0 24px rgba(0, 229, 192, 0.18);
  position: relative;
}
.mark::before, .mark::after {
  content: ""; position: absolute; inset: 9px;
  border: 1.5px solid var(--cyan); border-radius: 50%;
}
.mark::after { inset: 14px; background: var(--cyan); border: 0; border-radius: 50%; box-shadow: 0 0 10px var(--cyan); }
.brand-text h1 {
  margin: 0; font-size: 18px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: none;
}
.brand-text .sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.promo-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(245, 193, 90, 0.55);
  background: linear-gradient(180deg, rgba(245, 193, 90, 0.16), rgba(245, 193, 90, 0.05));
  color: #ffe7a8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
  box-shadow: 0 0 0 1px rgba(245, 193, 90, 0.08), 0 0 28px rgba(245, 193, 90, 0.12);
  white-space: nowrap;
}
.promo-btn:hover { filter: brightness(1.12); }
.promo-btn .chev { opacity: 0.8; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(13, 16, 24, 0.9);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 4px rgba(92, 103, 125, 0.15);
}
.status-pill.online { color: var(--up); border-color: rgba(61, 255, 176, 0.35); }
.status-pill.online .dot { background: var(--up); box-shadow: 0 0 0 4px rgba(61, 255, 176, 0.15); animation: pulse 1.8s ease-out infinite; }
.status-pill.offline { color: var(--down); border-color: rgba(255, 77, 106, 0.4); }
.status-pill.offline .dot { background: var(--down); box-shadow: 0 0 0 4px rgba(255, 77, 106, 0.15); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 255, 176, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(61, 255, 176, 0); }
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 16px;
  margin: 8px 0 18px;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
  .top-actions { justify-content: flex-start; }
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  backdrop-filter: blur(16px);
}
.kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 8px;
}
.equity-num {
  font-family: var(--mono);
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.equity-meta { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.equity-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px 20px;
  align-items: start;
}
@media (max-width: 640px) { .equity-split { grid-template-columns: 1fr; } }
.util-box {
  padding: 4px 0 0 16px;
  border-left: 1px solid var(--line);
}
@media (max-width: 640px) {
  .util-box { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
.util-num { font-size: clamp(28px, 5vw, 40px); }
.wallet-row {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.wallet-row a { color: var(--cyan); text-decoration: none; border-bottom: 1px dashed rgba(0,229,192,0.35); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.02);
}

.promo-banner {
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  border-color: rgba(245, 193, 90, 0.28);
  background:
    linear-gradient(160deg, rgba(245, 193, 90, 0.1), transparent 55%),
    var(--bg-card);
}
.promo-banner h2 { margin: 0; font-size: 18px; }
.promo-banner p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.promo-banner .promo-btn { align-self: flex-start; }

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 980px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }
.tile .label { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
.tile .value {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.tile .hint { margin-top: 6px; color: var(--faint); font-size: 11px; }
.pos { color: var(--up); }
.neg { color: var(--down); }
.neu { color: var(--text); }

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.section-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
.section-h h3 { margin: 0; font-size: 15px; letter-spacing: 0.04em; }
.section-h span { color: var(--faint); font-size: 12px; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; font-size: 12px; }
.bar-row .name { color: var(--muted); }
.bar-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.05); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--blue)); }
.bar-row .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.chart-wrap { position: relative; height: 220px; }
canvas { width: 100%; height: 100%; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); font-size: 11px; }
.legend i { display: inline-block; width: 10px; height: 2px; margin-right: 6px; vertical-align: middle; }
.legend .eq { background: var(--cyan); }
.legend .rz { background: var(--blue); }

.table-card { margin-bottom: 18px; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
}
.seg, select, .search {
  background: #0b0e15;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font: 12px/1.2 var(--sans);
}
.search { min-width: 160px; flex: 1; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td {
  text-align: left; padding: 9px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  white-space: nowrap;
}
th { color: var(--faint); font-weight: 550; letter-spacing: 0.06em; font-size: 11px; }
td.num, th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.badge {
  display: inline-flex; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 11px; color: var(--muted);
}
.badge.ok { color: var(--up); border-color: rgba(61,255,176,0.3); }
.badge.warn { color: var(--warn); border-color: rgba(245,193,90,0.35); }
.badge.bad { color: var(--down); border-color: rgba(255,77,106,0.35); }
.badge.live { color: var(--cyan); border-color: var(--line-strong); }

.foot {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  padding: 8px 4px 0;
}
.foot strong { color: var(--text); font-weight: 600; }
.sources { margin-top: 8px; color: var(--faint); font-size: 11px; }

.empty { color: var(--muted); text-align: center; padding: 28px 8px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #12161f; border: 1px solid var(--line-strong); color: var(--text);
  padding: 10px 14px; border-radius: 999px; font-size: 13px; z-index: 40;
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  .status-pill.online .dot { animation: none; }
}
