/*!
 * Bootstrap 5.3 自定义主题样式
 * 基于 Bootstrap 5.3 框架优化的 KNIME+AI 网站样式
 * 版本: 2.0.0
 * 更新时间: 2025-10-30
 */

/* ===== 1. Bootstrap 变量覆盖 ===== */
:root {
  /* 主题色彩系统 - 增强对比度 */
  --bs-dark-rgb: 11, 15, 20;
  --bs-primary: #51d1a6;
  --bs-primary-rgb: 81, 209, 166;
  --bs-secondary: #5aa0ff;
  --bs-secondary-rgb: 90, 160, 255;
  --bs-success: #51d1a6;
  --bs-info: #5aa0ff;
  --bs-warning: #ffb14f;
  --bs-danger: #ff6b6b;
  --bs-light: #f8f9fa;
  --bs-dark: #0b0f14;

  /* 深色主题优化 - 提高文字对比度 */
  --bs-body-bg: #0a0e12;
  --bs-body-bg-rgb: 10, 14, 18;
  --bs-body-color: #f0f6fc;
  --bs-body-color-rgb: 240, 246, 252;
  --bs-emphasis-color: #b8c5d6;
  --bs-emphasis-color-rgb: 184, 197, 214;
  --bs-border-color: #2d3748;
  --bs-border-color-translucent: rgba(45, 55, 72, 0.6);

  /* 组件自定义 - 更清晰的背景 */
  --bs-card-bg: #161b22;
  --bs-card-border-color: #30363d;
  --bs-dropdown-bg: #1c2128;
  --bs-dropdown-border-color: #30363d;
  --bs-navbar-bg: rgba(10, 14, 18, 0.95);

  /* 高对比度文字颜色 */
  --text-primary: #ffffff;
  --text-secondary: #c9d1d9;
  --text-muted: #8b949e;
  --text-inverse: #0d1117;
}

/* ===== 2. 全局样式重置和文字优化 ===== */
[data-bs-theme="dark"] {
  --bs-body-color: var(--bs-body-color);
  --bs-body-bg: var(--bs-body-bg);
  --bs-emphasis-color: var(--bs-emphasis-color);
}

/* 全局文字可读性优化 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 标题文字优化 */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary) !important;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

/* 段落文字优化 */
p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
  font-weight: 400;
}

/* 强调文字 */
strong, b {
  color: var(--text-primary) !important;
  font-weight: 700;
}

/* 链接文字 */
a {
  color: var(--bs-primary);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #7be6c3;
  text-decoration: underline;
}

/* 小文字优化 */
small {
  color: var(--text-muted) !important;
  font-size: 0.9rem;
  font-weight: 400;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bs-body-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--bs-border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bs-emphasis-color);
}

/* ===== 3. 导航栏样式 ===== */
.navbar {
  background: var(--bs-navbar-bg) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bs-border-color);
  transition: all 0.3s ease;
  padding: 0.5rem 0;
}

.navbar-brand {
  font-weight: 700;
  color: var(--bs-body-color) !important;
  transition: transform 0.2s ease;
  font-size: 1.2rem;
}

.navbar-brand:hover {
  transform: translateX(2px);
}

.navbar-nav .nav-link {
  color: var(--bs-emphasis-color) !important;
  font-weight: 600;
  padding: 0.75rem 1.25rem !important;
  border-radius: 8px;
  margin: 0 2px;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: var(--bs-card-bg);
  color: var(--bs-primary) !important;
}

.navbar-toggler {
  border: 1px solid var(--bs-border-color);
  padding: 4px 8px;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 2px var(--bs-primary);
}

/* ===== 4. 卡片组件样式 ===== */
.card {
  background-color: var(--bs-card-bg);
  border: 1px solid var(--bs-card-border-color);
  border-radius: 16px;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  border-color: var(--bs-primary);
}

.card-header {
  background: linear-gradient(135deg, var(--bs-primary), var(--bs-secondary));
  color: var(--text-inverse);
  font-weight: 700;
  border-bottom: none;
  padding: 1.25rem;
  font-size: 1.2rem;
}

.card-body {
  padding: 2rem;
}

.card-title {
  font-weight: 700;
  color: var(--text-primary) !important;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  line-height: 1.4;
}

.card-text {
  color: var(--text-secondary) !important;
  line-height: 1.8;
  font-size: 1.15rem;
  font-weight: 400;
}

/* 特殊边框样式 */
.border-primary {
  border-color: var(--bs-primary) !important;
  border-width: 2px !important;
}

.border-info {
  border-color: var(--bs-info) !important;
  border-width: 2px !important;
}

/* ===== 5. 按钮组件样式 ===== */
.btn {
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-secondary));
  border: none;
  color: #001b12;
}

.btn-primary:hover {
  background: linear-gradient(90deg, #4bc399, #4a8cee);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(81, 209, 166, 0.3);
  color: #001b12;
}

.btn-outline-primary {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
}

.btn-outline-primary:hover {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #001b12;
}

.btn-outline-light {
  border-color: var(--bs-emphasis-color);
  color: var(--bs-body-color);
}

.btn-outline-light:hover {
  background: var(--bs-body-color);
  border-color: var(--bs-body-color);
  color: var(--bs-body-bg);
}

.btn-outline-secondary {
  border-color: var(--bs-emphasis-color);
  color: var(--bs-emphasis-color);
}

.btn-outline-secondary:hover {
  background: var(--bs-emphasis-color);
  border-color: var(--bs-emphasis-color);
  color: var(--bs-body-bg);
}

/* ===== 6. 徽章和标签样式 ===== */
.badge {
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
}

.badge-gradient {
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-secondary));
  color: #001b12;
  font-weight: 600;
}

