@import '~@/utils/utils.less';

// 使用与OnBoarding相同的基础样式
.container {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background-color: #f5f6fa;
}

.mainContent {
  height: 100vh;
  overflow: hidden;
  
  .contentCard {
    height: 100%;
    border: none !important;
    
    :global(.ant-card-body) {
      padding: 12px 24px;
      // height: calc(100vh - 24px);
      // overflow: hidden;
    }
  }
}

// 组织架构树样式 - 与OnBoarding保持一致
.treeCard {
  height: 600px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;

  .treeContainer {
    height: 520px;
    overflow-y: auto;

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.02);
    }

    &::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.15);
      border-radius: 3px;
      
      &:hover {
        background: rgba(0, 0, 0, 0.25);
      }
    }
  }

  .orgTree {
    .ant-tree-node-content-wrapper {
      border-radius: 4px;
      transition: all 0.3s ease;
      padding: 4px 8px;

      &:hover {
        background-color: #f0f9ff;
        transform: translateX(2px);
      }

      &.ant-tree-node-selected {
        background-color: #e6f7ff !important;
        box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
      }
    }
  }
}

.tree-node-title {
  display: flex;
  align-items: center;
  width: 100%;

  .node-title {
    flex: 1;
    font-size: 14px;
    margin-left: 8px;
    color: #333;
  }

  .node-count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
  }
}

// 主卡片样式
.mainCard {
  height: calc(100vh - 60px);
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  
  .ant-card-body {
    padding: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
}

// 头部区域
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  height: 72px;
  // background: #fafafa;
}

// 内容区域
.content {
  flex: 1;
  padding: 20px 24px 28px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0; // 关键：允许flex子元素收缩
  height: calc(100vh - 180px); // 减去头部高度和其他空间，强制设置高度
  max-height: calc(100vh - 180px); // 明确最大高度，确保滚动条出现
  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;

    &:hover {
      background: rgba(0, 0, 0, 0.28);
    }
  }
  
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) rgba(0, 0, 0, 0.02);
}

// 按钮样式
.approveBtn {
  background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
  border: none;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
  
  &:hover {
    background: linear-gradient(135deg, #73d13d 0%, #95de64 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
  }
}

.rejectBtn {
  box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
  
  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
  }
}

// 信息卡片
.infoCard {
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

  &:last-child {
    margin-bottom: 0;
  }

  .ant-card-head {
    border-bottom: 1px solid #f0f0f0;
    
    .ant-card-head-title {
      font-size: 16px;
      font-weight: 600;
      color: #333;
    }
  }

  .ant-card-body {
    padding: 20px;
  }
}

// 照片容器
.photoContainer {
  text-align: center;
  
  .applicantPhoto,
  .idCardPhoto {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
  }
  
  .photoLabel {
    display: block;
    font-size: 12px;
    color: #666;
  }
}

// 基本信息
.basicInfo {
  .infoItem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    
    .infoLabel {
      color: #666;
      font-size: 14px;
    }
    
    .infoValue {
      font-weight: 500;
      color: #333;
      font-size: 14px;
    }
  }
}

// 背景信息区域
.backgroundSection {
  background: #fafafa;
  border-radius: 8px;
  padding: 16px;
  
  .backgroundRow {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    
    &:last-child {
      border-bottom: none;
    }
  }
}

// 审批流程时间线
.approvalTimeline {
  .timelineItem {
    padding-bottom: 24px;
    
    .timelineContent {
      background: #fafafa;
      border-radius: 8px;
      padding: 16px;
      margin-left: 16px;
      border: 1px solid #f0f0f0;
      
      .timelineHeader {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
        
        .stepTitle {
          font-size: 16px;
          color: #333;
        }
        
        .stepTime {
          font-size: 12px;
          color: #999;
        }
      }
      
      .stepComment {
        margin: 0;
        color: #666;
        font-size: 14px;
      }
      
      .stepOpinion {
        margin-top: 8px;
        padding: 8px 12px;
        background: #e6f7ff;
        border-radius: 4px;
        border-left: 3px solid #1890ff;
        
        span {
          color: #1890ff;
          font-size: 13px;
        }
      }
    }
  }
}

// 状态图标
.completedIcon {
  color: #52c41a;
  font-size: 16px;
}

.processingIcon {
  color: #faad14;
  font-size: 16px;
}

.waitingIcon {
  color: #d9d9d9;
  font-size: 16px;
}

// 响应式设计
@media (max-width: 1200px) {
  .treeCard {
    height: 300px;
  }
  
  .mainCard {
    height: auto;
    max-height: 80vh;
    min-height: 500px;
    
    .content {
      max-height: 65vh;
      
      &::-webkit-scrollbar {
        width: 4px;
      }
    }
  }
  
  .photoContainer {
    margin-bottom: 16px;
  }
}

// 页面特定样式
.container {
  .ant-btn-primary {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
  }
  
  .ant-btn:not(.ant-btn-primary) {
    border-radius: 6px;
    transition: all 0.3s ease;
    
    &:hover,
    &:focus {
      border-color: #4c7bff;
      color: #2d5cf6;
    }
  }
}