/* 图片裁剪工具专用样式 */

#image-crop-app {
  --crop-primary: #007cba;
  --crop-accent: #0073aa;
  --crop-border: #ddd;
  --crop-bg: #f9f9f9;
  --crop-shadow: rgba(0, 0, 0, 0.1);
  --crop-handle: #ffffff;
  --crop-handle-border: #007cba;
  --crop-overlay: rgba(0, 0, 0, 0.4);
}

/* 画布容器 */
#crop-canvas-container {
  position: relative;
  background: var(--crop-bg);
  border: 2px dashed var(--crop-border);
  border-radius: 8px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#crop-canvas-container.has-image {
  border: 1px solid var(--crop-border);
  background: #fff;
}

/* 主画布 */
#crop-main-canvas {
  display: none;
  max-width: 100%;
  max-height: 70vh;
  cursor: crosshair;
  border-radius: 4px;
}

#crop-main-canvas.dragging {
  cursor: grabbing;
}

/* 空状态 */
#crop-empty-state {
  text-align: center;
  color: #666;
  padding: 40px;
}

#crop-empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

#crop-empty-state p {
  margin: 0;
  font-size: 16px;
}

/* 预览区域 */
.preview-section {
  background: var(--crop-bg);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.preview-section strong {
  display: block;
  margin-bottom: 10px;
  color: #333;
  font-size: 16px;
}

/* 选区信息 */
#crop-selection-info {
  margin: 10px 0;
  padding: 8px 12px;
  background: var(--crop-primary);
  color: white;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  display: none;
}

/* 预览画布 */
#crop-preview-canvas {
  max-width: 100%;
  max-height: 300px;
  border: 1px solid var(--crop-border);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 8px var(--crop-shadow);
  display: none;
}

/* 控制按钮 */
.crop-controls {
  margin: 15px 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 裁剪工具特定按钮样式 - 只设置最小宽度 */
.crop-controls .btn {
  min-width: 120px;
}

/* 状态指示 */
#crop-status {
  margin-top: 10px;
  background: var(--crop-accent);
  color: white;
  display: none;
}

/* 鼠标样式状态 */
#crop-main-canvas.cursor-move {
  cursor: move;
}

#crop-main-canvas.cursor-nw-resize {
  cursor: nw-resize;
}

#crop-main-canvas.cursor-ne-resize {
  cursor: ne-resize;
}

#crop-main-canvas.cursor-crosshair {
  cursor: crosshair;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tool-cols {
    flex-direction: column;
    gap: 20px;
  }
  
  #crop-canvas-container {
    min-height: 250px;
  }
  
  .crop-controls {
    flex-direction: column;
    align-items: center;
  }
  
  .crop-controls .btn {
    min-width: 150px;
  }
}

/* 固定尺寸模式提示 */
.fixed-mode-active {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 10px 0;
  color: #856404;
}

/* 加载状态 */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--crop-border);
  border-top: 2px solid var(--crop-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}