/* Knowledge Base Management 组件专用样式 */

.knowledge-base-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.knowledge-base-container.drag-over {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  box-shadow: inset 0 0 50px rgba(66, 153, 225, 0.3);
}

/* 拖拽覆盖层 */
.kb-drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(66, 153, 225, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.kb-drag-overlay-content {
  text-align: center;
  color: white;
  padding: 3rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.kb-drag-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 1s infinite;
}

.kb-drag-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.kb-drag-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* 背景装饰效果 */
.knowledge-base-container::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -40%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  border-radius: 50%;
  animation: float 20s infinite ease-in-out;
}

.knowledge-base-container::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -40%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
  border-radius: 50%;
  animation: float 25s infinite ease-in-out reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -30px) rotate(120deg); }
  66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.knowledge-base-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
}

/* 页面标题区域 */
.kb-header {
  text-align: center;
  margin-bottom: 3rem;
}

.kb-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
}

.kb-title-icon:hover {
  transform: scale(1.05);
}

.kb-title-icon span {
  font-size: 2rem;
}

.kb-title {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.kb-subtitle {
  font-size: 1.25rem;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  opacity: 0.9;
}

/* 统计卡片 */
.kb-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.kb-stat-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.kb-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kb-stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.kb-stat-card:hover::before {
  opacity: 1;
}

.kb-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.kb-stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kb-stat-icon.blue { background: linear-gradient(135deg, #4299e1, #3182ce); }
.kb-stat-icon.green { background: linear-gradient(135deg, #48bb78, #38a169); }
.kb-stat-icon.purple { background: linear-gradient(135deg, #9f7aea, #805ad5); }
.kb-stat-icon.orange { background: linear-gradient(135deg, #ed8936, #dd6b20); }

.kb-stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.kb-stat-label {
  font-size: 0.9rem;
  color: #4a5568;
  font-weight: 500;
}

.kb-stat-progress {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  margin-top: 1rem;
  overflow: hidden;
}

.kb-stat-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4299e1, #3182ce);
  border-radius: 3px;
  transition: width 1s ease;
}

.kb-stat-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #4a5568;
}

.kb-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.kb-status-dot.green { background: #48bb78; }
.kb-status-dot.red { background: #f56565; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 上传区域 */
.kb-upload-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.kb-upload-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.kb-upload-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #48bb78, #38a169);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kb-upload-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.kb-upload-subtitle {
  color: #718096;
  font-size: 0.9rem;
}

.kb-format-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.kb-format-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.kb-format-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kb-format-tag.txt { background: linear-gradient(135deg, #e3f2fd, #bbdefb); color: #1565c0; }
.kb-format-tag.md { background: linear-gradient(135deg, #e8f5e8, #c8e6c9); color: #2e7d32; }
.kb-format-tag.pdf { background: linear-gradient(135deg, #ffebee, #ffcdd2); color: #c62828; }
.kb-format-tag.docx { background: linear-gradient(135deg, #f3e5f5, #e1bee7); color: #7b1fa2; }

.kb-upload-zone {
  border: 3px dashed #cbd5e0;
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  background: linear-gradient(135deg, #f7fafc, #edf2f7);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.kb-upload-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(66, 153, 225, 0.1), rgba(129, 140, 248, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kb-upload-zone:hover {
  border-color: #4299e1;
  background: linear-gradient(135deg, #ebf8ff, #e6fffa);
  transform: scale(1.02);
}

.kb-upload-zone:hover::before {
  opacity: 1;
}

.kb-upload-zone-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.kb-upload-zone:hover .kb-upload-zone-icon {
  transform: scale(1.1) rotate(5deg);
}

.kb-upload-zone-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.kb-upload-zone-subtitle {
  color: #718096;
  margin-bottom: 1.5rem;
}

.kb-upload-zone-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kb-upload-zone-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 选中文件列表 */
.kb-selected-files {
  background: linear-gradient(135deg, #f0fff4, #e6fffa);
  border-radius: 20px;
  padding: 1.5rem;
  margin-top: 2rem;
  border: 2px solid #48bb78;
}

.kb-selected-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.kb-selected-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #48bb78, #38a169);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  font-weight: bold;
}

.kb-selected-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #22543d;
}

.kb-selected-badge {
  margin-left: auto;
  padding: 0.25rem 0.75rem;
  background: #c6f6d5;
  color: #22543d;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.kb-file-list {
  display: grid;
  gap: 1rem;
}

.kb-file-item {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.kb-file-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kb-file-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.kb-file-info {
  flex: 1;
  min-width: 0;
}

.kb-file-name {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-file-meta {
  display: flex;
  gap: 0.75rem;
}

.kb-file-size {
  font-size: 0.8rem;
  color: #718096;
  background: #e2e8f0;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.kb-file-status {
  font-size: 0.8rem;
  color: #22543d;
  background: #c6f6d5;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
}

.kb-file-check {
  width: 32px;
  height: 32px;
  background: #c6f6d5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22543d;
  font-size: 0.9rem;
  font-weight: bold;
}

/* 操作按钮 */
.kb-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.kb-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.kb-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kb-button:hover::before {
  opacity: 1;
}

.kb-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.kb-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.kb-button.primary {
  background: linear-gradient(135deg, #4299e1, #3182ce);
  color: white;
}

.kb-button.secondary {
  background: linear-gradient(135deg, #718096, #4a5568);
  color: white;
}

.kb-button.danger {
  background: linear-gradient(135deg, #f56565, #e53e3e);
  color: white;
}

/* 文档列表 */
.kb-documents-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow-x: auto;
  overflow-y: visible;
}

.kb-documents-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.kb-documents-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kb-documents-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #9f7aea, #805ad5);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kb-documents-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.kb-documents-subtitle {
  color: #718096;
  font-size: 0.9rem;
}

/* 加载状态 */
.kb-loading {
  text-align: center;
  padding: 4rem;
}

.kb-loading-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 2rem;
  position: relative;
}

.kb-loading-spinner {
  width: 100%;
  height: 100%;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #4299e1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.kb-loading-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.kb-loading-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.kb-loading-subtitle {
  color: #718096;
  margin-bottom: 1.5rem;
}

.kb-loading-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.kb-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.kb-loading-dot:nth-child(1) { background: #4299e1; animation-delay: -0.32s; }
.kb-loading-dot:nth-child(2) { background: #9f7aea; animation-delay: -0.16s; }
.kb-loading-dot:nth-child(3) { background: #f56565; }

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  } 40% {
    transform: scale(1);
  }
}

/* 空状态 */
.kb-empty {
  text-align: center;
  padding: 5rem 2rem;
}

.kb-empty-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
  position: relative;
}

.kb-empty-circle {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e6fffa, #b2f5ea);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-soft 3s infinite ease-in-out;
}

.kb-empty-circle span {
  font-size: 3rem;
  animation: bounce-soft 2s infinite ease-in-out;
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes bounce-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.kb-empty-title {
  font-size: 2rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 1rem;
}

.kb-empty-subtitle {
  font-size: 1.25rem;
  color: #718096;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.kb-empty-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.kb-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.kb-empty-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.kb-empty-cta span:first-child {
  font-size: 1.25rem;
  animation: bounce-soft 2s infinite ease-in-out;
}

/* 文档表格容器 */
.kb-table-container {
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 8px;
  background: #ffffff;
}

.kb-table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.kb-table-container::-webkit-scrollbar-track {
  background: #f8f9fa;
  border-radius: 4px;
}

.kb-table-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.kb-table-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.kb-table-container::-webkit-scrollbar-corner {
  background: #f8f9fa;
}

/* 文档表格 */
.kb-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.kb-table thead {
  background: linear-gradient(135deg, #f7fafc, #edf2f7);
  position: sticky;
  top: 0;
  z-index: 10;
}

.kb-table th {
  padding: 1.5rem;
  text-align: left;
  font-weight: 600;
  color: #4a5568;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}

.kb-table th:first-child { text-align: left; }
.kb-table th:not(:first-child) { text-align: center; }

.kb-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.kb-table tbody tr:hover {
  background: linear-gradient(135deg, #f7fafc, #edf2f7);
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.kb-table td {
  padding: 2rem 1.5rem;
  vertical-align: middle;
}

.kb-doc-cell {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.kb-doc-icon-wrapper {
  position: relative;
}

.kb-doc-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #4299e1, #3182ce);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.kb-table tbody tr:hover .kb-doc-icon {
  transform: scale(1.1) rotate(5deg);
}

.kb-doc-number {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #48bb78, #38a169);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.kb-doc-info {
  flex: 1;
  min-width: 0;
}

.kb-doc-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

.kb-table tbody tr:hover .kb-doc-name {
  color: #4299e1;
}

.kb-doc-meta {
  display: flex;
  gap: 0.75rem;
}

.kb-doc-id {
  font-size: 0.8rem;
  color: #718096;
  background: #e2e8f0;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: monospace;
}

.kb-doc-status {
  font-size: 0.8rem;
  color: #22543d;
  background: #c6f6d5;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
}

.kb-cell-center {
  text-align: center;
}

.kb-file-size-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.25rem;
}

.kb-file-size-label {
  font-size: 0.8rem;
  color: #718096;
}

.kb-chunks-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #e6fffa, #b2f5ea);
  color: #234e52;
  border-radius: 20px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.kb-table tbody tr:hover .kb-chunks-badge {
  background: linear-gradient(135deg, #b2f5ea, #9ae6b4);
  transform: scale(1.05);
}

.kb-chunks-dot {
  width: 8px;
  height: 8px;
  background: #48bb78;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.kb-date-display {
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 0.25rem;
}

.kb-date-label {
  font-size: 0.8rem;
  color: #718096;
}

.kb-delete-button {
  position: relative;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #fed7d7, #feb2b2);
  color: #c53030;
  border: 2px solid #fed7d7;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.kb-delete-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f56565, #e53e3e);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kb-delete-button:hover {
  color: white;
  border-color: #f56565;
  transform: scale(1.05);
}

.kb-delete-button:hover::before {
  opacity: 1;
}

.kb-delete-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kb-delete-content span:first-child {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.kb-delete-button:hover .kb-delete-content span:first-child {
  animation: bounce-soft 0.6s ease-in-out;
}

/* 处理状态显示 */
.kb-processing-status {
  margin-top: 1rem;
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 2px solid;
}

.kb-processing-status.pending {
  background: linear-gradient(135deg, #fef5e7, #fed7aa);
  border-color: #f6ad55;
  color: #744210;
}

.kb-processing-status.reading {
  background: linear-gradient(135deg, #e6fffa, #b2f5ea);
  border-color: #4299e1;
  color: #1e4a8c;
}

.kb-processing-status.completed {
  background: linear-gradient(135deg, #f0fff4, #c6f6d5);
  border-color: #48bb78;
  color: #22543d;
}

.kb-processing-status.failed {
  background: linear-gradient(135deg, #fed7d7, #feb2b2);
  border-color: #f56565;
  color: #c53030;
}

.kb-processing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.kb-processing-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.kb-processing-percentage {
  font-weight: 600;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.kb-processing-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.kb-processing-progress {
  height: 100%;
  background: linear-gradient(90deg, #4299e1, #3182ce);
  border-radius: 4px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(66, 153, 225, 0.4);
}

.kb-processing-chunks {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.4);
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  display: inline-block;
}

.kb-chunks-info {
  margin-bottom: 0.5rem;
}

.kb-chunks-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.kb-chunks-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4299e1, #3182ce);
  border-radius: 3px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(66, 153, 225, 0.6);
}

/* 知识库滚动条美化 */
.knowledge-base-container::-webkit-scrollbar {
  width: 8px;
}

.knowledge-base-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.knowledge-base-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.knowledge-base-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.kb-documents-section::-webkit-scrollbar {
  height: 6px;
}

.kb-documents-section::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.kb-documents-section::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
  transition: background 0.3s ease;
}

.kb-documents-section::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .knowledge-base-content {
    padding: 1rem;
    min-height: calc(100vh - 2rem);
  }
  
  .kb-title {
    font-size: 2rem;
  }
  
  .kb-stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .kb-stat-card,
  .kb-upload-section,
  .kb-documents-section {
    padding: 1.5rem;
  }
  
  .kb-action-buttons {
    flex-direction: column;
  }
  
  .kb-button {
    justify-content: center;
  }
  
  .kb-table-container {
    max-height: 50vh;
  }
  
  .kb-table {
    font-size: 0.9rem;
    min-width: 600px;
  }
  
  .kb-table th,
  .kb-table td {
    padding: 1rem 0.75rem;
  }
  
  .kb-doc-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  
  .kb-doc-cell {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .knowledge-base-content {
    padding: 0.75rem;
    min-height: calc(100vh - 1.5rem);
  }
  
  .kb-title {
    font-size: 1.5rem;
  }
  
  .kb-subtitle {
    font-size: 1rem;
  }
  
  .kb-upload-zone {
    padding: 2rem 1rem;
  }
  
  .kb-format-tags {
    justify-content: center;
  }
  
  .kb-table-container {
    max-height: 45vh;
  }
  
  .kb-table {
    min-width: 500px;
    font-size: 0.8rem;
  }
  
  .kb-documents-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}