/* ==========================================================================
   AlphaQuant Editorial Design System
   Inspired by Claude (claude.com) by Anthropic
   Aesthetic: Quiet Intellectual Authority, Warm Ivory Canvas, Humanist Serif Typography
   Palette: Warm Ivory (#FAF9F5), Warm Parchment (#F5F4ED), Carbon Ink (#141413),
            Claude Terracotta (#D97757), Sage Forest (#237852), Crimson Brick (#C53929)
   ========================================================================== */

:root {
  /* Clean White Institutional Canvas & Surfaces */
  --bg-page: #FFFFFF;         /* Pure Clean White Canvas */
  --bg-card: #FFFFFF;         /* Crisp Card Surface */
  --bg-header: #FFFFFF;       /* Crisp White Header */
  --bg-ribbon: #F8FAFC;       /* Subtle Ribbon Surface */
  --bg-sidebar: #F8FAFC;      /* Clean Sidebar Background */
  --bg-subtle: #F1F5F9;       /* Light Slate Tint */
  --bg-elevated: #F8FAFC;     /* Elevated Container Layer */
  --bg-pill: #F1F5F9;         /* Segmented Pill Base */
  --bg-pill-hover: #E2E8F0;
  --bg-input: #FFFFFF;
  
  /* Crisp High-Contrast Borders */
  --border-subtle: #E2E8F0;   /* Clean Slate Border */
  --border-card: #E2E8F0;
  --border-input: #CBD5E1;
  --border-focus: #2563EB;    /* Indicative Blue Focus */
  --border-dark: #94A3B8;
  
  /* Ink & Typography Hierarchy */
  --text-primary: #0F172A;    /* Crisp Obsidian Black */
  --text-secondary: #334155;  /* Slate Dark Body */
  --text-muted: #64748B;      /* Medium Slate Muted */
  --text-dimmed: #94A3B8;     /* Light Slate */
  
  /* Distinctive Indicative Palette: Black, Orange, Blue */
  --accent-black: #0F172A;    /* Institutional Black */
  
  /* Indicative Vibrant Orange (Primary CTA, Buy Signals, Important Alerts) */
  --accent-orange: #FF6600;     /* High-Visibility Trading Orange */
  --accent-orange-hover: #EA580C;
  --accent-orange-light: #FFF7ED; /* Light Orange Tint */
  --accent-orange-border: #FDBA74;
  --accent-terracotta: #FF6600;
  
  /* Indicative Cobalt Blue (Active States, Selected Tabs, Navigation, Metric Focus) */
  --accent-blue: #2563EB;       /* Vibrant Cobalt Blue */
  --accent-blue-hover: #1D4ED8;
  --accent-blue-light: #EFF6FF; /* Light Blue Tint */
  --accent-blue-border: #93C5FD;
  --accent-navy: #1E3A8A;
  --accent-cyan: #0284C7;
  --accent-teal: #0D9488;
  --accent-purple: #7C3AED;

  /* Naturalist Financial Indicators */
  --color-bull: #059669;      /* Crisp Financial Emerald Green */
  --color-bull-bg: #ECFDF5;
  --color-bull-text: #065F46;
  --color-bear: #DC2626;      /* Crisp Financial Crimson Red */
  --color-bear-bg: #FEF2F2;
  --color-bear-text: #991B1B;

  /* Typography Stack: Tiempos / Galaxie Copernicus + Styrene + Fira Code / Fira Mono */
  --font-serif: "Tiempos Headline", "Tiempos Text", "Tiempos", "Galaxie Copernicus", "Copernicus", Georgia, "Times New Roman", serif;
  --font-sans: "Styrene A", "Styrene B", "Styrene", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", "Courier New", monospace;

  /* Geometry & Soft Paper Shadows */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(20, 20, 19, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(20, 20, 19, 0.04), 0 1px 2px -1px rgba(20, 20, 19, 0.02);
  --shadow-hover: 0 8px 24px -4px rgba(20, 20, 19, 0.07), 0 2px 6px -2px rgba(20, 20, 19, 0.03);
  --shadow-dropdown: 0 12px 32px -4px rgba(20, 20, 19, 0.12), 0 4px 12px rgba(20, 20, 19, 0.04);
  --shadow-modal: 0 24px 48px -12px rgba(20, 20, 19, 0.2);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Institutional Clean Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ==========================================================================
   Tier 1: Main Editorial Navigation Header
   ========================================================================== */

.app-header {
  height: 56px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #FF6B00 0%, #EA580C 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.28);
  flex-shrink: 0;
}

.logo-symbol {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0F172A;
  margin: 0;
  line-height: 1;
}

.badge-pro {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  background: #FFF7ED;
  color: #EA580C;
  border: 1px solid #FFEDD5;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* Modern Segmented Controller (Workspace Flow) */
.app-workspace-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #F1F3F5;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  flex-shrink: 0;
}

.nav-workspace-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #475569;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  line-height: 1.2;
}

.nav-workspace-btn:hover {
  color: #0F172A;
  background: rgba(255, 255, 255, 0.65);
}

.nav-workspace-btn.active {
  background: #FFFFFF;
  color: #0F172A;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.nwb-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #64748B;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  transition: all 0.15s ease;
}

.nav-workspace-btn.active .nwb-step {
  background: #0052CC;
  color: #FFFFFF;
}

.nwb-icon {
  font-size: 13px;
  line-height: 1;
}

/* Editorial Navigation Bar (Segmented Tabs) */
.nav-pages-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-pill);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 1;
  min-width: 0;
}

.nav-pages-bar::-webkit-scrollbar {
  display: none;
}

.nav-page-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-page-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

.nav-page-link.active {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue-border);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}

