:root {
  --bg: #f7f8fc;
  --panel: #ffffff;
  --panel-soft: #fbfcff;
  --border: #dfe6f3;
  --border-strong: #cfd9eb;
  --text: #1f2940;
  --muted: #71829f;
  --muted-soft: #96a3ba;
  --primary: #5f4bf0;
  --primary-strong: #4f43db;
  --primary-soft: #f0ecff;
  --cyan: #3cc2db;
  --violet: #a78cf5;
  --hero-border: rgba(255, 255, 255, 0.28);
  --shadow: 0 16px 40px rgba(93, 110, 160, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 1200px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(164, 121, 255, 0.06), transparent 30%),
    linear-gradient(180deg, #fafbff 0%, #f7f8fc 30%, #f6f7fb 100%);
}

button,
input {
  font: inherit;
}

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

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.dashboard-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: clamp(86px, 5.8vw, 118px);
  padding: 0 clamp(24px, 2.2vw, 54px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(222, 230, 242, 0.9);
  box-shadow: 0 3px 18px rgba(31, 41, 64, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.1vw, 22px);
  min-width: clamp(216px, 18vw, 290px);
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(52px, 3.7vw, 74px);
  height: clamp(52px, 3.7vw, 74px);
  border-radius: clamp(18px, 1.2vw, 26px);
  color: var(--primary);
  border: 2px solid currentColor;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), transparent 58%),
    linear-gradient(135deg, rgba(95, 75, 240, 0.1), rgba(91, 205, 224, 0.08));
  overflow: hidden;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px -4px 10px -4px;
  border: 2px solid rgba(95, 75, 240, 0.92);
  border-radius: 50%;
  transform: rotate(22deg);
}

