:root {
  color-scheme: dark;
  --bg: #070a0f;
  --bg-soft: #0c1118;
  --panel: #121923;
  --panel-2: #151e29;
  --panel-3: #1a2430;
  --line: #273342;
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #eef4fb;
  --muted: #93a3b5;
  --muted-2: #5f7186;
  --red: #ff514d;
  --red-soft: rgba(255, 81, 77, 0.15);
  --green: #35d99a;
  --green-soft: rgba(53, 217, 154, 0.13);
  --amber: #f6a044;
  --amber-soft: rgba(246, 160, 68, 0.16);
  --blue: #4c9dff;
  --blue-soft: rgba(76, 157, 255, 0.14);
  --cyan: #32c9d6;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  font-family: "Segoe UI", "Microsoft YaHei", Inter, Arial, sans-serif;
}

@keyframes flashRed {
  0% { background: rgba(255, 81, 77, 0.34); box-shadow: inset 0 0 0 1px rgba(255, 81, 77, 0.38); }
  62% { background: rgba(255, 81, 77, 0.18); box-shadow: inset 0 0 0 1px rgba(255, 81, 77, 0.2); }
  100% { background: transparent; box-shadow: inset 0 0 0 1px transparent; }
}

@keyframes flashGreen {
  0% { background: rgba(53, 217, 154, 0.3); box-shadow: inset 0 0 0 1px rgba(53, 217, 154, 0.34); }
  62% { background: rgba(53, 217, 154, 0.16); box-shadow: inset 0 0 0 1px rgba(53, 217, 154, 0.18); }
  100% { background: transparent; box-shadow: inset 0 0 0 1px transparent; }
}

@keyframes rowPulse {
  0% { background-color: rgba(255, 255, 255, 0.055); }
  100% { background-color: transparent; }
}

@keyframes livePulse {
  0%, 100% { opacity: 0.55; box-shadow: 0 0 0 0 rgba(53, 217, 154, 0.42); }
  50% { opacity: 1; box-shadow: 0 0 0 4px rgba(53, 217, 154, 0); }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 1180px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
}

body {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(14, 20, 28, 0.96), rgba(7, 10, 15, 1) 42%),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  display: block;
}

.app-root {
  min-height: 100vh;
}

.event-page,
.home-page,
.detail-page {
  min-height: 100vh;
  padding: 12px;
}

.app-header {
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(360px, 1fr) auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-grid;
  grid-template-columns: 42px auto;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 81, 77, 0.46);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(255, 81, 77, 0.22), rgba(76, 157, 255, 0.08));
}

.brand-mark svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--red);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav a,
.refresh-btn,
.stream-actions button,
.detail-bar a,
.panel-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.header-nav a.active,
.header-nav a:hover,
.refresh-btn:hover,
.stream-actions button:hover,
.detail-bar a:hover,
.panel-link:hover {
  color: var(--text);
  border-color: rgba(255, 81, 77, 0.42);
  background: var(--red-soft);
}

.header-status {
  text-align: right;
}

