/* Industry/style rotation extension — inherits the Quant Strategy Agent tokens. */
.nav-item[data-target^="rotation:"] i { background: var(--brand); }

.rotation-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.rotation-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font: 700 10px/1.35 Arial, "Microsoft YaHei", sans-serif;
}
.rotation-toolbar select {
  width: 100%;
  height: 39px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}
.rotation-toolbar .rotation-readout {
  min-height: 39px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 5px 10px;
  color: var(--muted);
  background: #fafafa;
  font-size: 10px;
}
.rotation-readout strong { display: block; margin-top: 3px; color: var(--ink); font-size: 12px; }

.rotation-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.rotation-status-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 14px 15px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.rotation-status-card.pass { border-top-color: var(--green); }
.rotation-status-card.review { border-top-color: var(--amber); background: #fffdf5; }
.rotation-status-card.fail { border-top-color: var(--red); background: #fff7f6; }
.rotation-status-card small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.rotation-status-card strong { display: block; margin: 7px 0 5px; color: var(--ink); font-size: 18px; line-height: 1.25; }
.rotation-status-card p { margin: 0; color: var(--subtle-ink); font-size: 10.5px; line-height: 1.55; }

.rotation-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.rotation-chart-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rotation-chart-grid > .chart-panel { margin: 0; }
.rotation-chart-grid .wide { grid-column: 1 / -1; }
.rotation-plot { width: 100%; min-height: 330px; }
.rotation-plot.compact { min-height: 270px; }

.rotation-timing {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.rotation-timing article {
  position: relative;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 12px;
  background: #fff;
}
.rotation-timing article:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -8px;
  z-index: 2;
  width: 14px;
  height: 14px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: #fff;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}
.rotation-timing b { color: var(--brand); font: 800 11px/1 Arial, sans-serif; }
.rotation-timing strong { display: block; margin: 7px 0 5px; color: var(--ink); font-size: 12px; }
.rotation-timing p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.rotation-hf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.rotation-hf-grid .chart-panel { margin: 0; }
.rotation-field-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--subtle-ink);
  background: #f2f4f7;
  font: 700 9px/1 Arial, "Microsoft YaHei", sans-serif;
}
.rotation-field-badge.live { color: #08783d; background: #eaf8f0; }
.rotation-field-badge.metadata_only { color: #9a4f04; background: #fff4df; }
.rotation-field-badge.selected { color: #8d1610; background: var(--brand-soft); }

.rotation-gate-note {
  margin: 0 0 18px;
  border: 1px solid #f2d39e;
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 11px 13px;
  color: #71410c;
  background: #fffaf0;
  font-size: 11px;
  line-height: 1.7;
}
.rotation-gate-note.pass { border-color: #b9dfca; border-left-color: var(--green); color: #0b6537; background: #f3fbf6; }

.rotation-split-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 10px; color: var(--muted); font-size: 10px; }
.rotation-split-legend span::before { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; content: ""; vertical-align: -1px; }
.rotation-split-legend .train::before { background: rgba(47,117,181,.16); }
.rotation-split-legend .validation::before { background: rgba(196,106,8,.16); }
.rotation-split-legend .test::before { background: rgba(22,138,71,.14); }

.rotation-table-note { margin: 8px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.55; }

@media (max-width: 1180px) {
  .rotation-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rotation-chart-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rotation-chart-grid.three > :last-child { grid-column: 1 / -1; }
  .rotation-timing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rotation-timing article::after { display: none; }
}
@media (max-width: 780px) {
  .rotation-toolbar, .rotation-status-grid, .rotation-chart-grid, .rotation-chart-grid.three,
  .rotation-hf-grid, .rotation-timing { grid-template-columns: 1fr; }
  .rotation-chart-grid.three > :last-child { grid-column: auto; }
  .rotation-toolbar .rotation-readout { border-left: 0; border-top: 3px solid var(--brand); border-radius: var(--radius); }
  .rotation-plot { min-height: 300px; }
}


/* Canonical final extension. */
.rotation-v4-panel {
  border-top: 2px solid rgba(180, 35, 24, .72);
}

.rotation-v4-panel .panel-header h3 {
  letter-spacing: .01em;
}

.rotation-v4-panel.compact-panel {
  min-height: 308px;
}

.rotation-v4-panel.compact-panel .rotation-plot.compact {
  min-height: 238px;
}

.rotation-v4-hf {
  align-items: stretch;
  margin-top: 16px;
}

.rotation-indicator-shell {
  min-width: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
}

.rotation-indicator-shell .chart-panel {
  border-top: 0;
  box-shadow: none;
  margin: 0;
}

.indicator-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  min-height: 37px;
  padding: 9px 14px 0;
  color: #667085;
  font-size: 11px;
  border-top: 2px solid #2f75b5;
  border-radius: 12px 12px 0 0;
}

.indicator-meta > span:not(:first-child) {
  position: relative;
  padding-left: 10px;
}

.indicator-meta > span:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #98a2b3;
}

.rotation-field-badge.live {
  color: #087443;
  border-color: rgba(8, 116, 67, .25);
  background: rgba(8, 116, 67, .08);
}

.rotation-field-badge.metadata_only,
.rotation-field-badge.review {
  color: #b54708;
  border-color: rgba(181, 71, 8, .25);
  background: rgba(181, 71, 8, .08);
}

.rotation-status-card.review {
  border-top-color: #c46a08;
}

.rotation-status-card.pass {
  border-top-color: #168a47;
}

.rotation-v4-hf + .table-panel {
  margin-top: 18px;
}

.rotation-v4-hf .panel-header p {
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1480px) {
  .rotation-v4-hf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .rotation-v4-hf {
    grid-template-columns: 1fr;
  }
}

.style-box-panel {
  margin: 16px 0;
  padding: 16px;
  border-top: 2px solid rgba(180, 35, 24, .72);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}

.style-box-panel .panel-header {
  margin-bottom: 12px;
}

.style-box-panel .panel-header p,
.style-box-date {
  color: #667085;
  font-size: 11px;
}

.rotation-style-box {
  display: grid;
  grid-template-columns: 76px repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.style-box-corner,
.style-box-head,
.style-box-size {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.style-box-head {
  border-bottom: 1px solid #d8dee5;
  color: #344054;
}

.style-box-head.dividend {
  color: #b42318;
}

.style-box-cell {
  display: flex;
  min-width: 0;
  min-height: 96px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #e4e8ec;
  border-left-width: 3px;
  border-radius: 9px;
  background: #fff;
  color: #18212b;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

button.style-box-cell {
  cursor: pointer;
}

button.style-box-cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 24, 40, .08);
}

.style-box-cell strong {
  font-size: 14px;
}

.style-box-cell span {
  color: #667085;
  font-size: 11px;
}

.style-box-cell em {
  color: #344054;
  font-size: 11px;
  font-style: normal;
}

.style-box-cell.style-成长 { border-left-color: #2f75b5; }
.style-box-cell.style-均衡 { border-left-color: #89939e; }
.style-box-cell.style-价值 { border-left-color: #c46a08; }
.style-box-cell.style-红利 { border-left-color: #b42318; }

.style-box-cell.selected {
  border-color: rgba(180, 35, 24, .78);
  background: rgba(180, 35, 24, .035);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, .12);
}

.style-box-cell.active {
  outline: 2px solid rgba(47, 117, 181, .35);
  outline-offset: 1px;
}

.rotation-search-label input {
  min-width: 190px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  background: #fff;
  color: #18212b;
  font: inherit;
}

#v4-style-stock-table .table-panel {
  margin-top: 18px;
}

@media (max-width: 980px) {
  .rotation-style-box {
    grid-template-columns: 62px repeat(2, minmax(0, 1fr));
  }

  .style-box-corner,
  .style-box-head {
    display: none;
  }

  .style-box-size {
    grid-column: 1 / -1;
    justify-content: flex-start;
    min-height: 26px;
    padding-top: 6px;
  }

  .style-box-cell {
    min-height: 88px;
  }
}


/* 行业/风格轮动最终收益区：年度表格 + Plotly 日度趋势。 */
.rotation-final-figures {
  margin: 0 0 18px;
}
.rotation-final-figures .panel-header {
  margin-bottom: 10px;
}
.rotation-result-group {
  margin: 0 0 18px;
  padding: 12px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.rotation-result-group:last-child {
  margin-bottom: 0;
}
.rotation-result-group h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  margin: 0 0 10px;
  color: var(--ink);
  font: 700 15px/1.45 KaiTi, "STKaiti", "Kaiti SC", Arial, sans-serif;
}
.rotation-result-group h4 span {
  color: var(--muted);
  font: 500 12px/1.45 Arial, KaiTi, sans-serif;
}
.rotation-result-pair {
  display: grid;
  grid-template-columns: minmax(260px, .92fr) minmax(360px, 1.38fr);
  gap: 14px;
  align-items: stretch;
}
.rotation-result-figure {
  margin: 0;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.rotation-result-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}
@media (max-width: 980px) {
  .rotation-result-pair {
    grid-template-columns: 1fr;
  }
}


/* v6 行业景气度 / 行业轮动：白底、黑字、红黄蓝灰高信息密度图表。 */
.rotation-v6 { color: #000; }
.rotation-v6 .chart-panel,
.rotation-v6 .table-panel,
.rotation-v6-final,
.rotation-v6-flow,
.rotation-v6-steps {
  border: 1px solid #d9e1e8;
  border-top: 2px solid #c00000;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16,24,40,.045);
}
.rotation-v6 .panel-header h3,
.rotation-v6 .table-panel h3 {
  color: #000;
  font: 700 15px/1.35 KaiTi, "STKaiti", "Kaiti SC", Arial, sans-serif;
}
.rotation-v6 .panel-header p { color:#667085; font-size:11px; }
.rotation-v6-flow { margin: 0 0 14px; padding: 12px; }
.rotation-v6-flow-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.rotation-v6-flow-row article {
  min-height: 54px;
  border: 1px solid #d9e1e8;
  border-left: 3px solid #c00000;
  border-radius: 7px;
  padding: 7px 8px;
  background: #fff;
}
.rotation-v6-flow-row small { display:block; color:#c00000; font:700 10px/1 Arial, sans-serif; }
.rotation-v6-flow-row strong { display:block; margin-top:5px; color:#000; font:700 12px/1.35 KaiTi, Arial, sans-serif; }
.rotation-v6-flow-row > i { display:none; }
.rotation-v6-steps { margin:0 0 14px; padding: 12px; }
.rotation-v6-step-grid { display:grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap:8px; }
.rotation-v6-step-grid article { min-height:58px; border:1px solid #e5e7eb; border-radius:7px; padding:8px 9px; background:#fff; }
.rotation-v6-step-grid b { color:#c00000; font:700 10px/1 Arial,sans-serif; }
.rotation-v6-step-grid strong { display:block; margin:3px 0; color:#000; font:700 12px/1.35 KaiTi,Arial,sans-serif; }
.rotation-v6-step-grid span { display:block; color:#344054; font:400 11px/1.45 KaiTi,Arial,sans-serif; }
.rotation-v6 .data-table { table-layout: fixed; width: 100%; border-collapse: collapse; color:#000; font-family: KaiTi, "STKaiti", "Kaiti SC", Arial, sans-serif; }
.rotation-v6 .data-table th { background:#8b1f14; color:#fff; font-size:11px; font-weight:700; text-align:center; padding:6px 5px; border:1px solid #ffffff; }
.rotation-v6 .data-table td { color:#000; font-size:10.5px; line-height:1.35; text-align:center; padding:5px 5px; border:1px solid #ffffff; word-break:break-word; }
.rotation-v6 .data-table tbody tr:nth-child(even) td { background:#e6e6e6; }
.rotation-v6 .data-table tbody tr:nth-child(odd) td { background:#f7f7f7; }
.rotation-v6 .data-table tbody td:first-child { background:#f2ece6; font-weight:700; }
.rotation-v6 .data-table tbody tr:hover td { background:#f4eee9; }
.rotation-v6 .data-table tbody tr:hover td:first-child { background:#eadfd6; }
.rotation-v6 .table-scroll { overflow: auto; }
.rotation-v6-arrow { display:inline-block; min-width:16px; margin-right:3px; font:900 15px/1 Arial,sans-serif; vertical-align:-1px; }
.rotation-v6-arrow.up { color:#c00000; }
.rotation-v6-arrow.down { color:#168a47; }
.rotation-v6-arrow + em { font-style:normal; color:#000; }
.rotation-v6-matrix { width:100%; height:100%; border-collapse:collapse; table-layout:fixed; color:#000; font-family:KaiTi,Arial,sans-serif; }
.rotation-v6-matrix th { border:1px solid #fff; padding:8px 6px; background:#8b1f14; color:#fff; font-size:12px; font-weight:700; }
.rotation-v6-matrix td { min-height:96px; border:1px solid #fff; padding:9px 8px; background:#fff; vertical-align:top; }
.rotation-v6-matrix tbody tr:nth-child(1) td:nth-child(4),
.rotation-v6-matrix tbody tr:nth-child(1) td:nth-child(3),
.rotation-v6-matrix tbody tr:nth-child(2) td:nth-child(4) { background:#f8e8d8; }
.rotation-v6-matrix tbody tr:nth-child(3) td:nth-child(2),
.rotation-v6-matrix tbody tr:nth-child(3) td:nth-child(3) { background:#e8eef6; }
.rotation-v6-matrix td strong { display:block; color:#000; font-size:12px; line-height:1.45; font-weight:700; }
.rotation-v6-matrix td span { display:block; margin-top:5px; color:#667085; font:400 10px/1.35 Arial,KaiTi,sans-serif; }
.rotation-v6-final { margin:0 0 18px; padding:12px; }
.rotation-v6-final .rotation-result-pair { grid-template-columns: minmax(300px, .9fr) minmax(480px, 1.45fr); }
.rotation-v6-result-table {
  min-width: 0;
  max-height: 350px;
  border: 1px solid #eceff3;
  border-radius: 6px;
  background: #fff;
}
.rotation-v6-result-table .data-table {
  min-width: 0;
  table-layout: fixed;
}
.rotation-v6-result-table .data-table th,
.rotation-v6-result-table .data-table td {
  white-space: nowrap;
}
.rotation-v6 .rotation-status-card { border-top-color:#c00000; background:#fff; }
.rotation-v6 .rotation-status-card.pass { border-top-color:#168a47; }
.rotation-v6 .rotation-status-card.review { border-top-color:#ffc000; background:#fff; }
.rotation-v6 .rotation-status-card strong,
.rotation-v6 .rotation-status-card small,
.rotation-v6 .rotation-status-card p { color:#000; }
.rotation-v6 .rotation-plot { min-height: 360px; }
.rotation-v6 .rotation-chart-grid { align-items: stretch; }
.rotation-v6 .rotation-chart-grid .wide { grid-column: 1 / -1; }
@media (max-width: 1280px) {
  .rotation-v6-flow-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rotation-v6-step-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .rotation-v6-flow-row, .rotation-v6-step-grid { grid-template-columns: 1fr; }
  .rotation-v6-final .rotation-result-pair { grid-template-columns: 1fr; }
}
