:root {
  --redraw-ultra-violet: 189, 124, 219;
  --redraw-ultra-lilac: 225, 181, 242;
  --redraw-ultra-blush: 232, 151, 211;
  --redraw-ultra-peach: 247, 221, 207;
  --redraw-ultra-lemon: 246, 239, 202;
  --redraw-ultra-mint: 207, 239, 226;
  --redraw-ultra-sky: 205, 230, 245;
  --redraw-ultra-lavender: 229, 216, 243;
  --redraw-ultra-track: 110, 61, 190;
  --redraw-ultra-ink: 17, 19, 25;
}

.redraw-series-ultra-layer {
  position: fixed;
  inset: 0;
  z-index: 2147482600;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 420ms ease, visibility 420ms step-end;
}

.redraw-series-ultra-layer.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms ease, visibility 0s step-start;
}

.redraw-series-ultra-aura {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(var(--redraw-ultra-lilac), 0.62);
  background:
    radial-gradient(ellipse at 50% -16%, rgba(var(--redraw-ultra-blush), 0.13), transparent 46%),
    radial-gradient(ellipse at 50% 116%, rgba(var(--redraw-ultra-violet), 0.12), transparent 45%);
  box-shadow:
    inset 0 0 24px rgba(var(--redraw-ultra-blush), 0.44),
    inset 0 0 88px rgba(var(--redraw-ultra-lilac), 0.3),
    inset 0 0 180px rgba(var(--redraw-ultra-violet), 0.18),
    0 0 30px rgba(var(--redraw-ultra-blush), 0.34);
  animation: redraw-series-aura-breathe 3.4s cubic-bezier(.4, 0, .2, 1) infinite;
}

.redraw-series-ultra-aura::before,
.redraw-series-ultra-aura::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(var(--redraw-ultra-lilac), 0.4);
  box-shadow: inset 0 0 78px rgba(var(--redraw-ultra-blush), 0.16);
  animation: redraw-series-aura-inward 4.6s ease-out infinite;
}

.redraw-series-ultra-aura::after {
  animation-delay: -1.8s;
}

.redraw-series-ultra-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.redraw-series-ultra-particles i {
  --particle-angle: 0deg;
  --particle-delay: 0s;
  --particle-travel: 24px;
  --particle-size: 2px;
  --particle-drift: 12px;
  --particle-opacity: 0.5;
  --particle-duration: 6s;
  position: absolute;
  left: calc(50% - 2px);
  top: calc(50% - 2px);
  width: var(--particle-size);
  height: var(--particle-size);
  border-radius: 999px;
  background: rgb(var(--redraw-ultra-blush));
  box-shadow: 0 0 8px rgba(var(--redraw-ultra-lilac), 0.58);
  transform: rotate(var(--particle-angle)) translateX(calc(max(49vw, 49vh) - var(--particle-travel)));
  transform-origin: center;
  opacity: 0;
  animation: redraw-series-particle-inward var(--particle-duration) linear var(--particle-delay) infinite;
}

.redraw-series-ultra-particles i.is-glint {
  background: #fff2f7;
  box-shadow: 0 0 5px #fff, 0 0 14px rgba(var(--redraw-ultra-blush), 0.76);
  animation-name: redraw-series-particle-glint;
}

.redraw-series-beat-stage {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  overflow: hidden;
}

.redraw-workspace-open .redraw-series-ultra-layer.is-active .redraw-series-beat-stage {
  display: grid;
}

.redraw-series-beat-wave,
.redraw-series-beat-wave i {
  position: absolute;
  width: min(34vw, 480px);
  aspect-ratio: 1;
  border: 1px solid rgba(var(--redraw-ultra-blush), 0.48);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(var(--redraw-ultra-blush), 0.2), inset 0 0 24px rgba(var(--redraw-ultra-lilac), 0.12);
  animation: redraw-series-beat 1.2s cubic-bezier(.12, .64, .18, 1) forwards;
}