.header-status strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.header-status span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.header-status i {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.event-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(520px, 2.2fr) minmax(250px, 0.9fr) minmax(270px, 1fr) minmax(350px, 1.2fr);
  gap: 12px;
  align-items: stretch;
  margin-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.seg-group {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.seg-group > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.seg-group > div {
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.seg-group button {
  min-height: 34px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(18, 25, 35, 0.86);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.seg-group button.active {
  color: var(--text);
  border-color: rgba(255, 81, 77, 0.48);
  background: var(--red-soft);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(12, 17, 24, 0.7);
  overflow: hidden;
}

.metric-card {
  min-width: 0;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 27px;
  line-height: 1.08;
}

.metric-card small {
  margin-top: 5px;
}

.metric-card.up strong,
.up {
  color: var(--red);
}

.metric-card.down strong,
.down {
  color: var(--green);
}

.metric-card.warn strong {
  color: var(--amber);
}

.metric-card.blue strong {
  color: var(--blue);
}

.event-workspace {
  display: grid;
  grid-template-columns: minmax(980px, 1fr) 530px;
  gap: 8px;
  align-items: stretch;
  height: auto;
  min-height: 760px;
  margin-top: 8px;
}

.event-stream-panel,
.event-evidence-panel,
.bottom-panel,
.rank-card,
.home-detail,
.detail-table,
.detail-summary,
.holdings-panel,
.home-topbar {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(20, 28, 39, 0.96), rgba(12, 17, 24, 0.98));
  box-shadow: var(--shadow);
}

.event-stream-panel {
  min-width: 0;
  min-height: 760px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.event-evidence-panel {
  min-width: 0;
  min-height: 760px;
  overflow: visible;
  padding: 14px;
}

.panel-head {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.panel-head small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.panel-head.compact {
  min-height: 40px;
}

.stream-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.check input {
  width: 14px;
  height: 14px;
  accent-color: var(--red);
}

.event-table-wrap {
  min-height: 0;
  flex: 1;
  overflow: visible;
}

.event-table-head,
.event-row {
  display: grid;
  grid-template-columns: 70px 96px minmax(126px, 1fr) 68px minmax(330px, 1.9fr) 72px 50px 76px minmax(120px, 0.9fr);
  min-width: 1120px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.event-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 36px;
  color: var(--muted);
  background: rgba(14, 20, 28, 0.98);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.event-row {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.event-row:hover,
.event-row.selected {
  background: rgba(255, 255, 255, 0.045);
}

.event-row.selected {
  box-shadow: inset 3px 0 0 var(--red);
}

.event-row.severity-3 {
  border-left: 2px solid rgba(255, 81, 77, 0.72);
}

.event-row > :nth-child(6),
.event-row > :nth-child(7),
.event-row > :nth-child(8),
.event-table-head > :nth-child(6),
.event-table-head > :nth-child(7),
.event-table-head > :nth-child(8) {
  text-align: right;
}

.time-cell {
  color: #d8e7f6;
  font-variant-numeric: tabular-nums;
}

.event-pill,
.severity-badge {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-up {
  color: var(--red);
  border-color: rgba(255, 81, 77, 0.34);
  background: rgba(255, 81, 77, 0.1);
}

.event-down {
  color: var(--green);
  border-color: rgba(53, 217, 154, 0.34);
  background: rgba(53, 217, 154, 0.1);
}

.event-warn {
  color: var(--amber);
  border-color: rgba(246, 160, 68, 0.38);
  background: rgba(246, 160, 68, 0.11);
}

.target-cell {
  min-width: 0;
}

.target-cell strong,
.target-cell small,
.ellipsis {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-cell strong {
  font-size: 14px;
}

.target-cell small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
}

.evidence-cell {
  min-width: 0;
  color: #d7e1ec;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.evidence-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 12px;
}

.evidence-head h2 {
  margin: 10px 0 0;
  font-size: 27px;
  line-height: 1.1;
}

.evidence-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.evidence-head em {
  margin-left: 16px;
  color: var(--text);
  font-style: normal;
}

.severity-score {
  min-width: 62px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 81, 77, 0.42);
  border-radius: 6px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 18px;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.evidence-grid > div,
.reason-box,
.mini-chart {
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
}

.evidence-grid > div {
  min-width: 0;
  padding: 9px 10px;
}

.evidence-grid span,
.evidence-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evidence-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 21px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evidence-grid small {
  margin-top: 3px;
  color: var(--muted-2);
}

.ratio-up {
  color: var(--red);
}

.ratio-down {
  color: var(--green);
}

.ratio-flat {
  color: var(--text);
}

.mini-chart {
  margin-top: 12px;
  padding: 10px;
}

.chart-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chart-title strong {
  color: var(--text);
}

.chart-title i {
  width: 16px;
  height: 2px;
  display: inline-block;
  margin: 0 5px 3px 10px;
  vertical-align: middle;
}

.red-line {
  background: var(--red);
}

.blue-line {
  background: var(--blue);
}

.spark-svg {
  width: 100%;
  height: 132px;
  margin-top: 6px;
}

.spark-grid line {
  stroke: rgba(255, 255, 255, 0.08);
}

.spark-bars rect {
  fill: rgba(76, 157, 255, 0.35);
}

.spark-line {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(255, 81, 77, 0.35));
}

.reason-box {
  margin-top: 12px;
  padding: 11px;
}

.reason-box strong {
  display: block;
  margin-bottom: 8px;
}

.reason-box div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reason-box span {
  max-width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  padding: 5px 7px;
  font-size: 12px;
  white-space: nowrap;
}

.member-mini {
  margin-top: 12px;
}

.member-head,
.member-row {
  display: grid;
  grid-template-columns: minmax(146px, 1fr) 74px 74px 70px;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border-bottom: 1px solid var(--line-soft);
}

.member-head {
  color: var(--muted);
  font-size: 12px;
}

.member-row {
  min-height: 48px;
}

.member-row > :nth-child(n+2),
.member-head > :nth-child(n+2) {
  text-align: right;
}

.member-row span {
  min-width: 0;
}

.member-row b {
  margin-right: 7px;
  color: var(--amber);
}

.member-row strong,
.member-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
}

.panel-link {
  width: 100%;
  margin-top: 12px;
  color: var(--text);
}

.event-bottom-grid {
  display: grid;
  grid-template-columns: minmax(430px, 0.9fr) minmax(520px, 1.05fr) minmax(430px, 0.95fr);
  gap: 8px;
  margin-top: 8px;
}

.bottom-panel {
  min-height: 214px;
  overflow: hidden;
}

.heat-list {
  padding: 8px 12px 12px;
}

.heat-row {
  display: grid;
  grid-template-columns: 24px minmax(92px, 1fr) minmax(80px, 0.9fr) 38px 66px 48px 58px;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}

.heat-row strong,
.heat-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heat-row > span:first-child {
  color: var(--amber);
  font-weight: 800;
}

.heat-row em {
  color: var(--red);
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.heat-track {
  height: 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.heat-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--red));
}

.histogram {
  height: 128px;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  gap: 5px;
  padding: 18px 22px 0;
  border-bottom: 1px solid var(--line-soft);
}

.hist-col {
  height: 104px;
  display: flex;
  align-items: end;
  gap: 2px;
}

.hist-col i {
  width: 100%;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
}

.hist-col .up {
  background: var(--red);
}

.hist-col .down {
  background: var(--green);
}

.hist-col .warn {
  background: var(--amber);
}

.hist-axis {
  display: flex;
  justify-content: space-between;
  padding: 9px 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.finger-table {
  padding: 8px 12px 12px;
}

.finger-head,
.finger-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 82px minmax(86px, 0.8fr) 68px 40px;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}

.finger-head {
  color: var(--muted);
}

.finger-row span,
.finger-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-footnote {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state.small {
  min-height: 46px;
}

.evidence-empty {
  height: 100%;
}

.home-topbar {
  display: grid;
  grid-template-columns: minmax(700px, 1.1fr) minmax(520px, 0.9fr);
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
}

.banner-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.15fr) auto auto;
  align-items: center;
  gap: 8px;
}

.banner-controls .seg-group {
  min-width: 0;
}

.banner-controls .refresh-btn {
  height: 100%;
  min-width: 58px;
}

.status-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.status-strip span {
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  padding: 7px 9px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-strip em,
.status-strip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.status-strip small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
}

.status-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.05;
}

.refresh-state.refresh-active {
  border-color: rgba(53, 217, 154, 0.3);
  background: linear-gradient(90deg, rgba(53, 217, 154, 0.08), rgba(255, 255, 255, 0.025));
}

.live-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--green);
  animation: livePulse 1.4s ease-in-out infinite;
}

.holdings-panel.nav-focus-pulse {
  border-color: #b87731;
  box-shadow: 0 0 0 1px rgba(236, 167, 74, .55), 0 0 24px rgba(236, 167, 74, .16);
}

.holdings-panel {
  margin-top: 8px;
  padding: 10px 12px 12px;
  scroll-margin-top: 82px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.holdings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.holdings-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.holdings-head h2 small {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.holdings-head p {
  margin: 4px 0 0;
  color: var(--muted-2);
  font-size: 12px;
}

.holdings-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.holdings-actions button,
.holdings-input-box button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.holdings-actions button:hover,
.holdings-actions button.active,
.holdings-input-box button.primary {
  color: var(--text);
  border-color: rgba(255, 81, 77, 0.44);
  background: var(--red-soft);
}

.holdings-actions button.soft {
  color: var(--amber);
  border-color: rgba(246, 160, 68, 0.45);
  background: rgba(246, 160, 68, 0.1);
}

.holdings-input-box {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  padding: 9px;
}

.holdings-input-box label,
.holdings-input-box label span {
  display: block;
}

.holdings-input-box label span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.holdings-input-box textarea {
  width: 100%;
  min-height: 44px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: rgba(4, 7, 11, 0.72);
  padding: 7px 9px;
  font: inherit;
}

.holdings-input-box > div {
  display: flex;
  gap: 8px;
}

.holding-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}

.holding-tag {
  position: relative;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  padding: 0 8px;
  line-height: 1;
}

.holding-tag:hover,
.holding-tag.selected {
  border-color: rgba(255, 81, 77, 0.55);
  background: rgba(255, 81, 77, 0.08);
}

.holding-tag strong {
  font-size: 15px;
  white-space: nowrap;
}

.holding-tag em {
  color: var(--amber);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.holding-tag i {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 81, 77, 0.28);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.holding-tag.unknown {
  color: var(--muted);
}

.pct-pill {
  min-width: 58px;
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0 7px;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.pct-pill.up {
  color: var(--red);
  border: 1px solid rgba(255, 81, 77, 0.35);
  background: rgba(255, 81, 77, 0.14);
}

.pct-pill.down {
  color: var(--green);
  border: 1px solid rgba(53, 217, 154, 0.3);
  background: rgba(53, 217, 154, 0.12);
}

.confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
}

.confirm-card {
  width: min(420px, calc(100vw - 48px));
  border: 1px solid rgba(255, 81, 77, 0.35);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(22, 31, 43, 0.98), rgba(10, 15, 22, 0.98));
  box-shadow: var(--shadow);
  padding: 18px;
}

.confirm-card h3 {
  margin: 0;
  font-size: 18px;
}

.confirm-card p {
  margin: 10px 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-card > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-card button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  padding: 0 12px;
  font-weight: 800;
}

.confirm-card button.danger {
  border-color: rgba(255, 81, 77, 0.52);
  color: var(--red);
  background: rgba(255, 81, 77, 0.14);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(620px, 0.98fr) minmax(560px, 0.9fr) minmax(430px, 0.72fr);
  gap: 8px;
  margin-top: 8px;
  height: auto;
  min-height: 0;
  overflow: visible;
  align-items: stretch;
}

.secondary-ranks {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  gap: 8px;
  align-content: start;
}

.rank-card,
.home-detail {
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-layout .rank-card,
.home-layout .home-detail {
  overflow: visible;
  contain: layout style;
}

.card-head,
.detail-title {
  min-height: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-head h2,
.detail-title h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.card-head h2 small {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
}

.card-head a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.rank-head,
.rank-row {
  display: grid;
  grid-template-columns: minmax(122px, 1.15fr) 72px 72px 64px 52px 66px 40px;
  align-items: center;
  gap: 6px;
  padding: 0 5px;
}

.rank-head {
  min-height: 26px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
}

.rank-row {
  width: 100%;
  min-height: 26px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-size: 13px;
  line-height: 1.05;
}

.rank-row:hover,
.rank-row.selected {
  background: rgba(255, 255, 255, 0.045);
}

.rank-row.row-updated,
.detail-table-row.row-updated,
.constituent-row.row-updated {
  animation: rowPulse 2.4s ease-out both;
}

.rank-row.row-new,
.detail-table-row.row-new,
.constituent-row.row-new {
  box-shadow: inset 3px 0 0 var(--amber);
}

.rank-row.selected {
  box-shadow: inset 3px 0 0 var(--red);
}

.rank-row > :nth-child(n+2),
.rank-head > :nth-child(n+2) {
  text-align: right;
}

.rank-name {
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  grid-template-areas: "rank name" "rank code";
  column-gap: 5px;
  row-gap: 1px;
}

.rank-name b {
  grid-area: rank;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--amber);
  font-size: 14px;
}

.rank-name strong,
.rank-name small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-name strong {
  grid-area: name;
  font-size: 13px;
}

.rank-name small {
  grid-area: code;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1;
}

.rank-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.home-layout .rank-list,
.home-layout .constituent-list {
  flex: 0 0 auto;
  overflow: visible;
}

.home-layout .window-record-list {
  flex: 0 0 auto;
}

.rank-card-compact {
  padding: 11px;
}

.rank-card-compact .card-head {
  min-height: 27px;
}

.rank-card-compact .card-head h2 {
  font-size: 16px;
}

.rank-card-compact .rank-head,
.rank-card-compact .rank-row {
  grid-template-columns: minmax(122px, 1.1fr) 70px 70px 62px 50px 64px 38px;
  gap: 6px;
  padding: 0 5px;
}

.rank-card-compact .rank-head {
  min-height: 24px;
  font-size: 12px;
}

.rank-card-compact .rank-row {
  min-height: 24px;
  font-size: 13px;
}

.rank-card-compact .rank-name {
  grid-template-columns: 50px minmax(0, 1fr);
}

.rank-card-compact .rank-name small {
  display: none;
}

.holding-insight-ranks {
  gap: 8px;
}

.window-record-card {
  padding: 12px;
}

.window-card-head {
  align-items: center;
  min-height: 36px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}

.window-card-head h2 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
}

.window-refresh-state {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(54, 211, 153, 0.28);
  border-radius: 999px;
  background: rgba(54, 211, 153, 0.08);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 800;
}

.window-refresh-state.warning {
  border-color: rgba(255, 184, 92, 0.3);
  background: rgba(255, 184, 92, 0.08);
  color: #ffb85c;
}

.window-card-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.window-tabs {
  flex-shrink: 0;
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 10, 17, 0.45);
}

.window-tabs button {
  min-width: 44px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.window-tabs button.active {
  color: var(--text);
  background: rgba(255, 69, 84, 0.26);
  box-shadow: inset 0 0 0 1px rgba(255, 89, 102, 0.55);
}

.window-record-head,
.window-record-row {
  display: grid;
  grid-template-columns: 50px minmax(62px, 0.9fr) minmax(62px, 0.9fr) minmax(68px, 1fr) minmax(58px, 0.85fr) 46px 62px 62px;
  align-items: center;
  column-gap: 9px;
  padding: 0 4px;
}

.window-record-head {
  min-height: 27px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.window-record-head > span:not(:first-child),
.window-record-row > :not(:first-child) {
  text-align: right;
}

.window-record-list {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.window-record-row {
  min-height: 25px;
  border-top: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
}

.window-record-row > span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.window-record-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.window-record-row .yesterday-total {
  color: #9fbad5;
}

.window-record-row .yesterday {
  color: #b8c8d8;
}

.window-record-row .today {
  color: #ffd166;
}

.muted-value {
  color: var(--muted-2);
}

.rank-move {
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 1px 3px;
  font-size: 10px;
  line-height: 1.1;
  font-style: normal;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.move-up {
  color: var(--red);
  background: rgba(255, 81, 77, 0.13);
}

.move-down {
  color: var(--green);
  background: rgba(53, 217, 154, 0.12);
}

.cell-flash {
  border-radius: 4px;
  padding: 1px 3px;
  margin: -1px -3px;
}

.flash-up {
  animation: flashRed 2.8s ease-out both;
}

.flash-down {
  animation: flashGreen 2.8s ease-out both;
}

.detail-title strong {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 81, 77, 0.38);
  border-radius: 5px;
  background: var(--red-soft);
  padding: 8px 10px;
  font-size: 15px;
}

.detail-title span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.detail-metrics > div,
.detail-summary > div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  padding: 9px 10px;
}

.detail-metrics span,
.detail-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-metrics strong,
.detail-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.detail-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-tabs button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.detail-tabs button.active {
  color: var(--text);
  border-color: rgba(255, 81, 77, 0.38);
  background: var(--red-soft);
}

.constituent-head,
.constituent-row {
  display: grid;
  grid-template-columns: minmax(108px, 0.86fr) minmax(150px, 1.3fr) 48px 64px;
  align-items: center;
  gap: 6px;
}

.constituent-head {
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
}

.constituent-row {
  min-height: 44px;
  border-bottom: 1px solid var(--line-soft);
}

.constituent-row.holding-pinned,
.detail-table-row.holding-pinned {
  background: rgba(255, 81, 77, 0.07);
  box-shadow: inset 3px 0 0 var(--red);
}

.constituent-row > :nth-child(n+2),
.constituent-head > :nth-child(n+2) {
  text-align: right;
}

.constituent-row span,
.constituent-row strong,
.constituent-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.constituent-row small {
  display: block;
  color: var(--muted-2);
  font-size: 11px;
}

.constituent-row small i,
.detail-table-row small i {
  display: inline-flex;
  margin-left: 6px;
  border-radius: 3px;
  color: var(--amber);
  background: rgba(246, 160, 68, 0.12);
  padding: 1px 4px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.amount-chain {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.amount-chain b {
  min-width: 0;
  font-weight: 800;
  color: #d8e5f1;
}

.constituent-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.detail-page {
  max-width: 1760px;
  margin: 0 auto;
}

.detail-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-bar h1 {
  margin: 0;
  font-size: 22px;
}

.detail-bar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-bar input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel);
  padding: 0 12px;
  outline: none;
}

.detail-summary {
  margin-top: 12px;
  padding: 10px;
}

.detail-table {
  margin-top: 12px;
  overflow: auto;
}

.detail-table-head,
.detail-table-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
}

.rank-detail-table .detail-table-head,
.rank-detail-table .detail-table-row {
  grid-template-columns: 42px minmax(180px, 1.4fr) 96px 96px 90px 78px 78px 70px;
}

.constituent-detail-table .detail-table-head,
.constituent-detail-table .detail-table-row {
  grid-template-columns: 42px minmax(180px, 1.4fr) 70px 96px 96px 90px 78px 78px;
}

.detail-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: rgba(14, 20, 28, 0.98);
  font-size: 12px;
}

.detail-table-row {
  color: var(--text);
  text-decoration: none;
}

.detail-table-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.detail-table-row > :nth-child(n+3),
.detail-table-head > :nth-child(n+3) {
  text-align: right;
}

.detail-table-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-index-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--amber);
  font-weight: 900;
}