.nav-page-badge {
  font-size: 8.5px;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.badge-barra { background: #FEF7EB; color: #B45309; }
.badge-ml    { background: #E6F4F1; color: #237852; }
.badge-cta   { background: #EAF5EE; color: #1A5E3F; }
.badge-alloc { background: #F3EEF9; color: #7E57C2; }
.badge-cfg   { background: #F0EEE6; color: #4D4C48; }
.badge-paper { background: #E6F4F1; color: #1E3A3A; }

/* Header Right Controls */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  min-width: 0;
  justify-content: flex-end;
}

/* Institutional Search Box */
.search-box {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  padding: 0 6px 0 9px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 210px;
  min-width: 150px;
  max-width: 260px;
  height: 32px;
  box-sizing: border-box;
  flex-shrink: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.search-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
  width: 250px;
}

.search-icon {
  width: 13px;
  height: 13px;
  color: #94A3B8;
  margin-right: 6px;
  flex-shrink: 0;
}

.search-box input,
.search-box input[type="text"],
.search-box input#custom-ticker-input {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  font-size: 12px !important;
  padding: 0 4px 0 0 !important;
  margin: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  line-height: normal !important;
  flex: 1 1 auto !important;
}

.search-box input[type="text"]:focus,
.search-box input#custom-ticker-input:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.search-box input::placeholder,
.search-box input[type="text"]::placeholder {
  color: #94A3B8 !important;
  font-size: 11.5px !important;
}

.btn-search {
  background: #0F172A;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 7.5px;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
  line-height: 1.2;
}

.btn-search:hover {
  background: #1E293B;
}

/* Institutional Search Suggestions Dropdown (TradingView & Yahoo Finance Integrated Light Style) */
.search-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 420px;
  max-width: min(440px, calc(100vw - 32px));
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.16), 0 4px 8px -2px rgba(15, 23, 42, 0.08);
  padding: 6px 4px 8px 4px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: dropdownFade 0.15s ease;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.suggestion-header {
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}

.suggestion-header-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.suggestion-header-link {
  font-size: 11px;
  font-weight: 600;
  color: #0052cc;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}

.suggestion-header-link:hover {
  text-decoration: underline;
  color: #0747a6;
}

.suggestion-item {
  display: flex;
  flex-direction: column;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
  background: #eff6ff !important;
}

.suggestion-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.suggestion-symbol {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.2px;
}

.suggestion-item:hover .suggestion-symbol,
.suggestion-item.highlighted .suggestion-symbol {
  color: #0052cc;
}

.suggestion-type {
  font-size: 10.5px;
  font-weight: 700;
  color: #0052cc;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.suggestion-item:hover .suggestion-type,
.suggestion-item.highlighted .suggestion-type {
  background: #0052cc;
  color: #ffffff;
  border-color: #0052cc;
}

.suggestion-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 2px;
}

.suggestion-name {
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.suggestion-item:hover .suggestion-name,
.suggestion-item.highlighted .suggestion-name {
  color: #334155;
}

.suggestion-exchange {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-left: 8px;
}

.suggestion-item:hover .suggestion-exchange,
.suggestion-item.highlighted .suggestion-exchange {
  color: #64748b;
}

.suggestion-loading,
.suggestion-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.suggestion-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Institutional Period Selector (Segmented Pill) */
.period-selector {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #F1F3F5;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  flex-shrink: 0;
}

.period-btn {
  border: none;
  background: transparent;
  color: #64748B;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.period-btn:hover {
  color: #0F172A;
}

.period-btn.active {
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* System Status Pill */
.system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 4px 9px;
  flex-shrink: 0;
  max-width: 170px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
}

.status-text {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Tier 2: Institutional Market Watch & Benchmarks Ribbon Bar
   ========================================================================== */

/* ==========================================================================
   Tier 2: Watchlist & Custom Groups Ribbon Bar (自选股与自建分组)
   ========================================================================== */

.market-ribbon-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 64px;
  z-index: 90;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}

/* Group Switcher Section */
.ribbon-group-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ribbon-group-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
}

.ribbon-icon {
  width: 14px;
  height: 14px;
  color: #f59e0b;
}

.ribbon-group-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.group-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.group-select-dropdown {
  background: #f8fafc;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
  max-width: 170px;
}

.group-select-dropdown:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.12);
}

.btn-ribbon-action {
  background: #eff6ff;
  border: 1px dashed #bfdbfe;
  color: var(--accent-blue);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-ribbon-action:hover {
  background: #dbeafe;
  border-color: var(--accent-blue);
}

/* Ticker Chips Container */
.ticker-presets-container {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  padding: 2px 0;
  scrollbar-width: thin;
}

.ticker-presets {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticker-chip {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 6px 3px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.ticker-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.ticker-chip.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 82, 204, 0.25);
}

.chip-sym {
  display: inline-block;
}

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.12s ease;
  padding: 0;
}

.chip-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

.ticker-chip.active .chip-remove {
  color: rgba(255, 255, 255, 0.7);
}

.ticker-chip.active .chip-remove:hover {
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
}

.btn-add-chip {
  background: #ffffff;
  border: 1px dashed var(--border-input);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-add-chip:hover {
  border-color: var(--accent-blue);
  background: #eff6ff;
}

/* Right Actions & Indicator */
.ribbon-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-manage-groups {
  background: #ffffff;
  border: 1px solid var(--border-input);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-manage-groups:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: #94a3b8;
}

.icon-gear {
  flex-shrink: 0;
}

.ribbon-asset-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.rai-label {
  font-size: 11px;
}

.rai-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-blue);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 7px;
  border-radius: var(--radius-xs);
}

.btn-fav-star {
  background: #ffffff;
  border: 1px solid var(--border-input);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}

.btn-fav-star:hover {
  border-color: #f59e0b;
  color: #b45309;
}

.btn-fav-star.active {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

/* Watchlist & Custom Groups Modals */
.group-list-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  margin: 12px 0 16px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: #f8fafc;
}

.group-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.group-list-item:hover {
  border-color: #cbd5e1;
}

.group-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.group-item-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.group-item-tickers {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.group-item-badge {
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.group-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-group-switch {
  background: var(--accent-blue-light);
  border: 1px solid #F2C8B8;
  color: var(--accent-blue);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.btn-group-switch:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-group-del {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--color-bear);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.btn-group-del:hover {
  background: var(--color-bear-bg);
  border-color: #F7C6BE;
}

.new-group-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.new-group-input-row input {
  flex: 1;
}

.quick-stock-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-suggestion-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-suggestion-chip:hover {
  background: var(--accent-blue-light);
  border-color: #F2C8B8;
  color: var(--accent-blue);
}

/* ==========================================================================
   Sub-Header / Strategy Switcher & Title Banner
   ========================================================================== */

.strategy-navbar {
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow: hidden;
}

.strategy-navbar::-webkit-scrollbar {
  display: none;
}

.page-title-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.page-title-banner h2 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.page-title-banner p {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 800px;
}

.strategy-tabs {
  display: flex;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.strategy-tabs::-webkit-scrollbar {
  display: none;
}

.strat-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  min-width: 140px;
  max-width: 220px;
  box-shadow: var(--shadow-sm);
}

.strat-tab:hover {
  background: #FAF9F5;
  border-color: #DDD9CD;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(20, 20, 19, 0.05);
}

.strat-tab:active {
  transform: scale(0.98);
}

.strat-tab.active {
  background: #FAF0EB;
  border-color: #F2C8B8;
  box-shadow: 0 2px 6px rgba(217, 119, 87, 0.12);
}

.tab-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.tab-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tab-title {
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.strat-tab.active .tab-title {
  color: var(--accent-blue);
}

.tab-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Indicative Primary Action Button */
.btn-primary-action {
  background: var(--accent-orange);
  border: 1px solid var(--accent-orange-hover);
  color: #ffffff;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.28);
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-primary-action:hover {
  background: var(--accent-orange-hover);
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.35);
  transform: translateY(-1px);
}

.btn-primary-action:active {
  transform: translateY(0);
}

/* ==========================================================================
   Main Workspace Layout
   ========================================================================== */

.main-workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  flex: 1;
  min-height: calc(100vh - 120px);
  background: var(--bg-page);
}

/* Left Sidebar Controls */
.control-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  position: sticky;
  top: 120px;
}

.sidebar-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.sidebar-title .icon-svg {
  width: 15px;
  height: 15px;
  color: var(--accent-blue);
}

.ticker-badge {
  font-family: var(--font-mono);
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid #F2C8B8;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
}

.sidebar-scroll {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Parameter Card */
.param-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: all 0.15s ease;
}

.param-card:hover {
  border-color: #DDD9CD;
  box-shadow: 0 4px 12px rgba(20, 20, 19, 0.05);
}

.param-card-title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Form Inputs */
input[type="number"],
input[type="text"],
.custom-select {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  padding: 8px 12px;
  outline: none;
  transition: all 0.15s ease;
}

input[type="number"]:focus,
input[type="text"]:focus,
.custom-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}

.input-with-affix {
  display: flex;
  align-items: center;
  position: relative;
}

.input-with-affix .affix {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.input-with-affix input {
  padding-left: 24px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-blue);
  width: 15px;
  height: 15px;
  border-radius: 3px;
  cursor: pointer;
}

/* Institutional Range Sliders */
.range-with-val {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-with-val input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: #E8E6DC;
  border-radius: 3px;
  outline: none;
}

.range-with-val input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(20, 20, 19, 0.2);
  cursor: grab;
  border: 2px solid var(--accent-blue);
  transition: transform 0.15s;
}

.range-with-val input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-with-val span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-blue);
  width: 38px;
  text-align: right;
  font-weight: 700;
}