.brand-mark::after {
  inset: -4px 12px -4px 12px;
  transform: rotate(-26deg);
  opacity: 0.78;
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-size: clamp(30px, 2.3vw, 44px);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-text {
  font-size: clamp(28px, 2.8vw, 52px);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(28px, 2.7vw, 72px);
  margin-right: auto;
}

.nav-link {
  color: #6a7a98;
  font-size: clamp(19px, 1.45vw, 28px);
  font-weight: 700;
}

.nav-link.active {
  color: #425574;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 14px;
  width: clamp(240px, 16vw, 320px);
  height: clamp(56px, 4vw, 74px);
  padding: 0 clamp(16px, 1.2vw, 24px);
  border-radius: 37px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #f5f7fc 0%, #edf1f8 100%);
  color: #6d7c97;
}

.search-box .icon {
  font-size: clamp(24px, 1.7vw, 34px);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #6d7c97;
  font-size: clamp(18px, 1.35vw, 26px);
  font-weight: 700;
}

.search-box input::placeholder {
  color: #6d7c97;
}

.user-badge {
  display: grid;
  place-items: center;
  width: clamp(50px, 3.4vw, 66px);
  height: clamp(50px, 3.4vw, 66px);
  border-radius: 50%;
  background: linear-gradient(135deg, #5f4bf0, #8b56f6);
  color: #fff;
  font-size: clamp(20px, 1.5vw, 28px);
  font-weight: 800;
}

.user-name {
  font-size: clamp(18px, 1.4vw, 28px);
  font-weight: 700;
}

.workspace-shell {
  display: grid;
  grid-template-columns: clamp(280px, 13.7vw, 404px) minmax(0, 1fr);
  min-height: calc(100vh - clamp(86px, 5.8vw, 118px));
}

.sidebar {
  padding: 18px clamp(18px, 1vw, 30px) 40px;
  background: rgba(255, 255, 255, 0.74);
  border-right: 1px solid rgba(222, 230, 242, 0.94);
}

.sidebar-group {
  padding: 22px 0 28px;
  border-bottom: 1px solid rgba(222, 230, 242, 0.92);
}

.sidebar-group:last-child {
  border-bottom: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #6a7b99;
}

.sidebar-link .icon {
  font-size: clamp(24px, 1.6vw, 32px);
}

.root-link,
.section-link {
  padding: 14px 2px;
  font-size: clamp(21px, 1.7vw, 32px);
  font-weight: 700;
}

.section-link {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: default;
}

.sidebar-link-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.section-link.active-group {
  color: var(--text);
}

.active-icon {
  color: var(--primary);
}

.chevron {
  color: #6f7e9c;
}

.chevron.expanded {
  transform: rotate(0deg);
}

.sub-links {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding-left: 36px;
}

.child-link {
  justify-content: flex-start;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 20px;
  font-size: clamp(18px, 1.45vw, 28px);
  font-weight: 600;
}

.child-link.current {
  color: var(--primary);
  background: linear-gradient(180deg, #efecff 0%, #e8e5ff 100%);
}

.child-link.current .icon {
  color: var(--primary);
}

.main-content {
  padding: 12px clamp(18px, 1.8vw, 34px) 42px;
}

.hero-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: clamp(176px, 11vw, 212px);
  padding: clamp(28px, 2vw, 34px) clamp(28px, 2.2vw, 44px) clamp(30px, 2.3vw, 38px) clamp(30px, 2.4vw, 48px);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(217, 203, 255, 0.9);
  background:
    radial-gradient(circle at 22% -10%, rgba(255, 255, 255, 0.18), transparent 33%),
    radial-gradient(circle at 76% 106%, rgba(255, 78, 182, 0.16), transparent 20%),
    radial-gradient(circle at 88% 26%, rgba(136, 215, 255, 0.12), transparent 24%),
    linear-gradient(90deg, #8c50dc 0%, #9f63e8 28%, #9265e2 58%, #7759df 76%, #7153db 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  inset: -18% auto auto 16%;
  width: 44%;
  height: 180%;
  border-radius: 42%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotate(28deg);
}

.hero-card::after {
  inset: -52% auto auto 56%;
  width: 36%;
  height: 190%;
  transform: rotate(18deg);
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: min(56vw, 980px);
}

.hero-eyebrow {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(34px, 2.7vw, 54px);
  font-weight: 800;
}

.hero-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(18px, 1.3vw, 26px);
  font-weight: 600;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: clamp(56px, 4vw, 74px);
  padding: 0 clamp(18px, 1.3vw, 26px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: clamp(18px, 1.3vw, 26px);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero-button.wide {
  min-width: clamp(340px, 24vw, 452px);
}

.hero-button.icon-only {
  width: 74px;
  padding: 0;
  justify-content: center;
}

.hero-button .icon {
  font-size: clamp(24px, 1.7vw, 34px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 1.25vw, 24px);
  margin-top: clamp(30px, 2.2vw, 48px);
}

.stat-card {
  border-radius: 28px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(54, 77, 120, 0.04);
  overflow: hidden;
}

.stat-card.mint {
  background: linear-gradient(180deg, #f6fbfb 0%, #f4fdf8 100%);
}

.stat-card.cream {
  background: linear-gradient(180deg, #fffdf8 0%, #fffdf4 100%);
}

.stat-card.sky {
  background: linear-gradient(180deg, #fbfcff 0%, #f7fbff 100%);
}

.stat-card.lilac {
  background: linear-gradient(180deg, #fdfdff 0%, #faf7ff 100%);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: clamp(86px, 6vw, 108px);
  padding: 0 clamp(18px, 1.25vw, 28px);
  border-bottom: 1px solid rgba(223, 230, 243, 0.85);
}

.stat-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(18px, 1.15vw, 24px);
  font-weight: 800;
  white-space: nowrap;
}

.stat-icon-wrap {
  display: grid;
  place-items: center;
  width: clamp(34px, 2vw, 42px);
  height: clamp(34px, 2vw, 42px);
  border-radius: 50%;
  background: rgba(114, 131, 164, 0.08);
  color: #687892;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: clamp(42px, 3vw, 54px);
  padding: 0 clamp(12px, 0.8vw, 18px);
  border-radius: 999px;
  border: 1px solid rgba(205, 218, 238, 0.96);
  background: rgba(255, 255, 255, 0.9);
  color: #364863;
  font-size: clamp(12px, 0.8vw, 17px);
  font-weight: 700;
  white-space: nowrap;
}

.stat-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: clamp(134px, 9vw, 158px);
  padding: clamp(18px, 1.5vw, 24px) clamp(18px, 1.4vw, 28px) clamp(20px, 1.6vw, 28px) clamp(22px, 1.7vw, 34px);
}

.stat-body.no-spark {
  align-items: flex-start;
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-value-row.single {
  gap: 0;
}

.stat-value-row.money {
  gap: 4px;
}

.currency,
.stat-value {
  font-size: clamp(34px, 2.35vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-compare {
  color: #71839f;
  font-size: clamp(17px, 1.15vw, 24px);
  font-weight: 700;
}

.stat-subvalue {
  margin-top: 18px;
  color: #637693;
  font-size: clamp(20px, 1.45vw, 28px);
  font-weight: 700;
}

.sparkline {
  width: clamp(112px, 9vw, 170px);
  height: clamp(70px, 5vw, 92px);
  overflow: visible;
}

.sparkline-path {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.mint-line {
  stroke: #55c99b;
}

.pink-line {
  stroke: #ff6aaf;
}

.blue-line {
  stroke: #5d97f4;
}

.analysis-card {
  margin-top: clamp(30px, 2.2vw, 48px);
  border-radius: 30px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(24px, 1.8vw, 34px) clamp(24px, 2.4vw, 48px) clamp(20px, 1.8vw, 28px);
  border-bottom: 1px solid rgba(223, 230, 243, 0.88);
}

.analysis-copy h2 {
  margin: 0;
  font-size: clamp(26px, 1.7vw, 32px);
  font-weight: 800;
}

.analysis-toolbar {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: clamp(56px, 3.6vw, 72px);
  padding: 0 clamp(18px, 1.4vw, 28px);
  border-radius: 18px;
  border: 1px solid rgba(205, 218, 238, 0.96);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  color: #354762;
  font-size: clamp(16px, 1.1vw, 22px);
  font-weight: 700;
}

.filter-button .chevron {
  font-size: 22px;
}

.tab-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid rgba(214, 223, 239, 0.94);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tab-button {
  min-height: clamp(48px, 3vw, 58px);
  padding: 0 clamp(18px, 1.4vw, 28px);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4b5d79;
  font-size: clamp(16px, 1.1vw, 22px);
  font-weight: 700;
}

.tab-button.active {
  background: linear-gradient(135deg, #5f4bf0 0%, #4f43db 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(95, 75, 240, 0.26);
}

.analysis-panel {
  padding: clamp(20px, 1.6vw, 26px) clamp(24px, 2.4vw, 48px) clamp(24px, 1.8vw, 36px);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(198, 212, 236, 0.98);
  background: #fff;
  color: var(--text);
  font-size: clamp(15px, 0.95vw, 18px);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(73, 92, 133, 0.05);
}

.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.legend-dot.cyan {
  background: var(--cyan);
}

.legend-dot.violet {
  background: var(--violet);
}

.chart-shell {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: stretch;
  min-height: 620px;
}

.chart-axis {
  display: grid;
  align-content: stretch;
  justify-items: end;
  padding-top: 84px;
  padding-right: 16px;
  color: #637693;
  font-size: clamp(14px, 0.95vw, 18px);
  font-weight: 700;
}

.chart-axis span {
  display: flex;
  align-items: center;
}

.chart-axis span:nth-child(1) {
  align-self: start;
}

.chart-axis span:nth-child(2),
.chart-axis span:nth-child(3),
.chart-axis span:nth-child(4) {
  align-self: center;
}

.chart-axis span:nth-child(5) {
  align-self: end;
}

.chart-area {
  position: relative;
  min-width: 0;
  border-radius: 30px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(247, 249, 254, 0.38), rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(244, 247, 255, 0.24));
}

.chart-svg {
  display: block;
  width: 100%;
  height: 620px;
}

.chart-footer {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-left: 110px;
  padding: 16px 0 0;
  color: #5c6f8c;
  font-size: clamp(14px, 0.95vw, 18px);
  font-weight: 700;
  text-align: center;
}

.chart-grid-line {
  stroke: rgba(221, 229, 242, 0.95);
  stroke-dasharray: 8 8;
  stroke-width: 1.4;
}

.chart-baseline {
  stroke: rgba(213, 222, 239, 0.98);
  stroke-width: 1.6;
}

.chart-bar {
  rx: 14;
}

.analysis-card,
.hero-card,
.stat-card {
  backdrop-filter: blur(8px);
}

@media (max-width: 1680px) {
  body {
    min-width: 1100px;
  }

  .topbar {
    padding-inline: 32px;
  }
}

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

  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding-block: 18px;
  }

  .brand {
    min-width: auto;
  }

  .primary-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-right: 0;
    gap: 28px;
  }

  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding-inline: 18px;
  }

  .hero-card,
  .analysis-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions,
  .analysis-toolbar {
    justify-content: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .chart-footer {
    margin-left: 84px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .search-box {
    flex: 1;
    min-width: 0;
  }

  .primary-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-button.wide {
    min-width: 0;
    width: 100%;
  }

  .tab-switcher {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .chart-shell {
    grid-template-columns: 1fr;
  }

  .chart-axis {
    display: none;
  }

  .chart-footer {
    margin-left: 0;
    font-size: 12px;
  }
}
