/* ============================================================
   Stock Buster — Design System v3.0
   暖白底 + 金色点缀 | 响应式 | 暗色模式 | 无障碍
   ============================================================ */

/* ─── 浅色主题覆盖 ─── */
:root[data-theme="light"] {
  --gold: #b8860b;
  --gold-light: #daa520;
  --gold-bg: rgba(184, 134, 11, 0.12);
  --gold-border: rgba(184, 134, 11, 0.25);
  --gold-dark: #8b6914;

  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.08);
  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.08);
  --purple: #7c3aed;
  --purple-border: rgba(124, 58, 237, 0.2);
  --orange: #ea580c;
  --yellow: #d97706;

  --bg: #f5f5f0;
  --bg-secondary: #efefe8;
  --bg-tertiary: #e8e8e0;
  --surface: #ffffff;
  --surface-1: #fafaf5;
  --surface-2: #f5f5f0;
  --surface-hover: #f0f0eb;
  --card: rgba(255, 255, 255, 0.7);
  --border: rgba(0, 0, 0, 0.1);
  --border-light: rgba(0, 0, 0, 0.05);
  --border-color: rgba(0, 0, 0, 0.1);
  --text-primary: #1a1a1a;
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --text-tertiary: #888;
  --text-quaternary: #bbb;
  --accent-primary: #b8860b;

  --glass-bg-level-1: rgba(255, 255, 255, 0.6);
  --glass-bg-level-2: rgba(255, 255, 255, 0.8);
  --glass-bg-level-3: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-strong: rgba(0, 0, 0, 0.15);

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.12), 0 6px 16px rgba(0,0,0,0.06);
  --glow-primary: 0 0 24px rgba(184, 134, 11, 0.15), inset 0 1px 0 rgba(255,255,255,0.5);
  --glow-secondary: 0 0 16px rgba(234, 88, 12, 0.12);
}

/* ─── CSS Variables (Design Tokens) ─── */
:root {
  /* Brand Colors - Open Design Style */
  --gold: #ffd700;
  --gold-light: #fff6df;
  --gold-bg: rgba(255, 215, 0, 0.15);
  --gold-border: rgba(255, 215, 0, 0.3);
  --gold-dark: #b8860b;

  /* Semantic Colors */
  --red: #ffb4ab;
  --red-bg: rgba(255, 180, 171, 0.1);
  --green: #63fe13;
  --green-bg: rgba(99, 254, 19, 0.1);
  --purple: #e7d1ff;
  --purple-border: rgba(231, 209, 255, 0.2);
  --orange: #00e3fd;
  --yellow: #fbbf24;

  /* Dark Theme Neutral Palette */
  --bg: #121318;
  --bg-secondary: #1a1b22;
  --bg-tertiary: #22232c;
  --surface: #1e1f25;
  --surface-1: #24252c;
  --surface-2: #2a2b33;
  --surface-hover: #292a2f;
  --card: rgba(52, 52, 58, 0.15);
  --border: rgba(255, 255, 255, 0.12);
  --border-light: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.12);
  --text-primary: #e3e1e9;
  --text: #e3e1e9;
  --text-secondary: #d0c6ab;
  --text-muted: #999077;
  --text-tertiary: #999077;
  --text-quaternary: #4d4732;
  --accent-primary: #ffd700;

  /* Premium glass levels */
  --glass-bg-level-1: rgba(52, 52, 58, 0.15);
  --glass-bg-level-2: rgba(52, 52, 58, 0.25);
  --glass-bg-level-3: rgba(52, 52, 58, 0.35);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-strong: rgba(255, 255, 255, 0.2);

  /* Layout */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 70px;
  --main-max-w: 1760px;

  /* Radius — Apple 级大圆角 */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadow — 柔和多层投影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 24px 56px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.2);
  --glow-primary: 0 0 32px rgba(255, 215, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  --glow-secondary: 0 0 24px rgba(0, 227, 253, 0.2);

  /* Transitions — Apple easeOut 弹性曲线 */
  --t-fast: 0.15s cubic-bezier(0.32, 0.72, 0, 1);
  --t-normal: 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  --t-slow: 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Font */
  --font-mono: var(--font-mono);

  /* Z-Index */
  --z-sidebar: 10;
  --z-toast: 500;
  --z-modal: 100;
  --z-drawer: 200;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 215, 0, 0.05) 0%, transparent 50%),
              radial-gradient(ellipse at 100% 100%, rgba(0, 227, 253, 0.04) 0%, transparent 40%),
              var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 浅色主题环境光 */
:root[data-theme="light"] body {
  background: radial-gradient(ellipse at 50% 0%, rgba(184, 134, 11, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 0% 100%, rgba(124, 58, 237, 0.04) 0%, transparent 40%),
              var(--bg);
}

h1, h2, h3, h4, h5, h6, .mono {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--text-quaternary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* Focus Ring (Accessibility) */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Layout ─── */
#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 19, 24, 0.75);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  margin: 0 auto;
  max-width: var(--main-max-w);
  width: 100%;
}

body:has(#page-tracking:not(.hidden)) .main {
  max-width: min(1960px, calc(100vw - 48px));
  padding-left: 28px;
  padding-right: 28px;
}

/* ─── Top Header Elements ─── */
.header-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(0, 227, 253, 0.3));
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.logo-sub {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item:hover {
  background: var(--glass-bg-level-1);
  color: var(--text-primary);
  border-color: var(--border);
}

.nav-item.active {
  background: var(--glass-bg-level-2);
  color: var(--gold-light);
  border-color: var(--gold-border);
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--glass-bg-level-1);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
}
.status-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 10px rgba(99, 254, 19, 0.45);
}
.status-dot.offline {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 77, 79, 0.45);
}
.status-dot.online {
  background: var(--green);
}
.theme-setting-btn {
  min-width: 92px;
}

/* ─── Mobile Menu Toggle ─── */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 40px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: calc(var(--z-drawer) - 1);
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.visible { display: block; }

/* ─── Pages ─── */
.page { animation: fadeIn 0.25s ease; }
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
  color: var(--text-primary);
}

/* ─── 浅色主题：策略引擎按钮加深背景 ─── */
:root[data-theme="light"] .qa-card {
  background: #f8f8f3;
  border-color: rgba(0,0,0,0.12);
  color: var(--text-primary);
}
:root[data-theme="light"] .dashboard-strategy-btn {
  background: #fbfaf4;
  border-color: rgba(0,0,0,0.12);
  border-left-color: var(--gold-border);
  color: var(--text-primary);
}
:root[data-theme="light"] .qa-card .qa-text {
  color: var(--text-primary);
}
:root[data-theme="light"] .dashboard-run-all.qa-accent {
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.98), rgba(5, 150, 105, 0.98)),
    linear-gradient(135deg, var(--accent-primary), #6366f1);
  border-color: rgba(22, 163, 74, 0.2);
  color: #fff;
  box-shadow: 0 14px 28px rgba(22, 163, 74, 0.22), inset 0 1px 0 rgba(255,255,255,0.12);
}
:root[data-theme="light"] .dashboard-run-all.qa-accent:hover {
  box-shadow: 0 16px 34px rgba(22, 163, 74, 0.3), 0 0 0 1px rgba(255,255,255,0.12) inset;
}
:root[data-theme="light"] .dashboard-run-all.qa-accent .qa-text {
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

/* ─── 浅色主题：导航栏/顶部栏适配 ─── */
:root[data-theme="light"] .top-header {
  background: rgba(255,255,255,0.95);
  border-bottom-color: rgba(0,0,0,0.1);
}
:root[data-theme="light"] .logo-title,
:root[data-theme="light"] .logo-sub {
  color: var(--text-primary);
}
:root[data-theme="light"] .nav-item {
  color: var(--text-secondary);
  border-color: transparent;
}
:root[data-theme="light"] .nav-item.active {
  background: var(--gold-bg);
  color: var(--gold);
  border-color: var(--gold-border);
}
:root[data-theme="light"] .menu-toggle span {
  background: var(--text-primary);
}
:root[data-theme="light"] .menu-toggle {
  background: var(--surface);
}
:root[data-theme="light"] .status-text {
  color: var(--text-secondary);
}
:root[data-theme="light"] .header-clock .hc-date {
  color: var(--text-secondary);
}
:root[data-theme="light"] .hc-time {
  color: var(--gold);
}
:root[data-theme="light"] .theme-toggle {
  background: var(--surface);
}

/* ─── 浅色主题：研报/分析区域适配 ─── */
:root[data-theme="light"] .research-page-head p {
  color: var(--text-secondary);
}
:root[data-theme="light"] .report-content {
  background:
    linear-gradient(135deg, rgba(184, 134, 11, 0.08), transparent 36%),
    linear-gradient(180deg, #ffffff, #fafaf5);
}
:root[data-theme="light"] .report-item {
  background: rgba(255,255,255,0.86);
  border-color: rgba(0,0,0,0.08);
}
:root[data-theme="light"] .report-item.active {
  border-left-color: var(--gold);
  background: var(--gold-bg);
}
:root[data-theme="light"] .research-toolbar {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(250,250,245,0.76)),
    var(--surface);
}
:root[data-theme="light"] .report-list-shell {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.86), rgba(250,250,245,0.72)),
    var(--surface);
}
:root[data-theme="light"] .rt-input,
:root[data-theme="light"] .rt-select {
  background: #ffffff;
  color: var(--text-primary);
  border-color: rgba(0,0,0,0.1);
}
:root[data-theme="light"] .research-generate-btn,
:root[data-theme="light"] .research-generate-btn span {
  color: #ffffff;
}
:root[data-theme="light"] .btn-outline {
  background: var(--surface);
  color: var(--text-primary);
  border-color: rgba(0,0,0,0.12);
}

/* ─── 自选圆点 ─── */
.watch-dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--border-color);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all var(--t-fast);
  vertical-align: middle;
}
.watch-dot:hover { border-color: var(--green); }
.watch-dot.active {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(99, 254, 19, 0.5);
}

