/* 页面背景样式 */
.knowledge-page {
  min-height: 100vh;
  background-color: #f5f5f5;
  padding: 0;
}

/* 导入选择器样式 */
.import-split-selector {
  margin-bottom: 1rem;
  width: 100%;
}

.import-split-selector .ant-radio-button-wrapper {
  height: 40px;
  line-height: 38px;
  padding: 0 16px;
  border-radius: 2px;
  font-weight: 500;
  transition: all 0.3s;
}

.import-split-selector .ant-radio-button-wrapper:first-child {
  border-radius: 2px 0 0 2px;
}

.import-split-selector .ant-radio-button-wrapper:last-child {
  border-radius: 0 2px 2px 0;
}

/* 选中状态样式 */
.import-split-selector .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
  background-color: #1890ff;
  border-color: #1890ff;
  color: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
}

/* 悬停样式 */
.import-split-selector .ant-radio-button-wrapper:hover {
  color: #1890ff;
  border-color: #1890ff;
}

.import-split-selector .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover {
  color: #fff;
  background-color: #40a9ff;
  border-color: #40a9ff;
}

/* 导入容器样式 */
.import-form-container {
  padding: 0.5rem 0;
}

/* 模板下载区域样式 */
.template-download-section {
  margin: 0.5rem 0 1.5rem;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 4px;
  border-left: 4px solid #1890ff;
}

.template-download-section .ant-divider {
  margin: 0 0 0.75rem;
  border-top-color: #e8e8e8;
}

.template-download-section .ant-divider-inner-text {
  font-weight: 500;
  color: #1890ff;
}

.template-download-section .ant-btn {
  margin-right: 8px;
  margin-bottom: 8px;
}

/* QA导入特定样式 */
.qa-import-info-panel {
  padding: 1rem;
  height: 100%;
  background-color: #f5f7fa;
  border-radius: 6px;
}

.qa-import-content-panel {
  padding: 0.5rem;
  height: 100%;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.qa-import-guide .ant-steps-item-icon {
  background-color: #e6f7ff;
  border-color: #1890ff;
}

.qa-import-guide .ant-steps-item-title {
  font-weight: 500;
}

.qa-import-guide .ant-steps-item-description {
  color: rgba(0, 0, 0, 0.65);
}

.qa-file-uploader {
  border: 2px dashed #d9d9d9;
  background-color: #fafafa;
  transition: all 0.3s;
}

.qa-file-uploader:hover {
  border-color: #1890ff;
}

.qa-file-uploader .ant-upload-drag-icon {
  color: #1890ff;
  margin-bottom: 0.5rem;
}

.qa-file-uploader .ant-upload-text {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.85);
  margin-bottom: 0.5rem;
}

.qa-file-uploader .ant-upload-hint {
  color: rgba(0, 0, 0, 0.45);
}

/* 链接导入样式 */
.link-import-textarea {
  font-family: monospace;
  font-size: 14px;
  border-width: 1px;
  border-radius: 4px;
}

.link-import-textarea:focus {
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.import-url-examples {
  margin-top: 1rem;
  padding: 0.5rem 0;
}

.import-url-example-card {
  background-color: #fafafa;
  border: 1px solid #f0f0f0;
}

.import-url-example-card ul {
  list-style-type: disc;
  margin: 0;
}

/* 导入提示信息样式 */
.import-tip-alert {
  background-color: #f9fafb;
  border-color: #e5e7eb;
  font-size: 0.9rem;
  opacity: 0.85;
}

.import-tip-alert .ant-alert-message {
  color: #4b5563;
  font-weight: 500;
}

.import-tip-alert .ant-alert-description {
  color: #6b7280;
}

.import-tip-alert .anticon {
  color: #9ca3af;
}

/* 知识项列表样式优化 - 清爽版本 */
.knowledge-items-table {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  border: 1px solid #f0f2f5;
}

.knowledge-items-table .ant-table {
  border-radius: 16px;
}

/* 表头样式优化 - 增加分隔线 */
.knowledge-items-table .ant-table-thead > tr > th {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #334155;
  font-weight: 600;
  border: none;
  padding: 18px 16px;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-align: center;
  border-bottom: 2px solid #e2e8f0;
  position: relative;
}

.knowledge-items-table .ant-table-thead > tr > th:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: #cbd5e1;
}

.knowledge-items-table .ant-table-thead > tr > th:first-child {
  border-radius: 16px 0 0 0;
}

.knowledge-items-table .ant-table-thead > tr > th:last-child {
  border-radius: 0 16px 0 0;
}

/* 表格行样式优化 - 增加分隔效果 */
.knowledge-items-table .ant-table-tbody > tr {
  transition: all 0.2s ease-in-out;
  border-bottom: 1px solid #f1f5f9;
}