.detail-table-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: 420px;
  border: 1px solid rgba(76, 157, 255, 0.3);
  border-radius: 8px;
  color: var(--text);
  background: rgba(18, 25, 35, 0.98);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   PORTFOLIO VIEW — 我的持仓异动
   ═══════════════════════════════════════════════════════════ */

.portfolio-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(12, 17, 24, 0.7);
}

.portfolio-title-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.portfolio-title-row h2 {
  margin: 0;
  font-size: 20px;
}

.portfolio-meta {
  color: var(--muted);
  font-size: 13px;
}

.portfolio-meta b {
  color: var(--text);
}

.portfolio-meta .warn-text {
  color: var(--amber);
}

.portfolio-scope-switch {
  display: flex;
  gap: 8px;
}

.portfolio-scope-switch button,
.portfolio-scope-switch a {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(18, 25, 35, 0.86);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.portfolio-scope-switch button.active,
.portfolio-scope-switch a:hover {
  color: var(--text);
  border-color: rgba(255, 81, 77, 0.42);
  background: var(--red-soft);
}

/* Portfolio table */
.portfolio-table-wrap {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(20, 28, 39, 0.96), rgba(12, 17, 24, 0.98));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portfolio-head,
.portfolio-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) 64px 76px 56px minmax(100px, 0.8fr) 130px minmax(200px, 1.6fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.portfolio-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 36px;
  color: var(--muted);
  background: rgba(14, 20, 28, 0.98);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.portfolio-row {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.portfolio-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.portfolio-row.pf-sev-major {
  border-left-color: rgba(255, 81, 77, 0.85);
  background: rgba(255, 81, 77, 0.04);
}

.portfolio-row.pf-sev-strong {
  border-left-color: rgba(246, 160, 68, 0.7);
}

.portfolio-row.pf-sev-normal {
  border-left-color: rgba(76, 157, 255, 0.4);
}

.portfolio-row.expanded {
  background: rgba(255, 255, 255, 0.05);
}

.portfolio-row > :nth-child(n+2),
.portfolio-head > :nth-child(n+2) {
  text-align: right;
}

.pf-name strong,
.pf-name small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pf-name strong {
  font-size: 14px;
}

.pf-name small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
}

.pf-industry-name {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Portfolio badges */
.pf-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.pf-badge.pf-none {
  color: var(--muted-2);
  background: transparent;
}

.pf-badge.pf-major {
  color: var(--red);
  border-color: rgba(255, 81, 77, 0.35);
  background: rgba(255, 81, 77, 0.1);
}

.pf-badge.pf-strong {
  color: var(--amber);
  border-color: rgba(246, 160, 68, 0.35);
  background: rgba(246, 160, 68, 0.1);
}

.pf-badge.pf-normal {
  color: var(--blue);
  border-color: rgba(76, 157, 255, 0.3);
  background: rgba(76, 157, 255, 0.08);
}

.pf-concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.pf-more {
  color: var(--muted);
  font-size: 10px;
  align-self: center;
}

/* Portfolio expanded detail */
.pf-detail {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line-soft);
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.15);
}

