/* Resize 页面特定样式 */
.resize-preview-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.preview-wrapper{
    /* 增加内边距，好看点 */
  padding: 0px !important;
}

.resize-preview-wrapper {
  width: 100%;
  max-width: 600px;
  height: 400px;
  background-color: #f3f4f6;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
  /* 移除 Flex 布局，防止 Cropper 定位冲突 */
  display: block; 
  overflow: hidden;
  padding: 0;
  position: relative;
}

.resize-preview-wrapper img {
  display: block;
  /* 确保图片在初始化前填满容器，避免 Cropper 计算出 0 尺寸 */
  max-width: 100%;
  max-height: 100%; /* 限制高度防止溢出容器 */
  width: auto;      /* 让浏览器保持比例 */
  height: auto;
  margin: 0 auto;   /* 如果图片本身很小，水平居中 */
}

/* 强制 Cropper 容器填满父容器 */
.cropper-container {
  width: 100% !important;
  height: 100% !important;
}

/* 覆盖 Cropper 默认样式，使其更美观 */
.cropper-view-box,
.cropper-face {
  border-radius: 0;
}

.resize-info-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 10; /* 确保在 Cropper 之上 */
  pointer-events: none; /* 防止遮挡操作 */
}

/* 按钮样式 */
.secondary-button {
  background-color: #9ca3af;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  height: 48px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-button:hover {
  background-color: #6b7280;
}

.save-button.secondary {
  background-color: #52c41a;
  margin-left: 10px;
}

.save-button.secondary:hover {
  background-color: #389e0d;
}

/* 输入框组样式 */
.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group input[type="number"] {
  width: 80px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  text-align: center;
}

.input-group span {
  color: #6b7280;
}

/* 锁定比例按钮 */
.aspect-ratio-lock {
  cursor: pointer;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background-color: #fff;
  transition: all 0.2s;
}

.aspect-ratio-lock:hover {
  background-color: #f9fafb;
}

.aspect-ratio-lock.active {
  color: #2563eb;
  background-color: #eff6ff;
  border-color: #bfdbfe;
}

/* 滑块样式 */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  margin-top: -6px;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: #e5e7eb;
  border-radius: 2px;
}

/* 响应式调整 */
@media (max-width: 640px) {
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .control-group {
    justify-content: space-between;
    width: 100%;
  }
  
  .input-group {
    flex: 1;
    justify-content: flex-end;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 10px;
  }
  
  .action-buttons button {
    width: 100%;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
}
