/* ============================================
   API接口对接流程 - 时间轴样式（独立模块）
   首页、API调试页、Skill测试页共用
   ============================================ */
.api-flow {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 80px auto 0;
  padding: 56px 40px 60px;
  background: linear-gradient(135deg, #f5f8ff 0%, #ffffff 100%);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(79, 110, 247, 0.08);
  border: 1px solid rgba(79, 110, 247, 0.08);
  box-sizing: border-box;
}

/* 标题区域 */
.api-flow-header {
  text-align: center;
  margin-bottom: 56px;
}

.api-flow-title {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 12px 0;
  letter-spacing: 1px;
}

.api-flow-subtitle {
  font-size: 15px;
  color: #666666;
  margin: 0;
  letter-spacing: 0.5px;
}

/* 流程轨道容器 */
.api-flow-track {
  position: relative;
  padding-top: 40px; /* 为圆圈留出空间 */
}

/* 横线 - 贯穿整个流程 */
.api-flow-line {
  position: absolute;
  top: 40px; /* 与圆圈中心对齐 */
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(79, 110, 247, 0.1) 0%,
    rgba(79, 110, 247, 0.5) 20%,
    rgba(79, 110, 247, 0.5) 80%,
    rgba(79, 110, 247, 0.1) 100%
  );
  z-index: 0;
}

/* 步骤行 */
.api-flow-steps {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  z-index: 1;
}

/* 单个节点（圆圈+卡片） */
.api-flow-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* 圆圈序号 */
.api-flow-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #4f6ef7;
  color: #4f6ef7;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px rgba(79, 110, 247, 0.2);
  transition: all 1s ease;
  position: relative;
  z-index: 2;
}

/* 卡片样式 */
.api-flow-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 28px 18px 24px;
  width: 100%;
  height: 260px; /* 固定高度，确保5张卡片一致 */
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border-top: 3px solid transparent;
  transition: all 1s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* 图标容器（图片版） */
.api-flow-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 16px;
  background: #f5f8ff;
  flex-shrink: 0; /* 不允许压缩 */
}

/* 图标图片 */
.api-flow-icon-img {
  max-width: 64px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 1s ease;
}

/* 卡片标题 */
.api-flow-card-title {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 12px 0;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* 卡片描述 */
.api-flow-card-desc {
  font-size: 13px;
  color: #888888;
  line-height: 1.7;
  margin: 0;
  letter-spacing: 0.3px;
  flex-grow: 1; /* 占据剩余空间，让描述底部对齐 */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
}

/* 悬停效果 */
.api-flow-node:hover .api-flow-circle {
  background: #4f6ef7;
  color: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(79, 110, 247, 0.4);
}

.api-flow-node:hover .api-flow-card {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(79, 110, 247, 0.15);
  border-top-color: #4f6ef7;
}

.api-flow-node:hover .api-flow-icon-img {
  transform: scale(1.15) rotate(5deg);
}

/* 流动箭头 - 位于当前节点圆圈右侧，指向下一个节点 */
.api-flow-arrow {
  position: absolute;
  top: 28px; /* 对齐圆圈中心（圆圈56px，中心在28px处） */
  right: -22px; /* 延伸到节点右侧外，位于两个节点之间 */
  width: 28px;
  height: 14px;
  z-index: 3;
  opacity: 0; /* 初始隐藏 */
  transform: translateX(-12px) scale(0.6); /* 初始位置偏左，缩小 */
  transition: opacity 1s ease, transform 1s ease;
  pointer-events: none; /* 不拦截鼠标事件 */
}

/* 激活状态：箭头从左向右滑入并显示 */
.api-flow-arrow.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  animation: arrowFlow 1.2s ease;
}

/* 流动动画：箭头从左向右移动一段距离，表示流程方向 */
@keyframes arrowFlow {
  0% {
    opacity: 0;
    transform: translateX(-20px) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translateX(4px) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* 进入视口动画（配合 scroll-reveal 风格） */
.api-flow-node {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

.api-flow-node.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 节点依次延迟动画 */
.api-flow-node:nth-child(1).is-visible { transition-delay: 0s; }
.api-flow-node:nth-child(2).is-visible { transition-delay: 0.15s; }
.api-flow-node:nth-child(3).is-visible { transition-delay: 0.3s; }
.api-flow-node:nth-child(4).is-visible { transition-delay: 0.45s; }
.api-flow-node:nth-child(5).is-visible { transition-delay: 0.6s; }
