.theme-center {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.theme-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.theme-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary, #64748b);
}

.theme-control input,
.theme-control select {
    padding: 6px 10px;
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 8px;
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #0f172a);
    font-size: 13px;
}

.theme-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 8px;
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #0f172a);
    font-size: 13px;
    cursor: pointer;
}

.theme-btn:hover {
    border-color: var(--accent, #1576e8);
    color: var(--accent, #1576e8);
}

#theme-center-directory {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#theme-center-directory .theme-pattern-panel {
    margin: 0;
}

.theme-detail-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 详情页顶栏：左侧返回、右侧身份，做成一条整体的导航条。 */
.theme-detail-page-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    padding: 10px 14px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: var(--card-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.theme-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    appearance: none;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    color: var(--text-secondary, #475569);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.theme-detail-back:hover {
    border-color: var(--accent, #1576e8);
    color: var(--accent, #1576e8);
    background: var(--accent-soft, #eff6ff);
}

.theme-detail-back-arrow {
    font-size: 14px;
    line-height: 1;
}

.theme-detail-page-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.theme-detail-page-eyebrow {
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #94a3b8);
}

.theme-detail-page-title-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.theme-detail-page-title {
    color: var(--text-primary, #0f172a);
    font-size: 16px;
    font-weight: 600;
}

.theme-detail-page-caption {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 16px;
    color: var(--text-secondary, #64748b);
    font-size: 12px;
}

.theme-detail-page-caption code {
    font-size: 12px;
}

.theme-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.theme-summary-card {
    appearance: none;
    width: 100%;
    text-align: left;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: var(--card-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.theme-summary-card:hover,
.theme-summary-card:focus-visible,
.theme-summary-card.active {
    border-color: var(--accent, #1576e8);
    background: var(--accent-soft, #eff6ff);
}

.theme-summary-card:focus-visible {
    outline: 2px solid var(--accent, #1576e8);
    outline-offset: 2px;
}

.theme-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.theme-summary-label {
    font-size: 13px;
    color: var(--text-primary, #334155);
    margin-top: 2px;
}

.theme-summary-hint {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    margin-top: 2px;
}

.theme-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    min-width: 0;
    max-width: 100%;
}

.theme-board-panel,
.theme-detail-panel {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--card-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.theme-board-panel,
.theme-detail-panel {
    min-width: 0;
    overflow: hidden;
}

.theme-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.theme-panel-head h3,
.theme-detail-panel h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.theme-board-title,
.theme-detail-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.theme-detail-section-head {
    justify-content: space-between;
    margin-bottom: 8px;
}

.theme-filter-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 5px;
    background: var(--accent-soft, #eff6ff);
    color: var(--accent, #1576e8);
    font-size: 12px;
    white-space: nowrap;
}

.theme-filter-state.hidden {
    display: none;
}

.theme-filter-state button {
    appearance: none;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

.theme-filter-state button:hover,
.theme-filter-state button:focus-visible {
    background: rgba(21, 118, 232, 0.12);
}

.theme-panel-head input {
    padding: 6px 10px;
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 8px;
    background: var(--bg, #f8fafc);
    color: var(--text-primary, #0f172a);
    font-size: 13px;
    width: 220px;
}

.theme-board-wrap {
    overflow-x: auto;
    max-height: 620px;
    overflow-y: auto;
}

.theme-board-note {
    margin: -2px 0 10px;
    padding: 8px 10px;
    border-left: 3px solid var(--accent, #1576e8);
    background: var(--accent-soft, #eff6ff);
    color: var(--text-secondary, #475569);
    font-size: 12px;
    line-height: 1.5;
}

.theme-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.theme-table th,
.theme-table td {
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
}

.theme-table th {
    position: sticky;
    top: 0;
    background: var(--card-bg, #ffffff);
    color: var(--text-secondary, #64748b);
    font-weight: 600;
    z-index: 1;
}

.theme-table th[data-sort-key] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.12s ease, background 0.12s ease;
}

.theme-table th[data-sort-key]:hover {
    color: var(--accent, #1576e8);
    background: var(--hover-bg, #f1f5f9);
}

.theme-table tbody tr {
    cursor: pointer;
    transition: background 0.12s ease;
}

.theme-table tbody tr:hover {
    background: var(--hover-bg, #f1f5f9);
}

.theme-table tbody tr.selected {
    background: var(--accent-soft, #eff6ff);
}

.theme-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.theme-cell-muted {
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
}

.theme-coverage-cell {
    min-width: 72px;
}

.theme-cell-sub {
    display: block;
    color: var(--text-secondary, #94a3b8);
    font-size: 10px;
    line-height: 1.1;
    text-align: right;
}

.theme-table .up {
    color: #dc2626;
}

.theme-table .down {
    color: #16a34a;
}

.theme-name-cell {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.theme-row-link {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--accent, #1576e8);
    font: inherit;
    cursor: pointer;
}

.theme-row-link:hover,
.theme-row-link:focus-visible {
    text-decoration: underline;
}

.theme-row-name {
    color: var(--text-primary, #0f172a);
    font-weight: 600;
}

.theme-pagination {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 6px 10px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    background: var(--card-bg, #ffffff);
    color: var(--text-secondary, #64748b);
    font-size: 12px;
}

.theme-page-btn {
    width: 32px;
    height: 32px;
    margin-left: 6px;
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 6px;
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #0f172a);
    cursor: pointer;
}

.theme-page-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.theme-detail-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* 行业景气详情头部：元信息行 + 统一的"值上/标签下"事实网格（4×2）。 */
.theme-industry-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--text-secondary, #64748b);
}

.theme-industry-meta strong {
    color: var(--text-primary, #0f172a);
    font-weight: 600;
}

.theme-fact-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 18px;
    margin: 0 0 16px;
}

.theme-fact-grid .metric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.theme-fact-grid .metric-label {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.theme-fact-grid .metric-value {
    font-size: 18px;
    white-space: nowrap;
}

.theme-fact-grid .metric-value-sm {
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
}

.theme-fact-grid .metric-label {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.theme-detail-code {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    margin-top: 4px;
}

.theme-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-soft, #eff6ff);
    color: var(--accent, #1576e8);
    font-size: 11px;
}

.theme-prosperity-panel {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--card-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
}

/* Secondary boards collapse into <details> so the daily theme board stays the
   first screen. The summary reuses the panel-head row; the marker shows state. */
details.theme-collapse-panel {
    padding: 0;
}

details.theme-collapse-panel > summary.theme-panel-head {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    margin: 0;
    user-select: none;
}

details.theme-collapse-panel > summary.theme-panel-head::-webkit-details-marker {
    display: none;
}

details.theme-collapse-panel > summary.theme-panel-head::after {
    content: "展开 ▾";
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
    padding-left: 12px;
}

details.theme-collapse-panel[open] > summary.theme-panel-head::after {
    content: "收起 ▴";
}

details.theme-collapse-panel > summary.theme-panel-head h3 {
    margin: 0;
}

details.theme-collapse-panel > .theme-board-wrap,
details.theme-collapse-panel > .theme-panel-head.theme-pattern-subhead {
    margin: 0 16px 16px;
}

details.theme-collapse-panel > .theme-panel-head.theme-pattern-subhead {
    padding: 0;
    cursor: default;
}

details.theme-collapse-panel > summary.theme-panel-head .theme-controls {
    cursor: default;
}

/* Structural warnings (proxy-model caveats) collapse instead of flooding the
   alert strip; only same-day incidents stay expanded. */
.market-alert-structural {
    margin-top: 4px;
    opacity: 0.85;
}

.market-alert-structural summary {
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}

.market-alert-structural[open] summary {
    margin-bottom: 4px;
}

.market-alert-structural > div {
    padding: 2px 0 2px 12px;
}

/* Directory section nav (景气度/拥挤度/题材模式) + provider switch. */
.theme-section-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 4px;
    padding: 6px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
}

.theme-section-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}

.theme-section-btn:hover {
    color: var(--accent, #1576e8);
    background: var(--accent-soft, #eff6ff);
}

.theme-section-btn.active {
    background: var(--accent-soft, #eff6ff);
    border-color: var(--accent, #1576e8);
    color: var(--accent, #1576e8);
    font-weight: 600;
}

.theme-section-divider {
    width: 1px;
    height: 18px;
    background: var(--border-color, #e2e8f0);
    margin: 0 6px;
}

/* 口径切换固定在该行最右侧，与左侧栏目分组拉开距离。 */
.theme-provider-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding-left: 12px;
    border-left: 1px solid var(--border-color, #e2e8f0);
}

.theme-provider-label {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    margin-right: 2px;
    white-space: nowrap;
}

.theme-provider-note {
    margin: 8px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--accent, #1576e8);
    background: var(--accent-soft, #eff6ff);
    color: var(--text-secondary, #334155);
    font-size: 13px;
    border-radius: 4px;
}

.theme-provider-note.hidden {
    display: none;
}

.theme-tdx-history {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bg, #f8fafc);
}

.theme-tdx-history.hidden {
    display: none;
}

/* TDX board detail: embedded candlestick chart + derived table. */
.theme-tdx-kline-note {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    margin: 6px 0;
}

.theme-tdx-kline {
    min-height: 320px;
    margin-bottom: 8px;
}

/* Crowding analytics grid (拥挤度栏目四图). */
.theme-crowding-method {
    margin: 0 0 12px;
}

.theme-crowding-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.theme-crowding-chart-cell {
    min-width: 0;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--bg, #f8fafc);
}

.theme-crowding-chart-cell h4 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.theme-crowding-chart {
    min-height: 260px;
}

@media (max-width: 1100px) {
    .theme-crowding-charts {
        grid-template-columns: minmax(0, 1fr);
    }
}

#theme-crowding-theme {
    width: 260px;
}

.theme-prosperity-meta {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    margin-bottom: 8px;
}

.theme-constituent-meta {
    margin: 4px 0 8px;
    color: var(--text-secondary, #64748b);
    font-size: 12px;
}

.theme-constituent-table {
    min-width: 760px;
}

.theme-badge.stage-accelerating,
.theme-badge.stage-recovering {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.theme-badge.stage-peaking {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.theme-badge.stage-declining {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.theme-badge.stage-stabilizing {
    background: rgba(21, 118, 232, 0.12);
    color: #0b5fd0;
}

.theme-badge.stage-early_observation {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.theme-badge.stage-unknown {
    background: rgba(148, 163, 184, 0.16);
    color: #64748b;
}

.theme-badge.q-high_rising {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.theme-badge.q-high_falling {
    background: rgba(217, 119, 6, 0.14);
    color: #b45309;
}

.theme-badge.q-low_rising {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.theme-badge.q-low_falling,
.theme-badge.q-unavailable {
    background: rgba(148, 163, 184, 0.16);
    color: #64748b;
}

.theme-detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 16px;
    flex: 1 1 360px;
    min-width: 0;
}

.theme-detail-metrics .metric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.metric-value.up {
    color: #dc2626;
}

.metric-value.down {
    color: #16a34a;
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.theme-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 16px;
    margin: 0 0 14px;
}

.theme-evolution-head {
    align-items: flex-start;
}

.theme-detail-subtitle {
    margin-top: 4px;
    color: var(--text-secondary, #64748b);
    font-size: 12px;
    line-height: 1.5;
}

.theme-evidence-health {
    margin: 14px 0;
    border-top: 1px solid var(--border-color, #e2e8f0);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    padding: 10px 0;
}

.theme-evidence-health-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-primary, #0f172a);
    font-size: 13px;
    line-height: 1.45;
}

.theme-evidence-health-head span {
    color: var(--text-secondary, #64748b);
    font-size: 12px;
    text-align: right;
}

.theme-evidence-axis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.theme-evidence-axis-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    background: var(--card-bg, #ffffff);
}

.theme-evidence-axis-name {
    min-width: 0;
    color: var(--text-primary, #0f172a);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-evidence-axis-score {
    color: var(--text-secondary, #64748b);
    font-size: 12px;
}

.theme-evidence-axis-status {
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 600;
}

.theme-evidence-axis-status.confirmed {
    color: #047857;
}

.theme-evidence-axis-status.observing,
.theme-evidence-axis-status.proxy {
    color: #1576e8;
}

.theme-evidence-axis-status.missing {
    color: #b45309;
}

.theme-evidence-summary {
    display: inline-block;
    color: #1576e8;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.theme-evidence-summary.missing {
    color: #b45309;
}

.theme-evolution-guidance {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 10px;
}

.theme-evolution-guidance div {
    min-width: 0;
    border-left: 2px solid var(--border-color, #e2e8f0);
    padding-left: 9px;
}

.theme-evolution-guidance strong {
    color: var(--text-primary, #0f172a);
    font-size: 12px;
}

.theme-evolution-guidance p {
    margin: 4px 0 0;
    color: var(--text-secondary, #64748b);
    font-size: 12px;
    line-height: 1.55;
}

.theme-badge.execution-observe,
.theme-badge.qualification-insufficient_evidence {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.theme-badge.execution-normal,
.theme-badge.state-earnings_confirmed,
.theme-badge.state-expectation_forming {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.theme-badge.execution-reduce_new_exposure,
.theme-badge.execution-reduce_exposure,
.theme-badge.state-high_growth_digesting,
.theme-badge.state-turning_down {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.theme-badge.execution-risk_off,
.theme-badge.state-invalidated {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.theme-detail-grid div {
    min-width: 0;
}

.theme-detail-grid dt {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.theme-detail-grid dd {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--text-primary, #0f172a);
    word-break: break-all;
}

.theme-chart-wrap {
    margin-top: 8px;
    max-width: 100%;
    overflow-x: auto;
}

/* 详情页下方的长表格容器：固定高度 + 滚动条，避免撑长整个页面 */
.theme-detail-panel .theme-chart-wrap {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}

.theme-detail-panel .theme-chart-wrap canvas {
    height: 300px;
    max-height: 320px;
}

.theme-chart-panel {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--card-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
    min-width: 0;
}

.theme-chart-panel .theme-panel-head {
    flex-wrap: wrap;
}

.theme-chart-group-label {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.theme-chart-group-divider {
    width: 1px;
    height: 18px;
    background: var(--border-color, #e2e8f0);
}

.theme-candlestick-chart {
    width: 100%;
    height: 430px;
    min-height: 0;
}

.theme-volume-chart-wrap {
    position: relative;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color, #eef2f7);
}

.theme-volume-chart-wrap.hidden {
    display: none;
}

.theme-volume-chart-label {
    position: absolute;
    top: 8px;
    left: 10px;
    z-index: 1;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-secondary, #94a3b8);
    font-size: 11px;
    line-height: 1.4;
    pointer-events: none;
}

.theme-volume-chart {
    width: 100%;
    height: 160px;
    min-height: 160px;
}

.theme-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    font-size: 13px;
}

.theme-chart-wrap.hidden {
    display: none;
}

.theme-table-scroll {
    overflow-x: auto;
}

.theme-archive-table tbody tr {
    cursor: default;
}

.theme-archive-title {
    min-width: 240px;
    max-width: 560px;
    white-space: normal;
    line-height: 1.5;
}

.theme-archive-open {
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
}

.theme-archive-original {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.theme-archive-summary {
    margin: 8px 0;
    color: var(--text-secondary, #475569);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.theme-archive-content {
    max-height: 460px;
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e2e8f0);
}

@media (max-width: 1100px) {
    .theme-main-grid {
        grid-template-columns: 1fr;
    }
}

.theme-pattern-panel {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    box-shadow: var(--card-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.theme-pattern-subhead h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
}

.theme-badge.pattern-ladder_escalation,
.theme-badge.pattern-dragon_head {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.theme-badge.pattern-ignition,
.theme-badge.pattern-first_board {
    background: rgba(249, 115, 22, 0.14);
    color: #c2410c;
}

.theme-badge.pattern-hot_money,
.theme-badge.pattern-lhb_heat {
    background: rgba(21, 118, 232, 0.14);
    color: #0b5fd0;
}

.theme-badge.pattern-second_wave,
.theme-badge.pattern-climax {
    background: rgba(220, 38, 38, 0.18);
    color: #991b1b;
}

.theme-badge.pattern-divergence {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.theme-badge.pattern-retreat {
    background: rgba(100, 116, 139, 0.16);
    color: #475569;
}

.theme-badge.pattern-flow_in {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.theme-badge.pattern-quiet {
    background: rgba(148, 163, 184, 0.16);
    color: #64748b;
}

.theme-help {
    margin-bottom: 2px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--card-bg, #ffffff);
}

.theme-help summary {
    cursor: pointer;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent, #1576e8);
    list-style: none;
}

.theme-help summary::-webkit-details-marker {
    display: none;
}

.theme-help summary::before {
    content: ' ';
}

.theme-help[open] summary::before {
    content: ' ';
}

.theme-help-body {
    padding: 0 14px 12px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text-secondary, #475569);
}

.theme-help-body h4 {
    margin: 10px 0 4px;
    font-size: 12.5px;
    color: var(--text-primary, #0f172a);
}

.theme-help-body ul {
    margin: 4px 0 8px;
    padding-left: 18px;
}

.theme-chart-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 4px;
}

.theme-chart-btn {
    padding: 4px 10px;
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 6px;
    background: var(--card-bg, #ffffff);
    color: var(--text-secondary, #64748b);
    font-size: 12px;
    cursor: pointer;
}

.theme-chart-btn.active {
    border-color: var(--accent, #1576e8);
    color: var(--accent, #1576e8);
    background: var(--accent-soft, #eff6ff);
}

.theme-chart-tip {
    min-width: 160px;
    padding: 9px 11px;
    font-size: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.theme-chart-tip-date {
    margin-bottom: 4px;
    font-weight: 600;
}

.theme-chart-tip-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.theme-chart-tip-row span {
    color: #94a3b8;
}

.theme-chart-tip-row b {
    font-variant-numeric: tabular-nums;
}

.theme-chart-tip-row b.up {
    color: #dc2626;
}

.theme-chart-tip-row b.down {
    color: #16a34a;
}

.theme-chart-panel .apexcharts-canvas {
    margin: 0 auto;
}

.theme-chart-panel .apexcharts-toolbar {
    top: 0 !important;
    right: 4px !important;
}

.theme-chart-panel .apexcharts-toolbar svg {
    width: 14px;
    height: 14px;
}

.theme-chart-panel .apexcharts-tooltip {
    border: 0;
    background: transparent;
    box-shadow: none;
}
.theme-chart-head {
    margin: 2px 0 6px;
    font-size: 12px;
    color: var(--text-secondary, #64748b);
}
.theme-hermes-unavailable {
    margin: 10px 0 4px;
    padding: 14px;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
    border-radius: 7px;
    background: #fffbeb;
}

.theme-hermes-unavailable strong {
    color: #92400e;
    font-size: 15px;
}

.theme-hermes-unavailable p {
    margin: 7px 0 0;
    color: #78350f;
    font-size: 13px;
    line-height: 1.65;
}

.theme-hermes-unavailable ul {
    margin: 8px 0 0;
    padding-left: 18px;
    color: #92400e;
    font-size: 12px;
    line-height: 1.7;
}

.theme-hermes-unavailable-next {
    color: #a16207 !important;
}
.theme-hermes-verdict {
    margin: 10px 0 12px;
    padding: 13px 14px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-left: 4px solid #94a3b8;
    border-radius: 7px;
    background: #f8fafc;
}

.theme-hermes-verdict.status-observe_only,
.theme-hermes-verdict.status-needs_review {
    border-left-color: #d97706;
    background: #fffbeb;
}

.theme-hermes-verdict.status-hypothesis_ready {
    border-left-color: #059669;
    background: #ecfdf5;
}

.theme-hermes-verdict.status-blocked {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.theme-hermes-verdict-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.theme-hermes-verdict-head span,
.theme-hermes-guidance strong,
.theme-hermes-insight strong {
    color: var(--text-secondary, #64748b);
    font-size: 12px;
}

.theme-hermes-verdict-head strong {
    color: var(--text-primary, #0f172a);
    font-size: 17px;
}

.theme-hermes-verdict p,
.theme-hermes-insight p {
    margin: 6px 0 0;
    color: var(--text-primary, #334155);
    font-size: 13px;
    line-height: 1.65;
}

.theme-hermes-memo {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #1576e8;
    border-radius: 7px;
    background: #f8fbff;
}

.theme-hermes-memo-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.theme-hermes-memo-head span {
    color: #64748b;
    font-size: 12px;
}

.theme-hermes-memo-head strong {
    min-width: 0;
    color: #1e3a8a;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.theme-hermes-memo p {
    margin: 7px 0 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.65;
}

.theme-hermes-memo b {
    color: #1e3a8a;
    font-weight: 600;
}

.theme-hermes-memo .theme-hermes-list {
    margin-top: 4px;
}
.theme-hermes-insight,
.theme-hermes-observation {
    margin: 0 0 12px;
    padding: 9px 11px;
    border-radius: 6px;
    background: var(--accent-soft, #eff6ff);
    color: var(--text-secondary, #475569);
    font-size: 12px;
    line-height: 1.6;
}

.theme-hermes-guidance {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    margin: 0 0 12px;
}

.theme-hermes-guidance section {
    min-width: 0;
    padding: 0 0 0 10px;
    border-left: 2px solid var(--border-color, #e2e8f0);
    overflow-wrap: anywhere;
}

.theme-hermes-list {
    margin: 5px 0 0;
    padding-left: 16px;
    color: var(--text-secondary, #475569);
    font-size: 12px;
    line-height: 1.6;
}

.theme-hermes-list li + li {
    margin-top: 4px;
}

.theme-hermes-boundary {
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding-top: 9px;
    color: var(--text-secondary, #64748b);
    font-size: 12px;
    line-height: 1.6;
}

.theme-hermes-boundary summary {
    cursor: pointer;
    color: var(--text-secondary, #475569);
}

.theme-hermes-boundary ul {
    margin: 7px 0 0;
    padding-left: 17px;
}

@media (max-width: 720px) {
    .theme-hermes-guidance {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .theme-hermes-memo {
        padding: 11px 12px;
    }

    .theme-hermes-memo-head strong {
        flex: 1 1 100%;
        font-size: 14px;
    }
}
@media (max-width: 720px) {
    .theme-center {
        gap: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .theme-controls,
    .theme-control {
        width: 100%;
    }

    .theme-control input,
    .theme-control select,
    .theme-panel-head input {
        width: 100%;
        min-width: 0;
    }

    .theme-panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-detail-page-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    /* 窄屏下报告期下拉改为整行，避免长摘要把指标挤出可视区。 */
    .theme-period-picker {
        margin-left: 0;
        width: 100%;
    }

    .theme-period-summary {
        width: 100%;
        max-width: none;
        justify-content: space-between;
    }

    .theme-period-menu {
        right: auto;
        left: 0;
        max-width: 100%;
    }

    .theme-detail-metrics {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 10px;
    }

    /* 窄屏下行业事实网格降为两列。 */
    .theme-fact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .theme-evidence-health-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .theme-evidence-health-head span {
        text-align: left;
    }

    .theme-evidence-axis,
    .theme-evolution-guidance {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .theme-detail-metrics .metric {
        align-items: flex-start;
    }

    .theme-board-panel,
    .theme-detail-panel,
    .theme-prosperity-panel,
    .theme-pattern-panel {
        padding: 12px;
    }

    .theme-candlestick-chart {
        height: 360px;
    }

    .theme-volume-chart {
        height: 132px;
        min-height: 132px;
    }

    .theme-chart-toolbar {
        gap: 6px;
    }

    .theme-chart-btn {
        padding: 5px 8px;
    }
}

/* 加载状态旋转指示器（仅题材研究作用域） */
.theme-center .market-state-badge.loading::before {
    content: '';
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 6px;
    border: 2px solid var(--text-secondary, #64748b);
    border-top-color: transparent;
    border-radius: 50%;
    animation: theme-center-badge-spin 0.7s linear infinite;
    flex: 0 0 auto;
}

@keyframes theme-center-badge-spin {
    to { transform: rotate(360deg); }
}

/* 成分股与财务：指标单选 + 报告期下拉（同一行，报告期靠右） */
.theme-constituent-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 12px;
    padding: 10px 12px;
    background: var(--market-panel-muted, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
}

.theme-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.theme-control-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.theme-control-label {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    font-weight: 600;
    margin-right: 4px;
}

/* 报告期下拉：收起时只显示已选摘要，展开后是多选面板。 */
.theme-period-picker {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}

.theme-period-picker[open] {
    z-index: 20;
}

.theme-period-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 6px;
    cursor: pointer;
    list-style: none;
    max-width: 420px;
}

.theme-period-summary::-webkit-details-marker {
    display: none;
}

.theme-period-summary:hover {
    border-color: var(--accent, #1576e8);
}

.theme-period-summary-value {
    font-size: 12px;
    color: var(--text-primary, #0f172a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-period-caret {
    font-size: 10px;
    color: var(--text-secondary, #94a3b8);
}

.theme-period-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 30;
    min-width: 260px;
    max-width: min(440px, 88vw);
    padding: 10px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.theme-period-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--text-secondary, #94a3b8);
}

.theme-period-reset {
    appearance: none;
    padding: 2px 8px;
    background: transparent;
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 4px;
    color: var(--text-secondary, #64748b);
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.theme-period-reset:hover {
    border-color: var(--accent, #1576e8);
    color: var(--accent, #1576e8);
}

.theme-period-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}

.theme-period-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 5px;
    font-size: 12px;
    color: var(--text-primary, #0f172a);
    cursor: pointer;
    user-select: none;
}

.theme-period-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent, #1576e8);
}

.theme-period-option:has(input:checked) {
    background: var(--accent-soft, #eff6ff);
    border-color: var(--accent, #1576e8);
    color: var(--accent, #1576e8);
}

.theme-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-primary, #0f172a);
    cursor: pointer;
    user-select: none;
}

.theme-chip input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.theme-chip:has(input:checked) {
    background: var(--accent-soft, #eff6ff);
    border-color: var(--accent, #1576e8);
    color: var(--accent, #1576e8);
}

/* 单选 chip：圆点代替方框 */
.theme-chip-radio input[type="radio"] {
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent, #1576e8);
}

.theme-chip-radio:has(input:checked) {
    background: var(--accent, #1576e8);
    border-color: var(--accent, #1576e8);
    color: #ffffff;
}

/* 列转置：让很多列的报告期表头紧凑 */
.theme-constituent-table thead th[num] {
    writing-mode: horizontal-tb;
    font-size: 12px;
    padding: 8px 6px;
    white-space: nowrap;
}

.theme-constituent-table tbody td[num] {
    padding: 6px 8px;
    white-space: nowrap;
}

/* 可排序表头 */
.theme-sort-th {
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease, color 0.12s ease;
}

.theme-sort-th:hover {
    background: var(--accent-soft, #eff6ff);
    color: var(--accent, #1576e8);
}

/* 成分股与财务表格行分组 + 滚动容器 */
.theme-table-scroll {
    overflow-x: auto;
    max-width: 100%;
}

.theme-table-scroll .theme-table {
    min-width: 720px;
}

.theme-table tbody tr td.theme-symbol {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
}

/* ---- 景气度栏目 v2:总览仪表盘 / 信号卡 / 日历条 ---- */
/* 产品裁剪:页头下沿空带(padding+border 形成的空白条)与 KPI 数字卡区不再展示。 */
.theme-center .page-header {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 8px;
}
#theme-center-summary { display: none; }
.theme-prosperity-overview { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; padding: 4px 8px 12px; }
.theme-disclosure-calendar h4 { margin: 4px 0 8px; font-size: 13px; color: #64748b; }
.theme-calendar-entry { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 12.5px; }
.theme-calendar-entry strong { font-size: 13px; }
.theme-calendar-entry.mode-reality { background: rgba(21, 118, 232, 0.08); border-left: 3px solid #1576e8; }
.theme-calendar-entry.mode-theme { background: rgba(217, 119, 6, 0.10); border-left: 3px solid #d97706; }
.theme-calendar-entry.mode-neutral { background: rgba(100, 116, 139, 0.08); border-left: 3px solid #94a3b8; }
.theme-prosperity-signals { padding: 4px 8px 12px; }
.theme-signal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.theme-signal-card { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 12px; overflow: auto; }
.theme-signal-card h4 { margin: 0 0 4px; font-size: 13.5px; }
.theme-signal-note { margin: 0 0 8px; font-size: 12px; color: #64748b; }
.theme-matrix-chart { min-height: 320px; }
.theme-prosperity-overview .theme-crowding-chart { min-height: 240px; }
@media (max-width: 960px) { .theme-prosperity-overview { grid-template-columns: 1fr; } }
.muted { color: #94a3b8; }

/* =============================================================
   暗色模式收口：以下规则里的浅色底是写死的，令牌覆盖不到它们。
   统一改成深底 + 提亮的前景色，避免暗色主题里出现白块。
   ============================================================= */

[data-theme="dark"] .theme-volume-chart-label {
    background: rgba(15, 23, 42, 0.78);
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .theme-chart-tip {
    background: var(--card-bg, #1e293b);
    border-color: var(--border-color, #334155);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .theme-hermes-unavailable {
    border-color: rgba(245, 158, 11, 0.4);
    border-left-color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
}

[data-theme="dark"] .theme-hermes-unavailable strong,
[data-theme="dark"] .theme-hermes-unavailable ul {
    color: #fbbf24;
}

[data-theme="dark"] .theme-hermes-unavailable p {
    color: #fcd34d;
}

[data-theme="dark"] .theme-hermes-unavailable-next {
    color: #fbbf24 !important;
}

[data-theme="dark"] .theme-hermes-verdict {
    background: var(--bg-subtle, #1e293b);
}

[data-theme="dark"] .theme-hermes-verdict.status-observe_only,
[data-theme="dark"] .theme-hermes-verdict.status-needs_review {
    background: rgba(245, 158, 11, 0.12);
}

[data-theme="dark"] .theme-hermes-verdict.status-hypothesis_ready {
    background: rgba(16, 185, 129, 0.12);
}

[data-theme="dark"] .theme-hermes-verdict.status-blocked {
    background: rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] .theme-hermes-memo {
    border-color: rgba(21, 118, 232, 0.45);
    background: rgba(21, 118, 232, 0.10);
}

[data-theme="dark"] .theme-hermes-memo-head strong,
[data-theme="dark"] .theme-hermes-memo b {
    color: #9ccbfa;
}

[data-theme="dark"] .theme-hermes-memo p {
    color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] .theme-signal-card {
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .theme-hermes-memo-head span,
[data-theme="dark"] .theme-disclosure-calendar h4,
[data-theme="dark"] .theme-signal-note {
    color: var(--text-secondary, #cbd5e1);
}

/* 状态徽标：浅底上的深色前景在暗色里读不出来，统一提亮到 300/400 档。 */
[data-theme="dark"] .theme-badge.stage-accelerating,
[data-theme="dark"] .theme-badge.stage-recovering,
[data-theme="dark"] .theme-badge.q-low_rising,
[data-theme="dark"] .theme-badge.execution-normal,
[data-theme="dark"] .theme-badge.state-earnings_confirmed,
[data-theme="dark"] .theme-badge.state-expectation_forming,
[data-theme="dark"] .theme-badge.pattern-flow_in,
[data-theme="dark"] .theme-evidence-axis-status.confirmed {
    color: #34d399;
}

[data-theme="dark"] .theme-badge.stage-peaking,
[data-theme="dark"] .theme-badge.q-high_falling,
[data-theme="dark"] .theme-badge.execution-observe,
[data-theme="dark"] .theme-badge.qualification-insufficient_evidence,
[data-theme="dark"] .theme-badge.execution-reduce_new_exposure,
[data-theme="dark"] .theme-badge.execution-reduce_exposure,
[data-theme="dark"] .theme-badge.state-high_growth_digesting,
[data-theme="dark"] .theme-badge.state-turning_down,
[data-theme="dark"] .theme-badge.pattern-divergence,
[data-theme="dark"] .theme-evidence-axis-status.missing,
[data-theme="dark"] .theme-evidence-summary.missing {
    color: #fbbf24;
}

[data-theme="dark"] .theme-badge.stage-declining,
[data-theme="dark"] .theme-badge.q-high_rising,
[data-theme="dark"] .theme-badge.execution-risk_off,
[data-theme="dark"] .theme-badge.state-invalidated,
[data-theme="dark"] .theme-badge.pattern-ladder_escalation,
[data-theme="dark"] .theme-badge.pattern-dragon_head,
[data-theme="dark"] .theme-badge.pattern-second_wave,
[data-theme="dark"] .theme-badge.pattern-climax {
    color: #fb7185;
}

[data-theme="dark"] .theme-badge.stage-stabilizing,
[data-theme="dark"] .theme-badge.pattern-hot_money,
[data-theme="dark"] .theme-badge.pattern-lhb_heat,
[data-theme="dark"] .theme-badge.stage-early_observation,
[data-theme="dark"] .theme-evidence-axis-status.observing,
[data-theme="dark"] .theme-evidence-axis-status.proxy,
[data-theme="dark"] .theme-evidence-summary {
    color: #9ccbfa;
}

[data-theme="dark"] .theme-badge.stage-unknown,
[data-theme="dark"] .theme-badge.q-low_falling,
[data-theme="dark"] .theme-badge.q-unavailable,
[data-theme="dark"] .theme-badge.pattern-retreat,
[data-theme="dark"] .theme-badge.pattern-quiet {
    color: #cbd5e1;
}

[data-theme="dark"] .theme-badge.pattern-ignition,
[data-theme="dark"] .theme-badge.pattern-first_board {
    color: #fb923c;
}
/* ========================================
   P4 暗色补充（2026-10-12）
   本文件在 enhanced.css 之后加载，控件底色必须在这里覆盖。
   ======================================== */

[data-theme="dark"] .theme-control input,
[data-theme="dark"] .theme-control select,
[data-theme="dark"] .theme-panel-head input,
[data-theme="dark"] .theme-control-row input,
[data-theme="dark"] .theme-control-row select {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .theme-btn {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .theme-constituent-controls {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .theme-hermes-verdict {
    background: var(--bg-secondary);
}

/* 选择框自身即 .theme-control（非 label 包裹），需单独命中，否则走浏览器原生白底 */
select.theme-control {
    padding: 6px 10px;
    border: 1px solid var(--border-color, #dbe1ea);
    border-radius: 8px;
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #0f172a);
    font-size: 13px;
}

[data-theme="dark"] select.theme-control {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}
