:root {
    --bg: #0d1117; --bg2: #161b22; --bg3: #1c2333; --line: #2b2f3a;
    --tx: #d1d4dc; --tx2: #8b949e; --up: #00b956; --down: #ff4976;
    --accent: #4da6ff; --orange: #ff9500; --purple: #c480ff; --zone: #ff8c1a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--tx); font: 14px/1.5 "Segoe UI","Microsoft YaHei",sans-serif; overflow: hidden; }
#app, .app-main { display: flex; flex-direction: column; height: 100vh; width: 100vw; }

/* ================= 顶栏 ================= */
.topbar { display: flex; align-items: center; gap: 8px; padding: 5px 10px; background: var(--bg2); border-bottom: 1px solid var(--line); flex-wrap: nowrap; flex-shrink: 0; }
.brand { font-weight: 700; font-size: 16px; color: #fff; white-space: nowrap; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; flex-shrink: 1; }
.brand .sub { font-size: 12px; color: var(--tx2); font-weight: 400; margin-left: 4px; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #f7b733, #fc4a1a); color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -1px; box-shadow: 0 2px 8px rgba(252, 74, 26, .4); }
.logo-mark.small { width: 26px; height: 26px; font-size: 12px; border-radius: 7px; }
.tb-group { display: flex; background: var(--bg3); border-radius: 5px; overflow: hidden; }
.tb-label { align-self: center; color: var(--tx2); font-size: 12px; padding: 0 3px 0 6px; white-space: nowrap; }
.tb-btn, .tf-btn, .ai-mode { border: none; background: transparent; color: var(--tx2); padding: 4px 8px; cursor: pointer; font-size: 12px; }
.tb-btn:hover, .tf-btn:hover, .ai-mode:hover { color: var(--tx); }
.tb-btn.active, .tf-btn.active, .ai-mode.active { background: var(--accent); color: #fff; }
.tb-ai { display: flex; gap: 4px; flex: 1; min-width: 200px; justify-content: flex-end; align-items: center; }
.model-select { background: var(--bg3); border: 1px solid var(--line); color: var(--tx); padding: 3px 6px; border-radius: 5px; font-size: 12px; outline: none; max-width: 120px; }
#aiQuestion { flex: 1; max-width: 200px; background: var(--bg3); border: 1px solid var(--line); color: var(--tx); padding: 4px 8px; border-radius: 5px; font-size: 12px; outline: none; }
#aiQuestion:focus { border-color: var(--accent); }
.btn-ai, .btn-ask { border: none; border-radius: 5px; padding: 4px 10px; cursor: pointer; font-size: 12px; font-weight: 600; white-space: nowrap; }
.btn-ai { background: var(--accent); color: #fff; }
.btn-ask { background: var(--bg3); color: var(--tx); border: 1px solid var(--line); }
.btn-ai:disabled, .btn-ask:disabled { opacity: .5; cursor: not-allowed; }
.btn-login { border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 5px; padding: 4px 10px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.btn-login:hover { background: var(--accent); color: #fff; }

/* ================= 主体三栏 ================= */
.main { flex: 1; min-height: 0; display: flex; }

/* ---- 左栏：AI (320px) ---- */
.ai-col { width: 320px; min-width: 260px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--bg2); display: flex; flex-direction: column; }
.ai-col.folded { width: 46px; min-width: 46px; }
.ai-col.folded .ai-model-row, .ai-col.folded .ai-actions, .ai-col.folded .ai-toolbar, .ai-col.folded .ai-body, .ai-col.folded .alert-panel { display: none; }
.ai-col.folded .ai-head { flex-direction: column; justify-content: flex-start; align-items: center; padding: 16px 0; gap: 14px; border-bottom: none; height: 100%; cursor: pointer; }
.ai-col.folded .ai-head .ai-title { writing-mode: vertical-rl; letter-spacing: 4px; font-size: 14px; }
.ai-col.folded .ai-head #aiFold { writing-mode: vertical-rl; letter-spacing: 2px; color: var(--accent); }
.ai-col.folded .ai-head #aiClear { display: none; }
.ai-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ai-title { font-weight: 700; color: #fff; font-size: 14px; white-space: nowrap; }
.ai-head-btn { border: 1px solid var(--accent); background: transparent; color: var(--accent); padding: 3px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; transition: all .15s; white-space: nowrap; }
.ai-head-btn:hover { background: var(--accent); color: #fff; }
.ai-meta { flex: 1; color: var(--tx2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-clear { cursor: pointer; color: var(--tx2); font-size: 12px; flex-shrink: 0; }
.ai-clear:hover { color: var(--tx); }
.ai-toolbar { display: flex; flex-wrap: wrap; gap: 2px 6px; padding: 4px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ind-toggle { font-size: 12px; color: var(--tx2); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 2px; }
.ind-toggle input { width: 11px; height: 11px; accent-color: var(--accent); }
.ind-toggle:has(input:checked) { color: var(--tx); }
.ai-body { flex: 1; overflow-y: auto; padding: 8px 10px; font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.ai-body .ai-headline { color: var(--tx2); font-size: 12px; margin-bottom: 6px; }
.ai-body pre { background: var(--bg3); padding: 6px; border-radius: 5px; overflow-x: auto; white-space: pre-wrap; font-size: 12px; }
.ai-body h1, .ai-body h2 { margin: 12px 0 5px; color: var(--accent); font-size: 14px; font-weight: 700; border-left: 3px solid var(--accent); padding-left: 8px; line-height: 1.4; }
.ai-body h3 { margin: 10px 0 4px; color: #fff; font-size: 13px; font-weight: 700; border-left: 3px solid var(--purple); padding-left: 8px; line-height: 1.4; }
.ai-body p { margin: 3px 0; }
.ai-body ul, .ai-body ol { padding-left: 20px; margin: 4px 0; }
.ai-body li { margin: 2px 0; }
.ai-body b { color: var(--orange); font-weight: 700; }
.ai-body i { color: var(--tx2); }
.ai-body .ai-sec { color: var(--accent); font-weight: 700; background: rgba(77, 166, 255, 0.1); padding: 0 4px; border-radius: 3px; }
.ai-body table { border-collapse: collapse; margin: 6px 0; width: 100%; }
.ai-body td, .ai-body th { border: 1px solid var(--line); padding: 3px 6px; font-size: 12px; text-align: left; }
.ai-body th { background: var(--bg3); color: #fff; }
.ai-body .cursor { display: inline-block; width: 6px; height: 12px; background: var(--accent); vertical-align: text-bottom; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ai-body .ai-err { color: var(--down); }
.ai-body .ai-placeholder { color: var(--tx2); font-size: 12px; padding: 6px 2px; }
.ai-body .ai-placeholder .ph-title { color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ai-body .ai-placeholder .ph-row { line-height: 1.8; }
.ai-body .ai-placeholder .ph-divider { height: 1px; background: var(--line); margin: 10px 0 8px; }
.ai-body .ai-placeholder .ph-sub { color: var(--accent); font-size: 12px; margin-bottom: 6px; letter-spacing: 0.5px; }
.ai-body .ai-placeholder .ph-mini { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
.ai-body .ai-placeholder .ph-mini label { color: var(--tx2); }
.ai-body .ai-placeholder .ph-mini b { color: #fff; font-weight: 500; }

/* 价格提醒面板 */
.alert-panel { border-top: 1px solid var(--line); flex-shrink: 0; max-height: 120px; overflow-y: auto; }
.alert-head { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; font-size: 12px; font-weight: 700; color: #fff; }
.alert-add { color: var(--accent); cursor: pointer; font-weight: 400; font-size: 12px; }
.alert-list { padding: 0 10px 6px; }
.alert-item { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; font-size: 12px; color: var(--tx2); }
.alert-item .alert-del { color: var(--down); cursor: pointer; font-size: 12px; }

/* ---- 中栏：K线 + 新闻 ---- */
.center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.quote-bar { display: flex; align-items: center; gap: 12px; padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: 12px; flex-wrap: nowrap; overflow: hidden; flex-shrink: 0; }
.quote-bar > * { flex-shrink: 0; white-space: nowrap; }
.q-price { font-size: 24px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.q-price.up { color: var(--up); } .q-price.down { color: var(--down); }
.q-change { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.q-change.up { color: var(--up); } .q-change.down { color: var(--down); }
.q-item { color: var(--tx2); } .q-item b { color: var(--tx); font-variant-numeric: tabular-nums; }
.reset-chart-btn { border: 1px solid var(--accent); background: transparent; color: var(--accent); padding: 4px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; transition: all .15s; white-space: nowrap; }
.reset-chart-btn:hover { background: var(--accent); color: #fff; }
.quote-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.chart-wrap { flex: 1; min-height: 160px; padding: 4px 6px 0 6px; position: relative; }
#mainChart { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
#vpOverlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 2; }
.chart-meta { height: 20px; padding: 2px 10px; font-size: 12px; color: var(--tx2); flex-shrink: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.trend-strip { display: flex; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; overflow-x: auto; }
.trend-card { flex: 1; min-width: 150px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.trend-card.selected { border-color: var(--accent); box-shadow: 0 0 8px rgba(77,166,255,.4); background: rgba(77,166,255,.08); }
.trend-card.selected .tc-tf { color: var(--accent); }
.trend-card .tc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.trend-card .tc-tf { font-size: 12px; font-weight: 700; color: #fff; }
.trend-card .tc-trend { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 4px; }
.trend-card .tc-trend.up { color: #fff; background: #1e6fff; }
.trend-card .tc-trend.down { color: #fff; background: #ff2d55; }
.trend-card .tc-trend.range { color: #fff; background: #8b949e; }
.trend-card .tc-trend.strong_up { color: #fff; background: #0053ff; }
.trend-card .tc-trend.strong_down { color: #fff; background: #ff0040; }
.trend-card .tc-levels { display: flex; justify-content: space-between; font-size: 10px; color: var(--tx2); }
.trend-card .tc-levels .hi { color: var(--up); }
.trend-card .tc-levels .lo { color: var(--down); }
.trend-card .tc-slope { font-size: 10px; color: var(--tx2); margin-top: 2px; }
.chart-legend { position: absolute; top: 8px; right: 10px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.liqmap-btn { border-color: #ff8c1a; color: #ff8c1a; }
.liqmap-btn:hover { background: #ff8c1a; color: #fff; }
.liqmap-btn.active { background: linear-gradient(90deg, #ff8c1a, #c078ff); color: #fff; border-color: transparent; box-shadow: 0 0 8px rgba(255,140,26,.5); }
.cvd-chart { width: 100%; height: 52px; display: block; margin: 2px 0 4px; background: rgba(255,255,255,.02); border-radius: 6px; }
.reg-btn { border: 1px solid var(--accent); background: rgba(28,35,51,.85); color: var(--accent); padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s; white-space: nowrap; }
.reg-btn:hover { background: var(--accent); color: #fff; }
.reg-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 0 8px rgba(77,166,255,.5); }

/* 底部新闻面板 */
.news-panel { height: 32%; min-height: 100px; border-top: 1px solid var(--line); display: flex; flex-direction: column; flex-shrink: 0; background: var(--bg2); }
.news-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.news-tab { border: none; background: transparent; color: var(--tx2); padding: 5px 14px; cursor: pointer; font-size: 12px; border-bottom: 2px solid transparent; }
.news-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.news-body, .twitter-body, .sentiment-body { flex: 1; overflow-y: auto; padding: 8px 12px; font-size: 13px; }
.news-placeholder, .twitter-placeholder { color: var(--tx2); padding: 20px 0; text-align: center; }
.news-item { padding: 4px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.news-item .ni-time { color: var(--tx2); flex-shrink: 0; font-size: 12px; }
.news-item .ni-src { color: var(--accent); flex-shrink: 0; font-size: 12px; min-width: 40px; }
.news-item .ni-text { color: var(--tx); }
.news-item.important { border-left: 2px solid var(--down); padding-left: 6px; }
.news-item.important .ni-text { color: #fff; font-weight: 600; }
.twitter-scroll { white-space: nowrap; overflow: hidden; }
.twitter-scroll .tw-item { display: inline-block; padding: 4px 20px 4px 0; color: var(--tx); font-size: 12px; }
.twitter-scroll .tw-item .tw-name { color: var(--accent); font-weight: 600; }
.fear-greed, .social-sentiment { padding: 8px 0; }
.fg-label { color: var(--tx2); font-size: 12px; margin-bottom: 4px; }
.fg-value { font-size: 32px; font-weight: 700; color: #fff; }
.fg-bar { height: 6px; background: var(--bg3); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.fg-fill { height: 100%; border-radius: 3px; transition: width .5s; }

/* ---- 右栏：清算信息 (340px) ---- */
.right { width: 340px; min-width: 280px; flex-shrink: 0; border-left: 1px solid var(--line); overflow-y: auto; background: var(--bg); }
.panel { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.legend { font-size: 12px; color: var(--tx2); font-weight: 400; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin: 0 2px; }
.dot-buy { background: var(--up); } .dot-sell { background: var(--down); } .dot-zone { background: var(--zone); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { color: var(--tx2); text-align: right; font-weight: 400; padding: 1px 3px; border-bottom: 1px solid var(--line); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { padding: 1px 3px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.buy { color: var(--up); } .tbl td.sell { color: var(--down); } .tbl td.muted { color: var(--tx2); }
.tbl tr:hover td { background: var(--bg3); }
.liq-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; margin-bottom: 4px; }
.liq-stat { display: flex; justify-content: space-between; font-size: 12px; }
.liq-stat label { color: var(--tx2); } .liq-stat b { font-variant-numeric: tabular-nums; }
.liq-stat b.long { color: var(--up); } .liq-stat b.short { color: var(--down); }
.liq-events { max-height: 90px; overflow-y: auto; font-size: 12px; }
.liq-ev { display: flex; gap: 5px; padding: 1px 0; color: var(--tx2); }
.liq-ev .ev-side { font-weight: 700; } .liq-ev .ev-side.long { color: var(--up); } .liq-ev .ev-side.short { color: var(--down); }
.liq-ev .ev-ex { color: var(--tx); } .liq-ev .ev-price { font-variant-numeric: tabular-nums; }

/* 行为识别 */
.behavior-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; }
.beh-item { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.beh-item label { color: var(--tx2); } .beh-item b { font-variant-numeric: tabular-nums; }

.foot { padding: 3px 10px; color: var(--tx2); font-size: 12px; border-top: 1px solid var(--line); flex-shrink: 0; }

/* ================= 登录弹窗 ================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 24px; width: 320px; }
.modal-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 16px; text-align: center; }
.modal-input { width: 100%; background: var(--bg3); border: 1px solid var(--line); color: var(--tx); padding: 8px 12px; border-radius: 6px; font-size: 13px; outline: none; margin-bottom: 10px; }
.modal-input:focus { border-color: var(--accent); }
.modal-btns { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.modal-msg { text-align: center; font-size: 12px; color: var(--down); margin-top: 10px; min-height: 16px; }

/* ================= 警报横幅 ================= */
.alert-overlay { position: fixed; top: 0; left: 0; right: 0; z-index: 200; }
.alert-banner { background: var(--down); color: #fff; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 700; animation: alertPulse 1s infinite; }
@keyframes alertPulse { 0%,100% { opacity: 1; } 50% { opacity: .7; } }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 页内详情弹窗 ================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 400; display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; width: min(860px, 92vw); max-height: 84vh; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-title { font-size: 16px; font-weight: 700; color: #fff; }
.modal-close { color: var(--tx2); cursor: pointer; font-size: 13px; padding: 4px 10px; border-radius: 6px; }
.modal-close:hover { background: var(--bg3); color: var(--tx); }
.modal-content { padding: 16px 18px; overflow-y: auto; flex: 1; }
.modal-content h3 { color: var(--accent); margin: 14px 0 8px; font-size: 15px; }
.modal-content h3:first-child { margin-top: 0; }
.modal-content ul { padding-left: 22px; margin: 6px 0; }
.modal-content li { font-size: 13px; color: var(--tx); line-height: 1.7; }
.modal-content p { font-size: 13px; color: var(--tx2); line-height: 1.7; }
.modal-content .detail-tbl { width: 100%; margin-bottom: 10px; }
.modal-content .detail-tbl td, .modal-content .detail-tbl th { padding: 5px 8px; font-size: 13px; }
.kol-detail-meta { color: var(--tx2); font-size: 12px; margin-bottom: 10px; }
.news-full { white-space: pre-wrap; line-height: 1.8; font-size: 13px; color: var(--tx); }
.kol-detail-link { display: inline-block; margin-top: 12px; color: var(--accent); font-size: 12px; text-decoration: none; border: 1px solid var(--accent); padding: 4px 12px; border-radius: 6px; }
.kol-detail-link:hover { background: var(--accent); color: #fff; }
.news-item, .tw-card { cursor: pointer; }
.news-item:hover .ni-text { color: var(--accent); }
.tw-card:hover { border-color: var(--accent); }

/* ================= Mobile ================= */
@media (max-width: 900px) {
    .main { flex-direction: column; }
    .ai-col { width: 100%; min-width: 0; max-height: 40vh; border-right: none; border-bottom: 1px solid var(--line); }
    .ai-col.folded { display: none; }
    .right { width: 100%; min-width: 0; max-height: 35vh; border-left: none; border-top: 1px solid var(--line); }
    .center { min-height: 50vh; }
    .news-panel { height: 25%; min-height: 80px; }
    .topbar { gap: 4px; padding: 4px 6px; flex-wrap: wrap; }
    .quote-bar { flex-wrap: wrap; overflow: visible; gap: 8px; }
    .quote-bar .q-item.q-oi, .quote-bar .q-item.q-fund, .quote-bar .q-item.q-liq { display: inline; }
    .gauge-row { flex-wrap: wrap; }
    .gauge-box { flex: 1 0 30%; }
    .tb-ai { min-width: 0; }
    #aiQuestion { max-width: 120px; }
    .brand .sub { display: none; }
    .battle-entry { order: -1; padding: 4px 9px; }
}

/* ================= 桌面端窄宽度：报价条逐项隐藏，保证一排不换行 ================= */
@media (min-width: 901px) and (max-width: 1300px) {
    .quote-bar .q-item.q-fund, .quote-bar .q-item.q-liq { display: none; }
    .q-price { font-size: 20px; }
}
@media (min-width: 901px) and (max-width: 1100px) {
    .quote-bar .q-item.q-oi { display: none; }
    .q-price { font-size: 18px; }
    .quote-bar { gap: 8px; }
}
@media (min-width: 901px) and (max-width: 980px) {
    .q-price { font-size: 16px; }
    .reset-chart-btn { padding: 3px 8px; }
}

/* ================= 桌面端低分辨率/小高度屏：压缩固定区，保住K线高度 ================= */
@media (max-height: 760px) {
    .news-panel { height: 28%; min-height: 88px; }
    .trend-card { padding: 5px 9px; }
    .gauge-row { padding: 4px 10px; }
}
@media (max-height: 620px) {
    .news-panel { height: 24%; min-height: 76px; }
    .chart-meta { height: 16px; padding: 0 10px; }
    .trend-strip { padding: 3px 10px; }
    .trend-card { padding: 4px 8px; }
    .trend-card .tc-slope { display: none; }
}

/* ================= 登录门 ================= */
.login-gate { position: fixed; inset: 0; background: radial-gradient(circle at 50% 30%, #16203a, #0d1117 70%); z-index: 500; display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 40px 44px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.login-logo { font-size: 24px; font-weight: 700; color: #fff; text-align: center; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--tx2); font-size: 12px; margin-bottom: 24px; }
.login-input { width: 100%; background: var(--bg3); border: 1px solid var(--line); color: var(--tx); padding: 11px 14px; border-radius: 8px; font-size: 14px; outline: none; margin-bottom: 12px; }
.login-input:focus { border-color: var(--accent); }
.login-btns { display: flex; gap: 10px; margin-top: 6px; }
.login-btns .btn-ai { flex: 1; padding: 10px; font-size: 14px; }
.login-btns .btn-ask { flex: 1; padding: 10px; font-size: 14px; }
.login-msg { text-align: center; margin-top: 14px; font-size: 12px; color: var(--down); min-height: 18px; }

/* ================= 广告跑马灯 ================= */
.ad-bar { height: 32px; background: linear-gradient(90deg, #1a3a6b, #2a5298); border-bottom: 1px solid #2f5f9e; overflow: hidden; flex-shrink: 0; position: relative; }
#adBottomBar { border-bottom: none; border-top: 1px solid var(--line); }
.ad-track { position: absolute; white-space: nowrap; display: inline-flex; align-items: center; height: 100%; animation: adScroll 30s linear infinite; will-change: transform; }
.ad-track .ad-item { color: #ffd76a; font-size: 13px; font-weight: 600; padding: 0 40px; text-decoration: none; display: inline-flex; align-items: center; }
.ad-track .ad-item b { color: #fff; margin-right: 6px; }
.ad-track .ad-item:hover { color: #fff; text-decoration: underline; }
@keyframes adScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ================= 顶栏右侧用户 ================= */
.tb-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.battle-entry { color: #fff; text-decoration: none; font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 6px; border: 1px solid #ffb347; background: linear-gradient(135deg, #a92535, #2b8a57); box-shadow: 0 0 12px rgba(255,179,71,.28); white-space: nowrap; }
.battle-entry:hover { filter: brightness(1.18); box-shadow: 0 0 18px rgba(255,179,71,.5); }
.battle-hero { display: flex; align-items: center; gap: 10px; margin: 8px; padding: 12px 14px; border-radius: 10px; text-decoration: none; color: #fff; border: 1px solid rgba(255,179,71,.55); background: linear-gradient(135deg, rgba(169,37,53,.9), rgba(43,138,87,.9)); box-shadow: 0 4px 18px rgba(255,179,71,.25); flex-shrink: 0; }
.battle-hero:hover { filter: brightness(1.15); box-shadow: 0 4px 26px rgba(255,179,71,.5); }
.battle-hero .bh-icon { font-size: 26px; }
.battle-hero .bh-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.battle-hero .bh-text b { font-size: 17px; letter-spacing: 3px; }
.battle-hero .bh-text small { color: rgba(255,255,255,.75); font-size: 11px; letter-spacing: 1px; }
.battle-hero .bh-go { font-size: 15px; color: #ffd05b; }
.battle-hero.hero-3d { background: linear-gradient(135deg, rgba(23,64,120,.92), rgba(43,138,87,.9)); border-color: rgba(88,166,255,.55); }
.user-chip { color: var(--accent); font-size: 12px; font-weight: 600; background: var(--bg3); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); }

/* ================= AI 面板（大按钮+模型） ================= */
.ai-actions { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ai-action-btn { display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--tx); background: var(--bg3); text-align: center; transition: background .15s, color .15s; letter-spacing: .3px; }
.ai-action-btn:hover { background: #232c3f; color: #fff; }
.ai-action-btn:active { transform: scale(.99); }
.ai-action-btn:disabled { opacity: .5; cursor: not-allowed; }
.ai-action-btn.intraday { border-left: 3px solid var(--up); }
.ai-action-btn.swing { border-left: 3px solid var(--accent); }
.ai-action-btn.long { border-left: 3px solid var(--purple); }
.ai-action-btn.intraday:hover { border-color: var(--up); }
.ai-action-btn.swing:hover { border-color: var(--accent); }
.ai-action-btn.long:hover { border-color: var(--purple); }
.ai-model-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.ai-model-row label { color: var(--accent); font-size: 12px; font-weight: 600; flex-shrink: 0; }
.ai-model-row .model-select { flex: 1; max-width: none; background: var(--bg3); border: 1px solid var(--line); color: var(--tx); padding: 6px 8px; border-radius: 6px; font-size: 12px; outline: none; }
.ai-model-row .model-select:focus { border-color: var(--accent); }

/* AI 加载动画 */
.ai-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; gap: 14px; }
.ai-loading .spinner { width: 34px; height: 34px; border: 3px solid var(--bg3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.ai-loading .load-text { color: var(--tx); font-size: 13px; text-align: center; line-height: 1.6; }
.ai-loading .load-sub { color: var(--tx2); font-size: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 情绪仪表盘（桌面端恒一排，等比缩放锁定显示比例） ================= */
.gauge-row { display: flex; gap: clamp(6px, 0.45vw, 18px); padding: clamp(4px, 0.4vw, 12px) clamp(8px, 0.7vw, 22px); border-bottom: 1px solid var(--line); flex-shrink: 0; align-items: stretch; flex-wrap: nowrap; }
.gauge-row.gauge-collapsed { display: none; }
.gauge-box { flex: 1 1 0; min-width: 0; text-align: center; background: var(--bg2); border: 1px solid var(--line); border-radius: clamp(6px, 0.5vw, 14px); padding: clamp(3px, 0.3vw, 8px) clamp(4px, 0.5vw, 14px) clamp(4px, 0.35vw, 10px); overflow: hidden; }
.gauge-box canvas { display: block; width: 100%; }
.gauge-label { font-size: clamp(10px, 0.6vw, 18px); color: var(--tx2); margin-top: clamp(2px, 0.2vw, 6px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= K线最大化（全屏）模式 ================= */
.chart-exit-btn { display: none; position: absolute; top: 10px; left: 10px; z-index: 6; border: 1px solid var(--down); background: rgba(28,35,51,.9); color: var(--down); padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chart-exit-btn:hover { background: var(--down); color: #fff; }
body.chart-max .ad-bar, body.chart-max .topbar, body.chart-max .ai-col, body.chart-max .right,
body.chart-max .quote-bar, body.chart-max .gauge-row, body.chart-max .chart-meta,
body.chart-max .trend-strip, body.chart-max .news-panel { display: none; }
body.chart-max .chart-wrap { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 460; background: var(--bg); padding: 0; }
body.chart-max .chart-exit-btn { display: block; }

/* ================= 分层挂单墙 ================= */
.panel-tabs { display: inline-flex; gap: 2px; margin-left: 6px; }
.ptab { border: none; background: var(--bg3); color: var(--tx2); padding: 2px 8px; cursor: pointer; font-size: 11px; border-radius: 4px; }
.ptab.active { background: var(--accent); color: #fff; }
.tier-info { font-size: 11px; color: var(--tx2); margin-bottom: 4px; }
.detail-btn { margin-left: auto; color: var(--accent); font-size: 11px; text-decoration: none; cursor: pointer; border: 1px solid var(--accent); padding: 1px 8px; border-radius: 4px; }
.detail-btn:hover { background: var(--accent); color: #fff; }
.panel-title { display: flex; align-items: center; gap: 6px; }

/* ================= 行为识别摘要 ================= */
.beh-item.beh-full { grid-column: span 2; }
.beh-summary { font-size: 11px; color: var(--tx2); line-height: 1.6; margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; }

/* ================= KOL 分页 ================= */
.tw-list { display: flex; flex-direction: column; gap: 6px; }
.tw-card { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.tw-card .tw-name { color: var(--accent); font-weight: 600; font-size: 12px; }
.tw-card .tw-handle { color: var(--tx2); font-size: 11px; margin-left: 6px; }
.tw-card .tw-text { color: var(--tx); font-size: 12px; margin-top: 4px; font-weight: 600; }
.tw-card .tw-summary { color: var(--tx2); font-size: 11px; margin-top: 3px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tw-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 0 2px; }
.tw-pageinfo { color: var(--tx2); font-size: 12px; }

/* ================= Toast 弹窗 ================= */
.toast-container { position: fixed; right: 20px; bottom: 40px; z-index: 600; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 14px; min-width: 220px; max-width: 320px; box-shadow: 0 8px 30px rgba(0,0,0,.4); animation: toastIn .3s ease; font-size: 12px; color: var(--tx); }
.toast.warn { border-left-color: var(--orange); }
.toast.err { border-left-color: var(--down); }
.toast.ok { border-left-color: var(--up); }
.toast .toast-title { font-weight: 700; color: #fff; margin-bottom: 2px; }
.toast.hide { opacity: 0; transform: translateX(20px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ================= 管理后台 / 详情页 ================= */
.admin-body, .detail-body { overflow: auto; }
.admin-wrap, .detail-wrap { max-width: 1200px; margin: 0 auto; padding: 20px; }
.admin-head, .detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-msg { font-size: 13px; margin-bottom: 12px; min-height: 18px; }
.admin-section { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.admin-tbl, .detail-tbl { width: 100%; }
.admin-tbl td, .admin-tbl th, .detail-tbl td, .detail-tbl th { padding: 6px 8px; font-size: 13px; }
.lvl-sel, .note-inp { background: var(--bg3); border: 1px solid var(--line); color: var(--tx); padding: 4px 8px; border-radius: 5px; font-size: 12px; }
.note-inp { width: 160px; }
.ad-add-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ad-add-row .login-input { margin-bottom: 0; flex: 1; min-width: 160px; }
.detail-content h3 { color: var(--accent); margin: 16px 0 8px; font-size: 15px; }
.detail-content ul { padding-left: 22px; margin: 6px 0; }
.detail-content li { font-size: 13px; color: var(--tx); line-height: 1.7; }
.detail-content p { font-size: 13px; color: var(--tx2); }
