* { margin:0; padding:0; box-sizing:border-box; }
body { background:#0d111e; color:#e0e0e0; font-family:'Microsoft YaHei',sans-serif; display:flex; flex-direction:column; height:100vh; overflow:hidden; }

/* ── 顶栏 ── */
.header { padding:10px 24px; display:flex; align-items:center; gap:16px; border-bottom:1px solid #1e2636; flex-shrink:0; flex-wrap:wrap; }
.header h1 { color:#f0b90b; font-size:18px; white-space:nowrap; }
.btn-group { display:flex; gap:5px; }
.btn-group button {
    padding:5px 14px; border:1px solid #2a3345; border-radius:4px;
    background:#1a1f2e; color:#8a94a6; cursor:pointer; font-size:12px; transition:all .2s;
}
.btn-group button.active { background:#f0b90b; color:#0d111e; border-color:#f0b90b; font-weight:bold; }
.btn-group button:hover:not(.active) { border-color:#f0b90b; color:#f0b90b; }
/* 模型按钮 — 选中时用模型自身颜色高亮 */
.btn-group button[data-model] { position:relative; transition:all .2s; }
.btn-group button[data-model].active {
    color:#fff; font-weight:bold;
    /* background 和 border-color 由 JS 设置为模型颜色 */
}
/* 布局/设置按钮 */
.layout-toggle, .settings-toggle {
    padding:4px 12px; border:1px solid #2a3345; border-radius:4px;
    background:#1a1f2e; color:#8a94a6; cursor:pointer; font-size:16px; transition:all .2s;
    line-height:1; display:flex; align-items:center; gap:6px;
}
.layout-toggle:hover, .settings-toggle:hover { border-color:#f0b90b; color:#f0b90b; }
.layout-toggle .lt-label { font-size:11px; }
.header-right { margin-left:auto; display:flex; gap:8px; align-items:center; }

/* ── 信号栏 ── */
.signal-panel {
    padding:8px 24px; display:flex; gap:16px; align-items:center;
    border-bottom:1px solid #1e2636; font-size:12px; flex-shrink:0; flex-wrap:wrap;
}
.signal-legend { display:flex; gap:6px; align-items:center; }
.legend-item { display:flex; align-items:center; gap:3px; }
.legend-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.filter-btn { cursor:pointer; padding:2px 8px; border-radius:3px; border:1px solid transparent; transition:all .2s; user-select:none; font-size:12px; }
.filter-btn:hover { border-color:#3a4555; }
.filter-btn.active { opacity:1; }
.filter-btn:not(.active) { opacity:.35; text-decoration:line-through; }
.strength-filter { display:flex; align-items:center; gap:6px; margin-left:8px; padding-left:12px; border-left:1px solid #1e2636; }
.sf-label { color:#555; font-size:11px; white-space:nowrap; }
.signal-info { color:#8a94a6; margin-left:auto; }
.latest-signal { padding:3px 8px; border-radius:4px; font-weight:bold; font-size:12px; }
.latest-signal.buy { background:rgba(0,200,83,0.15); color:#00c853; }
.latest-signal.wait { background:rgba(255,193,7,0.15); color:#ffc107; }
.latest-signal.avoid { background:rgba(244,67,54,0.15); color:#f44336; }
.latest-signal.reduce { background:rgba(255,152,0,0.15); color:#ff9800; }

/* ── 布局 ── */
.main-wrapper { flex:1; display:flex; overflow:hidden; min-height:0; min-width:0; }
.main-wrapper.layout-h { flex-direction:column; }
.layout-h .chart-pane { flex:1; min-height:180px; position:relative; }
.layout-h .report-pane { height:35vh; min-height:120px; display:flex; flex-direction:column; }
.layout-h .resizer {
    height:6px; width:100%; cursor:row-resize; flex-shrink:0;
    background:#1e2636; display:flex; align-items:center; justify-content:center; transition:background .2s;
}
.layout-h .resizer::after { content:''; width:40px; height:2px; background:#3a4555; border-radius:1px; }
.layout-h .report-pane { border-top:1px solid #1e2636; }
.main-wrapper.layout-v { flex-direction:row; }
.layout-v .chart-pane { flex:1; min-width:300px; position:relative; }
.layout-v .report-pane { width:38vw; min-width:280px; display:flex; flex-direction:column; }
.layout-v .resizer {
    width:6px; height:100%; cursor:col-resize; flex-shrink:0;
    background:#1e2636; display:flex; align-items:center; justify-content:center; transition:background .2s;
}
.layout-v .resizer::after { content:''; height:40px; width:2px; background:#3a4555; border-radius:1px; }
.layout-v .report-pane { border-left:1px solid #1e2636; }
.resizer:hover, .resizer.dragging { background:#f0b90b; }
.resizer:hover::after { background:#0d111e; }
#chart-container { width:100%; height:100%; }

/* ── 报告面板 ── */
.report-header {
    padding:8px 16px; border-bottom:1px solid #1e2636; flex-shrink:0;
    display:flex; align-items:center; gap:10px; font-size:13px; flex-wrap:wrap;
}
.report-header .rh-title { color:#f0b90b; font-weight:bold; white-space:nowrap; }
.report-header .rh-time { color:#555; font-size:12px; }
.report-header .rh-dir { font-weight:bold; padding:2px 8px; border-radius:3px; font-size:12px; }
/* 模型下拉选择 */
.rh-model-wrap { position:relative; display:inline-block; }
.rh-model {
    padding:2px 8px; border-radius:3px; font-size:11px; font-weight:bold;
    border:1px solid; cursor:pointer; user-select:none; white-space:nowrap;
}
.rh-model:hover { opacity:0.8; }
.rh-model-dropdown {
    display:none; position:absolute; top:100%; left:0; margin-top:4px;
    background:#1a1f2e; border:1px solid #2a3345; border-radius:6px;
    min-width:160px; z-index:200; overflow:hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.rh-model-dropdown.show { display:block; }
.rh-model-dropdown .md-item {
    display:flex; align-items:center; gap:8px; padding:8px 14px;
    cursor:pointer; font-size:12px; color:#8a94a6; transition:background .15s;
}
.rh-model-dropdown .md-item:hover { background:#252d42; }
.rh-model-dropdown .md-item.active { color:#e0e0e0; font-weight:bold; }
.rh-model-dropdown .md-item .md-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.rh-model-dropdown .md-item .md-name { flex:1; }
.rh-model-dropdown .md-item .md-dir { font-size:10px; opacity:0.7; }
.report-header .rh-nav { margin-left:auto; display:flex; gap:6px; white-space:nowrap; }
.report-header .rh-nav button {
    padding:3px 10px; border:1px solid #2a3345; border-radius:3px;
    background:#1a1f2e; color:#8a94a6; cursor:pointer; font-size:11px;
}
.report-header .rh-nav button:hover { border-color:#f0b90b; color:#f0b90b; }
.report-header .rh-nav button:disabled { opacity:.3; cursor:default; }
#report-content { flex:1; overflow-y:auto; padding:16px 20px; line-height:1.75; font-size:13px; }
.report-placeholder { color:#555; text-align:center; padding:48px 0; font-size:14px; }

/* ── Markdown ── */
#report-content h1,#report-content h2,#report-content h3 { color:#f0b90b; margin:16px 0 8px; }
#report-content h1 { font-size:18px; border-bottom:1px solid #1e2636; padding-bottom:6px; }
#report-content h2 { font-size:16px; }
#report-content h3 { font-size:14px; }
#report-content strong { color:#e8e8e8; }
#report-content em { color:#ffc107; font-style:normal; }
#report-content p { margin:6px 0; }
#report-content ul,#report-content ol { padding-left:20px; margin:6px 0; }
#report-content li { margin:3px 0; }
#report-content code { background:#1a1f2e; padding:1px 5px; border-radius:3px; font-size:12px; color:#00c853; }
#report-content hr { border:none; border-top:1px solid #1e2636; margin:12px 0; }
#report-content blockquote { border-left:3px solid #f0b90b; padding-left:12px; color:#8a94a6; margin:8px 0; }
.md-buy { color:#00c853 !important; font-weight:bold; }
.md-wait { color:#ffc107 !important; font-weight:bold; }
.md-avoid { color:#f44336 !important; font-weight:bold; }
.md-reduce { color:#ff9800 !important; font-weight:bold; }

/* ── 滚动条 ── */
#report-content::-webkit-scrollbar { width:6px; }
#report-content::-webkit-scrollbar-track { background:#0d111e; }
#report-content::-webkit-scrollbar-thumb { background:#2a3345; border-radius:3px; }
#report-content::-webkit-scrollbar-thumb:hover { background:#3a4555; }

/* ── 设置面板 ── */
.settings-overlay {
    display:none; position:fixed; top:0; left:0; right:0; bottom:0;
    background:rgba(0,0,0,0.6); z-index:1000; align-items:center; justify-content:center;
}
.settings-overlay.show { display:flex; }
.settings-box {
    background:#1a1f2e; border:1px solid #2a3345; border-radius:8px;
    padding:24px; min-width:360px; max-width:480px;
}
.settings-box h2 { color:#f0b90b; font-size:16px; margin-bottom:16px; }
.settings-box label { display:flex; align-items:center; gap:10px; padding:8px 0; cursor:pointer; font-size:13px; }
.settings-box input[type=checkbox] { width:16px; height:16px; accent-color:#f0b90b; }
.settings-box .s-model-color { width:10px; height:10px; border-radius:50%; display:inline-block; }
.settings-actions { display:flex; gap:10px; margin-top:16px; justify-content:flex-end; }
.settings-actions button {
    padding:6px 20px; border-radius:4px; cursor:pointer; font-size:13px; border:none;
}
.settings-actions .s-save { background:#f0b90b; color:#0d111e; font-weight:bold; }
.settings-actions .s-cancel { background:#2a3345; color:#8a94a6; }