.pf-detail-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.pf-detail-metrics > div {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 8px;
}

.pf-detail-metrics span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.pf-detail-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.pf-detail-section {
  margin-top: 10px;
}

.pf-detail-section > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.pf-detail-sub {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.pf-concept-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pf-concept-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
}

.pf-concept-row.pf-major {
  border-color: rgba(255, 81, 77, 0.3);
  background: rgba(255, 81, 77, 0.06);
}

.pf-concept-row.pf-strong {
  border-color: rgba(246, 160, 68, 0.3);
  background: rgba(246, 160, 68, 0.05);
}

.pf-concept-row span {
  color: var(--muted);
  font-size: 11px;
}

/* ═══════════════════════════════════════════════════════════
   END PORTFOLIO VIEW
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   V2 BOARD MATRIX — 板块状态矩阵
   ═══════════════════════════════════════════════════════════ */

.matrix-toolbar {
  grid-template-columns: minmax(240px, 0.9fr) minmax(200px, 0.6fr) minmax(250px, 0.9fr) minmax(350px, 1.2fr) auto;
}

.matrix-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.matrix-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(18, 25, 35, 0.86);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.matrix-actions button:hover {
  color: var(--text);
  border-color: rgba(255, 81, 77, 0.42);
  background: var(--red-soft);
}

