/* 爆款复刻向导 —— 复用全局主题变量，仅补充本页特有布局 */

.remake-page {
  background: var(--background);
}

.remake-actor-mapping,
.remake-actor-plan,
.remake-dialogue-editor,
.remake-dialogue-rows { display: grid; gap: 16px; min-width: 0; }
.remake-actor-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.remake-actor-card { display: grid; align-content: start; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 8px; }
.remake-actor-card header { display: flex; align-items: center; justify-content: space-between; }
.remake-actor-card .field { margin: 0; }
.remake-actor-choice-note { margin: 0; }
.remake-actor-replacement-mode { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.remake-actor-replacement-mode legend { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.remake-actor-mode-option { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.remake-actor-mode-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft, var(--surface-soft)); }
.remake-actor-mode-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.remake-actor-mode-option input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.remake-actor-mode-option span { display: grid; gap: 4px; min-width: 0; }
.remake-actor-mode-option strong { font-size: 13px; }
.remake-actor-mode-option small { color: var(--text-muted); line-height: 1.5; }
.remake-actor-replacement-mode:disabled .remake-actor-mode-option { cursor: default; }
.remake-keep-original-button { margin-block: 0 16px; }
.remake-actor-portrait { width: 100%; height: 180px; object-fit: contain; background: var(--surface-soft); }
.remake-actor-evidence { display: grid; gap: 6px; }
.remake-actor-evidence p { margin: 0; }
.remake-actor-source { width: 100%; height: 120px; padding: 0; background: var(--surface-soft); border: 1px solid var(--border); cursor: pointer; }
.remake-actor-source img { width: 100%; height: 100%; object-fit: contain; }
.remake-actor-assignments { display: grid; gap: 12px; }
.remake-actor-shot,
.remake-actor-state { min-width: 0; margin: 0; padding: 12px 0; border: 0; border-top: 1px solid var(--border); }
.remake-actor-shot .remake-plan-toggle { display: inline-flex; margin-right: 16px; min-height: 44px; }
.remake-actor-plan { padding-block: 16px; border-block: 1px solid var(--border); }
.remake-actor-state-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr); gap: 12px; }
.remake-dialogue-row { display: grid; grid-template-columns: minmax(120px, 2fr) minmax(80px, 1fr) minmax(80px, 1fr) 44px; gap: 12px; align-items: end; }
.remake-dialogue-text { grid-column: 1 / 4; }
.remake-dialogue-row .icon-button { grid-column: 4; grid-row: 2; width: 44px; height: 44px; }
.remake-actor-card .icon-button { width: 44px; height: 44px; }
.remake-actor-card .icon-button img,
.remake-dialogue-row .icon-button img { width: 18px; height: 18px; }
.remake-edit-actors { display: flex; flex-wrap: wrap; gap: 12px; }
.remake-edit-actors figure { flex: 1 1 100px; min-width: 0; margin: 0; }
.remake-edit-actors button { width: 100%; height: 140px; padding: 0; border: 0; background: var(--surface-soft); cursor: pointer; }
.remake-edit-actors img { width: 100%; height: 100%; object-fit: contain; }
.remake-edit-actors figcaption { padding-top: 8px; font-size: 13px; overflow-wrap: anywhere; }
.remake-edit-actors figcaption small { display: block; margin-top: 4px; color: var(--text-muted); line-height: 1.5; }
#remakeAddActorButton,
#remakeGenerateDialogueButton { margin-block: 12px; }
.remake-actor-mapping select,
.remake-actor-plan select { min-height: 44px; width: 100%; }
.remake-identity-review { display: grid; gap: 8px; min-width: 0; }
.remake-role-review { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.remake-role-review li { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.remake-role-review span { color: var(--text-muted); }
.remake-role-review [data-status="mismatch"] strong { color: var(--danger, #c0392b); }
.remake-role-review [data-status="uncertain"] strong { color: var(--warning, #b7791f); }
@media (max-width: 600px) {
  .remake-actor-state-row { grid-template-columns: 1fr; gap: 0; }
  .remake-dialogue-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; }
  .remake-dialogue-row > .field:first-child { grid-column: 1 / -1; }
  .remake-dialogue-text { grid-column: 1 / 3; }
  .remake-dialogue-row .icon-button { grid-column: 3; grid-row: 3; }
}

.remake-page .new-task-dialog {
  width: min(600px, calc(100vw - 32px));
}

/* 本页多处用 display:flex，会覆盖 [hidden] 自带的 display:none，这里显式兜回来。 */
.remake-page [hidden] {
  display: none !important;
}

.remake-draft-status {
  margin: -4px 0 12px;
  color: var(--text-subtle);
  font-size: 0.78rem;
  text-align: right;
}

.remake-draft-status[data-state="error"] { color: var(--danger); }

.task-history-remake[hidden] {
  display: none !important;
}

.remake-nav-active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.remake-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 26px 26px 72px;
}

/* ---- 侧栏 ---- */

.remake-sidebar {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
}

.remake-sidebar-heading h2 {
  margin: 2px 0 0;
  font-size: 1.05rem;
}

.remake-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.remake-template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.remake-record-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.remake-record-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-subtle);
}

.remake-record-status[data-tone="working"]::before { background: var(--primary); }
.remake-record-status[data-tone="done"]::before { background: var(--success); }
.remake-record-status[data-tone="failed"]::before { background: var(--danger); }

.remake-template {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.remake-template-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.remake-template-body strong {
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remake-template-body small {
  color: var(--text-subtle);
  font-size: 0.72rem;
}

.remake-template-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.remake-template-use {
  width: auto;
  min-height: 44px;
  padding: 0 10px;
  box-shadow: none;
}

.remake-template-use img,
.remake-template-delete img {
  width: 16px;
  height: 16px;
}

.remake-template-delete {
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius);
}

.remake-empty-hint {
  margin: 0;
  padding: 10px 2px;
  color: var(--text-subtle);
  font-size: 0.78rem;
  line-height: 1.6;
}

/* ---- 主区 ---- */

.remake-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.remake-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.remake-hero h1 {
  margin: 4px 0 8px;
  font-size: 1.72rem;
}

.remake-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remake-stepper li {
  display: block;
}

.remake-stepper li[hidden] {
  display: none;
}

.remake-stepper li button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-subtle);
  cursor: default;
  font: inherit;
  font-size: 0.78rem;
  transition: all var(--transition);
}

.remake-stepper li button:not(:disabled) {
  cursor: pointer;
}

.remake-stepper li button:not(:disabled):hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.remake-stepper li button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}

