.palette-config-panel {
  padding: 20px;
}

.palette-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.color-block-wrapper {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-block {
  height: 120px;
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.color-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.color-value {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  z-index: 2;
}

.color-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.lock-btn {
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px 10px;
  transition: all 0.15s ease;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lock-btn:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
}

/* 锁定状态下的按钮样式 */
.lock-btn.locked {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
  font-weight: 600;
}

/* 按钮容器 */
.btn-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 复制按钮样式 */
.color-controls .copy-btn {
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px 10px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.color-controls .copy-btn:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
}

.hsl-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.slider-container label {
  color: #fff;
  font-size: 11px;
  min-width: 16px;
  flex-shrink: 0;
}

.slider-container input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.slider-value {
  color: #fff;
  font-size: 11px;
  min-width: 28px;
  max-width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* 浅色模式下的滑动条样式 */
.light-theme .slider-container label {
  color: #1e293b;
}

.light-theme .slider-container input[type="range"] {
  background: rgba(148, 163, 184, 0.4);
}

.light-theme .slider-container input[type="range"]::-webkit-slider-thumb {
  background: #10b981;
}

.light-theme .slider-container input[type="range"]::-moz-range-thumb {
  background: #10b981;
}

.light-theme .slider-value {
  color: #1e293b;
}

.palette-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 200px;
}

.control-group label {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.control-group .config-select {
  flex: 1;
  min-width: 160px;
  padding: 10px 30px 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
  color: #e5e7eb;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 12l-6-6h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.control-group .config-select:focus {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  background: rgba(15, 23, 42, 0.5);
}

.control-group .config-select:hover {
  border-color: #10b981;
}

/* 自定义下拉框样式 */
.palette-config-panel .searchable-select {
  position: relative;
  flex: 1;
  min-width: 120px;
}

/* panel-actions中的下拉框使用按钮样式 */
.panel-actions .searchable-select {
  position: relative;
  min-width: 80px;
}

.palette-config-panel .searchable-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  color: #f1f5f9;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

/* panel-actions中的下拉框触发器使用secondary按钮样式 */
.panel-actions .searchable-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 999px;
  padding: 4px 10px;
  color: #f1f5f9;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  height: auto;
  min-height: 24px;
}

.palette-config-panel .searchable-select-trigger:hover {
  border-color: #10b981;
}

.panel-actions .searchable-select-trigger:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
}

.palette-config-panel .searchable-select-trigger .arrow,
.panel-actions .searchable-select-trigger .arrow {
  font-size: 12px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.palette-config-panel .searchable-select.open .searchable-select-trigger .arrow,
.panel-actions .searchable-select.open .searchable-select-trigger .arrow {
  transform: rotate(180deg);
}

.palette-config-panel .searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

/* panel-actions中的下拉菜单使用按钮样式 */
.panel-actions .searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  min-width: 80px;
}

.palette-config-panel .searchable-select.open .searchable-select-dropdown,
.panel-actions .searchable-select.open .searchable-select-dropdown {
  display: flex;
}

.palette-config-panel .options-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

/* panel-actions中的选项列表 */
.panel-actions .options-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.palette-config-panel .options-list::-webkit-scrollbar,
.panel-actions .options-list::-webkit-scrollbar {
  width: 4px;
}

.palette-config-panel .options-list::-webkit-scrollbar-thumb,
.panel-actions .options-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
}