.matrix-metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(12, 17, 24, 0.7);
  overflow: hidden;
}

.matrix-workspace {
  display: grid;
  grid-template-columns: minmax(780px, 1fr) 480px;
  gap: 8px;
  align-items: stretch;
  min-height: 680px;
  margin-top: 8px;
}

.matrix-table-wrap {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(20, 28, 39, 0.96), rgba(12, 17, 24, 0.98));
  box-shadow: var(--shadow);
  overflow-y: auto;
  overflow-x: hidden;
}

.matrix-head,
.matrix-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr) 52px 56px 44px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
}

.matrix-head {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 38px;
  color: var(--muted);
  background: rgba(14, 20, 28, 0.98);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.matrix-head .tf-col {
  text-align: center;
}

.matrix-head .tf-col small {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
  margin-top: 2px;
}

.matrix-row {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.matrix-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.matrix-row.matrix-sev-major {
  border-left-color: rgba(255, 81, 77, 0.85);
  background: rgba(255, 81, 77, 0.04);
}

.matrix-row.matrix-sev-strong {
  border-left-color: rgba(246, 160, 68, 0.75);
  background: rgba(246, 160, 68, 0.03);
}

.matrix-row.matrix-sev-normal {
  border-left-color: rgba(76, 157, 255, 0.45);
}

.matrix-row.expanded {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: var(--line);
}

.matrix-row > :nth-child(n+6),
.matrix-head > :nth-child(n+6) {
  text-align: right;
}

.matrix-name {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  grid-template-areas: "dot name" "dot code";
  column-gap: 8px;
  row-gap: 1px;
  align-items: center;
}

.sev-dot {
  grid-area: dot;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}

.sev-dot.sev-major {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.sev-dot.sev-strong {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.sev-dot.sev-normal {
  background: var(--blue);
  box-shadow: 0 0 4px var(--blue);
}

.matrix-name strong,
.matrix-name small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-name strong {
  grid-area: name;
  font-size: 14px;
  line-height: 1.2;
}

.matrix-name small {
  grid-area: code;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1;
}

.tf-cell {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
}

.tf-cell.tf-none {
  color: var(--muted-2);
}

.tf-cell.tf-active {
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 3px;
}

.tf-cell.tf-active.up {
  color: var(--red);
  background: rgba(255, 81, 77, 0.08);
}

.tf-cell.tf-active.down {
  color: var(--green);
  background: rgba(53, 217, 154, 0.08);
}

.chain-dots {
  display: inline-block;
  color: var(--amber);
  font-size: 10px;
  letter-spacing: 1px;
  vertical-align: middle;
}

.matrix-score {
  color: var(--amber);
  font-size: 16px;
  font-weight: 900;
}

.portfolio-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 22px;
  border: 1px solid rgba(246, 160, 68, 0.4);
  border-radius: 4px;
  color: var(--amber);
  background: rgba(246, 160, 68, 0.1);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  padding: 0 6px;
}

.portfolio-badge.heavy {
  border-color: rgba(255, 81, 77, 0.5);
  color: var(--red);
  background: rgba(255, 81, 77, 0.1);
}

/* Inline expanded detail inside matrix row */
.matrix-detail-inline {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line-soft);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.detail-mini-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.detail-mini-metrics > div {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 6px 8px;
}

.detail-mini-metrics span,
.detail-mini-metrics strong {
  display: block;
}

.detail-mini-metrics span {
  color: var(--muted);
  font-size: 11px;
}

.detail-mini-metrics strong {
  margin-top: 3px;
  font-size: 16px;
}

.detail-mini-reasons {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px;
}

.detail-mini-reasons span {
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--muted);
  padding: 4px 7px;
  font-size: 11px;
}

.detail-mini-members {
  min-width: 0;
}

.detail-mini-members > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.mini-member {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 50px 42px;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  font-size: 12px;
}

.mini-member b {
  color: var(--amber);
  font-size: 10px;
}

.mini-member strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Right detail panel */
.matrix-detail-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(20, 28, 39, 0.96), rgba(12, 17, 24, 0.98));
  box-shadow: var(--shadow);
  padding: 14px;
  overflow-y: auto;
}