/* ─── 策略助手 ─── */
.strategy-assistant {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sa-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}
.sa-input-row textarea {
  width: 100%;
  min-height: 54px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-level-2);
  color: var(--text-primary);
  padding: 10px 12px;
  font: inherit;
  line-height: 1.45;
  outline: none;
}
.sa-input-row textarea:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.12);
}
.sa-result {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
}
.sa-loading,
.sa-error {
  color: var(--text-muted);
  font-size: 13px;
}
.sa-error {
  color: var(--red);
}
.sa-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.sa-plan-head strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
}
.sa-plan-head small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}
.sa-result p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}
.sa-strategy-list,
.sa-constraints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.sa-strategy-list span,
.sa-constraints span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.sa-strategy-list span {
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
}
.sa-constraints span {
  color: var(--text-muted);
  background: var(--glass-bg-level-2);
  border: 1px solid var(--border);
}
.sa-reasons {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
}
.sa-warning {
  margin-top: 8px;
  color: var(--gold);
  font-size: 12px;
  line-height: 1.5;
}
:root[data-theme="light"] .sa-result {
  background: rgba(255,255,255,0.72);
}

/* ─── 动态仓位建议 ─── */
.pa-shell {
  display: grid;
  gap: 14px;
}
.pa-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.pa-stance {
  min-width: 132px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
}
.pa-stance span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
.pa-stance strong {
  display: block;
  color: var(--text-primary);
  font-size: 22px;
  font-family: var(--font-display);
}
.pa-summary p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}
.pa-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.pa-stat-grid > div {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--glass-bg-level-2);
  border: 1px solid var(--border);
}
.pa-stat-grid small,
.pa-actions small,
.pa-exposure small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.pa-stat-grid strong {
  color: var(--text-primary);
  font-size: 18px;
  font-family: var(--font-mono);
}
.pa-risk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pa-risk-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid rgba(34, 197, 94, 0.26);
  font-size: 12px;
  font-weight: 700;
}
.pa-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}
.pa-actions,
.pa-exposure {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.pa-actions ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.pa-strategy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.pa-strategy-row:first-of-type {
  border-top: 0;
}
.pa-strategy-row strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.pa-strategy-row small {
  margin: 0;
  line-height: 1.4;
}
.pa-metrics {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  gap: 6px;
  text-align: right;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}
:root[data-theme="light"] .pa-actions,
:root[data-theme="light"] .pa-exposure {
  background: rgba(255,255,255,0.72);
}

/* ─── 大盘环境雷达 ─── */
.market-regime-card .card-body {
  padding-top: 14px;
}
.mr-shell {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  grid-template-areas:
    "score main"
    "lower lower";
  gap: 14px;
}
.mr-score-card {
  grid-area: score;
  min-height: 128px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-border);
  background: linear-gradient(145deg, var(--gold-bg), rgba(255,255,255,0.03));
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.mr-score-card.positive {
  border-color: rgba(239, 68, 68, 0.28);
  background: linear-gradient(145deg, var(--red-bg), rgba(255,255,255,0.03));
}
.mr-score-card.negative {
  border-color: rgba(34, 197, 94, 0.26);
  background: linear-gradient(145deg, var(--green-bg), rgba(255,255,255,0.03));
}
.mr-score-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}
.mr-score-value {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 6px 0;
}
.mr-score-card strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1;
}
.mr-score-value small {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
}
.mr-score-card.positive strong {
  color: var(--red);
}
.mr-score-card.negative strong {
  color: var(--green);
}
.mr-score-caption {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.mr-main {
  grid-area: main;
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: center;
}
.mr-main p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}
.mr-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.mr-metrics > div {
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--glass-bg-level-2);
  border: 1px solid var(--border);
}
.mr-lower small,
.mr-metrics small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.mr-metrics strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.mr-lower {
  grid-area: lower;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.mr-lower > div {
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.mr-lower ul {
  margin: 0;
  padding-left: 17px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.65;
}
.mr-tags,
.mr-sector-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mr-tags + small {
  margin-top: 10px;
}
.mr-tags span,
.mr-sector-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--glass-bg-level-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.mr-tags.positive span {
  color: var(--red);
  background: var(--red-bg);
  border-color: rgba(239, 68, 68, 0.24);
}
.mr-tags.cautious span {
  color: var(--green);
  background: var(--green-bg);
  border-color: rgba(34, 197, 94, 0.24);
}
:root[data-theme="light"] .mr-score-card,
:root[data-theme="light"] .mr-lower > div {
  background-color: rgba(255,255,255,0.72);
}
@media (max-width: 900px) {
  .mr-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "score"
      "main"
      "lower";
  }
  .mr-score-card {
    min-height: 96px;
  }
  .mr-metrics,
  .mr-lower {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .mr-metrics,
  .mr-lower {
    grid-template-columns: 1fr;
  }
}

/* ─── 策略自动优化建议 ─── */
.strategy-optimization {
  padding: 0 18px 18px;
}
.so-head {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-bottom: 10px;
}
.so-head strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 3px;
}
.so-head span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.so-list {
  display: grid;
  gap: 8px;
}
.so-item {
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.so-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}
.so-item strong {
  color: var(--text-primary);
  font-size: 13px;
}
.so-item > div span {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
}
.so-item p {
  margin: 0 0 5px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.so-item small {
  color: var(--text-muted);
  font-size: 11px;
}
.so-item.high > div span {
  color: var(--green);
  background: var(--green-bg);
}
.so-item.positive > div span {
  color: var(--red);
  background: var(--red-bg);
}
.so-item.medium > div span,
.so-item.low > div span {
  color: var(--gold);
  background: var(--gold-bg);
}
:root[data-theme="light"] .so-item {
  background: rgba(255,255,255,0.72);
}

/* ─── 个性化偏好画像 ─── */
.pp-shell {
  display: grid;
  gap: 14px;
}
.pp-style {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(184,134,11,0.14), rgba(255,255,255,0.03));
}
.pp-style span,
.pp-grid small,
.pp-metrics small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.pp-style strong {
  display: block;
  color: var(--text-primary);
  font-size: 22px;
  font-family: var(--font-display);
  margin-bottom: 4px;
}
.pp-style small {
  color: var(--text-secondary);
  line-height: 1.45;
}
.pp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.pp-metrics > div {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--glass-bg-level-2);
  border: 1px solid var(--border);
}
.pp-metrics strong {
  color: var(--text-primary);
  font-size: 18px;
  font-family: var(--font-mono);
}
.pp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pp-grid > div {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.pp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pp-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  font-size: 12px;
  font-weight: 700;
}
.pp-suggestions {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  line-height: 1.65;
}
:root[data-theme="light"] .pp-grid > div,
:root[data-theme="light"] .pp-style {
  background: rgba(255,255,255,0.72);
}

/* ─── 板块情绪联动 ─── */
.sector-sentiment {
  display: grid;
  grid-template-columns: auto 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.sector-sentiment small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 3px;
}
.sector-sentiment strong {
  color: var(--text-primary);
}
.ss-score {
  width: 54px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
}
.ss-drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ss-drivers span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--glass-bg-level-2);
  border: 1px solid var(--border);
  font-size: 12px;
}
.sector-sentiment.偏热 .ss-score {
  color: var(--red);
  background: var(--red-bg);
  border-color: rgba(239, 68, 68, 0.28);
}
.sector-sentiment.偏冷 .ss-score {
  color: var(--green);
  background: var(--green-bg);
  border-color: rgba(34, 197, 94, 0.26);
}
:root[data-theme="light"] .sector-sentiment {
  background: rgba(255,255,255,0.72);
}

/* ─── 自选股 AI 标注 ─── */
.wl-ai-label {
  min-width: 220px;
  max-width: 300px;
}
.wl-ai-main {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  white-space: nowrap;
}
.wl-trend,
.wl-fit,
.wl-strategy {
  display: inline-flex;
  align-items: center;
  height: 22px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.wl-trend {
  padding: 0 8px;
  color: var(--text-primary);
  background: var(--glass-bg-level-2);
  border: 1px solid var(--border);
}
.wl-fit {
  width: 28px;
  justify-content: center;
  font-family: var(--font-mono);
  border: 1px solid transparent;
}
.wl-fit.strong {
  color: var(--red);
  background: var(--red-bg);
  border-color: rgba(239, 68, 68, 0.28);
}
.wl-fit.steady {
  color: var(--gold);
  background: var(--gold-bg);
  border-color: var(--gold-border);
}
.wl-fit.weak {
  color: var(--green);
  background: var(--green-bg);
  border-color: rgba(34, 197, 94, 0.26);
}
.wl-strategy {
  padding: 0 8px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}
.wl-ai-comment {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

/* ─── 主题切换按钮 ─── */
.theme-toggle {
  background: var(--glass-bg-level-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover {
  border-color: var(--gold);
  transform: rotate(15deg);
}

/* ─── 顶部栏时钟 ─── */
.header-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 14px;
  margin-right: 6px;
  border-right: 1px solid var(--border);
}
.hc-date {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hc-time {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-row .page-title { margin-bottom: 0; }

/* ─── Cards ─── */
/* ─── Cards ─── */
.card {
  background: var(--glass-bg-level-1);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--t-slow);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.card:hover {
  background: var(--glass-bg-level-2);
  border-color: var(--glass-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: 18px 24px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  /* 防止被右侧控件挤压导致标题截断 */
  flex-shrink: 0;
  white-space: nowrap;
}

/* 卡片头右侧元素允许收缩，给标题让位 */
.card-header > :not(h3) {
  min-width: 0;
  flex-shrink: 1;
}

/* 交互回测卡片头：历史下拉 + meta 聚合在右侧 */
.backtest-run-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bt-history-select {
  max-width: 260px;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}
.bt-history-clear {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid #e0b4b4;
  background: #fff5f5;
  color: #c53030;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.bt-history-clear:hover {
  background: #fed7d7;
}

.card-subtitle {
  padding: 0 24px 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.card-body {
  padding: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-market-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 24vw, 380px);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 20px;
}

.dashboard-rank-stack {
  display: grid;
  grid-template-rows: repeat(2, minmax(300px, auto));
  gap: 16px;
}

.heatmap-card,
.rank-square-card {
  height: 100%;
}

.heatmap-card {
  display: flex;
  flex-direction: column;
}

.heatmap-card #sectorHeatmap {
  flex: 1;
  min-height: 0;
}

.rank-square-card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.rank-square-card .card-header {
  padding: 18px 20px 12px;
}

.rank-square-card .card-subtitle {
  padding: 0 20px 8px;
}

.rank-square-card .card-body {
  flex: 1;
  min-height: 0;
  overflow: visible;
  padding: 8px 16px 16px;
}

.rank-square-card .stock-item {
  padding: 10px 0;
}

.dashboard-top-grid {
  align-items: stretch;
}

.dashboard-top-grid > .card {
  height: 100%;
}

/* ─── Hero Stats ─── */
.hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.hero-stat {
  background: var(--glass-bg-level-1);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  text-align: left;
}

.hero-stat::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.hero-stat .stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.hero-stat .stat-value {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.hero-stat.green .stat-value { color: var(--green); filter: drop-shadow(0 0 12px rgba(99, 254, 19, 0.2)); }
.hero-stat.red   .stat-value { color: var(--red); filter: drop-shadow(0 0 12px rgba(255, 180, 171, 0.2)); }
.hero-stat.gold  .stat-value { color: var(--gold); filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.2)); }

.dashboard-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0 24px 24px;
}

.dashboard-summary-grid .hero-stat {
  padding: 14px 16px;
  border-radius: var(--radius-md);
}

.dashboard-summary-grid .hero-stat .stat-label {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0;
}

.dashboard-summary-grid .hero-stat .stat-value {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1;
}

/* ─── Skeleton Loading ─── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-stat { height: 80px; border-radius: var(--radius-lg); }
.skeleton-line { height: 14px; margin-bottom: 8px; border-radius: var(--radius-sm); }
.skeleton-line:last-child { margin-bottom: 0; width: 60%; }
.skeleton-row { height: 40px; border-radius: var(--radius-sm); margin-bottom: 8px; }

/* ─── Buttons ─── */
.btn {
  font-family: 'Inter', -apple-system, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--t-normal);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.96) translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #3a3000;
  box-shadow: var(--glow-primary), var(--shadow-sm);
}
.btn-primary:hover {
  box-shadow: var(--glow-primary), var(--shadow-md);
  transform: translateY(-2px);
}
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.25), transparent 50%);
  pointer-events: none;
}

