/* ===== 颜色选择器 ===== */
.dream-color-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: end center;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dream-color-picker {
  --picker-hue-color: #c084fc;
  --picker-current-color: #c084fc;
  --picker-alpha: 1;
  width: min(100%, 360px);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(27, 28, 42, 0.98), rgba(12, 13, 22, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.dream-color-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 12px;
}

.dream-color-picker-header strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.dream-color-picker-close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  font-size: 22px;
  line-height: 1;
}

.dream-color-core {
  position: relative;
  width: 232px;
  height: 232px;
  margin: 2px auto 16px;
  touch-action: none;
}

.dream-hue-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 14px 36px rgba(0, 0, 0, 0.36);
  cursor: grab;
  touch-action: none;
}

.dream-hue-ring::after {
  content: '';
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(24, 25, 38, 0.98), rgba(14, 15, 24, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.dream-hue-thumb,
.dream-sv-thumb {
  position: absolute;
  z-index: 3;
  width: 24px;
  height: 24px;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.46), inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.dream-hue-thumb {
  background: var(--picker-hue-color);
}

.dream-sv-square {
  position: absolute;
  inset: 52px;
  z-index: 2;
  border-radius: 18px;
  background:
    linear-gradient(0deg, #000, transparent),
    linear-gradient(90deg, #fff, var(--picker-hue-color));
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  cursor: crosshair;
  overflow: hidden;
  touch-action: none;
}

.dream-sv-thumb {
  background: var(--picker-current-color);
}

.dream-swatches {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.dream-swatch {
  position: relative;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: var(--swatch-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 5px 14px rgba(0, 0, 0, 0.24);
}

.dream-swatch span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  opacity: 0;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
}

.dream-swatch.active span {
  opacity: 1;
}

.dream-alpha-row {
  padding: 6px 10px 14px;
}

.dream-alpha-track {
  position: relative;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #cfd2d8 25%, transparent 25%),
    linear-gradient(-45deg, #cfd2d8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #cfd2d8 75%),
    linear-gradient(-45deg, transparent 75%, #cfd2d8 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  overflow: visible;
  touch-action: none;
}

.dream-alpha-track::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--picker-current-color));
}

.dream-alpha-fill {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,255,255,0.18), var(--picker-current-color));
  pointer-events: none;
}

.dream-alpha-thumb {
  position: absolute;
  top: 50%;
  z-index: 2;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: rgba(16, 18, 28, 0.94);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 26px;
  text-align: center;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.38);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.dream-color-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 8px 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.dream-color-value code {
  flex: 1;
  color: rgba(255, 255, 255, 0.9);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
}

.dream-color-value button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.84);
}

.dream-color-value button.copied {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.34);
}

@media (max-width: 380px) {
  .dream-color-core {
    width: 210px;
    height: 210px;
  }

  .dream-sv-square {
    inset: 48px;
  }
}
