/* 拼多多上传管理：SN 详情与居中确认弹窗 */

body.pdd-upload-modal-open,
body.pdd-upload-confirm-open {
  overflow: hidden;
}

.pdd-upload-detail-backdrop {
  z-index: 50;
}

.pdd-upload-confirm-backdrop {
  z-index: 70;
}

.pdd-upload-detail-modal {
  width: min(1120px, 100%);
  height: min(85vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
}

.pdd-upload-detail-modal > .modal-header,
.pdd-upload-detail-modal > .modal-footer {
  flex: 0 0 auto;
}

.pdd-upload-detail-modal > .modal-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px;
  background: #f5f7fa;
}

.pdd-upload-detail-modal-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--muted);
  font-size: 11px;
}

.pdd-upload-detail-modal-meta > span:not(.status) + span:not(.status)::before {
  content: "·";
  margin-right: 10px;
  color: #c5c9d0;
}

.pdd-upload-detail-modal #pddUploadDetailPrimaryAction {
  display: flex;
}

.pdd-upload-detail-modal #pddUploadDetailPrimaryAction .primary-button {
  min-width: 126px;
}

.pdd-upload-order-detail {
  display: grid;
  gap: 10px;
}

.pdd-upload-detail-toolbar {
  min-height: 42px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #ffffff;
}

.pdd-upload-detail-toolbar > div:first-child {
  display: grid;
  gap: 2px;
}

.pdd-upload-detail-toolbar > div:first-child strong {
  color: #111827;
  font-size: 13px;
}

.pdd-upload-detail-toolbar > div:first-child span {
  color: var(--text-muted);
  font-size: 11px;
}

.pdd-upload-detail-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.pdd-upload-detail-actions .secondary-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11px;
}

.pdd-upload-sn-list {
  display: grid;
  gap: 8px;
}

.pdd-upload-sn-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e1e5eb;
  border-radius: 6px;
  background: #ffffff;
}

.pdd-upload-sn-main {
  min-height: 38px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pdd-upload-sn-identity {
  min-width: 0;
}

.pdd-upload-sn-title {
  flex-wrap: wrap;
  gap: 6px;
}

.pdd-upload-sn-title strong {
  color: #111827;
  font-size: 13px;
}

.pdd-upload-sn-meta {
  margin-top: 4px;
  flex-wrap: wrap;
  gap: 3px 10px;
  color: var(--text-muted);
  font-size: 11px;
}

.pdd-upload-sn-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 10px;
  color: #c6cbd2;
}

.pdd-upload-sn-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
}

.pdd-upload-sn-actions .text-button {
  min-height: 28px;
  padding: 0 6px;
  font-size: 11px;
}

.pdd-upload-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}

.pdd-upload-photo-card {
  min-width: 0;
  overflow: visible;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
  background: #ffffff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.pdd-upload-photo-card:hover {
  border-color: #f0a7a1;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.07);
}

.pdd-upload-photo-card:has([data-pdd-upload-photo-select]:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(225, 37, 27, 0.08);
}

.pdd-upload-photo-card.is-excluded {
  border-style: dashed;
  background: #fafafa;
}

.pdd-upload-photo-card.is-excluded .pdd-upload-thumb {
  filter: grayscale(0.8);
  opacity: 0.58;
}

.pdd-upload-photo-visual {
  position: relative;
  height: 94px;
  overflow: hidden;
  border-radius: 5px 5px 0 0;
  background: #f3f5f7;
}

.pdd-upload-thumb {
  width: 100%;
  height: 100%;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f3f5f7;
  color: var(--text-muted);
}

.pdd-upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pdd-upload-photo-select,
.pdd-upload-photo-excluded-label {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  min-height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  font-size: 10px;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.11);
}

.pdd-upload-photo-select input {
  accent-color: var(--primary);
}

.pdd-upload-photo-excluded-label {
  color: #ad6800;
  background: rgba(255, 251, 230, 0.96);
}

.pdd-upload-photo-meta {
  min-width: 0;
  padding: 7px;
  display: grid;
  gap: 4px;
}

.pdd-upload-photo-title {
  min-width: 0;
  justify-content: space-between;
  gap: 5px;
}

.pdd-upload-photo-meta strong {
  min-width: 0;
  overflow: hidden;
  color: #1f2937;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-photo-meta > span {
  color: var(--text-muted);
  font-size: 10px;
}

.pdd-upload-photo-actions {
  min-height: 26px;
  gap: 1px;
}

.pdd-upload-photo-actions .text-button {
  min-height: 26px;
  padding: 0 5px;
  color: #334155;
  font-size: 10px;
}

.pdd-upload-photo-menu {
  margin-left: auto;
}

.pdd-upload-photo-empty {
  grid-column: 1 / -1;
  min-height: 54px;
  padding: 10px 12px;
  display: grid;
  place-items: center;
  border: 1px dashed #ffe58f;
  border-radius: 5px;
  background: #fffbe6;
  color: #ad6800;
  font-size: 11px;
  text-align: center;
}

.pdd-upload-confirm-modal {
  width: min(540px, 100%);
  max-height: min(78vh, 680px);
  overflow: hidden;
  border-radius: 8px;
}

.pdd-upload-confirm-modal > .modal-body {
  max-height: calc(78vh - 110px);
  overflow-y: auto;
  padding: 18px;
}

.pdd-upload-confirm-message {
  color: #374151;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 820px) {
  .pdd-upload-detail-modal {
    height: calc(100vh - 24px);
  }

  .pdd-upload-detail-toolbar,
  .pdd-upload-sn-main {
    align-items: stretch;
    flex-direction: column;
  }

  .pdd-upload-detail-actions,
  .pdd-upload-sn-actions {
    justify-content: flex-start;
  }

  .pdd-upload-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}

@media (max-width: 560px) {
  .pdd-upload-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
