:root {
  color-scheme: dark;
  --bg: #080b12;
  --surface: rgba(17, 22, 34, .82);
  --surface-2: #151b29;
  --line: rgba(148, 163, 184, .14);
  --text: #f4f7fb;
  --muted: #8490a5;
  --green: #44f0a6;
  --cyan: #4edcff;
  --violet: #a78bfa;
  --amber: #ffcb66;
  --red: #ff647c;
  --radius: 18px;
  --shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 80% -10%, rgba(78, 220, 255, .08), transparent 34%),
    radial-gradient(circle at 0 30%, rgba(68, 240, 166, .06), transparent 26%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }
.ambient { position: fixed; width: 260px; height: 260px; border-radius: 50%; filter: blur(100px); opacity: .12; pointer-events: none; }
.ambient-one { top: 8%; right: -100px; background: var(--cyan); }
.ambient-two { bottom: 8%; left: -140px; background: var(--violet); }
.shell { width: min(1320px, 100%); margin: 0 auto; padding: 24px clamp(16px, 3vw, 36px) 30px; position: relative; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #07120e; background: linear-gradient(135deg, var(--green), #b9ffdc); font-weight: 900; font-size: 21px; box-shadow: 0 0 32px rgba(68, 240, 166, .2); }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 2px; font-size: clamp(18px, 3vw, 23px); letter-spacing: -.02em; }
.eyebrow, .section-kicker { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.header-actions { display: flex; gap: 9px; align-items: center; }
.status-pill { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 99px; background: rgba(17, 22, 34, .7); color: var(--muted); font-size: 12px; font-weight: 700; }
.status-pill.online { color: var(--green); border-color: rgba(68, 240, 166, .25); }
.status-pill.offline { color: var(--red); border-color: rgba(255, 100, 124, .25); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent); }
.online .pulse-dot { animation: pulse 1.8s infinite; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--surface); cursor: pointer; transition: .2s ease; }
.icon-button:hover { color: var(--text); border-color: rgba(78, 220, 255, .3); }
.icon-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.loading svg { animation: spin .8s linear infinite; }

