/* 主线挖掘 · 网页版（对齐全站 finance / plate_ranking 风格） */
body#mainlineMindmapPage {
  /* 密度页只加宽内容壳；gutter 沿用全局 --sa-topbar-px，与顶栏对齐 */
  --sa-topbar-max-width: 1560px;
  --text: var(--text-primary, #262626);
  --text-muted: var(--text-tertiary, #8c8c8c);
  --accent: var(--primary-color, #1a56a7);
  --accent-hover: var(--primary-hover, #4a90e2);
  --radius: var(--border-radius-lg, 12px);
  --radius-sm: var(--border-radius-md, 8px);
  --glass-bg: var(--bg-secondary, #fafbfc);
  --glass-border: var(--border-color, #e8eaed);
  --mlm-surface: rgba(255, 255, 255, 0.72);
  --mlm-card: var(--card-bg, #fff);
  --mlm-card-border: var(--border-color, #e8eaed);
  --mlm-card-hover: rgba(26, 86, 167, 0.06);
  --mlm-stock-bg: var(--card-bg, #fff);
  --mlm-stock-border: var(--border-light, #f0f2f5);
  --mlm-sub-bg: rgba(8, 145, 178, 0.07);
  --mlm-sub-border: rgba(8, 145, 178, 0.18);
  --mlm-evidence-bg: rgba(26, 86, 167, 0.08);
  --mlm-evidence-border: var(--accent);
  --mlm-reason-bg: rgba(15, 23, 42, 0.04);
  --mlm-accent-text: var(--accent);
  --mlm-accent-soft: rgba(26, 86, 167, 0.1);
  --mlm-teal-text: #0e7490;
  --mlm-teal-soft: rgba(8, 145, 178, 0.1);
  --mlm-chart-bg: rgba(255, 255, 255, 0.6);
  font-family: var(--font-family-base, "Lato", "PingFang SC", "Microsoft YaHei", sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-color, #f5f7fa);
  min-height: 100vh;
  color: var(--text-primary, #262626);
}

/* 水平 gutter 由 site_topbar .container / .sa-page-shell 提供；此处仅补垂直节奏 */
body#mainlineMindmapPage .container,
body#mainlineMindmapPage .sa-page-shell {
  padding-top: 16px;
  padding-bottom: 40px;
}

.mainline-page-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e8eaed);
  border-radius: var(--border-radius-lg, 12px);
  box-shadow: var(--shadow-card, 0 2px 12px rgba(0, 0, 0, 0.04));
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
  overflow: hidden;
}

.mainline-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px 0;
}

.mainline-page-kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary, #595959);
}

.mainline-page-title {
  display: none;
}

.mainline-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.mainline-page-actions .sa-toolbar-btn {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
}

.mainline-page-head__main {
  flex: 1;
  min-width: 0;
}

/* 盘面摘要区 */
.mlm-hero {
  padding: 14px 20px 0;
}

.mlm-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mlm-stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-light, #f0f2f5);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mlm-stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #8c8c8c);
}

.mlm-stat-value {
  font-family: "Lato", var(--font-family-base, sans-serif);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary, #262626);
}

.mlm-stat-value--mono {
  font-family: var(--font-family-number, "Roboto Mono", monospace);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.mlm-stat-unit {
  margin-left: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary, #8c8c8c);
}

.mlm-stat--rise {
  border-color: rgba(212, 56, 13, 0.18);
  background: linear-gradient(180deg, #fff7f5 0%, #fff 100%);
}

.mlm-stat--rise .mlm-stat-value {
  color: #c41d17;
}

.mlm-stat--cold {
  border-color: rgba(26, 86, 167, 0.2);
  background: linear-gradient(180deg, #f0f6ff 0%, #fff 100%);
}

.mlm-stat--cold .mlm-stat-value {
  color: var(--primary-color, #1a56a7);
}

.mlm-stat--neutral {
  border-color: rgba(8, 145, 178, 0.18);
  background: linear-gradient(180deg, #f4fbfd 0%, #fff 100%);
}

.mlm-stat--neutral .mlm-stat-value {
  color: #0e7490;
}

.mlm-hero__hint {
  margin: 12px 0 0;
  padding: 12px 14px 12px 16px;
  border: none;
  border-left: 3px solid var(--primary-color, #1a56a7);
  border-radius: 0 10px 10px 0;
  background: rgba(26, 86, 167, 0.06);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary, #595959);
}

.mlm-hero__hint.is-empty {
  display: none;
}

.mlm-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border-light, #f0f2f5);
}

.mlm-control-hint {
  margin: 0;
  flex: 1;
  min-width: 200px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-tertiary, #8c8c8c);
  text-align: right;
}

.mainline-mindmap-sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-tertiary, #8c8c8c);
  line-height: 1.45;
}

.mainline-mindmap-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 16px 18px;
}

.mainline-mindmap-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 320px;
  color: var(--text-tertiary, #8c8c8c);
  font-size: 14px;
}

.mainline-mindmap-loading.hidden,
.hidden {
  display: none !important;
}

.plate-chart-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(26, 86, 167, 0.15);
  border-top-color: var(--primary-color, #1a56a7);
  border-radius: 50%;
  animation: mlm-spin 0.8s linear infinite;
}

@keyframes mlm-spin {
  to { transform: rotate(360deg); }
}

.mlm-muted,
.mlm-empty {
  color: var(--text-tertiary, #8c8c8c);
  font-size: 13px;
  padding: 24px 12px;
  text-align: center;
}

body#mainlineMindmapPage .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body#mainlineMindmapPage .btn-sm {
  padding: 5px 10px;
  min-height: 30px;
}

body#mainlineMindmapPage .btn-ghost {
  background: var(--glass-bg, #fafbfc);
  border-color: var(--glass-border, #e8eaed);
  color: var(--text-primary, #262626);
}

body#mainlineMindmapPage .btn-ghost:hover {
  background: rgba(26, 86, 167, 0.08);
  border-color: rgba(26, 86, 167, 0.25);
  color: var(--primary-color, #1a56a7);
}

body#mainlineMindmapPage .btn-primary {
  background: var(--primary-color, #1a56a7);
  border-color: var(--primary-color, #1a56a7);
  color: #fff;
}

body#mainlineMindmapPage .btn-primary:hover {
  background: var(--primary-hover, #4a90e2);
  border-color: var(--primary-hover, #4a90e2);
}

.mainline-mindmap-meta {
  display: block;
}

.mlm-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}

.mlm-chip--phase {
  background: var(--mlm-accent-soft);
  color: var(--mlm-accent-text);
}

.mainline-mindmap-hint {
  margin: 0;
  padding: 0 18px 6px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text);
}

.mlm-view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #eef2f6;
  border: 1px solid var(--border-color, #e8eaed);
  flex-shrink: 0;
}

.mlm-view-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary, #595959);
  font-family: var(--font-family-base, sans-serif);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mlm-view-tab i {
  font-size: 12px;
  opacity: 0.85;
}

.mlm-view-tab:hover {
  color: var(--text);
}

.mlm-view-tab.is-active {
  background: var(--card-bg, #fff);
  color: var(--primary-color, #1a56a7);
  box-shadow: 0 2px 8px rgba(26, 86, 167, 0.12);
}

.mainline-mindmap-chart-view {
  flex: 1;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  padding: 12px 10px 0;
}

.mlm-mindmap-layout {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 520px;
  height: min(72vh, 680px);
}

.mlm-mindmap-rail {
  flex: 0 0 min(168px, 26%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  overflow-y: auto;
}

.mlm-rail-title {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.mlm-rail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--mlm-card-border);
  border-radius: 10px;
  background: var(--mlm-card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mlm-rail-item:hover {
  border-color: rgba(0, 113, 227, 0.35);
  background: var(--mlm-card-hover);
}

.mlm-rail-item.is-active {
  border-color: var(--primary-color, #1a56a7);
  box-shadow: 0 0 0 1px rgba(26, 86, 167, 0.16);
  background: #e8f0f8;
}

.mlm-rail-rank {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--mlm-accent-soft);
  color: var(--mlm-accent-text);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mlm-rail-item.is-active .mlm-rail-rank {
  background: var(--primary-color, #1a56a7);
  color: #fff;
}

.mlm-rail-body {
  flex: 1;
  min-width: 0;
}

.mlm-rail-name {
  display: block;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
}

.mlm-rail-meta {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-muted);
}

.mlm-mindmap-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mlm-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border-color, #e8eaed);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.mlm-mindmap-breadcrumb {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #595959);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mlm-mindmap-breadcrumb strong {
  color: var(--primary-color, #1a56a7);
  font-weight: 700;
}

.mlm-bc-sep {
  opacity: 0.45;
  margin: 0 3px;
}

.mlm-chart-toolbar-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
}

.mlm-btn-export {
  gap: 5px;
  border-color: rgba(26, 86, 167, 0.28) !important;
  color: var(--primary-color, #1a56a7) !important;
  background: rgba(26, 86, 167, 0.06) !important;
}

.mlm-btn-export:hover {
  background: rgba(26, 86, 167, 0.12) !important;
  border-color: rgba(26, 86, 167, 0.45) !important;
}

.mlm-btn-export.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

.mlm-btn-export i {
  font-size: 11px;
}

@media (max-width: 720px) {
  .mlm-btn-export span {
    display: none;
  }
}

.mlm-chart-stage {
  position: relative;
  flex: 1;
  min-height: 420px;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid #dde4ed;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.mlm-rail-item.is-active {
  border-color: var(--primary-color, #1a56a7);
  box-shadow: 0 0 0 1px rgba(26, 86, 167, 0.16);
  background: #e8f0f8;
}

.mlm-rail-item.is-active .mlm-rail-rank {
  background: var(--primary-color, #1a56a7);
  color: #fff;
}

.mainline-mindmap-chart {
  width: 100%;
  height: 100%;
  min-height: 420px;
}

.mlm-chart-error {
  height: 100%;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-tertiary, #8c8c8c);
  text-align: center;
  padding: 24px;
}

.mlm-chart-error i {
  font-size: 28px;
  color: var(--primary-color, #1a56a7);
  opacity: 0.65;
}

.mlm-chart-error p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.mainline-mindmap-chart-detail {
  flex-shrink: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
  box-shadow: var(--glass-shadow);
}

.mainline-mindmap-chart-detail.hidden {
  display: none;
}

.mlm-chart-detail-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mlm-chart-detail-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.mlm-chart-detail-head strong {
  font-size: 14px;
  color: var(--text);
}

.mlm-chart-detail-badge {
  font-size: 10px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mlm-accent-soft);
  color: var(--mlm-accent-text);
}

.mlm-chart-detail-badge.is-dragon {
  background: rgba(255, 59, 48, 0.14);
  color: var(--danger);
}

.mlm-chart-detail-badge.is-stock {
  background: rgba(56, 158, 13, 0.12);
  color: var(--up-color);
}

.mlm-chart-detail-code {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.mlm-chart-detail-reason {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
}

.mlm-chart-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mlm-chart-detail-close {
  margin-left: auto;
}

.mainline-mindmap-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 0 12px 14px;
  display: flex;
  flex-direction: column;
}

.mainline-mindmap-loading {
  position: absolute;
  inset: 0 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--mlm-surface);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  z-index: 2;
}

.mainline-mindmap-layout {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: min(62vh, 520px);
  max-height: min(68vh, 560px);
}

.mlm-sidebar {
  flex: 0 0 min(240px, 34%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(127, 127, 127, 0.12);
  overflow-y: auto;
}

.mlm-side-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 10px 10px;
  border: 1px solid rgba(127, 127, 127, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mlm-side-item:hover {
  border-color: rgba(102, 126, 234, 0.35);
  background: rgba(255, 255, 255, 0.92);
}

.mlm-side-item.is-active {
  border-color: rgba(102, 126, 234, 0.55);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(255, 255, 255, 0.95) 100%);
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.12);
}

.mlm-side-rank {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(102, 126, 234, 0.15);
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mlm-side-item.is-active .mlm-side-rank {
  background: #667eea;
  color: #fff;
}

.mlm-side-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mlm-side-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.3;
}

.mlm-side-count {
  font-size: 11px;
  color: var(--text-muted);
}

.mlm-side-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.mlm-side-chip {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.1);
  color: var(--text-muted);
}

.mlm-side-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  margin-top: 2px;
}

.mlm-detail {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(127, 127, 127, 0.12);
  overflow-y: auto;
}

.mlm-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  text-align: center;
  padding: 24px;
}

.mlm-detail-empty-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.mlm-muted,
.mlm-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.mlm-detail-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(127, 127, 127, 0.12);
}

.mlm-detail-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.mlm-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.mlm-detail-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(102, 126, 234, 0.12);
  color: #4338ca;
}

.mlm-detail-evidence,
.mlm-evidence {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

.mlm-dragon-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.mlm-dragon-label {
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
}

.mlm-dragon-btn {
  border: none;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 13px;
  font-weight: 650;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.mlm-dragon-btn:hover {
  background: rgba(220, 38, 38, 0.14);
}

.mlm-sections {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mlm-section {
  border: 1px solid rgba(127, 127, 127, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.mlm-section-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.mlm-section-head:hover {
  background: rgba(127, 127, 127, 0.05);
}

.mlm-section-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.mlm-section-toggle {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(102, 126, 234, 0.12);
  color: #4338ca;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mlm-section-body {
  display: none;
  padding: 0 12px 12px;
  border-top: 1px solid rgba(127, 127, 127, 0.08);
}

.mlm-section.is-open .mlm-section-body {
  display: block;
  padding-top: 10px;
}

.mlm-sub-group {
  margin-bottom: 10px;
}

.mlm-sub-group:last-child {
  margin-bottom: 0;
}

.mlm-sub-title {
  font-size: 12px;
  font-weight: 650;
  color: #0891b2;
  margin-bottom: 6px;
}

.mlm-stock-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mlm-stock-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(127, 127, 127, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  color: var(--text);
  text-align: left;
}

.mlm-stock-item--click {
  cursor: pointer;
}

.mlm-stock-item--click:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.06);
}

.mlm-stock-code {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 主线探索：单栏逐级展开 */
.mainline-mindmap-explorer {
  flex: 1;
  min-height: min(62vh, 520px);
  max-height: min(68vh, 580px);
  overflow-y: auto;
  padding: 4px 6px 8px;
  border-radius: var(--radius);
  background: var(--mlm-surface);
  border: 1px solid var(--mlm-card-border);
}

.mlm-exp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mlm-exp-mainline {
  border: 1px solid var(--mlm-card-border);
  border-radius: 12px;
  background: var(--mlm-card);
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.mlm-exp-mainline.is-open {
  border-color: rgba(0, 113, 227, 0.42);
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.1);
}

.mlm-exp-mainline-head {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.mlm-exp-mainline-head:hover {
  background: var(--mlm-card-hover);
}

.mlm-exp-rank {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--mlm-accent-soft);
  color: var(--mlm-accent-text);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mlm-exp-mainline.is-open .mlm-exp-rank {
  background: var(--accent);
  color: #fff;
}

.mlm-exp-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mlm-exp-name-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.mlm-exp-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.mlm-exp-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--mlm-accent-text);
}

.mlm-exp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mlm-exp-chip {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--mlm-accent-soft);
  color: var(--mlm-accent-text);
  font-weight: 600;
}

.mlm-exp-dragon {
  font-size: 12px;
  color: #b91c1c;
}

.mlm-exp-dragon-btn {
  border: none;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 12px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 4px;
}

.mlm-exp-dragon-btn:hover {
  background: rgba(220, 38, 38, 0.14);
}

.mlm-exp-chevron {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.mlm-exp-mainline-body {
  padding: 0 14px 14px 50px;
  border-top: 1px solid rgba(127, 127, 127, 0.1);
}

.mlm-exp-evidence {
  margin: 12px 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--mlm-evidence-bg);
  border-left: 3px solid var(--mlm-evidence-border);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.mlm-exp-section {
  margin-top: 8px;
  border: 1px solid var(--mlm-card-border);
  border-radius: 10px;
  background: var(--mlm-card);
  overflow: hidden;
}

.mlm-exp-section-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.mlm-exp-section-head:hover {
  background: rgba(127, 127, 127, 0.04);
}

.mlm-exp-section-head--static {
  cursor: default;
}

.mlm-exp-section-chevron {
  flex-shrink: 0;
  width: 16px;
  font-size: 10px;
  color: var(--mlm-accent-text);
}

.mlm-exp-section-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.mlm-exp-section-body {
  padding: 4px 10px 10px 34px;
}

.mlm-exp-sub {
  margin-bottom: 6px;
  border-radius: 8px;
  background: var(--mlm-sub-bg);
  border: 1px solid var(--mlm-sub-border);
}

.mlm-exp-sub.is-open {
  background: var(--mlm-teal-soft);
}

.mlm-exp-sub-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.mlm-exp-sub-head:hover {
  background: var(--mlm-sub-bg);
}

.mlm-exp-sub-chevron {
  flex-shrink: 0;
  width: 14px;
  font-size: 9px;
  color: var(--mlm-teal-text);
}

.mlm-exp-sub-name {
  font-size: 12px;
  font-weight: 650;
  color: var(--mlm-teal-text);
}

.mlm-exp-stock-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mlm-exp-stock.is-selected .mlm-exp-stock-btn {
  border-color: rgba(5, 150, 105, 0.45);
  background: rgba(5, 150, 105, 0.08);
}

.mlm-exp-stock-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--mlm-stock-border);
  border-radius: 8px;
  background: var(--mlm-stock-bg);
  font-size: 12px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.mlm-exp-stock-btn:hover {
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(5, 150, 105, 0.05);
}

.mlm-exp-stock-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.mlm-exp-stock-code {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.mlm-exp-stock-hint {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 650;
  color: #059669;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.1);
}

.mlm-reason-panel {
  margin: 4px 0 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--mlm-reason-bg);
  border: 1px solid var(--mlm-card-border);
}

.mlm-reason-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.mlm-reason-code {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.mlm-reason-text {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.mlm-reason-trend-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.mlm-reason-trend-btn:hover {
  background: var(--accent-hover);
}

.mlm-exp-cal-item {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-left: 2px solid rgba(124, 58, 237, 0.35);
  margin-bottom: 4px;
}

@media (max-width: 720px) {
  .mainline-mindmap-explorer {
    max-height: none;
  }

  .mlm-exp-mainline-body {
    padding-left: 14px;
  }

  .mlm-mindmap-layout {
    flex-direction: column;
    max-height: none;
  }

  .mlm-mindmap-rail {
    flex: 0 0 auto;
    max-height: 140px;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .mlm-rail-title {
    width: 100%;
  }
}

body#mainlineMindmapPage .mainline-mindmap-explorer,
body#mainlineMindmapPage .mainline-mindmap-chart-view {
  max-height: none;
  min-height: min(74vh, 720px);
}
body#mainlineMindmapPage .mlm-mindmap-layout {
  max-height: none;
  min-height: min(74vh, 720px);
}

@media (min-width: 1680px) {
  body#mainlineMindmapPage {
    --sa-topbar-max-width: 1680px;
  }
}

@media (max-width: 900px) {
  .mlm-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mlm-control-hint {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 720px) {
  body#mainlineMindmapPage {
    --sa-topbar-max-width: 100%;
  }

  .mainline-page-head,
  .mlm-hero,
  .mlm-control-bar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .mainline-mindmap-body {
    padding-left: 10px;
    padding-right: 10px;
  }

  .mlm-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mlm-stat-value {
    font-size: 16px;
  }
}

