/* 市场情绪 */
.sentiment-rule-note,
.ladder-rule-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  padding: 6px 9px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--breakout);
  border-radius: 6px;
  background: #faf9fe;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}
.sentiment-rule-note b,
.ladder-rule-note b { flex: 0 0 auto; color: var(--ink-2); font-size: 11px; }
.ladder-rule-note { border-left-color: var(--warn); background: #fffaf2; }
.kpis {
  display: grid;
  /* 9卡自适应:宽屏一行排开,窄屏自动换行 */
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 7px;
}
.kpi {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 9px 10px 8px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
.kpi::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: transparent;
}
.kpi:first-child::before { background: var(--up); }
.kpi:nth-child(2)::before { background: var(--down); }
.kpi.kpi-emotion::before { background: var(--up); }
.kpi.kpi-negative::before { background: var(--down); }
.kpi:hover { border-color: #aebdca; background: #f8fafc; }
.kpi:active { transform: translateY(1px); }
.kpi b {
  display: block;
  margin: 2px 0 0;
  color: var(--accent);
  font-size: 19px;
  line-height: 1.25;
  font-weight: 760;
  letter-spacing: -.3px;
}
.kpi span { color: var(--muted); font-size: 11px; }
.kpi .delta { font-size: 10.5px; }
.kpi b.kpi-stock-name {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-history-icon {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #9aabba;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .16s ease;
}
.sentiment-signals { display: flex; gap: 7px; margin: -1px 0 9px; flex-wrap: wrap; }
.sentiment-signal {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11px;
}
.sentiment-signal b { flex: none; font-size: 11px; }
.sentiment-signal .stock-link-btn { min-height: 20px; padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; }
.sentiment-signal.is-breakout { border-color: #d3cbed; background: var(--breakout-bg); }
.sentiment-signal.is-breakout b, .sentiment-signal.is-breakout .stock-link-btn { color: var(--breakout); }
.sentiment-signal.is-gap { border-color: #ead0a8; background: var(--warn-bg); }
.sentiment-signal.is-gap b, .sentiment-signal.is-gap .stock-link-btn { color: var(--warn); }
.kpi:hover .kpi-history-icon,
.kpi:focus-visible .kpi-history-icon { stroke: var(--accent); }
.trends {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.trend {
  width: 100%;
  padding: 7px 9px 5px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background-color .16s ease;
}
.trend:hover { border-color: #aebdca; background: #f8fafc; }
.trend .t {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10.5px;
}
.trend svg { width: 100%; height: 34px; margin-top: 3px; }

/* 单指标全历史弹窗 */
.sent-history-meta {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.sent-history-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}
.sent-history-stats > div {
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: #f8fafc;
}
.sent-history-stats span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10.5px;
}
.sent-history-stats b {
  color: var(--accent);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.sent-history-chart {
  width: 100%;
  height: 370px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
}
.sent-history-table {
  margin-top: 10px;
  border-top: 1px solid var(--line-2);
}
.sent-history-table summary {
  padding: 9px 2px 4px;
  color: #607185;
  font-size: 11.5px;
  cursor: pointer;
}
.sent-history-table > div {
  max-height: 280px;
  margin-top: 5px;
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: 6px;
}
.sent-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}
.sent-history-table th,
.sent-history-table td { text-align: right; }
.sent-history-table th:first-child,
.sent-history-table td:first-child { text-align: left; }
.sent-history-loading { min-height: 100px; }
.sent-stock-list h3 { padding-right: 32px; }
.sent-history-drilldown {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line-2);
}
.sent-history-drilldown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}
.sent-history-drilldown-head h4 {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
}
.sent-history-drilldown-head span {
  color: var(--muted);
  font-size: 10.5px;
}
.sent-stock-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
}
.sent-stock-summary b {
  flex: none;
  color: var(--accent);
  font-size: 12px;
}
.sent-stock-list .stock-related-table,
.sent-history-drilldown .stock-related-table {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: 7px;
}
.sent-stock-list table,
.sent-history-drilldown table { margin: 0; }
.sent-stock-list th:nth-child(4),
.sent-stock-list td:nth-child(4),
.sent-history-drilldown th:nth-child(4),
.sent-history-drilldown td:nth-child(4) { text-align: right; }
.sent-stock-code {
  display: block;
  margin-top: -2px;
  color: #94a1af;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

/* 指数完整历史弹窗 */
.index-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 1px 34px 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.index-history-head h3 { margin: 1px 0 0; }
.index-history-head .section-source {
  margin-top: 2px;
  margin-left: auto;
}
.index-history-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 8px;
}
.index-history-stats > div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #f8fafc;
}
.index-history-stats span,
.index-history-stats b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.index-history-stats span {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 10px;
}
.index-history-stats b {
  color: var(--accent);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.index-history-stats .is-loading span,
.index-history-stats .is-loading b {
  width: 55%;
  height: 9px;
  border-radius: 3px;
  background: var(--line-2);
}
.index-history-stats .is-loading b {
  width: 78%;
  height: 14px;
  margin-top: 5px;
}
.index-history-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10.5px;
}
.index-history-chart {
  width: 100%;
  height: 400px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
}
.index-history-table {
  margin-top: 9px;
  border-top: 1px solid var(--line-2);
}
.index-history-table summary {
  padding: 9px 2px 3px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.index-history-table > div {
  max-height: 280px;
  margin-top: 5px;
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: 7px;
}
.index-history-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}
.index-history-table th,
.index-history-table td { text-align: right; }
.index-history-table th:first-child,
.index-history-table td:first-child { text-align: left; }
.sent-stock-themes {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.sent-stock-themes .pill {
  padding: 2px 5px;
  font-size: 9.5px;
}
.sent-stock-status {
  display: flex;
  flex-direction: column;
  color: var(--accent);
  font-weight: 650;
  white-space: nowrap;
}
.sent-stock-status small {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 400;
}

