:root {
    --bg: #f5efe1;
    --panel: rgba(255, 252, 246, 0.84);
    --panel-strong: rgba(255, 250, 242, 0.96);
    --border: rgba(87, 64, 37, 0.14);
    --ink: #1e1c18;
    --muted: #6d6357;
    --brand: #9f4b22;
    --brand-soft: #d6a276;
    --green: #11795a;
    --red: #c44931;
    --gold: #cc9a2d;
    --shadow: 0 18px 40px rgba(86, 62, 31, 0.12);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(214, 162, 118, 0.36), transparent 28%),
        linear-gradient(180deg, #f6f0e6 0%, #f3ebdc 100%);
    color: var(--ink);
}

button,
input,
select {
    font: inherit;
}

.page-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.ambient {
    position: absolute;
    border-radius: 999px;
    filter: blur(22px);
    pointer-events: none;
}

.ambient-a {
    width: 320px;
    height: 320px;
    right: -60px;
    top: 80px;
    background: rgba(159, 75, 34, 0.16);
}

.ambient-b {
    width: 240px;
    height: 240px;
    left: -40px;
    bottom: 180px;
    background: rgba(17, 121, 90, 0.14);
}

.workspace {
    position: relative;
    z-index: 1;
    width: min(1380px, calc(100vw - 48px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.hero,
.control-panel,
.sector-strip-card,
.status-bar,
.chart-card,
.insight-panel,
.settings-sidebar,
.metric-card {
    backdrop-filter: blur(14px);
}

.hero,
.control-panel,
.sector-strip-card,
.status-bar,
.chart-card,
.insight-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 28px 30px;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.hero-action-row {
    display: flex;
    gap: 10px;
}

.hero-action-row form {
    margin: 0;
}

.session-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(28, 93, 77, 0.1);
    color: #184d41;
    font-size: 12px;
    font-weight: 700;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    font-weight: 700;
}

.hero h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.hero-copy {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.ghost-btn,
.primary-btn,
.period-btn {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
    padding: 10px 18px;
    border: 1px solid rgba(87, 64, 37, 0.12);
}

.primary-btn {
    background: linear-gradient(135deg, #b75a2f 0%, #8c3b18 100%);
    color: #fff7ef;
    padding: 14px 22px;
    box-shadow: 0 14px 24px rgba(159, 75, 34, 0.24);
}

.ghost-btn:hover,
.primary-btn:hover,
.period-btn:hover {
    transform: translateY(-1px);
}

.ghost-btn:disabled,
.primary-btn:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
    box-shadow: none;
}

.control-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    margin-top: 20px;
    padding: 22px 24px;
}

.sector-strip-card {
    margin-top: 18px;
    padding: 20px 24px;
}

.section-header.compact {
    align-items: center;
    margin-bottom: 12px;
}

.sector-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sector-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(87, 64, 37, 0.16);
    background: rgba(255, 252, 248, 0.86);
    color: var(--ink);
    cursor: pointer;
}

.sector-chip.active {
    background: rgba(28, 93, 77, 0.12);
    color: #184d41;
    border-color: rgba(28, 93, 77, 0.28);
    font-weight: 700;
}

.sector-chip-count,
.detail-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    background: rgba(159, 75, 34, 0.08);
    color: var(--brand);
    font-size: 12px;
}

.sector-chip-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1;
}

.sector-chip-status.warm {
    background: rgba(28, 93, 77, 0.1);
    color: #184d41;
}

.sector-chip-status.neutral {
    background: rgba(105, 94, 77, 0.08);
    color: var(--muted);
}

.input-label {
    display: inline-block;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 10px;
}

.search-row {
    display: flex;
    gap: 12px;
}

.search-row input,
.sidebar-block select {
    width: 100%;
    border: 1px solid rgba(87, 64, 37, 0.14);
    border-radius: 16px;
    background: var(--panel-strong);
    padding: 14px 16px;
    color: var(--ink);
}

.search-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.hint-chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(159, 75, 34, 0.08);
    color: var(--brand);
    font-size: 12px;
}

.period-panel {
    min-width: 230px;
}

.period-controls {
    display: flex;
    gap: 8px;
}

.period-btn {
    background: rgba(105, 94, 77, 0.08);
    color: var(--ink);
    padding: 12px 18px;
}

