/* 淘宝一键套图：视觉语言与亚马逊一键套图（static/css/amazon-bundle/**）逐条对齐——
   同一套石墨工作台 token、中性白色强调（无紫色）、同款上传/预览、白色主按钮、
   积分 chip、结果行状态色，以及直接移植的「开始 AI 分析」生成中动画。 */

/* ---------- shell（对齐 amazon-bundle/shell.css） ---------- */
body.taobao-bundle-open { overflow: hidden; }

.taobao-bundle-overlay {
  --tb-bg: #0b0e10;
  --tb-deep: #080a0c;
  --tb-surface: #121618;
  --tb-raised: #181d20;
  --tb-active: #202629;
  --tb-line: rgba(255,255,255,.11);
  --tb-line-strong: rgba(255,255,255,.24);
  --tb-text: #f1f3f2;
  --tb-muted: #a4acaa;
  --tb-dim: #7d8784;
  --tb-action: #f2f2f0;
  --tb-action-soft: rgba(255,255,255,.055);
  --tb-success: #71c29a;
  --tb-error: #ff7464;
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5,6,8,.78);
  backdrop-filter: blur(8px);
  font-family: var(--app-font-ui, "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif);
}

.taobao-bundle-overlay[hidden] { display: none; }

.taobao-bundle-dialog {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(900px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--tb-text);
  background: var(--tb-surface);
  border: 1px solid var(--tb-line);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0,0,0,.58);
  outline: none;
}

/* 与亚马逊一致：压掉 studio.css 全局紫色 focus 圈（石墨描边 + 纯黑投影）。 */
.taobao-bundle-dialog:focus,
.taobao-bundle-dialog:focus-visible {
  box-shadow: 0 30px 90px rgba(0,0,0,.58) !important;
}

.taobao-bundle-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.taobao-bundle-header > div { min-width: 0; }

.taobao-bundle-kicker {
  display: block;
  margin: 0 0 6px;
  color: var(--tb-muted);
  font-size: 11px;
  font-weight: 650;
}

.taobao-bundle-header h2 {
  margin: 0;
  color: var(--tb-text);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.3;
}

.taobao-bundle-header p {
  max-width: 62ch;
  margin: 6px 0 0;
  color: var(--tb-muted);
  font-size: 12px;
  line-height: 1.55;
}

.taobao-bundle-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--tb-muted);
  background: rgba(255,255,255,.04);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.taobao-bundle-close:hover,
.taobao-bundle-close:focus-visible {
  border-color: var(--tb-line-strong);
  color: var(--tb-text);
  background: var(--tb-action-soft);
  outline: none;
}

.taobao-bundle-body {
  min-height: 0;
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 18px 22px;
  scrollbar-color: rgba(255,255,255,.22) transparent;
  scrollbar-width: thin;
}

/* ---------- 上传 + 预览（对齐 amazon-bundle/source.css：左虚线上传框、
   右预览区，80px 圆角 tile + 右上角圆形 X） ---------- */
.taobao-bundle-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.taobao-bundle-upload {
  min-height: 96px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px dashed rgba(255,255,255,.24);
  border-radius: 6px;
  color: var(--tb-text);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  text-align: center;
}

.taobao-bundle-upload:hover {
  border-color: rgba(255,255,255,.42);
  background: rgba(255,255,255,.06);
}

.taobao-bundle-upload:focus-visible {
  border-color: var(--tb-line-strong);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.1);
}

.taobao-bundle-upload input { display: none; }
.taobao-bundle-upload-icon { color: var(--tb-text); }
.taobao-bundle-upload strong { font-size: 12px; }
.taobao-bundle-upload small { color: var(--tb-dim); }

.taobao-bundle-source-preview {
  min-height: 96px;
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 6px;
  background: var(--tb-deep);
}

.taobao-bundle-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,.16), 0 8px 24px rgba(0,0,0,.22);
}

.taobao-bundle-source-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.taobao-bundle-preview-item small {
  position: absolute;
  right: 5px;
  bottom: 3px;
  color: #fff;
  font-size: 9px;
  text-shadow: 0 1px 3px #000;
}

.taobao-bundle-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  color: #fff;
  background: rgba(16,16,16,.86);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s;
}

.taobao-bundle-preview-remove:hover,
.taobao-bundle-preview-remove:focus-visible {
  background: rgba(239,68,68,.9);
  outline: none;
}