.btn-outline {
  background: var(--glass-bg-level-1);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover {
  background: var(--glass-bg-level-2);
  border-color: var(--glass-border-strong);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: rgba(0, 227, 253, 0.08);
  color: var(--orange);
  border: 1px solid var(--orange);
  backdrop-filter: blur(12px);
}
.btn-accent:hover {
  background: rgba(0, 227, 253, 0.15);
  box-shadow: var(--glow-secondary);
}

.btn-danger {
  background: rgba(255, 180, 171, 0.08);
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger:hover { background: rgba(255, 180, 171, 0.15); }

.btn-sm { padding: 6px 14px; font-size: 12px; height: 32px; }
.btn-lg { padding: 12px 28px; font-size: 15px; height: 48px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

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

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

.dashboard-strategy-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg-level-1);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
}

.dashboard-strategy-btn:hover {
  transform: translateY(-2px);
  border-color: var(--gold-border);
  background: var(--glass-bg-level-2);
  box-shadow: var(--shadow-md);
}

.dashboard-strategy-btn:active {
  transform: translateY(0);
}

.dashboard-strategy-btn.selected {
  border-color: rgba(22, 163, 74, 0.35);
  border-left-color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.08) inset;
}

.dashboard-strategy-btn.selected:hover {
  border-color: rgba(22, 163, 74, 0.6);
  background: rgba(22, 163, 74, 0.12);
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.12);
}

.dsb-select {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
  transition: transform 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.dashboard-strategy-btn.selected .dsb-select {
  border-color: #16a34a;
  background: radial-gradient(circle at 50% 50%, #16a34a 0 43%, #dcfce7 44% 100%);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}

.dashboard-strategy-btn.selected .dsb-select::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  margin: 4px auto 0;
  border-radius: 999px;
  background: #fff;
}

.dsb-content {
  min-width: 0;
}

.dsb-name {
  display: block;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dsb-range {
  display: block;
  margin-top: 5px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.qa-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.qa-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}
.qa-card:active {
  transform: translateY(0);
}
.qa-card .qa-text {
  font-size: 14px;
  font-weight: 600;
}
.qa-card.qa-accent {
  background: linear-gradient(135deg, var(--accent-primary), #6366f1);
  color: #fff;
  border-color: transparent;
}
.qa-card.qa-accent:hover {
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}
.dashboard-run-all {
  width: 100%;
  min-height: 60px;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.dashboard-run-all .qa-text {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.dashboard-run-all.qa-accent {
  background:
    linear-gradient(135deg, rgba(22, 163, 74, 0.96), rgba(5, 150, 105, 0.96)),
    linear-gradient(135deg, var(--accent-primary), #6366f1);
  border-color: rgba(22, 163, 74, 0.2);
  box-shadow: 0 14px 28px rgba(22, 163, 74, 0.22), inset 0 1px 0 rgba(255,255,255,0.12);
}

.dashboard-run-all.qa-accent:hover {
  box-shadow: 0 16px 34px rgba(22, 163, 74, 0.3), 0 0 0 1px rgba(255,255,255,0.12) inset;
}

.dashboard-run-all.qa-accent:active {
  transform: translateY(1px) scale(0.99);
}

/* ─── 底部 LED 指数条（固定居中）─── */
.ticker-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: #0a0a0f;
  border-top: 1px solid rgba(0, 255, 136, 0.15);
  overflow: hidden;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ticker-track {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.tk-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 40px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}
.tk-name {
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  letter-spacing: 2px;
}
.tk-price {
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 6px currentColor;
}
.tk-pct {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.tk-pct.pos { color: #ff4444; text-shadow: 0 0 8px rgba(255,68,68,0.6); }
.tk-pct.neg { color: #00ff88; text-shadow: 0 0 8px rgba(0,255,136,0.6); }
.tk-sep {
  color: rgba(0,255,136,0.25);
  font-size: 10px;
}
.ticker-loading {
  color: rgba(255,255,255,0.4);
  padding: 0 28px;
  font-family: var(--font-mono);
  font-size: 13px;
}
/* 确保内容不被 ticker 遮挡 */
.main { padding-bottom: 50px; }

/* ─── 研报预览弹窗 ─── */
.research-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.research-modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.research-modal-box {
  position: relative;
  width: 90%; max-width: 900px; height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.rm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rm-header h3 { font-size: 16px; font-weight: 700; }
.rm-actions { display: flex; gap: 8px; }
.rm-file {
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  word-break: break-all;
}
.rm-body { flex: 1; overflow: hidden; padding: 12px; }
@media (max-width: 768px) {
  .research-modal-box { width: 95%; height: 90vh; }
  .rm-header { flex-direction: column; gap: 8px; align-items: stretch; }
}

/* ─── 板块热力图 ─── */
.card-meta { font-size: 12px; color: var(--text-tertiary); }
.heatmap-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: 100%;
}
.heatmap-panel {
  min-width: 0;
}
.heatmap-panel-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 5px;
  align-content: start;
}
.hm-cell {
  border-radius: var(--radius-sm);
  min-height: 42px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: transform var(--t-fast);
}
.hm-cell:hover { transform: scale(1.08); z-index: 1; }
.hm-cell.selected {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.18);
}
.hm-name { font-size: 11px; color: rgba(255,255,255,0.95); margin-bottom: 2px; font-weight: 600; }
.hm-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }

/* ─── AI 板块掘金 ─── */
.sector-scout-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}
.sector-scout-controls {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--glass-bg-level-1);
}
.sc-current {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.sc-label,
.sc-field span,
.sc-stock-grid small,
.sc-stock-notes small {
  font-size: 11px;
  color: var(--text-tertiary);
}
.sc-current strong {
  font-size: 22px;
  color: var(--text-primary);
}
.sc-current small {
  color: var(--text-secondary);
  line-height: 1.4;
}
.sc-field {
  display: grid;
  gap: 6px;
}
.sector-scout-history {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.sc-mini-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
}
.sc-history-list {
  display: grid;
  gap: 7px;
}
.sc-history-item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
  color: var(--text-secondary);
  cursor: pointer;
}
.sc-history-item:hover {
  border-color: var(--gold-border);
  background: var(--gold-bg);
}
.sc-history-item strong {
  color: var(--text-primary);
  font-size: 13px;
}
.sc-history-item span,
.sc-history-item small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  color: var(--text-tertiary);
}
.sector-scout-results {
  min-width: 0;
}
.sector-scout-empty,
.sector-scout-loading {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-tertiary);
}
.sector-scout-list {
  display: grid;
  gap: 14px;
}
.sc-view {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--glass-bg-level-1);
  border: 1px solid var(--border-light);
  line-height: 1.6;
}
.sc-source-chips,
.sc-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.sc-source-chips span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 12px;
}
.sc-note-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.7;
}
.sector-pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.sector-empty-hint {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(560px, 100%);
  margin: 16px auto 0;
}
.sector-empty-hint > div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
  text-align: left;
}
.sector-empty-hint small {
  color: var(--text-tertiary);
  font-size: 11px;
}
.sector-empty-hint strong {
  color: var(--text-primary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sc-empty-actions {
  justify-content: center;
}
.sector-pool-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}
.sector-pool-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sector-pool-item strong {
  color: var(--text-primary);
}
.sector-pool-item small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-tertiary);
}
.pool-score {
  flex: 0 0 auto;
}
.pool-score strong {
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
}
.sc-stock-card {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}
.sc-stock-head,
.sc-stock-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.sc-stock-head strong {
  font-size: 18px;
  margin-right: 8px;
}
.sc-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
}
.sc-rating span {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  font-size: 12px;
}
.sc-stock-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.sc-stock-tags span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--glass-bg-level-1);
  color: var(--text-secondary);
  font-size: 12px;
}
.sc-verdict {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-border);
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.10), var(--glass-bg-level-1));
}
.sc-verdict p {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.6;
}
.sc-verdict-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.sc-verdict-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 12px;
}
.sc-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.sc-evidence-grid > div {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
  border: 1px solid var(--border-light);
}
.sc-evidence-grid small {
  display: block;
  margin-bottom: 6px;
  color: var(--text-tertiary);
  font-size: 11px;
}
.sc-evidence-grid ul {
  margin: 0;
  padding-left: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.sc-evidence-grid p {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.6;
}
.sc-stock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.sc-stock-grid div {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
}
.sc-stock-grid p {
  margin: 4px 0 0;
  color: var(--text-primary);
  line-height: 1.5;
}
.sc-stock-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.sc-stock-notes ul {
  margin: 6px 0 0;
  padding-left: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.sc-data-basis {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
  border: 1px dashed var(--border-light);
}
.sc-data-basis small {
  font-size: 11px;
  color: var(--text-tertiary);
}
.sc-data-basis ul {
  margin: 6px 0 0;
  padding-left: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─── 历史决策回放 ─── */
.history-card .card-header {
  gap: 16px;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.history-card .card-header h3 {
  flex: 0 0 auto;
  white-space: nowrap;
}

.history-date-select {
  flex: 0 0 194px;
  width: 194px;
  min-width: 176px;
  max-width: 240px;
  height: 36px;
  padding: 0 34px 0 14px;
  border-radius: 10px;
  font-size: 13px;
  background-position: right 12px center;
}

.history-import-btn {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  white-space: nowrap;
}

.history-summary {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--glass-bg-level-2);
  border-radius: var(--radius-sm);
}
.hs-item { font-size: 14px; color: var(--text-secondary); }
.hs-item strong { font-size: 16px; }
.hs-item.pos strong { color: var(--red); }
.hs-item.neg strong { color: var(--green); }

/* ─── Method Chart ─── */
#methodChart {
  display: grid;
  gap: 12px;
  padding: 18px 24px 16px;
}

.method-bar {
  display: grid;
  grid-template-columns: 110px minmax(120px, 1fr) 36px;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}
.method-bar .mb-name {
  font-size: 13px;
  text-align: right;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.method-bar .mb-track {
  height: 20px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.method-bar .mb-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.method-bar .mb-count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ─── Stock List ─── */
.stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: padding var(--t-fast);
}
.stock-item:hover { background: var(--glass-bg-level-1); }
.stock-item:last-child { border-bottom: none; }
.stock-item .si-left { display: flex; gap: 8px; align-items: baseline; }
.stock-item .si-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
}
.stock-item .si-name { font-weight: 500; }
.stock-item .si-pnl {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.si-pnl.positive { color: var(--red); }
.si-pnl.negative { color: var(--green); }

/* ─── 智能预警 / 策略复盘 ─── */
.intelligence-grid {
  align-items: stretch;
}
.alert-list,
.review-rank-list {
  display: grid;
  gap: 10px;
}
.review-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.review-window,
.review-backfill {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.review-window.active {
  color: var(--gold);
  border-color: var(--gold-border);
  background: var(--gold-bg);
}
.review-backfill {
  color: var(--text-primary);
}
.review-backfill:disabled {
  opacity: .55;
  cursor: wait;
}
.alert-item {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
}
.alert-item.high {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.08);
}
.alert-item.medium {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.08);
}
.alert-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.alert-main-row > .mono:last-child {
  margin-left: auto;
  font-weight: 700;
  flex: 0 0 auto;
}
.alert-stock-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.alert-stock-title strong {
  color: var(--text-primary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.alert-level {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--gold);
  flex: 0 0 auto;
}
.alert-item.high .alert-level { background: var(--red); }
.alert-item.medium .alert-level { background: var(--orange); }
.alert-item p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}
.alert-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.alert-tags span {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--text-tertiary);
  font-size: 11px;
}
.review-rank-item {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
}
.review-rank-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.review-rank-no {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
}
.review-rank-head strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.review-rank-metrics {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding-left: 38px;
}
.review-status {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  font-size: 12px;
  font-weight: 700;
}
.compact-empty {
  min-height: 120px;
}
.tracking-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.alert-mini-badge {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--border-light);
}
.alert-mini-badge.high {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.08);
}
.alert-mini-badge.medium {
  color: var(--orange);
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.08);
}
.tracking-alert-row.high {
  background: rgba(239, 68, 68, 0.035);
}
.tracking-alert-row.medium {
  background: rgba(245, 158, 11, 0.035);
}
.alert-main-row,
.review-rank-item {
  cursor: pointer;
}
.review-rank-item:hover,
.alert-item:hover {
  border-color: var(--gold-border);
}
.review-detail-modal {
  max-width: 960px;
}
.review-detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.review-detail-summary > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
}
.review-detail-summary small {
  color: var(--text-tertiary);
  font-size: 11px;
}
.review-detail-summary strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
}
.review-explain-box {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
  color: var(--text-primary);
  line-height: 1.65;
  margin-bottom: 14px;
}
.review-record-list {
  display: grid;
  gap: 10px;
}
.review-record-item {
  display: grid;
  gap: 9px;
  padding: 13px 15px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
}
.review-record-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.review-record-head strong {
  margin-right: 8px;
  color: var(--text-primary);
}
.review-record-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
}
.review-record-item p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}
.detail-tags {
  margin-top: 12px;
}

