@import '../../pdf/shared/style.css?v=20260524-translate-loader-fix';

/* 专属图片工具的扩展样式 */

/* 双栏预览与画质对比 (Before / After Comparison) */
.preview-compare {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 320px;
  max-height: 500px;
  border-radius: var(--tool-radius-sm);
  border: 1px solid rgba(79, 209, 255, 0.16);
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.preview-compare__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.preview-compare__before {
  z-index: 1;
}

.preview-compare__after {
  z-index: 2;
  clip-path: inset(0 0 0 50%);
}

.preview-compare__slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  outline: none;
  margin: 0;
  cursor: ew-resize;
}

.preview-compare__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 4px;
  height: 100vh;
  background: var(--ld-primary);
  box-shadow: 0 0 10px var(--ld-primary), 0 0 20px var(--ld-primary);
  cursor: ew-resize;
}

.preview-compare__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(8, 8, 30, 0.9);
  border: 2px solid var(--ld-primary);
  box-shadow: 0 0 15px rgba(79, 209, 255, 0.4), var(--tool-shadow-soft);
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ld-text);
  font-weight: bold;
}

.preview-compare__handle::before {
  content: "↔";
  font-size: 18px;
  color: var(--ld-primary);
}

.preview-compare__label {
  position: absolute;
  bottom: 12px;
  padding: 4px 10px;
  background: rgba(5, 7, 18, 0.84);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--ld-font-mono);
  color: var(--ld-text-secondary);
  z-index: 5;
  pointer-events: none;
}

.preview-compare__label--before {
  left: 12px;
}

.preview-compare__label--after {
  right: 12px;
}

/* 批量上传与处理的卡片队列 (File Batch List) */
.image-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.image-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(79, 209, 255, 0.08);
  border-radius: var(--tool-radius-sm);
  transition: all 0.2s ease;
}

.image-item:hover {
  background: rgba(79, 209, 255, 0.03);
  border-color: rgba(79, 209, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.image-item__thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.04) 0% 25%, transparent 0% 50%) 50% / 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-item__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.image-item__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ld-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-item__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ld-text-secondary);
}

.image-item__size-badge {
  font-family: var(--ld-font-mono);
}

.image-item__status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-item__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #A0AEC0;
}

.image-item__status--processing .image-item__status-dot {
  background: var(--ld-primary);
  box-shadow: 0 0 8px var(--ld-primary);
  animation: pulse-glow 1.4s infinite ease-in-out;
}

.image-item__status--done .image-item__status-dot {
  background: #48BB78;
}

.image-item__status--error .image-item__status-dot {
  background: #F56565;
}

.image-item__savings {
  font-size: 12px;
  font-weight: bold;
  color: #48BB78;
  background: rgba(72, 187, 120, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(72, 187, 120, 0.2);
}

.image-item__remove {
  background: transparent;
  border: none;
  color: var(--ld-text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.image-item__remove:hover {
  background: rgba(245, 101, 101, 0.12);
  color: #F56565;
}

/* 高级选项面板 & 范围滑块 (Options Panel & Custom Slider) */
.options-group {
  display: grid;
  gap: 8px;
}

.options-group__label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ld-text-secondary);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--tool-radius-sm);
}

.slider-container input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.slider-container input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ld-primary);
  border: 2px solid var(--ld-secondary);
  box-shadow: 0 0 10px rgba(79, 209, 255, 0.4);
  cursor: pointer;
  margin-top: -6px;
  transition: transform 0.1s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

.slider-value {
  font-family: var(--ld-font-mono);
  font-size: 14px;
  font-weight: bold;
  color: var(--ld-primary);
  min-width: 36px;
  text-align: right;
}

/* 电商尺寸预设网格 (E-commerce presets grid) */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.preset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.preset-card:hover {
  background: rgba(79, 209, 255, 0.04);
  border-color: rgba(79, 209, 255, 0.2);
}

.preset-card--active {
  background: rgba(79, 209, 255, 0.08);
  border-color: var(--ld-primary);
  box-shadow: 0 0 12px rgba(79, 209, 255, 0.15);
}

.preset-card__platform {
  font-size: 12px;
  font-weight: bold;
  color: var(--ld-text-secondary);
}

.preset-card--active .preset-card__platform {
  color: var(--ld-primary);
}

.preset-card__size {
  font-family: var(--ld-font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ld-text);
  margin-top: 4px;
}

.preset-card__ratio {
  font-size: 10px;
  color: var(--ld-text-secondary);
  opacity: 0.6;
  margin-top: 2px;
}

/* 动效 (Keyframe Animations) */
@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.6;
    box-shadow: 0 0 4px var(--ld-primary);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 12px var(--ld-primary);
  }
}
