* {
  box-sizing: border-box;
}

:root {
  --bg: #eef2f5;
  --bg-deep: #dfe7ee;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --panel-soft: rgba(247, 250, 252, 0.9);
  --brand-950: #0b213e;
  --brand-900: #12345d;
  --brand-800: #1a4779;
  --accent: #d98744;
  --accent-soft: #f3dec4;
  --ink: #1c314e;
  --ink-soft: #637792;
  --line: rgba(124, 148, 178, 0.22);
  --line-strong: rgba(96, 122, 154, 0.32);
  --success: #557a55;
  --shadow-page: 0 36px 72px -48px rgba(9, 31, 57, 0.45);
  --shadow-card: 0 24px 48px -34px rgba(14, 34, 60, 0.35);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

body {
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, rgba(243, 222, 196, 0.42), transparent 24%),
    radial-gradient(circle at 86% 8%, rgba(178, 204, 226, 0.42), transparent 24%),
    linear-gradient(180deg, #f5f8fb 0%, var(--bg) 52%, #ebf0f4 100%);
}

body.modal-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 20px 16px 18px;
  color: rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(180deg, rgba(9, 30, 57, 0.98) 0%, rgba(17, 52, 93, 0.98) 48%, rgba(27, 71, 121, 0.98) 100%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent 28%);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 22px 0 40px -30px rgba(9, 31, 57, 0.75);
}

.brand-panel {
  padding: 18px 16px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
  backdrop-filter: blur(6px);
}

.brand-logo {
  width: 184px;
  max-width: 100%;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.18));
}

.brand-panel h1 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.42;
  font-weight: 600;
}

.sidebar-block {
  margin-top: 16px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-block-title {
  padding: 0 4px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}

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

.nav-btn {
  appearance: none;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 11px;
  text-align: left;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font-size: 0.84rem;
  line-height: 1.36;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-btn:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.nav-btn.active {
  color: #fff;
  border-color: rgba(246, 204, 161, 0.42);
  background: linear-gradient(90deg, rgba(217, 135, 68, 0.24), rgba(255, 255, 255, 0.08));
}

.sidebar-meta {
  margin-top: 18px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  word-break: break-all;
}

.page {
  padding: 24px;
}

.content-head {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.content-head-main {
  position: relative;
  overflow: hidden;
  padding: 22px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(122, 146, 175, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 252, 0.92)),
    radial-gradient(circle at top right, rgba(214, 231, 245, 0.8), transparent 34%);
  box-shadow: var(--shadow-page);
}

.content-head-main::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 240px;
  height: 240px;
  background:
    radial-gradient(circle, rgba(217, 135, 68, 0.14) 0%, rgba(217, 135, 68, 0) 70%);
  pointer-events: none;
}

.content-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  color: #5f7693;
}

.content-title {
  margin: 10px 0 0;
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.72rem, 2.5vw, 2.34rem);
  line-height: 1.12;
  color: #18375d;
}

