/* ================================================
   Istar GEO Visual Upgrade - 全局样式系统
   品牌色系：深邃科技蓝 (#0F172A) + 极客青 (#2DD4BF)
   ================================================ */

/* --- 1. CSS 变量定义 (Color Palette) --- */
:root {
  /* 主色系 */
  --primary: #0F172A;
  --primary-light: #1E293B;
  --secondary: #3B82F6;
  --accent: #2DD4BF;
  
  /* 中性色 */
  --bg-page: #0A0A0A;
  --bg-card: #F8FAFC;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --border: #E2E8F0;
  --border-glow: rgba(45, 212, 191, 0.3);
  
  /* 文字色 */
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  
  /* 状态色 */
  --success: #2DD4BF;
  --warning: #F59E0B;
  --error: #EF4444;
  
  /* 过渡动画 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* --- 2. 全局背景 (深色模式启动感) --- */
body {
  background-color: var(--bg-page);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans', sans-serif;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

/* --- 2.1 ISTAR 艺术字 Logo --- */
.istar-art-text {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #3B82F6 0%, #2DD4BF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(45, 212, 191, 0.3);
}

/* --- 3. 导航栏 (深邃科技蓝) --- */
.navbar-glass {
  background: var(--primary) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.8rem 1rem;
}

.navbar-glass .navbar-brand,
.navbar-glass .nav-link-custom {
  color: #F8FAFC !important;
}

.navbar-glass .nav-link-custom:hover,
.navbar-glass .nav-link-custom.active {
  color: var(--accent) !important;
}

/* 导航栏品牌 Logo */
.navbar-logo {
  height: 36px;
}

/* --- 4. Glassmorphism 玻璃态卡片 --- */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 0 20px rgba(45, 212, 191, 0.05);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 0 30px rgba(45, 212, 191, 0.1);
  border-color: var(--border-glow);
}

/* --- 5. 主要内容区 --- */
.main-content {
  background: var(--bg-card);
  min-height: calc(100vh - 56px - 56px);
}

/* --- 6. 输入框 (线性边框 + 呼吸灯) --- */
.input-outline {
  border: 2px solid var(--border);
  border-radius: 12px;
  background: transparent;
  transition: all var(--transition-normal);
  padding: 12px 16px;
}

.input-outline:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15),
              0 0 20px rgba(45, 212, 191, 0.2);
  outline: none;
  animation: breathe 1.5s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(45, 212, 191, 0.08); }
}

/* --- 7. 按钮系统 --- */

/* 主按钮：渐变色 (科技蓝→极客青) */
.btn-primary-gradient {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  border: none;
  color: white;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 12px;
  transition: all var(--transition-normal);
}

.btn-primary-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
  color: white;
}

/* Ghost Button (幽灵按钮) */
.btn-ghost {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-primary);
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 12px;
  transition: all var(--transition-normal);
}

.btn-ghost:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* --- 8. 标签 (Tag) - 微色块方案 --- */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--primary);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.tag-pill:hover {
  background: rgba(15, 23, 42, 0.15);
}

.tag-pill.accent {
  background: rgba(45, 212, 191, 0.1);
  color: #0D9488;
}

/* --- 9. KPI 指标卡片 --- */
.metric-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  transition: all var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.metric-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

/* 数字计数动画 */
@keyframes countUp {
  0% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.metric-value {
  animation: countUp 0.5s ease-out;
}

/* --- 10. 进度条 --- */
.progress-modern {
  height: 12px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.progress-modern .progress-bar {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--secondary) 0%, var(--accent) 100%);
  transition: width 0.8s ease-out;
}

/* --- 11. 雷达图样式 --- */
.radar-chart-container canvas {
  max-height: 160px;
}

