/* UGS v2.0: 已拆分为 base-structure.css + tokens.css + skin.css */
/* Phase 1: Interaction enhancement styles for coloring site */
/* Palette updated: rose pink #ec4899 + soft purple #8b5cf6 */

/* ════════════════════════════════════════════════
   PHASE 1 — COLORING INTERACTION ENHANCEMENTS
   ════════════════════════════════════════════════ */

/* ── Tool Palette ─────────────────────────────── */
.cl-tool-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem;
  background: var(--site-primary-light, #fdf2f8);
  border: 1px solid var(--site-primary-border, #fbcfe8);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.cl-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  font-size: 1.2rem;
}

.cl-tool-btn:hover {
  background: var(--site-primary-light, #fdf2f8);
  border-color: var(--site-primary-border, #fbcfe8);
}

.cl-tool-btn.is-active {
  border-color: var(--site-primary, #ec4899);
  background: rgba(236, 72, 153, 0.08);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

.cl-tool-btn:focus-visible {
  outline: 2px solid var(--site-primary, #ec4899);
  outline-offset: 2px;
}

.cl-tool-separator {
  width: 1px;
  height: 28px;
  background: var(--site-primary-border, #fbcfe8);
  align-self: center;
  margin: 0 0.2rem;
}

/* ── Color Picker ─────────────────────────────── */
.cl-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.6rem;
  background: var(--site-primary-light, #fdf2f8);
  border: 1px solid var(--site-primary-border, #fbcfe8);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.cl-color-swatch {
  width: 36px;
  height: 36px;
  border: 2px solid var(--site-primary-border, #fbcfe8);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cl-color-swatch:hover { transform: scale(1.15); }

.cl-color-swatch.is-active {
  border-color: var(--site-primary-dark, #9d174d);
  box-shadow: 0 0 0 3px var(--site-primary, #ec4899);
  transform: scale(1.15);
}

.cl-color-swatch:focus-visible {
  outline: 2px solid var(--site-primary, #ec4899);
  outline-offset: 2px;
}

.cl-recent-colors {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: auto;
  padding-left: 0.5rem;
  border-left: 1px solid var(--site-primary-border, #fbcfe8);
}

.cl-recent-colors__label {
  font-size: 0.7rem;
  color: var(--site-text-muted, #6b7280);
  margin-right: 0.25rem;
}

.cl-recent-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid var(--site-primary-border, #fbcfe8);
  border-radius: 50%;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Canvas Container ─────────────────────────── */
.cl-canvas-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 2px solid var(--site-primary-border, #fbcfe8);
  border-radius: 16px;
  background: #fff;
  touch-action: none;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.08);
}

.cl-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.cl-zoom-controls {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.3rem;
}

.cl-zoom-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--site-primary-border, #fbcfe8);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.cl-zoom-btn:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.12);
}

/* ── Completion Progress ──────────────────────── */
.cl-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--site-primary-light, #fdf2f8);
  border: 1px solid var(--site-primary-border, #fbcfe8);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.cl-progress__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--site-primary-dark, #9d174d);
  white-space: nowrap;
  font-family: var(--font-heading, 'Quicksand', sans-serif);
}

.cl-progress__track {
  flex: 1;
  height: 8px;
  background: var(--site-primary-border, #fbcfe8);
  border-radius: 4px;
  overflow: hidden;
}

.cl-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--site-primary, #ec4899), var(--site-accent, #8b5cf6));
  border-radius: 4px;
  transition: width 0.4s ease;
}

.cl-progress__pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--site-primary-dark, #9d174d);
  min-width: 3rem;
  text-align: right;
  font-family: var(--font-heading, 'Quicksand', sans-serif);
}

/* ── Works Collection (Gallery) ───────────────── */
.cl-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--site-primary-light, #fdf2f8);
  border: 1px solid var(--site-primary-border, #fbcfe8);
  border-radius: 12px;
  margin-top: 1rem;
}

.cl-gallery__item {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid var(--site-primary-border, #fbcfe8);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.cl-gallery__item:hover {
  border-color: var(--site-primary, #ec4899);
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.18);
  transform: translateY(-2px);
}

.cl-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cl-gallery__badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  background: rgba(157, 23, 77, 0.75);
  color: #fff;
}

/* ── Draft Save Indicator ─────────────────────── */
.cl-autosave {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--site-text-muted, #6b7280);
  padding: 0.25rem 0.5rem;
}

.cl-autosave__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
}

.cl-autosave__dot.is-saving {
  background: var(--site-primary, #ec4899);
  animation: cl-pulse 1s infinite;
}

@keyframes cl-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Streak / Achievement ─────────────────────── */
.cl-streak {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.875rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 9999px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.25);
  font-family: var(--font-heading, 'Quicksand', sans-serif);
}

/* ── Phase 1 Print Suppression ────────────────── */
@media print {
  .cl-tool-palette,
  .cl-color-picker,
  .cl-zoom-controls,
  .cl-progress,
  .cl-gallery,
  .cl-autosave,
  .cl-streak { display: none !important; }
}