/* ---------- 表单字段（对齐 amazon-bundle/source.css 输入语言） ---------- */
.taobao-bundle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.taobao-bundle-grid label,
.taobao-bundle-options label {
  display: grid;
  gap: 6px;
  color: var(--tb-muted);
  font-size: 11px;
  font-weight: 650;
}

.taobao-bundle-grid label:last-child { grid-column: 1 / -1; }

.taobao-bundle-grid input,
.taobao-bundle-grid textarea,
.taobao-bundle-options select,
.taobao-bundle-job input,
.taobao-bundle-job textarea,
.taobao-bundle-job select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--tb-line);
  border-radius: 5px;
  color: var(--tb-text);
  background: var(--tb-deep);
  padding: 10px 12px;
  font: inherit;
  font-size: 12px;
}

.taobao-bundle-grid input,
.taobao-bundle-options select { height: 42px; }
.taobao-bundle-grid textarea { min-height: 82px; resize: vertical; line-height: 1.55; }
.taobao-bundle-grid input::placeholder,
.taobao-bundle-grid textarea::placeholder { color: var(--tb-dim); }

.taobao-bundle-grid input:focus,
.taobao-bundle-grid textarea:focus,
.taobao-bundle-options select:focus,
.taobao-bundle-job input:focus,
.taobao-bundle-job textarea:focus,
.taobao-bundle-job select:focus {
  border-color: var(--tb-line-strong);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.1);
}

/* ---------- 顶部说明条（中性化，与亚马逊 outline 条同一语言） ---------- */
.taobao-bundle-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 14px 18px;
  border: 1px solid var(--tb-line);
  border-radius: 5px;
  background: var(--tb-action-soft);
}

.taobao-bundle-hero-copy { display: grid; gap: 5px; }
.taobao-bundle-hero-copy strong { color: var(--tb-text); font-size: 15px; font-weight: 760; }
.taobao-bundle-hero-copy span { color: var(--tb-muted); font-size: 12px; }
.taobao-bundle-hero-mark { color: var(--tb-text); font-size: 22px; font-weight: 780; }
.taobao-bundle-hero-mark span { display: block; margin-top: 4px; color: var(--tb-dim); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-align: right; }

/* ---------- 配置分区（对齐 amazon-bundle/config.css 的 section 语言） ---------- */
.taobao-bundle-panel { padding-top: 0; }

.taobao-bundle-panel > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.taobao-bundle-panel b { color: var(--tb-text); font-size: 14px; font-weight: 760; }
.taobao-bundle-panel small { max-width: 68ch; color: var(--tb-dim); font-size: 11px; line-height: 1.5; }

.taobao-bundle-style-grid,
.taobao-bundle-shot-options,
.taobao-bundle-route-options {
  display: grid;
  align-items: stretch;
  gap: 6px;
}

.taobao-bundle-style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.taobao-bundle-shot-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.taobao-bundle-route-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.taobao-bundle-style,
.taobao-bundle-shot,
.taobao-bundle-route {
  position: relative;
  min-height: 64px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--tb-line);
  border-radius: 5px;
  color: var(--tb-muted);
  background: rgba(255,255,255,.025);
  cursor: pointer;
}

.taobao-bundle-style:hover,
.taobao-bundle-shot:hover,
.taobao-bundle-route:hover {
  border-color: rgba(255,255,255,.2);
  background: rgba(255,255,255,.05);
}

.taobao-bundle-style.is-active,
.taobao-bundle-shot.is-active,
.taobao-bundle-route.is-active {
  border-color: var(--tb-line-strong);
  background: var(--tb-action-soft);
}

.taobao-bundle-style span,
.taobao-bundle-style small,
.taobao-bundle-shot strong,
.taobao-bundle-shot small,
.taobao-bundle-route strong,
.taobao-bundle-route small { display: block; }

.taobao-bundle-style span,
.taobao-bundle-shot strong,
.taobao-bundle-route strong { color: var(--tb-text); font-size: 12px; font-weight: 700; }

.taobao-bundle-style small,
.taobao-bundle-shot small,
.taobao-bundle-route small { margin-top: 2px; color: var(--tb-dim); font-size: 10px; line-height: 1.35; }

/* ---------- 数量/语言/分辨率 + 摘要 ---------- */
.taobao-bundle-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.taobao-bundle-options select { color-scheme: dark; }
.taobao-bundle-options option { color: var(--tb-text); background: var(--tb-raised); }

.taobao-bundle-summary {
  min-height: 20px;
  color: var(--tb-muted);
  font-size: 11px;
}

