/* 拼多多上传管理：紧凑订单卡片与横向筛选 */

.pdd-upload-filter-panel {
  padding: 8px 18px 12px;
  overflow: visible;
  border-radius: 8px;
}

.pdd-upload-quick-filters {
  display: grid;
}

.pdd-upload-filter-choice-row,
.pdd-upload-search-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
}

.pdd-upload-filter-choice-label {
  padding-top: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pdd-upload-filter-choice-options {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 22px;
  overflow: hidden;
}

.pdd-upload-filter-choice-options.is-collapsible {
  max-height: 30px;
}

.pdd-upload-filter-choice-options.is-expanded {
  max-height: none;
}

.pdd-upload-filter-choice {
  position: relative;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4b5563;
  font-size: 12px;
  white-space: nowrap;
}

.pdd-upload-filter-choice:hover {
  color: var(--primary);
}

.pdd-upload-filter-choice.is-active {
  color: var(--primary);
  font-weight: 700;
}

.pdd-upload-filter-choice.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.pdd-upload-filter-expand {
  min-height: 28px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.pdd-upload-filter-expand .inline-icon {
  transform: rotate(90deg);
  transition: transform 0.16s ease;
}

.pdd-upload-filter-expand.is-expanded .inline-icon {
  transform: rotate(-90deg);
}

.pdd-upload-search-row {
  grid-template-columns: 76px minmax(240px, 360px) minmax(180px, 260px) auto auto;
  align-items: center;
  padding-top: 8px;
  border-bottom: 0;
}

.pdd-upload-search-row > .pdd-upload-filter-choice-label {
  padding-top: 0;
}

.pdd-upload-search-field {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.pdd-upload-search-field > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.pdd-upload-search-field input {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
}

.pdd-upload-date-filter {
  position: relative;
}

.pdd-upload-date-filter > summary {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: #4b5563;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  white-space: nowrap;
}

.pdd-upload-date-filter > summary::-webkit-details-marker {
  display: none;
}

.pdd-upload-date-filter-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 35;
  min-width: 280px;
  padding: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.pdd-upload-date-filter-popover label {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pdd-upload-date-filter-popover input {
  min-height: 32px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 12px;
}

.pdd-upload-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdd-upload-filter-actions .primary-button,
.pdd-upload-filter-actions .secondary-button {
  min-height: 32px;
  font-size: 12px;
}

.pdd-upload-panel {
  overflow: visible;
  border-radius: 8px;
}

.pdd-upload-panel-header {
  min-height: 58px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.pdd-upload-heading-line,
.pdd-upload-page-actions,
.pdd-upload-card-heading,
.pdd-upload-card-shop,
.pdd-upload-card-metrics,
.pdd-upload-card-platform,
.pdd-upload-card-actions,
.pdd-upload-card-task > div,
.pdd-upload-detail-actions,
.pdd-upload-photo-actions,
.pdd-upload-sn-title,
.pdd-upload-sn-meta,
.pdd-upload-photo-title {
  display: flex;
  align-items: center;
}

.pdd-upload-heading-line {
  gap: 10px;
  flex-wrap: wrap;
}

.pdd-upload-total {
  padding: 3px 8px;
  border-radius: 999px;
  color: #595959;
  background: #f5f5f5;
  font-size: 12px;
}

.pdd-upload-status-sync-hint {
  color: #667085;
  font-size: 11px;
}

.pdd-upload-status-sync-hint[data-phase="SCHEDULED"],
.pdd-upload-status-sync-hint[data-phase="QUEUING"],
.pdd-upload-status-sync-hint[data-phase="RUNNING"] {
  color: #ad6800;
}

.pdd-upload-status-sync-hint[data-phase="FAILED"] {
  color: #cf1322;
}

.pdd-upload-status-sync-hint[data-phase="FRESH"] {
  color: #237804;
}

.pdd-upload-page-actions {
  justify-content: flex-end;
  gap: 10px;
}

.pdd-upload-select-page {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: #4b5563;
  font-size: 12px;
}

.pdd-upload-page-menu,
.pdd-upload-action-menu {
  position: relative;
}

.pdd-upload-batch-bar {
  position: sticky;
  top: 76px;
  z-index: 12;
  min-height: 48px;
  margin: 8px 14px 0;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #ffccc7;
  border-radius: 6px;
  background: #fff2f0;
  box-shadow: 0 6px 16px rgba(207, 19, 34, 0.08);
}

.pdd-upload-batch-bar[hidden] {
  display: none;
}

.pdd-upload-batch-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
}

.pdd-upload-batch-copy > .inline-icon {
  width: 18px;
  height: 18px;
}

.pdd-upload-batch-copy strong {
  font-size: 13px;
}

.pdd-upload-card-grid {
  padding: 12px 14px 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  align-items: stretch;
  gap: 12px;
}

.pdd-upload-order-card {
  min-width: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.pdd-upload-order-card:hover {
  transform: translateY(-1px);
  border-color: #f0a7a1;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.pdd-upload-order-card.is-complete {
  border-top: 3px solid #73d13d;
}

.pdd-upload-order-card.is-missing {
  border-top: 3px solid #fadb14;
}

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

.pdd-upload-card-body {
  height: 100%;
  padding: 11px;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto 1fr auto;
  gap: 8px;
}

.pdd-upload-card-kicker,
.pdd-upload-card-state-stack,
.pdd-upload-card-timeline {
  display: flex;
  align-items: center;
}

.pdd-upload-card-kicker {
  min-height: 24px;
  justify-content: space-between;
  gap: 8px;
}

.pdd-upload-card-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #667085;
  font-size: 11px;
  cursor: pointer;
}

.pdd-upload-card-state-stack {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.pdd-upload-card-heading {
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
}

.pdd-upload-card-order-link {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-order-link:hover {
  color: var(--primary);
}

.pdd-upload-card-shop {
  min-width: 0;
  gap: 7px;
  color: #667085;
  font-size: 11px;
}

.pdd-upload-card-shop span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-shop span + span::before {
  content: "·";
  margin-right: 7px;
  color: #c5c9d0;
}

.pdd-upload-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pdd-upload-card-metrics > span {
  min-width: 0;
  min-height: 48px;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #f8f9fb;
}

.pdd-upload-card-metrics strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.1;
}

.pdd-upload-card-metrics small {
  margin-top: 3px;
  overflow: hidden;
  color: #8a8f98;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-metrics .is-success {
  color: #237804;
  border-color: #d9f7be;
  background: #f6ffed;
}

.pdd-upload-card-metrics .is-warning {
  color: #ad6800;
  border-color: #ffe58f;
  background: #fffbe6;
}

.pdd-upload-card-platform {
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid #f0f1f3;
  color: #8a8f98;
  font-size: 10px;
}

.pdd-upload-card-platform > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-task {
  min-height: 32px;
  padding: 6px 8px;
  display: grid;
  gap: 3px;
  border-radius: 5px;
  background: #f7f8fa;
  color: #6b7280;
  font-size: 10px;
}

.pdd-upload-card-task > div {
  min-width: 0;
  gap: 6px;
}

.pdd-upload-card-task > div > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-task p {
  margin: 0;
  overflow: hidden;
  color: #cf1322;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-task.is-empty {
  place-items: center start;
}

.pdd-upload-card-timeline {
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
  color: #98a0ad;
  font-size: 10px;
}

.pdd-upload-card-timeline span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-upload-card-actions {
  min-width: 0;
  gap: 6px;
  align-self: end;
  padding-top: 2px;
}

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

.pdd-upload-card-actions .pdd-upload-row-primary {
  flex: 1 1 auto;
}

.pdd-upload-card-actions .pdd-upload-order-menu {
  margin-left: auto;
}

.pdd-upload-empty {
  margin: 14px;
}

.pdd-upload-action-menu > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.pdd-upload-action-menu > summary::-webkit-details-marker {
  display: none;
}

.pdd-upload-action-menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.pdd-upload-action-menu-popover .text-button {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  padding: 0 10px;
  color: var(--text);
  text-decoration: none;
}

.pdd-upload-action-menu-popover .text-button:hover {
  background: #f5f7fa;
}

.pdd-upload-action-menu-popover .text-button.danger {
  color: var(--danger);
}

@media (max-width: 1180px) {
  .pdd-upload-search-row {
    grid-template-columns: 76px repeat(2, minmax(180px, 1fr));
  }

  .pdd-upload-date-filter,
  .pdd-upload-filter-actions {
    grid-column: auto;
  }

  .pdd-upload-filter-actions {
    grid-column: 2 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 820px) {
  .pdd-upload-panel-header,
  .pdd-upload-batch-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pdd-upload-page-actions,
  .pdd-upload-batch-bar > .actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .pdd-upload-filter-choice-row,
  .pdd-upload-search-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pdd-upload-filter-choice-label {
    padding-top: 0;
  }

  .pdd-upload-filter-expand {
    justify-self: start;
  }

  .pdd-upload-filter-actions {
    grid-column: auto;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .pdd-upload-card-grid {
    grid-template-columns: 1fr;
  }

  .pdd-upload-search-field {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pdd-upload-card-actions {
    flex-wrap: wrap;
  }
}
