/* ==================== 客户资质管理样式 ==================== */

/* 容器 */
.cq-container {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* 头部 */
.cq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cq-header h2 {
  margin: 0;
  font-size: 24px;
  color: #333;
}

/* 筛选栏 */
.cq-filter-bar {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.cq-filter-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cq-filter-item label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.cq-filter-item input,
.cq-filter-item select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-width: 200px;
}

.cq-filter-item input:focus,
.cq-filter-item select:focus {
  outline: none;
  border-color: #1890ff;
}

/* 按钮 */
.cq-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.cq-btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

.cq-btn-primary {
  background: #1890ff;
  color: #fff;
}

.cq-btn-primary:hover {
  background: #40a9ff;
}

.cq-btn-secondary {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.cq-btn-secondary:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.cq-btn-danger {
  background: #ff4d4f;
  color: #fff;
}

.cq-btn-danger:hover {
  background: #ff7875;
}

.cq-btn-outline {
  background: transparent;
  border: 1px solid #1890ff;
  color: #1890ff;
}

.cq-btn-outline:hover {
  background: #1890ff;
  color: #fff;
}

.cq-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* 客户列表 */
.cq-customer-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cq-customer-item {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s;
}

.cq-customer-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cq-customer-item.cq-has-expired {
  border-left: 4px solid #ff4d4f;
}

.cq-customer-item.cq-has-expiring {
  border-left: 4px solid #faad14;
}

.cq-customer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e8e8e8;
}

.cq-customer-info h3 {
  margin: 0 0 5px 0;
  font-size: 18px;
  color: #333;
}

.cq-customer-meta {
  font-size: 14px;
  color: #999;
}

/* 完成度 */
.cq-completion-section {
  flex: 1;
  max-width: 300px;
  margin: 0 20px;
}

.cq-completion-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.cq-completion-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cq-progress-bar {
  flex: 1;
  height: 8px;
  background: #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
}

.cq-progress-fill {
  height: 100%;
  background: #52c41a;
  transition: width 0.3s ease;
}

.cq-progress-text {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  min-width: 50px;
  text-align: right;
}

/* 资质网格 */
.cq-qualifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

/* 资质卡片 */
.cq-qualification-card {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 15px;
  transition: all 0.3s;
}

.cq-qualification-card:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cq-qualification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cq-qualification-type {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.cq-qualification-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.cq-status-normal {
  background: #f6ffed;
  color: #52c41a;
}

.cq-status-warning {
  background: #fffbe6;
  color: #faad14;
}

.cq-status-expiring_soon {
  background: #fff7e6;
  color: #fa8c16;
}

.cq-status-expired {
  background: #fff1f0;
  color: #ff4d4f;
}

.cq-status-permanent {
  background: #f6ffed;
  color: #52c41a;
}

.cq-qualification-body {
  margin-bottom: 10px;
}

.cq-qualification-row {
  display: flex;
  margin-bottom: 5px;
  font-size: 14px;
}

.cq-qualification-row .cq-label {
  color: #666;
  min-width: 80px;
}

.cq-qualification-row .cq-value {
  color: #333;
  flex: 1;
}

.cq-file-link {
  color: #1890ff;
  text-decoration: none;
  cursor: pointer;
}

.cq-file-link:hover {
  text-decoration: underline;
}

.cq-qualification-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #e8e8e8;
}

/* 到期提醒 */
.cq-expiry-alert {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.cq-alert-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 16px;
  border-radius: 4px;
  background: #fff;
  border-left: 4px solid;
}

.cq-alert-danger {
  border-left-color: #ff4d4f;
  background: #fff1f0;
}

.cq-alert-warning {
  border-left-color: #faad14;
  background: #fffbe6;
}

.cq-alert-icon {
  font-size: 24px;
}

.cq-alert-content {
  flex: 1;
}

.cq-alert-title {
  font-size: 16px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}

.cq-alert-text {
  font-size: 14px;
  color: #666;
}

/* 空状态 */
.cq-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.cq-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.cq-empty-text {
  font-size: 16px;
}

/* 分页 */
.cq-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 4px;
}