.period-btn.active {
    background: #1c5d4d;
    color: #effaf7;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-top: 18px;
    padding: 14px 18px;
    color: var(--muted);
}

.status-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.status-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-meta {
    font-size: 13px;
    text-align: right;
}

.refresh-meta {
    font-size: 13px;
    color: var(--brand);
}

.signal-strip {
    margin-top: 20px;
    padding: 18px 22px;
    border-radius: 18px;
    background: #1f2937;
    color: #e8eef8;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.signal-strip-head,
.signal-strip-body {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.signal-strip-body {
    margin-top: 10px;
}

.signal-strip-main {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-weight: 700;
}

.signal-strip-title {
    font-size: 17px;
}

.signal-strip-position {
    font-size: 24px;
    letter-spacing: -0.04em;
}

.signal-strip-position.tone-bull,
.signal-chip.is-on {
    color: #22c55e;
}

.signal-strip-position.tone-bull-soft {
    color: #4ade80;
}

.signal-strip-position.tone-warm,
.signal-chip.is-warm {
    color: #f4c542;
}

.signal-strip-position.tone-watch {
    color: #fb923c;
}

.signal-strip-position.tone-idle,
.signal-chip.is-off {
    color: #fb7185;
}

.signal-strip-label,
.signal-strip-holding,
.signal-strip-divider,
.signal-strip-group-label,
.signal-strip-date {
    color: #94a3b8;
}

.signal-strip-date {
    margin-left: auto;
    font-size: 12px;
}

.signal-strip-group {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.signal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.market-pulse {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.pulse-card,
.metric-card,
.sector-card {
    background: var(--panel-strong);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.pulse-card-label,
.metric-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.pulse-card-value,
.metric-value {
    margin-top: 12px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.chart-card {
    margin-top: 22px;
    padding: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 18px;
}

.section-header h2 {
    margin: 0;
    font-size: 22px;
}

.section-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.chart-context-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(159, 75, 34, 0.08);
    color: var(--text);
    font-size: 13px;
}

.meta-chip strong {
    color: var(--brand);
}

.full-history-btn {
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
    align-self: center;
}

.chart-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stock-nav-stats {
    margin-bottom: 6px;
}

.stock-nav-stats .timing-stat {
    min-width: 200px;
}

.chart-container {
    width: 100%;
    height: 1060px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.95), rgba(255, 249, 240, 0.86));
    border: 1px solid rgba(87, 64, 37, 0.1);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.metric-delta {
    margin-top: 8px;
    font-size: 13px;
}

.metric-delta.positive {
    color: var(--green);
}

.metric-delta.negative {
    color: var(--red);
}

.insight-panel {
    margin-top: 22px;
    padding: 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.tab-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(105, 94, 77, 0.08);
    cursor: pointer;
}

.tab-btn.active {
    background: rgba(28, 93, 77, 0.12);
    color: #184d41;
    font-weight: 700;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.list-panel {
    display: grid;
    gap: 12px;
}

.event-card {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 252, 248, 0.9);
}

.event-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.event-title {
    font-weight: 700;
}

.event-date {
    color: var(--muted);
    font-size: 13px;
}

.event-summary {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.7;
}

.event-source {
    margin-top: 6px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
}

.tone-bull {
    border-left: 4px solid var(--green);
}

.tone-bear {
    border-left: 4px solid var(--red);
}

.tone-warn,
.tone-calm {
    border-left: 4px solid var(--gold);
}

.tone-note {
    border-left: 4px solid var(--brand-soft);
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 252, 248, 0.88);
}

.panel-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.panel-toolbar h3 {
    margin: 0;
}

.panel-toolbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sector-manager {
    display: grid;
    gap: 16px;
}

.sector-panel,
.detail-card {
    background: rgba(255, 252, 248, 0.9);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    overflow: hidden;
    min-width: 0;
}

.sector-panel.hidden,
.hidden {
    display: none !important;
}

.sector-flow-card {
    margin-top: 16px;
    padding: 14px 16px 10px;
    background: rgba(255, 252, 248, 0.9);
    border: 1px solid var(--border);
    border-radius: 16px;
    min-width: 0;
}

.sector-flow-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.sector-flow-head h4 {
    margin: 0;
    font-size: 15px;
    color: var(--ink);
}

.sector-flow-chart {
    width: 100%;
    height: 440px;
}

.sector-index-chart {
    height: 400px;
}

.inline-notice {
    min-height: 20px;
    font-size: 13px;
    color: var(--muted);
}

.inline-notice.success {
    color: var(--green);
}

.inline-notice.error {
    color: var(--red);
}

.inline-notice.warn {
    color: var(--gold);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.manual-member-fields {
    margin-top: 16px;
}

.manual-member-extra {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.form-grid label,
.import-pane,
#sectorEditPanel {
    display: grid;
    gap: 8px;
}

.form-grid span {
    color: var(--muted);
    font-size: 13px;
}

.form-grid input,
.form-grid select,
.import-pane textarea,
.import-pane input[type="file"],
#sectorEditPanel textarea {
    width: 100%;
    border: 1px solid rgba(87, 64, 37, 0.14);
    border-radius: 16px;
    background: var(--panel-strong);
    padding: 14px 16px;
    color: var(--ink);
}

.mini-tabs {
    display: flex;
    gap: 10px;
}

.mini-tab {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: rgba(105, 94, 77, 0.08);
    cursor: pointer;
}

.mini-tab.active {
    background: rgba(28, 93, 77, 0.12);
    color: #184d41;
    font-weight: 700;
}

.import-pane {
    display: none;
}

.import-pane.active {
    display: grid;
}

.panel-tip,
.muted-line {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.detail-head,
.detail-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

.detail-head h3,
.detail-card-head h4 {
    margin: 0;
}

.detail-card-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.detail-card-title .muted-line {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.detail-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sector-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.sector-action-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 8px 0 16px;
    padding: 14px 16px;
    border: 1px solid rgba(87, 64, 37, 0.1);
    border-radius: 16px;
    background: rgba(255, 252, 248, 0.72);
}

.sector-mode-copy {
    min-width: 0;
}

.sector-mode-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.mode-btn.active {
    background: rgba(159, 75, 34, 0.12);
    border-color: rgba(159, 75, 34, 0.2);
    color: var(--brand);
}

.compact-select,
.compact-input {
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 252, 248, 0.96);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
}

.compact-input {
    min-width: 168px;
}

.summary-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 252, 248, 0.84);
    padding: 14px 16px;
}

.summary-card.is-hold {
    border-color: rgba(49, 133, 87, 0.34);
    background: rgba(239, 249, 243, 0.9);
}

.summary-card.is-empty {
    border-color: rgba(181, 78, 56, 0.24);
    background: rgba(255, 247, 244, 0.9);
}

.summary-card.is-muted {
    opacity: 0.78;
}

.summary-label {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-value {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 700;
}

.summary-caption {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.wide-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.wide-table-wrap .data-table {
    width: max-content;
    min-width: 100%;
}

.wide-table-wrap .data-table th,
.wide-table-wrap .data-table td {
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wide-table-wrap .data-table td[title] {
    cursor: help;
}

/* 表头的筛选下拉（.filter-menu，absolute 定位）从 th 内弹出，
   上面 th 的 overflow:hidden 会把菜单裁成一条缝；省略号截断只留给 td */
.wide-table-wrap .data-table thead th {
    overflow: visible;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(87, 64, 37, 0.08);
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

.data-table thead th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    position: relative;
}

.sortable-th:hover,
.sortable-th.is-sorted {
    color: var(--brand);
}

.sortable-th.tone-smd,
.sortable-th.tone-smd:hover,
.sortable-th.tone-smd.is-sorted {
    color: #8f3fb4;
    font-weight: 800;
}

.sortable-th.tone-rdr,
.sortable-th.tone-rdr:hover,
.sortable-th.tone-rdr.is-sorted {
    color: #9b5b14;
    font-weight: 800;
}

.sortable-th.tone-cft,
.sortable-th.tone-cft:hover,
.sortable-th.tone-cft.is-sorted {
    color: #1d7f5d;
    font-weight: 800;
}

.header-label {
    display: inline-flex;
    align-items: center;
}

.sort-caret {
    margin-left: 6px;
    font-size: 11px;
    opacity: 0.75;
}

.filter-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

.filter-trigger {
    border: 1px solid rgba(87, 64, 37, 0.12);
    background: rgba(255, 252, 248, 0.95);
    color: var(--muted);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.5;
    cursor: pointer;
}

.filter-trigger.is-active {
    color: var(--brand);
    border-color: rgba(159, 75, 34, 0.24);
    background: rgba(159, 75, 34, 0.08);
}

.filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 96px;
    display: grid;
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 252, 248, 0.98);
    box-shadow: 0 16px 30px rgba(86, 62, 31, 0.12);
    z-index: 4;
}

.filter-option {
    border: 0;
    background: transparent;
    text-align: left;
    padding: 6px 8px;
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    cursor: pointer;
}

.filter-option:hover {
    background: rgba(159, 75, 34, 0.08);
}

.score-pill,
.state-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

.score-pill {
    background: rgba(159, 75, 34, 0.1);
    color: var(--brand);
}

.state-pill.state-hold {
    background: rgba(17, 121, 90, 0.12);
    color: var(--green);
}

.state-pill.state-empty {
    background: rgba(196, 73, 49, 0.12);
    color: var(--red);
}

.state-pill.state-t1 {
    background: rgba(17, 121, 90, 0.15);
    color: var(--green);
    font-weight: 800;
}

.state-pill.state-setup {
    background: rgba(200, 140, 30, 0.15);
    color: #b8860b;
}

.state-pill.state-trend {
    background: rgba(56, 120, 200, 0.12);
    color: #2a6bc4;
}

.state-pill.state-neutral {
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-muted);
}

.row-t1 {
    background: rgba(17, 121, 90, 0.04);
}

.jump-row {
    cursor: pointer;
    transition: background 0.1s;
}

.jump-row:hover {
    background: rgba(17, 121, 90, 0.05);
}

.check-ok {
    color: var(--green);
    font-size: 16px;
    font-weight: 700;
}

.check-no {
    color: var(--red);
    font-size: 14px;
    opacity: 0.6;
}

.dist-pos {
    color: var(--green);
}

.dist-neg {
    color: var(--red);
}

/* 策略切换 */
.strategy-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    flex-shrink: 0;
}

