/* ===== 裁切压缩工具专属样式 =====
   页面骨架（top-nav / sidebar / accordion / btn / toast 等）复用 style.css 通用区，
   比例按钮复用 .ratio-grid / .btn-ratio。本文件只放裁切与压缩自己的样式。 */

/* ---------- 左侧：照片列表 ---------- */
.crop-photo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}

.crop-label {
  font-size: 0.9rem;
  color: var(--text-dark);
  font-weight: 600;
}

.crop-photo-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crop-photo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.crop-photo-item:hover {
  border-color: var(--primary-color);
}

.crop-photo-item.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 1px var(--primary-color);
}

.crop-photo-item img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
}

.crop-photo-item .crop-photo-info {
  flex: 1;
  min-width: 0;
}

.crop-photo-item .crop-photo-name {
  font-size: 0.82rem;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crop-photo-item .crop-photo-size {
  font-size: 0.75rem;
  color: var(--text-light);
}

.crop-photo-item .crop-photo-remove {
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
}

.crop-photo-item .crop-photo-remove:hover {
  color: var(--danger-color);
  background: #fdeaea;
}

/* ---------- 中部：预览与裁切 ---------- */
.preview-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
  min-width: 0;
}

.border-stage {
  position: relative;
}

.empty-placeholder {
  width: 360px;
  height: 360px;
  max-width: 80%;
  max-height: 80%;
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.empty-placeholder:hover,
.border-stage.dragover .empty-placeholder {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: #f0f7ff;
}

.empty-placeholder i {
  font-size: 3rem;
}

.empty-placeholder p {
  font-size: 0.9rem;
}

.crop-frame {
  position: relative;
  line-height: 0;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14);
  border-radius: 2px;
  overflow: hidden; /* 旋转后的照片四角超出显示框时裁掉 */
}

.crop-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* 裁切遮罩层：框外压暗，框内透明 */
.crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  cursor: crosshair;
  z-index: 2;
}

.crop-rect {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
  box-sizing: border-box;
}

/* 九宫格辅助线（2 竖 + 2 横，相机取景器样式） */
.crop-gridline {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.crop-gridline-v1 { left: 33.33%; top: 0; bottom: 0; width: 1px; }
.crop-gridline-v2 { left: 66.66%; top: 0; bottom: 0; width: 1px; }
.crop-gridline-h1 { top: 33.33%; left: 0; right: 0; height: 1px; }
.crop-gridline-h2 { top: 66.66%; left: 0; right: 0; height: 1px; }

.crop-rect.hide-grid .crop-gridline {
  display: none;
}

.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  z-index: 3;
}

.crop-handle[data-handle="nw"] { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle[data-handle="ne"] { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle[data-handle="sw"] { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle[data-handle="se"] { bottom: -7px; right: -7px; cursor: nwse-resize; }

/* ---------- 右侧：控件 ---------- */
.crop-actions {
  display: flex;
  gap: 8px;
}

.crop-actions .btn-primary {
  flex: 1;
}

.crop-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0;
}

.crop-estimate {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 10px 12px;
}

.crop-estimate b {
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
}

/* 比例网格 3 列（复用 .btn-ratio 基础样式） */
.crop-ratio-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* 输出格式按钮组 */
.wm-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-crop-format {
  padding: 8px 4px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #f3f4f6;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  color: var(--text-dark);
  transition: all 0.2s;
}

.btn-crop-format:hover {
  background: #e9ecef;
}

.btn-crop-format.active {
  background: #fff;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ---------- 批量分页器 ---------- */
.photo-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.photo-pager button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 1rem;
  color: var(--text-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-pager button:hover {
  color: var(--primary-color);
}

.pager-count {
  font-size: 0.85rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: center;
}

/* ---------- 照片悬浮操作与示例标记 ---------- */
.frame-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
  line-height: 1;
}

.border-stage:hover .frame-toolbar {
  opacity: 1;
}

.frame-toolbar button {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  font-size: 1.1rem;
  color: var(--text-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.frame-toolbar button:hover {
  color: var(--primary-color);
}

.demo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.6;
  letter-spacing: 0.5px;
}