/* Responsive — matrix */
@media (max-width: 1500px) {
  .matrix-workspace {
    grid-template-columns: minmax(580px, 1fr) 400px;
    min-height: 580px;
  }

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

  .matrix-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

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

@media (max-width: 1100px) {
  .matrix-workspace,
  .matrix-toolbar,
  .matrix-metric-strip {
    grid-template-columns: 1fr;
  }

  .matrix-detail-panel {
    min-height: 400px;
  }
}

/* ═══════════════════════════════════════════════════════════
   END V2 BOARD MATRIX
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1500px) {
  html,
  body {
    min-width: 1040px;
  }

  .event-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .event-workspace {
    grid-template-columns: minmax(720px, 1fr) 440px;
    height: auto;
    min-height: 680px;
  }

  .event-bottom-grid,
  .home-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-layout {
    height: auto;
    overflow: visible;
  }

  .secondary-ranks {
    grid-template-rows: auto auto;
  }

  .home-detail {
    grid-column: span 2;
    min-height: 640px;
  }
}

@media (max-width: 1100px) {
  html,
  body {
    min-width: 760px;
  }

  .app-header,
  .home-topbar,
  .event-workspace,
  .event-bottom-grid,
  .home-layout {
    grid-template-columns: 1fr;
  }

  .banner-controls {
    grid-template-columns: 1fr;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-status {
    text-align: left;
  }

  .event-toolbar {
    grid-template-columns: 1fr;
  }
}

/* PC readability pass */
body {
  font-size: 14px;
}

.header-nav a,
.refresh-btn,
.stream-actions button,
.detail-bar a,
.panel-link,
.seg-group button,
.holdings-actions button,
.holdings-input-box button,
.portfolio-scope-switch button,
.portfolio-scope-switch a,
.matrix-actions button {
  min-height: 36px;
  font-size: 14px;
}

.header-status span,
.seg-group > span,
.metric-card span,
.metric-card small,
.panel-head small,
.evidence-head p,
.evidence-grid span,
.evidence-grid small,
.chart-title,
.reason-box span,
.data-footnote,
.status-strip span,
.status-strip small,
.holdings-head h2 small,
.holdings-head p,
.holdings-input-box label span,
.portfolio-meta,
.pf-industry-name,
.pf-detail-sub,
.detail-mini-metrics span,
.detail-mini-reasons span,
.detail-mini-members > span {
  font-size: 13px;
}

.event-table-head,
.member-head,
.rank-head,
.rank-card-compact .rank-head,
.window-record-head,
.constituent-head,
.detail-table-head,
.portfolio-head,
.matrix-head {
  min-height: 32px;
  font-size: 13px;
}

.event-row,
.member-row,
.heat-row,
.finger-row,
.rank-row,
.rank-card-compact .rank-row,
.window-record-row,
.constituent-row,
.detail-table-row,
.portfolio-row,
.matrix-row,
.mini-member {
  font-size: 14px;
  line-height: 1.2;
}

.rank-row,
.rank-card-compact .rank-row,
.window-record-row {
  min-height: 31px;
}

.rank-name strong {
  font-size: 14px;
}

.target-cell small,
.member-row small,
.rank-name small,
.constituent-row small,
.detail-table-row small,
.pf-name small,
.matrix-name small {
  font-size: 12px;
  line-height: 1.2;
}

.event-pill,
.severity-badge,
.holding-tag em,
.rank-move,
.constituent-row small i,
.detail-table-row small i,
.pf-badge,
.pf-more,
.portfolio-badge,
.mini-member b,
.chain-dots {
  font-size: 12px;
}

.card-head h2 small,
.matrix-head .tf-col small {
  font-size: 12px;
}

.window-card-head p,
.window-record-row > span:first-child,
.detail-title span,
.detail-metrics span,
.detail-summary span,
.amount-chain,
.pf-detail-metrics span,
.pf-concept-row,
.pf-concept-row span,
.tf-cell {
  font-size: 13px;
}

.window-tabs button {
  min-width: 50px;
  height: 30px;
  font-size: 12px;
}

.detail-tabs button {
  min-height: 34px;
  font-size: 13px;
}

.constituent-row {
  min-height: 48px;
}

.portfolio-row,
.matrix-row {
  min-height: 58px;
}

.portfolio-badge,
.pf-badge {
  min-height: 25px;
}

.card-head a {
  font-size: 13px;
}

.evidence-grid span {
  min-height: 32px;
  overflow: visible;
  line-height: 1.25;
  text-overflow: clip;
  white-space: normal;
}

/* Intraday anomaly workbench: adjacent closed five-minute windows. */
.anomaly-v3-page { width: 100%; max-width: none; }

.anomaly-control-bar {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0d141d;
  padding: 7px 10px;
}

.anomaly-primary-tabs,
.anomaly-market-tabs,
.direction-tabs {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0a1018;
  overflow: hidden;
}

.anomaly-primary-tabs button,
.anomaly-market-tabs button,
.direction-tabs button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.anomaly-primary-tabs button:last-child,
.anomaly-market-tabs button:last-child,
.direction-tabs button:last-child { border-right: 0; }

.anomaly-primary-tabs button.active,
.anomaly-market-tabs button.active,
.direction-tabs button.active {
  color: var(--text);
  background: rgba(255, 81, 77, 0.16);
  box-shadow: inset 0 -2px 0 var(--red);
}

.anomaly-live-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.anomaly-live-state strong { color: var(--text); font-size: 14px; }
.anomaly-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: livePulse 1.8s ease-in-out infinite;
}
.anomaly-live-dot.historical {
  background: #7891ad;
  animation: none;
}

.anomaly-data-time {
  min-width: 178px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.anomaly-data-time span,
.anomaly-data-time strong { display: block; }
.anomaly-data-time span { color: var(--muted); font-size: 11px; }
.anomaly-data-time strong { margin-top: 3px; font-size: 13px; }

.anomaly-market-static {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 81, 77, 0.5);
  border-radius: 4px;
  background: rgba(255, 81, 77, 0.12);
  padding: 0 20px;
  font-weight: 800;
}

.industry-chart-card,
.anomaly-list-panel,
.anomaly-detail-panel,
.stock-anomaly-filters {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #101822;
}

.industry-chart-card { position: relative; margin-top: 8px; padding: 12px 14px 8px; }
.industry-chart-card > header,
.anomaly-list-panel > header,
.stock-anomaly-chart-card > header,
.stock-industry-sync > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.industry-chart-card > header {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(460px, 1.35fr) auto;
  align-items: center;
}