.cq-pagination-info {
  font-size: 14px;
  color: #666;
}

.cq-pagination-controls {
  display: flex;
  gap: 10px;
}

/* 弹窗 */
.cq-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.cq-modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.cq-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.cq-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cq-modal-close:hover {
  color: #333;
}

.cq-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cq-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #e8e8e8;
}

/* 表单 */
.cq-form-group {
  margin-bottom: 15px;
}

.cq-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.cq-form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  color: #333;
}

.cq-form-group input[type="text"],
.cq-form-group input[type="date"],
.cq-form-group input[type="number"],
.cq-form-group select,
.cq-form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.cq-form-group input:focus,
.cq-form-group select:focus,
.cq-form-group textarea:focus {
  outline: none;
  border-color: #1890ff;
}

.cq-form-group textarea {
  resize: vertical;
}

.cq-form-group input[type="checkbox"] {
  margin-right: 8px;
}

.cq-required {
  color: #ff4d4f;
}

.cq-form-group input[type="file"] {
  width: 100%;
}

/* 文件预览 */
.cq-file-preview {
  margin-top: 10px;
}

.cq-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 4px;
}

.cq-loading {
  color: #1890ff;
  font-size: 14px;
}

/* Toast */
.cq-toast {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* 响应式 */
@media (max-width: 768px) {
  .cq-filter-bar {
    flex-direction: column;
  }

  .cq-filter-item input,
  .cq-filter-item select {
    width: 100%;
  }

  .cq-customer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .cq-completion-section {
    width: 100%;
    margin: 0;
  }

  .cq-qualifications-grid {
    grid-template-columns: 1fr;
  }

  .cq-form-row {
    grid-template-columns: 1fr;
  }

  .cq-pagination {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* ==================== 文件上传组件样式 ==================== */

.cq-file-upload-container {
  width: 100%;
}

.cq-drag-drop-zone {
  border: 2px dashed #ddd;
  border-radius: 4px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #fafafa;
}

.cq-drag-drop-zone:hover {
  border-color: #1890ff;
  background: #f0f8ff;
}

.cq-drag-drop-zone.cq-drag-over {
  border-color: #1890ff;
  background: #e6f7ff;
}

.cq-drag-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.cq-file-list {
  margin-top: 15px;
}

.cq-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  margin-bottom: 10px;
  background: #fff;
}

.cq-file-item.cq-uploading {
  background: #f0f8ff;
}

.cq-file-item.cq-success {
  background: #f6ffed;
  border-color: #b7eb8f;
}

.cq-file-item.cq-error {
  background: #fff2f0;
  border-color: #ffccc7;
}

.cq-file-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cq-file-name {
  font-weight: 500;
}

.cq-file-size {
  font-size: 12px;
  color: #999;
}

.cq-file-error {
  font-size: 12px;
  color: #f5222d;
}

.cq-progress-bar {
  width: 100%;
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 5px;
}

.cq-progress-fill {
  height: 100%;
  background: #1890ff;
  transition: width 0.3s;
}

.cq-file-status {
  font-size: 12px;
  color: #1890ff;
  margin-left: 10px;
}

/* ==================== 批量上传样式 ==================== */

.cq-batch-upload-zone {
  border: 2px dashed #ddd;
  border-radius: 4px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.cq-batch-upload-zone:hover {
  border-color: #1890ff;
  background: #f0f8ff;
}

.cq-batch-file-list {
  max-height: 300px;
  overflow-y: auto;
}

.cq-batch-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.cq-batch-stats {
  margin-top: 20px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 4px;
}

/* ==================== 文件预览样式 ==================== */

.cq-preview-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cq-preview-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cq-preview-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}
