:root {
  --bg: #f5f3ef;
  --ink: #1d2430;
  --muted: #5a6472;
  --brand: #0e7c86;
  --brand-2: #ea5f3a;
  --panel: rgba(255, 255, 255, 0.78);
  --line: rgba(16, 28, 45, 0.14);
  --good: #177a42;
  --bad: #b13a2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 15% 15%, #fff8eb, transparent 45%),
    radial-gradient(circle at 85% 10%, #e3f5ff, transparent 38%),
    linear-gradient(145deg, #f4eee6 0%, #eef4f8 100%);
  font-family: "Space Grotesk", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.shell {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

header.shell {
  padding: 36px 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.nav-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
}

.nav-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.nav-btn.admin {
  background: #fff4ec;
  border-color: #f4c6ae;
}

.nav-hint {
  font-size: 12px;
  color: var(--muted);
}

.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
  padding-bottom: 28px;
}

.kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
}

h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.time {
  font-family: "IBM Plex Mono", monospace;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
  padding-bottom: 28px;
}

.panel {
  grid-column: span 12;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  padding: 16px;
  box-shadow: 0 10px 25px rgba(19, 33, 52, 0.08);
  animation: rise 0.45s ease;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat-row article {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

h2,
h3 {
  margin: 0;
}

h3 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.value {
  margin: 6px 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}

.sub {
  color: var(--muted);
  font-size: 12px;
}

.status-ok {
  color: var(--good);
  font-weight: 600;
}

.status-err {
  color: var(--bad);
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 500;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.insight-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.donut {
  --ratio: 50;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  margin: 8px 0;
  background: conic-gradient(var(--good) calc(var(--ratio) * 1%), var(--bad) 0);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #fff;
}

.mono {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 54px 1fr 32px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e7eef2;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.risk {
  display: inline-block;
  margin: 8px 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.risk.low {
  color: #0f5e34;
  background: #dcf6e6;
}

.risk.mid {
  color: #8a5400;
  background: #ffedcb;
}

.risk.high {
  color: #8a1d1d;
  background: #ffdada;
}

.trade-light {
  display: inline-block;
  margin: 8px 0 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.trade-light.green {
  color: #0f5e34;
  background: #dcf6e6;
}

.trade-light.yellow {
  color: #8a5400;
  background: #ffedcb;
}

.trade-light.red {
  color: #8a1d1d;
  background: #ffdada;
}

.trade-light.neutral {
  color: #32465a;
  background: #e8edf1;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.wallet-controls {
  display: grid;
  grid-template-columns: 110px 2fr 1.2fr auto auto;
  gap: 8px;
}

.wallet-controls input,
.wallet-controls select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font-family: inherit;
}

.action-btn {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
}

.action-btn.ghost {
  background: #fff;
  color: var(--brand);
}

.wallet-list {
  display: grid;
  gap: 8px;
}

.wallet-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.wallet-item code {
  font-size: 12px;
  color: var(--muted);
}

.wallet-remove {
  border: 1px solid #efc4c4;
  background: #fff4f4;
  color: #9c2e2e;
  border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
}

.copy-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
}

.addr-cell {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: #fff;
  margin-right: 6px;
}

.buy {
  background: var(--good);
}

.sell {
  background: var(--bad);
}

pre {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: #102232;
  color: #f4f7fb;
  overflow: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.footer {
  padding-bottom: 30px;
  color: var(--muted);
  font-size: 13px;
}

.bg-orb {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(55px);
  z-index: -1;
}

.orb-a {
  top: -80px;
  left: -60px;
  background: rgba(234, 95, 58, 0.28);
}

.orb-b {
  right: -80px;
  bottom: -90px;
  background: rgba(14, 124, 134, 0.26);
}

.pos {
  color: var(--good);
}

.neg {
  color: var(--bad);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  header.shell {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .stat-row {
    grid-template-columns: 1fr;
  }
  .insight-grid {
    grid-template-columns: 1fr;
  }
  .wallet-controls {
    grid-template-columns: 1fr;
  }
}
