/* ============================================================
   Image Compress Page Layout
   ============================================================ */
.brush-row {
  display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:8px;
}
.brush-row label { min-width:auto; margin:0; }
.brush-row input[type="range"] { flex:0 0 140px; }
.brush-val { font-size:12px; color:var(--text-muted, #888); min-width:30px; }
.mask-color { width:34px; height:26px; padding:0; border:1px solid var(--border, #ccc); border-radius:6px; }
.compress-layout {
  display:flex;
  flex-direction:column;
  gap:20px;
}
.compress-left, .compress-right {
  display:flex; flex-direction:column; gap:16px;
}
.compress-right .settings-panel {
  margin-top:0;
}

/* ============================================================
   多文件列表（图片压缩）
   ============================================================ */
.file-list-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px;
  background:var(--bg-elevated);
  border:1px solid var(--border-color);
  border-radius:var(--radius-md) var(--radius-md) 0 0;
  border-bottom:none;
}
.file-list-title {
  font-size:13px; font-weight:600;
  display:flex; align-items:center; gap:8px;
}
.file-list-count {
  background:var(--accent-dim);
  color:var(--accent);
  font-size:11px;
  padding:2px 8px;
  border-radius:10px;
  font-weight:600;
}
.file-list-actions {
  display:flex; gap:6px;
}

.file-list {
  border:1px solid var(--border-color);
  border-radius:0 0 var(--radius-md) var(--radius-md);
  background:var(--bg-surface);
  max-height:500px;
  overflow-y:auto;
}

.image-file-item {
  display:flex; align-items:stretch; gap:12px;
  padding:12px 16px;
  border-bottom:1px solid var(--border-color);
  transition:background var(--transition);
}
.image-file-item:last-child { border-bottom:none; }
.image-file-item:hover { background:var(--bg-surface-hover); }
.image-file-item.compressed { background:rgba(34,197,94,0.04); }

.image-item-thumb {
  width:64px; height:64px;
  border-radius:var(--radius-sm);
  overflow:hidden;
  flex-shrink:0;
  background:var(--bg-elevated);
  display:flex; align-items:center; justify-content:center;
}
.image-item-thumb img {
  width:100%; height:100%; object-fit:cover;
}
.image-item-thumb svg {
  width:24px; height:24px; color:var(--text-muted);
}

.image-item-main {
  flex:1; min-width:0;
  display:flex; flex-direction:column; gap:6px;
}
.image-item-name {
  font-size:13px; font-weight:500;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.image-item-dims {
  font-size:11px; color:var(--text-secondary);
  font-family:'SF Mono','Consolas',monospace;
}
.image-item-compare {
  display:flex; align-items:center; gap:10px;
  font-family:'SF Mono','Consolas',monospace;
  font-size:11px;
}
.size-orig { color:var(--text-secondary); }
.size-arrow { color:var(--text-muted); }
.size-new { color:var(--text-primary); font-weight:600; }
.size-diff {
  padding:1px 6px;
  border-radius:8px;
  font-size:10px;
  font-weight:600;
}
.size-diff.down {
  background:var(--success-dim);
  color:var(--success);
}
.size-diff.up {
  background:var(--warning-dim);
  color:var(--warning);
}
.size-diff.same {
  background:var(--bg-input);
  color:var(--text-secondary);
}
.target-missed {
  color:var(--danger);
  font-weight:600;
}
.image-item-path {
  color:var(--text-muted);
  font-size:10px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.image-item-status {
  flex-shrink:0;
  display:flex; flex-direction:column;
  align-items:flex-end; justify-content:center;
  gap:6px;
  min-width:80px;
}
.status-badge {
  display:inline-block;
  font-size:11px;
  padding:3px 8px;
  border-radius:10px;
  font-weight:500;
}
.status-pending { background:var(--bg-input); color:var(--text-secondary); }
.status-compressing { background:var(--warning-dim); color:var(--warning); }
.status-done { background:var(--success-dim); color:var(--success); }
.status-error { background:var(--danger-dim); color:var(--danger); }

.image-item-remove {
  flex-shrink:0;
  width:28px; height:28px;
  padding:0;
  border:0;
  background:transparent;
  display:flex; align-items:center; justify-content:center;
  color:var(--text-muted);
  border-radius:6px;
  cursor:pointer;
  transition:all var(--transition);
  align-self:center;
}
.image-item-remove:hover {
  background:var(--danger-dim);
  color:var(--danger);
}
.image-item-remove svg { width:14px; height:14px; }

/* 压缩中禁止移除 */
.image-item-remove.disabled {
  opacity:0.35;
  cursor:not-allowed;
  pointer-events:none;
}

.image-item-progress {
  height:3px;
  background:var(--bg-input);
  border-radius:2px;
  overflow:hidden;
  width:100%;
}
.image-item-progress-fill {
  height:100%;
  background:var(--accent);
  width:0%;
  transition:width 0.3s;
}

.upload-zone.dragover,
.upload-zone.drag-over {
  border-color:var(--accent);
  background:var(--accent-dim);
  transform:scale(1.01);
}
.upload-options {
  align-items:center;
  gap:10px;
  margin-top:10px;
  color:var(--text-muted);
  font-size:11px;
}
.processing-note {
  margin-top:8px;
  color:var(--text-secondary);
  font-size:11px;
  line-height:1.5;
}
.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}

/* 批量操作栏 */
.batch-action-bar {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px;
  background:var(--bg-elevated);
  border:1px solid var(--border-color);
  border-radius:var(--radius-md);
  margin-top:12px;
}
.batch-info {
  font-size:12px; color:var(--text-secondary);
}
.batch-info strong { color:var(--text-primary); }
.batch-info .batch-total-size { color:var(--success); font-weight:600; }
.batch-info .batch-total-size.pending { color:var(--text-secondary); }

.batch-buttons {
  display:flex; gap:8px; align-items:center;
}
.batch-output-select {
  height:30px;
  min-width:132px;
}
.batch-output-select select {
  width:100%;
  height:100%;
  padding:0 8px;
  border:0;
  outline:0;
  background:transparent;
  color:var(--text-primary);
  font-size:12px;
}
.settings-subtitle { font-size:12px; font-weight:600; color:var(--text-secondary); margin:16px 0 10px; }
.watermark-settings {
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--border-color);
}
.mask-settings {
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--border-color);
}
.mask-editor-wrap {
  margin-top:10px;
  border:1px solid var(--border-color);
  border-radius:var(--radius-sm);
  background:var(--bg-input);
  overflow:hidden;
  line-height:0;
}
#ic-mask-editor {
  display:block;
  max-width:100%;
  cursor:crosshair;
  touch-action:none;
}
.mask-list {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}
.mask-item {
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid var(--border-color);
  border-radius:var(--radius-sm);
  background:var(--bg-surface);
  flex-wrap:wrap;
}
.mask-item .mask-index {
  font-size:11px;
  font-weight:600;
  color:var(--accent);
  min-width:18px;
}
.mask-item select,
.mask-item input {
  height:30px;
  border:1px solid var(--border-color);
  border-radius:var(--radius-sm);
  background:var(--bg-elevated);
  color:var(--text-primary);
  font-size:12px;
  padding:0 6px;
}
.mask-item .mask-block {
  width:64px;
}
.mask-item .mask-remove {
  margin-left:auto;
  width:28px; height:28px;
  border:0; background:transparent;
  color:var(--text-muted);
  border-radius:6px; cursor:pointer;
}
.mask-item .mask-remove:hover { background:var(--danger-dim); color:var(--danger); }
.wm-check {
  display:flex; align-items:center; gap:6px; cursor:pointer; font-size:12px; color:var(--text-secondary);
}
.wm-check input { width:16px; height:16px; }
.wm-tile-opts { display:flex; }
.wm-drag-editor {
  margin-top:12px; padding-top:12px; border-top:1px dashed var(--border-color);
}
#ic-wm-editor {
  display:block; max-width:100%; cursor:crosshair; touch-action:none; border-radius:var(--radius-sm);
}
.wm-drag-dot {
  position:absolute; width:18px; height:18px; margin:-9px 0 0 -9px;
  border-radius:50%; background:var(--accent); border:2px solid #fff; box-shadow:0 0 0 2px rgba(0,0,0,.2);
}
#image-settings .input-wrap,
#image-settings .range-row {
  box-sizing:border-box;
  height:42px;
  min-height:42px;
}
#image-settings .input-wrap > input,
#image-settings .input-wrap > select {
  box-sizing:border-box;
  min-width:0;
  height:100%;
  width: 100%;
  border-width: 0;
}
#image-settings .input-wrap input[type="text"] {
  padding:8px 10px;
  background:#fff;
  font-size:12px;
}
#image-settings .input-wrap input[type="color"] {
  width:100%;
  padding:6px 10px;
  border:0;
  background:transparent;
  cursor:pointer;
}
#image-settings .input-wrap input[type="file"] {
  width:100%;
  min-width:0;
  padding:8px 10px;
  border:0;
  background:transparent;
  font-size:12px;
}
.wm-text-field,
.wm-logo-field,
.wm-common-field { display:none; }
.label-hint {
  color:var(--text-muted);
  font-size:11px;
  font-weight:400;
  white-space:nowrap;
}
.watermark-position-picker { position:relative; }
.watermark-position-trigger {
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  padding:0 12px;
  color:var(--text-primary);
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.watermark-position-arrow {
  width:0;
  height:0;
  margin-right:2px;
  border-left:4px solid transparent;
  border-right:4px solid transparent;
  border-top:5px solid var(--text-primary);
  transition:transform var(--transition);
}
.watermark-position-popover {
  position:absolute;
  z-index:20;
  top:calc(100% + 6px);
  left:0;
  display:none;
  padding:6px;
  border:1px solid var(--border-color);
  border-radius:var(--radius-sm);
  background:var(--bg-surface);
  box-shadow:0 8px 24px rgba(26, 29, 38, .14);
}
.watermark-position-picker.open .watermark-position-popover { display:block; }
.watermark-position-picker.open .watermark-position-arrow { transform:rotate(180deg); }
.watermark-position-grid {
  display:grid;
  grid-template-columns:repeat(3, 20px);
  grid-template-rows:repeat(3, 20px);
  gap:4px;
  padding:4px;
  box-sizing:border-box;
  border:1px solid var(--border-color);
  border-radius:var(--radius-sm);
  background:var(--bg-input);
}
.watermark-position-btn {
  position:relative;
  padding:0;
  border:1px solid transparent;
  border-radius:3px;
  background:var(--bg-surface);
  cursor:pointer;
}
.watermark-position-btn::after {
  content:"";
  position:absolute;
  inset:50% auto auto 50%;
  width:5px;
  height:5px;
  border-radius:50%;
  background:var(--text-muted);
  transform:translate(-50%, -50%);
}
.watermark-position-btn:hover { border-color:var(--accent); }
.watermark-position-btn.active {
  border-color:var(--accent);
  background:rgba(76, 124, 255, .12);
}
.watermark-position-btn.active::after { background:var(--accent); }
.watermark-position-btn:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.watermark-position-btn:disabled { opacity:.55; cursor:not-allowed; }
.preview-panel { margin-top:16px; padding-top:4px; border-top:1px solid var(--border-color); }
.preview-images { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.preview-images > div { min-width:0; color:var(--text-muted); font-size:11px; }
.preview-images img { display:block; width:100%; height:180px; object-fit:contain; margin-top:6px; border-radius:var(--radius-sm); background:var(--bg-input); }
.preview-dims { color:var(--text-secondary); font-size:11px; margin-top:8px; }
.image-item-error { color:var(--danger); font-size:11px; }
@media (max-width: 640px) { .preview-images { grid-template-columns:1fr; } .preview-images img { height:140px; } .batch-action-bar { align-items:flex-start; flex-direction:column; gap:10px; } }

/* 批量下载进度（隐藏，压缩时显示） */
.batch-progress {
  display:none;
  margin-top:12px;
  padding:12px 16px;
  background:var(--bg-surface);
  border:1px solid var(--border-color);
  border-radius:var(--radius-md);
}
.batch-progress.visible { display:block; }
.batch-progress-bar {
  height:6px;
  background:var(--bg-input);
  border-radius:3px;
  overflow:hidden;
  margin-bottom:8px;
}
.batch-progress-fill {
  height:100%;
  background:linear-gradient(90deg, var(--accent), var(--accent-hover));
  width:0%;
  transition:width 0.3s;
}
.batch-progress-text {
  font-size:12px;
  color:var(--text-secondary);
  display:flex; justify-content:space-between;
}
.error-summary {
  display:none;
  margin-top:10px;
  padding:10px 14px;
  border:1px solid rgba(239,68,68,.25);
  border-radius:var(--radius-md);
  background:var(--danger-dim);
  color:var(--danger);
  font-size:11px;
  line-height:1.5;
}
.error-summary.visible { display:block; }
.error-summary ul { margin:4px 0 0 18px; }
@media (max-width:640px) {
  .upload-options, .batch-buttons { align-items:stretch; flex-direction:column; }
  .batch-output-select { width:100%; }
}

/* 图片裁剪编辑器弹窗（复用视频裁剪样式类） */
.ic-crop-badge { font-size:10px; color:var(--accent); margin-bottom:4px; font-weight:500; }
.ic-crop-actions { display:flex; gap:4px; margin-bottom:4px; }
.ic-crop-btn { font-size:11px; padding:2px 8px; }
.vc-crop-badge { font-size:10px; color:var(--accent); margin-bottom:4px; font-weight:500; }
.vc-crop-dialog {
  background:var(--bg-surface);
  border:1px solid var(--border-color);
  border-radius:var(--radius-xl);
  width:min(720px, 92vw);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}
.vc-crop-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--border-color);
}
.vc-crop-title { font-size:16px; font-weight:600; }
.vc-crop-body {
  padding:16px 20px; display:flex; flex-direction:column; align-items:center; gap:10px;
}
.vc-crop-stage-wrap { max-width:100%; overflow:auto; }
.vc-crop-stage { position:relative; background:#000; line-height:0; }
.vc-crop-image { display:block; width:100%; height:100%; }
.vc-crop-rect {
  position:absolute; border:1.5px solid #fff;
  box-shadow:0 0 0 9999px rgba(0,0,0,0.55);
  cursor:move; box-sizing:border-box;
}
.vc-handle {
  position:absolute; width:12px; height:12px; background:#fff;
  border:1px solid var(--accent); border-radius:2px;
}
.vc-handle-n { top:-6px; left:50%; transform:translateX(-50%); cursor:ns-resize; }
.vc-handle-s { bottom:-6px; left:50%; transform:translateX(-50%); cursor:ns-resize; }
.vc-handle-w { left:-6px; top:50%; transform:translateY(-50%); cursor:ew-resize; }
.vc-handle-e { right:-6px; top:50%; transform:translateY(-50%); cursor:ew-resize; }
.vc-handle-nw { left:-6px; top:-6px; cursor:nwse-resize; }
.vc-handle-ne { right:-6px; top:-6px; cursor:nesw-resize; }
.vc-handle-sw { left:-6px; bottom:-6px; cursor:nesw-resize; }
.vc-handle-se { right:-6px; bottom:-6px; cursor:nwse-resize; }
.vc-crop-readout {
  font-family:'SF Mono','Consolas',monospace; font-size:12px; color:var(--text-secondary);
}
.vc-crop-tip { font-size:11px; color:var(--text-muted); }
.vc-crop-foot {
  display:flex; align-items:center; gap:8px;
  padding:12px 20px; border-top:1px solid var(--border-color);
}
