/* ===== 股票技术分析工具 - 全局样式 =====
   暗色 GitHub 风格 + 流星动画
*/
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  min-height: 100vh;
  overflow-x: hidden;
}
/* 流星背景动画 */
.meteor-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.meteor {
  position: absolute; width: 2px; height: 2px; background: #fff; border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(88,166,255,0.6);
  animation: meteor-fall linear infinite;
}
.meteor::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 120px; height: 1px;
  background: linear-gradient(90deg, rgba(88,166,255,0.8), transparent);
  transform: translate(-120px, 0);
}
@keyframes meteor-fall {
  0% { transform: translate(0, 0) rotate(45deg); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(120vw, 120vh) rotate(45deg); opacity: 0; }
}
.app-wrap { position: relative; z-index: 1; }

/* 单股分析页专用布局 */
body.page-analyze { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
body.page-analyze .app-wrap { display: flex; flex-direction: column; height: 100vh; }
body.page-analyze .top-nav { flex-shrink: 0; }
body.page-analyze footer { flex-shrink: 0; }

/* 顶部导航 */
.top-nav {
  background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
  border-bottom: 1px solid #30363d;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.logo {
  font-size: 18px; font-weight: 700;
  background: linear-gradient(90deg, #58a6ff, #bc8cff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 12px; border-radius: 6px; font-size: 13px; color: #8b949e;
  text-decoration: none; transition: all 0.2s;
}
.nav-link:hover { background: #30363d; color: #c9d1d9; }
.nav-link.active { background: linear-gradient(135deg, #238636, #2ea043); color: white; font-weight: 600; }
.search-box { display: flex; gap: 8px; flex: 1; max-width: 400px; }
.search-box input {
  flex: 1; padding: 8px 12px; background: #0d1117;
  border: 1px solid #30363d; border-radius: 6px;
  color: #c9d1d9; font-size: 14px; outline: none; transition: border-color 0.2s;
}
.search-box input:focus { border-color: #58a6ff; }
.search-results {
  position: absolute; top: 50px; left: 0; right: 0; max-width: 400px;
  background: #161b22; border: 1px solid #30363d; border-radius: 8px;
  max-height: 300px; overflow-y: auto; z-index: 200; display: none;
}
.search-result-item {
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #21262d; font-size: 13px;
}
.search-result-item:hover { background: #21262d; }
.search-result-item:last-child { border-bottom: none; }
.btn {
  padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer;
  font-size: 14px; font-weight: 500; transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, #238636, #2ea043); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(46,160,67,0.3); }
.btn-secondary { background: #21262d; color: #c9d1d9; border: 1px solid #30363d; }
.btn-secondary:hover { background: #30363d; }
.btn-warn { background: linear-gradient(135deg, #9e6a03, #d29922); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.data-source-tag { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.tag-real { background: rgba(46,160,67,0.15); color: #3fb950; border: 1px solid rgba(46,160,67,0.3); }
.tag-tencent { background: rgba(88,166,255,0.15); color: #58a6ff; border: 1px solid rgba(88,166,255,0.3); }

/* 主体布局（仅单股分析页） */
body.page-analyze .main-container {
  display: grid; grid-template-columns: 1fr 360px; grid-template-rows: 1fr; gap: 16px; padding: 16px;
  max-width: 1800px; margin: 0 auto;
  flex: 1 1 0%; overflow: hidden; min-height: 0;
}
@media (max-width: 1200px) { body.page-analyze .main-container { grid-template-columns: 1fr; } }
body.page-analyze .left-panel { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; }
body.page-analyze .right-panel { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-height: 0; }

/* 股票信息条 */
.stock-info-bar {
  background: linear-gradient(135deg, #161b22 0%, #1c2128 100%);
  border: 1px solid #30363d; border-radius: 10px; padding: 16px 20px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.stock-name { font-size: 22px; font-weight: 700; color: #f0f6fc; }
.stock-code { font-size: 14px; color: #8b949e; margin-top: 2px; }
.stock-price { font-size: 28px; font-weight: 700; }
.price-up { color: #f85149; }
.price-down { color: #3fb950; }
.stock-change { font-size: 15px; margin-top: 4px; }
.stock-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px; flex: 1; min-width: 300px;
}
.meta-item { text-align: center; }
.meta-label { font-size: 11px; color: #8b949e; margin-bottom: 4px; }
.meta-value { font-size: 14px; font-weight: 600; color: #c9d1d9; }

/* 图表卡片 */
.chart-card {
  background: #161b22; border: 1px solid #30363d; border-radius: 10px; padding: 16px;
}
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.chart-title { font-size: 15px; font-weight: 600; color: #f0f6fc; }
.signal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 12px; }
#klineChart { width: 100%; height: 650px; }

/* ===== L1-L4 信号时间轴（K 线下方） ===== */
.signal-strip-wrap {
  margin-top: 8px; padding: 8px 12px;
  background: #0d1117; border: 1px solid #30363d; border-radius: 8px;
}
.signal-strip-label {
  font-size: 11px; color: #8b949e; margin-bottom: 4px; font-weight: 600;
}
.signal-strip-chart { width: 100%; height: 90px; }

/* ===== 3.20 K线图回测可视化 ===== */
.backtest-overlay-badge {
  display: inline-block;
  padding: 4px 10px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(88,166,255,0.18), rgba(188,140,255,0.18));
  border: 1px solid rgba(88,166,255,0.4);
  color: #58a6ff; font-size: 12px; font-weight: 600;
}
.backtest-period-toggles {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 4px 8px; background: #0d1117; border-radius: 6px;
  border: 1px solid rgba(88,166,255,0.25);
}
.period-toggle-btn {
  padding: 3px 10px; border: 1px solid #30363d; border-radius: 4px;
  background: #161b22; color: #8b949e; font-size: 11px; cursor: pointer;
  transition: all 0.15s;
}
.period-toggle-btn:hover { background: #21262d; color: #c9d1d9; }
.period-toggle-btn.active {
  background: linear-gradient(135deg, #238636, #2ea043);
  border-color: #2ea043; color: white; font-weight: 600;
}
.btn-clear-overlay {
  padding: 3px 10px; font-size: 11px; margin-left: 4px;
}

/* 回测信号点右键菜单（3.20.3） */
.bt-point-menu {
  position: fixed; z-index: 9999;
  min-width: 200px;
  background: #161b22; border: 1px solid #30363d; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  padding: 4px; opacity: 0; transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
.bt-point-menu.show { opacity: 1; transform: translateY(0); }
.bt-menu-title {
  padding: 8px 12px; font-size: 12px; color: #58a6ff;
  border-bottom: 1px solid #21262d; margin-bottom: 4px; font-weight: 600;
}
.bt-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; background: transparent; border: none;
  color: #c9d1d9; font-size: 13px; cursor: pointer; border-radius: 4px;
  transition: background 0.15s;
}
.bt-menu-item:hover { background: #21262d; }
.bt-menu-cancel { color: #8b949e; }

/* 月度胜率热力条（3.20.2） */
.backtest-heatmap-wrap {
  margin-top: 12px; padding: 10px;
  background: #0d1117; border: 1px solid #30363d; border-radius: 8px;
}
.heatmap-title { font-size: 12px; color: #58a6ff; font-weight: 600; margin-bottom: 6px; }
.heatmap-chart { width: 100%; height: 110px; }
.heatmap-legend { display: flex; gap: 12px; margin-top: 6px; font-size: 11px; color: #8b949e; }
.heatmap-legend-item { display: flex; align-items: center; gap: 4px; }
.heatmap-legend-item .legend-dot {
  width: 10px; height: 10px; border-radius: 2px;
  display: inline-block;
}

/* 右侧面板 */
.right-panel {
  display: flex; flex-direction: column; gap: 14px;
  min-height: 0; overflow-y: auto; padding-right: 4px;
}
.right-panel::-webkit-scrollbar { width: 6px; }
.right-panel::-webkit-scrollbar-track { background: #161b22; }
.right-panel::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
.card { background: #161b22; border: 1px solid #30363d; border-radius: 10px; padding: 16px; }
.card-title {
  font-size: 14px; font-weight: 600; color: #f0f6fc; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px; border-bottom: 1px solid #21262d;
}
.card-title::before {
  content: ''; width: 3px; height: 14px;
  background: linear-gradient(180deg, #58a6ff, #bc8cff); border-radius: 2px;
}

/* 综合评分 */
.score-container { display: flex; gap: 16px; align-items: center; }
#scoreChart { width: 150px; height: 150px; flex-shrink: 0; }
.score-details { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.score-item { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.score-bar { flex: 1; height: 6px; background: #21262d; border-radius: 3px; margin: 0 10px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.score-final { text-align: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid #21262d; }
.score-final-label { font-size: 12px; color: #8b949e; }
.score-final-value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.judgment-bullish { color: #f85149; }
.judgment-neutral { color: #d29922; }
.judgment-bearish { color: #3fb950; }

/* 信号卡片 */
.signal-list { display: flex; flex-direction: column; gap: 8px; }
.signal-item {
  padding: 10px 12px; border-radius: 8px; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
  background: #0d1117; border-left: 3px solid;
}
.signal-buy { border-color: #f85149; }
.signal-add { border-color: #db6d28; }
.signal-reduce { border-color: #39c5cf; }
.signal-sell { border-color: #3fb950; }
.signal-manual { border-color: #58a6ff; }
.signal-date { color: #8b949e; font-size: 12px; }
.signal-conf { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: rgba(255,255,255,0.08); }
.xinyi-tag {
  display: inline-block; background: linear-gradient(135deg, #ffd700, #ffb700);
  color: #161b22; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; font-weight: 700; margin-left: 4px;
}

/* 量价关系 */
.vp-card {
  background: linear-gradient(135deg, rgba(88,166,255,0.08), rgba(188,140,255,0.08));
  border: 1px solid rgba(88,166,255,0.2); padding: 12px; border-radius: 8px;
  font-size: 14px; font-weight: 600; text-align: center;
}
.vp-detail { margin-top: 8px; font-size: 12px; color: #8b949e; font-weight: normal; }

/* 情绪周期 */
.emotion-phase { text-align: center; padding: 20px; border-radius: 8px; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.emotion-ice { background: rgba(56,139,253,0.15); color: #388bfd; }
.emotion-start { background: rgba(188,140,255,0.15); color: #bc8cff; }
.emotion-main { background: rgba(248,81,73,0.15); color: #f85149; }
.emotion-fade { background: rgba(63,185,80,0.15); color: #3fb950; }
.emotion-suggest { font-size: 12px; color: #8b949e; line-height: 1.6; padding: 8px; background: #0d1117; border-radius: 6px; }

/* 游资形态 */
.morph-list { display: flex; flex-direction: column; gap: 6px; }
.morph-item { padding: 8px 10px; background: #0d1117; border-radius: 6px; font-size: 12px; display: flex; justify-content: space-between; }
.morph-name { color: #ffd700; font-weight: 600; }
.morph-date { color: #8b949e; }

/* 分时承接 */
.chengjie-display { text-align: center; padding: 16px; border-radius: 8px; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.chengjie-strong { background: rgba(248,81,73,0.15); color: #f85149; }
.chengjie-mid { background: rgba(210,153,34,0.15); color: #d29922; }
.chengjie-weak { background: rgba(63,185,80,0.15); color: #3fb950; }

/* ===== 分时图分析 ===== */
.intraday-summary {
  padding: 10px 12px; background: linear-gradient(135deg, rgba(88,166,255,0.08), rgba(188,140,255,0.08));
  border: 1px solid rgba(88,166,255,0.2); border-radius: 8px;
  font-size: 13px; color: #c9d1d9; line-height: 1.6; margin-bottom: 10px;
}
.intraday-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px; margin-bottom: 10px;
}
.intraday-stat {
  background: #0d1117; border-radius: 6px; padding: 6px 8px; text-align: center;
}
.intraday-stat-label { font-size: 10px; color: #8b949e; }
.intraday-stat-value { font-size: 13px; font-weight: 600; margin-top: 2px; }
.peak-list { display: flex; flex-direction: column; gap: 6px; }
.peak-item {
  padding: 8px 10px; background: #0d1117; border-radius: 6px; font-size: 12px;
  border-left: 3px solid;
}
.peak-attack { border-color: #f85149; }
.peak-duidao { border-color: #d29922; }
.peak-chuhuo { border-color: #3fb950; }
.peak-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.peak-type { font-weight: 600; }
.peak-time { color: #8b949e; font-size: 11px; }
.peak-desc { color: #8b949e; line-height: 1.5; }
.tail-action {
  margin-top: 8px; padding: 8px 10px; border-radius: 6px; font-size: 12px;
  background: rgba(210,153,34,0.1); border: 1px solid rgba(210,153,34,0.25);
}
.tail-action strong { color: #d29922; }

/* ===== 主力行为分析 ===== */
.mainforce-intent {
  text-align: center; padding: 14px; border-radius: 8px; font-size: 16px; font-weight: 700;
  margin-bottom: 10px;
}
.intent-吸筹 { background: rgba(248,81,73,0.15); color: #f85149; }
.intent-洗盘 { background: rgba(188,140,255,0.15); color: #bc8cff; }
.intent-拉升 { background: rgba(210,153,34,0.15); color: #d29922; }
.intent-出货 { background: rgba(63,185,80,0.15); color: #3fb950; }
.intent-观望 { background: rgba(139,148,158,0.15); color: #8b949e; }
.intent-desc { font-size: 12px; color: #8b949e; font-weight: normal; margin-top: 6px; }
.fund-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px;
}
.fund-item {
  padding: 8px 10px; background: #0d1117; border-radius: 6px; text-align: center;
  border-left: 3px solid;
}
.fund-inflow { border-color: #f85149; }
.fund-outflow { border-color: #3fb950; }
.fund-label { font-size: 11px; color: #8b949e; margin-bottom: 2px; }
.fund-value { font-size: 14px; font-weight: 700; }
.fund-value-up { color: #f85149; }
.fund-value-down { color: #3fb950; }
.evidence-list { font-size: 12px; color: #8b949e; line-height: 1.7; }
.evidence-list li { padding: 2px 0; list-style: none; }
.evidence-list li::before { content: '▸ '; color: #58a6ff; }

/* ===== 明日交易计划 ===== */
.plan-bias-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 14px; font-weight: 600;
}
.bias-偏多 { background: rgba(248,81,73,0.15); color: #f85149; }
.bias-中性 { background: rgba(139,148,158,0.15); color: #8b949e; }
.bias-偏空 { background: rgba(63,185,80,0.15); color: #3fb950; }
.plan-prices {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px;
}
.plan-price {
  padding: 8px 10px; background: #0d1117; border-radius: 6px; text-align: center;
}
.plan-price-label { font-size: 11px; color: #8b949e; }
.plan-price-value { font-size: 14px; font-weight: 700; margin-top: 2px; }
.action-list { display: flex; flex-direction: column; gap: 6px; }
.action-item {
  padding: 8px 10px; background: #0d1117; border-radius: 6px;
  font-size: 12px; line-height: 1.5; color: #c9d1d9;
}

/* ===== 盘口语言综合解读卡片 ===== */
.pankou-state {
  text-align: center; padding: 14px; border-radius: 8px; margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(88,166,255,0.1), rgba(188,140,255,0.1));
  border: 1px solid rgba(88,166,255,0.2);
}
.pankou-state.strong-bull {
  background: linear-gradient(135deg, rgba(248,81,73,0.25), rgba(210,153,34,0.2));
  border-color: rgba(248,81,73,0.5);
}
.pankou-state.bull {
  background: rgba(248,81,73,0.15);
  border-color: rgba(248,81,73,0.3);
}
.pankou-state.neutral {
  background: rgba(139,148,158,0.1);
  border-color: rgba(139,148,158,0.25);
}
.pankou-state.bear {
  background: rgba(63,185,80,0.15);
  border-color: rgba(63,185,80,0.3);
}
.pankou-state.strong-bear {
  background: linear-gradient(135deg, rgba(63,185,80,0.25), rgba(188,140,255,0.2));
  border-color: rgba(63,185,80,0.5);
}
.pankou-state-label { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.pankou-state.strong-bull .pankou-state-label,
.pankou-state.bull .pankou-state-label { color: #f85149; }
.pankou-state.neutral .pankou-state-label { color: #8b949e; }
.pankou-state.bear .pankou-state-label,
.pankou-state.strong-bear .pankou-state-label { color: #3fb950; }
.pankou-state-score { font-size: 11px; color: #8b949e; margin-top: 4px; }
.pankou-summary {
  font-size: 12px; color: #c9d1d9; line-height: 1.6; padding: 8px 10px;
  background: #0d1117; border-radius: 6px; margin-bottom: 10px;
}
.pankou-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;
}
.pankou-stat {
  padding: 10px 8px; background: #0d1117; border-radius: 6px; text-align: center;
}
.pankou-stat .stat-num { font-size: 22px; font-weight: 800; display: block; }
.pankou-stat .stat-num.bull { color: #f85149; }
.pankou-stat .stat-num.bear { color: #3fb950; }
.pankou-stat .stat-label { font-size: 11px; color: #8b949e; }

.pankou-section {
  margin-top: 6px; border: 1px solid #21262d; border-radius: 6px;
  background: #0d1117; padding: 6px 10px;
}
.pankou-section summary {
  cursor: pointer; font-size: 12px; color: #58a6ff; font-weight: 600;
  padding: 2px 0; user-select: none;
}
.pankou-section summary:hover { color: #79c0ff; }
.pankou-section[open] summary { margin-bottom: 6px; }
.pankou-sig-list { display: flex; flex-direction: column; gap: 4px; }
.pankou-sig-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; background: #161b22; border-radius: 4px; font-size: 12px;
}
.pankou-sig-item.sig-bull { border-left: 3px solid #f85149; }
.pankou-sig-item.sig-bear { border-left: 3px solid #3fb950; }
.pankou-sig-item.sig-neutral { border-left: 3px solid #8b949e; }
.pankou-sig-item .sig-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 600;
}
.sig-bull .sig-tag { background: rgba(248,81,73,0.2); color: #f85149; }
.sig-bear .sig-tag { background: rgba(63,185,80,0.2); color: #3fb950; }
.sig-neutral .sig-tag { background: rgba(139,148,158,0.2); color: #8b949e; }
.pankou-sig-item .sig-name { flex: 1; color: #c9d1d9; }
.pankou-sig-item .sig-date { color: #8b949e; font-size: 11px; }

.pankou-evidence-list { display: flex; flex-direction: column; gap: 4px; }
.evidence-item {
  display: flex; flex-direction: column; gap: 2px; padding: 6px 8px;
  background: #161b22; border-radius: 4px; font-size: 12px; line-height: 1.5;
}
.evidence-item.evidence-bull { border-left: 3px solid #f85149; }
.evidence-item.evidence-bear { border-left: 3px solid #3fb950; }
.evidence-source { font-size: 10px; color: #58a6ff; font-weight: 600; }
.evidence-desc { color: #8b949e; }

/* ===== 历史分时图弹窗 ===== */
.intraday-modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s, visibility 0s 0.2s;
}
.intraday-modal.show {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s;
}
.intraday-modal-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}
.intraday-modal-content {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(1100px, 95vw);
  max-height: 90vh;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}
.intraday-modal.show .intraday-modal-content {
  transform: translate(-50%, -50%) scale(1);
}
.intraday-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #21262d;
  background: linear-gradient(135deg, #161b22, #0d1117);
}
.intraday-modal-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 16px; color: #c9d1d9; font-weight: 600;
}
.intraday-hint {
  font-size: 11px; color: #8b949e; font-weight: normal;
  padding: 2px 8px; background: rgba(139,148,158,0.1);
  border-radius: 3px;
}
.intraday-close {
  background: transparent; border: none; color: #8b949e;
  font-size: 24px; cursor: pointer; padding: 0 8px; line-height: 1;
  border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.intraday-close:hover {
  color: #f85149; background: rgba(248,81,73,0.1);
}
.intraday-modal-body {
  flex: 1; overflow: auto;
  padding: 16px 20px;
}
.intraday-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.intraday-stat {
  background: #161b22;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
  border-left: 2px solid #30363d;
}
.intraday-stat .lbl {
  display: block;
  font-size: 11px;
  color: #8b949e;
  margin-bottom: 4px;
}
.intraday-stat .val {
  font-size: 14px;
  font-weight: 600;
  color: #c9d1d9;
}
.intraday-stat .val.num-up { color: #f85149; }
.intraday-stat .val.num-down { color: #3fb950; }
.intraday-chart {
  width: 100%;
  height: 420px;
  background: #161b22;
  border-radius: 8px;
  padding: 8px;
  box-sizing: border-box;
}
.intraday-loading, .intraday-error {
  text-align: center;
  padding: 40px;
  color: #8b949e;
  font-size: 14px;
}
.intraday-error {
  color: #d29922;
}

/* 鼠标移到 K 线时显示指针光标 */
#klineChart {
  cursor: pointer;
}

/* 表格 */
.info-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.info-table td { padding: 8px 6px; border-bottom: 1px solid #21262d; }
.info-table td:first-child { color: #8b949e; width: 40%; }
.data-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.data-table th { padding: 10px 8px; text-align: left; border-bottom: 2px solid #30363d; color: #8b949e; font-weight: 600; font-size: 12px; }
.data-table td { padding: 8px; border-bottom: 1px solid #21262d; }
.data-table tr:hover { background: #1c2128; }

/* 表单 */
.form-group { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: #8b949e; }
.form-group input, .form-group select, .form-group textarea {
  padding: 8px 10px; background: #0d1117; border: 1px solid #30363d;
  border-radius: 6px; color: #c9d1d9; font-size: 13px; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #58a6ff; }
.form-row { display: flex; gap: 8px; }
.form-row > * { flex: 1; }

/* 进度条 */
.progress-bar { width: 100%; height: 20px; background: #0d1117; border-radius: 10px; overflow: hidden; border: 1px solid #30363d; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #238636, #2ea043); transition: width 0.3s ease; }
.progress-text { text-align: center; font-size: 12px; line-height: 20px; color: white; font-weight: 600; }

/* 标签页 */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; background: #0d1117; padding: 4px; border-radius: 8px; }
.tab { flex: 1; padding: 6px 8px; text-align: center; font-size: 12px; cursor: pointer; border-radius: 6px; color: #8b949e; transition: all 0.2s; }
.tab.active { background: linear-gradient(135deg, #238636, #2ea043); color: white; font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* 提示 */
.empty-tip { text-align: center; padding: 30px 10px; color: #8b949e; font-size: 13px; }
.warn-tip { text-align: center; padding: 8px 10px; color: #d29922; background: rgba(187, 128, 9, 0.1); border: 1px solid rgba(187, 128, 9, 0.3); border-radius: 6px; font-size: 12px; margin-bottom: 8px; }
.error-tip { text-align: center; padding: 20px; color: #f85149; font-size: 13px; }
.loading { text-align: center; padding: 20px; color: #58a6ff; font-size: 13px; }
.spinner {
  display: inline-block; width: 16px; height: 16px; border: 2px solid #30363d;
  border-top-color: #58a6ff; border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 数字颜色 */
.num-up { color: #f85149; }
.num-down { color: #3fb950; }
.num-flat { color: #8b949e; }

/* Toast */
.toast {
  position: fixed; top: 80px; right: 20px; z-index: 9999;
  padding: 12px 20px; border-radius: 8px; font-size: 13px;
  background: #161b22; border: 1px solid #30363d; color: #c9d1d9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4); max-width: 360px;
  animation: slide-in 0.3s ease;
}
.toast-success { border-color: #3fb950; }
.toast-error { border-color: #f85149; }
.toast-info { border-color: #58a6ff; }
@keyframes slide-in { from { transform: translateX(400px); } to { transform: translateX(0); } }

/* 回测结果卡 */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.metric-card { background: #0d1117; padding: 12px; border-radius: 8px; text-align: center; }
.metric-card-label { font-size: 11px; color: #8b949e; margin-bottom: 4px; }
.metric-card-value { font-size: 18px; font-weight: 700; }
.metric-card-sub { font-size: 11px; color: #8b949e; margin-top: 2px; }

.level-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600; color: white;
}
.level-1 { background: #f85149; }
.level-2 { background: #db6d28; }
.level-3 { background: #39c5cf; }
.level-4 { background: #3fb950; }

footer { text-align: center; padding: 20px; color: #8b949e; font-size: 12px; border-top: 1px solid #21262d; margin-top: 20px; }

/* ===== 精简模式：隐藏低优先级卡片 ===== */
body.compact-mode .card-optional { display: none; }

/* ===== K线图标记开关 ===== */
.chart-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.marker-toggles { display: flex; gap: 4px; }
.marker-toggle {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 4px; cursor: pointer;
  background: #161b22; border: 1px solid #30363d; font-size: 11px; color: #8b949e;
  transition: all 0.15s;
}
.marker-toggle:hover { border-color: #58a6ff; color: #c9d1d9; }
.marker-toggle input { margin: 0; cursor: pointer; }
.btn-backtest { font-size: 12px; padding: 4px 12px; white-space: nowrap; }

/* ===== 右侧面板工具栏 ===== */
.panel-toolbar { padding: 0 0 8px 0; }
.btn-compact-toggle { font-size: 12px; padding: 4px 12px; }

/* ===== 禁用指标提示卡片 ===== */
.disabled-notice {
  display: flex; align-items: center; gap: 4px;
  background: rgba(63, 185, 80, 0.08); border: 1px solid rgba(63, 185, 80, 0.3);
  padding: 8px 12px; font-size: 12px; color: #3fb950;
}
.disabled-icon { font-size: 14px; }

/* ===== 回测结果弹窗表格 ===== */
.bt-result-content { max-width: 800px; }
.bt-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.bt-table th { text-align: left; padding: 6px 8px; color: #8b949e; border-bottom: 1px solid #30363d; font-weight: 600; }
.bt-table td { padding: 6px 8px; border-bottom: 1px solid #21262d; color: #c9d1d9; }
.bt-table tr.row-disabled td { opacity: 0.5; }
.bt-table tr.row-disabled td:first-child { text-decoration: line-through; }
.badge-disabled { background: rgba(248, 81, 73, 0.15); color: #f85149; padding: 1px 6px; border-radius: 3px; font-size: 10px; }
.badge-active { background: rgba(63, 185, 80, 0.15); color: #3fb950; padding: 1px 6px; border-radius: 3px; font-size: 10px; }
.bt-table h4 { color: #c9d1d9; margin: 8px 0 4px; font-size: 13px; }

/* ===== 法律与合规：风险提示弹窗 ===== */
.risk-modal { position: fixed; inset: 0; z-index: 9999; display: none; }
.risk-modal.show { display: block; }
.risk-modal-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
.risk-modal-content {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #161b22 0%, #1c2128 100%);
  border: 1px solid #30363d; border-radius: 12px;
  max-width: 520px; width: 90%; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  animation: risk-modal-in 0.3s ease;
}
@keyframes risk-modal-in {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
.risk-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 24px; border-bottom: 1px solid #30363d;
}
.risk-icon { font-size: 22px; }
.risk-title {
  font-size: 17px; font-weight: 700; color: #f85149;
}
.risk-modal-body { padding: 20px 24px; line-height: 1.7; color: #c9d1d9; font-size: 14px; }
.risk-modal-body p { margin-bottom: 12px; }
.risk-modal-body ul { margin: 8px 0 12px 20px; }
.risk-modal-body li { margin-bottom: 6px; color: #8b949e; }
.risk-modal-body strong { color: #f85149; font-weight: 600; }
.risk-confirm-text {
  margin-top: 16px; padding: 10px 12px;
  background: rgba(248, 81, 73, 0.08); border-left: 3px solid #f85149;
  border-radius: 4px; font-size: 13px; color: #8b949e;
}
.risk-modal-footer {
  padding: 16px 24px; border-top: 1px solid #30363d;
  text-align: right;
}
.risk-modal-footer .btn { min-width: 160px; }

/* ===== 信号卡片"仅供参考"角标 ===== */
.disclaimer-tag {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 1px 6px; margin-left: 6px;
  background: rgba(248, 81, 73, 0.12); color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.3); border-radius: 3px;
  vertical-align: middle;
}

/* ===== 信号历史与反馈（3.15） ===== */
.feedback-btns { display: flex; gap: 4px; }
.fb-btn {
  width: 26px; height: 26px; border-radius: 4px; cursor: pointer;
  border: 1px solid #30363d; background: #161b22; color: #8b949e;
  font-size: 14px; font-weight: 700; line-height: 1; transition: all 0.2s;
}
.fb-btn:hover { border-color: #58a6ff; color: #c9d1d9; }
.fb-btn.fb-active[data-fb="correct"] { background: rgba(63,185,80,0.2); color: #3fb950; border-color: #3fb950; }
.fb-btn.fb-active[data-fb="wrong"] { background: rgba(248,81,73,0.2); color: #f85149; border-color: #f85149; }
.fb-btn.fb-active[data-fb="uncertain"] { background: rgba(210,153,34,0.2); color: #d29922; border-color: #d29922; }
.signal-ret { font-size: 11px; margin-left: 6px; font-weight: 600; }

/* ===== 交易日志（3.15） ===== */
.trade-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; margin-top: 6px;
  background: #161b22; border: 1px solid #30363d; border-radius: 6px;
  font-size: 13px;
}
.trade-action { font-weight: 700; margin-right: 6px; padding: 1px 6px; border-radius: 3px; font-size: 12px; }
.trade-action.num-up { background: rgba(248,81,73,0.15); color: #f85149; }
.trade-action.num-down { background: rgba(63,185,80,0.15); color: #3fb950; }

/* ===== 信号详情弹窗（3.14） ===== */
.sd-section { margin-bottom: 16px; }
.sd-section h4 { color: #c9d1d9; margin: 0 0 8px; font-size: 14px; border-bottom: 1px solid #30363d; padding-bottom: 4px; }
.sd-section .info-table td { padding: 4px 8px; font-size: 13px; }

/* ===== 自适应信号筛选（3.17） ===== */
.prio-tag { font-size: 10px; margin-left: 6px; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.prio-tag.prio-core { background: rgba(63,185,80,0.15); color: #3fb950; border: 1px solid rgba(63,185,80,0.3); }
.prio-tag.prio-ref { background: rgba(88,166,255,0.15); color: #58a6ff; border: 1px solid rgba(88,166,255,0.3); }
.prio-tag.prio-noise { background: rgba(139,148,158,0.1); color: #8b949e; border: 1px solid rgba(139,148,158,0.2); }
/* 精简模式：隐藏噪音信号 */
body.compact-mode .signal-item.prio-noise { display: none; }

/* 今日信号卡片筹码小标注 */
.chip-hint {
  margin-top: 4px; font-size: 11px; color: #7ee787;
  background: rgba(63,185,80,0.08); border: 1px solid rgba(63,185,80,0.2);
  border-radius: 4px; padding: 1px 6px; display: inline-block;
}

/* ===== 界面简化配置（3.18） ===== */
.settings-modal { position: fixed; inset: 0; z-index: 9998; display: none; }
.settings-modal.show { display: block; }
.settings-modal-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.settings-modal-content {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: #161b22; border: 1px solid #30363d; border-radius: 10px;
  max-width: 420px; width: 90%; padding: 20px 24px;
}
.settings-modal-content h3 { color: #c9d1d9; margin-bottom: 16px; font-size: 16px; }
.settings-section { margin-bottom: 16px; }
.settings-section label { display: block; color: #8b949e; font-size: 12px; margin-bottom: 6px; }
.mode-buttons { display: flex; gap: 8px; }
.mode-btn {
  flex: 1; padding: 8px; border-radius: 6px; cursor: pointer;
  border: 1px solid #30363d; background: #0d1117; color: #8b949e;
  font-size: 13px; text-align: center; transition: all 0.2s;
}
.mode-btn:hover { border-color: #58a6ff; }
.mode-btn.active { background: rgba(88,166,255,0.15); border-color: #58a6ff; color: #58a6ff; }
.card-toggle-list { display: flex; flex-direction: column; gap: 6px; }
.card-toggle-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 4px; cursor: pointer; font-size: 13px; color: #c9d1d9;
}
.card-toggle-item:hover { background: #21262d; }

/* ===== 多时间周期切换（3.16） ===== */
.period-switcher { display: inline-flex; gap: 2px; margin-left: 12px; vertical-align: middle; }
.period-btn {
  padding: 3px 10px; border-radius: 4px; cursor: pointer; font-size: 11px;
  border: 1px solid #30363d; background: #0d1117; color: #8b949e; transition: all 0.2s;
}
.period-btn:hover { border-color: #58a6ff; color: #c9d1d9; }
.period-btn.active { background: rgba(88,166,255,0.15); border-color: #58a6ff; color: #58a6ff; }

/* ===== 骨架屏（10. 性能要求） ===== */
.skeleton {
  background: linear-gradient(90deg, #21262d 25%, #30363d 50%, #21262d 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-card { padding: 16px; background: #161b22; border: 1px solid #30363d; border-radius: 8px; }

/* ===== 首页仪表盘（11.） ===== */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; padding: 16px; max-width: 1200px; margin: 0 auto; }
.dash-card { background: linear-gradient(135deg, #161b22 0%, #1c2128 100%); border: 1px solid #30363d; border-radius: 10px; padding: 20px; }
.dash-card h3 { color: #c9d1d9; margin-bottom: 12px; font-size: 15px; border-bottom: 1px solid #30363d; padding-bottom: 8px; }
.dash-stat { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 14px; }
.dash-stat-value { font-size: 18px; font-weight: 700; }

/* ===== 11. 首页仪表盘 ===== */
.dashboard-card {
  background: linear-gradient(135deg, #161b22 0%, #1c2128 100%);
  border: 1px solid #30363d; border-radius: 10px; padding: 16px;
  min-width: 0;
  overflow: hidden;
}
.dashboard-card .card-title {
  font-size: 15px; font-weight: 600; color: #f0f6fc; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid #21262d;
  display: flex; align-items: center; gap: 8px;
}
.dashboard-card > div[id$="Body"] {
  overflow-x: auto;
}
.dashboard-card .card-title::before {
  content: ''; width: 3px; height: 14px;
  background: linear-gradient(180deg, #58a6ff, #bc8cff); border-radius: 2px;
}

/* KPI 网格 */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.kpi-item {
  background: #0d1117; border: 1px solid #21262d; border-radius: 8px; padding: 10px;
  text-align: center;
}
.kpi-label { font-size: 11px; color: #8b949e; margin-bottom: 4px; }
.kpi-value { font-size: 18px; font-weight: 700; color: #f0f6fc; }
.kpi-sub { font-size: 11px; color: #8b949e; margin-top: 2px; }

/* 持仓列表 */
.holding-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.holding-row {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 10px; align-items: center;
  padding: 8px 10px; background: #0d1117; border-radius: 6px;
  font-size: 13px; transition: background 0.15s;
}
.holding-row:hover { background: #21262d; }
.holding-name { color: #f0f6fc; font-weight: 500; }
.holding-shares { color: #8b949e; font-size: 11px; }
.holding-price { font-weight: 600; min-width: 90px; text-align: right; }
.holding-pnl { font-weight: 600; min-width: 100px; text-align: right; }
.holding-pnl-pct { font-size: 11px; color: #8b949e; }

/* 市场情绪 */
.market-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px; margin: 10px 0;
}
.market-stat {
  background: #0d1117; border-radius: 6px; padding: 8px; text-align: center;
  border-left: 3px solid #30363d;
}
.market-stat.up { border-color: #f85149; }
.market-stat.down { border-color: #3fb950; }
.ms-label { font-size: 11px; color: #8b949e; }
.ms-value { font-size: 16px; font-weight: 700; color: #c9d1d9; margin-top: 2px; }
.market-detail { margin-top: 8px; }
.market-detail summary {
  cursor: pointer; font-size: 12px; color: #58a6ff; padding: 6px 0;
}
.market-detail summary:hover { text-decoration: underline; }

/* 信号列表 */
.signal-row { cursor: pointer; transition: background 0.15s; }
.signal-row:hover { background: #21262d; }

/* 回测列表 */
.backtest-list { display: flex; flex-direction: column; gap: 8px; }
.backtest-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px; background: #0d1117; border-radius: 6px;
  text-decoration: none; color: #c9d1d9; font-size: 13px;
  transition: background 0.15s;
}
.backtest-row:hover { background: #21262d; }
.bt-meta { font-size: 12px; color: #8b949e; }
.bt-stats { display: flex; gap: 12px; font-weight: 600; }
.badge-running {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: rgba(210,153,34,0.15); color: #d29922;
  border: 1px solid rgba(210,153,34,0.3); font-size: 11px; font-weight: 600;
}
.badge-active {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: rgba(63,185,80,0.15); color: #3fb950;
  border: 1px solid rgba(63,185,80,0.3); font-size: 11px; font-weight: 600;
}
.badge-disabled {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: rgba(248,81,73,0.15); color: #f85149;
  border: 1px solid rgba(248,81,73,0.3); font-size: 11px; font-weight: 600;
}

/* 导出按钮（3.21） */
.btn-export {
  padding: 4px 10px !important; font-size: 12px !important;
}
.btn-export-mini {
  padding: 2px 8px !important; font-size: 12px !important;
  margin-left: auto;
}
.card-title .btn-export-mini { margin-left: auto; }

/* 宏观环境模块（国信宏观 skill） */
.macro-list { display: flex; flex-direction: column; gap: 8px; }
.macro-item {
  padding: 8px 12px; border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  font-size: 14px; line-height: 1.5;
}
.macro-item b, .macro-item strong { color: #58a6ff; }

/* ===== 自选股列表（实时价 + 添加价 + 涨幅预判） ===== */
.watch-list { display: flex; flex-direction: column; gap: 6px; }
.watch-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: #0d1117; border: 1px solid #21262d;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.watch-row:hover { border-color: #30363d; background: #161b22; }
.watch-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.watch-info .watch-name {
  font-size: 13px; font-weight: 600; color: #f0f6fc;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.watch-info .watch-code { font-size: 11px; color: #8b949e; }
.watch-prices { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; min-width: 88px; }
.watch-price-now { font-size: 14px; font-weight: 700; }
.watch-price-add { font-size: 11px; color: #8b949e; white-space: nowrap; }
.watch-gain {
  font-size: 14px; font-weight: 700; min-width: 64px; text-align: right;
}
.watch-del {
  color: #8b949e; font-size: 13px; cursor: pointer; padding: 2px 4px;
  border-radius: 4px; transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.watch-del:hover { color: #f85149; background: rgba(248,81,73,0.1); }

/* ===== 手机端适配（单股分析页） ===== */
@media (max-width: 768px) {
  /* 根容器：禁止页面级横向溢出，消除水平滚动条 */
  html, body.page-analyze, body.page-analyze .app-wrap {
    height: auto; min-height: 100vh;
    overflow: visible;
    overflow-x: hidden;
  }
  body.page-analyze .main-container {
    display: block;
    overflow: visible; min-height: 0; flex: none;
    padding: 8px; gap: 0;
    max-width: 100%;
  }
  body.page-analyze .left-panel,
  body.page-analyze .right-panel {
    overflow: visible; min-height: 0; overflow-y: visible;
    overflow-x: hidden;
    gap: 8px;
  }

  /* ========== 顶部导航：两行模式（Logo+操作按钮 | 搜索框），导航/快捷/设置藏入横向滚动 ========== */
  body.page-analyze .top-nav {
    padding: 6px 10px; gap: 6px 8px;
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid #21262d;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  body.page-analyze .top-nav .logo {
    font-size: 14px; grid-column: 1 / 2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body.page-analyze .top-nav .search-box {
    grid-column: 1 / -1;
    max-width: none; flex: none;
  }
  body.page-analyze .top-nav .search-box input {
    padding: 6px 10px; font-size: 13px;
    background: #0a0d12;
    border: 1px solid #30363d;
    border-radius: 18px;
  }
  body.page-analyze .top-nav .nav-links {
    grid-column: 1 / -1;
    order: 5;
    display: flex; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 2px; padding: 2px 0;
    scrollbar-width: none;
  }
  body.page-analyze .top-nav .nav-links::-webkit-scrollbar { display: none; }
  body.page-analyze .top-nav .nav-link {
    padding: 4px 8px; font-size: 11px;
    white-space: nowrap; flex-shrink: 0;
    border-radius: 4px;
  }
  body.page-analyze .top-nav .quick-btns {
    grid-column: 1 / -1;
    order: 6;
    display: flex; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 4px; padding: 2px 0;
    scrollbar-width: none;
  }
  body.page-analyze .top-nav .quick-btns::-webkit-scrollbar { display: none; }
  body.page-analyze .top-nav .quick-btn {
    padding: 3px 8px; font-size: 11px;
    white-space: nowrap; flex-shrink: 0;
    background: #21262d; border-color: #30363d;
  }
  body.page-analyze .top-nav .nav-actions {
    grid-column: 2 / 3;
    display: flex; gap: 6px; align-items: center;
    justify-content: flex-end;
  }
  body.page-analyze .top-nav #settingsBtn {
    padding: 4px 8px; font-size: 11px;
  }
  body.page-analyze .top-nav .nav-actions .data-source-tag { display: none; }

  /* ========== 股票信息条：名码合并、价格醒目、行情数据紧凑网格 ========== */
  body.page-analyze .stock-info-bar {
    padding: 12px; gap: 10px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "name price"
      "meta meta";
  }
  /* 名码区 */
  body.page-analyze .stock-info-bar > div:first-child { grid-area: name; }
  body.page-analyze .stock-name { font-size: 16px; line-height: 1.2; }
  body.page-analyze .stock-code { font-size: 11px; margin-top: 2px; }
  /* 价涨跌区 */
  body.page-analyze .stock-info-bar > div:nth-child(2) {
    grid-area: price;
    text-align: right;
    display: flex; flex-direction: column;
    justify-content: center;
    align-items: flex-end;
  }
  body.page-analyze .stock-price { font-size: 24px; line-height: 1.1; font-weight: 800; }
  body.page-analyze .stock-change { font-size: 12px; margin-top: 4px; line-height: 1.2; }
  /* 行情网格（7项：今开/昨收/最高/最低/量/额/换手 → 2列紧凑） */
  body.page-analyze .stock-meta {
    grid-area: meta;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px 4px;
    flex: none;
    padding-top: 8px;
    border-top: 1px dashed #21262d;
  }
  body.page-analyze .meta-item { text-align: left; }
  body.page-analyze .meta-label {
    font-size: 10px; margin-bottom: 1px;
    color: #6e7681;
  }
  body.page-analyze .meta-value {
    font-size: 12px; font-weight: 600;
    color: #c9d1d9;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body.page-analyze .stock-info-bar > .tag-real {
    display: none;
  }

  /* ========== K线头部：手机端改为纵向堆叠，行内横向散开，避免拥挤 ========== */
  body.page-analyze .chart-card {
    padding: 10px 8px;
    border-radius: 12px;
  }
  body.page-analyze .chart-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 10px;
  }
  /* 第1行：标题与周期左右散开 */
  body.page-analyze .chart-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px; font-weight: 600;
    gap: 10px;
    min-width: 0;
  }
  body.page-analyze .period-switcher {
    display: inline-flex; gap: 4px;
    margin-left: 0;
    flex-shrink: 0;
  }
  body.page-analyze .period-switcher .period-btn {
    padding: 3px 10px; font-size: 11px;
    border-radius: 4px;
  }
  /* 第2行：marker toggles 横向均匀分布 */
  body.page-analyze .chart-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  body.page-analyze .marker-toggles {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
  }
  body.page-analyze .marker-toggles::-webkit-scrollbar { display: none; }
  body.page-analyze .marker-toggle {
    flex: 1 1 auto;
    justify-content: center;
    display: flex; align-items: center; gap: 4px;
    padding: 5px 6px;
    font-size: 12px;
    border-radius: 6px;
    background: rgba(22,27,34,0.8);
    border: 1px solid #30363d;
    white-space: nowrap;
  }
  body.page-analyze .marker-toggle input {
    width: 13px; height: 13px;
    flex-shrink: 0;
  }
  body.page-analyze .marker-toggle span {
    font-size: 12px; color: #c9d1d9;
  }
  /* 第3行：回测按钮右对齐 */
  body.page-analyze .btn-backtest {
    align-self: flex-end;
    padding: 5px 12px; font-size: 12px;
    white-space: nowrap;
    font-weight: 600;
  }
  /* 第4行：信号图例横向铺开，允许换行，间距更大 */
  body.page-analyze .signal-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 10px;
    font-size: 11px;
    padding-top: 8px;
    border-top: 1px solid #21262d;
    width: 100%;
  }
  body.page-analyze .signal-legend .legend-item {
    display: flex; align-items: center; gap: 4px;
    color: #8b949e;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: calc(33% - 8px);
    justify-content: center;
  }
  body.page-analyze .signal-legend .legend-dot {
    width: 13px; height: 13px;
    font-size: 12px;
    flex-shrink: 0;
  }
  /* MA图例：防止被右边缘截断 */
  body.page-analyze .chart-card .echarts-tooltip,
  body.page-analyze .chart-card > #klineChart {
    max-width: 100%;
    overflow: hidden;
  }

  /* ========== 回测叠加控件 ========== */
  body.page-analyze .backtest-overlay-badge {
    grid-column: 1 / -1;
    justify-self: start;
    font-size: 10px;
    padding: 2px 8px;
  }
  body.page-analyze .backtest-period-toggles {
    grid-column: 1 / -1;
    display: flex; flex-wrap: wrap; gap: 2px;
    padding: 2px 4px;
    font-size: 10px;
  }
  body.page-analyze .backtest-period-toggles > span { font-size: 10px; }
  body.page-analyze .period-toggle-btn {
    padding: 2px 6px; font-size: 10px;
  }
  body.page-analyze .btn-clear-overlay {
    padding: 2px 6px; font-size: 10px;
  }

  /* ========== K线+信号轴：视觉平衡 ========== */
  body.page-analyze #klineChart { height: 360px; }
  body.page-analyze .signal-strip-wrap {
    margin-top: 6px; padding: 6px 8px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(13,17,23,0.6), rgba(13,17,23,0.2));
    border: 1px solid rgba(48,54,61,0.8);
    backdrop-filter: blur(4px);
  }
  body.page-analyze .signal-strip-label {
    font-size: 10px; margin-bottom: 2px;
  }
  body.page-analyze .signal-strip-chart { height: 84px; }

  /* 窄屏（≤480px）进一步压缩，优先保证主图舒展 */
  @media (max-width: 480px) {
    body.page-analyze #klineChart { height: 320px; }
    body.page-analyze .chart-card {
      padding: 10px 8px;
      border-radius: 12px;
      background: linear-gradient(160deg, rgba(22,27,34,0.95), rgba(13,17,23,0.95));
      border: 1px solid rgba(48,54,61,0.7);
      box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    }
    body.page-analyze .signal-strip-chart { height: 78px; }
  }

  /* ========== 右侧分析卡片：紧凑化 ========== */
  body.page-analyze .right-panel { padding-right: 0; gap: 8px; }
  body.page-analyze .card {
    padding: 10px 12px;
    border-radius: 10px;
  }
  body.page-analyze .card-title {
    font-size: 12px; font-weight: 600;
    margin-bottom: 6px; padding-bottom: 6px;
  }
  body.page-analyze .info-table,
  body.page-analyze .data-table {
    font-size: 12px;
  }
  body.page-analyze .data-table th,
  body.page-analyze .data-table td {
    padding: 6px 4px;
  }
  body.page-analyze .info-table td { padding: 5px 4px; }

  /* 卡片中可能超宽的元素：表格、长文本、回测区间 */
  body.page-analyze .card > * { max-width: 100%; }
  body.page-analyze .card .data-table,
  body.page-analyze .card .info-table {
    display: block; width: 100%;
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.page-analyze .card .data-table::-webkit-scrollbar,
  body.page-analyze .card .info-table::-webkit-scrollbar { display: none; }

  /* footer 紧凑 */
  body.page-analyze footer {
    font-size: 10px; padding: 8px 10px;
    line-height: 1.4;
  }
}
