/* Settings Panel */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
}

.settings-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.settings-content {
  position: relative;
  width: 400px;
  max-width: 90vw;
  background: white;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Header */
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.settings-header h2 {
  margin: 0;
  color: #1e293b;
  font-size: 1.25rem;
  font-weight: 600;
}

.close-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
}

.close-button:hover {
  background: #e2e8f0;
  color: #475569;
}

/* Tabs */
.settings-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.tab-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.tab-button:hover {
  color: #475569;
  background: #f1f5f9;
}

.tab-button.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: white;
}

/* Body */
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-section h3 {
  margin: 0 0 0.5rem 0;
  color: #1e293b;
  font-size: 1.125rem;
  font-weight: 600;
}

.section-description {
  margin: 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Setting Groups */
.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.setting-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

/* Background Options */
.background-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.background-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.background-option:hover {
  border-color: #cbd5e1;
}

.background-option.selected {
  border-color: #667eea;
  background: #f0f4ff;
}

.background-preview {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.background-option span {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

/* Image Options */
.image-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.image-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-option:hover {
  border-color: #cbd5e1;
}

.image-option.selected {
  border-color: #667eea;
  background: #f0f4ff;
}

.image-option img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.image-option span {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

/* Option Buttons */
.option-buttons {
  display: flex;
  gap: 0.5rem;
}

.option-button {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.option-button:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.option-button.selected {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

/* Toggle Buttons */
.setting-toggles {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-item label {
  font-size: 0.875rem;
  color: #374151;
  font-weight: 500;
}

.toggle-button {
  width: 48px;
  height: 24px;
  border-radius: 12px;
  background: #cbd5e1;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.toggle-button.active {
  background: #667eea;
}

.toggle-slider {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-button.active .toggle-slider {
  transform: translateX(24px);
}

/* Voice Settings */
.voice-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.voice-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.speed-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.speed-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.speed-slider::-webkit-slider-thumb:hover {
  background: #5a67d8;
  transform: scale(1.1);
}

.speed-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* General Settings */
.api-endpoint-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.875rem;
  color: #64748b;
  font-family: 'Monaco', 'Menlo', monospace;
}

.version-info {
  padding: 1rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.version-info p {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
  .settings-content {
    width: 100vw;
    max-width: none;
  }
  
  .settings-header {
    padding: 1rem 1.5rem;
  }
  
  .settings-body {
    padding: 1.5rem;
  }
  
  .background-options {
    grid-template-columns: 1fr;
  }
  
  .image-options {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .option-buttons {
    flex-direction: column;
  }
}

/* Scrollbar */
.settings-body::-webkit-scrollbar {
  width: 6px;
}

.settings-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.settings-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.settings-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 设置面板底部 */
.settings-footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.changes-indicator {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  font-size: 14px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.changes-indicator::before {
  content: '⚠️';
  font-size: 16px;
}

.footer-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.cancel-button,
.confirm-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  min-width: 100px;
  justify-content: center;
}

.cancel-button {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.cancel-button:hover {
  background: #e2e8f0;
  color: #475569;
}

.confirm-button {
  background: #3b82f6;
  color: white;
  border: 1px solid #3b82f6;
}

.confirm-button:hover:not(:disabled) {
  background: #2563eb;
  border-color: #2563eb;
}

.confirm-button:disabled {
  background: #9ca3af;
  border-color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
} 