/* ---------- 第二步检查台（对齐 amazon-bundle/review.css 卡片语言） ---------- */
.taobao-bundle-review-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.taobao-bundle-review-head h3 { margin: 4px 0 0; color: var(--tb-text); font-size: 16px; font-weight: 760; }
.taobao-bundle-review-head > span { color: var(--tb-dim); font-size: 10px; text-align: right; }

.taobao-bundle-direction {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 5px;
  color: var(--tb-muted);
  background: var(--tb-action-soft);
  font-size: 11px;
  line-height: 1.5;
}

.taobao-bundle-direction b { color: var(--tb-text); font-size: 11px; }
.taobao-bundle-direction .taobao-bundle-vi-label { margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.1); color: var(--tb-muted); }
.taobao-bundle-vi-text { color: var(--tb-muted); line-height: 1.7; }

.taobao-bundle-job {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid var(--tb-line);
  border-radius: 6px;
  background: var(--tb-raised);
}

.taobao-bundle-job header { display: flex; align-items: center; gap: 8px; }
.taobao-bundle-job header > div { display: grid; flex: 1; min-width: 0; gap: 5px; }
.taobao-bundle-job header b { color: var(--tb-muted); font-size: 10px; font-weight: 650; }
.taobao-bundle-job-index { color: var(--tb-text); font-size: 13px; font-weight: 760; }

.taobao-bundle-job header input {
  width: min(420px, 100%);
  min-height: 34px;
  padding: 7px 9px;
  font-size: 13px;
  line-height: 1.35;
}

/* 「重新生成提示词」：与亚马逊同款白色主按钮 + 暗色 1 积分徽章。 */
.taobao-bundle-regen {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #111315;
  background: var(--tb-action);
  font: 700 11px/1 var(--app-font-ui, "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif);
  cursor: pointer;
}

.taobao-bundle-regen:hover,
.taobao-bundle-regen:focus-visible {
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,.18) !important;
}

.taobao-bundle-regen:disabled {
  color: rgba(255,255,255,.55);
  background: #3b3e40;
  cursor: wait;
}

.taobao-bundle-regen-cost {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(17, 19, 21, 0.08);
  color: #52565a;
  font: 600 10px/1.2 var(--app-font-ui, "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif);
  white-space: nowrap;
}

.taobao-bundle-regen:disabled .taobao-bundle-regen-cost {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
}

.taobao-bundle-job-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 8px;
}

.taobao-bundle-job-meta label,
.taobao-bundle-script-grid label,
.taobao-bundle-prompt-label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--tb-dim);
  font-size: 10px;
  font-weight: 650;
}

.taobao-bundle-job-meta input,
.taobao-bundle-job-meta select { height: 36px; padding: 7px 9px; }

.taobao-bundle-script-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.taobao-bundle-script-grid label:first-child { grid-column: 1 / -1; }

.taobao-bundle-script-grid label:first-child input {
  height: 44px;
  color: var(--tb-text);
  border-color: var(--tb-line-strong);
  background: rgba(255,255,255,.04);
  font-size: 15px;
  font-weight: 760;
}

.taobao-bundle-script-grid input { height: 36px; padding: 7px 9px; }

.taobao-bundle-prompt-label > span { margin: 2px 0 4px; color: var(--tb-muted); font-size: 10px; }

.taobao-bundle-job textarea {
  min-height: 116px;
  padding: 10px;
  font: 12px/1.55 var(--app-font-mono, Consolas, monospace);
  resize: vertical;
}

.taobao-bundle-prompt-label textarea { min-height: 132px; }

/* ---------- 第三步生成结果（对齐 amazon-bundle/progress.css 两列结果行） ---------- */
.taobao-bundle-results,
[data-tb-results] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 18px;
}