.strategy-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}

.strategy-btn:hover {
    color: var(--text);
    background: rgba(159, 75, 34, 0.06);
}

.strategy-btn.active {
    background: var(--brand);
    color: #fff;
}

.sector-row {
    transition: background 120ms ease;
}

.sector-row:hover {
    background: rgba(159, 75, 34, 0.04);
}

.sector-row.watchlist-mode {
    cursor: pointer;
}

.jump-cell {
    cursor: pointer;
    font-weight: 600;
}

.jump-cell:hover {
    color: var(--brand);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.status-chip.is-hold,
.status-chip.is-strong {
    color: var(--green);
}

.status-chip.is-hold .status-dot,
.status-chip.is-strong .status-dot {
    background: #1cc55b;
    box-shadow: 0 0 10px rgba(28, 197, 91, 0.35);
}

.status-chip.is-warm {
    color: #d39817;
}

.status-chip.is-warm .status-dot {
    background: #f3b218;
    box-shadow: 0 0 10px rgba(243, 178, 24, 0.28);
}

.status-chip.is-watch {
    color: #cb6a2b;
}

.status-chip.is-watch .status-dot {
    background: #e07a28;
}

.status-chip.is-idle {
    color: var(--muted);
}

.status-chip.is-idle .status-dot {
    background: #cfc7bd;
}

.signal-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.signal-mark.is-on {
    background: #18b93f;
    color: white;
}

.signal-mark.is-off {
    color: #df3528;
    font-size: 18px;
}

.sector-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.sector-card h4 {
    margin: 0;
    font-size: 16px;
}

.sector-meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.ghost-btn.danger {
    color: var(--red);
    border-color: rgba(196, 73, 49, 0.2);
}

.settings-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(360px, 100vw);
    height: 100vh;
    transform: translateX(100%);
    transition: transform 220ms ease;
    background: rgba(252, 248, 240, 0.94);
    border-left: 1px solid var(--border);
    box-shadow: -20px 0 40px rgba(86, 62, 31, 0.12);
    z-index: 5;
}