/* ─── Strategy Cards (2-column grid) ─── */
.strategy-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.strategy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid #ccc;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--t-normal);
  position: relative;
  overflow: hidden;
}

.strategy-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: inherit;
  opacity: 0;
}

.strategy-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--border);
}

/* Strategy card header */
.strategy-card .sc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.strategy-card .sc-title {
  flex: 1;
  min-width: 0;
}

.strategy-card .sc-name {
  font-weight: 700;
  font-size: 17px;
  color: var(--text-primary);
  line-height: 1.3;
}

.strategy-card .sc-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 3px;
  line-height: 1.5;
}

.strategy-card .sc-status {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-weight: 500;
  align-self: flex-start;
}
.strategy-card .sc-status.running {
  color: var(--gold);
  background: var(--gold-bg);
}
.strategy-card .sc-status.done {
  color: var(--green);
  background: var(--green-bg);
}
.strategy-card .sc-status.error {
  color: var(--red);
  background: var(--red-bg);
}

/* Footer: range badge + execute button */
.strategy-card .sc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.strategy-card .sc-range {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.strategy-card .sc-range-label {
  font-size: 11px;
  color: var(--text-quaternary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}

/* ─── Table ─── */
.table-wrap {
  background: var(--glass-bg-level-1);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-md);
  position: relative;
}
.table-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 1080px; /* 13 列内容较多，窄屏走横向滚动而非挤压 */
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

#page-tracking .table-wrap {
  width: 100%;
}

#trackingTable {
  min-width: 1380px;
}

#trackingTable th:last-child,
#trackingTable td:last-child {
  min-width: 72px;
  text-align: center;
  padding-right: 22px;
}

#trackingTable th[data-key="method"],
#trackingTable td:nth-child(6) {
  width: 180px;
  min-width: 160px;
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}

.data-table thead {
  background: var(--glass-bg-level-2);
}

.data-table th {
  font-family: 'Inter', sans-serif;
  padding: 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--t-fast);
}

.data-table th:hover { color: var(--text-primary); }
.data-table th.sortable::after {
  content: ' \2195';
  opacity: 0.3;
  font-size: 11px;
}
.data-table th.sort-asc::after { content: ' \2191'; opacity: 1; color: var(--gold); }
.data-table th.sort-desc::after { content: ' \2193'; opacity: 1; color: var(--gold); }

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.data-table tbody tr {
  transition: background var(--t-fast);
}