.taobao-bundle-result {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.taobao-bundle-result-label {
  min-width: 0;
  overflow: hidden;
  color: var(--tb-text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taobao-bundle-result b {
  color: var(--tb-muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.taobao-bundle-result.is-done b { color: var(--tb-success); }
.taobao-bundle-result.is-error b { max-width: 46%; overflow: hidden; color: var(--tb-error); text-overflow: ellipsis; white-space: nowrap; }

.taobao-bundle-result img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
  cursor: zoom-in;
}

/* ---------- footer（对齐 amazon-bundle/footer.css：积分 chip + 白色主按钮 + 转环） ---------- */
.taobao-bundle-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: var(--tb-surface);
}

.taobao-bundle-status {
  flex: 1;
  color: var(--tb-muted);
  font-size: 11px;
}

.taobao-bundle-cost {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--tb-line);
  border-radius: 999px;
  background: var(--tb-raised);
  color: var(--tb-muted);
  font-size: 12px;
  white-space: nowrap;
}

.taobao-bundle-cost[hidden] { display: none; }

.taobao-bundle-cost strong {
  color: var(--tb-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.taobao-bundle-cost-icon {
  color: var(--tb-text);
  display: inline-flex;
}

.taobao-bundle-cost-icon svg { width: 14px; height: 14px; }

.taobao-bundle-secondary,
.taobao-bundle-primary {
  min-height: 42px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.taobao-bundle-secondary {
  padding: 0 16px;
  border: 1px solid var(--tb-line);
  color: var(--tb-muted);
  background: transparent;
}

.taobao-bundle-secondary[hidden] { display: none; }

.taobao-bundle-secondary:hover:not(:disabled) {
  border-color: rgba(255,255,255,.24);
  color: var(--tb-text);
  background: var(--tb-active);
}

.taobao-bundle-primary {
  min-width: 154px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid transparent;
  color: #111315;
  background: var(--tb-action);
}

.taobao-bundle-primary:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-1px);
}

.taobao-bundle-primary:disabled,
.taobao-bundle-secondary:disabled {
  color: rgba(255,255,255,.55);
  background: #3b3e40;
  cursor: wait;
}

/* 白色焦点圈必须带 !important：studio.css 的全局 button:focus-visible
   紫色圈带 !important，不带会被压掉（与亚马逊同款处理）。 */
.taobao-bundle-primary:focus-visible,
.taobao-bundle-secondary:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,.18) !important;
}

/* 提交按钮内的小转环：分析期间替换 sparkles 图标，按钮文案切「AI 分析中…」。 */
.taobao-bundle-submit-spinner {
  display: none;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: taobao-bundle-spin .8s linear infinite;
}

.taobao-bundle-primary.is-busy .taobao-bundle-submit-spinner { display: inline-block; }
.taobao-bundle-primary.is-busy > [data-ui-icon] { display: none; }

/* ---------- 「开始 AI 分析」生成中遮罩：逐条移植 amazon-bundle/analyzing.css ---------- */
.taobao-bundle-analyzing {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8,10,12,.72);
  backdrop-filter: blur(6px);
  animation: taobao-bundle-fade-in .25s ease;
}

.taobao-bundle-analyzing[hidden] { display: none; }

.taobao-bundle-analyzing-card {
  position: relative;
  overflow: hidden;
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 34px 30px 28px;
  border: 1px solid var(--tb-line);
  border-radius: 10px;
  background: var(--tb-surface);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  text-align: center;
}

/* 卡片表面周期性扫光：一道斜向高光从左到右掠过，让整块面板「活着」。 */
.taobao-bundle-analyzing-card::before {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: -45%;
  width: 42%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.07), transparent);
  transform: skewX(-14deg);
  animation: taobao-bundle-sheen 3.2s ease-in-out infinite;
  pointer-events: none;
}

.taobao-bundle-analyzing-orbit {
  position: relative;
  width: 64px;
  height: 64px;
}

.taobao-bundle-analyzing-orbit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255,255,255,0) 0deg, rgba(255,255,255,.85) 140deg, rgba(255,255,255,0) 260deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: taobao-bundle-spin 1.1s linear infinite;
}

.taobao-bundle-analyzing-orbit::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
}

.taobao-bundle-analyzing-spark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--tb-text);
  animation: taobao-bundle-pulse 1.6s ease-in-out infinite;
}

.taobao-bundle-analyzing-spark svg { width: 22px; height: 22px; }

/* 外圈呼吸光晕 + 反向慢速虚线环：与主转环反向运动，转动感更明显。 */
.taobao-bundle-analyzing-glow {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), transparent 66%);
  animation: taobao-bundle-breathe 2.2s ease-in-out infinite;
}

.taobao-bundle-analyzing-ring2 {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,.3);
  animation: taobao-bundle-spin 5.5s linear infinite reverse;
}

/* 跳动圆点：替代静态「…」，标题与阶段文案后各一组，错峰起伏。 */
.taobao-bundle-analyzing-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 3px;
  vertical-align: 2px;
}

.taobao-bundle-analyzing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--tb-muted);
  animation: taobao-bundle-blink 1.2s ease-in-out infinite;
}

.taobao-bundle-analyzing-dots i:nth-child(2) { animation-delay: .18s; }
.taobao-bundle-analyzing-dots i:nth-child(3) { animation-delay: .36s; }

