:root {
  --bg: #070b12;
  --bg-2: #0d1420;
  --panel: #111827;
  --panel-2: #162033;
  --line: rgba(148, 163, 184, 0.16);
  --text: #e8eef7;
  --muted: #94a3b8;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --green: #22c55e;
  --red: #f43f5e;
  --amber: #f59e0b;
  --radius: 14px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --nav-h: 64px;
  --side-w: 250px;
  --font: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(59, 130, 246, 0.16), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(34, 211, 238, 0.08), transparent 45%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}
button { cursor: pointer; }
table { width: 100%; border-collapse: collapse; }
img { max-width: 100%; display: block; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: var(--nav-h) 1fr;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2563eb, #06b6d4);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: -0.04em;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.brand-text strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.brand-text span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0 0.95rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: 0.18s ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn-ghost:hover { border-color: rgba(96, 165, 250, 0.45); }

.layout {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: calc(100vh - var(--nav-h));
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(13, 20, 32, 0.72);
  padding: 1rem 0.75rem;
  overflow: auto;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
}

.side-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55rem 0.75rem 0.4rem;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0.8rem;
  border-radius: 12px;
  color: #cbd5e1;
  text-align: left;
  margin-bottom: 0.2rem;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }

.nav-item.active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.22), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #fff;
}

.nav-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.nav-item small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.main {
  min-width: 0;
  padding: 1.25rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: -0.03em;
}

.page-head p {
  color: var(--muted);
  margin-top: 0.3rem;
  max-width: 52ch;
}

.chips {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.chip {
  min-height: 32px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
}

.chip.active, .chip:hover {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.12);
}

.grid {
  display: grid;
  gap: 1rem;
}

.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)); }

.card {
  background: linear-gradient(180deg, rgba(22, 32, 51, 0.95), rgba(17, 24, 39, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
}

.card-hd h2, .card-hd h3 {
  font-size: 0.98rem;
  font-weight: 600;
}

.card-bd { padding: 1rem; }

.stat {
  padding: 1rem 1.05rem;
}

.stat .label {
  color: var(--muted);
  font-size: 0.82rem;
}

.stat .value {
  margin-top: 0.35rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat .delta {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-family: var(--mono);
}

.up { color: var(--green); }
.down { color: var(--red); }
.warn { color: var(--amber); }
.info { color: var(--cyan); }

.table-wrap { overflow: auto; }

table th, table td {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  white-space: nowrap;
  font-size: 0.9rem;
}

table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
}

table tr:hover td { background: rgba(59, 130, 246, 0.05); }

.ticker {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.badge-red { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.bars {
  display: grid;
  gap: 0.65rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 64px 1fr 72px;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.85rem;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22d3ee);
}

.chart {
  width: 100%;
  height: 220px;
  display: block;
}

.toolbar {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.field {
  min-height: 38px;
  padding: 0 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.field:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.hero-panel {
  padding: 1.4rem;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 35%),
    linear-gradient(160deg, rgba(37, 99, 235, 0.18), rgba(17, 24, 39, 0.2));
}

.hero-panel h1 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: -0.04em;
  max-width: 16ch;
}

.hero-panel p {
  margin-top: 0.7rem;
  color: #cbd5e1;
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.module-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.module-card {
  text-align: left;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.35);
  transition: 0.18s ease;
}

.module-card:hover {
  border-color: rgba(96, 165, 250, 0.4);
  transform: translateY(-2px);
  background: rgba(59, 130, 246, 0.08);
}

.module-card strong {
  display: block;
  margin-bottom: 0.3rem;
}

.module-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.price-card {
  padding: 1.25rem;
}

.price-card .price {
  font-size: 2.2rem;
  font-weight: 760;
  letter-spacing: -0.04em;
  margin: 0.4rem 0 0.2rem;
}

.price-card ul {
  list-style: none;
  margin: 1rem 0;
  display: grid;
  gap: 0.45rem;
}

.price-card li {
  color: #cbd5e1;
  font-size: 0.92rem;
  padding-left: 1.1rem;
  position: relative;
}

.price-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.price-card.featured {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), var(--shadow);
}

.note {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 45;
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; place-items: center; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--nav-h);
    bottom: 0;
    width: min(86vw, 300px);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .overlay.show { display: block; }
  .grid-3, .grid-2, .price-grid, .module-cards {
    grid-template-columns: 1fr;
  }
  .brand-text span { display: none; }
}