.data-table tbody tr:hover {
  background: var(--glass-bg-level-1);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table.compact th,
.data-table.compact td {
  padding: 6px 12px;
  font-size: 12px;
}

.data-table .col-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* 列宽控制：窄列固定，长文本列省略 */
.data-table .col-index { width: 40px; text-align: center; }
.data-table th[data-key="holding_days"],
.data-table td:nth-child(10) { width: 50px; text-align: center; } /* 天数 */
.data-table .col-pnl,
.data-table th[data-key="pnl"] { width: 80px; text-align: right; }
.data-table .col-signal { width: 84px; text-align: center; }
.data-table th[data-key="entry_price"],
.data-table th[data-key="latest_price"],
.data-table th[data-key="score"] { width: 72px; text-align: right; }
.data-table th[data-key="code"] { width: 76px; }
.data-table th[data-key="first_date"] { width: 92px; }
.data-table th[data-key="status"] { width: 72px; }
/* 名称列超长省略 */
.data-table th[data-key="name"],
.data-table td[data-key="name"] {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 行业/方案列省略 */
.data-table th[data-key="industry"],
.data-table th[data-key="method"] {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table .col-pnl {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 缺入选价标记：盈亏不可知，避免误显示为 0.00% */
.entry-missing-tag {
  display: inline-block;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-base);
  color: var(--text-tertiary);
  background: rgba(125, 133, 144, 0.12);
  border-radius: 3px;
}

/* 追踪池买卖信号列（A股惯例：红买绿卖） */
.col-signal { text-align: center; font-size: 12px; white-space: nowrap; }
.sig-buy { color: #dc2626; font-weight: 600; cursor: help; }
.sig-sell { color: #16a34a; font-weight: 600; cursor: help; }
.sig-buy.sig-recent {
  background: rgba(220, 38, 38, 0.12);
  padding: 2px 6px;
  border-radius: 3px;
  animation: sig-pulse 1.5s ease-in-out infinite;
}
.sig-sell.sig-recent {
  background: rgba(22, 163, 74, 0.12);
  padding: 2px 6px;
  border-radius: 3px;
  animation: sig-pulse 1.5s ease-in-out infinite;
}
.sig-none, .sig-flat { color: var(--text-tertiary); }
.sig-nocache { color: var(--text-tertiary); font-size: 11px; cursor: help; }
@keyframes sig-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ─── Filter Bar ─── */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  padding: 9px 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg-level-1);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast);
}

.filter-bar select:hover,
.filter-bar input:hover {
  border-color: var(--glass-border-strong);
  background: var(--glass-bg-level-2);
  transform: translateY(-1px);
}
.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px var(--gold-bg);
}

/* ─── 实时模式开关 ─── */
.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--glass-bg-level-2);
  transition: all 0.2s;
  user-select: none;
}
.live-toggle:hover { border-color: var(--gold); }
.live-toggle .lt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: all 0.2s;
}
.live-toggle.active {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239,68,68,0.08);
}
.live-toggle.active .lt-dot {
  background: var(--red);
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* 盈亏数字跳动动画 */
.pnl-flash {
  animation: pnl-flash 0.6s ease;
}
@keyframes pnl-flash {
  0% { transform: scale(1); }
  30% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ─── Status Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-holding { background: var(--gold-bg); border-color: var(--gold-border); color: var(--gold); }
.badge-profit  { background: var(--red-bg); color: var(--red); }
.badge-stop    { background: var(--green-bg); color: var(--green); }

/* ─── Analysis Layout ─── */
.research-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.research-page-head .page-title {
  margin-bottom: 6px;
}

.research-page-head p {
  max-width: 680px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.6;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.28fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.report-list-shell {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--glass-bg-level-2), var(--glass-bg-level-1)),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.report-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
}

.report-list-head span {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
}

.report-list-head small {
  color: var(--text-tertiary);
  font-size: 12px;
}

.report-list {
  max-height: calc(100vh - 270px);
  overflow-y: auto;
  padding: 8px 12px 14px;
}

.report-item {
  position: relative;
  margin-bottom: 10px;
  padding: 14px 14px 13px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.report-item:hover {
  transform: translateY(-1px);
  border-color: var(--gold-border);
  background: var(--surface-hover);
  box-shadow: var(--shadow-sm);
}
.report-item.active {
  background: var(--gold-bg);
  border-color: var(--gold-border);
  box-shadow: inset 3px 0 0 var(--gold);
}

.report-item .ri-date {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.report-item .ri-type {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.report-content {
  position: relative;
  min-height: 520px;
  background:
    linear-gradient(135deg, rgba(255, 215, 0, 0.08), transparent 34%),
    linear-gradient(180deg, var(--surface), var(--glass-bg-level-1));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}

.report-content h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.report-content .stock-analysis {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.report-content .stock-analysis:last-child { border-bottom: none; }

.report-content .sa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.report-content .sa-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.report-content .sa-score {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold);
}

.report-content .sa-section { margin: 10px 0; }

.report-content .sa-section-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.report-content .sa-section-body {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─── Settings Form ─── */
body.modal-open {
  overflow: hidden;
}

.settings-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeIn 0.18s ease;
}

.settings-modal {
  width: min(1040px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 56px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--surface-1), var(--surface));
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--border-light);
}

.settings-modal-header h3 {
  font-size: 20px;
  line-height: 1.2;
  color: var(--text-primary);
}

.settings-modal-header p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.settings-modal-body {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-right: 1px solid var(--border-light);
  background: var(--glass-bg-level-1);
}

.settings-tab {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.settings-tab:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.settings-tab.active {
  color: var(--text-primary);
  border-color: var(--gold-border);
  background: var(--gold-bg);
}

.settings-content {
  min-width: 0;
  overflow-y: auto;
  padding: 22px;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-section {
  padding: 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--glass-bg-level-2);
}

.settings-section + .settings-section {
  margin-top: 16px;
}

.settings-section-head {
  margin-bottom: 18px;
}

.settings-section-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-section-head h4 {
  font-size: 16px;
  color: var(--text-primary);
}

.settings-section-head p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.55;
}

.theme-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.theme-mode-option {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.theme-mode-option:hover {
  transform: translateY(-1px);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-sm);
}

.theme-mode-option.active {
  border-color: var(--gold);
  background: var(--gold-bg);
  box-shadow: inset 0 0 0 1px var(--gold-border);
}

.theme-mode-option span {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
}

.theme-mode-option small {
  display: block;
  color: var(--text-tertiary);
  line-height: 1.45;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: none;
  gap: 16px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.setting-row label {
  font-weight: 500;
  color: var(--text-secondary);
}

.setting-row input[type="number"],
.setting-row input[type="time"] {
  width: 120px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color var(--t-fast);
}

.setting-row input:focus {
  border-color: var(--gold);
  outline: none;
}

.setting-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--gold);
}

.setting-row-full {
  grid-column: 1 / -1;
  align-items: stretch;
  flex-direction: column;
}

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

.account-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.account-field span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.account-field input {
  width: 100%;
  height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--text-primary);
  font: inherit;
}

.account-field input:focus {
  border-color: var(--gold);
  outline: none;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.model-config-section {
  background: var(--surface);
}

.model-config-block + .model-config-block {
  margin-top: 34px;
}

.model-config-title {
  margin-bottom: 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
}

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

.model-option-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 112px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--glass-bg-level-1);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.model-option-card:hover {
  transform: translateY(-1px);
  border-color: var(--gold-border);
  background: var(--glass-bg-level-2);
  box-shadow: var(--shadow-sm);
}

.model-option-card.selected {
  border-color: var(--gold);
  background: var(--gold-bg);
  box-shadow: inset 0 0 0 1px var(--gold-border);
}

.model-option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.model-radio {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.model-option-card.selected .model-radio {
  border: 6px solid #2f7df6;
}

.model-copy {
  min-width: 0;
}

.model-copy strong {
  display: block;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
}

.model-copy small {
  display: block;
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.api-key-list {
  display: grid;
  gap: 18px;
}

.api-key-row label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}

.api-key-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 88px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.api-key-control input {
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
}

.api-key-toggle,
.api-key-save {
  height: 48px;
  border: 0;
  border-left: 1px solid var(--border);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.api-key-toggle {
  background: var(--surface-1);
  color: var(--text-tertiary);
}

.api-key-save {
  background: #0f172a;
  color: #fff;
}

.api-key-row p {
  margin-top: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
}

.api-key-row a {
  color: #2f7df6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.settings-modal .auto-run-card {
  border-color: var(--gold-border);
  background: var(--glass-bg-level-2);
  box-shadow: none;
}

.settings-modal .auto-run-card::before {
  display: none;
}

.settings-modal .auto-run-status-bar {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 14px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.settings-modal .auto-run-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 18px;
  width: 100%;
}

.settings-modal .ari-item {
  min-width: 0;
  padding: 0 18px;
  border-left: 1px solid var(--border-light);
}

.settings-modal .ari-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.settings-modal .ari-value {
  max-width: none;
  font-size: 16px;
  line-height: 1.35;
}

.settings-modal .strategy-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.settings-modal .strategy-chip {
  width: 100%;
  min-height: 58px;
  justify-content: flex-start;
  padding: 10px 14px;
  border-radius: 18px;
}

.settings-modal .strategy-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--surface-1);
  color: var(--text-primary);
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { background: var(--green); color: #fff; }
.toast.error { background: var(--red); color: #fff; }
.toast.info { background: var(--gold); color: #fff; }
.toast.warning { background: var(--orange); color: #fff; }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

.toast.removing { animation: toastOut 0.3s ease forwards; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 26px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 { font-size: 18px; color: var(--text-primary); }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--t-fast);
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); background: var(--surface-hover); }

.modal-body {
  padding: 22px 26px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.stock-code-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-light);
  background: var(--surface-subtle);
  color: var(--gold);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.stock-code-link:hover {
  background: var(--surface-hover);
  border-color: var(--gold);
  color: var(--text-primary);
}

.kline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

.kline-quick-card .card-body {
  display: grid;
  gap: 14px;
}

.kline-quick-form {
  display: grid;
  grid-template-columns: minmax(160px, 260px) auto;
  gap: 10px;
  align-items: center;
}

.kline-quick-form input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--text-primary);
  font: inherit;
}

.kline-quick-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.16);
}

.kline-quick-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kline-example-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
}

.kline-example-btn:hover {
  border-color: var(--gold);
  color: var(--text-primary);
  background: var(--surface-hover);
}

.kline-example-btn small {
  color: var(--text-tertiary);
  font-size: 12px;
}

.kline-modal {
  max-width: 1040px;
}

.kline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.kline-chart-wrap {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  overflow: hidden;
}

#klineCanvas {
  display: block;
  width: 100%;
  height: auto;
}

.kline-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* 数据来源标记：缓存/旧缓存降级提示 */
.kline-src-tag {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 400;
}
.kline-src-tag.stale {
  color: #d97706;
  font-weight: 500;
}