.redraw-series-beat-wave i:nth-child(1) { animation-delay: 80ms; }
.redraw-series-beat-wave i:nth-child(2) { animation-delay: 170ms; }
.redraw-series-beat-wave i:nth-child(3) { animation-delay: 260ms; }
.redraw-series-beat-wave.is-success,
.redraw-series-beat-wave.is-success i {
  border-color: rgba(224, 255, 244, 0.82);
  animation-duration: 1.65s;
}
.redraw-series-beat-wave.is-failure,
.redraw-series-beat-wave.is-failure i {
  border-style: dashed;
  animation-duration: 850ms;
}

.redraw-series-global-indicator {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 15px 8px 10px;
  border: 1px solid rgba(var(--redraw-ultra-lilac), 0.3);
  border-radius: 999px;
  color: #edf2f1;
  background: rgba(var(--redraw-ultra-ink), 0.88);
  box-shadow: 0 12px 40px rgba(5, 8, 12, 0.46), inset 0 0 22px rgba(var(--redraw-ultra-blush), 0.1);
  backdrop-filter: blur(18px) saturate(1.3);
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: pointer;
}

.redraw-series-indicator-orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff 0 8%, rgb(var(--redraw-ultra-blush)) 30%, rgb(var(--redraw-ultra-violet)) 68%, #28232d 100%);
  box-shadow: 0 0 14px rgba(var(--redraw-ultra-blush), 0.55);
  animation: redraw-series-orb 1.7s ease-in-out infinite;
}

#redrawGenerateSeriesBtn.is-ultra-active {
  position: relative;
  overflow: hidden;
  color: #f5eef2;
  border-color: rgba(var(--redraw-ultra-blush), 0.54);
  background: linear-gradient(110deg, rgba(24, 25, 32, 0.96), rgba(91, 70, 94, 0.9), rgba(24, 25, 32, 0.96));
  background-size: 220% 100%;
  box-shadow: inset 0 0 16px rgba(var(--redraw-ultra-blush), 0.14), 0 0 18px rgba(var(--redraw-ultra-blush), 0.18);
  animation: redraw-series-button-flow 2.4s linear infinite;
}

.redraw-workspace.is-series-ultra .redraw-timeline-host {
  border-color: rgba(var(--redraw-ultra-lilac), 0.34);
  box-shadow: inset 0 0 38px rgba(var(--redraw-ultra-blush), 0.07), 0 0 24px rgba(var(--redraw-ultra-violet), 0.11);
}

.redraw-workspace.is-series-ultra .redraw-timeline-lanes {
  background: radial-gradient(circle at 50% 120%, rgba(var(--redraw-ultra-blush), 0.1), transparent 62%);
}

.redraw-workspace.is-series-ultra .redraw-timeline-track-result {
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(var(--redraw-ultra-lilac), 0.72);
  background: rgba(29, 17, 48, 0.96);
  box-shadow: inset 0 0 18px rgba(var(--redraw-ultra-track), 0.24), 0 0 20px rgba(var(--redraw-ultra-track), 0.4);
}

.redraw-workspace.is-series-ultra .redraw-timeline-track-result::before,
.redraw-workspace.is-series-ultra .redraw-timeline-track-result::after {
  content: "";
  position: absolute;
  inset: 4px 0;
  z-index: 0;
  pointer-events: none;
  border-radius: 5px;
}

.redraw-workspace.is-series-ultra .redraw-timeline-track-result::before {
  background: linear-gradient(100deg,
    rgba(78, 38, 139, 0.98),
    rgba(var(--redraw-ultra-track), 0.98) 32%,
    rgba(145, 84, 224, 0.98) 50%,
    rgba(var(--redraw-ultra-track), 0.98) 68%,
    rgba(78, 38, 139, 0.98));
  background-size: 230% 100%;
  box-shadow: inset 0 0 0 1px rgba(218, 184, 255, 0.72), 0 0 20px rgba(var(--redraw-ultra-track), 0.5);
  animation: redraw-series-button-flow 3.6s linear infinite;
}

.redraw-workspace.is-series-ultra .redraw-timeline-track-result::after {
  inset-inline: -32%;
  background: linear-gradient(100deg, transparent 35%, rgba(224, 198, 255, 0.58) 50%, transparent 65%);
  transform: translateX(-45%);
  mix-blend-mode: screen;
  animation: redraw-series-track-sweep 3.2s cubic-bezier(.42, 0, .2, 1) infinite;
}

