/* Phase 3: 批处理模式 - 结果展示样式 */

.batch-results {
  display: flex;
  flex-direction: column;
  background: #fff;
}

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

.results-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #262626;
}

.title-icon {
  font-size: 20px;
}

.results-summary {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: #fafafa;
  border-bottom: 1px solid #e8e8e8;
  flex-wrap: wrap;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.summary-label {
  color: #8c8c8c;
}

.summary-value {
  color: #262626;
  font-weight: 500;
}

.summary-value.success-text {
  color: #52c41a;
}

.summary-value.failed-text {
  color: #ff4d4f;
}

.results-table {
  margin-top: 20px;
  overflow-x: auto; /* 允许横向滚动 */
  width: 100%;
}

/* 预设表格样式 */
.preset-table {
  width: 100%;
  overflow: visible; /* 让表格自己处理滚动 */
}

.preset-table .ant-table {
  font-size: 13px;
}

.preset-table .ant-table-container {
  overflow-x: auto !important; /* 强制横向滚动 */
}

/* Ant Design 表格内部滚动条美化 */
.preset-table .ant-table-body::-webkit-scrollbar,
.preset-table .ant-table-container::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.preset-table .ant-table-body::-webkit-scrollbar-track,
.preset-table .ant-table-container::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 5px;
}

.preset-table .ant-table-body::-webkit-scrollbar-thumb,
.preset-table .ant-table-container::-webkit-scrollbar-thumb {
  background: #bfbfbf;
  border-radius: 5px;
}

.preset-table .ant-table-body::-webkit-scrollbar-thumb:hover,
.preset-table .ant-table-container::-webkit-scrollbar-thumb:hover {
  background: #8c8c8c;
}

.preset-table .ant-table-thead > tr > th {
  background: #fafafa;
  font-weight: 600;
  padding: 12px 8px;
}

.preset-table .ant-table-tbody > tr > td {
  padding: 12px 8px;
  vertical-align: top; /* 顶部对齐，适合多行内容 */
}

.preset-table .table-cell-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 新增：支持换行的单元格 */
.preset-table .table-cell-wrap {
  white-space: pre-wrap; /* 保留换行，自动换行 */
  word-break: break-word; /* 允许单词内断行 */
  line-height: 1.6;
  font-size: 13px;
  color: #262626;
  max-height: 200px; /* 限制最大高度 */
  overflow-y: auto; /* 超出显示滚动条 */
  padding: 4px 0;
}

/* 单元格内滚动条美化 */
.preset-table .table-cell-wrap::-webkit-scrollbar {
  width: 4px;
}

.preset-table .table-cell-wrap::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 2px;
}

.preset-table .table-cell-wrap::-webkit-scrollbar-thumb {
  background: #bfbfbf;
  border-radius: 2px;
}

.preset-table .table-cell-wrap::-webkit-scrollbar-thumb:hover {
  background: #8c8c8c;
}

.preset-table .doc-name {
  font-weight: 500;
  word-break: break-all; /* 文件名可以断行 */
  line-height: 1.4;
}

/* 紧凑型文献名称显示 */
.preset-table .doc-name-compact {
  font-weight: 500;
  font-size: 12px;
  line-height: 1.3;
  color: #595959;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* 最多显示2行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  max-height: 32px; /* 约2行的高度 */
}

/* 自定义表格样式 */
.custom-table .doc-name {
  font-weight: 500;
  color: #262626;
}

.custom-table .result-text {
  font-size: 13px;
  line-height: 1.6;
  color: #595959;
}

.custom-table .text-preview {
  white-space: pre-wrap;
  word-break: break-word;
}

.custom-table .text-ellipsis {
  color: #bfbfbf;
  margin: 0 4px;
}

.custom-table .view-full-link {
  color: #1890ff;
  margin-left: 8px;
  cursor: pointer;
}

.custom-table .view-full-link:hover {
  text-decoration: underline;
}

.custom-table .error-message {
  color: #ff4d4f;
  font-size: 13px;
}

/* 详情模态框 */
.result-detail-modal .result-detail {
  max-height: 60vh;
  overflow-y: auto;
}

.result-detail .detail-section {
  margin-bottom: 16px;
}

.result-detail .section-title {
  font-weight: 600;
  color: #262626;
  margin-bottom: 8px;
}

.result-detail .section-content {
  font-size: 14px;
  line-height: 1.8;
  color: #595959;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  background: #fafafa;
  border-radius: 4px;
}

.result-detail .detail-meta {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
}