.remake-stepper li button:disabled {
  opacity: 1;
}

.remake-stepper li span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.remake-stepper li b {
  font: inherit;
}

.remake-stepper li.is-active button {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.remake-stepper li.is-active span {
  background: var(--primary);
  color: #fff;
}

.remake-stepper li.is-done button {
  border-color: var(--success);
  color: var(--success);
}

.remake-stepper li.is-done span {
  background: var(--success-soft);
  color: var(--success);
}

.remake-history-review .remake-stage:not(#remakeDoneStage) .remake-stage-actions,
.remake-history-review #remakeReferenceStage .remake-stage-actions-right,
.remake-history-review #remakeClearPickedVideoButton {
  display: none;
}

/* ---- 提示条 ---- */

.remake-notice {
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.remake-notice[data-tone="error"] {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.remake-notice[data-tone="success"] {
  border-left-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.remake-audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ---- 阶段容器 ---- */

.remake-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.remake-stage-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.remake-stage-heading h2 {
  margin: 0 0 6px;
  font-size: 1.16rem;
}

.remake-stage-heading p {
  margin: 0;
  max-width: 78ch;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.remake-badge {
  padding: 5px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.remake-badge[data-tone="done"] {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.remake-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* 按钮文字比可用宽度长时会被 flex 压扁并溢出，这里禁止压缩，改由整行换行。 */
.remake-stage-actions button {
  flex-shrink: 0;
  white-space: nowrap;
}

.remake-stage-actions-split {
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.remake-stage-actions-right {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.remake-note {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.78rem;
  line-height: 1.6;
}

/* ---- 上传 ---- */

.remake-mode-picker {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.remake-mode-picker legend {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.remake-mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.remake-mode-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.remake-mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.remake-mode-option-body {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 4px 10px;
  align-content: center;
  min-height: 72px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.remake-mode-option-body > img {
  grid-row: 1 / span 2;
  width: 19px;
  height: 19px;
  margin-top: 1px;
}

.remake-mode-option-body strong {
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.35;
}

.remake-mode-option-body strong em {
  margin-left: 5px;
  color: var(--primary);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 600;
}

.remake-mode-option-body small {
  color: var(--text-subtle);
  font-size: 0.75rem;
  line-height: 1.45;
}

.remake-mode-option:hover .remake-mode-option-body {
  background: var(--surface);
}

.remake-mode-option input:checked + .remake-mode-option-body {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--primary-soft);
}

.remake-mode-option input:focus-visible + .remake-mode-option-body {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.remake-mode-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.remake-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.remake-dropzone:hover,
.remake-dropzone.is-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.remake-dropzone strong {
  font-size: 0.92rem;
}

.remake-dropzone small {
  color: var(--text-subtle);
  font-size: 0.78rem;
}

.remake-dropzone:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

.remake-video-file-input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  opacity: 0;
}

.remake-dropzone-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
}

.remake-dropzone-icon img {
  width: 20px;
  height: 20px;
}

.remake-picked {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.remake-picked-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.remake-picked-icon img {
  width: 17px;
  height: 17px;
}

.remake-picked-body {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.remake-picked-body strong {
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remake-picked-body small {
  color: var(--text-subtle);
  font-size: 0.76rem;
}

/* ---- 进度 ---- */

.remake-progress {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
}

.remake-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #e0805e);
  transition: width 420ms ease-out;
}

.remake-progress-meta {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.remake-progress-meta strong {
  color: var(--text);
}

.remake-progress-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.remake-progress-steps li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-subtle);
  font-size: 0.78rem;
}

.remake-progress-steps li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
}

.remake-progress-steps li.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.remake-progress-steps li.is-active::before { background: var(--primary); }

.remake-progress-steps li.is-done {
  color: var(--success);
  border-color: var(--success);
}

.remake-progress-steps li.is-done::before { background: var(--success); }

/* ---- 拆解结果 ---- */

.remake-analysis-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.remake-analysis-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 18px;
}

.remake-analysis-media h3 {
  margin: 0;
  font-size: 0.92rem;
}

.remake-video {
  width: 100%;
  border-radius: var(--radius);
  background: #101614;
  aspect-ratio: 9 / 16;
  max-height: 440px;
}

.remake-media-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-size: 0.78rem;
}

.remake-media-facts dt {
  color: var(--text-subtle);
}

.remake-media-facts dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.remake-frame-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.remake-frame {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.remake-frame-preview {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.remake-frame-preview img {
  display: block;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.remake-frame-preview:focus-visible,
.remake-product-image-preview:focus-visible,
.remake-character-image-preview:focus-visible,
.remake-character-select:focus-visible,
.remake-edit-character-preview:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.remake-frame figcaption {
  color: var(--text-subtle);
  font-size: 0.68rem;
  text-align: center;
}

.remake-analysis-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.remake-card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.remake-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.94rem;
}

.remake-card h3 img {
  width: 16px;
  height: 16px;
}

.remake-card p {
  margin: 0 0 8px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.remake-card p:last-child {
  margin-bottom: 0;
}

.remake-card-lead {
  color: var(--text) !important;
  font-weight: 600;
}

.remake-card-meta {
  color: var(--text-subtle) !important;
  font-size: 0.79rem !important;
}

.remake-card-advice ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.75;
}

.remake-details summary {
  cursor: pointer;
  color: var(--text-subtle);
  font-size: 0.79rem;
}

.remake-details p {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--surface);
  white-space: pre-wrap;
}

.remake-shot-table-wrap {
  overflow-x: auto;
}

.remake-shot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.remake-shot-table th,
.remake-shot-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.remake-shot-table th {
  color: var(--text-subtle);
  font-weight: 500;
  white-space: nowrap;
}

.remake-shot-table td:first-child {
  color: var(--text-subtle);
}

.remake-shot-table td:nth-child(2) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.remake-shot-confidence {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-strong);
  color: var(--text-subtle);
  font-size: 0.68rem;
}

.remake-save-template {
  display: flex;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
}

.remake-save-template input {
  display: block;
  flex: 1 1 180px;
  min-width: 160px;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--soft-radius-control);
  outline: 0;
  background: var(--soft-surface-muted);
  color: var(--soft-ink);
  box-shadow: inset 0 1px 3px rgb(88 101 126 / 7%);
  transition: background var(--soft-transition), box-shadow var(--soft-transition);
}

.remake-save-template input:hover {
  border: 0;
  background: #f0f2f7;
}

.remake-save-template input:focus {
  border: 0;
  outline: 0;
  background: var(--soft-surface);
  box-shadow: 0 0 0 5px var(--soft-primary-halo), 0 10px 24px rgb(99 102 241 / 10%);
}

.remake-save-template input::placeholder {
  color: #959cad;
}

.remake-save-template .secondary-button {
  width: auto;
  flex: 0 0 auto;
}

/* 全局 .primary-button 是 width:100%，本页的操作行一律改为按内容宽度排布，
   否则同一行里主按钮会独占整宽、把旁边的按钮挤到上一行。 */
.remake-stage-actions .secondary-button,
.remake-stage-actions .primary-button {
  width: auto;
}

/* ---- 表单 ---- */

.remake-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.remake-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.remake-form-grid .field-wide {
  grid-column: 1 / -1;
}

.remake-product-upload-field {
  display: grid;
  gap: 8px;
}

.remake-product-upload-shell {
  width: min(100%, 900px);
  min-width: 0;
  margin-inline: auto;
}

.field .remake-product-dropzone {
  display: flex;
  margin: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.remake-product-upload-shell:not(:has(.remake-product-image-item)) .remake-product-dropzone {
  border-color: #b8cfe9;
  background-color: #f7fbff;
  background-image: radial-gradient(circle, rgb(79 135 194 / 15%) 1px, transparent 1.2px);
  background-size: 16px 16px;
}

.remake-product-upload-shell:not(:has(.remake-product-image-item)) .remake-product-dropzone .dropzone-icon {
  box-sizing: content-box;
  width: 26px;
  height: 26px;
  padding: 10px;
  margin-bottom: 2px;
  border: 1px solid #d6e2ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 10px rgb(53 105 171 / 8%);
  opacity: .9;
}

.remake-product-dropzone:focus-within {
  border-color: var(--primary);
  background-color: #f5f5ff;
  box-shadow: 0 0 0 5px var(--soft-primary-halo), 0 14px 30px rgb(99 102 241 / 12%);
}

.field .remake-product-dropzone .dropzone-title {
  color: var(--soft-ink);
}

.field .remake-product-dropzone .dropzone-meta {
  color: var(--soft-muted);
}

.field .remake-product-file-input,
.field .remake-product-file-input:hover,
.field .remake-product-file-input:focus {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  box-shadow: none;
}

.remake-fieldset {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.remake-fieldset legend {
  padding: 0 8px;
  color: var(--text-subtle);
  font-size: 0.78rem;
}

.remake-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
}

.remake-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.remake-product-preview {
  margin-top: 0;
}

.remake-product-upload-shell:has(.remake-product-image-item) {
  display: flex;
  width: fit-content;
  max-width: 100%;
  padding: 12px;
  flex-flow: row wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 22px;
  background: var(--soft-surface-muted);
  box-shadow: inset 0 1px 3px rgb(88 101 126 / 6%);
}

.remake-product-upload-shell:has(.remake-product-image-item) .remake-product-preview {
  display: flex;
  width: auto;
  max-width: 676px;
  margin: 0;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: center;
  order: 1;
  gap: 12px;
}

.remake-product-image-item {
  display: grid;
  width: 160px;
  height: 198px;
  flex: 0 0 160px;
  grid-template-rows: 160px 38px;
  aspect-ratio: auto;
  border-radius: 8px;
}

.remake-product-image-preview {
  display: block;
  width: 100%;
  height: 160px;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  border: 0;
  background: var(--surface);
}

.remake-product-image-preview > img {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--surface);
  object-fit: contain;
  object-position: center;
}

.remake-product-image-item .remove-image img {
  filter: none;
}

.remake-product-upload-shell:has(.remake-product-image-item) .remake-product-dropzone {
  width: 160px;
  height: 160px;
  min-height: 160px;
  padding: 18px 14px;
  flex: 0 0 160px;
  order: 2;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 5%);
  transform: none;
}

.remake-product-upload-shell:has(.remake-product-image-item) .remake-product-dropzone .dropzone-icon {
  width: 24px;
  height: 24px;
  margin: 0 0 6px;
}

.remake-product-upload-shell:has(.remake-product-image-item) .remake-product-dropzone .dropzone-meta {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.remake-product-upload-shell:has(.remake-product-image-item) .remake-product-dropzone.at-capacity {
  display: none;
}

.remake-product-review {
  width: min(100%, 900px);
  margin-inline: auto;
  padding-top: 4px;
  border-bottom: 0;
}

.remake-product-review .three-view-block {
  width: min(100%, 760px);
  margin: 18px auto 0;
}

.remake-product-review .remake-stage-actions {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ---- 逐镜换品计划 ---- */

.remake-plan-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.remake-plan-summary strong {
  color: var(--text);
}

.remake-plan-shot-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.remake-plan-shot {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.remake-plan-shot-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.remake-plan-shot-heading > div {
  display: grid;
  gap: 4px;
}

.remake-plan-shot-heading strong {
  font-size: 0.9rem;
}

.remake-plan-shot-heading small {
  color: var(--text-subtle);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.remake-generation-copy {
  display: grid;
  grid-template-columns: minmax(116px, auto) minmax(0, 1fr);
  align-items: start;
  gap: 8px 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary-soft) 62%, var(--surface));
}

.remake-generation-copy strong {
  color: var(--primary);
  font-size: 0.78rem;
  line-height: 1.6;
  white-space: nowrap;
}

.remake-generation-copy p {
  margin: 0;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.remake-generation-copy > details {
  grid-column: 1 / -1;
  min-width: 0;
}

[data-remake-audio] {
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}

[data-remake-audio] > button {
  justify-self: start;
}

.remake-generation-copy[data-mode="none"] {
  border-left-color: var(--border-strong);
  background: var(--surface-soft);
}

.remake-generation-copy[data-mode="none"] strong,
.remake-generation-copy[data-mode="none"] p {
  color: var(--text-subtle);
}

.remake-plan-grid,
.remake-plan-product {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.remake-plan-grid textarea,
.remake-plan-product textarea {
  min-height: 76px;
  resize: vertical;
}

.remake-plan-product {
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
}

.remake-plan-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.remake-plan-toggle input {
  width: 18px;
  height: 18px;
}

.remake-plan-details {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.remake-plan-details summary {
  min-height: 44px;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 44px;
}

.remake-plan-details[open] summary {
  margin-bottom: 12px;
}

#remakePlanForm > .remake-stage-actions {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* ---- 脚本 ---- */

.remake-script-head h3 {
  font-size: 1.05rem;
}

.remake-beat-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.remake-beat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.remake-beat-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.remake-beat-head strong {
  font-size: 0.88rem;
}

.remake-beat-time {
  color: var(--primary);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.remake-beat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.remake-tag {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.72rem;
}

.remake-beat-voiceover {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.65;
}

.remake-beat-fields {
  display: grid;
  gap: 5px;
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.6;
}

.remake-beat-fields dt {
  color: var(--text-subtle);
  font-size: 0.72rem;
}

.remake-beat-fields dd {
  margin: 0 0 4px;
  color: var(--text-muted);
}

.remake-done-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.remake-done-stat {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.remake-done-stat small {
  color: var(--text-subtle);
  font-size: 0.74rem;
}

.remake-done-stat strong {
  font-size: 1rem;
}

/* ---- 出片 ---- */

.remake-produce-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.remake-shot-progress {
  display: grid;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.remake-shot-progress-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.remake-shot-progress-heading h3,
.remake-shot-progress-heading p {
  margin: 0;
}

.remake-shot-progress-heading h3 {
  font-size: 0.94rem;
}

.remake-shot-progress-heading p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.remake-generated-shot-list {
  display: grid;
  gap: 10px;
}

.remake-generated-shot {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.remake-generated-shot-media {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.remake-generated-shot-pane {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin: 0;
}

.remake-generated-shot-media > figure > figcaption {
  display: flex;
  min-height: 20px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.remake-generated-shot[data-status="failed"] {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
}

.remake-generated-shot-video,
.remake-generated-shot-placeholder {
  width: 100%;
  max-height: 500px;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #101614;
}

.remake-generated-shot-video {
  display: block;
  object-fit: contain;
}

.remake-generated-shot-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--surface-soft);
  color: var(--text-subtle);
  font-size: 0.74rem;
  text-align: center;
}

.remake-generated-shot-placeholder img {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.remake-generated-shot-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: center;
  gap: 10px 20px;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.remake-generated-shot-title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.remake-generated-shot-title strong {
  font-size: 0.9rem;
  line-height: 1.5;
}

.remake-generated-shot-title small {
  color: var(--text-subtle);
  font-size: 0.74rem;
  line-height: 1.5;
}

.remake-generated-shot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.remake-shot-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.remake-shot-status[data-status="succeeded"] {
  border-color: color-mix(in srgb, var(--success) 32%, var(--border));
  color: var(--success);
}

.remake-shot-status[data-status="failed"] {
  border-color: color-mix(in srgb, var(--danger) 32%, var(--border));
  color: var(--danger);
}

.remake-generated-shot-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--danger);
  font-size: 0.78rem;
  line-height: 1.55;
}

.remake-failure-guidance {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 4px;
}

.remake-generated-shot-actions .remake-shot-resume,
.remake-generated-shot-actions .remake-shot-edit {
  min-height: 44px;
}

#remakeProduceError .failure-guidance,
#remakeReferenceError .failure-guidance,
#remakeNotice .failure-guidance {
  color: var(--text);
}

.remake-generated-shot .remake-shot-retry,
.remake-generated-shot .remake-shot-review {
  width: fit-content;
  min-height: 44px;
}

.remake-generated-shot-body > .remake-plan-details {
  grid-column: 1 / -1;
  min-width: 0;
}

.remake-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.94rem;
}

.remake-result-heading {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.remake-sync-playback-button {
  width: auto;
  min-height: 44px;
  padding-inline: 14px;
  flex: 0 0 auto;
}

.remake-result-title img {
  width: 16px;
  height: 16px;
}

.remake-result-video {
  width: 100%;
  max-width: 400px;
  max-height: 520px;
  aspect-ratio: 9 / 16;
}

/* 用链接做按钮时沿用同一套外观 */
a.primary-button,
a.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.remake-produce-block .remake-card ul {
  margin: 0 0 8px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.75;
}

/* ---- 顶栏入口的响应式 ----
   601–1023 区间顶栏按钮仍带文字，再叠加「重新开始」会把这一行撑破，
   因此让复刻入口按 characters.css 里人物入口的前例退化为纯图标。 */

@media (max-width: 1023px) {
  .header-actions .remake-nav-link {
    width: 44px;
    min-width: 44px;
    padding: 0;
    justify-content: center;
  }

  .header-actions .remake-nav-link span {
    display: none;
  }
}

/* 601–1023 区间多一个入口后顶栏会差十几像素，把按钮间距收到与窄屏一致。 */
@media (min-width: 601px) and (max-width: 1023px) {
  .header-actions {
    gap: 4px;
  }
}

/* ---- 主页面历史里的复刻记录 ---- */

.task-history-remake {
  margin-top: 34px;
  padding: 26px 0 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.task-history-remake-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.task-history-remake-heading h2 {
  margin: 2px 0 6px;
  font-size: 1.16rem;
}

.task-history-remake-heading p {
  margin: 0;
  max-width: 72ch;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.task-history-remake-heading .secondary-button {
  /* 全局样式把次级按钮设成了 100% 宽，这里恢复到内容宽度。 */
  width: auto;
  flex: 0 0 auto;
  align-self: flex-start;
}

.task-history-remake-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 14px;
}

.remake-history-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), transform var(--transition);
}

.remake-history-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.remake-history-card-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.remake-history-card-title {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.remake-history-card-head strong {
  font-size: 0.94rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remake-history-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.remake-history-card small {
  color: var(--text-subtle);
  font-size: 0.74rem;
}

.task-type-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.task-history-card-content > .task-type-badge {
  margin-bottom: 8px;
}

/* ---- 轻提示 ---- */

.remake-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(560px, calc(100vw - 40px));
  padding: 12px 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-size: 0.84rem;
  line-height: 1.5;
  box-shadow: var(--shadow);
}

.remake-toast[data-tone="error"] {
  background: var(--danger);
  border-color: var(--danger);
}

.remake-toast[data-tone="success"] {
  background: var(--success);
  border-color: var(--success);
}

/* ---- 响应式 ---- */

@media (max-width: 1080px) {
  .remake-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px 16px 64px;
  }

  .remake-sidebar {
    position: static;
    max-height: none;
  }

  .remake-analysis-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-analysis-media {
    position: static;
  }

  .remake-video {
    max-height: 380px;
  }
}

@media (max-width: 520px) {
  .remake-mode-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-product-upload-shell:has(.remake-product-image-item) {
    padding: 10px;
    gap: 10px;
  }

  .remake-product-upload-shell:has(.remake-product-image-item) .remake-product-preview {
    max-width: 274px;
    gap: 10px;
  }

  .remake-product-image-item {
    width: 132px;
    height: 170px;
    flex-basis: 132px;
    grid-template-rows: 132px 38px;
  }

  .remake-product-image-preview {
    height: 132px;
  }

  .remake-product-upload-shell:has(.remake-product-image-item) .remake-product-dropzone {
    width: 132px;
    height: 132px;
    min-height: 132px;
    padding: 12px 10px;
    flex-basis: 132px;
  }

  .remake-shot-progress-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .remake-shot-progress-heading .remake-badge {
    align-self: flex-start;
  }

  .remake-generated-shot {
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-generated-shot-video,
  .remake-generated-shot-placeholder {
    width: min(220px, 100%);
    margin-inline: auto;
  }

  .remake-generated-shot-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-generated-shot-actions {
    justify-content: space-between;
  }

  .remake-generated-shot .remake-shot-retry {
    width: fit-content;
  }

}

/* ---- 可信虚拟人物选择 ---- */

.remake-character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 12px;
}

.remake-character-option {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 44px;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.remake-character-option:hover {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
}

.remake-character-option[data-selected="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent);
}

.remake-character-image-preview {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  border: 0;
  border-radius: 6px;
  background: var(--surface-strong);
}

.remake-character-image-preview > img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background: var(--surface-strong);
  object-fit: contain;
  object-position: center;
}

.remake-character-select {
  display: flex;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.remake-character-select:disabled {
  cursor: default;
}

.remake-character-option-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.remake-character-option-copy strong,
.remake-character-option-copy small {
  overflow-wrap: anywhere;
}

.remake-character-scope {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.remake-character-scope legend {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.remake-character-scope-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.remake-character-scope-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.remake-character-scope-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.remake-character-scope-option > span {
  display: grid;
  min-height: 64px;
  align-content: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.remake-character-scope-option strong {
  font-size: 0.84rem;
}

.remake-character-scope-option small {
  color: var(--text-subtle);
  font-size: 0.74rem;
  line-height: 1.5;
}

.remake-character-scope-option input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent);
}

.remake-character-scope-option input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent);
  outline-offset: 2px;
}

.remake-character-scope-option input:disabled + span {
  cursor: default;
  opacity: 0.72;
}

.remake-reference-review-note {
  padding: 10px 12px;
  border-left: 3px solid var(--warning, #b7791f);
  background: color-mix(in srgb, var(--warning, #b7791f) 9%, var(--surface));
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .remake-character-scope-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

.remake-character-option-copy strong {
  font-size: 0.86rem;
}

.remake-character-option-copy small {
  color: var(--text-subtle);
  font-size: 0.74rem;
}

.remake-character-selected-mark {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
}

.remake-character-selected-mark img {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
}

.remake-character-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
}

.remake-character-empty > img {
  width: 28px;
  height: 28px;
}

.remake-character-empty .secondary-button {
  width: auto;
}

/* ---- 商品替换确认与结果对照 ---- */

.remake-edit-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: min(100%, 1080px);
  margin-inline: auto;
}

.remake-edit-asset {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.remake-edit-asset .remake-video,
.remake-edit-asset .review-image-preview,
.remake-edit-character-preview {
  width: 100%;
  max-height: 460px;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #111;
}

.remake-edit-character-preview {
  display: grid;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  place-items: center;
}

.remake-edit-character-preview:disabled {
  cursor: wait;
}

.remake-edit-character-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.remake-edit-character-state {
  max-width: 220px;
  margin: 0;
  padding: 20px;
  color: #fff;
  text-align: center;
}

.remake-edit-asset .review-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.remake-edit-form {
  display: grid;
  gap: 18px;
  width: min(100%, 900px);
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.remake-edit-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.remake-preserve-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.remake-preserve-list span {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.remake-preserve-list img {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.remake-result-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 400px));
  gap: 18px;
  align-items: start;
}

.remake-result-pane {
  display: grid;
  gap: 8px;
}

.remake-result-pane > span {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.remake-result-pane[hidden] + .remake-result-pane {
  grid-column: 1;
}

/* ---- 逐镜换品预览 ---- */

.remake-reference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.remake-reference-shot {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.remake-reference-shot[open] {
  grid-column: 1 / -1;
}

.remake-reference-shot-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  min-height: 68px;
  padding: 12px 14px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  transition: background var(--transition);
}

.remake-reference-shot-summary::-webkit-details-marker {
  display: none;
}

.remake-reference-shot-summary:hover {
  background: color-mix(in srgb, var(--primary-soft) 55%, transparent);
}

.remake-reference-shot-summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.remake-reference-shot-order {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--soft-primary-soft, var(--primary-soft));
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.remake-reference-shot-heading {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.remake-reference-shot-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remake-reference-shot-heading small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 0.75rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.remake-reference-shot-summary-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.remake-reference-shot-count {
  color: var(--text-subtle);
  font-size: 0.72rem;
  white-space: nowrap;
}

.remake-reference-shot-chevron {
  width: 18px;
  height: 18px;
  opacity: 0.58;
  transition: transform 180ms ease;
}

.remake-reference-shot[open] .remake-reference-shot-chevron {
  transform: rotate(180deg);
}

.remake-reference-shot-content {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.remake-reference-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.remake-reference-pane {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin: 0;
}

.remake-reference-pane figcaption {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.remake-reference-image-button,
.remake-reference-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 500px;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #101614;
}

.remake-reference-shot .remake-reference-image-button,
.remake-reference-shot .remake-reference-placeholder {
  height: clamp(240px, 48vw, 420px);
  max-height: none;
  aspect-ratio: auto !important;
}

.remake-reference-image-button {
  cursor: zoom-in;
}

.remake-reference-image-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.remake-reference-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

/* 复刻流程中的业务图片必须保留完整构图；图标不使用这个类。 */
.remake-page .remake-content-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

.remake-reference-placeholder {
  padding: 18px;
  color: #d4dedb;
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: center;
}

.remake-reference-shot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.remake-reference-shot-actions .secondary-button,
.remake-reference-shot-actions .primary-button {
  width: auto;
}

.remake-reference-error-text {
  color: var(--danger, #b42318);
  font-size: 0.78rem;
}

@media (max-width: 700px) {
  .remake-reference-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-reference-shot[open] {
    grid-column: 1;
  }

  .remake-reference-shot-summary {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    min-height: 64px;
    padding: 10px 12px;
    gap: 10px;
  }

  .remake-reference-shot-order {
    width: 36px;
    height: 36px;
  }

  .remake-reference-shot-heading small {
    -webkit-line-clamp: 2;
  }

  .remake-reference-shot-count {
    display: none;
  }

  .remake-reference-shot-summary-meta {
    gap: 6px;
  }

  .remake-reference-shot-summary-meta .remake-badge {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .remake-reference-shot-content {
    padding: 12px;
  }

  .remake-generation-copy {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .remake-plan-grid,
  .remake-plan-product {
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-plan-shot-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .remake-plan-shot-heading .remake-tag {
    width: fit-content;
  }

  .remake-edit-preview,
  .remake-result-comparison {
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-result-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .remake-sync-playback-button {
    width: 100%;
  }

  .remake-generated-shot-media {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .remake-generated-shot-media .remake-generated-shot-pane:last-child {
    grid-column: 1 / -1;
  }

  .remake-reference-shot-header,
  .remake-reference-shot-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .remake-reference-shot-header .remake-badge {
    align-self: flex-start;
  }

  .remake-reference-shot-actions .secondary-button,
  .remake-reference-shot-actions .primary-button {
    width: 100%;
  }

  .remake-edit-asset .remake-video,
  .remake-edit-asset .review-image-preview,
  .remake-edit-character-preview {
    max-height: 420px;
  }

  .remake-preserve-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- 与主创作台统一的工作流外观 ---- */

.remake-page .remake-nav-active {
  border: 0;
  background: var(--soft-primary-soft);
  color: var(--soft-primary-strong);
  box-shadow: 0 9px 22px rgb(99 102 241 / 12%);
}

.remake-shell {
  grid-template-columns: 226px minmax(0, 1fr);
  gap: 34px;
  width: min(100%, 1440px);
  max-width: 1440px;
  padding: 42px 32px 136px;
}

.remake-sidebar {
  top: 92px;
  gap: 12px;
  max-height: calc(100dvh - 116px);
  padding: 18px 14px;
  border: 0;
  border-radius: var(--soft-radius-card);
  background: var(--soft-surface);
  box-shadow: var(--soft-shadow-md);
  scrollbar-width: thin;
}

.remake-sidebar-label {
  margin: 0;
  padding: 2px 10px 8px;
  color: var(--soft-muted);
  font-size: 13px;
  font-weight: 700;
}

.remake-stepper {
  display: grid;
  gap: 4px;
  width: 100%;
}

.remake-stepper li {
  position: relative;
  min-width: 0;
}

.remake-stepper li + li::before {
  position: absolute;
  z-index: 0;
  top: -6px;
  left: 27px;
  width: 1px;
  height: 12px;
  background: #e0e4ec;
  content: "";
}

.remake-stepper li.is-done + li::before {
  background: #a9d6c9;
}

.remake-stepper li button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--soft-text);
  text-align: left;
  transition: background var(--soft-transition), box-shadow var(--soft-transition), transform var(--soft-transition), opacity var(--soft-transition);
}

.remake-stepper li button:not(:disabled):hover {
  border: 0;
  background: #f7f7ff;
  color: var(--soft-primary-strong);
  box-shadow: 0 8px 18px rgb(99 102 241 / 9%);
  transform: translateY(-1px);
}

.remake-stepper li button:disabled {
  opacity: .52;
}

.remake-stepper li span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--soft-surface-muted);
  color: var(--soft-muted);
  font-size: 11px;
  font-weight: 700;
  box-shadow: inset 0 1px 2px rgb(88 101 126 / 6%);
}

.remake-stepper li strong {
  min-width: 0;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.remake-step-icon {
  display: block;
  width: 17px;
  height: 17px;
  opacity: .48;
}

.remake-stepper li.is-active button {
  border: 0;
  background: var(--soft-primary-soft);
  color: var(--soft-primary-strong);
  box-shadow: 0 10px 24px rgb(99 102 241 / 14%);
  opacity: 1;
}

.remake-stepper li.is-active span {
  background: var(--soft-primary);
  color: #fff;
  box-shadow: 0 8px 18px rgb(99 102 241 / 24%);
}

.remake-stepper li.is-active .remake-step-icon {
  opacity: .78;
  filter: invert(40%) sepia(72%) saturate(1750%) hue-rotate(220deg) brightness(94%) contrast(92%);
}

.remake-stepper li.is-done button {
  border: 0;
  color: #26765f;
  opacity: 1;
}

.remake-stepper li.is-done span {
  background: var(--soft-emerald-soft);
  color: var(--soft-emerald);
}

.remake-sidebar-section {
  display: block;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--soft-line);
}

.remake-sidebar-section > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-radius: 14px;
  color: var(--soft-text);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.remake-sidebar-section > summary::-webkit-details-marker {
  display: none;
}

.remake-sidebar-section > summary:hover {
  background: var(--soft-primary-soft);
  color: var(--soft-primary-strong);
}

.remake-sidebar-section > summary img {
  width: 16px;
  height: 16px;
  transition: transform var(--soft-transition);
}

.remake-sidebar-section[open] > summary img {
  transform: rotate(180deg);
}

.remake-sidebar-heading {
  display: none;
}

.remake-template-list {
  gap: 8px;
  padding-top: 8px;
}

.remake-template {
  padding: 10px;
  border: 0;
  border-radius: 16px;
  background: var(--soft-surface-muted);
  box-shadow: inset 0 1px 2px rgb(88 101 126 / 5%);
}

.remake-main {
  gap: 24px;
}

.remake-hero {
  min-height: 0;
  align-items: flex-start;
  padding: 2px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.remake-hero > div {
  max-width: 820px;
}

.remake-hero .eyebrow {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--soft-primary-soft);
  color: var(--soft-primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.remake-hero h1 {
  margin: 0 0 8px;
  color: var(--soft-ink);
  font-size: 38px;
  font-weight: 720;
  line-height: 1.24;
}

.remake-highlights {
  margin-top: 17px;
  padding: 0;
  list-style: none;
}

.remake-hero > .status-label {
  min-height: 36px;
  padding: 7px 14px;
  background: var(--soft-surface);
  color: var(--soft-text);
  box-shadow: var(--soft-shadow-sm);
}

.remake-mobile-progress {
  display: none;
}

.remake-notice {
  padding: 14px 18px;
  border: 0;
  border-left: 4px solid var(--soft-primary);
  border-radius: 16px;
  background: var(--soft-surface);
  box-shadow: var(--soft-shadow-sm);
}

.remake-stage {
  gap: 24px;
  min-width: 0;
  min-height: 500px;
  padding: 36px 42px 32px;
  border: 0;
  border-radius: 28px;
  background: var(--soft-surface);
  box-shadow: var(--soft-shadow-lg);
}

.remake-stage-heading {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--soft-line);
}

.remake-stage-heading::before {
  display: grid;
  width: 44px;
  height: 44px;
  grid-row: 1;
  grid-column: 1;
  border-radius: 50%;
  background: var(--soft-primary-soft) url("/icons/clapperboard.svg") center / 20px 20px no-repeat;
  box-shadow: 0 8px 20px rgb(99 102 241 / 14%);
  content: "";
}

#remakeUploadStage .remake-stage-heading::before { background-image: url("/icons/upload.svg"); }
#remakeProgressStage .remake-stage-heading::before { background-image: url("/icons/loader-circle.svg"); }
#remakeAnalysisStage .remake-stage-heading::before { background-image: url("/icons/scan-search.svg"); }
#remakeProductStage .remake-stage-heading::before { background-image: url("/icons/package.svg"); }
#remakeCharacterStage .remake-stage-heading::before { background-image: url("/icons/users.svg"); }
#remakeEditStage .remake-stage-heading::before { background-image: url("/icons/replace.svg"); }
#remakePlanStage .remake-stage-heading::before { background-image: url("/icons/list-checks.svg"); }
#remakeReferenceStage .remake-stage-heading::before { background-image: url("/icons/images.svg"); }
#remakeScriptStage .remake-stage-heading::before { background-image: url("/icons/file-text.svg"); }

.remake-stage-heading > div {
  grid-column: 2;
}

.remake-stage-heading h2 {
  margin: 0 0 4px;
  color: var(--soft-ink);
  font-size: 21px;
  font-weight: 720;
  line-height: 1.35;
}

.remake-stage-heading p {
  max-width: 76ch;
  color: var(--soft-text);
  font-size: 14px;
  line-height: 1.65;
}

.remake-stage-heading > .remake-badge {
  grid-column: 3;
}

.remake-badge,
.remake-tag,
.remake-shot-status,
.task-type-badge {
  border: 0;
  border-radius: 999px;
  background: var(--soft-surface-muted);
  color: var(--soft-text);
  font-weight: 650;
  box-shadow: inset 0 1px 2px rgb(88 101 126 / 5%);
}

.remake-badge[data-tone="done"],
.remake-shot-status[data-status="succeeded"] {
  border: 0;
  background: var(--soft-emerald-soft);
  color: #08795c;
}

.remake-mode-picker,
.remake-form,
.remake-edit-form,
.remake-produce-block {
  gap: 22px;
}

.remake-mode-options {
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.remake-mode-option-body,
.remake-character-scope-option > span {
  min-height: 88px;
  padding: 16px 18px;
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  background: var(--soft-surface-muted);
}

.remake-mode-option:hover .remake-mode-option-body,
.remake-character-scope-option:hover > span {
  border-color: #c8c9fb;
  background: #f7f7ff;
  box-shadow: 0 10px 24px rgb(99 102 241 / 10%);
}

.remake-mode-option input:checked + .remake-mode-option-body,
.remake-character-scope-option input:checked + span {
  border-color: #aaaef7;
  background: var(--soft-primary-soft);
  box-shadow: 0 10px 24px rgb(99 102 241 / 12%);
}

.remake-dropzone {
  min-height: 210px;
  padding: 32px 24px;
  border: 2px dashed var(--soft-line-strong);
  border-radius: 20px;
  background: var(--soft-surface-muted);
}

.remake-dropzone:hover,
.remake-dropzone.is-over {
  border-color: #aeb2f6;
  background: #f7f7ff;
  box-shadow: 0 14px 30px rgb(99 102 241 / 10%);
}

.remake-dropzone-icon,
.remake-picked-icon {
  border: 0;
  background: var(--soft-primary-soft);
  box-shadow: 0 8px 20px rgb(99 102 241 / 14%);
}

.remake-picked,
.remake-progress-steps li,
.remake-media-facts > div,
.remake-preserve-list span {
  border: 0;
  border-radius: 16px;
  background: var(--soft-surface-muted);
  box-shadow: inset 0 1px 2px rgb(88 101 126 / 5%);
}

.remake-progress {
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--soft-surface-pressed);
  box-shadow: inset 0 2px 5px rgb(88 101 126 / 9%);
}

.remake-progress-fill {
  border-radius: inherit;
  background: var(--soft-primary);
  box-shadow: 0 0 18px rgb(99 102 241 / 28%);
}

.remake-card {
  padding: 24px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.remake-analysis-body .remake-card + .remake-card,
.remake-script-head + .remake-beat-list,
.remake-beat-list + .remake-card {
  border-top: 1px solid var(--soft-line);
}

.remake-analysis-media,
.remake-shot-table-wrap,
.remake-plan-summary {
  border: 0;
  border-radius: 20px;
  background: var(--soft-surface-muted);
  box-shadow: inset 0 1px 2px rgb(88 101 126 / 5%);
}

.remake-video,
.review-image-preview,
.remake-edit-character-preview,
.remake-reference-image-button,
.remake-reference-placeholder,
.remake-generated-shot-video,
.remake-generated-shot-placeholder {
  border: 0;
  border-radius: 18px;
  box-shadow: var(--soft-shadow-sm);
}

.remake-character-option,
.remake-plan-shot,
.remake-reference-shot,
.remake-generated-shot,
.remake-beat {
  border: 0;
  border-radius: 20px;
  background: var(--soft-surface-muted);
  box-shadow: inset 0 1px 2px rgb(88 101 126 / 5%);
}

.remake-character-option {
  padding: 12px;
  transition: background var(--soft-transition), box-shadow var(--soft-transition), transform var(--soft-transition);
}

.remake-character-option:hover {
  border: 0;
  background: #f7f7ff;
  box-shadow: 0 14px 30px rgb(99 102 241 / 12%);
  transform: translateY(-2px);
}

.remake-character-option[data-selected="true"] {
  border: 0;
  background: var(--soft-primary-soft);
  box-shadow: 0 0 0 2px #aaaef7, 0 14px 30px rgb(99 102 241 / 12%);
}

.remake-character-image-preview > img {
  border-radius: 15px;
}

.remake-edit-form {
  border-color: var(--soft-line);
}

.remake-stage-actions-split {
  border-color: var(--soft-line);
}

.remake-stage > .remake-stage-actions:last-child,
.remake-stage > form > .remake-stage-actions:last-child,
.remake-stage > .remake-product-review > .remake-stage-actions:last-child {
  z-index: 10;
  bottom: 14px;
  margin-top: 4px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 12px 34px rgb(88 101 126 / 13%);
  backdrop-filter: blur(18px);
}

.remake-stage > .remake-stage-actions:last-child,
.remake-stage > form > .remake-stage-actions:last-child {
  position: sticky;
}

.remake-stage-actions .primary-button,
.remake-stage-actions .secondary-button,
.remake-stage-actions a.primary-button,
.remake-stage-actions a.secondary-button {
  min-height: 48px;
}

.remake-toast {
  bottom: 92px;
  padding: 13px 20px;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--soft-shadow-lg);
}

@media (max-width: 1023px) {
  .remake-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 30px 22px 104px;
  }

  .remake-sidebar {
    position: static;
    display: grid;
    max-height: none;
    grid-template-columns: minmax(0, 1fr) minmax(180px, .7fr);
    gap: 12px;
    padding: 12px;
    border-radius: 20px;
  }

  .remake-sidebar-label,
  .remake-stepper {
    display: none;
  }

  .remake-sidebar-section {
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .remake-sidebar-section > summary {
    min-height: 48px;
    background: var(--soft-surface-muted);
  }

  .remake-sidebar-section[open] {
    grid-column: 1 / -1;
  }

  .remake-main {
    gap: 22px;
  }

  .remake-mobile-progress {
    display: block;
    margin: 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--soft-line);
  }

  .remake-stage {
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .remake-shell {
    gap: 20px;
    padding: 24px 16px 88px;
  }

  .remake-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-sidebar-section,
  .remake-sidebar-section[open] {
    grid-column: 1;
  }

  .remake-hero {
    gap: 14px;
    padding-inline: 2px;
  }

  .remake-hero h1 {
    font-size: 28px;
  }

  .remake-hero > .status-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .remake-highlights {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-highlights li {
    width: 100%;
    justify-content: flex-start;
  }

  .remake-stage {
    gap: 20px;
    padding: 24px 18px;
    border-radius: 22px;
  }

  .remake-stage-heading {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 18px;
  }

  .remake-stage-heading > .remake-badge {
    grid-row: 2;
    grid-column: 2;
    justify-self: start;
  }

  .remake-stage-heading h2 {
    font-size: 19px;
  }

  .remake-mode-options,
  .remake-character-scope-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .remake-dropzone {
    min-height: 172px;
    padding: 24px 16px;
  }

  .remake-stage > .remake-stage-actions:last-child,
  .remake-stage > form > .remake-stage-actions:last-child,
  .remake-stage > .remake-product-review > .remake-stage-actions:last-child {
    bottom: 8px;
    margin-inline: -6px;
    padding: 10px;
    border-radius: 16px;
  }

  .remake-stage-actions,
  .remake-stage-actions-right,
  .remake-save-template {
    align-items: stretch;
  }

  .remake-save-template {
    min-width: 0;
    flex-direction: column;
  }

  .remake-save-template input,
  .remake-save-template .secondary-button,
  .remake-save-template .text-action {
    width: 100%;
    min-width: 0;
  }

  .remake-save-template input {
    flex: 0 0 48px;
  }

  .remake-save-template .text-action {
    justify-content: center;
  }

  .remake-stage-actions > .primary-button,
  .remake-stage-actions > .secondary-button,
  .remake-stage-actions > a.primary-button,
  .remake-stage-actions > a.secondary-button,
  .remake-stage-actions-right > .primary-button,
  .remake-stage-actions-right > .secondary-button {
    width: 100%;
  }
}