.redraw-workspace.is-series-ultra .redraw-timeline-track-result .redraw-timeline-result {
  z-index: 1;
  border-radius: 0;
}

.redraw-workspace.is-series-ultra .redraw-timeline-result.is-series-current,
.redraw-workspace.is-series-ultra .redraw-timeline-result.is-series-waiting,
.redraw-workspace.is-series-ultra .redraw-timeline-result.is-series-complete,
.redraw-workspace.is-series-ultra .redraw-timeline-result.is-series-skipped {
  --redraw-segment-border: transparent;
  opacity: 1;
  color: #f5edff;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  animation: none;
}

.redraw-workspace.is-series-ultra .redraw-timeline-result.is-series-failed {
  background: rgba(55, 27, 37, 0.98);
  box-shadow: inset 0 0 0 1px rgba(255, 145, 177, 0.7), 0 0 12px rgba(255, 100, 145, 0.2);
}

.redraw-workspace.is-series-ultra .redraw-timeline-lanes {
  overflow: hidden;
  border-radius: 8px;
}

.redraw-workspace.is-series-ultra .redraw-timeline-lanes::before {
  content: "";
  position: absolute;
  inset: -40% -20%;
  z-index: 8;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 28%, rgba(var(--redraw-ultra-lilac), 0.02) 40%, rgba(var(--redraw-ultra-blush), 0.12) 50%, rgba(var(--redraw-ultra-violet), 0.03) 60%, transparent 72%);
  transform: translateX(-60%);
  mix-blend-mode: screen;
  animation: redraw-series-track-sweep 3.2s cubic-bezier(.42, 0, .2, 1) infinite;
}

.redraw-series-ultra-layer.is-success .redraw-series-ultra-aura {
  box-shadow: inset 0 0 82px rgba(var(--redraw-ultra-mint), 0.24), inset 0 0 160px rgba(var(--redraw-ultra-sky), 0.08);
}

.redraw-series-ultra-layer.is-failure .redraw-series-ultra-aura {
  box-shadow: inset 0 0 82px rgba(var(--redraw-ultra-blush), 0.25), inset 0 0 160px rgba(var(--redraw-ultra-peach), 0.09);
}

.redraw-series-ultra-layer.is-stopped .redraw-series-ultra-aura {
  box-shadow: inset 0 0 82px rgba(var(--redraw-ultra-lavender), 0.22), inset 0 0 160px rgba(var(--redraw-ultra-sky), 0.07);
  animation-duration: 4.2s;
}

/* ---------- 全集生成确认与分辨率计划 ---------- */

.redraw-series-modal {
  --series-card: rgba(13, 17, 23, 0.98);
  --series-panel: rgba(17, 21, 28, 0.92);
  --series-line: rgba(170, 190, 195, 0.17);
  --series-accent: 105, 209, 201;
  --series-copy: #e2e8e5;
  --series-muted: rgba(200, 212, 210, 0.56);
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--series-copy);
}

.redraw-series-modal[hidden] { display: none; }

.redraw-series-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 10, 0.78);
  backdrop-filter: blur(12px) saturate(0.94);
}

.redraw-series-modal-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(760px, 94vw);
  max-height: min(820px, 90vh);
  overflow: hidden;
  border: 1px solid rgba(var(--series-accent), 0.24);
  border-radius: 12px;
  background:
    radial-gradient(circle at 82% -12%, rgba(var(--series-accent), 0.08), transparent 40%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.018), transparent 34%),
    var(--series-card);
  box-shadow: 0 34px 110px rgba(2, 5, 8, 0.72), inset 0 1px rgba(255, 255, 255, 0.045);
}

.redraw-series-modal-head {
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--series-line);
}