/* 三段阶段进度：随阶段文案推进逐段点亮，当前段呼吸闪烁。 */
.taobao-bundle-analyzing-steps { display: flex; gap: 6px; }

.taobao-bundle-analyzing-steps i {
  width: 46px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  transition: background .5s ease, box-shadow .5s ease;
}

.taobao-bundle-analyzing-steps i.is-done { background: rgba(255,255,255,.34); }

.taobao-bundle-analyzing-steps i.is-active {
  background: rgba(255,255,255,.88);
  box-shadow: 0 0 12px rgba(255,255,255,.4);
  animation: taobao-bundle-step-pulse 1.4s ease-in-out infinite;
}

.taobao-bundle-analyzing-title {
  color: var(--tb-text);
  font-size: 15px;
  font-weight: 760;
}

.taobao-bundle-analyzing-stage {
  min-height: 18px;
  margin: 0;
  color: var(--tb-muted);
  font-size: 12px;
  line-height: 1.5;
}

.taobao-bundle-analyzing-stage.is-swap { animation: taobao-bundle-rise .45s ease; }

.taobao-bundle-analyzing-bar {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.taobao-bundle-analyzing-bar i {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  animation: taobao-bundle-sweep 1.4s ease-in-out infinite;
}

.taobao-bundle-analyzing-elapsed { color: var(--tb-dim); font-size: 11px; }

@keyframes taobao-bundle-spin { to { transform: rotate(360deg); } }
@keyframes taobao-bundle-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes taobao-bundle-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes taobao-bundle-sweep { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }
@keyframes taobao-bundle-pulse { 0%,100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes taobao-bundle-sheen { 0% { left: -45%; } 55%,100% { left: 118%; } }
@keyframes taobao-bundle-breathe { 0%,100% { opacity: .35; transform: scale(.82); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes taobao-bundle-blink { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes taobao-bundle-step-pulse { 0%,100% { opacity: .65; } 50% { opacity: 1; } }

/* 系统开启减弱动效时不能把「生成中」指示做成全静止——转环/扫光就是
   「还在跑」的功能信号。这里只放慢并去掉位移动画，保留运动本身。 */
@media (prefers-reduced-motion: reduce) {
  .taobao-bundle-analyzing-card::before { display: none; }
  .taobao-bundle-analyzing-stage.is-swap { animation: none; }
  .taobao-bundle-analyzing-dots i { animation: none; opacity: .8; }
  .taobao-bundle-analyzing-orbit::before { animation-duration: 2.6s; }
  .taobao-bundle-analyzing-ring2 { animation-duration: 12s; }
  .taobao-bundle-analyzing-bar i { animation-duration: 2.8s; }
  .taobao-bundle-submit-spinner { animation-duration: 1.6s; }
}

/* ---------- 响应式（对齐 amazon-bundle/responsive.css 断点） ---------- */
@media (max-width: 720px) {
  .taobao-bundle-overlay { padding: 10px; }
  .taobao-bundle-dialog { max-height: calc(100vh - 20px); border-radius: 7px; }
  .taobao-bundle-header,
  .taobao-bundle-body,
  .taobao-bundle-footer { padding-left: 16px; padding-right: 16px; }
  .taobao-bundle-source-row,
  .taobao-bundle-grid,
  .taobao-bundle-options { grid-template-columns: 1fr; }
  .taobao-bundle-style-grid,
  .taobao-bundle-shot-options,
  .taobao-bundle-route-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .taobao-bundle-review-head { align-items: start; flex-direction: column; gap: 4px; }
  .taobao-bundle-review-head > span { text-align: left; }
  .taobao-bundle-footer { flex-wrap: wrap; }
  .taobao-bundle-status { flex-basis: 100%; }
}

@media (max-width: 520px) {
  .taobao-bundle-grid label:last-child { grid-column: auto; }
  .taobao-bundle-style-grid,
  .taobao-bundle-shot-options,
  .taobao-bundle-route-options { grid-template-columns: 1fr; }
  .taobao-bundle-job header { align-items: stretch; flex-direction: column; }
  .taobao-bundle-regen { justify-content: center; }
  .taobao-bundle-job-meta,
  .taobao-bundle-script-grid { grid-template-columns: 1fr; }
  .taobao-bundle-script-grid label:first-child { grid-column: auto; }
  .taobao-bundle-results,
  [data-tb-results] { grid-template-columns: 1fr; }
  .taobao-bundle-footer { justify-content: stretch; }
  .taobao-bundle-cost,
  .taobao-bundle-primary,
  .taobao-bundle-secondary { flex: 1 1 auto; justify-content: center; }
}
