/* 拍照对比（P3-2 · 2026-11-12）
   三栏图是"家长愿意发出去"的产物，所以预览与导出必须长得一样：
   预览画布按固定比例，导出按 2 倍尺寸 —— 同一份 drawScene 函数，只换宽度参数。 */

.cp-main { padding-bottom: 48px; }
.cp-layout { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .cp-layout { grid-template-columns: 1fr; } }

.cp-left, .cp-right { padding: 18px; }

.cp-chars { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.cp-char {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: var(--radius-input);
  font-family: inherit; font-size: 22px; color: var(--text-h1);
  cursor: pointer;
}
.cp-char.is-on { background: var(--primary-light); border-color: var(--primary); color: var(--primary-hover); font-weight: 800; }

/* 裁切框：正方形 + 十字辅助线，让用户知道"字该对到哪里" */
.cp-crop {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  overflow: hidden; touch-action: none; cursor: grab;
  background: #F1EDE6; border: 1px solid var(--border);
  border-radius: var(--radius-input);
}
.cp-crop.is-dragging { cursor: grabbing; }
.cp-crop img {
  position: absolute; left: 50%; top: 50%;
  transform-origin: center center;
  max-width: none; user-select: none; -webkit-user-drag: none;
  will-change: transform;
}
/* 十字：格子的中线。照片里的字对到十字中心，叠加才看得准 */
.cp-cross {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(50% - 0.5px), rgba(0, 0, 0, .18) calc(50% - 0.5px), rgba(0, 0, 0, .18) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(0, 0, 0, .18) calc(50% - 0.5px), rgba(0, 0, 0, .18) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}

.cp-zoom { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: var(--font-sm); color: var(--text-aux); }
.cp-zoom input { flex: 1; accent-color: var(--primary); }

.cp-preview { width: 100%; overflow-x: auto; }
#cpCanvas { width: 100%; height: auto; border-radius: var(--radius-input); background: #FFFDF9; }
.cp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