.hero { min-height: 158px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: clamp(24px, 5vw, 38px); margin-bottom: 16px; overflow: hidden; position: relative; border: 1px solid rgba(68, 240, 166, .13); border-radius: 22px; background: linear-gradient(118deg, rgba(24, 39, 38, .94), rgba(14, 19, 29, .9) 65%); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; inset: 0; opacity: .12; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 30px 30px; mask-image: linear-gradient(90deg, transparent, #000); pointer-events: none; }
.hero h2 { margin: 7px 0 9px; font-size: clamp(25px, 4vw, 40px); letter-spacing: -.045em; }
.muted { color: var(--muted); font-size: 12px; }
.hero-signal { height: 66px; display: flex; align-items: center; gap: 6px; padding: 0 22px; z-index: 1; }
.hero-signal span { display: block; width: 5px; height: 24%; border-radius: 5px; background: var(--green); box-shadow: 0 0 16px rgba(68, 240, 166, .45); animation: wave 1.4s ease-in-out infinite; }
.hero-signal span:nth-child(2) { height: 55%; animation-delay: -.2s; }.hero-signal span:nth-child(3) { height: 100%; animation-delay: -.4s; }.hero-signal span:nth-child(4) { height: 65%; animation-delay: -.6s; }.hero-signal span:nth-child(5) { height: 35%; animation-delay: -.8s; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.metric-card, .panel { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.metric-card { min-width: 0; padding: 18px; border-radius: 16px; position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.accent-green { --accent: var(--green); }.accent-cyan { --accent: var(--cyan); }.accent-violet { --accent: var(--violet); }.accent-amber { --accent: var(--amber); }
.metric-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-icon { color: var(--accent); }
.metric-card strong { display: block; margin: 14px 0 4px; font-size: 25px; font-variant-numeric: tabular-nums; }
.metric-card small { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.span-12 { grid-column: span 12; }.span-7 { grid-column: span 7; }.span-5 { grid-column: span 5; }
.panel { min-width: 0; padding: 20px; border-radius: var(--radius); }
.panel-header { min-height: 38px; display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 17px; }
.panel h3 { margin-top: 5px; font-size: 17px; }
.badge { flex-shrink: 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 11px; font-weight: 700; }
.badge.good { color: var(--green); border-color: rgba(68, 240, 166, .2); background: rgba(68, 240, 166, .06); }
.badge.warn { color: var(--amber); border-color: rgba(255, 203, 102, .2); background: rgba(255, 203, 102, .06); }
.badge.bad { color: var(--red); border-color: rgba(255, 100, 124, .2); background: rgba(255, 100, 124, .06); }
.live-label { display: flex; gap: 7px; align-items: center; color: var(--green); font-size: 11px; }
.live-label span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.empty-state, .table-empty { color: var(--muted); text-align: center; font-size: 12px; padding: 24px 10px; }

.service-list, .account-list, .threshold-list { display: grid; gap: 9px; }
.service-item, .account-item, .threshold-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; border: 1px solid rgba(148, 163, 184, .1); border-radius: 12px; background: rgba(255,255,255,.018); }
.item-main { min-width: 0; display: flex; align-items: center; gap: 11px; }
.service-dot, .avatar { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.service-dot.good { background: var(--green); box-shadow: 0 0 10px rgba(68,240,166,.5); }.service-dot.warn { background: var(--amber); }.service-dot.bad { background: var(--red); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; color: var(--cyan); background: rgba(78,220,255,.09); font-size: 11px; font-weight: 800; }
.item-text { min-width: 0; }
.item-text strong, .item-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-text strong { font-size: 12px; }.item-text span, .item-meta { margin-top: 3px; color: var(--muted); font-size: 10px; }
.item-value { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); }

.timeline { display: grid; gap: 0; }
.event { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; min-width: 0; padding: 0 0 17px; position: relative; }
.event:last-child { padding-bottom: 0; }.event::after { content: ""; position: absolute; top: 13px; bottom: 3px; left: 5px; width: 1px; background: var(--line); }.event:last-child::after { display: none; }
.event-dot { width: 11px; height: 11px; margin-top: 2px; border: 3px solid rgba(78,220,255,.2); border-radius: 50%; background: var(--cyan); z-index: 1; }.event-dot.trade { background: var(--green); border-color: rgba(68,240,166,.2); }.event-dot.alert { background: var(--amber); border-color: rgba(255,203,102,.2); }.event-dot.error { background: var(--red); border-color: rgba(255,100,124,.2); }
.event-body { min-width: 0; }.event-body strong { display: block; font-size: 12px; }.event-body p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }.event time { color: var(--muted); font-size: 10px; white-space: nowrap; }

.table-scroll { overflow-x: auto; margin: 0 -5px -4px; padding: 0 5px 4px; scrollbar-color: #293143 transparent; scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
th { padding: 10px 12px; color: var(--muted); font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid rgba(148,163,184,.08); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }.token { display: flex; align-items: center; gap: 9px; }.token-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #09110e; background: linear-gradient(135deg, var(--green), var(--cyan)); font-size: 10px; font-weight: 900; }.token strong, .token small { display: block; }.token small { max-width: 120px; margin-top: 2px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }.positive { color: var(--green); }.negative { color: var(--red); }.score { font-weight: 800; color: var(--cyan); }.hash { display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: var(--cyan); }
.side-buy { color: var(--green); }.side-sell { color: var(--red); }

.trade-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.trade-stats > div { padding: 14px; border: 1px solid rgba(148,163,184,.1); border-radius: 12px; background: rgba(255,255,255,.018); }
.trade-stats span, .trade-stats strong { display: block; }.trade-stats span { color: var(--muted); font-size: 10px; }.trade-stats strong { margin-top: 8px; font-size: 18px; font-variant-numeric: tabular-nums; }
.error-banner { position: fixed; right: 18px; bottom: 18px; left: 18px; z-index: 10; width: min(460px, calc(100% - 36px)); margin-left: auto; display: flex; align-items: center; gap: 11px; padding: 12px 14px; border: 1px solid rgba(255,100,124,.3); border-radius: 13px; color: #ffdbe1; background: rgba(45,17,25,.96); box-shadow: var(--shadow); font-size: 12px; }
.error-banner > span { width: 23px; height: 23px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #19080c; background: var(--red); font-weight: 900; }.error-banner p { flex: 1; }.error-banner button { border: 0; color: var(--red); background: transparent; cursor: pointer; font-weight: 800; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px 4px 0; color: #596378; font-size: 10px; letter-spacing: .06em; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .5; box-shadow: 0 0 0 7px rgba(68,240,166,0); } }
@keyframes wave { 50% { transform: scaleY(.55); opacity: .65; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }
@media (max-width: 820px) { .metric-grid { grid-template-columns: repeat(2, 1fr); }.span-7, .span-5 { grid-column: span 12; } }
@media (max-width: 520px) {
  .shell { padding: 16px 12px 22px; }.topbar { padding-bottom: 16px; }.status-pill { padding: 0 10px; }.hero { min-height: 138px; padding: 24px 20px; }.hero-signal { position: absolute; right: -8px; opacity: .35; }.metric-grid { gap: 8px; }.metric-card { padding: 14px; }.metric-card strong { font-size: 21px; }.dashboard-grid { gap: 8px; }.panel { padding: 16px 14px; border-radius: 15px; }.panel-header { margin-bottom: 14px; }.event { grid-template-columns: 14px 1fr; }.event time { grid-column: 2; margin-top: -7px; }.trade-stats > div { padding: 12px; } footer { flex-direction: column; gap: 5px; }.brand .eyebrow { display: none; }
}