.input-hint {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}

.info-alert {
  background: var(--accent-blue-light);
  border: 1px solid #F2C8B8;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: #8C3E25;
  line-height: 1.55;
  margin-top: 8px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-input);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: #FAF9F5;
  color: var(--text-primary);
  border-color: #B0AEA5;
}

/* ==========================================================================
   Center Workspace & Charts
   ========================================================================== */

.content-workspace {
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--bg-page);
}

/* Claude Editorial KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #DDD9CD;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 6px 0;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1;
}

.kpi-value.positive {
  color: var(--color-bull);
}

.kpi-value.negative {
  color: var(--color-bear);
}

.kpi-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
}

.kpi-subtext {
  font-size: 11.5px;
  color: var(--text-muted);
  display: block;
  letter-spacing: -0.01em;
}

/* Chart Container Cards */
.chart-container-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.chart-title-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-sma20 { background-color: var(--accent-orange); }
.dot-sma50 { background-color: var(--accent-cyan); }
.dot-bb    { background-color: var(--accent-purple); }

.legend-marker {
  font-size: 10px;
  font-weight: 900;
}

.marker-buy { color: var(--color-bull); }
.marker-sell { color: var(--color-bear); }

.legend-line {
  width: 14px;
  height: 2.5px;
  border-radius: 2px;
  display: inline-block;
}

.line-strategy { background-color: var(--accent-blue); }
.line-benchmark { background-color: var(--text-muted); }
.line-momentum { background-color: var(--accent-orange); }
.line-ml { background-color: var(--accent-cyan); }
.line-turtle { background-color: var(--color-bull); }
.line-chan { background-color: #a855f7; }
.line-prediction-buy { background-color: #16a34a; }
.line-prediction-tp  { background-color: #0284c7; }
.line-prediction-sl  { background-color: #dc2626; }

.cursor-price-info {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-blue);
  background: var(--accent-blue-light);
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid #F2C8B8;
  font-weight: 600;
}

.chart-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-dock-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-dock-toggle:hover {
  background: var(--bg-subtle);
  border-color: #B0AEA5;
  color: var(--text-primary);
}

/* K-Line Workbench Grid & Prediction Dock */
.kline-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
  align-items: stretch;
  position: relative;
  transition: grid-template-columns 0.25s ease;
  min-width: 0;
}

.kline-workbench-grid.collapsed-dock {
  grid-template-columns: minmax(0, 1fr) 0px;
}

.kline-workbench-grid.collapsed-dock .kline-prediction-dock {
  display: none;
}

.kline-canvas-wrapper {
  width: 100%;
  height: 410px;
  position: relative;
  min-width: 0;
}

/* Prediction Dock Card */
.kline-prediction-dock {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-card);
  animation: fadeIn 0.2s ease-in;
  overflow: hidden;
}

.dock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.dock-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dock-status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-bull);
  box-shadow: 0 0 0 3px rgba(35, 120, 82, 0.2);
  display: inline-block;
}

.dock-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.dock-strategy-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid #F2C8B8;
}

/* Hero Action Card */
.dock-hero-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-signal-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hero-signal-badge.bull {
  background: var(--color-bull-bg);
  color: var(--color-bull-text);
  border: 1px solid #BCE4CE;
}

.hero-signal-badge.warn {
  background: #FEF7EB;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.hero-confidence-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-price-display {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.hero-price-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-price-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-price-val {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--color-bull);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-price-diff-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.hero-diff-label {
  font-size: 9.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-diff-val {
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--color-bull-text);
  background: var(--color-bull-bg);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #BCE4CE;
}

