/* 免费图片裁剪工具样式（本地） */

.tool-photo-cropper .crop-viewport-wrapper {
  background:
    linear-gradient(45deg, #f0f0f0 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(-45deg, #f0f0f0 25%, transparent 25%) 0 0/20px 20px,
    linear-gradient(45deg, transparent 75%, #f0f0f0 75%) 0 0/20px 20px,
    linear-gradient(-45deg, transparent 75%, #f0f0f0 75%) 0 0/20px 20px;
  padding: 10px;
  border-radius: 10px;
}

.tool-photo-cropper .crop-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* 将由 JS 动态更新 */
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  max-height: 60vh;
  cursor: grab;
}

.tool-photo-cropper .crop-viewport.dragging {
  cursor: grabbing;
}

.tool-photo-cropper #cropImage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  will-change: transform;
  pointer-events: none; /* 避免默认拖拽图片 */
  max-width: none; /* 使用自然尺寸参与缩放 */
}

.tool-photo-cropper .crop-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(#00000033, #00000033), /* 轻蒙层 */
    linear-gradient(to right, transparent 33.33%, #ffffff66 33.33%, #ffffff66 66.66%, transparent 66.66%),
    linear-gradient(to bottom, transparent 33.33%, #ffffff66 33.33%, #ffffff66 66.66%, transparent 66.66%);
  background-size: 100% 100%, 100% 1px, 1px 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}

.tool-photo-cropper .preview-box {
  background-color: #f8f9fa;
}

.tool-photo-cropper .btn-primary {
  background: #6c63ff;
  border: none;
}

.tool-photo-cropper .btn-primary:hover {
  background: #2574e6;
}

.tool-photo-cropper .btn-outline-primary {
  border-color: #6c63ff;
  color: #6c63ff;
}

.tool-photo-cropper .btn-outline-primary:hover {
  background: #6c63ff;
  color: #fff;
}

.tool-photo-cropper .form-range:focus {
  box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.25);
}

.tool-photo-cropper .form-check-input:checked {
  background-color: #6c63ff;
  border-color: #6c63ff;
}

