/* 调试样式文件 - 增强版本，确保布局正确显示 */

@use '../ios-theme.scss' as *;

/* 重置所有可能冲突的样式 - 使用最高优先级 */
* {
  box-sizing: border-box !important;
}

/* 重置主内容区域样式 */
.main-content {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 重置内容包装器样式 */
.content-wrapper {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 重置项目详情容器 */
.project-detail-container {
  padding: 20px !important;
  width: 100% !important;
  margin: 0 !important;
}

/* 重置标签页内容容器 */
.tab-content {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 重置项目进度标签页内容 */
.progress-tab-content {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 上传区域样式优化 - 确保在并排显示时内容清晰可读 */
.upload-section {
  /* 基础样式保持不变 */
  margin-bottom: 16px !important;
  
  /* 针对四个卡片并排时的特殊优化 */
  .stage-progress-container:has(.vertical-stage-block:nth-child(4):last-child) & {
    /* 笔记本端和PC端的上传区域优化 */
    @media (min-width: 1366px) {
      margin-bottom: 12px !important;
      
      .upload-dropzone {
        min-height: 120px !important;
        padding: 12px !important;
        
        .upload-text {
          font-size: 12px !important;
          line-height: 1.4 !important;
        }
        
        .upload-hint {
          font-size: 11px !important;
          margin-top: 4px !important;
        }
      }
    }
    
    /* 24寸PC端的上传区域优化 */
    @media (min-width: 1920px) {
      margin-bottom: 16px !important;
      
      .upload-dropzone {
        min-height: 140px !important;
        padding: 16px !important;
        
        .upload-text {
          font-size: 13px !important;
          line-height: 1.4 !important;
        }
        
        .upload-hint {
          font-size: 12px !important;
          margin-top: 6px !important;
        }
      }
    }
    
    /* 较小屏幕时保持紧凑布局 */
    @media (max-width: 1365px) {
      margin-bottom: 10px !important;
      
      .upload-dropzone {
        min-height: 100px !important;
        padding: 10px !important;
        
        .upload-text {
          font-size: 11px !important;
          line-height: 1.3 !important;
        }
        
        .upload-hint {
          font-size: 10px !important;
          margin-top: 3px !important;
        }
      }
    }
  }
}

/* 阶段标题样式优化 */
.vertical-stage-header {
  /* 针对四个卡片并排时的标题优化 */
  .stage-progress-container:has(.vertical-stage-block:nth-child(4):last-child) & {
    margin-bottom: 12px !important;
    
    h4 {
      font-size: 14px !important;
      line-height: 1.3 !important;
      margin: 0 !important;
      
      /* 笔记本端和PC端的标题优化 */
      @media (min-width: 1366px) {
        font-size: 15px !important;
      }
      
      /* 24寸PC端的标题优化 */
      @media (min-width: 1920px) {
        font-size: 16px !important;
      }
    }
  }
}

/* 强制覆盖主内容布局样式 - 使用最高优先级 */
.progress-tab-content > .main-content-layout {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 20px !important;
  margin-top: 20px !important;
  width: 100% !important;
  background-color: transparent !important; /* 去除调试底色 */
  padding: 20px !important;
  border-radius: 8px !important;
}

/* 强制覆盖左侧列样式 - 使用最高优先级 */
.progress-tab-content > .main-content-layout > .left-column {
  width: 28% !important;
  min-width: 28% !important;
  max-width: 28% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  background-color: transparent !important; // 去除左侧粉色底色
  padding: 8px !important;
  border-radius: 6px !important;
}

/* 强制覆盖右侧列样式 - 使用最高优先级 */
.progress-tab-content > .main-content-layout > .right-column {
  width: 72% !important;
  min-width: 72% !important;
  max-width: 72% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  background-color: transparent !important; // 去除右侧调试底色
  padding: 8px !important;
  border-radius: 6px !important;
}

/* 优化卡片样式 */
.left-column .card,
.right-column .card {
  background-color: white !important;
  border-radius: 8px !important;
  padding: 16px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid #eaeaea !important;
}

/* 客户信息卡片内部元素优化 */
.left-column .project-info-card .info-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
}

.left-column .project-info-card .info-item {
  display: flex !important;
  flex-direction: column !important;
  padding: 8px !important;
  background: #f8f9fa !important;
  border-radius: 6px !important;
  border: 1px solid #e9ecef !important;
  font-size: 12px !important;
}

.left-column .project-info-card .info-item label {
  font-weight: 500 !important;
  color: #6c757d !important;
  margin-bottom: 4px !important;
  font-size: 11px !important;
}

.left-column .project-info-card .info-item span {
  color: #212529 !important;
  font-weight: 600 !important;
  font-size: 12px !important;
}

.left-column .project-info-card .tags-container {
  margin-top: 8px !important;
}

.left-column .project-info-card .tag-section {
  margin-bottom: 8px !important;
}

.left-column .project-info-card .tag-section h3 {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #495057 !important;
  margin-bottom: 6px !important;
}

.left-column .project-info-card .tags .tag {
  font-size: 10px !important;
  padding: 4px 8px !important;
  margin: 2px 4px 2px 0 !important;
  background-color: rgba(24, 144, 255, 0.08) !important;
  color: #1890ff !important;
  border-radius: 4px !important;
}

.left-column .project-info-card .need-list {
  margin: 0 !important;
  padding-left: 12px !important;
}

.left-column .project-info-card .need-list li {
  font-size: 11px !important;
  color: #495057 !important;
  margin-bottom: 3px !important;
}

.left-column .project-info-card .requirement-sync-info {
  margin-top: 8px !important;
  padding: 8px !important;
  background: #f1f3f4 !important;
  border-radius: 6px !important;
}

.left-column .project-info-card .requirement-sync-info h4 {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #495057 !important;
  margin-bottom: 6px !important;
}

/* 确保响应式布局正常工作 */
@media (max-width: 1024px) {
  .progress-tab-content > .main-content-layout {
    flex-direction: column !important;
  }
  
  .progress-tab-content > .main-content-layout > .left-column,
  .progress-tab-content > .main-content-layout > .right-column {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
  }
}

/* ===================== 四大板块：工具条与内容样式（调试版） ===================== */
.sections-toolbar {
  display: flex;
  gap: $ios-spacing-md;
  padding: $ios-spacing-sm;
  background: $ios-background-secondary;
  border-radius: $ios-radius-lg;
  border: 1px solid $ios-border;
  margin: $ios-spacing-md 0 $ios-spacing-lg;
}

.section-btn {
  appearance: none;
  border: 1px solid $ios-border;
  background: $ios-background;
  color: $ios-text-primary;
  padding: $ios-spacing-sm $ios-spacing-lg;
  border-radius: $ios-radius-md;
  font-size: $ios-font-size-sm;
  font-weight: $ios-font-weight-medium;
  cursor: pointer;
  transition: all 0.15s ease;
}
.section-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.section-btn.completed { background: #e6f7e6; color: $ios-success; border-color: rgba(0,0,0,0.06); }
.section-btn.active { background: #e8f0fe; color: $ios-primary; border-color: $ios-primary; }
.section-btn.pending { background: $ios-background; color: $ios-text-secondary; }

.sections-content { margin-top: $ios-spacing-md; }

.section-panel {
  background: $ios-background;
  border: 1px solid $ios-border;
  border-radius: $ios-radius-lg;
  padding: $ios-spacing-lg;
}

/* 交付执行：三列布局 */
.delivery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: $ios-spacing-lg;
}

@media (max-width: 1024px) {
  .delivery-grid { grid-template-columns: 1fr; }
}

.delivery-col {
  background: $ios-background-secondary;
  border: 1px solid $ios-border;
  border-radius: $ios-radius-md;
  padding: $ios-spacing-md;
  display: flex;
  flex-direction: column;
  gap: $ios-spacing-md;
}

.delivery-stage-header {
  display: flex;
  align-items: center;
  gap: $ios-spacing-sm;
}
.delivery-stage-header .dot {
  width: 10px; height: 10px; border-radius: 50%; background: $ios-border;
}
.delivery-stage-header .dot.completed { background: $ios-success; }
.delivery-stage-header .dot.active { background: $ios-primary; }

.delivery-stage-body { display: flex; flex-direction: column; gap: $ios-spacing-md; }

/* 统一纵向内容容器 */
.section-vertical { display: flex; flex-direction: column; gap: $ios-spacing-lg; }

.vertical-stage-block {
  background: $ios-background-secondary;
  border: 1px solid $ios-border;
  border-radius: $ios-radius-md;
  padding: $ios-spacing-md;
}

.vertical-stage-header { display: flex; align-items: center; gap: $ios-spacing-sm; margin-bottom: $ios-spacing-sm; }
.vertical-stage-header .dot { width: 10px; height: 10px; border-radius: 50%; background: $ios-border; }
.vertical-stage-header .dot.completed { background: $ios-success; }
.vertical-stage-header .dot.active { background: $ios-primary; }

.vertical-stage-body { display: flex; flex-direction: column; gap: $ios-spacing-md; }

/* 缩略图列表适配到新容器 */
.section-panel .thumb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: $ios-spacing-md; }
.section-panel .thumb-item { background: white; border: 1px solid $ios-border; border-radius: $ios-radius-sm; overflow: hidden; display: flex; flex-direction: column; }
.section-panel .thumb-item img { width: 100%; height: 120px; object-fit: cover; }
.section-panel .thumb-meta { display: flex; justify-content: space-between; padding: $ios-spacing-xs $ios-spacing-sm; font-size: $ios-font-size-xs; color: $ios-text-secondary; }

/* 上传区小幅适配 */
.section-panel .upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: $ios-spacing-sm;
  padding: $ios-spacing-sm $ios-spacing-md;
  background: $ios-background;
  border: 1px dashed $ios-border;
  border-radius: $ios-radius-sm;
}

/* 强调版：客户信息卡片更突出、边缘更清晰 */
/* 顶部强调条、圆角与阴影调整，以及关键信息高亮 */
.left-column .project-info-card.card {
  border: 1px solid $ios-border !important;
  border-radius: 12px !important; /* 圆角加大 */
  box-shadow: 0 10px 24px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.05) !important; /* 阴影减弱些 */
  position: relative;
}
.left-column .project-info-card.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px; /* 顶部强调条 */
  background: $ios-primary;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
/* 关键信息轻微高亮：客户姓名 */
.left-column .project-info-card .info-item.key-info span {
  font-weight: $ios-font-weight-semibold;
  color: $ios-text-primary;
}
.left-column .project-info-card .info-item.key-info label {
  color: $ios-primary;
}
/* 标签轻微高亮：提升标签显著性但不过度 */
.left-column .project-info-card .tags .tag {
  background-color: rgba(24, 144, 255, 0.08); /* 以主色系的淡背景形成层级 */
  color: $ios-primary;
}
.left-column .project-info-card.card h2 {
  color: $ios-primary !important; /* 标题与强调条呼应 */
}

/* 活动阶段卡片：浅红底色突显（更显眼版） */
.delivery-col.active,
.vertical-stage-block.active {
  background: #ffeaea; /* 比 #fff2f0 更显眼 */
  border-color: #ffccc7; /* 维持柔和的红系边框 */
  box-shadow: 0 8px 22px rgba(255, 85, 62, 0.12), 0 2px 8px rgba(255, 85, 62, 0.10);
  position: relative; /* 提供定位上下文给badge */
  padding-right: $ios-spacing-lg; /* 让出badge空间，避免内容压贴 */
}

/* 活动阶段标题与圆点颜色呼应 */
.delivery-col.active .delivery-stage-header h3,
.vertical-stage-block.active .vertical-stage-header h3 { color: #ff4d4f; }
.delivery-col.active .dot,
.vertical-stage-block.active .dot { background: #ff4d4f; }

/* 右上角状态badge：进行中 */
.delivery-col.active::after,
.vertical-stage-block.active::after {
  content: '进行中';
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  background: #ff4d4f;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(255, 77, 79, 0.25);
}

/* 阶段卡片横向排列（按板块的阶段数量自适应列数） */
.stage-progress-container {
  display: grid !important;
  gap: 12px !important;
  align-items: stretch !important; // 保证同一行的卡片等高
  
  /* 针对交付执行阶段的四个卡片进行特殊处理 */
  &:has(.vertical-stage-block:nth-child(4):last-child) {
    /* 当有且仅有4个卡片时，强制并排显示 */
    grid-template-columns: repeat(4, 1fr) !important;
    
    /* 笔记本端适配（1366px及以上） */
    @media (min-width: 1366px) {
      grid-template-columns: repeat(4, 1fr) !important;
      gap: 16px !important;
    }
    
    /* 24寸PC端适配（1920px及以上） */
    @media (min-width: 1920px) {
      grid-template-columns: repeat(4, 1fr) !important;
      gap: 20px !important;
    }
    
    /* 较小屏幕的降级处理（小于1366px） */
    @media (max-width: 1365px) {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 12px !important;
    }
  }
  
  /* 其他情况保持原有的自适应布局 */
  &:not(:has(.vertical-stage-block:nth-child(4):last-child)) {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  }
}

.vertical-stage-block {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  padding: 12px !important;
  background: white !important;
  border-radius: 8px !important;
  border: 1px solid #e9ecef !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
  
  /* 确保卡片内容在并排显示时保持可读性 */
  min-width: 0 !important; /* 防止内容溢出 */
  
  /* 针对四个卡片并排时的特殊样式 */
  .stage-progress-container:has(.vertical-stage-block:nth-child(4):last-child) & {
    /* 笔记本端和PC端的内容优化 */
    @media (min-width: 1366px) {
      padding: 16px !important;
      min-height: 300px !important; /* 确保卡片有足够高度 */
    }
    
    /* 24寸PC端的内容优化 */
    @media (min-width: 1920px) {
      padding: 20px !important;
      min-height: 320px !important;
    }
    
    /* 较小屏幕时保持紧凑布局 */
    @media (max-width: 1365px) {
      padding: 12px !important;
      min-height: 280px !important;
    }
  }
}

.vertical-stage-header {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
  padding-bottom: 6px !important;
  border-bottom: 1px solid #f1f3f4 !important;
}

.vertical-stage-header h3 {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #495057 !important;
  margin: 0 !important;
}

.vertical-stage-header .dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #dee2e6 !important;
  flex-shrink: 0 !important;
}

.vertical-stage-header .dot.completed {
  background: #28a745 !important;
}

.vertical-stage-header .dot.active {
  background: #007bff !important;
}

.vertical-stage-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
}

/* 活动阶段卡片优化 */
.vertical-stage-block.active {
  background: #fff8f0 !important;
  border-color: #ffc069 !important;
  box-shadow: 0 2px 8px rgba(255, 192, 105, 0.2) !important;
}

.vertical-stage-block.active .vertical-stage-header h3 {
  color: #d46b08 !important;
}

.vertical-stage-block.active .dot {
  background: #fa8c16 !important;
}

/* 订单创建阶段完成后的绿色高亮 */
.vertical-stage-block.completed {
  background: #f6ffed !important;
  border-color: #b7eb8f !important;
  box-shadow: 0 2px 8px rgba(183, 235, 143, 0.3) !important;
}

.vertical-stage-block.completed .vertical-stage-header h3 {
  color: #389e0d !important;
  font-weight: 600 !important;
}

.vertical-stage-block.completed .dot {
  background: #52c41a !important;
}

/* 需求沟通阶段激活时的高亮 */
.vertical-stage-block[id="stage-requirements-talk"].active {
  background: linear-gradient(135deg, #e6f7ff 0%, #f0f9ff 100%) !important;
  border-color: #40a9ff !important;
  box-shadow: 0 4px 16px rgba(64, 169, 255, 0.2) !important;
  transform: translateY(-2px) !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.vertical-stage-block[id="stage-requirements-talk"].active .vertical-stage-header h3 {
  color: #1890ff !important;
  font-weight: 700 !important;
}

.vertical-stage-block[id="stage-requirements-talk"].active .dot {
  background: #1890ff !important;
  box-shadow: 0 0 0 4px rgba(24, 144, 255, 0.2) !important;
}