/* 批量裁剪 · 可视化工作台 */
.btn.small { padding: 7px 12px; font-size: 12px; border-radius: 9px; }

.crop-workbench {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

/* 左侧缩略图 */
.crop-thumbs-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 560px;
}
.crop-thumbs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.crop-thumbs-head small { font-weight: 500; color: var(--muted-2); }
.crop-thumbs { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.crop-thumb {
  appearance: none;
  border: 2px solid transparent;
  background: var(--surface);
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  display: block;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.crop-thumb img {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: cover;
  background: var(--surface-3);
}
.crop-thumb span {
  display: block;
  padding: 5px 7px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.crop-thumb i {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(10, 14, 26, .66);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}
.crop-thumb:hover { border-color: var(--line-strong); }
.crop-thumb.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 右侧画布 */
.crop-stage { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.crop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.crop-ratio-group {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ratio-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
  transition: .15s ease;
}
.ratio-btn:hover { color: var(--ink); }
.ratio-btn.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

.crop-canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, rgba(127, 137, 166, .08) 25%, transparent 25%, transparent 75%, rgba(127, 137, 166, .08) 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, rgba(127, 137, 166, .08) 25%, transparent 25%, transparent 75%, rgba(127, 137, 166, .08) 75%) 9px 9px / 18px 18px,
    var(--surface-3);
  overflow: hidden;
}
#crop-canvas {
  display: block;
  max-width: 100%;
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 2px 16px rgba(8, 12, 24, .18);
}
#crop-canvas[data-dragging="1"] { cursor: grabbing; }
.crop-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 12.5px;
  pointer-events: none;
}
.crop-placeholder[hidden] { display: none; }

/* 坐标读数 */
.crop-readout {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}
.crop-readout label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--muted);
}
.crop-readout input {
  width: 78px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11.5px;
}
.crop-readout input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.crop-size-note { margin-left: auto; color: var(--muted-2); font-family: var(--mono); font-size: 11px; }

.crop-apply-row { display: flex; gap: 8px; flex-wrap: wrap; }
.crop-tip { margin: 0; font-size: 11.5px; line-height: 1.7; color: var(--muted-2); }

.crop-output-row { margin-top: 18px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row output {
  min-width: 34px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 3px 6px;
}

@media (max-width: 820px) {
  .crop-workbench { grid-template-columns: 1fr; }
  .crop-thumbs-wrap { max-height: none; }
  .crop-thumbs { flex-direction: row; overflow-x: auto; }
  .crop-thumb { flex: 0 0 116px; }
  .crop-thumb img { height: 66px; }
  .crop-size-note { margin-left: 0; width: 100%; }
}
