/* dashboard 单页样式 · v1.0.0-dev */

/* tab 导航 */
.tab-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab-btn {
  padding: 6px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-sub);
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s;
}
.tab-btn:hover {
  color: var(--color-text);
}
.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 500;
}

/* dashboard 主体 */
.dashboard {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px 64px;
}
.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}
.tab-panel.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.tab-header h2 { margin: 0; font-size: 24px; }
.tab-sub { color: var(--color-text-sub); margin: 0; flex: 1; }
.tab-actions { display: flex; gap: 8px; align-items: center; }

/* 卡片基础 */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.card h2, .card h3 { margin: 0 0 12px; }
.card h2 { font-size: 18px; }
.card h3 { font-size: 16px; }
.card-sub { color: var(--color-text-sub); font-size: 13px; margin: -6px 0 12px; }
.card-status-section { background: #fafbfc; }

/* 卡片网格(概览页 4 张入口卡) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.card-entry {
  display: block;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--color-text) !important;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: var(--shadow-card);
}
.card-entry:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(30, 111, 255, 0.1);
}
.card-entry h3 { margin: 0 0 6px; font-size: 16px; }
.card-entry p { margin: 0 0 8px; color: var(--color-text-sub); font-size: 12px; }
.card-tag {
  display: inline-block;
  padding: 1px 6px;
  background: #e6f7ff;
  color: var(--color-primary);
  border-radius: 3px;
  font-size: 11px;
}

/* 总览行 */
.total-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.total-card {
  background: #fafbfc;
  border-radius: var(--radius);
  padding: 12px 16px;
}
.total-card .label { font-size: 11px; color: var(--color-text-sub); }
.total-card .value { font-size: 20px; font-weight: 600; margin-top: 4px; }
.total-card.positive .value { color: var(--color-success); }
.total-card.negative .value { color: var(--color-danger); }

/* 排名表(双色柱状图) */
.ranking-bar-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  height: 18px;
  min-width: 100px;
}
.ranking-bar {
  height: 12px;
  background: linear-gradient(90deg, var(--color-primary), #4d8cff);
  border-radius: 2px;
  transition: width 0.3s;
}
.ranking-bar.positive {
  background: linear-gradient(90deg, #00b42a, #5cd47e);
}
.ranking-bar.negative {
  background: linear-gradient(90deg, #f53f3f, #ff7878);
}
.ranking-bar.neutral {
  background: linear-gradient(90deg, #c0c4cc, #d8dae0);
}
.ranking-bar.etf {
  background: linear-gradient(90deg, #00b42a, #5cd47e);
}
.ranking-pct {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--color-text);
  min-width: 45px;
  text-align: right;
}
.ranking-row-alert {
  background: rgba(245, 63, 63, 0.08) !important;
  border-left: 3px solid var(--color-danger);
}
.ranking-row-alert:hover {
  background: rgba(245, 63, 63, 0.12) !important;
}

/* 阈值设置 */
.threshold-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.threshold-form .form-row {
  grid-template-columns: 180px 100px 1fr;
  align-items: center;
}
.threshold-form input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.threshold-form .hint {
  font-size: 11px;
  color: var(--color-text-sub);
  margin-left: 4px;
}
.threshold-form .form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.alert-box {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 6px;
  line-height: 1.6;
}
.alert-box code {
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
  margin: 0 2px;
}
.alert-ticker {
  background: rgba(245, 63, 63, 0.1);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
}
.alert-region {
  background: rgba(255, 125, 0, 0.1);
  border: 1px solid var(--color-warn);
  color: var(--color-warn);
}
.alert-sector {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid #d4a017;
  color: #b36800;
}
.alert-ok {
  background: rgba(0, 180, 42, 0.1);
  border: 1px solid var(--color-success);
  color: var(--color-success);
}
/* W5.16.2 阈值嵌入各表标题区(原独立设置卡已拆) */
.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.card-header-row h3 { margin: 0 0 4px; }
.card-header-row .card-sub { margin: 0; }
.threshold-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.inline-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.inline-input input {
  width: 60px;
  padding: 3px 6px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}
.inline-input input:focus {
  outline: none;
  border-color: var(--color-primary);
}
/* 矩阵单元格超阈值标红 */
.overlap-table td.cell-alert {
  background: var(--color-danger) !important;
  color: white !important;
  font-weight: 600;
}
/* active share 表行超阈值 */
.active-share-row.alert { background: rgba(245, 63, 63, 0.08); }
.active-share-row.alert td.num { color: var(--color-danger); font-weight: 600; }
/* 行/列总和超阈值 */
.row-total-alert, .col-total-alert {
  background: rgba(245, 63, 63, 0.15) !important;
  color: var(--color-danger) !important;
  font-weight: 600;
}
  color: var(--color-success);
}

/* 重叠矩阵 */
.overlap-table {
  border-collapse: collapse;
  font-size: 12px;
}
.overlap-table th, .overlap-table td {
  padding: 6px 10px;
  text-align: center;
  border: 1px solid var(--color-border);
}
.overlap-table th { background: #f5f6f7; font-weight: 500; }
.overlap-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.overlap-cell.diagonal { background: transparent; color: transparent; }
.overlap-cell.hot { background: rgba(245, 63, 63, 0.15); color: var(--color-danger); }
.overlap-cell.warm { background: rgba(255, 125, 0, 0.15); color: var(--color-warn); }
.overlap-cell.mild { background: rgba(0, 180, 42, 0.15); color: var(--color-success); }

/* === 概览页跨 tab 速览 === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.kpi-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
}
.kpi-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.kpi-sub .pos { color: var(--color-success); font-weight: 600; }
.kpi-sub .neg { color: var(--color-danger); font-weight: 600; }

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 1100px) { .overview-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .overview-grid { grid-template-columns: 1fr; } }

.overview-grid .card { min-height: 280px; }
.overview-grid .card-sub { font-size: 11px; color: var(--color-text-muted); margin: -4px 0 12px; }

.data-table.compact { font-size: 12px; }
.data-table.compact th, .data-table.compact td { padding: 4px 8px; }
.alert-row { background: rgba(245, 63, 63, 0.06); }
.alert-row td.neg { color: var(--color-danger); font-weight: 600; }

.empty-ok { color: var(--color-success); padding: 12px 0; font-size: 13px; }
.empty { color: var(--color-text-muted); padding: 12px 0; font-size: 12px; text-align: center; }

.candidate-mini {
  list-style: none;
  padding: 0;
  margin: 0;
}
.candidate-mini li {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
}
.candidate-mini li:last-child { border-bottom: none; }
.candidate-mini-ticker code {
  background: var(--color-primary);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
}
.candidate-mini-name { color: var(--color-text); }
.candidate-mini-intent {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.candidate-mini-intent.intent-blue { background: rgba(22, 119, 255, 0.1); color: var(--color-primary); }
.candidate-mini-intent.intent-gray { background: rgba(0, 0, 0, 0.06); color: #666; }
.candidate-mini-intent.intent-orange { background: rgba(255, 125, 0, 0.1); color: var(--color-warn); }
.candidate-mini-intent.intent-unknown { background: rgba(0,0,0,0.04); color: #999; }
.candidate-mini-note {
  grid-column: 1 / -1;
  color: var(--color-text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.research-mini {
  list-style: none;
  padding: 0;
  margin: 0;
}
.research-mini li {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
}
.research-mini li:last-child { border-bottom: none; }
.research-mini-ticker {
  grid-row: 1 / 3;
}
.research-mini-ticker code {
  background: var(--color-primary);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
}
.research-mini-title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.research-mini-tag {
  background: rgba(0, 180, 42, 0.1);
  color: var(--color-success);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.research-mini-meta {
  grid-column: 2 / -1;
  color: var(--color-text-muted);
  font-size: 10px;
  font-family: monospace;
}

/* === 候选池 tab === */
.bridge-viz { display: flex; flex-direction: column; gap: 16px; }
.bridge-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 0;
  flex-wrap: wrap;
}
.bridge-node {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 20px;
  min-width: 160px;
  text-align: center;
}
.bridge-node-icon { font-size: 24px; margin-bottom: 4px; }
.bridge-node-label { font-weight: 600; font-size: 14px; }
.bridge-node-sub { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }
.bridge-arrow { font-size: 28px; color: var(--color-primary); }
.bridge-intents {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.bridge-intent {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
}
.bridge-intent.bridge-blue { background: rgba(22, 119, 255, 0.1); color: var(--color-primary); }
.bridge-intent.bridge-gray { background: rgba(0, 0, 0, 0.06); color: #666; }
.bridge-intent.bridge-orange { background: rgba(255, 125, 0, 0.1); color: var(--color-warn); }
.bridge-intent.bridge-unknown { background: rgba(0,0,0,0.04); color: #999; }
.bridge-intent-count {
  font-weight: 700;
  font-size: 13px;
  background: rgba(255,255,255,0.6);
  padding: 0 6px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
}
.bridge-meta {
  display: flex;
  gap: 24px;
  font-size: 11px;
  color: var(--color-text-muted);
  justify-content: center;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.candidates-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1000px) { .candidates-section-grid { grid-template-columns: 1fr; } }

.candidates-section {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 2px solid;
  font-weight: 600;
}
.section-header.section-blue { border-color: var(--color-primary); background: rgba(22, 119, 255, 0.04); }
.section-header.section-gray { border-color: #999; background: rgba(0, 0, 0, 0.02); }
.section-header.section-orange { border-color: var(--color-warn); background: rgba(255, 125, 0, 0.04); }
.section-title { font-size: 14px; }
.section-count {
  background: rgba(255,255,255,0.6);
  padding: 0 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}
.section-add {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: 1px dashed var(--color-border);
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--color-text-muted);
}
.section-add:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.section-list { padding: 8px; min-height: 80px; }

.candidate-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.candidate-card:hover { border-color: var(--color-primary); }
.candidates-section[data-intent="未买先研"] .candidate-card { border-left: 3px solid var(--color-primary); }
.candidates-section[data-intent="参照系"] .candidate-card { border-left: 3px solid #999; }
.candidates-section[data-intent="退出跟踪"] .candidate-card { border-left: 3px solid var(--color-warn); }

.candidate-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.candidate-card-ticker code {
  background: var(--color-primary);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}
.candidate-card-name { font-size: 13px; font-weight: 500; }
.held-badge {
  background: rgba(0, 180, 42, 0.15);
  color: var(--color-success);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}
.candidate-card-note {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 6px 0 0;
  padding-left: 4px;
  border-left: 2px solid var(--color-border);
  padding: 4px 0 4px 8px;
}
.candidate-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
}
.candidate-card-foot .row-actions { display: flex; gap: 4px; }
.candidate-card-foot button {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  color: var(--color-text);
}
.candidate-card-foot button:hover { background: var(--color-bg); }
.candidate-card-foot .btn-del:hover { color: var(--color-danger); border-color: var(--color-danger); }

#analysis-ticker-grid.list-mode { display: block; }
#analysis-ticker-grid.list-mode .ticker-card { display: none; }

/* === 研报库 + 分析引擎 一行一条 === */
.research-list, .analysis-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.research-list li, .analysis-list-item {
  display: grid;
  grid-template-columns: 70px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
  background: var(--color-bg-card);
}
.research-list li:last-child, .analysis-list-item:last-child { border-bottom: none; }
.research-list li:hover, .analysis-list-item:hover { background: rgba(22, 119, 255, 0.03); }
.research-list .research-mini-ticker, .analysis-list .research-mini-ticker {
  text-decoration: none;
}
.research-list .research-mini-ticker code, .analysis-list .research-mini-ticker code {
  background: var(--color-primary);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.research-list .research-mini-title, .analysis-list .research-mini-title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.research-list .research-mini-meta, .analysis-list .research-mini-meta {
  color: var(--color-text-muted);
  font-size: 11px;
  font-family: monospace;
  text-align: right;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.analysis-region {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}

/* === 概览页:宏观/周期 dashboard === */
.macro-kpi .macro-card {
  cursor: default;
  transition: box-shadow 0.15s;
}
.macro-kpi .macro-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.kpi-value .pos { color: var(--color-success); }
.kpi-value .neg { color: var(--color-danger); }
.kpi-sub .pos { color: var(--color-success); font-weight: 600; }
.kpi-sub .neg { color: var(--color-danger); font-weight: 600; }
.kpi-sub .muted { color: var(--color-text-muted); font-weight: 400; }

.chart-container { width: 100%; min-height: 280px; padding: 8px 0; }
.chart-small { min-height: 200px; }
.macro-chart { width: 100%; height: auto; max-height: 320px; }
.macro-chart-small { width: 100%; height: auto; max-height: 220px; }
.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 0 0;
  font-size: 12px;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
}
.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.legend-item .pos { color: var(--color-success); font-weight: 600; }
.legend-item .neg { color: var(--color-danger); font-weight: 600; }

.macro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 4px 0 12px;
}
.macro-table th, .macro-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.macro-table th { color: var(--color-text-muted); font-weight: 500; font-size: 11px; }
.macro-name { font-weight: 500; }
.macro-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.macro-table .num { text-align: right; }
.macro-table .pos { color: var(--color-success); }
.macro-table .neg { color: var(--color-danger); }

/* === 周期选择器 === */
.period-filter {
  display: inline-flex;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.period-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.12s;
}
.period-btn:hover { background: rgba(22, 119, 255, 0.06); color: var(--color-primary); }
.period-btn.active {
  background: var(--color-primary);
  color: white;
}

/* === macro-chart === */
.macro-chart-wrap { width: 100%; }
.macro-chart { width: 100%; height: auto; max-height: 360px; cursor: crosshair; }

.macro-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.macro-module-head h3 { margin: 0; }
.macro-module-actions { display: flex; align-items: center; gap: 8px; }
.macro-module-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

/* === 合成指数设置 === */
.synth-settings { display: flex; flex-direction: column; gap: 12px; }
.synth-mode-row { display: flex; gap: 12px; flex-wrap: wrap; }
.synth-mode-opt {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.synth-mode-opt.active {
  border-color: var(--color-primary);
  background: rgba(22, 119, 255, 0.04);
}
.synth-mode-opt small { color: var(--color-text-muted); font-size: 11px; margin-left: auto; }
.synth-mode-opt code { background: rgba(22, 119, 255, 0.1); color: var(--color-primary); padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.synth-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.synth-preset {
  border: 1px solid var(--color-border);
  background: transparent;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text);
}
.synth-preset:hover { background: rgba(22, 119, 255, 0.06); }
.synth-preset.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.synth-sliders { display: flex; flex-direction: column; gap: 6px; }
.synth-slider-row {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.synth-slider-name { color: var(--color-text); }
.synth-slider { width: 100%; }
.synth-num {
  width: 60px;
  padding: 3px 6px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  text-align: right;
  font-size: 12px;
}
.synth-total {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: right;
  padding-top: 4px;
}
.synth-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--color-border);
}
.synth-info {
  font-size: 12px;
  color: var(--color-text-muted);
  padding: 8px 10px;
  background: var(--color-bg);
  border-radius: 4px;
  margin-top: 6px;
}

/* === 模态框 === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--color-bg-card);
  border-radius: 8px;
  padding: 20px;
  min-width: 480px;
  max-width: 720px;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.modal-head h3 { margin: 0; }
.modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--color-bg); color: var(--color-text); }

/* === 要闻栏目 === */
.headline-module { background: linear-gradient(180deg, rgba(245, 63, 63, 0.04), transparent 60%); }
.headline-list { margin-top: 8px; }
.headline-items { list-style: none; padding: 0; margin: 0; }
.headline-item {
  display: grid;
  grid-template-columns: 24px 70px 60px 1fr 110px 80px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.headline-item:last-child { border-bottom: none; }
.headline-impact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: white;
  font-size: 11px;
  font-weight: 700;
}
.headline-region {
  font-family: monospace;
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 3px;
  text-align: center;
}
.headline-cat {
  font-size: 11px;
  color: var(--color-text-muted);
}
.headline-title {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.headline-title:hover { color: var(--color-primary); text-decoration: underline; }
.headline-source {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: right;
}
.headline-time {
  font-size: 11px;
  color: var(--color-text-muted);
  font-family: monospace;
  text-align: right;
}
.headline-toggle {
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  text-align: center;
}
.headline-toggle button {
  width: 100%;
  border: 1px dashed var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  padding: 6px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
}
.headline-toggle button:hover {
  background: var(--color-bg);
  color: var(--color-text);
  border-style: solid;
}
.meso-section {
  background: rgba(0, 180, 42, 0.04);
  border-left: 3px solid var(--color-success);
}

/* === Z1 中美宏观 mini 图 === */
.z1-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .z1-grid { grid-template-columns: 1fr; } }
.z1-country-block {
  background: var(--color-bg);
  border-radius: 6px;
  padding: 12px;
}
.z1-country-head {
  font-weight: 600;
  font-size: 13px;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 2px solid;
  display: flex;
  align-items: center;
  gap: 6px;
}
.z1-flag { font-size: 16px; }
.z1-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.z1-mini-chart {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--c, #1677ff);
  border-radius: 4px;
  padding: 6px 8px;
}
.z1-mini-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 4px;
}
.z1-mini-name { color: var(--color-text-muted); }
.z1-mini-current { font-weight: 600; color: var(--color-text); }
.z1-mini-unit { color: var(--color-text-muted); font-size: 10px; margin-left: 1px; }
.z1-mini-change { font-weight: 600; font-size: 10px; }
.z1-mini-change.pos { color: var(--color-success); }
.z1-mini-change.neg { color: var(--color-danger); }
.z1-mini-svg { width: 100%; height: 50px; }

.legend-section {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-right: 4px;
  font-weight: 600;
}

/* === group 切换(全部/宏观/中观) === */
.group-filter {
  display: inline-flex;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.group-btn {
  border: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 4px;
}
.group-btn:hover { background: rgba(22, 119, 255, 0.06); color: var(--color-primary); }
.group-btn.active {
  background: var(--color-primary);
  color: white;
}
.legend-item { cursor: pointer; }
.legend-item:hover { background: rgba(0, 0, 0, 0.03); }

/* === AI 参考意见(W5.14) === */
.ai-module {
  background: linear-gradient(135deg, rgba(114, 46, 209, 0.04), rgba(22, 119, 255, 0.02));
  border-left: 3px solid #722ed1;
}
.ai-insights-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.ai-badge {
  background: linear-gradient(90deg, #722ed1, #1677ff);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
}
.ai-note {
  font-size: 11px;
  color: var(--color-text-muted);
}
.ai-insight {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  border-left: 3px solid transparent;
}
.ai-insight:last-child { border-bottom: none; }
.ai-insight.ai-priority-high { border-left-color: #f5222d; background: rgba(245, 63, 63, 0.02); }
.ai-insight.ai-priority-medium { border-left-color: #fa8c16; }
.ai-insight.ai-priority-low { border-left-color: #52c41a; }
.ai-insight-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}
.ai-insight-priority {
  display: inline-block;
  width: 20px;
  height: 20px;
  text-align: center;
  line-height: 20px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}
.ai-insight-cat {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
}
.ai-insight-title {
  font-weight: 600;
  color: var(--color-text);
}
.ai-insight-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-muted);
  font-family: monospace;
}
.ai-insight-body {
  font-size: 12px;
  color: var(--color-text);
  line-height: 1.6;
  padding-left: 28px;
}
.ai-insight-body strong {
  color: #722ed1;
  font-weight: 600;
}

/* === 嵌入每张时序图的时间轴 + 范围刷子(W5.16.1) === */
/* 8 档按钮由 period-filter 提供(在图右上角),本组件只画时间轴 */
.timeline-brush {
  margin-top: 12px;
  padding: 10px 12px 8px;
  background: rgba(22, 119, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  user-select: none;
}
.timeline-axis {
  position: relative;
  height: 50px;
  margin: 0 0 6px;
  user-select: none;
}
.timeline-track {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
}
.timeline-range {
  position: absolute;
  top: 14px;
  height: 16px;
  background: rgba(22, 119, 255, 0.15);
  border: 1.5px solid var(--color-primary);
  border-radius: 3px;
  cursor: grab;
}
.timeline-range:active { cursor: grabbing; }
.timeline-handle {
  position: absolute;
  top: 10px;
  width: 8px;
  height: 24px;
  background: var(--color-primary);
  border-radius: 2px;
  cursor: ew-resize;
  z-index: 2;
}
.timeline-handle-left { left: -4px; }
.timeline-handle-right { right: -4px; }
.timeline-handle:hover { background: #003eb3; }
.timeline-handle:active { background: #001a66; }
.timeline-tick {
  position: absolute;
  top: 0;
  pointer-events: none;
}
.timeline-tick-line {
  position: absolute;
  top: 28px;
  left: 0;
  width: 1px;
  height: 5px;
  background: #ccc;
}
.timeline-tick-year .timeline-tick-line {
  background: #666;
  height: 8px;
}
.timeline-tick-label {
  position: absolute;
  top: 38px;
  left: 0;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--color-text-muted);
  font-family: monospace;
  white-space: nowrap;
}
.timeline-tick-year .timeline-tick-label {
  color: var(--color-text);
  font-weight: 600;
}
.timeline-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-muted);
  font-family: monospace;
}
.timeline-info-current { color: var(--color-primary); font-weight: 600; }
.timeline-info-meta { font-size: 10px; }

/* 指数叠加 */
.index-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.index-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.index-bar-name { font-weight: 500; }
.index-bar-track {
  display: flex;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  background: #f5f6f7;
}
.index-bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: 500;
  transition: width 0.3s;
}
.sector-科技 { background: #1e6fff; }
.sector-消费 { background: #00b42a; }
.sector-金融 { background: #ff7d00; }
.sector-新能源 { background: #f53f3f; }
.sector-医药 { background: #8c8c8c; }
.sector-军工 { background: #5e35b1; }
.sector-现金 { background: #c0c4cc; }
.sector-医疗 { background: #8c8c8c; }
.sector-unknown { background: #c0c4cc; }

/* ticker 来源 */
.source-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  background: #e6f7ff;
  color: var(--color-primary);
  margin-right: 2px;
}
.source-tag.direct { background: #fff7e6; color: var(--color-warn); }
.source-tag.etf { background: #e6f7ff; color: var(--color-primary); }

/* filter bar */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--color-text-sub);
}
.filter-bar select, .filter-bar input {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: white;
  font-size: 13px;
}
.filter-bar input { min-width: 160px; }
.filter-bar .count { margin-left: auto; }

/* form */
.form-card { background: #fafbfc; }
.candidate-form { display: flex; flex-direction: column; gap: 12px; }
.form-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 12px;
}
.form-row label { font-size: 13px; color: var(--color-text-sub); }
.form-row code { color: var(--color-danger); }
.form-row input, .form-row select, .form-row textarea {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.form-actions { display: flex; gap: 8px; margin-top: 8px; }

/* table */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.data-table th {
  background: #f5f6f7;
  font-weight: 500;
  color: var(--color-text-sub);
  font-size: 12px;
}
.data-table td.num, .data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table tr:hover { background: #fafbfc; }
.data-table .empty { text-align: center; color: var(--color-text-sub); padding: 24px; }
.data-table .positive { color: var(--color-success); }
.data-table .negative { color: var(--color-danger); }

/* 候选池标签 */
.intent-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.intent-未买先研 { background: #e6f7ff; color: var(--color-primary); }
.intent-退出跟踪 { background: #fff7e6; color: var(--color-warn); }
.intent-参照系 { background: #f5f6f7; color: var(--color-text-sub); }
.row-actions { display: flex; gap: 6px; }
.row-actions button {
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid var(--color-border);
  background: white;
  border-radius: 3px;
  cursor: pointer;
}
.row-actions button:hover { background: #f5f6f7; }

/* 研报卡 */
.doc-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.doc-card .title {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}
.doc-card .summary {
  font-size: 13px;
  color: var(--color-text-sub);
  line-height: 1.5;
  margin-bottom: 8px;
}
.doc-card .meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
}
.doc-card .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}
.doc-card .ticker-link {
  background: var(--color-primary);
  color: white !important;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.doc-card .tag {
  background: #f5f6f7;
  color: var(--color-text-sub);
  padding: 2px 6px;
  border-radius: 3px;
}

/* 分析引擎 ticker 卡片 */
.ticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.ticker-card {
  background: #fafbfc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: all 0.2s;
  cursor: pointer;
}
.ticker-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}
.ticker-card .code {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
}
.ticker-card .name { font-size: 14px; margin-top: 4px; }
.ticker-card .category { font-size: 11px; color: var(--color-text-sub); margin-top: 6px; }
.ticker-card .highlight {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-sub);
}
.tag-核心观察 { background: #fff0f0; color: #f53f3f; }
.tag-持续跟踪 { background: #e6f7ff; color: #1e6fff; }
.tag-参照系 { background: #f5f6f7; color: #646a73; }
.region-badge {
  display: inline-block;
  padding: 1px 6px;
  background: #f5f6f7;
  color: var(--color-text-sub);
  border-radius: 3px;
  font-size: 10px;
  margin-left: 6px;
}

/* info banner */
.info-banner {
  background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
  border: 1px solid #ffcb7c;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #663c00;
}
.info-banner strong { color: #b36800; }

/* 按钮 */
.btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { background: #f5f6f7; }
.btn-primary { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { color: var(--color-text-sub); }

.as-of {
  font-size: 12px;
  color: var(--color-text-sub);
  background: #f5f6f7;
  padding: 4px 10px;
  border-radius: 12px;
}

/* V7.5.3 P2-3 骨架屏(skeleton) */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.skeleton-card {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-text {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  background: linear-gradient(90deg, #f0f0f0 0%, #e8e8e8 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  padding: 12px;
  border-radius: 4px;
  color: transparent;
}
.sk-line {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 0%, #e8e8e8 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  border-radius: 3px;
  margin: 8px 0;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.ai-section-block {
  font-size: 13px;
}
.rating-badge {
  display: inline-block;
  padding: 2px 6px;
  background: #e8f4f8;
  color: #2980b9;
  border-radius: 3px;
  font-size: 11px;
}

/* ===== V7.6 新增:⌘K 面板 / 矩形图 / 情绪触发器 ===== */
.palette-kbd{margin-left:14px;border:1px solid var(--color-border,#e3e6ea);border-radius:8px;padding:5px 12px;font-size:12px;width:190px;color:var(--color-text-secondary,#666);cursor:pointer;background:transparent}
#palette-box .palette-mask{position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:900}
#palette-box .palette-panel{position:fixed;top:12vh;left:50%;transform:translateX(-50%);width:min(560px,92vw);background:var(--color-bg,#fff);border:1px solid var(--color-border,#e3e6ea);border-radius:10px;z-index:901;box-shadow:0 8px 30px rgba(0,0,0,.15)}
#palette-box #palette-input{width:100%;box-sizing:border-box;border:0;border-bottom:1px solid var(--color-border,#e3e6ea);padding:12px 14px;font-size:14px;background:transparent;color:inherit;outline:none}
#palette-list{max-height:50vh;overflow:auto}
.palette-item{padding:9px 14px;cursor:pointer;display:flex;gap:8px;align-items:baseline}
.palette-item.active{background:var(--color-hover,#f0f2f5)}
.palette-name{color:var(--color-text-secondary,#666);font-size:12px}
.palette-tag{font-style:normal;font-size:10px;border:1px solid var(--color-border,#ddd);border-radius:6px;padding:1px 6px;color:var(--color-text-secondary,#888)}
.palette-w{margin-left:auto;font-style:normal;font-size:11px;color:var(--color-text-secondary,#888)}
.palette-empty{padding:18px;text-align:center;color:var(--color-text-secondary,#999);font-size:12px}
#v76-treemap-card{margin-top:12px}
#v76-treemap svg{display:block}
.v76-tag{font-size:10px;border:1px solid var(--color-border,#ddd);border-radius:5px;padding:1px 6px;color:var(--color-text-secondary,#999);vertical-align:1px}
.sentiment-trigger .trigger-body b{margin-right:6px}

/* ===== V7.7 修改批次:分层横幅/复选框/悬浮/合成指数/候选池弹窗与分组 ===== */
.meso-divider{display:flex;align-items:baseline;gap:10px;margin:22px 0 10px;padding:8px 14px;border-left:4px solid var(--color-primary,#3478c8);background:color-mix(in srgb,var(--color-primary,#3478c8) 6%,transparent);border-radius:0 8px 8px 0}
.meso-divider span{font-weight:700;font-size:15px;color:var(--color-text-primary,#2c3e50)}
.meso-divider em{font-style:normal;font-size:11px;color:var(--color-text-secondary,#888)}
.legend-cb{margin:0 4px 0 2px;cursor:pointer;vertical-align:-2px}
.synth-sliders input{font-size:14px;font-weight:600;color:var(--color-text-primary,#2c3e50)}
.synth-warn{font-size:12px;margin:6px 0;font-weight:600}
#candidate-mask{display:none;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:840}
.form-card.modal-form{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:850;width:min(480px,92vw);max-height:86vh;overflow:auto;box-shadow:0 12px 40px rgba(0,0,0,.25);border-radius:12px}
.asset-sub{font-size:11px;font-weight:700;color:var(--color-text-secondary,#888);padding:6px 2px 2px;border-bottom:1px dashed var(--color-border,#e3e6ea);margin-top:4px}
.section-green{background:var(--color-positive,#27ae60)}
.bridge-stats{font-size:11px;color:var(--color-text-secondary,#888);margin-top:8px;padding-top:8px;border-top:1px dashed var(--color-border,#e3e6ea)}
.bridge-stats b{color:var(--color-text-primary,#2c3e50)}
.candidates-section-grid{grid-template-columns:repeat(4,1fr)!important}
@media (max-width:1100px){.candidates-section-grid{grid-template-columns:repeat(2,1fr)!important}}

/* ===== V7.7.1:CSS 变量补全(site.css 未定义而 dashboard.css 在用的变量,缺失导致面板透明)===== */
:root {
  --color-bg-card: #ffffff;
  --color-hover: #f2f3f5;
  --color-positive: #00b42a;
  --color-text-primary: #1f2329;
  --color-text-secondary: #646a73;
  --color-text-muted: #8f959e;
  --color-card-solid: #ffffff;
}
/* 设置面板实心化:不透明背景 + 提升层级 + 加阴影,彻底盖住底层内容 */
.modal-overlay .modal-content {
  background: var(--color-bg-card, #ffffff) !important;
  opacity: 1 !important;
  z-index: 1001;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--color-border, #e4e6eb);
}
.modal-overlay .modal-content .m2-settings-body,
.modal-overlay .modal-content .synth-sliders,
.modal-overlay .modal-content .modal-head { background: transparent; }

/* ===== V7.7.2:排名表固定列宽(4/8/16/8/6/30/8/20)+ 等高居中 + 交替底纹 ===== */
#ranking-table { table-layout: fixed; }
#ranking-table td { vertical-align: middle; }
#ranking-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--color-primary, #3478c8) 4%, transparent); }
#ranking-table tbody tr:hover { background: color-mix(in srgb, var(--color-primary, #3478c8) 9%, transparent); }
#ranking-table .ranking-bar-wrap { min-width: 0; width: 100%; }
.name-cell { max-height: 2.6em; line-height: 1.3; overflow: hidden; }
.sources-cell { max-height: 3.9em; line-height: 1.3; overflow: hidden; }
.sources-cell .source-tag, .sources-cell span { max-width: 100%; }

/* ===== V7.7.3:M1.1 / M1.2 并排布局 ===== */
.m1-split{display:grid;grid-template-columns:3fr 2fr;gap:14px;align-items:stretch}
@media (max-width:1100px){.m1-split{grid-template-columns:1fr}}
.m12-select{max-width:230px;padding:4px 8px;border:1px solid var(--color-border,#e3e6ea);border-radius:6px;font-size:12px;background:var(--color-bg-card,#fff);color:var(--color-text-primary,#1f2329)}

/* ===== V7.7.4:M1 布局定稿(仅作用 M1 两卡,不影响其他模块)===== */
/* 宽度 3:2 显式 60/40 + 允许列压缩到内容最小宽以下 */
.m1-split{grid-template-columns:60% 40%}
.m1-split>.card{min-width:0}
/* 卡片内部纵向节奏:图(固定360) → 滑尺(固定76) → 图例(弹性吸收差值) */
.m1-split .chart-container{display:flex;flex-direction:column}
.m1-split .chart-container>svg{order:0;flex:none;width:100%}
.m1-split .chart-container>.timeline-brush{order:1;flex:none;height:76px;box-sizing:border-box}
.m1-split .chart-container>.chart-legend{order:2;flex:1 1 auto;overflow:auto}

/* ===== V7.7.5:M1 布局修正(基于真实 DOM:wrap 内含 svg+图例,滑尺在容器层)===== */
/* ① 宽度恢复 1:1(覆盖 V7.7.4 的 60/40) */
.m1-split{grid-template-columns:1fr 1fr}
/* ② 容器层排序:wrap(0) + 滑尺(1) → 滑尺位于 wrap 之后 */
.m1-split .chart-container{display:flex;flex-direction:column}
.m1-split .chart-container>.timeline-brush{order:1;flex:none;height:76px;box-sizing:border;border-top:1px solid var(--color-border,#eceef1);border-bottom:1px solid var(--color-border,#eceef1)}
/* ③ wrap 层排序:svg(0) + 图例(2);配合容器层滑尺 order=1,视觉顺序为 图→滑尺→图例 */
.m1-split .macro-chart-wrap{display:flex;flex-direction:column}
.m1-split .macro-chart-wrap svg{order:0;flex:none;width:100%}
.m1-split .macro-chart-wrap .chart-legend{order:2;flex:1 1 auto;overflow:auto}

/* ===== V7.7.6:滑尺入 wrap 后的高度对齐(brusher 现在是 wrap 的子元素)===== */
.m1-split .macro-chart-wrap>.timeline-brush{flex:none;height:76px;box-sizing:border-box;border-top:1px solid var(--color-border,#eceef1);border-bottom:1px solid var(--color-border,#eceef1)}
.m1-split .macro-chart-wrap{display:flex;flex-direction:column}
.m1-split .macro-chart-wrap svg{flex:none;width:100%}
.m1-split .macro-chart-wrap .chart-legend{flex:1 1 auto;overflow:auto}

/* ===== V7.9.1:候选卡紧凑化(时间入头部/纯文字链接/图标小钮)===== */
.candidate-card-head{display:flex;align-items:baseline;gap:6px}
.candidate-card-time{font-size:10px;color:var(--color-text-muted,#8f959e);margin-left:2px;white-space:nowrap}
.candidate-card-foot .row-actions{display:flex;align-items:center;gap:6px;width:100%}
.row-actions .btn-link{border:0;background:none;font-size:13px;font-weight:600;cursor:pointer;color:var(--color-primary,#3478c8);padding:2px 4px}
.row-actions .btn-link:hover{text-decoration:underline}
.row-actions .btn-ico{border:1px solid var(--color-border,#d0d5db);background:transparent;border-radius:5px;width:22px;height:22px;font-size:12px;line-height:1;cursor:pointer;color:var(--color-text-secondary,#646a73);padding:0;display:inline-flex;align-items:center;justify-content:center}
.row-actions .btn-ico:hover{color:var(--color-primary,#3478c8);border-color:var(--color-primary,#3478c8)}
.row-actions .btn-del:hover{color:var(--color-danger,#c0392b);border-color:var(--color-danger,#c0392b)}

/* ===== V7.9.2:AI 摘要模态实心化(原 .modal-card 无背景规则)===== */
.modal-overlay .modal-card{background:var(--color-bg-card,#fff);border-radius:10px;width:min(680px,92vw);max-height:82vh;overflow:auto;padding:16px 18px;box-shadow:0 14px 48px rgba(0,0,0,.22);border:1px solid var(--color-border,#e4e6eb)}

/* ===== V7.9.3:模态层级与关闭按钮可点击保障 ===== */
.modal-overlay .modal-card{position:relative;z-index:1002}
.modal-overlay .modal-close{position:absolute;top:10px;right:12px;z-index:1003;border:0;background:transparent;font-size:18px;line-height:1;cursor:pointer;color:var(--color-text-secondary,#646a73);padding:4px}
.modal-overlay .modal-close:hover{color:var(--color-text-primary,#1f2329)}

/* ===== V7.9.5:上传面板表单优化(行距/下拉框/输入框)===== */
#research-upload-form .form-row{margin-bottom:12px}
#research-upload-form .form-row label{font-size:13px;color:var(--color-text-primary,#1f2329);font-weight:500}
#research-upload-form input[type="text"],#research-upload-form input[type="url"],#research-upload-form select,#research-upload-form textarea{width:100%;box-sizing:border-box;min-height:34px;padding:7px 10px;border:1px solid var(--color-border,#dcdfe5);border-radius:6px;background:var(--color-bg-card,#fff);font-size:13px;color:var(--color-text-primary,#1f2329)}
#research-upload-form select{appearance:auto;cursor:pointer}
#research-upload-form input:focus,#research-upload-form select:focus,#research-upload-form textarea:focus{outline:none;border-color:var(--color-primary,#3478c8)}
#research-upload-form textarea{min-height:64px;resize:vertical;font-family:inherit}
#research-upload-form input[type="file"]{border:0;background:transparent;padding:4px 0;font-size:12px;width:100%}

/* ===== V8.2.4:M1 布局权威块(卡片定界 · 图例内部滚动 · 根治溢出)===== */
.m1-split{display:grid!important;grid-template-columns:1fr 1fr!important;gap:14px;align-items:stretch!important}
.m1-split>.card{display:flex!important;flex-direction:column!important;min-width:0;min-height:0;overflow:hidden}
.m1-split .chart-container{flex:1;min-height:0;display:flex!important;flex-direction:column!important}
.m1-split .macro-chart-wrap{display:flex!important;flex-direction:column!important;flex:none}
.m1-split .macro-chart-wrap svg{flex:none;width:100%}
.m1-split .macro-chart-wrap>.timeline-brush{flex:none;height:76px;box-sizing:border-box;border-top:1px solid var(--color-border,#eceef1);border-bottom:1px solid var(--color-border,#eceef1)}
.m1-split .macro-chart-wrap .chart-legend,.m1-split .chart-container>.chart-legend{flex:1 1 auto!important;min-height:0;overflow:auto!important}
@media(max-width:1100px){.m1-split{grid-template-columns:1fr!important}}

/* ===== V8.3.1:图表卡定界收窄为 M 系列(Z 卡渲染器与自然布局冲突,还原)===== */
.card:has(#m1-indices-chart),.card:has(#m12-abs-chart),.card:has(#m2-synth-chart),.card:has(#m3-fx-chart),.card:has(#m4-bonds-chart),.card:has(#m5-gdp-chart){display:flex!important;flex-direction:column!important;min-width:0;min-height:0;overflow:hidden}
.card:has(#m1-indices-chart) .chart-container,.card:has(#m12-abs-chart) .chart-container,.card:has(#m2-synth-chart) .chart-container,.card:has(#m3-fx-chart) .chart-container,.card:has(#m4-bonds-chart) .chart-container,.card:has(#m5-gdp-chart) .chart-container{flex:1;min-height:0;display:flex!important;flex-direction:column!important}
.card:has(#m1-indices-chart) .macro-chart-wrap,.card:has(#m12-abs-chart) .macro-chart-wrap,.card:has(#m2-synth-chart) .macro-chart-wrap,.card:has(#m3-fx-chart) .macro-chart-wrap,.card:has(#m4-bonds-chart) .macro-chart-wrap,.card:has(#m5-gdp-chart) .macro-chart-wrap{display:flex!important;flex-direction:column!important;min-height:0}
.card:has(#m1-indices-chart) .macro-chart-wrap svg,.card:has(#m12-abs-chart) .macro-chart-wrap svg,.card:has(#m2-synth-chart) .macro-chart-wrap svg,.card:has(#m3-fx-chart) .macro-chart-wrap svg,.card:has(#m4-bonds-chart) .macro-chart-wrap svg,.card:has(#m5-gdp-chart) .macro-chart-wrap svg{flex:none;width:100%}
.card:has(#m1-indices-chart) .macro-chart-wrap>.timeline-brush,.card:has(#m12-abs-chart) .macro-chart-wrap>.timeline-brush,.card:has(#m2-synth-chart) .macro-chart-wrap>.timeline-brush,.card:has(#m3-fx-chart) .macro-chart-wrap>.timeline-brush,.card:has(#m4-bonds-chart) .macro-chart-wrap>.timeline-brush,.card:has(#m5-gdp-chart) .macro-chart-wrap>.timeline-brush{flex:none!important;height:76px!important;box-sizing:border-box;border-top:1px solid var(--color-border,#eceef1);border-bottom:1px solid var(--color-border,#eceef1)}
.card:has(#m1-indices-chart) .macro-chart-wrap .chart-legend,.card:has(#m12-abs-chart) .macro-chart-wrap .chart-legend,.card:has(#m2-synth-chart) .macro-chart-wrap .chart-legend,.card:has(#m3-fx-chart) .macro-chart-wrap .chart-legend,.card:has(#m4-bonds-chart) .macro-chart-wrap .chart-legend,.card:has(#m5-gdp-chart) .macro-chart-wrap .chart-legend{flex:1 1 auto!important;min-height:0;overflow:auto!important}
.card:has(.chart-container){display:flex!important;flex-direction:column!important;min-width:0;min-height:0;overflow:hidden}
.card:has(.chart-container) .chart-container{flex:1;min-height:0;display:flex!important;flex-direction:column!important}
.card:has(.chart-container) .macro-chart-wrap{display:flex!important;flex-direction:column!important;min-height:0}
.card:has(.chart-container) .macro-chart-wrap svg,.card:has(.chart-container) .chart-container>svg{flex:none;width:100%}
.card:has(.chart-container) .macro-chart-wrap>.timeline-brush,.card:has(.chart-container) .chart-container>.timeline-brush{flex:none!important;height:76px!important;box-sizing:border-box;border-top:1px solid var(--color-border,#eceef1);border-bottom:1px solid var(--color-border,#eceef1)}
.card:has(.chart-container) .macro-chart-wrap .chart-legend,.card:has(.chart-container) .chart-container>.chart-legend{flex:1 1 auto!important;min-height:0;overflow:auto!important}

/* ===== V8.5:M1.2 对比分析(chips 行 + 输入框)===== */
#m12-code-input{width:210px;padding:5px 10px;border:1px solid var(--color-border,#dcdfe5);border-radius:6px;font-size:12px;background:var(--color-bg-card,#fff);color:var(--color-text-primary,#1f2329)}
#m12-code-input:focus{outline:none;border-color:var(--color-primary,#3478c8)}
#m12-chips-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px;min-height:30px;align-items:center}
.m12-chip{display:inline-flex;align-items:center;gap:5px;font-size:12px;border:1px solid var(--color-border,#d0d5db);border-radius:12px;padding:2px 10px;color:var(--color-text-secondary,#646a73);background:var(--color-bg-card,#fff)}
.m12-chip i{width:8px;height:8px;border-radius:2px}
.m12-chip b{cursor:pointer;color:#c0392b;font-weight:400;margin-left:2px;font-size:13px}
.m12-chip b:hover{color:#8e2b20}
#m12-abs-chart .chart-legend{display:none}

/* ===== V8.5.1:M1.2 控件收紧 + chips 贴滑尺 ===== */
#m12-code-input{width:130px!important;padding:4px 8px!important;font-size:12px}
#m12-chips-row{margin-top:6px!important;min-height:26px}

/* ===== V8.5.2:M1.2 自由比选(控件等高+chips 贴滑尺)===== */
#m12-code-input{height:30px!important;box-sizing:border-box}
.macro-module-actions{align-items:center}
.card:has(#m12-abs-chart) .chart-container{flex:none!important}
#m12-chips-row{margin-top:6px!important;min-height:26px}

/* ===== V8.5.3:chips 回卡底(与 M1.1 图例同位)===== */
#m12-chips-row{margin-top:auto!important;padding-top:10px;min-height:30px}

/* ===== V8.5.4:滑尺可拖(平移光标)===== */
.timeline-range{cursor:grab}
.timeline-range:active{cursor:grabbing}
.timeline-handle{cursor:ew-resize}

/* ===== V8.6.1:模态 X 锚定修正(原 .modal-content 未定位,X 锚到视口)===== */
.modal-overlay .modal-content{position:relative!important}
