/**
 * 自定义图表样式 - 包含动画效果
 * 所有流程图和架构图共用此样式
 */

/* ===== 基础流程图样式 ===== */
.flowchart {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
  padding: 28px;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f4f8 100%);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.flow-step {
  padding: 14px 24px;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  cursor: default;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}

/* 依次入场动画 */
.flow-step:nth-child(1) { animation-delay: 0.1s; }
.flow-step:nth-child(3) { animation-delay: 0.2s; }
.flow-step:nth-child(5) { animation-delay: 0.3s; }
.flow-step:nth-child(7) { animation-delay: 0.4s; }
.flow-step:nth-child(9) { animation-delay: 0.5s; }
.flow-step:nth-child(11) { animation-delay: 0.6s; }
.flow-step:nth-child(13) { animation-delay: 0.7s; }

/* Hover 效果 */
.flow-step:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.flow-arrow {
  font-size: 24px;
  color: #94a3b8;
  font-weight: bold;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
  animation-delay: 0.15s;
  transition: all 0.3s ease;
}

.flow-arrow:hover {
  color: #64748b;
  transform: scale(1.2);
}

/* ===== 架构图样式 ===== */
.architecture {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 24px 0;
  padding: 28px;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f4f8 100%);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.arch-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.arch-section {
  text-align: center;
  flex: 1;
  min-width: 220px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}

.arch-section:nth-child(1) { animation-delay: 0.1s; }
.arch-section:nth-child(3) { animation-delay: 0.3s; }

.arch-section:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.arch-section h4 {
  margin: 0 0 16px 0;
  color: #1e293b;
  font-size: 16px;
  font-weight: 600;
}

.arch-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.arch-item {
  padding: 10px 18px;
  border-radius: 20px;
  color: white;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: default;
}

.arch-item:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.arch-arrow {
  text-align: center;
  font-size: 28px;
  color: #94a3b8;
  font-weight: bold;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
  animation-delay: 0.2s;
  transition: all 0.3s ease;
}

.arch-arrow:hover {
  color: #64748b;
  transform: scale(1.1);
}

/* ===== 动画定义 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* 脉冲动画 - 用于强调 */
.flow-step.pulse,
.arch-item.pulse {
  animation: pulse 2s infinite;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .flowchart {
    flex-direction: column;
    padding: 20px;
  }
  
  .flow-arrow {
    transform: rotate(90deg);
  }
  
  .arch-row {
    flex-direction: column;
  }
  
  .arch-section {
    min-width: auto;
  }
  
  .flow-step,
  .arch-item {
    font-size: 13px;
    padding: 12px 18px;
  }
}

/* ===== 主题色变量（可选） ===== */
:root {
  --chart-primary: #667eea;
  --chart-secondary: #3498db;
  --chart-success: #27ae60;
  --chart-warning: #f39c12;
  --chart-danger: #e74c3c;
  --chart-info: #9b59b6;
  --chart-teal: #1abc9c;
}