/* 2x2 Price Levels Grid */
.dock-levels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.level-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.cell-val {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.profit-color { color: var(--accent-cyan); }
.loss-color   { color: var(--color-bear); }
.rr-color     { color: var(--accent-blue); }

/* Forecast Analytics Rows */
.dock-forecast-section {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forecast-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}

.fc-row-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.fc-row-val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.fc-row-val.bull {
  color: var(--color-bull-text);
}

/* Commentary Box */
.dock-commentary-box {
  background: var(--accent-blue-light);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.commentary-header {
  display: flex;
  align-items: center;
  gap: 5px;
}

.comm-icon {
  font-size: 12px;
}

.comm-title {
  font-size: 11px;
  font-weight: 700;
  color: #8C3E25;
}

.commentary-text {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* Dock Action Buttons */
.dock-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.dock-action-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid var(--border-input);
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.dock-action-btn:hover {
  background: var(--bg-subtle);
  border-color: #B0AEA5;
  color: var(--text-primary);
}

.dock-action-btn.active {
  background: var(--accent-blue-light);
  border-color: var(--accent-blue-border, #93C5FD);
  color: var(--accent-blue);
}

@media (max-width: 1180px) {
  .kline-workbench-grid {
    grid-template-columns: 1fr;
  }
  .kline-canvas-wrapper {
    height: 380px;
  }
}

.canvas-wrapper {
  width: 100%;
  height: 380px;
  position: relative;
}

#equity-wrapper {
  height: 300px;
}

#compare-equity-wrapper {
  height: 360px;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   Factor & ML Diagnostics Panel
   ========================================================================== */

.diagnostics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}

.card-inner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.card-inner-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.ai-sparkle {
  color: var(--accent-blue);
  font-size: 16px;
}

.ml-meta-tags {
  display: flex;
  gap: 8px;
}

.ml-tag {
  background: var(--accent-blue-light);
  border: 1px solid #F2C8B8;
  color: var(--accent-blue);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-weight: 600;
}

.ml-diagnostics-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.feature-bar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feature-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.feature-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.feature-fill {
  height: 100%;
  background: linear-gradient(90deg, #D97757, #C97D30);
  border-radius: 3px;
}

.ml-explanation-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ml-explanation-box h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.ml-explanation-box p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ml-stat-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.stat-pill {
  background: #ffffff;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.03);
}

.stat-pill .p-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-pill .p-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
  margin-top: 4px;
}

/* ==========================================================================
   Trades Table
   ========================================================================== */

.trades-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}

.trades-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.trades-card-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.btn-sm {
  background: #ffffff;
  border: 1px solid var(--border-input);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sm:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.table-container {
  overflow-x: auto;
  max-height: 360px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.trades-table th {
  background: var(--bg-page);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trades-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.trades-table tbody tr:hover {
  background: var(--bg-subtle);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
  font-family: var(--font-sans);
  font-size: 13px;
}

.tag-badge {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-weight: 700;
}

.tag-badge.long {
  background: var(--color-bull-bg);
  color: var(--color-bull-text);
  border: 1px solid #BCE4CE;
}

.tag-reason {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Comparison Matrix View
   ========================================================================== */

.comparison-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.comp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.comp-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #DDD9CD;
}

.comp-card.highlight {
  border-color: var(--accent-blue);
  box-shadow: 0 4px 14px rgba(217, 119, 87, 0.15);
}

.comp-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 9.5px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid #F2C8B8;
}

.comp-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.comp-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.comp-stat-item {
  background: var(--bg-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.comp-stat-item .cs-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comp-stat-item .cs-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  display: block;
  margin-top: 3px;
  color: var(--text-primary);
}

/* ==========================================================================
   Modal Window
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 580px;
  max-width: 90vw;
  box-shadow: var(--shadow-modal);
  padding: 28px 32px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-close:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.modal-body p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 14px;
}

.code-snippet-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.code-snippet-box code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-blue);
  font-weight: 600;
}

.btn-copy {
  background: #ffffff;
  border: 1px solid var(--border-input);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

.modal-body h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.modal-body ul {
  padding-left: 20px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.modal-body code {
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Responsive Adaptations & Settings Styles
   ========================================================================== */

.badge-cfg {
  background: #F3EEF9;
  color: #7E57C2;
  border: 1px solid #E9D5FF;
}

/* Settings Workspace & Components */
.settings-workspace {
  animation: fadeIn 0.2s ease;
}

.preset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217, 119, 87, 0.12);
  border-color: #F2C8B8 !important;
}

/* Compact Active Profile Summary in Left Sidebar */
.active-profile-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(20, 20, 19, 0.02);
}

.mini-pillars-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-pillar-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mini-pillar-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.mini-pillar-pct {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-blue);
}

.mini-pillar-track {
  height: 6px;
  width: 100%;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.mini-pillar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.btn-open-settings-hub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent-blue-light);
  border: 1px solid #F2C8B8;
  color: var(--accent-blue);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-open-settings-hub:hover {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 2px 6px rgba(217, 119, 87, 0.28);
}

.btn-quick-tweak {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-tweak:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: #B0AEA5;
}

/* Collapsible Sidebar Mode */
.main-workspace.sidebar-collapsed {
  grid-template-columns: 44px 1fr;
}

.main-workspace.sidebar-collapsed .control-sidebar {
  width: 44px;
  overflow: hidden;
  padding: 0;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-page);
}

.main-workspace.sidebar-collapsed .sidebar-header {
  padding: 10px 4px;
  justify-content: center;
}

.main-workspace.sidebar-collapsed .sidebar-scroll,
.main-workspace.sidebar-collapsed .sidebar-title,
.main-workspace.sidebar-collapsed .ticker-badge {
  display: none !important;
}

.main-workspace.sidebar-collapsed .btn-toggle-sidebar-collapse {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.05);
}

.btn-toggle-sidebar-collapse {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.btn-toggle-sidebar-collapse:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Quick Drawer Modal */
.quick-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 20, 19, 0.45);
  backdrop-filter: blur(2px);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  animation: fadeIn 0.15s ease;
}