/* ===== 7. KPI 指标卡片 ===== */
.kpi-card {
  background: linear-gradient(135deg, #0d1117, #1a1f2a);
  border: 2px solid var(--bs-border-color);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.kpi-card:hover {
  border-color: var(--bs-primary);
  background: linear-gradient(135deg, rgba(81, 209, 166, 0.15), rgba(90, 160, 255, 0.08));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(81, 209, 166, 0.3);
}

.kpi-value {
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--bs-primary);
  text-shadow: 0 0 15px rgba(81, 209, 166, 0.4);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.kpi-label {
  font-size: 1rem;
  color: var(--text-secondary) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  line-height: 1.4;
}

/* ===== 8. 轮播图样式 ===== */
.slideshow-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 320px;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.slideshow-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.slideshow-image.active {
  opacity: 1;
}

.slideshow-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-decoration: none;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.slideshow-link:hover {
  transform: scale(1.02);
}

.slideshow-link:hover .slideshow-image {
  filter: brightness(1.1);
}

/* ===== 9. 动画效果 ===== */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

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

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

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

/* ===== 10. 工具类 ===== */
.text-gradient {
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bg-gradient-primary {
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-secondary));
}

.bg-gradient-card {
  background: linear-gradient(135deg, var(--bs-card-bg), #1a1f2a);
}

.shadow-glow {
  box-shadow: 0 0 20px rgba(81, 209, 166, 0.3);
}

.shadow-glow-secondary {
  box-shadow: 0 0 20px rgba(90, 160, 255, 0.3);
}

/* ===== 11. 响应式优化 ===== */
@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 0;
  }

  .display-3 {
    font-size: 2.2rem;
  }

  .slideshow-container {
    height: 200px;
  }

  .card-body {
    padding: 1.5rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .navbar-nav .nav-link {
    padding: 0.75rem 1rem !important;
    text-align: center;
  }

  .kpi-value {
    font-size: 1.5rem;
  }

  .kpi-label {
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    padding: 2rem 0;
  }

  /* 响应式标题 */
  .display-3 {
    font-size: 2rem !important;
  }

  .display-5 {
    font-size: 1.5rem !important;
  }

  /* 响应式段落 */
  .lead {
    font-size: 1.1rem !important;
    line-height: 1.6;
  }

  p {
    font-size: 1rem !important;
    line-height: 1.6;
  }

  .card-text {
    font-size: 1rem !important;
    line-height: 1.6;
  }

  /* 响应式KPI */
  .kpi-card {
    padding: 1.5rem 1rem;
  }

  .kpi-value {
    font-size: 1.8rem;
  }

  .kpi-label {
    font-size: 0.85rem;
  }

  /* 响应式卡片 */
  .card-title {
    font-size: 1.1rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .card-header {
    font-size: 1rem;
    padding: 1rem;
  }

  /* 响应式按钮 */
  .btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
  }

  .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
  }

  /* 响应式徽章 */
  .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* 平板端优化 */
@media (min-width: 577px) and (max-width: 768px) {
  .display-3 {
    font-size: 2.8rem !important;
  }

  .lead {
    font-size: 1.2rem !important;
  }

  .kpi-value {
    font-size: 2rem;
  }

  .card-text {
    font-size: 1.1rem;
  }
}

/* 文字清晰度优化 - 增强版 */
.text-white-50 {
  color: rgba(240, 246, 252, 0.85) !important;
}

.text-primary {
  color: var(--bs-primary) !important;
  font-weight: 700;
}

.text-muted {
  color: var(--text-muted) !important;
  font-weight: 400;
}

.text-white {
  color: var(--text-primary) !important;
}

/* Bootstrap 文字颜色重写 */
.text-body {
  color: var(--text-secondary) !important;
}

.text-body-secondary {
  color: var(--text-muted) !important;
}

/* Alert 框优化 */
.alert {
  border: none;
  border-radius: 12px;
  font-weight: 500;
  font-size: 1rem;
  padding: 1rem 1.5rem;
}

.alert-info {
  background: linear-gradient(135deg, rgba(90, 160, 255, 0.15), rgba(81, 209, 166, 0.05));
  color: var(--text-primary) !important;
  border: 1px solid rgba(90, 160, 255, 0.3);
}

/* Lead 文字优化 */
.lead {
  font-size: 1.4rem !important;
  font-weight: 500;
  line-height: 1.8;
  color: var(--text-secondary) !important;
  margin-bottom: 1.5rem;
}

/* Display 标题优化 */
.display-1 {
  font-size: 5rem !important;
  font-weight: 800;
  line-height: 1.2;
}

.display-3 {
  font-size: 3.5rem !important;
  font-weight: 800;
  line-height: 1.2;
}

.display-4 {
  font-size: 2.5rem !important;
  font-weight: 700;
  line-height: 1.3;
}

.display-5 {
  font-size: 2rem !important;
  font-weight: 700;
  line-height: 1.3;
}

/* 徽章文字优化 */
.badge {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
}

.badge-gradient {
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-secondary));
  color: var(--text-inverse);
  font-weight: 700;
}

/* 按钮文字优化 */
.btn {
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-lg {
  font-size: 1.1rem;
  padding: 1rem 2rem;
  font-weight: 600;
}

@media (max-width: 576px) {
  .kpi-card {
    padding: 0.75rem;
  }

  .kpi-value {
    font-size: 1.25rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ===== 12. 打印样式 ===== */
@media print {
  .navbar,
  footer,
  .btn,
  .slideshow-container {
    display: none !important;
  }

  .card {
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }

  body {
    background: white !important;
    color: black !important;
  }
}

/* ===== 13. 辅助功能 ===== */
.visually-hidden-focusable:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .card {
    border-width: 2px;
  }

  .btn {
    border-width: 2px;
  }
}