:root {
  /* 科技感深色配色体系 */
  --bg-main: #0b1121;
  --bg-panel: rgba(17, 24, 39, 0.75);
  --bg-panel-hover: rgba(31, 41, 55, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.5);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-accent: #38bdf8;
  --text-warning: #f59e0b;
  
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  
  --up-green: #10b981;
  --up-green-bg: rgba(16, 185, 129, 0.1);
  --down-red: #ef4444;
  --down-red-bg: rgba(239, 68, 68, 0.1);
  
  --tag-bg: rgba(148, 163, 184, 0.15);
  
  --shadow-glow: 0 0 15px rgba(56, 189, 248, 0.15);
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --trans-fast: 0.15s ease-in-out;
  --trans-base: 0.25s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[v-cloak] {
  display: none !important;
}

body.dark-theme {
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at 15% 50%, rgba(37, 99, 235, 0.04), transparent 35%), 
                    radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.03), transparent 30%);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--text-accent);
  color: var(--bg-main);
}

.mono { font-family: var(--font-mono); }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 600; }
.text-accent { color: var(--text-accent); }
.text-warning { color: var(--text-warning); }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.flex-1 { flex: 1; }

/* ======== 布局主框架 ======== */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 玻璃态通用效果 */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ======== 左侧边栏 ======== */
.sidebar {
  width: 250px;
  background: rgba(15, 23, 42, 0.9);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.logo-icon {
  font-size: 24px;
  color: var(--text-accent);
  filter: drop-shadow(0 0 8px rgba(56,189,248,0.5));
}

.logo h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #fff;
}
.logo h2 span {
  color: var(--text-muted);
  font-weight: 300;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.8rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: var(--trans-base);
  font-weight: 500;
}

.nav-menu a i {
  font-size: 18px;
  transition: var(--trans-base);
}

.nav-menu a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-main);
}

.nav-menu a.active {
  background: linear-gradient(90deg, rgba(37,99,235,0.15) 0%, transparent 100%);
  color: var(--text-accent);
  border-left: 3px solid var(--text-accent);
}

/* ======== 任务监控面板 ======== */
.system-status {
  margin-top: auto;
  padding: 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
}

.status-header {
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
}

.task-running {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spinner-container {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-accent);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(56,189,248,0.2);
  border-top-color: var(--text-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.progress-container {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--text-accent);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--text-accent);
}

.progress-stats {
  display: flex;
  justify-content: space-between;
}

.task-msg {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-green {
  color: var(--up-green);
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-buttons {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

/* ======== 按钮 ======== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.6rem 1rem;
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--trans-base);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
.btn-full { width: 100%; }

.btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.btn-primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}
.btn-primary:hover {
  background: var(--accent-blue-hover);
  border-color: var(--accent-blue-hover);
  box-shadow: 0 0 12px rgba(37,99,235,0.4);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fef2f2;
}

.btn-danger-outline {
  color: #fca5a5;
  border-color: transparent;
}
.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-outline:hover {
  background: var(--up-green-bg);
  color: var(--up-green);
  border-color: rgba(16, 185, 129, 0.3);
}

/* ======== 主内容区 ======== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-glass);
  border-top: none; border-left: none; border-right: none;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 0;
}

.header-title h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 0 1rem;
  transition: var(--trans-base);
}

.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-icon {
  color: var(--text-muted);
  font-size: 16px;
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
  outline: none;
  width: 250px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.content-wrapper {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  position: relative;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.data-table th {
  background: rgba(0,0,0,0.2);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr {
  transition: background var(--trans-fast);
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.tag {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
}
.bg-tag { background: var(--tag-bg); color: #cbd5e1; }
.time-sm { font-size: 0.8rem; color: var(--text-muted); }

/* ======== UI 动画 ======== */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  text-align: center;
  height: 100%;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.glow {
  color: var(--text-accent);
  filter: drop-shadow(0 0 15px rgba(56,189,248,0.4));
  opacity: 0.8;
}

/* ======== AI 分析面板 ======== */
.analysis-panel {
  padding: 1.5rem;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.selected-stock-badge {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.kpi-card {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s;
}
.kpi-card:hover { transform: translateY(-3px); }

.kpi-icon {
  font-size: 24px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.highlight { color: var(--text-accent); }

.detail-card {
  padding: 1.5rem;
  border-radius: var(--radius-md);
}

.detail-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
}

.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.5), transparent);
}

.reasoning-text {
  color: #e2e8f0;
  line-height: 1.7;
  white-space: pre-wrap;
}

.levels-container {
  display: flex;
  gap: 1rem;
}

.level-card {
  flex: 1;
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.level-card h4 {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.8rem;
  display: flex; align-items: center; gap: 6px;
}

.support-bg h4 { color: var(--up-green); }
.resistance-bg h4 { color: var(--down-red); }

.level-card ul {
  list-style: none;
  display: flex; flex-direction: column; gap: 6px;
}
.level-card li {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
  font-size: 0.9rem;
}

.signals-risk {
  display: flex;
  gap: 1rem;
}

.signal-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.signal-list li {
  font-size: 0.9rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
}

.bg-warning-subtle { background: rgba(245, 158, 11, 0.05); }
.border-warning { border-color: rgba(245, 158, 11, 0.2); }
.border-accent { border-color: rgba(56,189,248,0.3) !important; box-shadow: 0 0 15px rgba(56,189,248,0.1); }

/* ======== 趋势颜色辅助类 ======== */
.up { color: var(--up-green); }
.down { color: var(--down-red); }

/* ======== Toast ======== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 0.9rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
}

.toast-success { border-left: 3px solid var(--up-green); }
.toast-success i { color: var(--up-green); }

.toast-error { border-left: 3px solid var(--down-red); }
.toast-error i { color: var(--down-red); }

.toast-info { border-left: 3px solid var(--text-accent); }
.toast-info i { color: var(--text-accent); }

/* Toast 动画 */
.toast-enter-active, .toast-leave-active { transition: all 0.3s ease; }
.toast-enter-from { opacity: 0; transform: translateX(30px); }
.toast-leave-to { opacity: 0; transform: translateY(10px); }
