/* ===== 右侧颜色面板样式 ===== */

.right-colorbar {
  position: fixed;
  right: 0;
  top: 150px; /* 70px导航栏 + 80px header */
  z-index: 997; /* 降低z-index，确保导航栏下拉菜单不被遮挡 */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: calc(var(--colorbar-width) + var(--colorbar-margin));
  padding-right: var(--colorbar-margin);
}

/* 颜色面板折叠状态 */
.right-colorbar.collapsed {
  transform: translateX(calc(var(--colorbar-width) - var(--colorbar-collapsed-width)));
}

/* 颜色面板折叠按钮 */
.colorbar-toggle-btn {
  position: absolute;
  left: -40px;
  top: 20px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 50%;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  z-index: 1050; /* 提高z-index，确保按钮可见 */
}

.colorbar-toggle-btn:hover {
  background: rgba(241, 245, 249, 0.98);
  color: #3c8dbc;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(60, 140, 220, 0.15);
}

.colorbar-toggle-btn .toggle-icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: bold;
}

/* 折叠状态下按钮图标翻转 */
.right-colorbar.collapsed .colorbar-toggle-btn .toggle-icon {
  transform: rotate(180deg);
}

/* 颜色栏样式 */
.color-bar {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 16px 10px 16px 10px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  max-height: 64vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 140, 220, 0.3) transparent;
  max-width: var(--colorbar-width);
  width: var(--colorbar-width);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 折叠状态下隐藏颜色栏 */
.right-colorbar.collapsed .color-bar {
  opacity: 0;
  visibility: hidden;
}

/* 自定义滚动条样式 */
.color-bar::-webkit-scrollbar {
  width: 4px;
}

.color-bar::-webkit-scrollbar-track {
  background: transparent;
}

.color-bar::-webkit-scrollbar-thumb {
  background: rgba(60, 140, 220, 0.3);
  border-radius: 2px;
}

.color-bar::-webkit-scrollbar-thumb:hover {
  background: rgba(60, 140, 220, 0.5);
}

/* 颜色栏容器，用于分组显示 */
.color-bar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  width: 100%;
}

.color-bar-section:last-child {
  margin-bottom: 0;
}

.color-bar-section-title {
  font-size: 11px;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  text-align: center;
}

/* 颜色组网格布局 */
.color-bar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  justify-items: center;
}

/* 单列布局 */
.color-bar-grid.single-column {
  grid-template-columns: 1fr;
}

/* 双列布局 */
.color-bar-grid.double-column {
  grid-template-columns: repeat(2, 1fr);
}

/* 4列布局 */
.color-bar-grid.quad-column {
  grid-template-columns: repeat(4, 1fr);
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-swatch.selected {
  border: 3px solid #3c8dbc;
  transform: scale(1.1);
} 