:root {
  color-scheme: light;
  --bg: #f7faff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --line: #e7eef9;
  --muted: #708099;
  --text: #12233d;
  --blue: #1f73f1;
  --blue-strong: #1264e9;
  --blue-soft: #eaf2ff;
  --green: #45c27a;
  --yellow: #f2c84b;
  --orange: #ff8a3d;
  --red: #ee4758;
  --shadow: 0 14px 40px rgba(31, 75, 130, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  min-height: 100vh;
  overflow: hidden;
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui,
    -apple-system, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(33, 115, 241, 0.09), transparent 30%),
    linear-gradient(135deg, #fbfdff 0%, var(--bg) 48%, #fdfefe 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(860px, 1fr);
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 0 6px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--blue);
}

.brand-mark svg {
  width: 40px;
  height: 40px;
  overflow: visible;
}

.brand-mark path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.brand-mark circle {
  fill: white;
  stroke: currentColor;
  stroke-width: 2.5;
}

.brand strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: #506078;
  font-size: 13px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 14px;
  color: #3f4f68;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
}

.side-nav a span {
  width: 24px;
  color: #697991;
  font-size: 20px;
  text-align: center;
}

.side-nav a.active,
.side-nav a:hover {
  color: var(--blue-strong);
  background: #eaf3ff;
}

.side-nav a.active span,
.side-nav a:hover span {
  color: var(--blue-strong);
}

.formula-card {
  margin-top: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(31, 75, 130, 0.05);
}

.formula-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.formula-card p {
  margin: 0 0 8px;
  color: #66758c;
  font-size: 13px;
  line-height: 1.55;
}

.formula {
  width: 112px;
  margin: 6px 0 8px 22px;
  color: #283850;
  text-align: center;
  font-size: 14px;
}

.formula em {
  display: block;
  height: 1px;
  margin: 8px 0;
  background: #1d2e48;
}

