:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --card-soft: #f8fbff;
  --line: #d8e2ef;
  --line-strong: #c8d5e6;
  --text: #162230;
  --muted: #617286;
  --brand: #2d6cdf;
  --brand-soft: #eaf2ff;
  --positive: #c62828;
  --negative: #1e8e3e;
  --neutral: #74869a;
  --shadow: 0 18px 40px rgba(20, 42, 73, 0.08);
  --shadow-soft: 0 8px 20px rgba(20, 42, 73, 0.05);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f6fa 100%);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
p,
dl,
dt,
dd {
  margin: 0;
}

.page-shell {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

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

.section {
  margin-top: 20px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  gap: 20px;
  padding: 26px;
}

.hero-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  font-size: 18px;
  line-height: 1.25;
}

.hero-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.hero-badges,
.badge-list,
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.95) 0%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.toolbar-label,
.filter-label,
.search-box span,
.metric-label,
.panel-meta,
.section-head p,
.filter-summary,
.mini-label,
.small,
.muted {
  color: var(--muted);
}

.toolbar-label,
.filter-label,
.search-box span,
.metric-label,
.mini-label {
  font-size: 12px;
  font-weight: 700;
}

.mode-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mode-note {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-neutral {
  background: #eef3fb;
  color: #496682;
}

.badge-live {
  background: rgba(45, 108, 223, 0.12);
  color: var(--brand);
}

.badge-snapshot {
  background: rgba(116, 134, 154, 0.14);
  color: #5d7084;
}

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

.mini-metric {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.mini-value {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head p,
.panel-meta,
.filter-summary,
.small,
.muted {
  font-size: 13px;
  line-height: 1.6;
}

.inline-head {
  align-items: center;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.metric-value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
}

.metric-footnote {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

.filters-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, 260px);
  gap: 14px;
  margin-bottom: 18px;
}

.filter-group,
.search-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.chip.active {
  background: var(--brand-soft);
  border-color: #b9d0ff;
  color: var(--brand);
}

.search-box input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

.search-box input:focus {
  outline: 2px solid rgba(45, 108, 223, 0.18);
  border-color: #b9d0ff;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
}

.table-wrap table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  background: #fff;
}

.table-wrap thead {
  background: #f6f9fd;
}

.table-wrap th,
.table-wrap td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
  vertical-align: top;
}

.table-wrap tbody tr {
  cursor: pointer;
  transition: background 0.18s ease;
}

.table-wrap tbody tr:hover {
  background: #f8fbff;
}

.table-wrap tbody tr.selected {
  background: #eef5ff;
}

.asset-name,
.value-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-title {
  font-weight: 700;
}

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

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.neutral {
  color: var(--neutral);
}

.analytics-grid,
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.single-panel-grid {
  grid-template-columns: minmax(0, 1fr);
}

.analytics-grid > .panel-surface,
.details-grid > .panel-surface,
.section.panel-surface {
  padding: 20px;
}

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

.bar-list,
.note-list,
.mobile-holdings,
.detail-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.bar-label,
.bar-value {
  font-size: 13px;
  font-weight: 700;
}

.bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f89ea 0%, #2d6cdf 100%);
}

.bar-fill.positive {
  background: linear-gradient(90deg, #ea7b7b 0%, var(--positive) 100%);
}

.bar-fill.negative {
  background: linear-gradient(90deg, #7cc98f 0%, var(--negative) 100%);
}

.mobile-holdings {
  display: none;
}

.mobile-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.mobile-card.selected {
  border-color: #bfd4fb;
  background: #f7fbff;
}

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.mobile-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mobile-stat {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--card-soft);
  border: 1px solid #e7eef8;
}

.mobile-stat-label {
  font-size: 11px;
  color: var(--muted);
}

.mobile-stat-value {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
}

.detail-panel,
.methodology-panel {
  min-height: 420px;
}

.detail-empty {
  padding: 24px;
  border-radius: 18px;
  background: var(--card-soft);
  color: var(--muted);
  line-height: 1.7;
}

.detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.detail-item,
.note-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--card-soft);
  border: 1px solid #e6edf6;
}

.detail-item dt {
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--muted);
}

.detail-item dd {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.note-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

@media (max-width: 1200px) {
  .page-shell {
    width: min(100vw - 28px, 1240px);
  }

  .hero,
  .filters-bar,
  .details-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .page-shell {
    width: min(100vw - 20px, 1240px);
    padding: 14px 0 28px;
  }

  .hero,
  .analytics-grid > .panel-surface,
  .details-grid > .panel-surface,
  .section.panel-surface {
    padding: 16px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 20px;
  }

  .hero-copy {
    font-size: 14px;
    line-height: 1.7;
  }

  .mini-metrics,
  .metrics-grid,
  .detail-grid,
  .mobile-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .desktop-table {
    display: none;
  }

  .mobile-holdings {
    display: flex;
  }

  .panel-head,
  .section-head,
  .mobile-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .mini-metrics,
  .metrics-grid,
  .detail-grid,
  .mobile-card-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 14px;
  }

  .hero-side,
  .mobile-card,
  .metric-card {
    padding: 14px;
  }

  .metric-value {
    font-size: 26px;
  }

  .chip,
  .badge {
    font-size: 11px;
  }
}
