/* ============================================================
   AI工作流板块深度重构 - 外部覆盖样式
   功能：文案更新、4子板块、3+1布局、点击查看按钮、微动效
   ============================================================ */

/* ============================================================
   1. 隐藏原有板块内容，使用新内容覆盖
   ============================================================ */
.ai-workflow-section-override {
  position: relative;
}

.ai-workflow-section-override .original-content {
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

/* ============================================================
   2. 新板块容器
   ============================================================ */
.ai-workflow-new-container {
  width: 100%;
  padding: 48px 24px;
  background: #ffffff;
}

.ai-workflow-new-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* 板块标题区域 */
.ai-workflow-new-header {
  margin-bottom: 32px;
}

.ai-workflow-new-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ai-workflow-new-icon {
  width: 28px;
  height: 28px;
  color: #333;
}

.ai-workflow-new-title {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.ai-workflow-new-subtitle {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
  margin: 0;
  max-width: 700px;
}

/* ============================================================
   3. 四个子板块网格布局
   ============================================================ */
.ai-workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}

/* 前三个子板块 */
.ai-workflow-card {
  background: linear-gradient(145deg, #f8f8f8 0%, #f0f0f0 100%);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.ai-workflow-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* 第四个子板块（模型实验）- 独占一行 */
.ai-workflow-card:nth-child(4) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}

/* 卡片编号 */
.ai-workflow-card-number {
  font-size: 12px;
  font-weight: 600;
  color: #999;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

/* 卡片标题 */
.ai-workflow-card-title {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 12px 0;
}

/* 卡片描述 */
.ai-workflow-card-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.7;
  margin: 0;
}

/* 第四张卡片的特殊布局 */
.ai-workflow-card:nth-child(4) .card-left {
  display: flex;
  flex-direction: column;
}

.ai-workflow-card:nth-child(4) .card-right {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.ai-workflow-experiment-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
}

.ai-workflow-experiment-item .item-label {
  font-size: 11px;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
}

.ai-workflow-experiment-item .item-content {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   4. "点击查看"按钮样式与微动效
   ============================================================ */
.ai-workflow-view-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: ai-workflow-float 2s ease-in-out infinite;
  z-index: 10;
}

.ai-workflow-view-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

/* 上下漂浮动画 */
@keyframes ai-workflow-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

/* ============================================================
   5. 模态弹窗样式
   ============================================================ */
.ai-workflow-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

.ai-workflow-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ai-workflow-modal {
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.ai-workflow-modal-overlay.active .ai-workflow-modal {
  transform: scale(1) translateY(0);
}

.ai-workflow-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.ai-workflow-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.ai-workflow-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.ai-workflow-modal-close:hover {
  background: #e8e8e8;
}

.ai-workflow-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 140px);
}

.ai-workflow-modal-section {
  margin-bottom: 20px;
}

.ai-workflow-modal-section:last-child {
  margin-bottom: 0;
}

.ai-workflow-modal-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
}

.ai-workflow-modal-section-content {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  margin: 0;
}

.ai-workflow-modal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-workflow-modal-tool-tag {
  padding: 6px 12px;
  background: #f0f0f0;
  border-radius: 16px;
  font-size: 12px;
  color: #555;
}

/* 阅读全文按钮 */
.ai-workflow-read-full {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 24px;
  background: #1a1a1a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.ai-workflow-read-full:hover {
  background: #333;
  transform: translateY(-1px);
}

.ai-workflow-read-full svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   6. 移动端适配 - 3*1布局
   ============================================================ */
@media (max-width: 767px) {
  .ai-workflow-new-container {
    padding: 32px 16px;
  }

  .ai-workflow-new-title {
    font-size: 20px;
  }

  .ai-workflow-new-subtitle {
    font-size: 13px;
  }

  /* 移动端：前三个卡片水平并排 */
  .ai-workflow-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .ai-workflow-card:nth-child(1),
  .ai-workflow-card:nth-child(2),
  .ai-workflow-card:nth-child(3) {
    padding: 14px 10px;
    min-height: 140px;
  }

  /* 缩小卡片内容 */
  .ai-workflow-card:nth-child(1) .ai-workflow-card-number,
  .ai-workflow-card:nth-child(2) .ai-workflow-card-number,
  .ai-workflow-card:nth-child(3) .ai-workflow-card-number {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .ai-workflow-card:nth-child(1) .ai-workflow-card-title,
  .ai-workflow-card:nth-child(2) .ai-workflow-card-title,
  .ai-workflow-card:nth-child(3) .ai-workflow-card-title {
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.4;
  }

  .ai-workflow-card:nth-child(1) .ai-workflow-card-desc,
  .ai-workflow-card:nth-child(2) .ai-workflow-card-desc,
  .ai-workflow-card:nth-child(3) .ai-workflow-card-desc {
    font-size: 11px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 缩小按钮 */
  .ai-workflow-card:nth-child(1) .ai-workflow-view-btn,
  .ai-workflow-card:nth-child(2) .ai-workflow-view-btn,
  .ai-workflow-card:nth-child(3) .ai-workflow-view-btn {
    padding: 4px 8px;
    font-size: 10px;
    top: 8px;
    right: 8px;
  }

  /* 第四个卡片独占一行 */
  .ai-workflow-card:nth-child(4) {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .ai-workflow-card:nth-child(4) .ai-workflow-card-title {
    font-size: 15px;
  }

  .ai-workflow-card:nth-child(4) .card-right {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ai-workflow-experiment-item {
    padding: 14px;
  }

  /* 弹窗适配 */
  .ai-workflow-modal {
    max-height: 90vh;
    margin: 0 12px;
  }

  .ai-workflow-modal-body {
    padding: 20px;
    max-height: calc(90vh - 130px);
  }

  .ai-workflow-modal-title {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .ai-workflow-grid {
    gap: 8px;
  }

  .ai-workflow-card:nth-child(1),
  .ai-workflow-card:nth-child(2),
  .ai-workflow-card:nth-child(3) {
    padding: 12px 8px;
    min-height: 130px;
  }

  .ai-workflow-card:nth-child(1) .ai-workflow-card-title,
  .ai-workflow-card:nth-child(2) .ai-workflow-card-title,
  .ai-workflow-card:nth-child(3) .ai-workflow-card-title {
    font-size: 12px;
  }

  .ai-workflow-card:nth-child(1) .ai-workflow-card-desc,
  .ai-workflow-card:nth-child(2) .ai-workflow-card-desc,
  .ai-workflow-card:nth-child(3) .ai-workflow-card-desc {
    font-size: 10px;
    -webkit-line-clamp: 2;
  }
}