.palette-config-panel .option-item {
  padding: 10px 12px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* panel-actions中的选项使用按钮样式 */
.panel-actions .option-item {
  padding: 6px 10px;
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.palette-config-panel .option-item:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

/* panel-actions中的选项悬停效果 */
.panel-actions .option-item:hover {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.palette-config-panel .option-item.selected {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-weight: 600;
}

/* panel-actions中的选中选项 */
.panel-actions .option-item.selected {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-weight: 500;
}

/* 亮色模式适配 */
.light-theme .palette-config-panel .searchable-select-trigger {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
}

/* panel-actions中的下拉框使用secondary按钮样式 */
.light-theme .panel-actions .searchable-select-trigger {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

.light-theme .palette-config-panel .searchable-select-trigger:hover {
  border-color: #10b981;
}

.light-theme .panel-actions .searchable-select-trigger:hover {
  background: #ffffff;
  border-color: #10b981;
  color: #10b981;
}

.light-theme .palette-config-panel .searchable-select-dropdown {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* panel-actions中的下拉菜单亮色模式 */
.light-theme .panel-actions .searchable-select-dropdown {
  background: #ffffff;
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.light-theme .palette-config-panel .option-item {
  color: #64748b;
}

/* panel-actions中的选项亮色模式 */
.light-theme .panel-actions .option-item {
  color: #111827;
}

.light-theme .palette-config-panel .option-item:hover {
  background: rgba(16, 185, 129, 0.08);
}

/* panel-actions中的选项悬停效果亮色模式 */
.light-theme .panel-actions .option-item:hover {
  background: rgba(16, 185, 129, 0.08);
  color: #10b981;
}

.light-theme .palette-config-panel .option-item.selected {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

/* panel-actions中的选中选项亮色模式 */
.light-theme .panel-actions .option-item.selected {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.image-upload-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed rgba(148, 163, 184, 0.2);
}

.image-upload-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-color, #e5e7eb);
}

/* 自定义文件上传按钮样式 */
.image-upload-section input[type="file"] {
  display: none;
}

.image-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 999px;
  color: #f1f5f9;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 15px;
}

.image-upload-label:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
}

.image-upload-label::before {
  content: "📁";
  font-size: 14px;
}

.image-preview {
  max-width: 100%;
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.3);
}

.image-preview img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 亮色模式适配 */
.light-theme .control-group label {
  color: #1e293b;
}

.light-theme .control-group .config-select {
  flex: 1;
  min-width: 160px;
  padding: 10px 30px 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(30, 41, 59, 0.18);
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 12l-6-6h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.light-theme .control-group .config-select:focus {
  background: #ffffff;
  border-color: rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.light-theme .control-group .config-select:hover {
  border-color: #10b981;
}

.light-theme .image-upload-section h3 {
  color: #1e293b;
}

.light-theme .image-upload-section {
  border-top-color: #e2e8f0;
}

/* 亮色模式下的自定义文件上传按钮 */
.light-theme .image-upload-label {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

.light-theme .image-upload-label:hover {
  background: #ffffff;
  border-color: #10b981;
  color: #10b981;
}

.light-theme .image-preview {
  border-color: #e2e8f0;
  background: #ffffff;
}

/* 亮色模式下的复制按钮样式 */
.light-theme .copy-btn {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

.light-theme .copy-btn:hover {
  background: #ffffff;
  border-color: #10b981;
  color: #10b981;
}

.color-codes-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-code-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background-color: var(--background-secondary);
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.color-code-item:hover {
  background-color: var(--background-tertiary);
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.code-value {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-all;
}

.copy-btn {
  padding: 4px 10px;
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 999px;
  color: #f1f5f9;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
}

/* 亮色模式下的颜色控制面板 */
.light-theme .color-controls {
  background: rgba(241, 245, 249, 0.6);
  border-color: #e2e8f0;
}

.light-theme .lock-btn {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

.light-theme .lock-btn:hover {
  background: #ffffff;
  border-color: #10b981;
  color: #10b981;
}

/* 浅色模式下锁定状态的按钮样式 */
.light-theme .lock-btn.locked {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
  font-weight: 600;
}

/* 浅色模式下复制按钮样式 */
.light-theme .color-controls .copy-btn {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

.light-theme .color-controls .copy-btn:hover {
  background: #ffffff;
  border-color: #10b981;
  color: #10b981;
}

/* 配色样例库样式 */
.palette-library-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
}

.palette-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.palette-category-btn {
  padding: 6px 12px;
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.palette-category-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #10b981;
}

.palette-category-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
  font-weight: 500;
}

.palette-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.palette-example-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.palette-example-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(16, 185, 129, 0.4);
}

.palette-example-colors {
  display: flex;
  height: 60px;
}

.palette-example-color {
  flex: 1;
  height: 100%;
}

.palette-example-info {
  padding: 12px;
}

.palette-example-name {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.palette-example-category {
  font-size: 12px;
  color: #64748b;
}



.light-theme .palette-category-btn {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

.light-theme .palette-category-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
  color: #10b981;
}

.light-theme .palette-category-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
}

.light-theme .palette-example-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

.light-theme .palette-example-name {
  color: #1e293b;
}

.light-theme .palette-example-category {
  color: #64748b;
}

@media (max-width: 768px) {
  .palette-grid {
    flex-direction: column;
  }
  
  .color-block {
    width: 100%;
    height: 100px;
  }
  
  .palette-controls {
    flex-direction: column;
  }
  
  .control-group {
    min-width: 100%;
  }
  
  .color-code-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .code-value {
    width: 100%;
  }
  
  .copy-btn {
    align-self: flex-start;
  }
  
  .palette-examples-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* 搜索框样式 */
.search-box {
  display: flex;
  align-items: center;
}

.search-input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
  color: #e5e7eb;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 150px;
}

.search-input:focus {
  border-color: rgba(16, 185, 129, 0.18);
  background: rgba(15, 23, 42, 0.5);
}

.light-theme .search-input {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(30, 41, 59, 0.18);
}

.light-theme .search-input:focus {
  background: #ffffff;
  border-color: rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}