/* --- 12. Toast 提示 --- */
.toast {
  background: var(--primary);
  color: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- 13. 排行榜 --- */
.ranking-item {
  padding: 14px 16px;
  border-radius: 12px;
  transition: all var(--transition-fast);
  background: transparent;
}

.ranking-item:hover {
  background: rgba(45, 212, 191, 0.05);
  transform: translateX(4px);
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.rank-1 { background: linear-gradient(135deg, #FFD700, #F59E0B); color: white; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #9CA3AF); color: white; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #B45309); color: white; }

/* --- 14. Tooltip 悬浮提示 --- */
.tooltip-custom {
  position: absolute;
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'SF Mono', 'Monaco', monospace;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.tooltip-custom.visible {
  opacity: 1;
}

/* --- 15. 加载动画 (Loading Screen) --- */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 72px;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: blur(20px);
  animation: maskSlice 2s ease-in-out forwards;
}

@keyframes maskSlice {
  0% { filter: blur(20px); opacity: 0.5; }
  50% { filter: blur(10px); opacity: 0.8; }
  100% { filter: blur(0px); opacity: 1; }
}

.loading-logo.explode {
  animation: explode 0.8s ease-out forwards;
}

@keyframes explode {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

/* --- 16. 卡片悬浮微交互 (Bento Box) --- */
.card-interactive {
  transition: transform var(--transition-normal);
}

.card-interactive:hover {
  transform: scale(1.02);
}

/* --- 17. 引言式排版 (定义页) --- */
.quote-block {
  position: relative;
  padding-left: 24px;
  border-left: 4px solid;
  border-image: linear-gradient(180deg, var(--secondary), var(--accent)) 1;
}

.quote-block::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--secondary) 0%, var(--accent) 100%);
}

/* --- 18. Sticky 定义区域 --- */
.sticky-definition {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  padding: 20px;
  transition: all var(--transition-normal);
  z-index: 100;
}

.sticky-definition.collapsed {
  padding: 12px 20px;
  background: var(--primary);
  border-radius: 8px;
}

.sticky-definition.collapsed .definition-full {
  display: none;
}

.sticky-definition.collapsed .definition-summary {
  display: block;
}

.definition-summary {
  display: none;
  color: white;
  font-weight: 600;
}

/* --- 19. 页脚 (Footer) --- */
.footer-modern {
  background: var(--primary);
  padding: 24px 0;
  color: var(--text-muted);
}

.footer-modern a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-modern a:hover {
  color: var(--accent);
}

.footer-modern .footer-divider {
  color: rgba(255, 255, 255, 0.2);
  margin: 0 12px;
}

/* --- 20. 延迟动画类 --- */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- 22. Premium 卡片阴影 --- */
.premium-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  background: white;
}

.premium-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 12px 24px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

/* --- 23. 搜索表单 Premium 样式 --- */
.shadow-premium {
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.15), 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.1);
}

/* --- 24. 排行榜表格样式 --- */
.rank-row {
  transition: all 0.25s ease;
  border: 1px solid transparent !important;
}

.rank-row:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(45, 212, 191, 0.05) 100%) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* --- 25. 迷你进度条 --- */
.progress-bar-mini {
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  overflow: hidden;
  transition: width 0.6s ease-out;
}

/* --- 26. KPI 指标样式优化 --- */
.card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1E293B 0%, #3B82F6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.trend-indicator {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.trend-indicator-up {
  background: rgba(45, 212, 191, 0.1);
  color: #0D9488;
}

.trend-indicator-down {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
}

/* --- 27. Offcanvas 抽屉样式 --- */
.offcanvas {
  border-left: none !important;
}

.offcanvas-header {
  padding: 20px 24px !important;
}

/* --- 28. 滚动条美化 --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --- 29. 输入框增强 --- */
.form-control:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-group-text {
  border-radius: 8px 0 0 8px;
}

/* --- 30. 按钮悬停效果 --- */
.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* --- 31. 行业洞察侧边栏 --- */
.insights-sidebar-trigger {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1040;
  background: #0F172A;
  color: #2DD4BF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: none;
  border-radius: 0 10px 10px 0;
  padding: 12px 10px 12px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.insights-sidebar-trigger:hover {
  background: #1E293B;
  padding-right: 14px;
  color: #fff;
}

/* 侧边栏面板 */
.insights-sidebar {
  position: fixed;
  left: -320px;
  top: 0;
  width: 300px;
  height: 100vh;
  background: #0F172A;
  z-index: 1050;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.3);
}

.insights-sidebar.open {
  left: 0;
}

.insights-sidebar-header {
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.insights-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
}

.insights-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  color: #F8FAFC;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

.insights-sidebar-item:hover {
  background: rgba(59, 130, 246, 0.12);
  color: #2DD4BF;
  text-decoration: none;
}

/* 侧边栏遮罩 */
.insights-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1045;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
}

.insights-sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* --- 32. 事实库按钮 --- */
.facts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
  color: #3B82F6;
  transition: all 0.2s ease;
  text-decoration: none;
}

.facts-btn:hover {
  background: rgba(59, 130, 246, 0.18);
  color: #2563EB;
  transform: scale(1.1);
}

/* --- 21. 响应式适配 --- */
@media (max-width: 991px) {
  .metric-value {
    font-size: 2rem;
  }
  
  .loading-logo {
    font-size: 48px;
  }
}

@media (max-width: 767px) {
  .metric-value {
    font-size: 1.8rem;
  }
  
  .loading-logo {
    font-size: 36px;
  }
  
  .btn-primary-gradient {
    padding: 10px 20px;
  }
}
