.settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.settings-window {
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 800px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg) var(--spacing-xl);
  border-bottom: 1px solid var(--color-border-default);
  background-color: var(--color-bg-elevated);
}

.settings-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--color-text-primary);
}

.settings-title h2 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.settings-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.settings-close-btn:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.settings-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.settings-sidebar {
  width: 220px;
  background-color: var(--color-bg-elevated);
  border-right: 1px solid var(--color-border-default);
  overflow-y: auto;
  flex-shrink: 0;
}

.settings-sidebar::-webkit-scrollbar {
  width: 8px;
}

.settings-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.settings-sidebar::-webkit-scrollbar-thumb {
  background: rgba(121, 121, 121, 0.3);
  border-radius: 4px;
}

.settings-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 100, 0.5);
}

.settings-category-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--spacing-md) var(--spacing-lg);
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  position: relative;
}

.settings-category-btn:hover {
  background-color: var(--color-bg-hover);
}

.settings-category-btn.active {
  background-color: var(--color-bg-base);
  border-left-color: var(--color-primary);
}

.settings-category-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.settings-category-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.settings-category-arrow {
  position: absolute;
  right: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-tertiary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.settings-category-btn.active .settings-category-arrow {
  opacity: 1;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-xl);
}

.settings-content::-webkit-scrollbar {
  width: 14px;
}

.settings-content::-webkit-scrollbar-track {
  background: transparent;
}

.settings-content::-webkit-scrollbar-thumb {
  background: rgba(121, 121, 121, 0.4);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.settings-content::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 100, 0.7);
  background-clip: padding-box;
}

.settings-section {
  margin-bottom: var(--spacing-2xl);
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0 0 var(--spacing-md) 0;
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border-subtle);
}

.settings-section-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: var(--spacing-sm) 0 var(--spacing-md) 0;
}

.settings-field {
  margin-bottom: var(--spacing-lg);
}

.settings-field:last-child {
  margin-bottom: 0;
}

.settings-label {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
}

.settings-label-checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-bottom: 0;
}

.settings-label-checkbox span:first-of-type {
  font-weight: var(--font-weight-medium);
}

.settings-hint {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-tertiary);
  margin-top: 2px;
}

.settings-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-bg-inset);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-family: var(--font-family-mono);
  transition: all var(--transition-fast);
}

.settings-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-bg-base);
}

.settings-input:hover:not(:focus) {
  border-color: var(--color-border-strong);
}

.settings-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-md);
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: 1px solid var(--color-border-default);
  background-color: var(--color-bg-elevated);
}

.settings-btn {
  padding: var(--spacing-sm) var(--spacing-lg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-btn-cancel {
  background-color: var(--color-bg-hover);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-default);
}

.settings-btn-cancel:hover {
  background-color: var(--color-bg-inset);
  border-color: var(--color-border-strong);
}

.settings-btn-save {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.settings-btn-save:hover {
  background-color: var(--color-primary-hover);
}

.settings-btn-save:active {
  transform: scale(0.98);
}

.settings-select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-bg-inset);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-select:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-bg-base);
}

.settings-select:hover:not(:focus) {
  border-color: var(--color-border-strong);
}

.settings-range-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.settings-range {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--color-bg-inset);
  outline: none;
  -webkit-appearance: none;
}

.settings-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.settings-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.settings-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: none;
  transition: transform var(--transition-fast);
}

.settings-range::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.settings-range-value {
  min-width: 40px;
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  font-family: var(--font-family-mono);
}

.settings-color-input {
  width: 60px;
  height: 40px;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.settings-color-input:hover {
  border-color: var(--color-border-strong);
}

.settings-input-error {
  border-color: var(--color-error) !important;
}

.settings-error {
  display: block;
  margin-top: var(--spacing-xs);
  font-size: var(--font-size-xs);
  color: var(--color-error);
}

.settings-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-tertiary);
  text-align: center;
  gap: var(--spacing-md);
}

.settings-empty svg {
  opacity: 0.3;
}

.settings-empty p {
  margin: 0;
  font-size: var(--font-size-base);
}
