.knowledge-base-panel {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #2D2D2D 0%, #252525 100%);
  border-left: 1px solid #404040;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}
.kb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #404040;
  background: linear-gradient(90deg, #2D2D2D 0%, #333333 50%, #2D2D2D 100%);
  padding: 15px 20px;
  margin: -20px -20px 20px -20px;
  border-radius: 0;
}

.kb-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #E0E0E0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
}


.kb-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.add-btn {
  padding: 8px;
  background: linear-gradient(135deg, #00AD62 0%, #008C4F 100%);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 173, 98, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.add-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #00C46B 0%, #00A85A 100%);
  box-shadow: 0 4px 12px rgba(0, 173, 98, 0.4);
  transform: translateY(-1px);
}

.add-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 173, 98, 0.3);
}

.add-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #555555 0%, #444444 100%);
  box-shadow: none;
}

.refresh-btn {
  padding: 8px;
  background: #3C3C3C;
  color: #B0B0B0;
  border: 1px solid #555555;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.refresh-btn:hover:not(:disabled) {
  background: #4A4A4A;
  border-color: #00AD62;
  color: #00AD62;
  box-shadow: 0 2px 8px rgba(0, 173, 98, 0.2);
}

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

.close-btn {
  padding: 8px;
  background: #3C3C3C;
  color: #B0B0B0;
  border: 1px solid #555555;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.close-btn:hover {
  background: #4A4A4A;
  border-color: #00AD62;
  color: #00AD62;
  box-shadow: 0 2px 8px rgba(0, 173, 98, 0.2);
}

.error-message {
  background: linear-gradient(135deg, #4A4A4A 0%, #3C3C3C 100%);
  color: #E0E0E0;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #555555;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.error-message::before {
  content: "⚠️";
  margin-right: 10px;
  font-size: 16px;
}

.error-message button {
  padding: 6px 12px;
  background: #555555;
  color: #E0E0E0;
  border: 1px solid #666666;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.error-message button:hover {
  background: #00AD62;
  border-color: #00AD62;
  color: white;
}

.kb-file-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}

.kb-file-list::-webkit-scrollbar {
  width: 6px;
}

.kb-file-list::-webkit-scrollbar-track {
  background: #2D2D2D;
  border-radius: 3px;
}

.kb-file-list::-webkit-scrollbar-thumb {
  background: #555555;
  border-radius: 3px;
}

.kb-file-list::-webkit-scrollbar-thumb:hover {
  background: #00AD62;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #808080;
  font-style: italic;
  background: linear-gradient(135deg, #3C3C3C 0%, #333333 100%);
  border-radius: 12px;
  border: 2px dashed #555555;
  margin: 20px 0;
}

.empty-state::before {
  content: "📁";
  font-size: 48px;
  display: block;
  margin-bottom: 15px;
  opacity: 0.6;
}

.kb-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  margin: 10px 0 10px 0;
  background: linear-gradient(135deg, #3C3C3C 0%, #333333 100%);
  border: 1px solid #444444;
  border-radius: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.kb-file-item:hover {
  border-color: #00AD62;
  box-shadow: 0 4px 12px rgba(0, 173, 98, 0.2);
  transform: translateY(-2px);
  background: linear-gradient(135deg, #444444 0%, #3A3A3A 100%);
}

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

.file-name {
  font-weight: 600;
  color: #efebeb;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.file-details {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #131212;
  flex-wrap: wrap;
}

.document-count {
  display: flex;
  align-items: center;
  background: #090909;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid #444444;
}

.document-count::before {
  content: "📄";
  margin-right: 6px;
  font-size: 12px;
}

.create-time {
  display: flex;
  align-items: center;
  background: #2D2D2D;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid #444444;
}

.create-time::before {
  content: "🕒";
  margin-right: 6px;
  font-size: 12px;
}

.file-actions {
  flex-shrink: 0;
  margin-left: 16px;
}
.info-btn {
  padding: 6px 12px;
  background: #3a3f4b;
  color: #abb2bf;
  border: 1px solid #5c6370;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  margin-right: 8px;
}

.info-btn:hover:not(:disabled) {
  background: #4a4f5b;
  border-color: #00AD62;
  color: #00AD62;
}

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

.rename-btn {
  padding: 6px 12px;
  background: #3a3f4b;
  color: #abb2bf;
  border: 1px solid #5c6370;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  margin-right: 8px;
}

.rename-btn:hover:not(:disabled) {
  background: #4a4f5b;
  border-color: #00AD62;
  color: #00AD62;
}

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

.delete-btn {
  padding: 6px 12px;
  background: #3a3f4b;
  color: #abb2bf;
  border: 1px solid #5c6370;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.delete-btn:hover:not(:disabled) {
  background: #4a4f5b;
  border-color: #00AD62;
  color: #00AD62;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
  .knowledge-base-panel {
    padding: 12px;
  }
  
  .kb-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .kb-file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .file-actions {
    margin-left: 0;
    align-self: flex-end;
  }
  
  .file-details {
    flex-direction: column;
    gap: 4px;
  }
}
