/* ==========================================================================
   OzonAI Variant Matrix & Image/Video Centers (Identical to Plugin UI)
   ========================================================================== */

.pvm-container {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-top: 18px;
  margin-bottom: 24px;
  overflow: hidden;
}

/* Header */
.pvm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.pvm-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.pvm-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}
.pvm-count {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}
.pvm-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Header Buttons */
.pvm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}
.pvm-btn-outline {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #334155;
}
.pvm-btn-outline:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
}
.pvm-btn-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}
.pvm-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.pvm-btn-danger-outline {
  border-color: #fca5a5;
  background: #ffffff;
  color: #ef4444;
}
.pvm-btn-danger-outline:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
}

/* Table Wrapper */
.pvm-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  width: 100%;
}
.pvm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
  min-width: 1380px;
}
.pvm-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  padding: 10px 10px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  vertical-align: middle;
}
.pvm-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  background: #ffffff;
}
.pvm-table tbody tr:hover td {
  background: #fafafa;
}

/* Header Links ("一键同首行") */
.pvm-th-action {
  display: block;
  font-size: 11px;
  color: #2563eb;
  cursor: pointer;
  margin-top: 3px;
  font-weight: 400;
  text-decoration: none;
}
.pvm-th-action:hover {
  text-decoration: underline;
}

/* Table Cells */
/* 1. Checkbox & Index */
.pvm-cell-chk {
  width: 55px;
  text-align: center;
}
.pvm-chk-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-weight: 600;
  color: #64748b;
  font-size: 12px;
}
.pvm-chk {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
}

/* 2. Image Cell */
.pvm-cell-img {
  width: 75px;
}
.pvm-img-box {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pvm-img-box:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}
.pvm-img-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pvm-img-empty {
  font-size: 11px;
  color: #94a3b8;
}
.pvm-img-badge {
  position: absolute;
  left: 2px;
  top: 2px;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
}

/* 3. Title Cell */
.pvm-cell-title {
  min-width: 200px;
  max-width: 240px;
}
.pvm-title-wrap-cell {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  position: relative;
}
.pvm-title-textarea-wrap {
  position: relative;
  flex: 1;
}
.pvm-title-textarea {
  width: 100%;
  height: 60px;
  padding: 6px 8px;
  padding-bottom: 18px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-sizing: border-box;
  font-size: 11.5px;
  line-height: 1.35;
  color: #1e293b;
  resize: vertical;
}
.pvm-title-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.pvm-title-counter {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 10px;
  color: #94a3b8;
  pointer-events: none;
  user-select: none;
}
/* Blue circular AI button */
.pvm-ai-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pvm-ai-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}
.pvm-ai-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.pvm-ai-btn.is-loading {
  animation: pvm-spin 1s linear infinite;
  opacity: 0.8;
}
@keyframes pvm-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 4. Video Cell */
.pvm-cell-video {
  width: 75px;
  text-align: center;
}
.pvm-video-thumb-box {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pvm-video-thumb-box:hover {
  border-color: #3b82f6;
}
.pvm-video-play-icon {
  width: 22px;
  height: 22px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}
.pvm-video-check-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 5. Rich Text Cell */
.pvm-cell-richtext {
  width: 65px;
  text-align: center;
}
.pvm-doc-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
  background: #ffffff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pvm-doc-btn:hover {
  border-color: #3b82f6;
  color: #2563eb;
  background: #eff6ff;
}
.pvm-doc-btn.has-content {
  border-style: solid;
  border-color: #93c5fd;
  background: #eff6ff;
  color: #2563eb;
}

/* 6. SKU / 货号 */
.pvm-cell-sku {
  width: 125px;
}
.pvm-inp-sku {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  box-sizing: border-box;
  color: #334155;
}

/* 7, 8, 9, 10. Prices */
.pvm-cell-price {
  width: 95px;
}
.pvm-price-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}
.pvm-currency-symbol {
  font-size: 11px;
  color: #64748b;
  margin-right: 4px;
  user-select: none;
}
.pvm-inp-price {
  width: 100%;
  height: 32px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  box-sizing: border-box;
  color: #0f172a;
}
.pvm-inp-price:focus, .pvm-inp-sku:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.pvm-profit-badge {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  margin-top: 3px;
  color: #16a34a;
  white-space: nowrap;
}
.pvm-profit-badge.is-negative {
  color: #ef4444;
}

/* 11. Packaging Dimensions */
.pvm-cell-dims {
  width: 135px;
}
.pvm-dims-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
}
.pvm-inp-dim {
  width: 36px;
  height: 30px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 11.5px;
  box-sizing: border-box;
  padding: 0 2px;
}
.pvm-dim-mul {
  color: #94a3b8;
  font-size: 12px;
  user-select: none;
}

/* 12. Weight */
.pvm-cell-weight {
  width: 75px;
}
.pvm-inp-weight {
  width: 60px;
  height: 30px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 11.5px;
  box-sizing: border-box;
  padding: 0 4px;
}

/* 13. Delete Button */
.pvm-cell-op {
  width: 65px;
  text-align: center;
}
.pvm-btn-del {
  padding: 4px 10px;
  background: #f87171;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.pvm-btn-del:hover {
  background: #ef4444;
}

/* Modals */
.pvm-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pvm-modal-box {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pvm-modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pvm-modal-pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.pvm-modal-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.pvm-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pvm-modal-close {
  border: none;
  background: #e2e8f0;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  color: #475569;
}
.pvm-modal-close:hover {
  background: #cbd5e1;
  color: #0f172a;
}
.pvm-modal-bd {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.pvm-modal-ft {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Gallery Grid in Image Processing Center */
.pvm-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.pvm-gallery-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}
.pvm-gallery-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.pvm-gallery-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #f1f5f9;
}
.pvm-gallery-meta {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pvm-gallery-tag {
  font-size: 10px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pvm-gallery-ops {
  display: flex;
  gap: 4px;
}
.pvm-gallery-btn {
  flex: 1;
  padding: 3px 0;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  text-align: center;
}
.pvm-gallery-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
}
.pvm-gallery-btn.pri {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.pvm-gallery-btn.pri:hover {
  background: #1d4ed8;
}
