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

/* 绩效评估页面样式 */
.performance-assess-page {
  padding: 24px;
  background-color: #f5f6fa;
  min-height: 90vh;
  max-height: 90vh; /* 限制最大高度 */
  overflow-y: auto; /* 添加垂直滚动条 */
  overflow-x: hidden; /* 隐藏水平滚动条 */

  /* 自定义滚动条样式 */
  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }

  &::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    
    &:hover {
      background: #a8a8a8;
    }
  }

  .ant-card {
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px; /* 增加卡片间隔 */
    transition: all 0.3s ease;

    &:hover {
      box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
      transform: translateY(-2px);
    }

    /* 最后一个卡片不需要下边距 */
    &:last-child {
      margin-bottom: 0;
    }
  }
}

/* 筛选区样式 */
.search-section {
  margin-bottom: 10px; /* 增加与后续内容的间隔 */
  
  .ant-card-body {
    padding: 20px; /* 调整内边距 */
  }

  .form-item {
    margin-bottom: 16px;

    .form-label {
      display: block;
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 4px;
    }
  }

  .search-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6; /* 添加分隔线 */

    .ant-btn {
      font-size: 14px;
      height: 32px;
      padding: 0 16px;
      border-radius: 4px;
    }
  }
}

/* 人员信息样式 */
.employee-section {
  margin-bottom: 10px;
  
  .ant-card-body {
    padding: 20px;
  }

  .employee-info {
    display: flex;
    align-items: center;
    gap: 20px; /* 增加元素间隔 */

    .employee-avatar {
      flex-shrink: 0;
      background-color: #e5e7eb;
    }

    .employee-details {
      flex: 1;
    }

    .plan-info {
      flex-shrink: 0;
      min-width: 200px; /* 确保有足够空间 */
    }

    .info-item {
      display: flex;
      flex-direction: column;
      margin-bottom: 8px; /* 增加项目间隔 */

      .info-label {
        font-size: 12px;
        color: #6b7280;
        margin-bottom: 4px;
      }

      .info-value {
        font-size: 14px;
        color: #111827;
        font-weight: 500;
      }
    }
  }
}

/* 绩效公式样式 */
.formula-section {
  margin-bottom: 10px;
  
  .ant-card-body {
    padding: 20px;
  }

  .section-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 12px;
    margin-top: 0;
  }

  .formula-content {
    background-color: #f3f4f6;
    padding: 12px; /* 增加内边距 */
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    line-height: 1.5; /* 增加行高 */
    border-left: 4px solid #2d5cf6; /* 添加左边框 */
  }
}

/* 绩效总分样式 */
.score-section {
  margin-bottom: 10px;
  
  .ant-card-body {
    padding: 20px;
  }

  .score-info {
    display: flex;
    flex-direction: column;

    .score-label {
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 6px;
    }

    .score-value {
      font-size: 36px; /* 增大字体 */
      font-weight: bold;
      color: #2d5cf6;
      line-height: 1;
    }
  }

  .status-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    .status-label {
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 6px;
    }

    .status-value {
      font-size: 16px; /* 增大字体 */
      color: #059669;
      font-weight: 500;
      padding: 4px 12px;
      background-color: #d1fae5;
      border-radius: 12px;
    }
  }
}

/* 客观指标样式 */
.objective-section {
  margin-bottom: 10px;
  
  .ant-card-body {
    padding: 20px;
  }

  .section-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 16px;
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f3f4f6;
  }

  .metric-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background-color: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;

    .metric-label {
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 4px;
    }

    .metric-value {
      font-size: 16px;
      color: #111827;
      font-weight: 600;
    }
  }
}

/* 主观指标样式 */
.subjective-section {
  // margin-bottom: 10px;

  .subjective-card {
    height: auto;
    margin-bottom: 16px;
    
    .ant-card-body {
      padding: 20px;
    }

    .section-title {
      font-size: 14px;
      font-weight: 500;
      color: #111827;
      margin-bottom: 16px;
      margin-top: 0;
      padding-bottom: 8px;
      border-bottom: 2px solid #f3f4f6;
    }

    .rating-section {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 16px;
      padding: 12px;
      background-color: #f9fafb;
      border-radius: 6px;

      .rating-label {
        font-size: 14px;
        color: #374151;
        font-weight: 500;
      }

      .rating-value {
        font-size: 14px;
        color: #111827;
        font-weight: 600;
        background-color: #2d5cf6;
        color: white;
        padding: 2px 8px;
        border-radius: 4px;
      }
    }

    .comment-section {
      .comment-label {
        display: block;
        font-size: 12px;
        color: #6b7280;
        margin-bottom: 8px;
        font-weight: 500;
      }

      .ant-input {
        font-size: 14px;
        border-radius: 6px;
        border: 2px solid #e5e7eb;
        padding: 12px;
        min-height: 120px; /* 增加最小高度 */
        
        &:focus {
          border-color: #2d5cf6;
          box-shadow: 0 0 0 3px rgba(45, 92, 246, 0.1);
        }
      }
    }
  }
}

/* 操作按钮样式 */
.action-section {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  // margin-top: 32px;
  // padding-top: 24px;
  // border-top: 2px solid #f3f4f6;

  .ant-btn {
    padding: 12px 32px;
    height: auto;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 500;
  }

  .ant-btn-primary {
    background-color: #2d5cf6;
    border-color: #2d5cf6;

    &:hover {
      background-color: #1d4ed8;
      border-color: #1d4ed8;
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(45, 92, 246, 0.3);
    }
  }

  .ant-btn:not(.ant-btn-primary) {
    border: 2px solid #e5e7eb;
    color: #374151;

    &:hover {
      border-color: #d1d5db;
      transform: translateY(-1px);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
  }
}

/* 响应式样式 */
@media (max-width: 768px) {
  .performance-assess-page {
    padding: 16px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .ant-card {
    margin-bottom: 16px;
    
    .ant-card-body {
      padding: 16px !important;
    }
  }

  .employee-section {
    .employee-info {
      flex-direction: column;
      align-items: flex-start;
      gap: 16px;

      .employee-details {
        width: 100%;
      }

      .plan-info {
        width: 100%;
        min-width: auto;
      }
    }
  }

  .subjective-section {
    .ant-col {
      margin-bottom: 16px;
    }
  }

  .action-section {
    flex-direction: column;
    gap: 12px;

    .ant-btn {
      width: 100%;
    }
  }

  .objective-section {
    .ant-row {
      .ant-col {
        margin-bottom: 12px;
      }
    }
  }
}

/* 自定义Rate组件样式 */
.ant-rate {
  font-size: 18px;

  .ant-rate-star {
    margin-right: 6px;
  }

  .ant-rate-star-full .ant-rate-star-first,
  .ant-rate-star-full .ant-rate-star-second {
    color: #faad14;
  }
}

/* Firefox 滚动条样式 */
.performance-assess-page {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

/* 输入框聚焦效果增强 */
.ant-input:focus,
.ant-select-focused .ant-select-selector {
  border-color: #2d5cf6;
  box-shadow: 0 0 0 3px rgba(45, 92, 246, 0.1);
}

/* 卡片内容区域滚动优化 */
.ant-card-body {
  overflow: hidden; /* 防止内容溢出 */
}

/* 长文本内容滚动 */
.comment-section .ant-input {
  resize: vertical; /* 允许垂直调整大小 */
  max-height: 200px; /* 限制最大高度 */
  overflow-y: auto; /* 超出时显示滚动条 */
}