.redraw-series-modal-head > div {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.redraw-series-modal-head span {
  color: rgba(var(--series-accent), 0.78);
  font-size: 10px;
  letter-spacing: 0.22em;
}

.redraw-series-modal-head strong {
  font-size: 24px;
  letter-spacing: 0.04em;
}

.redraw-series-modal-head p {
  margin: 12px 0 0;
  color: var(--series-muted);
  font-size: 13px;
  line-height: 1.7;
}

.redraw-series-modal-body {
  min-height: 0;
  padding: 20px 26px;
  overflow: auto;
}

.redraw-series-strategy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.redraw-series-strategy label {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  padding: 14px;
  border: 1px solid var(--series-line);
  border-radius: 8px;
  background: var(--series-panel);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.redraw-series-strategy label:hover { border-color: rgba(var(--series-accent), 0.38); transform: translateY(-1px); }

.redraw-series-strategy label.is-selected {
  border-color: rgba(var(--series-accent), 0.62);
  background: linear-gradient(90deg, rgba(var(--series-accent), 0.1), rgba(var(--redraw-ultra-blush), 0.035));
  box-shadow: inset 3px 0 rgba(var(--series-accent), 0.72);
}

.redraw-series-strategy input {
  grid-row: 1 / span 2;
  margin-top: 2px;
  accent-color: rgb(var(--series-accent));
}

.redraw-series-strategy strong { font-size: 14px; }
.redraw-series-strategy span { color: var(--series-muted); font-size: 11px; line-height: 1.5; }

.redraw-series-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(var(--series-accent), 0.1);
  border-radius: 7px;
  background: rgba(var(--series-accent), 0.055);
  color: var(--series-muted);
  font-size: 12px;
}

.redraw-series-summary span {
  padding-right: 10px;
  border-right: 1px solid var(--series-line);
}

.redraw-series-summary b { color: var(--series-copy); font-size: 15px; }
.redraw-series-summary small { flex-basis: 100%; line-height: 1.55; }

.redraw-series-resolution-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.redraw-series-resolution-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(126px, auto) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid var(--series-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.016);
}

.redraw-series-resolution-row > span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.redraw-series-resolution-row > span b {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--series-accent), 0.28);
  background: rgba(var(--series-accent), 0.1);
  color: rgb(var(--series-accent));
  font-size: 11px;
}

.redraw-series-resolution-row em {
  color: var(--series-muted);
  font-size: 10px;
  font-style: normal;
}

.redraw-series-resolution-row select {
  min-width: 126px;
  padding: 8px 30px 8px 10px;
  border: 1px solid rgba(var(--series-accent), 0.22);
  border-radius: 8px;
  color: var(--series-copy);
  background: #10161d;
}

.redraw-series-resolution-row select:disabled { opacity: 0.58; }
.redraw-series-resolution-row.is-lead { border-color: rgba(var(--series-accent), 0.28); }
.redraw-series-resolution-row.is-skipped { opacity: 0.68; }
.redraw-series-resolution-row.is-skipped > strong { color: rgba(var(--series-accent), 0.82); font-size: 12px; }

.redraw-series-resolution-row .mini-button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(var(--series-accent), 0.3);
  border-radius: 7px;
  color: var(--series-copy);
  background: transparent;
  cursor: pointer;
}

.redraw-series-resolution-row .mini-button:hover,
.redraw-series-resolution-row .mini-button:focus-visible {
  border-color: rgba(var(--redraw-ultra-blush), 0.56);
  color: rgb(var(--redraw-ultra-blush));
  outline: none;
}

.redraw-series-research-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(var(--series-accent), 0.28);
  border-radius: 7px;
  color: rgba(var(--series-accent), 0.88);
  background: rgba(var(--series-accent), 0.065);
  text-align: center;
  font-size: 13px;
}

.redraw-series-research-note[hidden] { display: none; }

.redraw-series-modal-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr .72fr;
  gap: 10px;
  padding: 16px 26px 22px;
  border-top: 1px solid var(--series-line);
}

.redraw-series-modal-actions button {
  min-height: 42px;
  border-radius: 7px;
}