.knowledge-items-table .ant-table-tbody > tr:hover {
  background: linear-gradient(90deg, #fafbff 0%, #f8fafc 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.knowledge-items-table .ant-table-tbody > tr > td {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  text-align: center;
  position: relative;
}

.knowledge-items-table .ant-table-tbody > tr > td:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: #f1f5f9;
}

/* 知识项数据单元格样式 - 修复自适应问题 */
.knowledge-item-data-cell {
  width: 100%; /* 自适应父容器宽度 */
  text-align: left;
  padding: 6px 0;
}

.knowledge-item-data-preview {
  background: #ffffff;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3b82f6;
  font-size: 12px;
  line-height: 1.4;
  color: #475569;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  word-break: break-word;
  /* 完全自适应容器宽度 */
  width: 100%;
  min-height: 36px;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.knowledge-item-data-preview:hover {
  background: #fafbfc;
  border-left-color: #2563eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

/* 操作按钮样式优化 - 更紧凑 */
.knowledge-item-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.knowledge-item-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid #e5e7eb;
  cursor: pointer;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.knowledge-item-action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.4s ease;
}

.knowledge-item-action-btn:hover::before {
  left: 100%;
}

.knowledge-item-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.knowledge-item-action-btn.view-btn {
  color: #3b82f6;
}

.knowledge-item-action-btn.view-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.knowledge-item-action-btn.delete-btn {
  color: #ef4444;
}

.knowledge-item-action-btn.delete-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.knowledge-item-action-btn.reprocess-btn {
  color: #10b981;
}

.knowledge-item-action-btn.reprocess-btn:hover {
  background: #f0fdf4;
  border-color: #10b981;
  color: #059669;
}

/* ID 单元格样式 - 更紧凑 */
.knowledge-item-id {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 10px;
  color: #64748b;
  border: 1px solid #e2e8f0;
  display: inline-block;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 简洁的数据量显示样式 */
.knowledge-item-count-simple {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  display: inline-block;
  min-width: 32px;
  text-align: center;
  transition: all 0.2s ease;
}

.knowledge-item-count-simple:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* 时间显示样式 - 更紧凑 */
.knowledge-item-time {
  font-size: 10px;
  color: #64748b;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 4px 6px;
  border-radius: 6px;
  border-left: 2px solid #94a3b8;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: inline-block;
  line-height: 1.2;
}

/* 加载状态优化 */
.knowledge-items-loading {
  padding: 60px 0;
  text-align: center;
  background: #fafbfc;
  border-radius: 16px;
}

.knowledge-items-loading .ant-spin-text {
  color: #64748b;
  margin-top: 12px;
  font-weight: 500;
  font-size: 14px;
}

/* 空状态样式优化 */
.knowledge-items-empty {
  padding: 60px 40px;
  text-align: center;
  background: #fafbfc;
  border-radius: 16px;
  margin: 20px 0;
  border: 1px dashed #cbd5e1;
}

.knowledge-items-empty .ant-empty-description {
  color: #64748b;
  font-weight: 500;
  font-size: 14px;
}

/* 分页器样式优化 */
.knowledge-items-table .ant-pagination {
  margin-top: 20px;
  text-align: center;
}

.knowledge-items-table .ant-pagination-total-text {
  color: #64748b;
  font-size: 13px;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .knowledge-items-table .ant-table-thead > tr > th {
    padding: 12px 8px;
    font-size: 12px;
  }
  
  .knowledge-items-table .ant-table-tbody > tr > td {
    padding: 12px 8px;
  }
  
  .knowledge-item-actions {
    flex-direction: column;
    gap: 6px;
  }
  
  .knowledge-item-action-btn {
    width: 28px;
    height: 28px;
  }

  .knowledge-item-data-cell {
    max-width: 200px;
  }

  .knowledge-item-data-preview {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* 知识库详情页面样式 */
.knowledge-detail-container {
  padding: 24px;
  background: #f5f7fa;
  min-height: 100vh;
}

.knowledge-detail-header {
  margin-bottom: 24px;
}

.knowledge-header-content {
  padding: 20px 24px;
}

.knowledge-header-nav {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.knowledge-nav-divider {
  margin: 0 16px;
  height: 20px;
}

.knowledge-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
}

.knowledge-breadcrumb-item {
  color: #6b7280;
  font-size: 14px;
}

.knowledge-breadcrumb-current {
  color: #1f2937;
  font-size: 14px;
  font-weight: 500;
}

.knowledge-breadcrumb-separator {
  color: #d1d5db;
  font-size: 14px;
}

.knowledge-header-info {
  margin-top: 16px;
}

.knowledge-title-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.knowledge-title-icon {
  color: #1890ff;
  margin-right: 8px;
  flex-shrink: 0;
}

.knowledge-status-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.knowledge-feature-tag {
  display: flex;
  align-items: center;
  gap: 4px;
}

.knowledge-description {
  margin: 0 !important;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

.knowledge-overview-section {
  margin-bottom: 24px;
}

.knowledge-loading-card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.knowledge-loading-content {
  text-align: center;
  padding: 60px 20px;
}

.knowledge-header-section {
  margin-bottom: 24px;
}

.knowledge-header-card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.knowledge-breadcrumb {
  margin-bottom: 16px;
}

.knowledge-breadcrumb .ant-breadcrumb-link {
  color: #6b7280;
  font-size: 14px;
}

.knowledge-breadcrumb .ant-breadcrumb-link:hover {
  color: #1890ff;
}

.knowledge-title-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.knowledge-title-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.knowledge-title {
  margin: 0 !important;
  color: #1f2937;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.3;
}

.knowledge-status-tag {
  font-weight: 500;
}

.knowledge-ocr-badge {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
}

/* 返回按钮样式 */
.knowledge-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
  border-radius: 6px;
  padding: 6px 12px;
  margin: 0 0 16px 0 !important;
}

.knowledge-back-btn:hover {
  color: #1890ff;
  background: rgba(24, 144, 255, 0.06);
}

.knowledge-info-section {
  margin-bottom: 24px;
}

.knowledge-info-card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.knowledge-info-grid {
  gap: 24px;
}

.knowledge-info-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #fafbfc;
  border-radius: 8px;
  border: 1px solid #f0f2f5;
  transition: all 0.2s ease;
  width: 100%;
  height: 100%;
}

.knowledge-info-item:hover {
  background: #f0f4ff;
  border-color: #d6e4ff;
}

.knowledge-info-icon {
  color: #1890ff;
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
}

.knowledge-info-content {
  flex: 1;
  min-width: 0;
}

.knowledge-info-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.knowledge-info-value {
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.3;
  flex: 1;
}

.knowledge-content-section {
  margin-bottom: 24px;
}

.knowledge-content-card {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.knowledge-tabs .ant-tabs-tab {
  padding: 12px 20px;
  font-weight: 500;
}

.knowledge-tab-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.knowledge-tab-icon {
  font-size: 16px;
}

.knowledge-items-section,
.knowledge-search-section {
  padding: 8px 0;
}

.knowledge-items-header,
.knowledge-search-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f2f5;
}

.knowledge-items-title,
.knowledge-search-header {
  flex: 1;
}

.knowledge-section-title {
  margin: 0 0 8px 0 !important;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

.knowledge-section-icon {
  color: #1890ff;
  font-size: 18px;
}

.knowledge-section-desc {
  margin: 0 !important;
  color: #6b7280;
  font-size: 14px;
}

.knowledge-items-actions {
  flex-shrink: 0;
}

.knowledge-import-btn {
  border-radius: 8px;
  height: 40px;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.knowledge-import-btn:hover {
  box-shadow: 0 4px 8px rgba(24, 144, 255, 0.3);
  transform: translateY(-1px);
}

.knowledge-items-table-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.knowledge-items-table .ant-table-thead > tr > th {
  background: #fafbfc;
  border-bottom: 2px solid #f0f2f5;
  color: #374151;
  font-weight: 600;
}

.knowledge-items-table .ant-table-tbody > tr:hover > td {
  background: #f0f4ff;
}

.knowledge-pagination .ant-pagination-item {
  border-radius: 6px;
}

.knowledge-items-empty {
  padding: 40px 20px;
}

.knowledge-search-input {
  margin-bottom: 24px;
}

.knowledge-search-bar .ant-input-search {
  border-radius: 8px;
}

.knowledge-search-bar .ant-btn {
  border-radius: 0 8px 8px 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.knowledge-search-loading {
  text-align: center;
  padding: 60px 20px;
}

.knowledge-search-stats {
  margin-bottom: 16px;
}

.knowledge-search-count {
  font-weight: 500;
  border-radius: 6px;
}

.knowledge-search-results-list {
  space-y: 12px;
}

.knowledge-search-result-card {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.knowledge-search-result-card:hover {
  border-color: #1890ff;
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.1);
}

.knowledge-search-result-content {
  padding: 4px 0;
}

.knowledge-search-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.knowledge-search-result-icon {
  color: #1890ff;
  font-size: 16px;
}

.knowledge-search-result-title {
  color: #1f2937;
  font-weight: 600;
  font-size: 14px;
}

.knowledge-search-result-body {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
}

.knowledge-search-empty {
  text-align: center;
  padding: 60px 20px;
}

.knowledge-search-empty-tip {
  margin-top: 12px !important;
  color: #6b7280;
  font-size: 14px;
}