.settings-sidebar.open {
    transform: translateX(0);
}

.sidebar-inner {
    padding: 28px 24px;
}

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

.sidebar-header h3 {
    margin: 0;
}

.sidebar-block {
    margin-top: 24px;
}

.sidebar-block label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.toggle-grid {
    display: grid;
    gap: 12px;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
}

.sidebar-note {
    margin-top: 26px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(159, 75, 34, 0.08);
    color: var(--muted);
    line-height: 1.7;
}

.empty-state {
    color: var(--muted);
    padding: 18px;
}

.auth-layout {
    position: relative;
    z-index: 1;
    width: min(1080px, calc(100vw - 48px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 32px 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 24px;
    align-items: center;
}

.auth-copy-panel,
.auth-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.auth-copy-panel {
    padding: 34px 32px;
}

.auth-copy-panel h1,
.auth-card h2 {
    margin: 0;
    letter-spacing: -0.04em;
}

.auth-copy {
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.auth-note {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(159, 75, 34, 0.08);
    color: var(--muted);
    display: grid;
    gap: 8px;
}

.auth-card {
    padding: 28px 26px;
}

.auth-card-head {
    margin-bottom: 18px;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    border: 1px solid rgba(87, 64, 37, 0.14);
    border-radius: 16px;
    background: var(--panel-strong);
    padding: 14px 16px;
    color: var(--ink);
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
}

.auth-alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(196, 73, 49, 0.1);
    color: #8e2c1b;
    line-height: 1.6;
}

.auth-alert-warn {
    background: rgba(204, 154, 45, 0.14);
    color: #7d5a12;
}

@media (max-width: 1100px) {
    .market-pulse,
    .metrics-grid,
    .sector-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .control-panel,
    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .workspace {
        width: calc(100vw - 24px);
        padding-top: 18px;
    }

    .hero,
    .status-bar,
    .signal-strip-head,
    .signal-strip-body,
    .sector-action-strip {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-actions {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .search-row {
        flex-direction: column;
    }

    .market-pulse,
    .metrics-grid,
    .sector-summary-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 980px;
    }

    .auth-layout {
        width: calc(100vw - 24px);
        grid-template-columns: 1fr;
        align-items: start;
    }

    .hero-actions {
        width: 100%;
        align-items: flex-start;
    }

    .hero-action-row {
        flex-wrap: wrap;
    }
}

/* ── 板块热度 tab（东财行业板块排行，与 /api/market-overview 对应）── */
.heat-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0;
}

.heat-pill {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.heat-pill-label {
    font-size: 13px;
    color: var(--muted);
}

.heat-pill-value {
    font-size: 20px;
    font-weight: 700;
}

.heat-pill-value.positive {
    color: var(--green);
}

.heat-pill-value.negative {
    color: var(--red);
}

.heat-pill-sub {
    font-size: 12px;
    color: var(--muted);
}

.heat-chart-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.heat-chart-card h4,
.heat-table-block h4,
#heatFlips h4 {
    margin: 4px 0 10px;
    font-size: 14px;
}

.heat-thermometer {
    height: 220px;
}

/* ── 择时驾驶舱（方向择时 tab 头条 + 逐 track 策略图）── */
.cockpit-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 6px;
}

.cockpit-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cockpit-card.cockpit-market {
    border-color: rgba(17, 121, 90, 0.35);
    background: linear-gradient(135deg, rgba(17, 121, 90, 0.06), var(--panel));
}

.cockpit-card.is-clickable,
.direction-card.is-clickable {
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.cockpit-card.is-clickable:hover,
.direction-card.is-clickable:hover {
    border-color: rgba(17, 121, 90, 0.5);
    transform: translateY(-1px);
}

.cockpit-label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
}

.cockpit-gear {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
}

.cockpit-sub {
    font-size: 12.5px;
    color: var(--muted);
}

.cockpit-lights {
    display: flex;
    gap: 6px;
}

.cockpit-hint {
    font-size: 12px;
    color: var(--green);
    font-weight: 600;
}

.cockpit-note {
    margin: 4px 2px 14px;
}

.csr-light {
    display: inline-flex;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
}

.csr-light.is-on {
    background: rgba(17, 121, 90, 0.14);
    color: var(--green);
}

.csr-light.is-off {
    background: rgba(196, 73, 49, 0.10);
    color: var(--red);
}

.timing-detail {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

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

.timing-members {
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.timing-members-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.timing-members-head h4 {
    margin: 0 0 4px;
    font-size: 14.5px;
}

.timing-members .wide-table-wrap {
    max-height: 520px;
    overflow-y: auto;
}

.timing-detail-head h4 {
    margin: 0 0 4px;
    font-size: 15.5px;
}

.timing-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.timing-band-seg {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
    background: rgba(87, 64, 37, 0.03);
    user-select: none;
}

.timing-band-seg-label {
    padding: 0 6px 0 4px;
    font-size: 11.5px;
    color: var(--muted);
}

.timing-band-seg button {
    border: none;
    background: transparent;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
}

.timing-band-seg button.is-active {
    background: rgba(17, 121, 90, 0.12);
    color: var(--green, #11795a);
    font-weight: 600;
}

.timing-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 8px;
}

.timing-stat {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 14px;
    min-width: 220px;
}

.timing-stat.is-strategy {
    border-color: rgba(17, 121, 90, 0.4);
    background: rgba(17, 121, 90, 0.05);
}

.timing-stat.is-v0 {
    border-color: rgba(74, 111, 165, 0.45);
    background: rgba(74, 111, 165, 0.06);
}

.timing-stat.is-v0cs {
    border-color: rgba(32, 128, 141, 0.45);
    background: rgba(32, 128, 141, 0.06);
}

.timing-stat.is-v0all {
    border-color: rgba(138, 90, 168, 0.45);
    background: rgba(138, 90, 168, 0.06);
}

.timing-stat.is-v0cr {
    border-color: rgba(171, 78, 143, 0.45);
    background: rgba(171, 78, 143, 0.06);
}

.timing-stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.timing-stat-main {
    font-size: 15px;
    font-weight: 700;
}

.timing-stat-sub {
    font-size: 12.5px;
    color: var(--muted);
}

.timing-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.scope-pill {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: rgba(87, 64, 37, 0.04);
}

.timing-chart {
    height: 680px;
}

.direction-chart-hint {
    float: right;
    color: var(--green);
    font-weight: 600;
    font-size: 12px;
}

.heat-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.heat-table-block {
    overflow-x: auto;
}

.heat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.heat-table th {
    text-align: left;
    padding: 6px 8px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.heat-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(87, 64, 37, 0.08);
    white-space: nowrap;
}

.heat-rank {
    color: var(--muted);
    width: 30px;
}

.heat-name {
    font-weight: 600;
}

.heat-flip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.heat-flip-chip {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.heat-flip-chip.is-bull {
    color: var(--green);
    border-color: rgba(17, 121, 90, 0.35);
}

.heat-flip-chip.is-bear {
    color: var(--red);
    border-color: rgba(196, 73, 49, 0.35);
}

/* ── 方向择时 tab（路径 β 接口占位，与 /api/directions 对应）── */
.direction-pending {
    padding: 18px;
    background: var(--panel);
    border: 1px dashed var(--border);
    border-radius: 14px;
    line-height: 1.7;
}

.direction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.direction-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.direction-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.direction-name {
    font-size: 15px;
    font-weight: 700;
}

.direction-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.direction-position {
    font-weight: 600;
}

/* 信号 pill：双字文案（绿上/绿下），不复用 22px 方形 .signal-mark */
.direction-signal {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.direction-signal.is-on {
    background: #18b93f;
    color: #fff;
}

.direction-signal.is-off {
    background: rgba(223, 53, 40, 0.12);
    color: #df3528;
}

/* V3 挡下方向：保留展示但整卡弱化（健康度时变，按年重估会翻转） */
.direction-card.is-blocked {
    opacity: 0.55;
}

/* 标星卡片：粉底置顶（右键或 ★ 按钮切换，quant.user_prefs 跨设备同步）；
   挡下+标星仍要一眼可寻，透明度回升 */
.direction-card.is-starred {
    background: linear-gradient(135deg, rgba(214, 106, 142, 0.10), rgba(214, 106, 142, 0.04));
    border-color: rgba(214, 106, 142, 0.45);
}

.direction-card.is-blocked.is-starred {
    opacity: 0.8;
}

.direction-head-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.direction-star {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
    color: rgba(87, 64, 37, 0.35);
}

.direction-star:hover {
    color: #d66a8e;
}

.direction-star.is-active {
    color: #d66a8e;
}

.direction-gate {
    font-size: 12px;
}

@media (max-width: 900px) {
    .heat-tables {
        grid-template-columns: 1fr;
    }
}