.industry-chart-heading { min-width: 0; }
.market-overview-strip {
  width: min(100%, 680px);
  min-width: 440px;
  justify-self: center;
  border-left: 1px solid rgba(87, 105, 128, .32);
  border-right: 1px solid rgba(87, 105, 128, .32);
  padding: 0 20px;
}
.market-overview-counts,
.market-overview-amounts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  white-space: nowrap;
}
.market-overview-counts strong { font-size: 15px; }
.market-overview-counts span { color: var(--muted); font-size: 12px; }
.market-breadth-track {
  display: flex;
  width: 100%;
  height: 7px;
  overflow: hidden;
  margin: 6px 0;
  background: rgba(143, 161, 184, .22);
}
.market-breadth-track i { display: block; min-width: 0; height: 100%; }
.market-breadth-track i.down { background: var(--green); }
.market-breadth-track i.flat { background: #8fa1b8; border-left: 2px solid #101822; border-right: 2px solid #101822; }
.market-breadth-track i.up { background: var(--red); }
.market-overview-amounts { color: #b8c5d6; font-size: 13px; }
.market-overview-amounts strong { margin-left: 4px; color: var(--text); font-size: 15px; }
.market-overview-amounts strong.up { color: var(--red); }
.market-overview-amounts strong.down { color: var(--green); }

.industry-chart-card h2,
.anomaly-list-panel h2,
.stock-anomaly-chart-card h3,
.stock-industry-sync h3 { margin: 0; font-size: 17px; letter-spacing: 0; }
.industry-chart-card p,
.anomaly-list-panel > header span,
.stock-anomaly-chart-card header span,
.stock-industry-sync header span { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.anomaly-chart-legend { display: flex; gap: 18px; color: var(--muted); font-size: 12px; }
.anomaly-chart-legend span::before {
  content: "";
  width: 18px;
  height: 2px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}
.anomaly-chart-legend .up-line::before { background: var(--red); }
.anomaly-chart-legend .down-line::before { background: var(--green); }
.anomaly-chart-legend .market-line::before { background: var(--amber); }
.anomaly-chart-legend .previous-market-line::before {
  height: 0;
  border-top: 2px dashed #7891ad;
}
.anomaly-chart-legend .amount-bars::before {
  width: 14px;
  height: 8px;
  background: linear-gradient(90deg, var(--red) 0 48%, var(--green) 52% 100%);
}
.anomaly-chart-legend .up-point::before,
.anomaly-chart-legend .down-point::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.anomaly-chart-legend .up-point::before { background: var(--red); }
.anomaly-chart-legend .down-point::before { background: var(--green); }
#industryAnomalyChart, #stockAnomalyChart { width: 100%; display: block; }

.industry-chart-label-layer {
  position: absolute;
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}

.industry-chart-event-label {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 0 2px;
  color: var(--text);
  background: transparent;
  font: 800 12px/25px "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(1, 8, 16, .98);
  cursor: pointer;
  pointer-events: auto;
  transform-origin: center;
  transition: transform 90ms ease, text-shadow 90ms ease, opacity 90ms ease;
}

.industry-chart-event-label.up { color: #ff625f; background: transparent; }
.industry-chart-event-label.down { color: #35d8a0; background: transparent; }
.industry-chart-event-label.selected {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.industry-chart-event-label:hover,
.industry-chart-event-label:focus-visible,
.industry-chart-event-label.active {
  z-index: 30;
  overflow: visible;
  outline: 0;
  transform: translateY(-1px);
  text-shadow: 0 1px 2px rgba(1, 8, 16, 1), 0 0 4px currentColor;
}

.industry-chart-tooltip {
  position: absolute;
  z-index: 50;
  width: max-content;
  max-width: 390px;
  border: 1px solid rgba(120, 145, 173, .7);
  border-radius: 4px;
  background: rgba(7, 13, 21, .97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .38);
  padding: 9px 11px;
  pointer-events: none;
}
.industry-chart-tooltip strong,
.industry-chart-tooltip span,
.industry-chart-tooltip small { display: block; }
.industry-chart-tooltip strong { font-size: 13px; }
.industry-chart-tooltip strong.up { color: var(--red); }
.industry-chart-tooltip strong.down { color: var(--green); }
.industry-chart-tooltip strong.market { color: var(--amber); }
.industry-chart-tooltip span { margin-top: 5px; color: var(--text); font-size: 13px; }
.industry-chart-tooltip small { margin-top: 4px; color: var(--muted); font-size: 12px; }

.industry-anomaly-workspace,
.stock-anomaly-workspace {
  display: grid;
  grid-template-columns: minmax(880px, 1.85fr) minmax(420px, .95fr);
  gap: 8px;
  align-items: start;
  margin-top: 8px;
}

.anomaly-list-panel { min-width: 0; overflow: visible; }
.anomaly-list-panel > header { min-height: 48px; border-bottom: 1px solid var(--line); padding: 0 13px; }
.anomaly-event-table { min-width: 0; }

.industry-grid,
.stock-grid {
  display: grid;
  align-items: center;
  column-gap: 10px;
  padding: 0 10px;
}

.industry-grid { grid-template-columns: 54px minmax(100px, .76fr) 78px minmax(164px, 1.25fr) 82px 82px 56px 82px 68px 72px; }
.stock-grid { grid-template-columns: 54px minmax(112px, 1fr) minmax(104px, .9fr) 76px 86px 86px 56px 84px 82px; }

.anomaly-table-head {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 38px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #0d141d;
  font-size: 12px;
  font-weight: 700;
}

.anomaly-table-row {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-size: 13px;
  content-visibility: auto;
  contain-intrinsic-size: 48px;
}

.anomaly-table-row:hover { background: rgba(255, 255, 255, 0.035); }
.anomaly-table-row.selected { border-left-color: var(--red); background: rgba(255, 81, 77, 0.09); }
.anomaly-table-row > *, .anomaly-table-head > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.anomaly-table-row > :nth-child(n+5), .anomaly-table-head > :nth-child(n+5) { text-align: right; }
.anomaly-name strong, .anomaly-name small { display: block; overflow: hidden; text-overflow: ellipsis; }
.anomaly-name strong { font-size: 14px; }
.anomaly-name small { margin-top: 2px; color: var(--muted-2); font-size: 10px; }
.anomaly-reason { color: #b7c5d6; }

.anomaly-load-more {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
  font-weight: 800;
}

.anomaly-detail-panel {
  position: sticky;
  top: 8px;
  min-width: 0;
  padding: 14px;
  overflow: visible;
}

.anomaly-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.anomaly-detail-head span { color: var(--muted); font-size: 12px; }
.anomaly-detail-head h2 { margin: 5px 0 0; font-size: 23px; }
.anomaly-direction-badge {
  min-width: 82px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 900;
}
.anomaly-direction-badge.up { color: var(--red); background: var(--red-soft); }
.anomaly-direction-badge.down { color: var(--green); background: var(--green-soft); }
.anomaly-detail-explanation { margin: 12px 0 0; color: #c3cfdd; font-size: 13px; line-height: 1.65; }

.anomaly-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.anomaly-detail-metrics > div { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px; }
.anomaly-detail-metrics span, .anomaly-detail-metrics strong, .anomaly-detail-metrics small { display: block; }
.anomaly-detail-metrics span, .anomaly-detail-metrics small { color: var(--muted); font-size: 11px; }
.anomaly-detail-metrics strong { margin: 5px 0 3px; font-size: 18px; }

.anomaly-event-timeline,
.anomaly-member-table,
.stock-anomaly-chart-card,
.stock-window-compare,
.stock-industry-sync { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.anomaly-event-timeline h3, .anomaly-member-table h3 { margin: 0 0 12px; font-size: 15px; }
.anomaly-event-timeline > div {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.anomaly-event-timeline > div::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--line);
}
.anomaly-event-timeline span { position: relative; text-align: center; }
.anomaly-event-timeline i {
  width: 14px;
  height: 14px;
  display: block;
  margin: 0 auto 7px;
  border: 3px solid #0f1721;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 1px var(--line);
}
.anomaly-event-timeline span.active.up i { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.anomaly-event-timeline span.active.down i { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.anomaly-event-timeline b, .anomaly-event-timeline small { display: block; }
.anomaly-event-timeline b { font-size: 12px; }
.anomaly-event-timeline small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.anomaly-member-head,
.anomaly-member-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.25fr) 88px 72px 82px;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  border-bottom: 1px solid var(--line-soft);
}
.anomaly-member-head { color: var(--muted); font-size: 11px; }
.anomaly-member-row { color: var(--text); font-size: 13px; text-decoration: none; }
.anomaly-member-head > :nth-child(n+2), .anomaly-member-row > :nth-child(n+2) { text-align: right; }
.anomaly-member-row strong, .anomaly-member-row small { display: block; }
.anomaly-member-row small { color: var(--muted-2); font-size: 10px; }

.stock-anomaly-filters {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding: 8px 10px;
}
.direction-tabs button { min-width: 132px; }
.direction-tabs small { margin-left: 8px; color: inherit; opacity: .72; }
.anomaly-search {
  width: min(360px, 32vw);
  min-height: 38px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 10px;
}
.anomaly-search span { color: var(--muted); font-size: 12px; }
.anomaly-search input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.stock-anomaly-chart-card header { align-items: flex-start; }
.stock-anomaly-chart-card header span { max-width: 55%; text-align: right; }
.stock-window-compare { font-size: 12px; }
.stock-window-compare > div {
  display: grid;
  grid-template-columns: .8fr 1.2fr 1.2fr .9fr;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  border-bottom: 1px solid var(--line-soft);
}
.stock-window-compare > div > :nth-child(n+2) { text-align: right; }
.stock-window-compare .compare-head { color: var(--muted); font-size: 11px; }
.stock-industry-sync button {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 54px minmax(94px, 1fr) 54px 64px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  background: transparent;
  text-align: left;
}
.stock-industry-sync button > :nth-child(n+3) { text-align: right; }

.anomaly-stock-detail-link {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  font-weight: 800;
}
.anomaly-stock-detail-link:hover { border-color: rgba(255, 81, 77, 0.5); background: var(--red-soft); }

.anomaly-empty {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 28px;
}
.anomaly-empty strong { color: var(--text); font-size: 16px; }
.anomaly-empty button {
  min-height: 34px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  padding: 0 14px;
}
.anomaly-mini-empty { min-height: 62px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.anomaly-method-note { margin-top: 8px; border-top: 1px solid var(--line); color: var(--muted); padding: 10px 4px 4px; font-size: 12px; line-height: 1.6; }
.anomaly-method-note strong { color: var(--text); }

@media (max-width: 1500px) {
  .industry-chart-card > header { grid-template-columns: minmax(230px, .65fr) minmax(400px, 1.2fr) auto; gap: 12px; }
  .market-overview-strip { min-width: 400px; padding: 0 12px; }
  .anomaly-chart-legend { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
  .industry-anomaly-workspace, .stock-anomaly-workspace { grid-template-columns: minmax(760px, 1.7fr) minmax(390px, .9fr); }
  .industry-grid {
    grid-template-columns: 50px minmax(90px, .72fr) 72px minmax(120px, 1fr) 76px 76px 52px 76px 62px 66px;
    column-gap: 7px;
    padding: 0 7px;
  }
  .anomaly-reason { font-size: 12px; }
}

@media (max-width: 1280px) {
  .industry-chart-card > header { grid-template-columns: 1fr auto; }
  .market-overview-strip { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; border: 0; border-top: 1px solid rgba(87, 105, 128, .28); padding: 10px 0 0; }
  .industry-anomaly-workspace, .stock-anomaly-workspace { grid-template-columns: 1fr; }
  .anomaly-detail-panel { position: static; }
  .anomaly-control-bar { flex-wrap: wrap; }
  .anomaly-live-state { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .anomaly-live-dot { animation: none; }
}
.desktop-data-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 24px 0;
  border: 1px solid rgba(255, 176, 32, 0.42);
  border-radius: 10px;
  padding: 10px 14px;
  color: #dbe7f3;
  background: rgba(255, 176, 32, 0.08);
}

.desktop-data-warning > div { min-width: 0; }
.desktop-data-warning strong,
.desktop-data-warning span { display: block; }
.desktop-data-warning strong { font-size: 14px; }
.desktop-data-warning span { margin-top: 3px; color: #9fb0c3; font-size: 12px; }
.desktop-data-warning button {
  min-height: 34px;
  border: 1px solid rgba(54, 215, 192, 0.55);
  border-radius: 8px;
  padding: 0 14px;
  color: #36d7c0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