.content-desc {
  max-width: 720px;
  margin: 12px 0 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.utility-bar {
  position: relative;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.search-box {
  position: relative;
}

.search-box label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.search-box input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(105, 132, 163, 0.28);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-box input:focus {
  border-color: rgba(26, 71, 121, 0.46);
  box-shadow: 0 0 0 4px rgba(26, 71, 121, 0.08);
}

.search-results {
  position: absolute;
  inset: calc(100% + 10px) 0 auto;
  display: none;
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(124, 148, 178, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 38px -30px rgba(7, 27, 48, 0.34);
  z-index: 20;
}

.search-results.show {
  display: block;
}

.search-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(124, 148, 178, 0.12);
  padding: 11px 12px;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.search-item:last-child {
  border-bottom: 0;
}

.search-item:hover {
  background: rgba(237, 244, 250, 0.9);
  transform: translateX(2px);
}

.search-item-title {
  font-size: 0.84rem;
  color: var(--ink);
}

.search-item-meta {
  margin-top: 4px;
  font-size: 0.73rem;
  color: var(--ink-soft);
}

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

.panel.soft {
  background: linear-gradient(180deg, rgba(247, 250, 252, 0.94), rgba(255, 255, 255, 0.92));
}

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

.panel-head h2 {
  margin: 0;
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
  font-size: 1.2rem;
  color: #1a3d66;
}

.panel-sub {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.mini-head {
  margin-bottom: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #55708d;
}

.home-grid {
  display: block;
}

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

.sheet-card {
  display: flex;
  min-height: 176px;
  flex-direction: column;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(124, 148, 178, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94)),
    radial-gradient(circle at top right, rgba(223, 234, 244, 0.6), transparent 42%);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.sheet-card:hover {
  transform: translateY(-2px);
  border-color: rgba(98, 128, 164, 0.28);
  box-shadow: 0 30px 54px -40px rgba(14, 34, 60, 0.42);
}

.sheet-card-wide {
  grid-column: span 3;
  min-height: 0;
}

.sheet-card h3 {
  margin: 0;
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
  font-size: 1rem;
  line-height: 1.35;
  color: #1f426d;
}

.sheet-card .meta {
  margin-top: 5px;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.sheet-card .desc {
  margin: 10px 0 0;
  flex: 1;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #4d6380;
}

.open-btn,
.ghost-btn {
  appearance: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.open-btn {
  align-self: flex-start;
  margin-top: 12px;
  border: 1px solid rgba(32, 79, 129, 0.22);
  background: linear-gradient(90deg, rgba(18, 59, 122, 0.08), rgba(217, 135, 68, 0.08));
  color: #19406b;
}

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

.source-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(103, 128, 155, 0.18);
  background: rgba(247, 250, 252, 0.95);
  font-size: 0.74rem;
  color: #50657f;
}

.theme-topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.theme-topic-tab {
  appearance: none;
  border: 1px solid rgba(78, 105, 137, 0.16);
  background: rgba(243, 247, 250, 0.94);
  color: #335275;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.theme-topic-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(28, 68, 112, 0.28);
}

.theme-topic-tab.active {
  color: #ffffff;
  border-color: rgba(18, 59, 122, 0.52);
  background: linear-gradient(90deg, rgba(18, 59, 122, 0.94), rgba(36, 84, 138, 0.92));
}

.theme-chart-grid {
  display: block;
}

.theme-chart-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(124, 148, 178, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 251, 253, 0.96)),
    radial-gradient(circle at top right, rgba(224, 235, 245, 0.64), transparent 42%);
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.theme-chart-card:hover {
  transform: translateY(-2px);
  border-color: rgba(98, 128, 164, 0.28);
  box-shadow: 0 30px 56px -42px rgba(14, 34, 60, 0.42);
}

.theme-chart-card.focus-flash {
  border-color: rgba(217, 135, 68, 0.5);
  box-shadow: 0 0 0 4px rgba(217, 135, 68, 0.14);
}

.theme-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.theme-chart-title {
  font-size: 0.94rem;
  line-height: 1.52;
  color: #1f426d;
  font-weight: 600;
}

.theme-chart-kicker {
  margin-bottom: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #72859f;
  text-transform: uppercase;
}

.theme-chart-meta {
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.theme-chart-actions {
  display: flex;
  align-items: start;
  gap: 8px;
  flex-shrink: 0;
}

.theme-chart-tip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(18, 59, 122, 0.06);
  color: #4c6581;
  font-size: 0.72rem;
  white-space: nowrap;
}

.theme-chart-note {
  margin-top: 10px;
  padding-left: 4px;
  font-size: 0.76rem;
  color: #667a95;
}

.ghost-btn {
  border: 1px solid rgba(18, 59, 122, 0.14);
  background: rgba(255, 255, 255, 0.84);
  color: #1f426d;
}

.chart-shell,
.picture-stage {
  border-radius: 18px;
  border: 1px solid rgba(124, 148, 178, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.92)),
    repeating-linear-gradient(
      -45deg,
      rgba(220, 230, 239, 0.18) 0,
      rgba(220, 230, 239, 0.18) 16px,
      rgba(255, 255, 255, 0.18) 16px,
      rgba(255, 255, 255, 0.18) 32px
    );
}

.chart-shell {
  min-height: 560px;
}

.chart-canvas {
  width: 100%;
  height: 560px;
}

.radar-values-table {
  width: calc(100% - 24px);
  min-width: 0;
  margin: 8px 12px 14px;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
}

.radar-values-table th,
.radar-values-table td {
  border: 1px solid rgba(124, 148, 178, 0.14);
  padding: 5px 6px;
  font-size: 0.68rem;
  color: #325074;
  text-align: center;
}

.radar-values-table th {
  background: rgba(239, 245, 250, 0.92);
  font-weight: 600;
}

.radar-values-table td:first-child,
.radar-values-table th:first-child {
  text-align: left;
  width: 96px;
}

.picture-stage {
  min-height: 328px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 10px;
}

.picture-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.chart-fallback,
.empty-tip {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.theme-table-wrap {
  margin-top: 18px;
  border-radius: 20px;
  border: 1px solid rgba(124, 148, 178, 0.18);
  background: var(--panel-strong);
  box-shadow: var(--shadow-card);
}

.theme-table-title {
  padding: 13px 14px 10px;
  border-bottom: 1px solid rgba(124, 148, 178, 0.14);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: #3a5779;
  text-transform: uppercase;
}

.theme-table-scroll {
  overflow: auto;
  max-height: 72vh;
}

.theme-data-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
}

.theme-data-table td {
  border: 1px solid rgba(124, 148, 178, 0.16);
  padding: 6px 7px;
  font-size: 0.73rem;
  line-height: 1.38;
  color: #1f426d;
  vertical-align: middle;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.theme-data-table.compact-table {
  min-width: 720px;
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
}

.theme-data-table.compact-table tr:first-child td,
.theme-data-table.compact-table tr:nth-child(2) td {
  font-weight: 600;
  color: #28476c;
  background: rgba(239, 245, 250, 0.92);
}

.theme-data-table.compact-table td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
}

.theme-data-table.global-funds-table {
  min-width: 760px;
  table-layout: auto;
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
}

.theme-data-table.global-funds-table td {
  border: 1px solid rgba(181, 191, 205, 0.72);
  padding: 6px 8px;
  font-size: 0.74rem;
  color: #111827;
  white-space: pre-line;
}

.theme-data-table.stock-valuation-table {
  width: 100%;
  table-layout: fixed;
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", sans-serif;
}

.theme-data-table.stock-valuation-table td {
  padding: 2px 3px;
  font-size: 0.66rem;
  line-height: 1.1;
  color: #111827;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.theme-data-table.stock-valuation-table td:first-child {
  font-weight: 700;
  text-align: left;
}

.theme-data-table.stock-valuation-table .has-data-bar {
  padding: 0 4px;
}

.table-cell-bar-wrap {
  position: relative;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-cell-bar-fill {
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  border-radius: 0;
  background: #dcebff;
}

.table-cell-bar-label {
  position: relative;
  z-index: 1;
}

.theme-data-table.asset-performance-table tr td:first-child {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.theme-data-table.asset-performance-table tr:first-child td {
  color: #ffffff !important;
}

.theme-table-note,
.theme-data-table tr.theme-table-note-row td.theme-table-note-cell {
  color: #7f8793;
  line-height: 1.44;
  white-space: normal;
}

.theme-table-note {
  border-top: 1px solid rgba(124, 148, 178, 0.14);
  padding: 8px 12px 12px;
  font-size: 0.74rem;
}

.page-footnote {
  margin-top: 14px;
  padding: 8px 2px 2px;
  font-size: 0.73rem;
  color: #74859b;
}

.tooltip-title {
  margin-bottom: 6px;
  font-weight: 600;
  color: #fff;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}

.tooltip-name {
  color: rgba(244, 247, 251, 0.84);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 19, 34, 0.7);
  backdrop-filter: blur(5px);
}

.image-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100vw - 48px));
  margin: 32px auto;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 56px -28px rgba(0, 0, 0, 0.5);
}

.image-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(124, 148, 178, 0.14);
}

.image-modal-title {
  font-size: 0.9rem;
  color: #1f426d;
}

.image-modal-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 59, 122, 0.08);
  color: #1f426d;
  font-size: 1.2rem;
  cursor: pointer;
}

.image-modal-body {
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 12px;
}

.image-modal-body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

@media (max-width: 1200px) {
  .sheet-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sheet-card-wide {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding-bottom: 20px;
  }

  .page {
    padding: 16px;
  }

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

@media (max-width: 720px) {
  .content-head-main,
  .panel {
    padding: 16px;
  }

  .sheet-overview {
    grid-template-columns: 1fr;
  }

  .sheet-card-wide {
    grid-column: span 1;
  }

  .theme-chart-head {
    flex-direction: column;
  }

  .theme-chart-actions {
    flex-wrap: wrap;
  }

  .chart-shell,
  .picture-stage,
  .chart-canvas {
    min-height: 280px;
    height: 280px;
  }

  .image-modal-dialog {
    width: calc(100vw - 20px);
    margin: 10px auto;
  }
}
