:root {
  --red: #d9382c;
  --red-2: #b3271d;
  --red-soft: #fdeceb;
  --dark: #191e28;
  --dark-2: #222834;
  --bg: #f1f2f4;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #8b919c;
  --line: #edeff2;
  --up: #e03131;
  --down: #2b9a5a;
  --blue: #2f6fed;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

/* ---------------- sidebar ---------------- */
.sidebar {
  width: 228px;
  flex: 0 0 228px;
  background: var(--dark);
  color: #aab1be;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
}
.logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e2453a, #a92118);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(217, 56, 44, .35);
}
.logo-text b { display: block; color: #fff; font-size: 15px; letter-spacing: .5px; }
.logo-text small { display: block; color: #6f7787; font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; margin-top: 2px; }

#nav { padding: 6px 0; flex: 1; }
#nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 20px;
  color: #a3aab7;
  text-decoration: none;
  font-size: 13px;
  border-radius: 0 8px 8px 0;
  margin: 2px 10px 2px 0;
  transition: background .15s, color .15s;
}
#nav a svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#nav a:hover { background: #232a36; color: #e7eaf0; }
#nav a.active {
  background: linear-gradient(90deg, #c22f25, #e0453a);
  color: #fff;
  box-shadow: 0 6px 14px rgba(217, 56, 44, .28);
}

.side-foot {
  padding: 14px 20px 18px;
  font-size: 11px;
  color: #6f7787;
  border-top: 1px solid #262d39;
  display: flex; align-items: center; gap: 7px;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: #35c26b;
  box-shadow: 0 0 0 3px rgba(53, 194, 107, .15);
}

/* ---------------- banner ---------------- */
.main { flex: 1; min-width: 0; }

.banner {
  position: relative;
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(900px 220px at 78% 120%, rgba(255, 160, 80, .35), transparent 60%),
    linear-gradient(100deg, #240a08 0%, #5e140d 42%, #a5271b 72%, #cf3a26 100%);
}
.banner::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,.045) 0 2px, transparent 2px 14px);
  pointer-events: none;
}
.banner-glow {
  position: absolute; right: 8%; top: -60px;
  width: 340px; height: 240px;
  background: radial-gradient(closest-side, rgba(255, 190, 120, .35), transparent);
  filter: blur(4px);
}
.banner-text { position: relative; z-index: 1; }
.banner-text h1 {
  margin: 0;
  font-size: 29px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}
.banner-text p { margin: 8px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .78); letter-spacing: .4px; }
.banner-right {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  backdrop-filter: blur(6px);
}
.banner-right .btn.ghost {
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  color: #fff;
  padding: 4px 10px;
  font-size: 11.5px;
}
.banner-right .btn.ghost:hover { background: rgba(255,255,255,.22); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }

/* ---------------- layout ---------------- */
.view { padding: 18px 22px 34px; max-width: 1560px; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }

.card {
  background: var(--card);
  border: 1px solid #eef0f3;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.card.pad { padding: 16px 18px; }
.card .label { color: var(--muted); font-size: 12px; margin-bottom: 9px; display: flex; justify-content: space-between; align-items: center; }
.card .value { font-size: 27px; font-weight: 800; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.card .value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.card .sub { margin-top: 8px; color: #9aa0aa; font-size: 11.5px; line-height: 1.5; }

.section { background: var(--card); border: 1px solid #eef0f3; border-radius: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); margin-bottom: 16px; overflow: hidden; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.section-title { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--red); }
.section-sub { color: var(--muted); font-size: 11.5px; font-weight: 400; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.grid-2-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------------- table ---------------- */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: #8a909c;
  background: #fafbfc;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: #fcfcfd; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.mono { font-variant-numeric: tabular-nums; }

.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.strong { font-weight: 700; }

.sym { display: flex; align-items: center; gap: 10px; }
.coin {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800;
  background: #f2f4f7; color: #5b6472;
}
.sym b { font-size: 13px; }
.sym small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }

.rank { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #e2453a, #b3271d); }
.rank.gray { background: #e9ebef; color: #7b828e; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 11px; line-height: 18px; }
.badge.red { background: var(--red-soft); color: var(--red-2); }
.badge.blue { background: #eaf1fe; color: #2f6fed; }
.badge.green { background: #e8f6ee; color: #1f7f4c; }
.badge.gray { background: #f1f2f5; color: #6d7480; }
.badge.amber { background: #fff3e2; color: #b26a00; }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

.btn {
  border: 1px solid #e3e6ea; background: #fff; color: #39404b;
  border-radius: 7px; padding: 6px 11px; font-size: 12px; cursor: pointer;
}
.btn:hover { border-color: #cfd4db; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-2); }

.seg { display: inline-flex; background: #f2f3f5; border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; font-size: 12px; color: #6d7480; cursor: pointer; }
#kind-seg { margin-left: 6px; }
#kind-seg::before { content: ""; }
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }

/* ---------------- chart ---------------- */
.chart { padding: 6px 10px 12px; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 16px; padding: 4px 12px 8px; font-size: 11.5px; color: #6d7480; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* ---------------- misc ---------------- */
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed #eef0f3; font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; font-variant-numeric: tabular-nums; }

.progress { height: 6px; background: #f1f2f4; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #e0453a, #f0a04b); border-radius: 99px; }

.note { padding: 10px 14px; background: #fbfbfc; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.6; }

.empty { padding: 26px; text-align: center; color: var(--muted); font-size: 12.5px; }

.md { padding: 18px 22px; line-height: 1.75; font-size: 13px; }
.md h1 { font-size: 20px; margin: 4px 0 14px; }
.md h2 { font-size: 16px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 14px; margin: 16px 0 8px; }
.md p { margin: 8px 0; }
.md table { margin: 10px 0 16px; }
.md th { background: #fafbfc; }
.md code { background: #f4f5f7; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.md pre { background: #171b23; color: #d8dee9; padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.md ul { padding-left: 20px; }
.md blockquote { margin: 10px 0; padding: 8px 12px; border-left: 3px solid #e3e6ea; color: #6d7480; background: #fafbfc; }

.report-item { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; border-bottom: 1px solid #f3f4f6; cursor: pointer; }
.report-item:hover { background: #fcfcfd; }
.report-item b { font-size: 13px; font-weight: 600; }
.report-item small { color: var(--muted); font-size: 11.5px; }

.toolbar { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

@media (max-width: 1180px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2-even { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .sidebar { width: 64px; flex-basis: 64px; }
  .logo-text, #nav a span, #nav a { font-size: 0; }
  #nav a { justify-content: center; padding: 14px 0; }
  #nav a svg { width: 20px; height: 20px; }
  .side-foot { display: none; }
  .banner-text h1 { font-size: 20px; }
}
