:root {
  color-scheme: dark;
  --bg: #050b14;
  --panel: rgba(11, 22, 37, 0.88);
  --panel-soft: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f8fc;
  --muted: #8d9bb0;
  --gate: #4b8dff;
  --mexc: #19d3ae;
  --positive: #20d6a3;
  --negative: #ff6277;
  --warning: #f7b955;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, #142944 0, transparent 42%),
    linear-gradient(145deg, #050a12 0%, #07111f 48%, #050a12 100%);
  color: var(--text);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(115px);
  opacity: .12;
  pointer-events: none;
}

.ambient-one { left: -180px; top: 28%; background: var(--gate); }
.ambient-two { right: -180px; top: 38%; background: var(--mexc); }

.shell {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 28px;
}

.topbar,
.intro,
.exchange-head,
.chart-label,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 15px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(75,141,255,.2), rgba(25,211,174,.12));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 14px 34px rgba(0,0,0,.25);
  font-size: 31px;
  font-weight: 300;
}

.eyebrow {
  margin: 0 0 5px;
  color: #7f90a7;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .19em;
  text-transform: uppercase;
}

h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.simulation-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(247,185,85,.22);
  border-radius: 999px;
  background: rgba(247,185,85,.07);
  color: #f7ca7e;
  font-size: 12px;
  font-weight: 700;
}
.simulation-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 12px var(--warning); }

.intro { padding: 46px 4px 34px; }
h2 { margin: 0; font-size: clamp(27px, 3vw, 43px); line-height: 1.1; letter-spacing: -.045em; }
.global-status { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.global-status strong, .global-status small { display: block; }
.global-status strong { font-size: 13px; }
.global-status small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 14px rgba(247,185,85,.8); }
.status-dot.live { background: var(--positive); box-shadow: 0 0 14px rgba(32,214,163,.85); }
.status-dot.error { background: var(--negative); box-shadow: 0 0 14px rgba(255,98,119,.75); }

.exchange-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.exchange-card {
  position: relative;
  overflow: hidden;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(17,31,50,.92), rgba(8,17,29,.96));
  box-shadow: 0 28px 70px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.035);
}
.exchange-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; opacity: .9; }
.exchange-card.gate::before { background: linear-gradient(90deg, transparent, var(--gate), transparent); }
.exchange-card.mexc::before { background: linear-gradient(90deg, transparent, var(--mexc), transparent); }

.exchange-code { display: inline-block; margin-bottom: 8px; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.gate .exchange-code { color: #82adff; }
.mexc .exchange-code { color: #62e4ca; }
h3 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.exchange-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.connection { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); color: var(--muted); font-size: 11px; }
.connection span { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.connection.live { color: #9cecd8; border-color: rgba(32,214,163,.18); background: rgba(32,214,163,.06); }
.connection.live span { background: var(--positive); box-shadow: 0 0 10px var(--positive); }
.connection.error { color: #ff9dab; border-color: rgba(255,98,119,.2); background: rgba(255,98,119,.06); }
.connection.error span { background: var(--negative); }

.hero-metrics { display: grid; grid-template-columns: 1.28fr .92fr; gap: 12px; margin-top: 26px; }
.metric { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel-soft); }
.metric > span, .detail-grid span, .best-route span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric strong { display: block; overflow: hidden; margin-top: 9px; font-size: clamp(25px, 3vw, 39px); line-height: 1; letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; }
.metric small { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; }
.metric small b { color: #c4cfdd; }
.profit-metric strong { font-size: clamp(23px, 2.5vw, 33px); }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.neutral { color: #cbd5e1 !important; }

.chart-wrap { margin: 13px 0; padding: 17px 18px 5px; border: 1px solid var(--line); border-radius: 17px; background: rgba(0,0,0,.12); }
.chart-label span { color: var(--muted); font-size: 11px; }
.chart-label b { color: #becadb; font-size: 11px; }
.sparkline { display: block; width: 100%; height: 92px; margin-top: 7px; overflow: visible; }
.sparkline .line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.gate .sparkline .line { stroke: var(--gate); filter: drop-shadow(0 0 5px rgba(75,141,255,.5)); }
.mexc .sparkline .line { stroke: var(--mexc); filter: drop-shadow(0 0 5px rgba(25,211,174,.45)); }

.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.detail-grid > div { min-width: 0; padding: 14px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.detail-grid strong { display: block; overflow: hidden; margin-top: 8px; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }

.best-route { margin-top: 12px; padding: 15px 16px; border-left: 2px solid; border-radius: 5px 13px 13px 5px; background: rgba(255,255,255,.025); }
.gate .best-route { border-color: var(--gate); }
.mexc .best-route { border-color: var(--mexc); }
.best-route strong { display: block; overflow: hidden; margin-top: 7px; color: #d9e2ee; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

footer { padding: 25px 4px 0; color: var(--muted); font-size: 11px; }
footer p { margin: 0; }
.shield { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 7px; border-radius: 50%; background: rgba(32,214,163,.12); color: var(--positive); font-weight: 800; }

@media (max-width: 980px) {
  .exchange-grid { grid-template-columns: 1fr; }
  .metric strong { font-size: 36px; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1400px); padding-top: 20px; }
  .topbar { align-items: flex-start; gap: 18px; }
  .simulation-badge { padding: 7px 9px; font-size: 0; }
  .simulation-badge::after { content: "Paper"; font-size: 11px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 24px; padding: 34px 2px 25px; }
  .exchange-card { padding: 19px; border-radius: 19px; }
  .exchange-head { align-items: flex-start; gap: 12px; }
  h3 { font-size: 23px; }
  .connection { padding: 7px 9px; }
  .hero-metrics { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  footer { align-items: flex-start; flex-direction: column; gap: 10px; }
}