.redraw-series-modal-actions .primary-button {
  color: #071412;
  border-color: rgba(var(--series-accent), 0.68);
  background: linear-gradient(110deg, #69d1c9, #58b7b4);
  box-shadow: 0 8px 24px rgba(var(--series-accent), 0.12);
}

.redraw-series-modal-actions .ghost-button {
  color: var(--series-copy);
  border-color: var(--series-line);
  background: rgba(255, 255, 255, 0.018);
}

.redraw-series-modal-actions button:hover { transform: translateY(-1px); }
.redraw-series-modal-actions button:active { transform: translateY(1px) scale(0.99); }
.redraw-series-modal-actions button:focus-visible {
  outline: 2px solid rgba(var(--series-accent), 0.58);
  outline-offset: 2px;
}

.redraw-workspace.is-series-input-locked [data-series-disabled="1"] {
  opacity: 0.46;
  cursor: not-allowed;
}

@keyframes redraw-series-aura-breathe {
  0%, 100% {
    opacity: 0.9;
    filter: saturate(1.04);
  }
  50% {
    opacity: 1;
    filter: saturate(1.12);
  }
}
@keyframes redraw-series-aura-inward {
  0% { inset: 3px; opacity: 0.72; border-color: rgba(var(--redraw-ultra-blush), 0.42); }
  55% { border-color: rgba(var(--redraw-ultra-lilac), 0.34); }
  100% { inset: 54px; opacity: 0; border-color: rgba(var(--redraw-ultra-violet), 0.25); }
}
@keyframes redraw-series-particle-inward {
  0% { opacity: 0; transform: rotate(var(--particle-angle)) translateX(max(49vw, 49vh)) translateY(0) scale(0.45); }
  18% { opacity: var(--particle-opacity); }
  72% { opacity: calc(var(--particle-opacity) * 0.72); }
  100% { opacity: 0; transform: rotate(var(--particle-angle)) translateX(calc(max(38vw, 38vh) - var(--particle-travel))) translateY(var(--particle-drift)) scale(1.05); }
}
@keyframes redraw-series-particle-glint {
  0% { opacity: 0; transform: rotate(var(--particle-angle)) translateX(max(49vw, 49vh)) scale(0.3); }
  22% { opacity: var(--particle-opacity); }
  28% { opacity: 0.12; }
  36% { opacity: var(--particle-opacity); }
  100% { opacity: 0; transform: rotate(var(--particle-angle)) translateX(calc(max(38vw, 38vh) - var(--particle-travel))) translateY(var(--particle-drift)) scale(0.85); }
}
@keyframes redraw-series-beat {
  0% { opacity: 0.92; transform: scale(0.12); }
  100% { opacity: 0; transform: scale(2.45); }
}
@keyframes redraw-series-orb {
  0%, 100% { transform: scale(0.9); }
  50% { transform: scale(1.08); }
}
@keyframes redraw-series-button-flow {
  to { background-position: -220% 0; }
}
@keyframes redraw-series-track-sweep {
  0% { transform: translateX(-62%); opacity: 0; }
  14% { opacity: 1; }
  70%, 100% { transform: translateX(62%); opacity: 0; }
}

@media (max-width: 680px) {
  .redraw-series-modal { padding: 10px; }
  .redraw-series-modal-card { width: min(100%, 540px); max-height: 94vh; border-radius: 15px; }
  .redraw-series-modal-head { padding: 18px 16px 14px; }
  .redraw-series-modal-head > div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .redraw-series-modal-head strong { font-size: 21px; }
  .redraw-series-modal-body { padding: 14px 16px; }
  .redraw-series-strategy { grid-template-columns: 1fr; }
  .redraw-series-resolution-row { grid-template-columns: minmax(100px, 1fr) auto; }
  .redraw-series-resolution-row em { display: none; }
  .redraw-series-resolution-row select { min-width: 118px; }
  .redraw-series-resolution-row .mini-button { grid-column: 1 / -1; }
  .redraw-series-modal-actions { grid-template-columns: 1fr; padding: 13px 16px 16px; }
  .redraw-series-global-indicator { bottom: 12px; max-width: calc(100vw - 24px); }
  #redrawSeriesGlobalIndicatorText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .redraw-series-ultra-aura,
  .redraw-series-ultra-aura::before,
  .redraw-series-ultra-aura::after,
  .redraw-series-ultra-particles i,
  .redraw-series-indicator-orb,
  #redrawGenerateSeriesBtn.is-ultra-active,
  .redraw-workspace.is-series-ultra .redraw-timeline-lanes::before,
  .redraw-workspace.is-series-ultra .redraw-timeline-track-result::before,
  .redraw-workspace.is-series-ultra .redraw-timeline-track-result::after {
    animation: none !important;
  }
  .redraw-series-ultra-particles,
  .redraw-series-beat-stage { display: none !important; }
}
