/* Download task center: scoped to this page, using the site's existing rose/navy palette. */
.taobao-page #delivery-content { display: block; margin-top: 12px; }
.taobao-page #delivery-status:empty, .taobao-page #delivery-status[hidden] { display: none; }
.taobao-page #delivery-status { margin: 12px 0; padding: 9px 12px; font-size: 13px; }
.download-center {
  --download-ink: #1f2a3d; --download-muted: #5b6577; --download-line: #e5e8f0; --download-accent: #c9214b;
  --download-prepared: #f5c9d4; --download-track: #eef0f5; --download-success: #256344; --download-error: #a02c38;
  min-width: 0; max-width: 100%; color: var(--download-ink); font-size: 14px; line-height: 1.5;
}
.download-center * { box-sizing: border-box; }
.download-center ::selection { background: #f9d9e2; color: #7d1530; }
.download-center h2, .download-center p { margin: 0; }
.download-center small { font-size: 12px; color: var(--download-muted); }
.download-center button, .download-center select, .download-center a { -webkit-tap-highlight-color: transparent; }
.download-center :is(button,select,a):focus-visible { outline: 2px solid var(--download-accent); outline-offset: 3px; }
.download-center button:disabled { opacity: .48; cursor: not-allowed; }
.download-center a { text-underline-offset: 3px; }

/* One row per task: product, both stages on one meter, state, actions. */
.download-job-list, .download-job.is-detail { border: 1px solid var(--download-line); border-radius: 12px; background: #fff; }
/* Rows share the list's columns (subgrid), so every meter, state and action lines up down the page. */
.download-job-list { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1fr) max-content max-content; column-gap: 22px; overflow: hidden; }
.download-job {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1fr) max-content max-content;
  align-items: center; gap: 8px 22px; padding: 14px 18px;
}
.download-job-list > .download-job { grid-column: 1 / -1; grid-template-columns: subgrid; }
.download-job-list .download-job + .download-job { border-top: 1px solid var(--download-line); }
.download-job-list .download-job:hover { background: #fafbfd; }
.download-job-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.download-job-title { min-width: 0; }
.download-job-title h2 { font-size: 14px; font-weight: 600; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.download-job.is-detail .download-job-title h2 { font-size: 17px; font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.download-job-link { color: inherit; text-decoration: none; }
.download-job-link:hover { color: var(--download-accent); text-decoration: underline; }
.download-job-title small { display: block; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.download-job-progress { min-width: 0; }
.download-job-state { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.download-job-error { grid-column: 1 / -1; max-width: 75ch; }
.download-job-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 12px; border-top: 1px solid var(--download-line); }

.download-badge { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 9px; border-radius: 6px; background: #f1f3f7; color: var(--download-muted); font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.download-badge::before { content: ''; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; }
.download-badge.success { color: var(--download-success); background: #edf7f1; }
.download-badge.active { color: #ad2042; background: #fff0f4; }
.download-badge.error { color: #8c441b; background: #fff4e9; }
.download-job[data-tone="active"] .download-badge.active::before { animation: download-live 1.6s ease-in-out infinite; }
@keyframes download-live { 50% { opacity: .25; } }

/* Two-stage meter: light = prepared on the server, solid = saved on the selected device. */
.download-meter__line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.download-meter__lead { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; }
.download-meter__lead strong { font-size: 13px; color: var(--download-ink); }
.download-meter__ready, .download-meter__eta { color: var(--download-muted); white-space: nowrap; }
.download-meter__track { position: relative; height: 8px; margin-top: 6px; border-radius: 999px; background: var(--download-track); overflow: hidden; }
.download-job.is-detail .download-meter__track { height: 10px; }
.download-meter__prepared { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--download-prepared); transition: width .45s cubic-bezier(.16,1,.3,1); }
.download-meter progress { position: relative; display: block; width: 100%; height: 100%; margin: 0; border: 0; appearance: none; background: transparent; color: var(--download-accent); }
.download-meter progress::-webkit-progress-bar { background: transparent; }
.download-meter progress::-webkit-progress-value { background: var(--download-accent); border-radius: 999px; transition: width .45s cubic-bezier(.16,1,.3,1); }
.download-meter progress::-moz-progress-bar { background: var(--download-accent); border-radius: 999px; }
.download-center .download-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; font-size: 12px; color: var(--download-muted); font-variant-numeric: tabular-nums; }
.download-center .download-result strong { font-size: 13px; color: var(--download-success); }
.download-center .download-hint { font-size: 12px; line-height: 1.6; color: var(--download-muted); }
.download-center .download-error-text, .download-center .download-item-error { color: #8c441b; font-size: 12px; line-height: 1.6; }

.download-current { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 520px; }
.download-current > div { min-width: 0; }
.download-current small { display: block; font-size: 11px; }
.download-current-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.download-thumb { width: 44px; height: 44px; flex: 0 0 44px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 8px; background: #f4f5f8; color: var(--download-muted); font-size: 10px; text-align: center; }
.download-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.download-thumb.is-placeholder { color: #9aa3b2; }

.download-device-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.download-device-row label { font-size: 12px; color: var(--download-muted); }
.download-device-row select { width: auto; max-width: 100%; min-height: 34px; padding: 5px 30px 5px 10px; border: 1px solid var(--download-line); border-radius: 7px; color: var(--download-ink); background-color: #fff; font: inherit; font-size: 12px; }

.download-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 6px 14px; }
.download-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 5px 12px; border: 1px solid var(--download-line); border-radius: 7px; background: #fff; color: var(--download-ink); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: border-color .15s, background .15s, color .15s; }
.download-button:hover { border-color: #e7a9ba; color: var(--download-accent); background: #fff7f9; }
.download-button.primary { background: var(--download-accent); color: #fff; border-color: var(--download-accent); }
.download-button.primary:hover { background: #aa1a3f; color: #fff; }
.download-text-button { border: 0; padding: 6px 0; min-height: 32px; background: none; color: var(--download-muted); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.download-text-button:hover { color: var(--download-ink); text-decoration: underline; text-underline-offset: 3px; }
.download-text-button.danger { color: var(--download-error); }
.download-back { margin-bottom: 8px; }

.download-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 20px 0 10px; }
.download-toolbar h2 { font-size: 15px; font-weight: 700; }
.download-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.download-filters .download-button[aria-pressed=true] { color: var(--download-accent); border-color: #efb6c5; background: #fff0f4; }

/* Per-product table: two-stage image meter in place of two text lines. */
.download-table-wrap { border: 1px solid var(--download-line); border-radius: 12px; background: #fff; overflow: hidden; }
.download-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 12px; }
.download-table th { text-align: left; background: #f9fafc; color: var(--download-muted); padding: 9px 14px; font-weight: 600; }
.download-table th:first-child { width: 42%; }
.download-table th:nth-child(4) { width: 18%; }
.download-table th:last-child { width: 16%; }
.download-table td { padding: 10px 14px; border-top: 1px solid var(--download-line); vertical-align: middle; }
.download-table tr[data-state="error"] td { background: #fffaf6; }
.download-table td > small { display: block; font-size: 11px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.download-product { display: flex; align-items: center; gap: 12px; }
.download-product > div { min-width: 0; }
.download-product-link { color: var(--download-ink); font-weight: 600; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.download-product-link:hover { color: var(--download-accent); text-decoration: underline; }
.download-product small { display: block; margin-top: 2px; font-size: 11px; }
.download-center .download-item-error { margin: 6px 0 0 56px; }
.download-center .download-skipped { display: block; margin-top: 4px; color: #8c441b; font-size: 11px; }
.download-center .download-item-detail { display: block; margin: 2px 0 0 56px; color: var(--sc-muted, #6b7280); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.download-table .download-hint { display: block; margin: 0; }
.download-image-meter { display: grid; gap: 5px; min-width: 0; }
.download-image-meter__count { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--download-ink); }
.download-image-meter__track { position: relative; height: 6px; border-radius: 999px; background: var(--download-track); overflow: hidden; }
.download-image-meter__prepared, .download-image-meter__saved { position: absolute; inset: 0 auto 0 0; border-radius: inherit; }
.download-image-meter__prepared { background: var(--download-prepared); }
.download-image-meter__saved { background: var(--download-accent); }
.download-muted { color: var(--download-muted); }
.download-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.download-empty, .download-empty-filter { padding: 38px 20px; text-align: center; border: 1px solid var(--download-line); border-radius: 12px; background: #fff; }
.download-empty p { color: var(--download-muted); margin: 10px 0 20px; }
.download-job-list + .download-hint { margin-top: 10px; }

@media (max-width: 980px) {
  .download-job-list { display: block; }
  .download-job, .download-job-list > .download-job { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
  .download-job-main { grid-column: 1; }
  .download-job-state { grid-column: 2; grid-row: 1; align-items: flex-end; }
  .download-job-progress { grid-column: 1 / -1; }
  .download-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .download-job { padding: 14px; }
  .download-job-title small { white-space: normal; }
  .download-actions { flex-wrap: wrap; }
  .download-toolbar { align-items: flex-start; }
  .download-toolbar h2 { width: 100%; }
  .download-table, .download-table tbody, .download-table tr { display: block; }
  .download-table thead { display: none; }
  .download-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); padding: 14px; gap: 10px 12px; }
  .download-table tr + tr { border-top: 1px solid var(--download-line); }
  .download-table td { border: 0; padding: 0; background: none !important; }
  .download-table td:first-child { grid-column: 1 / -1; padding-bottom: 3px; }
  .download-table td:not(:first-child)::before { content: attr(data-label); display: block; color: var(--download-muted); font-size: 11px; margin-bottom: 4px; }
  .download-center .download-item-error { margin-left: 0; }
  .download-center .download-item-detail { margin-left: 0; }
  .download-table td:last-child:has(> .download-muted) { display: none; }
  .download-button, .download-text-button { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .download-meter__prepared, .download-meter progress::-webkit-progress-value, .download-button { transition: none; }
  .download-job[data-tone="active"] .download-badge.active::before { animation: none; }
}