.quick-drawer-panel {
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -8px 0 24px rgba(20, 20, 19, 0.12);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.quick-drawer-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-drawer-header h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.quick-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.quick-drawer-footer {
  padding: 18px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
}

@media (max-width: 1200px) {
  .app-header {
    padding: 0 14px;
    gap: 10px;
  }
  .header-left {
    gap: 10px;
  }
  .nav-workspace-btn {
    padding: 5px 9px;
    font-size: 12px;
  }
  .search-box {
    width: 160px;
    min-width: 130px;
  }
  .search-box:focus-within {
    width: 200px;
  }
  .system-status {
    display: none;
  }
  .main-workspace {
    grid-template-columns: 270px 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .main-workspace {
    grid-template-columns: 1fr;
  }
  .control-sidebar {
    height: auto;
    position: static;
  }
  .strategy-navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .app-header {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .header-left, .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .market-ribbon-bar {
    top: auto;
    position: static;
  }
  .ml-diagnostics-grid {
    grid-template-columns: 1fr;
  }
  .comparison-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Brokerage-Grade Trading Interface & Watchlist Picker Styles
   (券商级交易看板、组合分组下拉面板与自选标的交互)
   ========================================================================== */

/* Brokerage Group Trigger & Dropdown */
.brokerage-group-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-brokerage-group-trigger {
  background: #ffffff;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.04);
}

.btn-brokerage-group-trigger:hover {
  border-color: var(--accent-blue);
  background: var(--bg-subtle);
  box-shadow: 0 2px 4px rgba(217, 119, 87, 0.12);
}

.btn-brokerage-group-trigger.active {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(217, 119, 87, 0.15);
}

.bgt-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bgt-name {
  color: var(--text-primary);
  font-weight: 600;
}

.bgt-arrow {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  max-width: 14px;
  max-height: 14px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.btn-brokerage-group-trigger.active .bgt-arrow {
  transform: rotate(180deg);
}

/* Brokerage Group Dropdown Menu */
.brokerage-group-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  z-index: 1000;
  padding: 8px;
  display: flex;
  flex-direction: column;
  animation: dropdownFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.brokerage-group-menu.hidden {
  display: none !important;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bgm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.bgm-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bgm-btn-new {
  background: var(--accent-blue-light);
  border: 1px dashed #F2C8B8;
  color: var(--accent-blue);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.bgm-btn-new:hover {
  background: #FAF0EB;
  border-color: var(--accent-blue);
}

.bgm-list {
  max-height: 270px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0;
}

.bgm-item {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1px solid transparent;
}

.bgm-item:hover {
  background: var(--bg-subtle);
  border-color: var(--border-subtle);
}

.bgm-item.active {
  background: var(--accent-blue-light);
  border-color: #F2C8B8;
}

.bgm-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bgm-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.bgm-item.active .bgm-item-title {
  color: var(--accent-blue);
}

.bgm-item-count {
  font-size: 10.5px;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 10px;
}

.bgm-item.active .bgm-item-count {
  background: #FAF0EB;
  color: var(--accent-blue);
}

.bgm-item-preview {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bgm-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 6px 4px 2px 4px;
}

.bgm-footer-manage {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.12s ease;
}

.bgm-footer-manage:hover {
  background: var(--bg-subtle);
  color: var(--accent-blue);
}

/* Collapsible Watchlist Ribbon Bar */
.btn-ribbon-toggle {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-ribbon-toggle:hover {
  background: var(--bg-subtle);
  border-color: #B0AEA5;
  color: var(--text-primary);
}

.market-ribbon-bar.collapsed .ticker-presets-container {
  display: none !important;
}

.market-ribbon-bar.collapsed {
  padding-top: 4px;
  padding-bottom: 4px;
}

/* Brokerage Real-time Quote & Market Stats Banner */
.brokerage-quote-banner {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.bqu-main-info {
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.bqu-ticker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bqu-ticker-sym {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.bqu-ticker-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.bqu-badge-market {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.bqu-price-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 4px;
}

.bqu-current-price {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  transition: color 0.3s ease, background-color 0.4s ease, transform 0.2s ease;
  display: inline-block;
}

.bqu-current-price.tick-up {
  color: var(--color-bull) !important;
  background-color: rgba(35, 120, 82, 0.12);
  animation: tickUpPulse 0.65s ease-out;
}

.bqu-current-price.tick-down {
  color: var(--color-bear) !important;
  background-color: rgba(197, 57, 41, 0.12);
  animation: tickDownPulse 0.65s ease-out;
}

@keyframes tickUpPulse {
  0% { transform: scale(1.05); background-color: rgba(35, 120, 82, 0.25); }
  60% { transform: scale(1.01); background-color: rgba(35, 120, 82, 0.10); }
  100% { transform: scale(1); background-color: transparent; }
}

@keyframes tickDownPulse {
  0% { transform: scale(1.05); background-color: rgba(197, 57, 41, 0.25); }
  60% { transform: scale(1.01); background-color: rgba(197, 57, 41, 0.10); }
  100% { transform: scale(1); background-color: transparent; }
}

/* 1-Second Real-Time Synchronization Pill */
.bqu-live-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bull-bg);
  border: 1px solid #BCE4CE;
  color: var(--color-bull-text);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 2px rgba(35, 120, 82, 0.08);
  transition: all 0.2s ease;
}

.pulse-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-bull);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(35, 120, 82, 0.6);
  animation: pulse-ring 1.8s infinite;
}

.live-clock-seconds {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-bull-text);
  font-weight: 600;
}

/* Market Status: Closed / Weekend / Pre-Market States */
.bqu-live-sync-indicator.closed {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: var(--text-muted);
  box-shadow: none;
}

.bqu-live-sync-indicator.closed .pulse-live-dot {
  background-color: var(--text-dimmed);
  animation: none;
  box-shadow: none;
}

.bqu-live-sync-indicator.closed .live-clock-seconds {
  display: none;
}

.bqu-live-sync-indicator.pre {
  background: #FEF7EB;
  border-color: #FDE68A;
  color: #B45309;
  box-shadow: none;
}

.bqu-live-sync-indicator.pre .pulse-live-dot {
  background-color: #F59E0B;
  animation: none;
  box-shadow: none;
}

.bqu-live-sync-indicator.pre .live-clock-seconds {
  display: none;
}

.bqu-change-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.25s ease;
  font-family: var(--font-mono);
}

.bqu-change-badge.positive {
  background: var(--color-bull-bg);
  color: var(--color-bull-text);
  border: 1px solid #BCE4CE;
}

.bqu-change-badge.negative {
  background: var(--color-bear-bg);
  color: var(--color-bear-text);
  border: 1px solid #F7C6BE;
}

.bqu-stats-grid {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 8px 18px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.bqu-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 60px;
}

.bqu-stat-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bqu-stat-val {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.bqu-stat-val.val-high {
  color: var(--color-bull-text);
}

.bqu-stat-val.val-low {
  color: var(--color-bear-text);
}

.bqu-actions-col {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bqu-nav-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-quote-nav {
  background: #ffffff;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-xs);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-quote-nav:hover {
  background: var(--accent-blue-light);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-quote-fav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #FEF7EB;
  border: 1px solid #FDE68A;
  color: #B45309;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quote-fav:hover {
  background: #FDF3D8;
  border-color: #F59E0B;
}

.btn-quote-fav.active {
  background: #F59E0B;
  border-color: #D97706;
  color: #ffffff;
}

/* Chip Price & Change Tag */
.chip-change-tag {
  font-size: 9.5px;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-weight: 700;
  margin-left: 2px;
}

.chip-change-tag.pos {
  background: var(--color-bull-bg);
  color: var(--color-bull-text);
}

.chip-change-tag.neg {
  background: var(--color-bear-bg);
  color: var(--color-bear-text);
}

.ticker-chip.active .chip-change-tag {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

@media (max-width: 900px) {
  .bqu-stats-grid {
    width: 100%;
    overflow-x: auto;
    padding: 8px 12px;
  }
  .brokerage-quote-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Paper Trading Module
   ========================================================================== */

.paper-trading-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 32px 40px 72px 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  background: var(--bg-page);
}

/* Live Market Status Bar */
.paper-market-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  box-shadow: var(--shadow-card);
  gap: 16px;
  flex-wrap: wrap;
}

.market-status-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.market-pulse-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.market-pulse-pill.open {
  background: var(--color-bull-bg);
  border-color: #BCE4CE;
  color: var(--color-bull-text);
}

.market-pulse-pill.closed {
  background: var(--color-bear-bg);
  border-color: #F7C6BE;
  color: var(--color-bear-text);
}

.market-pulse-pill.pre {
  background: #FEF7EB;
  border-color: #FDE68A;
  color: #B45309;
}

.pulse-indicator-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-bull);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(35, 120, 82, 0.7);
  animation: pulse-ring 2s infinite;
}

.market-pulse-pill.closed .pulse-indicator-dot {
  background: var(--color-bear);
  box-shadow: none;
  animation: none;
}

.market-pulse-pill.pre .pulse-indicator-dot {
  background: #F59E0B;
  box-shadow: none;
  animation: none;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(35, 120, 82, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(35, 120, 82, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(35, 120, 82, 0);
  }
}

.market-time-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.market-session-msg {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.market-status-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-paper-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
}

.btn-paper-action:hover {
  background: var(--bg-subtle);
  border-color: #B0AEA5;
}

.btn-paper-action.primary {
  background: var(--accent-orange);
  color: #ffffff;
  border-color: var(--accent-orange-hover);
  box-shadow: 0 2px 6px rgba(255, 102, 0, 0.22);
}

.btn-paper-action.primary:hover {
  background: var(--accent-orange-hover);
  box-shadow: 0 4px 10px rgba(255, 102, 0, 0.3);
}

.btn-paper-action.danger {
  background: #fff;
  color: var(--color-bear);
  border-color: #F7C6BE;
}

.btn-paper-action.danger:hover {
  background: var(--color-bear-bg);
}

/* Paper Trading KPI Row */
.paper-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 20px;
}

.paper-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.paper-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.kpi-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-number {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-number.pos {
  color: var(--color-bull);
}

.kpi-number.neg {
  color: var(--color-bear);
}

.kpi-subtext {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Main Workbench 2-Column Grid */
.paper-workbench-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1200px) {
  .paper-workbench-grid {
    grid-template-columns: 1fr;
  }
}

.paper-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Institutional Card */
.paper-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.paper-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-page);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-heading {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.paper-card-body {
  padding: 22px 24px;
}

/* Tables & Blotters */
.table-blotter-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-blotter {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.table-blotter th {
  padding: 12px 18px;
  background: var(--bg-page);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.table-blotter td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-blotter tr:hover td {
  background: var(--bg-subtle);
}

.table-blotter .mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.badge-order-action {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-order-action.buy {
  background: var(--color-bull-bg);
  color: var(--color-bull-text);
  border: 1px solid #BCE4CE;
}

.badge-order-action.sell {
  background: var(--color-bear-bg);
  color: var(--color-bear-text);
  border: 1px solid #F7C6BE;
}

.btn-table-action {
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  transition: all 0.15s ease;
}

.btn-table-action.close-pos:hover {
  background: var(--color-bear-bg);
  border-color: #F7C6BE;
  color: var(--color-bear);
}

/* Model Radar Signals */
.radar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  transition: all 0.15s ease;
}

.radar-item:hover {
  border-color: #DDD9CD;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.radar-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.radar-symbol-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  padding: 4px 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
}

.radar-signal-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.radar-signal-badge.buy {
  background: var(--color-bull-bg);
  color: var(--color-bull-text);
  border: 1px solid #BCE4CE;
}

.radar-signal-badge.sell {
  background: var(--color-bear-bg);
  color: var(--color-bear-text);
  border: 1px solid #F7C6BE;
}

.radar-signal-badge.hold {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

/* Manual Order Ticket Form */
.order-ticket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.order-field-full {
  grid-column: span 2;
}

.order-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.order-input, .order-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-input);
  font-size: 12.5px;
  background: #ffffff;
  font-family: var(--font-sans);
}

.order-input:focus, .order-select:focus {
  border-color: var(--accent-blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(217, 119, 87, 0.15);
}

.action-toggle-btns {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.btn-toggle-action {
  flex: 1;
  padding: 8px 12px;
  border: none;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.btn-toggle-action.active-buy {
  background: var(--color-bull);
  color: #ffffff;
}

.btn-toggle-action.active-sell {
  background: var(--color-bear);
  color: #ffffff;
}

.btn-submit-order {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 6px;
}

.btn-submit-order.buy-btn {
  background: var(--color-bull);
}

.btn-submit-order.buy-btn:hover {
  background: #1A5E3F;
}

.btn-submit-order.sell-btn {
  background: var(--color-bear);
}

.btn-submit-order.sell-btn:hover {
  background: #9E2517;
}

/* Config Section */
.paper-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.toggle-switch-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-input);
  transition: .3s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(20, 20, 19, 0.2);
}

input:checked + .slider {
  background-color: var(--color-bull);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

/* ==========================================================================
   Application Software-Grade Workflow Design System
   Workflow: 1. 选股 (Screener) -> 2. 股票档案与基本面 (Fundamentals)
            -> 3. 策略选择 (Strategy) -> 4. 策略执行与回测 (Execution)
   ========================================================================== */

/* 1. Top Application Workspace Switcher (Styled in Tier 1 header section) */

/* 2. Global Active Stock Sticky Strip */
.active-stock-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 24px;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  position: sticky;
  top: 56px;
  z-index: 90;
}

.ass-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ass-ticker {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.ass-name {
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ass-exchange {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.ass-price-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-left: 6px;
}

.ass-price {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.ass-change {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.ass-change.positive {
  color: var(--color-bull);
  background: var(--color-bull-bg);
}

.ass-change.negative {
  color: var(--color-bear);
  background: var(--color-bear-bg);
}

.ass-center-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ass-pill {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.ass-pill.active-strat-pill {
  background: #EFF6FF;
  color: var(--accent-blue);
  border-color: #BFDBFE;
  font-weight: 600;
}

.ass-right-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ass-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ass-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-dark);
}

.ass-btn.highlight {
  background: var(--accent-orange);
  color: #FFFFFF;
  border-color: var(--accent-orange);
  box-shadow: 0 1px 3px rgba(255, 102, 0, 0.25);
}

.ass-btn.highlight:hover {
  background: var(--accent-orange-hover);
  border-color: var(--accent-orange-hover);
}

/* 3. Screener View (选股大厅) */
.workspace-screener-view {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.screener-hero-banner {
  background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.shb-title-group h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shb-title-group p {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 680px;
  line-height: 1.5;
}

.screener-toolbar-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.screener-categories-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sc-pill {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sc-pill:hover {
  background: var(--bg-pill-hover);
  color: var(--text-primary);
}

.sc-pill.active {
  background: var(--accent-black);
  color: #FFFFFF;
  border-color: var(--accent-black);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

.screener-filter-inputs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.screener-search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.screener-search-wrap input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-input);
  background: #FFFFFF;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.screener-search-wrap input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.screener-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-dimmed);
}

.screener-sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ssg-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.ssg-select {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-input);
  background: #FFFFFF;
  color: var(--text-primary);
  font-family: var(--font-sans);
  cursor: pointer;
}

.screener-table-container {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.screener-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.screener-table thead th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.screener-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.12s ease;
  cursor: pointer;
}

.screener-table tbody tr:hover {
  background-color: var(--bg-subtle);
}

.screener-table tbody td {
  padding: 14px 16px;
  color: var(--text-secondary);
  white-space: nowrap;
  vertical-align: middle;
}

.st-ticker-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.st-sym-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.st-symbol {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}

.st-badge {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--accent-blue);
  font-weight: 600;
  border: 1px solid #DBEAFE;
}

.st-name {
  font-size: 12px;
  color: var(--text-muted);
}

.st-price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.st-change {
  font-family: var(--font-mono);
  font-weight: 600;
}

.st-action-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue-border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.st-action-btn:hover {
  background: var(--accent-blue);
  color: #FFFFFF;
}

/* 4. Fundamentals & Financials View (股票基本面与财务档案) */
.workspace-fundamentals-view {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fund-hero-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.fhc-left h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fhc-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.fhc-right-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-launch-strategy-cta {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--accent-orange);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(255, 102, 0, 0.3);
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-launch-strategy-cta:hover {
  background: var(--accent-orange-hover);
  transform: translateY(-1px);
}

.fund-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .fund-cards-grid {
    grid-template-columns: 1fr;
  }
}

.fund-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.fund-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.fund-card-title {
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.fund-card-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.fund-metrics-2x3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 18px;
}

.fund-metric-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fmb-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.fmb-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.fmb-sub {
  font-size: 11px;
  color: var(--text-dimmed);
}

/* 52-week Range Bar */
.range-52w-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.r52-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.r52-track {
  width: 100%;
  height: 6px;
  background: #CBD5E1;
  border-radius: 3px;
  position: relative;
}

.r52-thumb {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transform: translateX(-50%);
}

/* Analyst Target Gauge */
.target-gauge-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  background: #F8FAFC;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tgb-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tgb-mean-target {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.tgb-upside {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.tgb-recomm-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

/* Company Description Card */
.fund-summary-card {
  grid-column: 1 / -1;
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fsc-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.fsc-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

/* Strategy Workbench Parameter Drawer Toggle */
.btn-toggle-param-drawer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle-param-drawer:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-dark);
}

/* ==========================================================================
   Fluid Animations & Transitions Engine
   1. K-Line & Chart Progressive Drawing Enhancements
   2. Workspace View & Step Switching Transitions
   3. Financial Metrics & Strategy Panel Cascade Micro-Interactions
   ========================================================================== */

/* 1. Workspace View Transitions */
.view-enter-active {
  animation: workspaceViewEnter 0.40s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes workspaceViewEnter {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.995);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 2. Fundamentals View Cards Staggered Cascade */
.view-enter-active .fund-hero-card {
  animation: cardCascadeIn 0.38s 0.03s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.view-enter-active .fund-metrics-grid .fm-card:nth-child(1) {
  animation: cardCascadeIn 0.38s 0.07s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.view-enter-active .fund-metrics-grid .fm-card:nth-child(2) {
  animation: cardCascadeIn 0.38s 0.11s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.view-enter-active .fund-metrics-grid .fm-card:nth-child(3) {
  animation: cardCascadeIn 0.38s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.view-enter-active .fund-metrics-grid .fm-card:nth-child(4) {
  animation: cardCascadeIn 0.38s 0.19s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.view-enter-active .fund-metrics-grid .fm-card:nth-child(5) {
  animation: cardCascadeIn 0.38s 0.23s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.view-enter-active .fund-metrics-grid .fm-card:nth-child(6) {
  animation: cardCascadeIn 0.38s 0.27s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardCascadeIn {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 3. Strategy Tab & Parameter Panel Switching */
.strategy-tab-enter {
  animation: stratTabSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes stratTabSlideIn {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 4. Screener Table Waterfall Rows */
.screener-row-enter {
  animation: screenerRowFade 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes screenerRowFade {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 5. Metrics & Card Pulse Highlight Animation */
.pulse-highlight {
  animation: metricPulseGlow 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes metricPulseGlow {
  0% {
    background-color: rgba(0, 82, 204, 0.16);
    transform: scale(1.02);
  }
  50% {
    background-color: rgba(0, 82, 204, 0.08);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

/* 6. Active Stock Strip & Forward Projection Badges */
.hero-signal-badge {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-signal-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.15);
}

.brokerage-quote-banner {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.brokerage-quote-banner:hover {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

/* 7. Canvas Chart Containers */
.chart-card, .kline-chart-box, .equity-chart-box {
  position: relative;
  transition: box-shadow 0.25s ease;
}
.chart-card:hover, .kline-chart-box:hover, .equity-chart-box:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

/* 8. Modern Navigation Buttons Interaction */
.nav-workspace-btn {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-workspace-btn .nwb-step {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.strat-tab {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}




/* ==========================================================================
   Professional Artist Vector Icon Suite (画师级专业矢量图标系统)
   ========================================================================== */
.art-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  width: 1.15em;
  height: 1.15em;
  line-height: 1;
}

.art-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease, fill 0.2s ease;
}

.nwb-art-icon {
  width: 14px;
  height: 14px;
  margin-right: 2px;
}

.btn-art-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

.pill-art-icon {
  width: 13px;
  height: 13px;
  margin-right: 4px;
}

.title-art-icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  color: var(--accent-blue, #0052cc);
}

.tab-icon.art-icon {
  width: 22px;
  height: 22px;
}

.comm-art-icon {
  width: 14px;
  height: 14px;
  color: #d97706;
}

.star-art-icon {
  width: 14px;
  height: 14px;
  color: #f59e0b;
}

.group-art-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  color: var(--text-secondary);
}

/* Micro-interaction hover lift for illustrator icons */
.nav-workspace-btn:hover .art-icon svg,
.ass-btn:hover .art-icon svg,
.sc-pill:hover .art-icon svg,
.strat-tab:hover .art-icon svg,
.btn-primary-action:hover .art-icon svg {
  transform: translateY(-1px) scale(1.08);
}

/* ==========================================================================
   TradingView Institutional Single-Screen Workspace Architecture (TV-Grid)
   ========================================================================== */
html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

.tv-workspace-layout {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
  color: #0f172a;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* 1. Top TradingView Global Header */
.tv-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 12px;
  flex-shrink: 0;
  gap: 8px;
  z-index: 50;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  white-space: nowrap;
}

.tv-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tv-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 800;
  color: #0f172a;
  font-size: 14.5px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  white-space: nowrap;
}

.tv-brand-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: #eff6ff;
  color: #0052cc;
  border: 1px solid #bfdbfe;
  flex-shrink: 0;
}

.tv-search-box {
  display: flex;
  align-items: center;
  position: relative;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 6px 0 8px;
  height: 30px;
  width: 250px;
  min-width: 220px;
  flex-shrink: 0;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tv-search-box:focus-within {
  border-color: #0052cc;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.12);
  width: 280px;
}

.tv-search-icon {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  flex-shrink: 0;
}

.tv-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 11.5px;
  font-weight: 600;
  color: #0f172a;
  padding: 0;
  white-space: nowrap;
}

.tv-search-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
  font-size: 11px;
}

.tv-search-btn {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: #eff6ff;
  color: #0052cc;
  font-weight: 600;
  font-size: 11px;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tv-search-btn:hover {
  background: #0052cc;
  color: #ffffff;
  border-color: #0052cc;
}

.tv-ticker-hero {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  height: 28px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tv-ticker-code {
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  font-size: 13.5px;
  color: #0f172a;
}

.tv-ticker-price {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 13px;
}

.tv-top-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tv-tf-btn {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tv-tf-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.tv-tf-btn.active {
  background: #eff6ff;
  color: #0052cc;
  font-weight: 700;
}

.tv-sep {
  width: 1px;
  height: 18px;
  background: #e2e8f0;
  margin: 0 4px;
}

.tv-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tv-strat-select-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 0 10px !important;
  height: 28px !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
  text-decoration: none !important;
}

.tv-strat-select-btn:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}

.tv-strat-select-btn.active {
  background: #eff6ff !important;
  border-color: #0052cc !important;
  color: #0052cc !important;
}

.tv-strat-select-btn span {
  white-space: nowrap !important;
  display: inline-block !important;
}

.tv-btn-run {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: #0052cc !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 0 12px !important;
  height: 28px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 82, 204, 0.3) !important;
  transition: all 0.18s ease !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
}

.tv-btn-run:hover {
  background: #0747a6 !important;
  transform: translateY(-1px);
}

.tv-btn-run span {
  white-space: nowrap !important;
  display: inline-block !important;
}

/* System status dot & text anti-wrap */
.system-status {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 1;
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.system-status .status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive Top Bar: Gracefully hide non-critical metadata on compact viewports */
@media (max-width: 1440px) {
  #ass-name,
  #ass-exchange {
    display: none !important;
  }
}

@media (max-width: 1240px) {
  .system-status {
    display: none !important;
  }
  .tv-search-box {
    width: 210px;
  }
  .tv-search-box:focus-within {
    width: 240px;
  }
}

/* Strategy Dropdown Selector (TradingView Style) */
.tv-strat-dropdown {
  position: relative;
  display: inline-block;
}

.tv-strat-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  height: 30px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.tv-strat-dropdown-trigger:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.tv-strat-trigger-icon {
  width: 14px;
  height: 14px;
  color: #0052cc;
  flex-shrink: 0;
}

.tv-strat-trigger-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
}

.tv-strat-trigger-text strong {
  color: #0052cc;
  font-weight: 700;
}

.tv-strat-arrow {
  width: 12px;
  height: 12px;
  color: #64748b;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.tv-strat-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 330px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  padding: 6px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tv-strat-dropdown-menu.hidden {
  display: none !important;
}

.tv-strat-menu-header {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px 4px 10px;
  border-bottom: 1px solid #f1f5f9;
}

.tv-strat-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.tv-strat-menu-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.tv-strat-menu-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.tsm-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  flex-shrink: 0;
  margin-top: 2px;
}

.tv-strat-menu-item.active .tsm-icon-box {
  background: #0052cc;
  color: #ffffff;
}

.tsm-content {
  flex: 1;
  min-width: 0;
}

.tsm-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.tsm-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.tv-strat-menu-item.active .tsm-title {
  color: #0052cc;
}

.tsm-desc {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.3;
}

/* 2. Middle Grid: Left Toolbar (44px) + Center Workspace + Right Dock (380px) */
.tv-middle-grid {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  height: calc(100vh - 46px);
}

.tv-left-toolbar {
  width: 44px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 4px;
  flex-shrink: 0;
  height: 100%;
  z-index: 30;
}

.tv-draw-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tv-draw-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.tv-draw-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #0052cc;
}

.tv-draw-divider {
  width: 24px;
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* Center Main Chart Area */
/* Center Workspace: Houses Main Chart Viewport + Bottom Strategy Tester */
.tv-center-workspace {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: #ffffff;
  overflow: hidden;
  height: 100%;
}

.tv-main-chart-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: #ffffff;
  position: relative;
}

.tv-chart-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 11px;
  background: #ffffff;
  flex-shrink: 0;
  height: 28px;
  color: #64748b;
  overflow: hidden;
  gap: 12px;
}

.tv-css-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.tv-css-title {
  font-weight: 700;
  color: #0f172a;
  font-family: var(--font-mono, monospace);
  flex-shrink: 0;
}

.tv-css-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  padding: 0;
}

.tv-css-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.tv-css-tooltip {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #64748b;
}

.tv-chart-canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  width: 100%;
}

.tv-chart-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Right Dock (380px, collapsible) */
.tv-right-dock {
  width: 380px;
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease;
  overflow: hidden;
  z-index: 40;
}

.tv-right-dock.collapsed {
  width: 38px;
}

.tv-dock-tab-bar {
  display: flex;
  align-items: center;
  height: 38px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 4px;
  gap: 2px;
  flex-shrink: 0;
}

.tv-dock-tab-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.tv-dock-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.tv-dock-tab-btn.active {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0052cc;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.tv-dock-toggle-btn {
  margin-left: auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  color: #64748b;
  font-size: 13px;
}

.tv-dock-toggle-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.tv-dock-content-pane {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 12px;
  background: #ffffff;
  display: none;
}

.tv-dock-content-pane.active {
  display: block;
}

/* 3. Bottom Strategy Tester Panel (TradingView Drawer) */
.tv-bottom-panel {
  height: 260px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: height 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  z-index: 35;
}

.tv-bottom-panel.collapsed {
  height: 32px;
}

.tv-bottom-panel.expanded {
  height: 520px;
}

.tv-panel-header {
  height: 32px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  flex-shrink: 0;
}

.tv-panel-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tv-panel-tab-btn {
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tv-panel-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.tv-panel-tab-btn.active {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0052cc;
  font-weight: 700;
}

.tv-panel-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tv-ctrl-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
}

.tv-ctrl-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.tv-panel-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

.tv-panel-pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 10px 14px;
  display: none;
}

.tv-panel-pane.active {
  display: block;
}

/* Screener Dock Component */
.tv-screener-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.tv-screener-search-input-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  height: 28px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 8px;
  transition: all 0.15s ease;
}

.tv-screener-search-input-box:focus-within {
  background: #ffffff;
  border-color: #0052cc;
  box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.12);
}

.tv-screener-search-icon {
  width: 13px;
  height: 13px;
  color: #94a3b8;
  flex-shrink: 0;
}

.tv-screener-search-input-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 11.5px;
  color: #0f172a;
  padding: 0;
  height: 100%;
}

.tv-screener-sort-select {
  height: 28px;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  padding: 0 6px;
  width: 120px;
  flex-shrink: 0;
  outline: none;
  cursor: pointer;
}

.tv-screener-sort-select:focus {
  border-color: #0052cc;
  background: #ffffff;
}

.tv-screener-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 190px);
}
