:root {
  --ink: #111827;
  --sub: #4B5563;
  --muted: #6B7280;
  --line: #E5E7EB;
  --panel: #F3F4F6;
  --pale: #EAF5FD;
  --blue: #3D8DFF;
  --navy: #17365D;
  --etf: #3D8DFF;
  --passive: #7BA3C9;
  --enhance: #1F4E79;
  --fuguo: #E47C2B;
  --white: #FFFFFF;
  --sidebar: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--white);
  display: flex;
}
button, select { font-family: inherit; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  background: #FAFBFC;
}
.brand-kicker { font-size: 11px; letter-spacing: 0.12em; color: var(--blue); font-weight: 600; }
.brand-title { margin: 8px 0 4px; font-size: 20px; font-weight: 700; line-height: 1.3; }
.brand-sub { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 28px; }
.nav-label {
  font-size: 11px; color: var(--muted); letter-spacing: 0.08em;
  margin: 18px 0 8px; font-weight: 600;
}
.nav-btn {
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  color: var(--ink); font-size: 14px; margin-bottom: 4px;
}
.nav-btn.active { background: var(--pale); color: var(--navy); font-weight: 650; }
.nav-btn:hover:not(.active):not(:disabled) { background: #EEF1F4; }
.nav-btn:disabled { color: #9CA3AF; cursor: not-allowed; }
.nav-note { margin-top: auto; font-size: 11px; color: var(--muted); line-height: 1.55; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.topbar {
  padding: 22px 36px 0; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
}
.topbar h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.topbar p { margin: 6px 0 0; color: var(--sub); font-size: 14px; line-height: 1.5; max-width: 720px; }
.meta-chip {
  font-size: 12px; color: var(--navy); background: var(--pale);
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.screen { display: none; flex: 1; overflow: auto; padding: 20px 36px 28px; }
.screen.active { display: block; }
.footer-call {
  margin-top: 18px; background: var(--panel); padding: 14px 16px; border-radius: 10px;
  font-size: 14px; line-height: 1.55; color: var(--ink);
}
.footer-call strong { color: var(--navy); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 16px; }
.kpi {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  border-left: 4px solid var(--blue); background: var(--white);
}
.kpi .l { font-size: 12px; color: var(--sub); }
.kpi .v { font-size: 22px; font-weight: 700; margin: 4px 0 2px; }
.kpi .s { font-size: 12px; color: var(--muted); }
.row { display: grid; gap: 16px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-21 { grid-template-columns: 1.15fr 0.85fr; }
.quad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quad {
  border: 1px solid var(--line); border-radius: 12px; background: var(--white);
  padding: 14px 16px; text-align: left; cursor: pointer; color: inherit;
}
.quad .qn { font-size: 13px; color: var(--sub); font-weight: 650; }
.quad .qv { font-size: 22px; font-weight: 700; margin: 6px 0 4px; }
.quad .qh { font-size: 12px; color: var(--muted); line-height: 1.45; }
.quad.on { background: #FAFBFC; box-shadow: inset 3px 0 0 var(--navy); }
.quad[data-quad="资金驱动成长型"] .qn { color: #2A9D8F; }
.quad[data-quad="行情驱动型"] .qn { color: #E47C2B; }
.quad[data-quad="资金流入但净值拖累"] .qn { color: #3D8DFF; }
.quad[data-quad="弱生命力"] .qn { color: #C0392B; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--white); }
.card h3 { margin: 0 0 8px; font-size: 14px; color: var(--navy); }
.chart { width: 100%; height: 300px; }
.chart-tall { height: 360px; }
.chart-wide { height: 440px; }
.chart-scroll { overflow-x: auto; }
.block { margin-top: 8px; }
.block + .block { margin-top: 28px; }
.block-title {
  font-size: 16px; font-weight: 700; color: var(--navy);
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.block-title span { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar[hidden] { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  border: 0; background: var(--white); padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--sub);
}
.seg button.on { background: var(--navy); color: var(--white); }
.chip {
  border: 1px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 5px 11px; font-size: 12px; cursor: pointer; color: var(--sub);
}
.chip.on { border-color: var(--blue); color: var(--navy); background: var(--pale); font-weight: 600; }
#chCats, #chThemes, #chBanks, #trendThemeCats, #mgrThemeCats, #chStackCats,
#fgCats, #fgThemes, #fgBanks, #fgPos { display: flex; flex-wrap: wrap; gap: 6px; }
#chBanks, #fgBanks { flex: 1; flex-wrap: nowrap; overflow-x: auto; }
.fg-pos-push { color: #2A9D8F; font-weight: 650; }
.fg-pos-bring { color: #3D8DFF; font-weight: 650; }
.fg-pos-gap { color: #E47C2B; font-weight: 650; }
.fg-pos-watch { color: #6B7280; }
.chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; margin-right: 5px; vertical-align: 1px;
}
.ch-prod-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ch-prod-filters .toolbar { margin-bottom: 0; }
.row-2.ch-quads { grid-template-columns: 1fr 1fr; }
.ch-quads .card { min-width: 0; }
.ch-quads .chart { height: 440px; }
.ch-chart-cap { margin: 0 0 8px; min-height: 16px; }
#chAdvNote { margin: 10px 0 0; }
.slider-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; }
.slider-wrap input { flex: 1; }
.muted { color: var(--muted); font-size: 12px; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.rule h3 { margin: 0 0 10px; font-size: 15px; }
.rule ul { margin: 0; padding-left: 18px; color: var(--sub); font-size: 14px; line-height: 1.7; }
details.why {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: #FAFBFC;
}
details.why summary { cursor: pointer; font-weight: 650; color: var(--navy); }
details.why p { color: var(--sub); font-size: 14px; line-height: 1.7; margin: 10px 0 0; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: right; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
th { cursor: pointer; color: var(--sub); font-weight: 600; background: #FAFBFC; position: sticky; top: 0; white-space: normal; vertical-align: bottom; }
th .h { display: block; white-space: nowrap; }
th .calc { display: block; font-size: 10px; font-weight: 400; color: var(--muted); line-height: 1.35; margin-top: 3px; }
th.idx, td.idx { width: 44px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; cursor: default; }
th:hover { color: var(--navy); }
th.sorted { color: var(--navy); }
th.sorted .calc { color: #6B7280; }
th[data-dir="desc"] .h::after { content: " ↓"; font-weight: 700; }
th[data-dir="asc"] .h::after { content: " ↑"; font-weight: 700; }
tr.fuguo td { background: #FFF6EE; font-weight: 650; }
tr.picked td { background: var(--pale); }
.pick {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; color: var(--ink); background: var(--white); cursor: pointer;
}
.pick:focus, .search:focus { outline: 2px solid var(--pale); border-color: var(--blue); }
.search {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
  font-size: 13px; min-width: 220px; color: var(--ink); background: var(--white);
}
.search:focus { outline: 2px solid var(--pale); border-color: var(--blue); }
#prodTable th:nth-child(2),
#prodTable td.name {
  text-align: left;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#prodTable th:nth-child(3),
#prodTable td.mgr {
  text-align: left;
  white-space: nowrap;
}
#chProdTable th:nth-child(2),
#chProdTable td.name {
  text-align: left;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#chProdTable th:nth-child(3),
#chProdTable td.mgr,
#chProdTable th:nth-child(4),
#chProdTable td.cust {
  text-align: left;
  white-space: nowrap;
}
#chProdTable th:nth-child(5),
#chProdTable th:nth-child(6),
#chProdTable th:nth-child(7),
#chProdTable th:nth-child(8) {
  text-align: left;
}
#fgDirTable th:nth-child(2),
#fgDirTable td.name,
#fgProdTable th:nth-child(2),
#fgProdTable td.name,
#fgRefTable th:nth-child(2),
#fgRefTable td.name {
  text-align: left;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#fgDirTable thead,
#fgProdTable thead,
#fgRefTable thead { position: sticky; top: 0; z-index: 3; }
#fgDirTable thead th,
#fgProdTable thead th,
#fgRefTable thead th { position: static; top: auto; vertical-align: bottom; }
#fgDirTable .fg-g-head,
#fgProdTable .fg-g-head,
#fgRefTable .fg-g-head { cursor: default; }
#fgDirTable .fg-g-size,
#fgProdTable .fg-g-size,
#fgRefTable .fg-g-size { background: #E8F1FA; }
#fgDirTable .fg-g-share,
#fgProdTable .fg-g-share,
#fgRefTable .fg-g-share { background: #E7F5EF; }
#fgDirTable .fg-g-ratio,
#fgProdTable .fg-g-ratio,
#fgRefTable .fg-g-ratio { background: #FFF3E6; }
#fgDirTable th.fg-g-size,
#fgDirTable th.fg-g-share,
#fgDirTable th.fg-g-ratio,
#fgProdTable th.fg-g-size,
#fgProdTable th.fg-g-share,
#fgProdTable th.fg-g-ratio,
#fgRefTable th.fg-g-size,
#fgRefTable th.fg-g-share,
#fgRefTable th.fg-g-ratio { color: var(--navy); }
#fgDirBody tr.picked td.fg-g-size { background: #D7E6F5; }
#fgDirBody tr.picked td.fg-g-share { background: #D4EEE3; }
#fgDirBody tr.picked td.fg-g-ratio { background: #FCE6C8; }
#fgDirTable th:nth-child(3),
#fgProdTable th:nth-child(3),
#fgProdTable th:nth-child(4),
#fgProdTable th:nth-child(5),
#fgProdTable th:nth-child(6),
#fgProdTable td.cust,
#fgRefTable th:nth-child(3),
#fgRefTable td.mgr,
#fgRefTable th:nth-child(4),
#fgRefTable th:nth-child(5),
#fgRefTable th:nth-child(6) { text-align: left; }
#fgProdTable th[data-sort="founded"],
#fgRefTable th[data-sort="founded"],
#fgProdTable td.date,
#fgRefTable td.date { white-space: nowrap; }
#fgDirTable { min-width: 1760px; }
#fgProdTable,
#fgRefTable,
#mgrProdTable { min-width: 2180px; }
#mgrProdTable .fg-g-head { cursor: default; }
#mgrProdTable .fg-g-size { background: #E8F1FA; }
#mgrProdTable .fg-g-share { background: #E7F5EF; }
#mgrProdTable .fg-g-ratio { background: #FFF3E6; }
#mgrProdTable th.fg-g-size,
#mgrProdTable th.fg-g-share,
#mgrProdTable th.fg-g-ratio { color: var(--navy); }
#mgrProdTable th:nth-child(2),
#mgrProdTable td.name {
  text-align: left;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#mgrProdTable thead { position: sticky; top: 0; z-index: 3; }
#mgrProdTable thead th { position: static; top: auto; vertical-align: bottom; }
#mgrProdCard { margin-bottom: 16px; }
#fgDirBody tr { cursor: pointer; }
#fgDirNote, #fgProdNote { margin: 10px 0 0; }
.chg-up { color: #C0392B; font-weight: 650; }
.chg-down { color: #1B7A4E; font-weight: 650; }
#mgrBody tr { cursor: pointer; }
#mgrTable { min-width: 1180px; }
#mgrTable .mgr-g-head { cursor: default; }
#mgrTable .mgr-g-sn { background: #E8F1FA; }
#mgrTable .mgr-g-ss { background: #D6E6F5; }
#mgrTable .mgr-g-in { background: #E7F5EF; }
#mgrTable .mgr-g-is { background: #FFF3E6; }
#mgrTable th.mgr-g-sn,
#mgrTable th.mgr-g-ss,
#mgrTable th.mgr-g-in,
#mgrTable th.mgr-g-is { color: var(--navy); }
#mgrBody tr.fuguo td.mgr-g-sn,
#mgrBody tr.picked td.mgr-g-sn { background: #D7E6F5; }
#mgrBody tr.fuguo td.mgr-g-ss,
#mgrBody tr.picked td.mgr-g-ss { background: #C5D9EF; }
#mgrBody tr.fuguo td.mgr-g-in,
#mgrBody tr.picked td.mgr-g-in { background: #D4EEE3; }
#mgrBody tr.fuguo td.mgr-g-is,
#mgrBody tr.picked td.mgr-g-is { background: #FCE6C8; }
#mgrBody tr.fuguo td:nth-child(1),
#mgrBody tr.fuguo td:nth-child(2) { background: #FFF6EE; }
.table-wrap { max-height: 560px; overflow: auto; margin-top: 8px; }
.q-label { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--navy); min-width: 72px; }
.play { border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
.cdn-warn { padding: 10px 16px; background: #FEF3C7; color: #92400E; font-size: 13px; }
@media (max-width: 1100px) {
  .kpis, .row-2, .row-21, .rule-grid { grid-template-columns: 1fr; }
  .row-2.ch-quads { grid-template-columns: 1fr 1fr; }
  .sidebar { display: none; }
}