.formula-card a {
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.main {
  display: grid;
  grid-template-rows: 30px 30px 252px minmax(0, 1fr) 124px 22px;
  gap: 7px;
  height: 100vh;
  overflow: hidden;
  padding: 12px 18px 10px 22px;
}

.topbar,
.toolbar,
.top-nav,
.top-actions,
.market-toggle,
.card-header,
.range-tabs {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: flex-end;
  min-height: 30px;
  gap: 34px;
}

.top-nav {
  gap: 36px;
}

.top-nav a {
  position: relative;
  color: #3c4b61;
  font-size: 14px;
  font-weight: 600;
}

.top-nav a.active {
  color: var(--blue-strong);
}

.top-nav a.active::after {
  position: absolute;
  right: -16px;
  bottom: -14px;
  left: -16px;
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
  content: "";
}

.top-actions {
  gap: 12px;
}

.sun {
  color: #6f7d91;
  font-size: 20px;
}

.top-actions button,
.market-btn,
.range-tabs button {
  border: 0;
  border-radius: 9px;
  color: #40516a;
  background: #fff;
  box-shadow: 0 4px 16px rgba(25, 68, 120, 0.06);
  cursor: pointer;
}

.top-actions button {
  padding: 8px 12px;
  font-size: 13px;
}

.toolbar {
  justify-content: space-between;
  min-height: 30px;
  margin: 0;
  color: #5b6a80;
}

.market-toggle {
  gap: 8px;
  margin-left: 12px;
  font-size: 13px;
}

.market-btn {
  padding: 7px 13px;
  border: 1px solid var(--line);
  font-weight: 700;
}

.market-btn.active {
  color: var(--blue-strong);
  border-color: #d9e6fb;
  background: #fff;
}

.updated-at {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 12px;
  color: #7b8798;
  font-weight: 600;
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 20px 10px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h1,
.card-header h2 {
  margin: 0;
  color: #10223d;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.section-title span {
  color: #9aa8ba;
  font-size: 18px;
}

.hero-copy p {
  margin: 6px 0 8px;
  color: #5d6c82;
  font-size: 13px;
}

.indicator-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(360px, 1.3fr) minmax(250px, 0.9fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
  align-items: center;
  border-top: 1px solid #edf2f8;
  padding-top: 8px;
}

.latest {
  align-self: center;
  padding: 0 8px 0 4px;
}

.latest p {
  margin: 0 0 8px;
  color: #253750;
  font-size: 14px;
  font-weight: 700;
}

.latest strong {
  display: block;
  margin-bottom: 12px;
  color: #236cf1;
  font-size: 58px;
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.change,
.tag {
  color: #637087;
  font-size: 13px;
  font-weight: 700;
}

.change.down,
.tag.success,
.success {
  color: var(--green);
}

.change.up,
.tag.danger,
.danger {
  color: var(--red);
}

.gauge-wrap {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 4px 0 0;
}

.gauge-wrap canvas {
  width: min(100%, 372px);
  height: 174px;
  filter: drop-shadow(0 14px 24px rgba(28, 87, 173, 0.14));
}

.legend-panel {
  display: flex;
  flex-direction: column;
  align-self: center;
  width: 100%;
  min-height: 158px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.legend-panel h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.legend-panel ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legend-panel li {
  display: grid;
  grid-template-columns: 12px 1fr 92px;
  gap: 8px;
  color: #55637a;
  font-size: 12px;
}

.legend-panel i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.green {
  background: var(--green);
}

.yellow {
  background: var(--yellow);
}

.orange {
  background: var(--orange);
}

.red {
  background: var(--red);
}

.legend-panel b {
  color: #687589;
  font-weight: 700;
}

.legend-panel footer {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  color: #758195;
  font-size: 12px;
}

.legend-panel footer a {
  color: var(--blue);
  font-weight: 700;
}

.chart-card {
  min-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding: 11px 18px 9px;
}

.card-header {
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-header h2 {
  font-size: 17px;
}

.range-tabs {
  gap: 8px;
}

.range-tabs button {
  min-width: 38px;
  padding: 6px 10px;
  color: #6e7a8c;
  background: #fbfcff;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

.range-tabs button.active {
  color: #fff;
  background: var(--blue);
}

.range-tabs .more {
  min-width: auto;
  font-size: 22px;
  line-height: 1;
}

.chart-wrap {
  position: relative;
  height: calc(100% - 34px);
  min-height: 150px;
  overflow: hidden;
}

.chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.stat-card {
  position: relative;
  min-height: 124px;
  overflow: hidden;
  padding: 13px 15px 16px;
}

.stat-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.stat-card p {
  margin: 0 0 6px;
  color: #68778e;
  font-size: 12px;
  font-weight: 600;
}

.stat-card strong {
  display: block;
  color: #14243d;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.stat-card small {
  color: inherit;
  font-size: 12px;
  letter-spacing: 0;
}

.stat-card .change,
.stat-card .tag {
  display: block;
  margin-top: 8px;
  font-size: 12px;
}

.spark {
  position: absolute;
  right: 10px;
  bottom: 14px;
  width: 70px;
  height: 35px;
  display: block;
}

.pie {
  position: absolute;
  right: 18px;
  bottom: 26px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: conic-gradient(#b8d3ff 0 34%, #e8f0ff 34% 100%);
}

.pie::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.8) 49% 51%, transparent 52%);
  content: "";
  transform: rotate(150deg);
}

.disclaimer {
  margin: 0;
  color: #7f8a9a;
  text-align: center;
  font-size: 12px;
  line-height: 22px;
}

@media (max-width: 1280px) {
  body {
    min-width: 1040px;
  }

  .app-shell {
    grid-template-columns: 238px minmax(800px, 1fr);
  }

  .indicator-grid {
    grid-template-columns: minmax(160px, 0.72fr) minmax(320px, 1.15fr) minmax(220px, 0.88fr);
    gap: 12px;
  }

  .top-nav {
    gap: 24px;
  }

  .latest strong {
    font-size: 52px;
  }

  .gauge-wrap canvas {
    width: min(100%, 344px);
    height: 164px;
  }
}
