/* ═══════════════════════════════════════════════════════════════
   SKU 图片工作台 (2026-10-23)
   原图区 + AI 生成区并列 / 文字按钮 / 拖拽手柄 / 自绘确认 / 生成进度
   仅作用于 #skuImageEditor 弹窗，不影响其它页面
   ═══════════════════════════════════════════════════════════════ */

/* ——— 分区 ——— */
.wb-section {
  border: 1px solid #E4EAF2;
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px 16px;
  margin-bottom: 14px;
}
.wb-section:last-child { margin-bottom: 0; }

.wb-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.wb-section__title {
  font-size: 14px;
  font-weight: 700;
  color: #1B3A6B;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wb-count {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  background: #F1F5F9;
  border-radius: 999px;
  padding: 2px 9px;
}
.wb-section__hint {
  font-size: 12px;
  color: #94A3B8;
}

/* ——— 通用文字按钮 ——— */
.wb-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  line-height: 26px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.wb-btn:hover { background: #F8FAFC; border-color: #CBD5E1; color: #1B3A6B; }
.wb-btn:disabled { opacity: .45; cursor: not-allowed; }
.wb-btn--primary { background: #2563EB; border-color: #2563EB; color: #fff; }
.wb-btn--primary:hover { background: #1D4ED8; border-color: #1D4ED8; color: #fff; }
.wb-btn--danger { color: #DC2626; border-color: #FECACA; background: #FEF7F7; }
.wb-btn--danger:hover { background: #FEE2E2; border-color: #FCA5A5; color: #B91C1C; }
.wb-btn--danger-solid { background: #DC2626; border-color: #DC2626; color: #fff; }
.wb-btn--danger-solid:hover { background: #B91C1C; border-color: #B91C1C; color: #fff; }

/* ——— 原图区网格 ——— */
.sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.sku-img-card {
  position: relative;
  border: 1px solid #E4EAF2;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.sku-img-card:hover {
  border-color: #BFD3F5;
  box-shadow: 0 6px 18px rgba(16, 35, 58, .10);
}
.sku-img-card.translated { border-color: #86EFAC; }
.sku-img-card.ai { border-color: #BFD3F5; background: #F8FBFF; }
.sku-img-card[dragging], .sku-img-card.is-dragging { opacity: .5; }

.sku-img-card__head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 6px;
}
.sku-img-card__no {
  width: 18px; height: 18px;
  border-radius: 5px;
  background: #1B3A6B;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.sku-img-card__role {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  white-space: nowrap;
}
.sku-img-card__badge {
  font-size: 10px;
  font-weight: 700;
  color: #1D4ED8;
  background: #EAF2FF;
  border-radius: 999px;
  padding: 1px 7px;
}
.sku-img-card__badge.is-ai { color: #1D4ED8; }
.sku-img-card__handle {
  margin-left: auto;
  width: 20px; height: 20px;
  border-radius: 5px;
  border: 1px solid #E4EAF2;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: grab;
  opacity: 0;
  transition: opacity .15s;
  flex: 0 0 auto;
}
.sku-img-card:hover .sku-img-card__handle { opacity: 1; }
.sku-img-card__handle:active { cursor: grabbing; }

.sku-img-card__media {
  background: #F8FAFC;
  border-top: 1px solid #F1F5F9;
  border-bottom: 1px solid #F1F5F9;
}
.sku-img-card__media img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #F8FAFC;
}

.sku-img-card__actions {
  display: flex;
  gap: 6px;
  padding: 8px;
  flex-wrap: wrap;
}
.sku-img-card__actions .wb-btn { flex: 1 1 auto; padding: 0 6px; }

.sku-img-label {
  font-size: 11px;
  color: #94A3B8;
  padding: 0 8px 8px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ——— AI 生成区（9 槽位） ——— */
.wb-gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.wb-slot {
  border: 1px solid #E4EAF2;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .18s, box-shadow .18s;
}
.wb-slot:hover { box-shadow: 0 6px 18px rgba(16, 35, 58, .08); }
.wb-slot--ok { border-color: #BFD3F5; }
.wb-slot--busy { border-color: #FCD34D; }
.wb-slot--fail { border-color: #FECACA; background: #FFFBFB; }

.wb-slot__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px 6px;
}
.wb-slot__name {
  font-size: 12px;
  font-weight: 700;
  color: #1B3A6B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-slot__state {
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  background: #F1F5F9;
  color: #64748B;
  flex: 0 0 auto;
}
.wb-slot__state--ok { background: #E8F7EE; color: #15803D; }
.wb-slot__state--busy { background: #FEF6E4; color: #B45309; }
.wb-slot__state--fail { background: #FEF2F2; color: #B91C1C; }

.wb-slot__media {
  position: relative;
  background: #F8FAFC;
  border-top: 1px solid #F1F5F9;
  border-bottom: 1px solid #F1F5F9;
}
.wb-slot__media img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #F1F5F9;
}
.wb-slot__tag {
  position: absolute;
  left: 6px; top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 25, 40, .72);
  border-radius: 5px;
  padding: 1px 6px;
}
.wb-slot__empty {
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #B6C2D2;
  background-image: linear-gradient(#F1F5F9 1px, transparent 1px), linear-gradient(90deg, #F1F5F9 1px, transparent 1px);
  background-size: 14px 14px;
  padding: 8px;
  text-align: center;
}
.wb-slot__empty--fail { color: #EF4444; font-weight: 600; }
.wb-slot__err {
  font-size: 10px;
  font-weight: 400;
  color: #B91C1C;
  background: #FEF2F2;
  border-radius: 5px;
  padding: 3px 6px;
  max-height: 46px;
  overflow: hidden;
  line-height: 1.35;
}
.wb-slot__busy { color: #B45309; font-weight: 600; }

.wb-slot__actions {
  display: flex;
  gap: 6px;
  padding: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.wb-slot__actions .wb-btn { flex: 1 1 auto; padding: 0 6px; }
.wb-slot__hint { font-size: 11px; color: #B45309; font-weight: 600; }

/* 转圈 */
.wb-spinner {
  width: 20px; height: 20px;
  border: 2.5px solid #FDE68A;
  border-top-color: #F59E0B;
  border-radius: 50%;
  animation: wb-spin .8s linear infinite;
  display: inline-block;
}
@keyframes wb-spin { to { transform: rotate(360deg); } }

/* ——— 空态 ——— */
.wb-empty {
  text-align: center;
  padding: 56px 20px;
  color: #94A3B8;
  font-size: 13px;
}
.wb-empty__icon {
  width: 44px; height: 44px;
  margin: 0 auto 10px;
  border-radius: 12px;
  border: 2px dashed #CBD5E1;
  background: #F8FAFC;
}

/* ——— 批量生成进度浮层 ——— */
.wb-progress {
  display: none;
  position: fixed;
  right: 24px;
  top: 88px;
  width: 268px;
  z-index: 3000;
  background: #fff;
  border: 1px solid #E4EAF2;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 35, 58, .16);
  padding: 12px 14px 10px;
}
.wb-progress__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.wb-progress__title { font-size: 13px; font-weight: 700; color: #1B3A6B; }
.wb-progress__num { font-size: 12px; font-weight: 700; color: #2563EB; }
.wb-progress__bar {
  height: 6px;
  border-radius: 999px;
  background: #EFF3F8;
  overflow: hidden;
}
.wb-progress__bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563EB, #60A5FA);
  transition: width .25s ease;
}
.wb-progress__meta {
  font-size: 11px;
  color: #64748B;
  margin-top: 7px;
  min-height: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-progress__ops { margin-top: 9px; text-align: right; }

/* ——— 删除确认（自绘） ——— */
.wb-confirm-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3100;
  background: rgba(15, 25, 40, .42);
  align-items: center;
  justify-content: center;
}
.wb-confirm {
  width: 320px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(16, 35, 58, .26);
  padding: 18px 18px 14px;
}
.wb-confirm__title {
  font-size: 14px;
  font-weight: 700;
  color: #1B3A6B;
  margin-bottom: 12px;
}
.wb-confirm__body { display: flex; gap: 12px; align-items: center; }
.wb-confirm__thumb {
  width: 64px; height: 85px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #E4EAF2;
  background: #F1F5F9;
  flex: 0 0 auto;
}
.wb-confirm__meta { font-size: 12px; color: #475569; font-weight: 600; }
.wb-confirm__warn { font-size: 11px; color: #DC2626; font-weight: 500; margin-top: 4px; }
.wb-confirm__ops {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
