.rag-repository-manager {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #2D2D2D 0%, #252525 100%);
  color: #E0E0E0;
}

.rag-repo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #404040;
}

.rag-repo-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #E0E0E0;
}

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

.create-repo-btn {
  padding: 8px 16px;
  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;
  display: flex;
  align-items: center;
  gap: 8px;
}

.create-repo-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #00C46B 0%, #00A85A 100%);
  transform: translateY(-1px);
}

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

.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;
}

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

.rag-repo-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  height: calc(100% - 80px);
  overflow: hidden;
}

.repo-list-panel,
.file-list-panel {
  background: linear-gradient(135deg, #3C3C3C 0%, #333333 100%);
  border: 1px solid #444444;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.repo-list-panel h4,
.file-list-panel h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #E0E0E0;
  border-bottom: 1px solid #555555;
  padding-bottom: 10px;
}

.repo-list,
.file-list {
  flex: 1;
  overflow-y: auto;
}

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

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

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

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

.repo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: #2D2D2D;
  border: 1px solid #444444;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.repo-item:hover {
  border-color: #00AD62;
  background: #333333;
}

.repo-item.selected {
  border-color: #00AD62;
  background: linear-gradient(135deg, #2D2D2D 0%, #1E7B4F 100%);
}

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

.repo-name {
  font-weight: 600;
  color: #efebeb;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.repo-details {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #B0B0B0;
  flex-wrap: wrap;
}

.file-count,
.embedding-model {
  background: #1E1E1E;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #444444;
}

.repo-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

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

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

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.add-file-btn {
  padding: 6px 12px;
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.add-file-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 100%);
  transform: translateY(-1px);
}

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

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  background: #2D2D2D;
  border: 1px solid #444444;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.file-item:hover {
  border-color: #00AD62;
  background: #333333;
}

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

.file-name {
  font-weight: 600;
  color: #efebeb;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.file-details {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #B0B0B0;
}

.document-count,
.file-size {
  background: #1E1E1E;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #444444;
}

.file-actions {
  flex-shrink: 0;
}

.no-repo-selected {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #808080;
  text-align: center;
}

.no-repo-selected svg {
  margin-bottom: 15px;
  opacity: 0.6;
}

.loading-state,
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #808080;
  font-style: italic;
}

.empty-state {
  background: linear-gradient(135deg, #3C3C3C 0%, #333333 100%);
  border-radius: 8px;
  border: 2px dashed #555555;
}

.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;
}

.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;
}

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.create-repo-modal {
  background: #2D2D2D;
  border: 1px solid #444444;
  border-radius: 8px;
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

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

.modal-header button {
  background: none;
  border: none;
  color: #B0B0B0;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-header button:hover {
  color: #E0E0E0;
}

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

.form-group {
  margin-bottom: 15px;
}

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

.form-group input {
  width: 100%;
  padding: 8px 12px;
  background: #1E1E1E;
  color: #E0E0E0;
  border: 1px solid #555555;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #00AD62;
}

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

.modal-actions {
  padding: 20px;
  border-top: 1px solid #444444;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #333333;
}

.modal-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.modal-actions button:first-child {
  background: #555555;
  color: #E0E0E0;
}

.modal-actions button:first-child:hover {
  background: #666666;
}

.modal-actions button:last-child {
  background: #00AD62;
  color: white;
}

.modal-actions button:last-child:hover:not(:disabled) {
  background: #00C46B;
}

.modal-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .rag-repo-layout {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .rag-repo-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .create-repo-modal {
    width: 95vw;
    margin: 10px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* 模型选择器样式 */
.model-selector-container {
  position: relative;
  width: 100%;
  min-height: 500px; /* 为平级布局提供足够高度 */
}

.model-selector-button {
  width: 100%;
  padding: 8px 12px;
  background: #1E1E1E;
  color: #E0E0E0;
  border: 1px solid #555555;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.model-selector-button:hover {
  border-color: #00AD62;
}

.model-selector-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #2D2D2D;
  border: 1px solid #555555;
  border-radius: 4px;
  margin-top: 4px;
  z-index: 1000;
  max-height: 800px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 嵌入模型选择器面板样式 */
.embedding-model-selector-panel {
  background: #2D2D2D;
  color: #E0E0E0;
  max-height: 1000px;
  overflow-y: auto;
}

.embedding-model-filter-section {
  margin-bottom: 15px;
}

.embedding-search-container {
  position: relative;
  margin-bottom: 10px;
}

.embedding-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #B0B0B0;
}

.embedding-search-input {
  width: 100%;
  padding: 8px 12px 8px 35px;
  background: #1E1E1E;
  color: #E0E0E0;
  border: 1px solid #555555;
  border-radius: 4px;
  font-size: 14px;
}

.embedding-search-input:focus {
  outline: none;
  border-color: #00AD62;
}

.embedding-provider-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.embedding-filter-label {
  font-size: 12px;
  color: #B0B0B0;
  white-space: nowrap;
}

.embedding-provider-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.embedding-provider-tag {
  padding: 4px 8px;
  background: #3C3C3C;
  color: #B0B0B0;
  border: 1px solid #555555;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.embedding-provider-tag:hover {
  background: #4A4A4A;
  border-color: #00AD62;
}

.embedding-provider-tag.active {
  background: #00AD62;
  color: white;
  border-color: #00AD62;
}

.embedding-model-list-container {
  max-height: 200px;
  overflow-y: auto;
}

.embedding-model-grid {
  display: grid;
  gap: 8px;
}

.embedding-model-card {
  padding: 10px;
  background: #3C3C3C;
  border: 1px solid #555555;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.embedding-model-card:hover {
  border-color: #00AD62;
  background: #4A4A4A;
}

.embedding-model-card.selected {
  border-color: #00AD62;
  background: linear-gradient(135deg, #2D2D2D 0%, #1E7B4F 100%);
}

.embedding-model-info {
  flex: 1;
}

.embedding-model-name {
  font-weight: 600;
  color: #E0E0E0;
  font-size: 13px;
  margin-bottom: 2px;
}

.embedding-model-provider {
  font-size: 11px;
  color: #B0B0B0;
}

.selected-indicator {
  color: #00AD62;
  font-weight: bold;
}

.embedding-empty-state {
  text-align: center;
  padding: 20px;
  color: #808080;
  font-style: italic;
}

.embedding-search-results-info {
  margin-top: 10px;
  font-size: 12px;
  color: #B0B0B0;
  text-align: center;
}