/* 加载失败时的重试按钮 */
.kline-retry-btn {
  margin-left: 10px;
  padding: 2px 12px;
  font-size: 12px;
  color: var(--accent, #4a90d9);
  background: transparent;
  border: 1px solid var(--accent, #4a90d9);
  border-radius: 4px;
  cursor: pointer;
}
.kline-retry-btn:hover {
  background: var(--accent, #4a90d9);
  color: #fff;
}

.kline-legend i {
  display: inline-block;
  width: 16px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 2px;
}

.legend-price { background: var(--gold); }
.legend-ma5 { background: #f59e0b; }
.legend-ma10 { background: #3b82f6; }
.legend-ma20 { background: #8b5cf6; }

/* 买卖点图例：三角图标（A股惯例：红买绿卖） */
.legend-signal { display: inline-flex; align-items: center; gap: 5px; }
.legend-buy {
  display: inline-block;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 7px solid #dc2626;
}
.legend-sell {
  display: inline-block;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #16a34a;
}

.backtest-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.bt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bt-field-wide {
  grid-column: 1 / -1;
}

.bt-field label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.bt-field input {
  min-height: 38px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  padding: 8px 10px;
}

.bt-strategy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.bt-strategy-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--text-primary);
}

.bt-actions {
  display: flex;
  justify-content: flex-end;
}

.interactive-backtest-result {
  margin-top: 18px;
}

.backtest-running {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

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

.bt-result-summary > div {
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.bt-result-summary span {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
  margin-bottom: 4px;
}

.bt-result-summary strong {
  color: var(--text-primary);
  font-size: 18px;
}

.bt-info-note {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
  padding: 8px 12px;
  background: var(--bg-tertiary, rgba(125, 133, 144, 0.08));
  border-left: 3px solid var(--accent, #4a90d9);
  border-radius: 4px;
}

.bt-sample-note,
.bt-trades-head {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 10px 0;
}

@media (max-width: 900px) {
  .backtest-form,
  .bt-strategy-grid,
  .bt-result-summary {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .backtest-form,
  .bt-strategy-grid,
  .bt-result-summary {
    grid-template-columns: 1fr;
  }
}

.modal-footer .btn { min-width: 100px; }

/* ─── Run All Modal ─── */
.run-all-modal {
  max-width: 980px;
  max-height: 92vh;
}

.run-all-modal .modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.run-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.run-status-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 13px;
  transition: all var(--t-normal);
}

.run-status-tag .rst-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-quaternary);
  flex-shrink: 0;
}
.run-status-tag.running .rst-dot {
  background: var(--orange);
  animation: pulse 1s infinite;
}
.run-status-tag.done .rst-dot { background: var(--green); }
.run-status-tag.error .rst-dot { background: var(--red); }

@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.run-progress-bar {
  position: relative;
  height: 28px;
  background: var(--bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.run-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: var(--radius-md);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.run-progress-text {
  position: relative;
  z-index: 1;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.run-log {
  height: clamp(260px, 38vh, 420px);
  overflow-y: auto;
  background: #1a1a1a;
  color: #d4d4d4;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 16px;
  display: none;
}

.run-log.visible { display: block; }

.run-log div { word-break: break-all; }
.run-log-prefix {
  color: var(--gold);
  font-weight: 700;
}

.run-results {
  max-height: 240px;
  overflow-y: auto;
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
}

.empty-state .es-icon {
  display: none;
}

.empty-state .es-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state .es-desc {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ─── Loading Spinner ─── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ─── Placeholder (legacy) ─── */
.placeholder {
  color: var(--text-quaternary);
  text-align: center;
  padding: 24px;
  font-size: 14px;
}

/* ─── Misc ─── */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.pos { color: var(--red); }
.neg { color: var(--green); }
/* 表格内 .data-table td 的 color 优先级(0,1,1)会覆盖 .pos/.neg(0,1,0)，
   用 td.pos/td.neg 同等优先级但后定义来覆盖，确保涨跌红绿在表格内生效 */
td.pos { color: var(--red); font-weight: 600; }
td.neg { color: var(--green); font-weight: 600; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-tertiary); }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Number transition */
.tabular { font-variant-numeric: tabular-nums; }

/* ─── Keyboard Shortcut Hint ─── */
kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}

/* ─── Responsive Breakpoints ─── */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
  .main { padding: 24px 28px; }
  .hero-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .dashboard-market-grid { grid-template-columns: 1fr; }
  .dashboard-rank-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(300px, auto); }
  .analysis-layout { grid-template-columns: 220px 1fr; }
  .settings-modal .strategy-checkbox-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-modal .auto-run-info { grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 12px; }
  .settings-modal .ari-item { padding: 0 12px; }
  .model-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  /* ─── 移动端 Header 重构 ─── */
  .top-header {
    padding: 10px 14px;
    flex-wrap: wrap;
    height: auto;
    gap: 8px;
  }

  /* 第一行：logo 在左，设置+汉堡在右 */
  .header-left {
    flex: 1;
    gap: 8px;
    order: 1;
  }
  .header-left .logo .logo-text { display: flex; gap: 4px; }
  .header-left .logo .logo-title { font-size: 14px; }
  .header-left .logo .logo-sub { display: none; }  /* 手机只显示 Alchemy，隐藏 Stock Buster 副标题 */
  .header-left .logo-icon { font-size: 20px; }

  .menu-toggle {
    display: flex;
    width: 36px; height: 36px;
  }

  /* 右侧：隐藏时钟和状态，保留设置+汉堡 */
  .header-right {
    order: 2;
    gap: 8px;
    align-items: center;
  }
  .header-right .header-clock { display: none; }
  .header-right .status-indicator { display: none; }
  .header-right .nav-settings {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
  }

  /* 导航下拉面板：固定到 header 正下方，全宽 */
  .nav {
    position: fixed;
    top: 52px;  /* header 高度 */
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 4px 0;
    display: none;
    z-index: 200;
  }
  .nav.open { display: flex; }
  .nav .nav-item {
    padding: 14px 20px;
    border-radius: 0;
    border-left: none;
    font-size: 15px;
    border-bottom: 1px solid var(--border-light);
  }
  .nav .nav-item:last-child { border-bottom: none; }
  .nav .nav-item.active {
    background: var(--gold-bg);
    border-left: 3px solid var(--gold);
  }

  .main {
    padding: 16px 12px 60px;
    max-width: 100%;
  }

  /* 手机端指数条改为循环滚动 */
  .ticker-bar { justify-content: flex-start; }
  .ticker-track {
    justify-content: flex-start;
    animation: ticker-scroll 20s linear infinite;
  }
  .ticker-track:hover { animation-play-state: paused; }
  @keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }

  .hero-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-stat { padding: 16px 12px; }
  .hero-stat .stat-value { font-size: 28px; }

  .grid-2 { grid-template-columns: 1fr; gap: 16px; }
  .grid-2 { margin-bottom: 16px; }
  .review-rank-metrics {
    padding-left: 0;
  }
  .dashboard-market-grid { gap: 16px; margin-bottom: 16px; }
  .dashboard-rank-stack { grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(300px, auto)); gap: 16px; }
  .rank-square-card { min-height: 0; }
  .heatmap-split,
  .sector-scout-shell,
  .sector-empty-hint,
  .sc-evidence-grid,
  .sc-stock-grid,
  .sc-stock-notes {
    grid-template-columns: 1fr;
  }
  .sector-scout-controls {
    padding: 14px;
  }

  .page-title { font-size: 20px; margin-bottom: 18px; }

  .history-card .card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-date-select {
    width: 100%;
    max-width: none;
    flex-basis: auto;
  }

  .analysis-layout { grid-template-columns: 1fr; }

  .report-list { max-height: 200px; }

  .strategy-list {
    grid-template-columns: 1fr;
  }

  .filter-bar { gap: 8px; }
  .filter-bar select,
  .filter-bar input { flex: 1; min-width: 0; }

  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }

  .modal { max-width: 100%; border-radius: var(--radius-md); }
  .modal-header, .modal-body { padding: 16px 18px; }
  .run-all-modal { max-height: 94vh; }
  .run-log { height: clamp(220px, 34vh, 320px); }
  .run-results { max-height: 180px; }

  .settings-modal-overlay {
    align-items: stretch;
    padding: 12px;
  }

  .settings-modal {
    width: 100%;
    height: calc(100vh - 24px);
    border-radius: var(--radius-lg);
  }

  .settings-modal-header {
    padding: 16px 18px;
  }

  .settings-modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .settings-tabs {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border-light);
  }

  .settings-tab {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    white-space: nowrap;
    text-align: center;
  }

  .settings-content {
    padding: 14px;
  }

  .settings-section {
    padding: 16px;
  }

  .settings-section-head-row {
    flex-direction: column;
    align-items: stretch;
  }

  .theme-mode-grid,
  .compact-settings-form,
  .account-settings-grid,
  .model-option-grid {
    grid-template-columns: 1fr;
  }

  .model-option-card {
    min-height: 96px;
  }

  .api-key-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .api-key-toggle,
  .api-key-save {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .settings-modal .auto-run-status-bar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .settings-modal .auto-run-info {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settings-modal .ari-item {
    padding: 0 0 10px;
    border-left: 0;
    border-bottom: 1px solid var(--border-light);
  }

  .settings-modal .ari-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .settings-modal .strategy-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .theme-mode-option {
    min-height: 88px;
  }

  .account-actions {
    flex-direction: column;
  }

  .account-actions .btn {
    width: 100%;
  }

  .toast-container { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: 100%; }

  .run-status-grid { grid-template-columns: 1fr; }

  .setting-row { max-width: 100%; }
}

/* Small Mobile: < 480px */
@media (max-width: 480px) {
  .hero-row { grid-template-columns: repeat(2, 1fr); }
  .hero-stat .stat-value { font-size: 24px; }
  .main { padding: 56px 12px 60px; }
  #methodChart { padding: 16px; }
  .method-bar {
    grid-template-columns: 82px minmax(80px, 1fr) 30px;
    gap: 8px;
  }
}

/* Print */
@media print {
  .sidebar, .menu-toggle, .filter-bar, .dashboard-strategy-panel { display: none; }
  .main { padding: 0; overflow: visible; }
  .card, .table-wrap { box-shadow: none; border: 1px solid #ddd; }
}

/* ============================================================
   今日选股结果 — UI 组件
   ============================================================ */

.today-picks-meta {
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.today-picks-table {
  width: 100%;
}

/* 确保表头与内容列垂直对齐 */
.today-picks-table th,
.today-picks-table td {
  vertical-align: middle;
}
.today-picks-table th.text-right,
.today-picks-table td.text-right {
  text-align: right;
}
.today-picks-table th.text-center,
.today-picks-table td.text-center {
  text-align: center;
}

.today-picks-table .score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--gold-bg);
  color: var(--gold-dark, #8a6d00);
}

/* 免费版锁定提示行 */
.today-picks-table .locked-row td.locked-cta {
  text-align: center;
  padding: 14px 12px;
  background: var(--glass-bg-level-2);
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px dashed var(--border);
}
.today-picks-table .locked-row .lock-icon {
  margin-right: 6px;
}
.today-picks-table .locked-row .btn-link {
  margin-left: 10px;
  background: none;
  border: none;
  color: var(--gold-dark, #b8860b);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.today-picks-table .locked-row .btn-link:hover {
  text-decoration: underline;
}

/* ============================================================
   自动定时选股 — UI 组件
   ============================================================ */

/* 高亮卡片 */
.auto-run-card {
  border: 1px solid var(--gold);
  background: var(--surface-2);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.05);
  position: relative;
  overflow: hidden;
}

.auto-run-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.auto-run-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 状态 badge */
.auto-run-badge {
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.auto-run-badge.active {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #86efac;
}
.auto-run-badge.inactive {
  background: var(--surface-2);
  color: var(--text-tertiary);
  border: 1px solid var(--border);
}

/* 状态栏 */
.auto-run-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.auto-run-info {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.ari-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ari-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ari-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 策略复选框网格 */
.strategy-checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.strategy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.strategy-chip:hover {
  border-color: var(--gold-light);
}
.strategy-chip.selected {
  border-color: var(--gold);
  background: var(--gold-bg);
  font-weight: 600;
}
.strategy-chip input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* 执行历史区域 */
.auto-run-log-section {
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 0;
  user-select: none;
}
.log-header:hover {
  color: var(--gold);
}

.log-toggle-icon {
  font-size: 12px;
  transition: transform 0.2s;
}

.log-list {
  margin-top: 10px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #fff;
}
.log-item.log-success { border-left: 3px solid var(--green); background: var(--green-bg); }
.log-item.log-error { border-left: 3px solid var(--red); background: var(--red-bg); }
.log-item.log-skipped { border-left: 3px solid #d1d5db; background: #f9fafb; }
.log-item.log-manual { border-left: 3px solid var(--gold); background: var(--gold-bg); }

.log-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.log-content {
  flex: 1;
  min-width: 0;
}

.log-time {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.log-message {
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-word;
}

/* 执行日志的数字徽章与逐策略明细 */
.log-nums {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.log-num {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 1px 7px;
  border-radius: 3px;
  background: rgba(125, 133, 144, 0.1);
}
.log-details {
  display: flex;
  gap: 6px 10px;
  flex-wrap: wrap;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed var(--border-light);
}
.log-detail {
  font-size: 12px;
  color: var(--text-secondary);
}
.log-detail.ok { color: var(--green, #22c55e); }
.log-detail.fail { color: var(--red, #ef4444); }
.log-detail-err {
  color: var(--red, #ef4444);
  font-size: 11px;
}

.log-tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--gold);
  color: #fff;
  margin-left: 6px;
}

.log-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
  .auto-run-status-bar { flex-direction: column; align-items: stretch; }
  .auto-run-info { gap: 16px; }
  .strategy-checkbox-grid { flex-direction: column; }
}

/* Markdown 样式 */
.markdown-body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text-primary);
}
.markdown-body h1 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}
.markdown-body h2 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  color: var(--accent-primary);
}
.markdown-body h3 {
  font-size: 1.05rem;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}
.markdown-body p {
  margin-bottom: 1rem;
  line-height: 1.6;
}
.markdown-body ul, .markdown-body ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
.markdown-body li {
  margin-bottom: 0.3rem;
}
.markdown-body strong {
  color: var(--gold);
  font-weight: 600;
}
.markdown-body hr {
  border: 0;
  border-top: 1px dashed var(--border-color);
  margin: 2rem 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  overflow: hidden;
}
.markdown-body th, .markdown-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.markdown-body th {
  background: var(--glass-bg-level-2);
  font-weight: 600;
  color: var(--text-primary);
}
.markdown-body tr:last-child td {
  border-bottom: none;
}
.markdown-body code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.markdown-body pre code {
  background: transparent;
  padding: 0;
}
.markdown-body pre {
  background: #1e1e1e;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.markdown-body blockquote {
  border-left: 4px solid var(--accent-primary);
  margin: 0 0 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1rem;
  color: var(--text-muted);
  background: rgba(255, 215, 0, 0.05);
}

/* ============================================================
   研报专区（research）样式
   ============================================================ */

/* ─── 操作栏 ─── */
.research-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px;
  background:
    linear-gradient(135deg, var(--glass-bg-level-3), var(--glass-bg-level-1)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.research-query-block {
  min-width: 0;
}
.research-query-block label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.rt-input-group {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(220px, 0.32fr);
  gap: 10px;
}
.rt-input {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.rt-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-bg);
}
.rt-select {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
}
.research-action-block {
  display: grid;
  grid-template-columns: 150px 126px 126px;
  gap: 10px;
}
.research-toolbar .btn {
  height: 50px;
  white-space: nowrap;
}
.research-generate-btn {
  font-weight: 900;
  letter-spacing: 0;
}
.research-download-btn {
  color: var(--text-secondary);
}
.research-toolbar .btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── 加载状态 ─── */
.research-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}
.rl-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}
.rl-text { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.rl-sub { font-size: 13px; color: var(--text-muted); }

.research-empty-state {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.research-empty-kicker {
  margin-bottom: 14px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.research-empty-title {
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}

.research-empty-desc {
  max-width: 520px;
  margin-top: 10px;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.7;
}

.research-empty-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
  width: min(560px, 100%);
  margin-top: 28px;
}

.research-empty-grid span {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

/* ─── 研报报告主体 ─── */
.research-report { max-width: 100%; }

/* 封面：深色渐变 */
.rr-cover {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 14px;
  padding: 32px;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,0.08);
}
.rr-cover h1 { font-size: 24px; color: #f8fafc; margin-bottom: 6px; }
.rr-subtitle { font-size: 13px; color: #94a3b8; }
.rr-meta-row { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.rr-meta-item {
  background: rgba(255,255,255,0.08);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: #cbd5e1;
}
.rr-meta-item strong { color: #fbbf24; font-weight: 700; }

/* 评分进度条 */
.rr-scores {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}
.rr-scores h2 { font-size: 15px; color: var(--text); margin-bottom: 14px; }
.score-bar-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sb-label { width: 110px; font-size: 12px; color: var(--text-secondary); flex-shrink: 0; }
.sb-track {
  flex: 1; height: 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
}
.sb-fill { height: 100%; border-radius: 8px; transition: width 0.6s ease; }
.sb-value {
  width: 48px; text-align: right;
  font-size: 11px; color: var(--text-muted);
  font-family: var(--font-mono);
}

/* 关键价位卡片 */
.rr-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.rr-card {
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 4px solid;
}
.rr-card-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.rr-card-value { font-size: 20px; font-weight: 700; font-family: var(--font-mono); }
.rr-card.buy { background: rgba(239,68,68,0.08); border-color: var(--red); }
.rr-card.buy .rr-card-value { color: var(--red); }
.rr-card.stop { background: rgba(34,197,94,0.08); border-color: var(--green); }
.rr-card.stop .rr-card-value { color: var(--green); }
.rr-card.target { background: rgba(251,191,36,0.08); border-color: var(--yellow); }
.rr-card.target .rr-card-value { color: var(--yellow); }
.rr-card.rr { background: rgba(96,165,250,0.08); border-color: #60a5fa; }
.rr-card.rr .rr-card-value { color: #60a5fa; }

/* 10章节分析 */
.rr-sections {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.rr-sections-title { font-size: 15px; color: var(--text); margin-bottom: 16px; }
.rr-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.rr-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.rr-section-title {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rr-sec-num {
  background: var(--accent-primary);
  color: white;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.rr-section-body {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 30px;
}
.rr-section-body strong { color: var(--yellow); }
.rr-section-body h4 { color: #60a5fa; margin: 8px 0 4px; font-size: 13px; }
.emoji-up { color: var(--red); font-weight: 700; }
.emoji-down { color: var(--green); font-weight: 700; }
.emoji-mid { color: var(--yellow); font-weight: 700; }
.rr-empty { color: var(--text-muted); text-align: center; padding: 20px; }
.rr-footer {
  text-align: center;
  padding: 20px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ─── 历史研报列表项 ─── */
.research-item { cursor: pointer; }
.research-item .ri-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.research-item .ri-code {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.research-item .ri-sub {
  margin-top: 3px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
}
.research-item .ri-date {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 11px;
}
.research-item .ri-tags {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.ri-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.ri-badge.pdf { background: var(--red-bg); color: var(--red); }
.ri-badge.html { background: var(--gold-bg); color: var(--gold); }

.research-list-empty {
  padding: 48px 20px;
}

.report-content iframe {
  display: block;
}

/* 响应式 */
@media (max-width: 768px) {
  .rr-cards { grid-template-columns: repeat(2, 1fr); }
  .research-page-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .research-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .rt-input-group {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .research-action-block {
    grid-template-columns: 1fr;
  }
  .research-empty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rr-section-body { padding-left: 0; }
}

/* Markdown List Items in reports */
.md-li {
  margin-left: 12px;
  margin-top: 6px;
  display: block;
}

/* ─── 全局风险免责提示条 ─── */
.risk-disclaimer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.12), rgba(217, 119, 6, 0.06));
  border-bottom: 1px solid rgba(217, 119, 6, 0.25);
  font-size: 12px;
  line-height: 1.5;
  color: #fbbf24;
}
.risk-disclaimer-bar .rd-icon { font-size: 14px; flex-shrink: 0; }
.risk-disclaimer-bar .rd-text { flex: 1; }
.risk-disclaimer-bar .rd-text b { color: #f59e0b; }
.risk-disclaimer-bar .rd-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #fbbf24;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  opacity: 0.7;
}
.risk-disclaimer-bar .rd-close:hover { opacity: 1; }
[data-theme="light"] .risk-disclaimer-bar {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.1), rgba(217, 119, 6, 0.04));
  color: #b45309;
}
[data-theme="light"] .risk-disclaimer-bar .rd-text b { color: #92400e; }

/* ─── 认证弹窗 ─── */
.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.auth-modal {
  background: var(--surface, #1a1d24);
  border: 1px solid var(--border-light, #30363d);
  border-radius: 12px;
  padding: 32px;
  width: 380px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-tertiary, #7d8590);
  font-size: 18px;
  cursor: pointer;
}
.auth-close:hover { color: var(--text-primary, #1a1d24); }
.auth-modal-header { text-align: center; margin-bottom: 24px; }
.auth-modal-header h3 { margin: 0 0 4px; font-size: 22px; color: var(--text-primary); }
.auth-subtitle { margin: 0; font-size: 13px; color: var(--text-tertiary); }
.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary, #5a6168);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light, #30363d);
  border-radius: 8px;
  background: var(--bg-tertiary, #21262d);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent, #4a90d9);
}
.auth-error {
  color: var(--red, #ef4444);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}
.auth-submit {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  background: var(--accent, #4a90d9);
  color: #fff;
  cursor: pointer;
}
.auth-submit:hover { opacity: 0.9; }
.auth-submit:disabled { opacity: 0.6; cursor: wait; }
.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.auth-switch a {
  color: var(--accent, #4a90d9);
  text-decoration: none;
  margin-left: 4px;
}

/* 顶部导航的登录/用户入口 */
.auth-entry { display: flex; align-items: center; gap: 8px; position: relative; }
.auth-login-btn {
  padding: 6px 16px;
  border: 1px solid var(--accent, #4a90d9);
  border-radius: 6px;
  background: transparent;
  color: var(--accent, #4a90d9);
  font-size: 13px;
  cursor: pointer;
}
.auth-login-btn:hover { background: var(--accent, #4a90d9); color: #fff; }

/* ─── landing 页登录入口 ─── */
.landing-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 48px;
  z-index: 10;
}
.landing-auth-btn {
  padding: 12px 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}
.landing-auth-btn:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.landing-auth-btn.primary {
  background: linear-gradient(135deg, #4a90d9, #3b7dd8);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(74, 144, 217, 0.4);
}
.landing-auth-btn.primary:hover {
  box-shadow: 0 6px 28px rgba(74, 144, 217, 0.6);
}
.landing-guest-btn {
  display: block;
  margin-top: 4px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  padding: 8px;
}
.landing-guest-btn:hover { color: rgba(255, 255, 255, 0.8); }

/* ─── 顶部用户菜单（点击下拉） ─── */
.auth-user-menu-wrap { position: relative; }
.auth-user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.auth-user-trigger:hover { background: var(--glass-bg-level-1); border-color: var(--border-light); }
.auth-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a90d9, #3b7dd8);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-username { font-size: 13px; font-weight: 500; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-caret { font-size: 10px; color: var(--text-tertiary); }

.auth-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  overflow: hidden;
}
.auth-dropdown.show { display: block; }
.auth-dropdown-header {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-dd-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.auth-dd-email { font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; }
.auth-dropdown .auth-role {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(74, 144, 217, 0.15);
  color: #4a90d9;
}
.auth-dropdown-divider { height: 1px; background: var(--border-light); margin: 0; }
.auth-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.auth-dropdown-item:hover { background: var(--glass-bg-level-1); }
.auth-dropdown-item.danger { color: #ef4444; }
.auth-dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.1); }
.adi-icon { width: 16px; text-align: center; }

/* ─── 权益锁定遮罩 ─── */
.entitlement-lock {
  position: absolute;
  inset: 0;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  z-index: 50;
  border-radius: inherit;
}
.entitlement-lock .lock-icon { font-size: 28px; opacity: 0.85; }
.entitlement-lock .lock-hint {
  font-size: 13px;
  color: #c9d1d9;
  text-align: center;
  max-width: 240px;
  line-height: 1.4;
}
.entitlement-lock .lock-upgrade-btn {
  margin-top: 4px;
  padding: 7px 22px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #4a90d9, #3b7dd8);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(74, 144, 217, 0.4);
  white-space: nowrap;
}
.entitlement-lock .lock-upgrade-btn:hover { box-shadow: 0 6px 22px rgba(74, 144, 217, 0.6); }
[data-theme="light"] .entitlement-lock { background: rgba(245, 246, 248, 0.9); }

/* 锁定占位（替代真实数据，居中显示在 card-body 内）*/
.locked-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
}
.locked-placeholder .lp-icon { font-size: 32px; opacity: 0.7; }
.locked-placeholder .lp-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  max-width: 240px;
  line-height: 1.4;
}
.locked-placeholder .lp-btn {
  margin-top: 4px;
  padding: 7px 22px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #4a90d9, #3b7dd8);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(74, 144, 217, 0.4);
}
.locked-placeholder .lp-btn:hover { box-shadow: 0 6px 22px rgba(74, 144, 217, 0.6); }

/* 游客锁定的导航项 */
.nav-item.nav-guest-locked {
  display: none !important;
}

/* 锁定的导航项：游客/免费版能看到但点不了，引导升级 */
.nav-item.nav-locked {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
}
.nav-item.nav-locked::after {
  content: '🔒';
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.8;
}
.nav-item.nav-locked:hover {
  opacity: 0.7;
}

/* ─── 套餐权益对比页 ─── */
.page-subtitle { color: var(--text-tertiary); margin: -8px 0 24px; font-size: 14px; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}
@media (max-width: 768px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.pricing-card.pricing-highlight {
  border-color: var(--accent, #4a90d9);
  box-shadow: 0 8px 32px rgba(74, 144, 217, 0.18);
  transform: translateY(-4px);
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #4a90d9, #3b7dd8);
  color: #fff;
  font-size: 12px;
  padding: 4px 16px;
  border-radius: 12px;
  white-space: nowrap;
}
.pricing-name { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.pricing-price { font-size: 32px; font-weight: 700; color: var(--accent, #4a90d9); margin: 8px 0 4px; }
.pricing-desc { font-size: 13px; color: var(--text-tertiary); margin-bottom: 18px; min-height: 18px; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.pricing-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}
.pf-check { color: #22c55e; font-weight: 700; }
.pricing-cta {
  width: 100%;
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}
.cta-primary { background: linear-gradient(135deg, #4a90d9, #3b7dd8); color: #fff; }
.cta-primary:hover { box-shadow: 0 4px 16px rgba(74, 144, 217, 0.4); }
.cta-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text-primary); }
.cta-outline:hover { border-color: var(--accent); color: var(--accent); }

/* 详细对比表 */
.pricing-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pricing-table th {
  padding: 12px;
  text-align: center;
  color: var(--text-tertiary);
  font-weight: 600;
  border-bottom: 2px solid var(--border-light);
}
.pricing-table th.pt-feature, .pricing-table td.pt-feature { text-align: left; color: var(--text-secondary); width: 40%; }
.pricing-table th.pt-pro, .pricing-table td.pt-pro-cell { color: var(--accent, #4a90d9); }
.pricing-table td { padding: 10px 12px; text-align: center; border-bottom: 1px solid var(--border-light); }
.pricing-table tr.pt-category td {
  background: var(--glass-bg-level-1);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}
.pt-yes { color: #22c55e; font-weight: 700; font-size: 15px; }
.pt-no { color: var(--text-tertiary); }
.pt-text { color: var(--text-secondary); font-size: 12px; }
.pricing-detail-card .card-subtitle { font-size: 12px; color: var(--text-tertiary); }

/* ─── 管理后台 ─── */
.admin-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.admin-stat-row:last-child { border-bottom: none; }
.admin-stat-row span { color: var(--text-secondary); }
.admin-stat-row strong { color: var(--text-primary); }
.badge-admin {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
}
.badge-plan { font-size: 11px; padding: 2px 8px; border-radius: 3px; }
.badge-plan.plan-free { background: rgba(125, 133, 144, 0.15); color: var(--text-secondary); }
.badge-plan.plan-pro { background: rgba(74, 144, 217, 0.15); color: #4a90d9; font-weight: 600; }
.badge-plan.plan-enterprise { background: rgba(168, 85, 247, 0.15); color: #a855f7; font-weight: 600; }
.admin-actions { white-space: nowrap; }
.admin-actions .btn { margin-right: 4px; }

/* ============================================================
   科技要闻
   ============================================================ */
.news-date-select { max-width: 150px; }
.news-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.news-card {
  background: var(--card-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: var(--radius-md, 10px);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.news-card:hover { border-color: var(--gold, #b8860b); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.news-card:active { transform: translateY(0); }
.news-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 12px; }
.news-source { color: var(--gold, #b8860b); font-weight: 600; }
.news-time { color: var(--text-muted, #888); }
.news-card-title { font-size: 16px; font-weight: 600; margin: 0 0 6px; line-height: 1.4; }
.news-card-summary { font-size: 13px; color: var(--text-secondary, #aaa); margin: 0 0 8px; line-height: 1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.news-card-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.news-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px;
  background: rgba(184,134,11,0.12); color: var(--gold, #b8860b);
}
.news-tag-stock { background: rgba(46,160,67,0.14); color: #4caf50; }
.news-meta { margin-left: auto; }

/* 详情弹窗 */
#page-news .filter-bar select,
#page-news .filter-bar .btn { height: 32px; box-sizing: border-box; }
#page-news .filter-bar select { padding: 0 12px; line-height: 30px; }
.news-detail-modal { max-width: 980px; width: 94vw; }
.news-detail-modal .modal-body { overflow-x: hidden !important; }     /* 彻底取消左右滑条 */
.news-detail-modal .modal-body > * { max-width: 100%; }
.news-detail-modal .news-stocks-table { width: 100%; min-width: 0 !important; table-layout: fixed; word-break: break-word; }
.news-detail-modal .news-stocks-table th,
.news-detail-modal .news-stocks-table td { white-space: normal; word-break: break-word; max-width: 100%; }
.news-detail-meta { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom: 10px; font-size:12px; }
.news-detail-title { font-size: 20px; font-weight: 700; margin: 0 0 12px; line-height: 1.4; }
.news-detail-summary { font-size: 14px; line-height: 1.7; color: var(--text, #e3e1e9); margin-bottom: 20px; white-space: pre-wrap; word-break: break-word; }
.news-impact { font-size: 13px; line-height: 1.6; padding: 10px 14px; margin-bottom: 16px; border-radius: 8px; background: rgba(184,134,11,0.10); border-left: 3px solid var(--gold, #b8860b); color: var(--text-secondary, #d0c6ab); }
.news-block-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; color: var(--gold, #b8860b); }
.news-stocks-block { margin-top: 8px; }
/* 题材个股表：去掉滚动条，推荐理由列换行 */
.news-stocks-table { width: 100%; min-width: 0 !important; table-layout: fixed; }
.news-stocks-table th.ns-code,
.news-stocks-table td.mono { width: 80px; white-space: nowrap; }
.news-stocks-table th.ns-name,
.news-stocks-table td:nth-child(2) { width: 110px; white-space: nowrap; }
.news-stocks-table th.ns-reason { width: auto; }
.news-stocks-table td.news-stock-reason { white-space: normal; word-break: break-word; line-height: 1.55; }
.news-stocks-table td { vertical-align: top; }
