/* VideoForge - Replication New Page Styles */

/* ============================================
   Step Header (参考 CreatOK)
   ============================================ */

.step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  min-height: 64px;
}

.step-header.hidden {
  display: none;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-back:hover {
  background: var(--border-color);
}

.btn-back:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-back i {
  font-size: 18px;
}

.step-header .step-indicator {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-mono);
}

.step-current {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.step-separator {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 2px;
}

.step-total {
  font-size: 18px;
  color: var(--text-muted);
}

.step-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
}

.header-widgets {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.widget-credits {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.widget-credits i {
  color: var(--primary);
}

.credit-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.credit-lbl {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   Phase Sections
   ============================================ */

.replication-workspace {
  padding: 24px;
  height: calc(100vh - 144px);
  overflow-y: auto;
}

.phase-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.phase-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Phase 1: Import
   ============================================ */

.import-card {
  max-width: 640px;
  margin: 60px auto;
}

.import-zone {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-physics);
}

.import-zone:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.import-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-glow);
  transform: scale(1.01);
}

.import-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.import-icon-wrapper {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.import-icon-wrapper i {
  font-size: 36px;
  color: white;
}

.import-inner h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.import-inner p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.import-hint {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
}

.import-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 320px;
  margin: 20px 0;
}

.import-divider::before,
.import-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.import-divider span {
  font-size: 12px;
  color: var(--text-muted);
}

.url-import-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

.url-import-row input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 14px;
}

.url-import-row input::placeholder {
  color: var(--text-muted);
}

.btn-parse-url {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-parse-url:hover {
  background: var(--primary-hover);
}

.file-input-hidden {
  display: none;
}

/* ============================================
   Phase 2: Config Layout
   ============================================ */

.config-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  height: calc(100vh - 200px);
}

.config-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 8px;
}

.config-right {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  text-align: center;
  padding: 60px 40px;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon i {
  font-size: 36px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  max-width: 280px;
}

/* ============================================
   Phase 2.5: Analysis Layout (分镜在左, 方案在右)
   ============================================ */

.analysis-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  height: calc(100vh - 200px);
}

.analysis-left {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.analysis-right {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow-y: auto;
}

/* Video Preview Card */
.video-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.video-thumb-wrapper {
  position: relative;
  aspect-ratio: 9/16;
  max-height: 240px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.video-thumb-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 12px;
}

.btn-play-preview {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-play-preview:hover {
  background: white;
  transform: translate(-50%, -50%) scale(1.1);
}

.btn-play-preview i {
  font-size: 20px;
  color: var(--primary);
}

.video-meta {
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.video-filename {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-resolution {
  font-size: 12px;
  color: var(--text-muted);
}

/* Config Section */
.config-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
}

.section-title i {
  font-size: 18px;
  color: var(--primary);
}

.section-title.clickable {
  cursor: pointer;
  user-select: none;
}

.section-title .toggle-icon {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.collapsible.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible.collapsed .collapsible-content {
  max-height: 0 !important;
  padding-top: 0;
  margin-top: 0;
}

.input-field {
  margin-bottom: 12px;
}

.input-field:last-child {
  margin-bottom: 0;
}

.input-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-field input,
.input-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 14px;
  transition: var(--transition-fast);
}

/* Styled custom select globally to replace native browser arrows */
.input-field select,
.param-item select,
select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
  padding-right: 36px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

[data-theme="light"] select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
}

.input-field input:focus,
.input-field select:focus {
  outline: none;
  border-color: var(--primary);
}

.input-field input::placeholder {
  color: var(--text-muted);
}

/* Product Images */
.product-images-row {
  display: flex;
  gap: 8px;
}

.product-img-slot {
  width: 64px;
  height: 64px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.product-img-slot:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.product-img-slot i {
  font-size: 24px;
  color: var(--text-muted);
}

.product-img-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-img-slot.has-image i {
  display: none;
}

/* Analyze Button */
.btn-analyze {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
}

.btn-forge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-forge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ============================================
   Analysis Loading
   ============================================ */

.analysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  position: relative;
  margin-bottom: 24px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-spinner i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  color: var(--primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.analysis-loading h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.analysis-loading p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}

.loading-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  min-width: 40px;
}

/* ============================================
   Storyboard Section
   ============================================ */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.storyboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.storyboard-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.storyboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.storyboard-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.storyboard-time {
  font-size: 12px;
  color: var(--text-muted);
}

.storyboard-field {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.storyboard-field:last-child {
  margin-bottom: 0;
}

.storyboard-field strong {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 6px;
}

.storyboard-field span {
  color: var(--text-main);
}

/* ============================================
   Strategies Section
   ============================================ */

.strategies-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.strategy-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.strategy-card:hover {
  border-color: var(--primary);
}

.strategy-card.selected {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.strategy-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.strategy-card[data-strategy="ORIGINAL"] .strategy-badge {
  background: #6b7280;
}

.strategy-card[data-strategy="SCENE_SWAP"] .strategy-badge {
  background: #10b981;
}

.strategy-card[data-strategy="AUDIENCE_DRIFT"] .strategy-badge {
  background: #f59e0b;
}

.strategy-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.strategy-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.strategy-desc {
  font-size: 12px;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 12px;
}

.strategy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.strategy-tag {
  padding: 3px 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
}

.btn-select-strategy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  margin-top: 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-select-strategy:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary);
}

.strategy-card.selected .btn-select-strategy {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ============================================
   Phase 3: Confirm Layout
   ============================================ */

.confirm-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  height: calc(100vh - 200px);
}

.confirm-left {
  overflow-y: auto;
}

.confirm-right {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Strategy Detail Card (参考 CreatOK) */
.strategy-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.strategy-detail-header {
  margin-bottom: 16px;
}

.strategy-badge-large {
  display: inline-block;
  padding: 6px 14px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.strategy-detail-card[data-strategy="ORIGINAL"] .strategy-badge-large {
  background: #6b7280;
}

.strategy-detail-card[data-strategy="SCENE_SWAP"] .strategy-badge-large {
  background: #10b981;
}

.strategy-detail-card[data-strategy="AUDIENCE_DRIFT"] .strategy-badge-large {
  background: #f59e0b;
}

.strategy-detail-card[data-strategy="PREMIUM"] .strategy-badge-large {
  background: #8b5cf6;
}

.strategy-detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.strategy-detail-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.strategy-detail-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
}

.detail-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-item-header i {
  font-size: 16px;
  color: var(--primary);
}

.detail-item-content {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
}

/* ============================================
   Analysis Loading Overlay
   ============================================ */

.analysis-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.analysis-loading-overlay.active {
  display: flex;
}

.loading-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 64px;
  text-align: center;
  max-width: 400px;
}

.loading-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin: 24px 0 8px 0;
}

.loading-content p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}

.selected-strategy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.replication-storyboard-list {
  flex: 1;
  overflow-y: auto;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Generation Params */
.generation-params {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: auto;
}

.param-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.param-row:last-child {
  margin-bottom: 0;
}

.param-item {
  flex: 1;
}

.param-item.full-width {
  flex: none;
  width: 100%;
}

.param-item label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.param-item select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
}

.reference-images-row {
  display: flex;
  gap: 8px;
}

.ref-img-slot {
  flex: 1;
  padding: 20px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.ref-img-slot i {
  font-size: 24px;
}

/* Generation Footer */
.generation-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.credits-estimate {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.credits-estimate i {
  color: var(--primary);
}

.credits-estimate strong {
  color: var(--primary);
  font-weight: 600;
}

.btn-generate {
  padding: 12px 32px;
}

/* ============================================
   Phase 4: Generating
   ============================================ */

.generating-card {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px;
}

.generating-visual {
  margin-bottom: 32px;
}

.gen-spinner {
  width: 100px;
  height: 100px;
  position: relative;
  margin: 0 auto;
}

.spinner-outer {
  position: absolute;
  inset: 0;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.spinner-inner {
  position: absolute;
  inset: 12px;
  border: 4px solid var(--border-color);
  border-bottom-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite reverse;
}

.gen-spinner i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  color: var(--primary);
}

.generating-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.generating-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 32px 0;
}

.generation-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.gen-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  opacity: 0.5;
  transition: var(--transition-fast);
}

.gen-step.active {
  opacity: 1;
  background: var(--primary-glow);
}

.gen-step.completed {
  opacity: 1;
}

.gen-step .step-indicator {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gen-step.active .step-indicator {
  border-color: var(--primary);
  animation: pulse 1s ease infinite;
}

.gen-step.completed .step-indicator {
  background: var(--green);
  border-color: var(--green);
}

.gen-step.completed .step-indicator i {
  color: white;
  font-size: 12px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.gen-step span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.generation-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.progress-bar-large {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill-large {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--green));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-percentage {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ============================================
   Phase 5: Complete
   ============================================ */

.complete-layout {
  display: flex;
  justify-content: center;
  padding: 40px;
}

.complete-card {
  max-width: 640px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

.complete-icon {
  font-size: 64px;
  color: var(--green);
  margin-bottom: 16px;
}

.complete-card h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.complete-card > p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}

.video-result-preview {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
}

.video-result-preview video {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.complete-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.complete-actions .btn-forge {
  padding: 12px 32px;
}

/* ============================================
   Video Clip Modal
   ============================================ */

.video-clip-modal-box {
  max-width: 720px;
  width: 95%;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title-group h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.modal-title-group p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.btn-close-modal:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
}

.clip-video-preview {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  max-height: 320px;
  margin-bottom: 20px;
}

.clip-video-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-time-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 13px;
  font-family: var(--font-mono);
}

.clip-duration-badge {
  margin-left: 8px;
  padding: 2px 6px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

/* Timeline Section */
.clip-timeline-section {
  margin-bottom: 16px;
}

.timeline-frames-container {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.timeline-frame {
  flex: 1;
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
  overflow: hidden;
}

.timeline-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-slider-container {
  position: relative;
  padding: 0 8px;
}

.timeline-track {
  position: relative;
  height: 40px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.timeline-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0, 102, 204, 0.2);
  border-left: 3px solid var(--primary);
  border-right: 3px solid var(--primary);
}

.timeline-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 16px;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.handle-left {
  left: 0;
}

.handle-right {
  right: 0;
}

.handle-grip {
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: 2px;
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red);
  left: 0;
  z-index: 5;
}

.timeline-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.btn-control {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.btn-control:hover {
  background: var(--border-color);
}

.btn-control.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.clip-info {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.modal-footer .btn-forge,
.modal-footer .btn-secondary {
  margin-top: 0 !important;
  height: 38px;
  box-sizing: border-box;
}

.modal-footer .btn-forge {
  padding: 10px 24px;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-height: 90vh;
  overflow: hidden;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============================================
   New Layout (参考 CreatOK 布局)
   ============================================ */

.rep-main-layout {
  display: flex;
  height: calc(100vh - 80px);
  overflow: hidden;
}

.rep-left-panel {
  width: 320px;
  min-width: 320px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  overflow-y: auto;
}

.rep-right-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-secondary);
}

/* Content states */
.rep-content-state {
  display: none;
  animation: fadeIn 0.3s ease;
}

.rep-content-state.active {
  display: block;
}

/* Empty placeholder */
.rep-empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  text-align: center;
  color: var(--text-muted);
}

.rep-empty-placeholder i {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.rep-empty-placeholder h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.rep-empty-placeholder p {
  font-size: 14px;
  max-width: 400px;
  line-height: 1.6;
}

/* Left panel - Video import section */
.rep-video-import-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rep-import-box {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.rep-import-box:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.rep-import-box.drag-over {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.rep-import-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rep-import-content i {
  font-size: 32px;
  color: var(--primary);
}

.rep-import-content span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.rep-url-row {
  display: flex;
  gap: 8px;
}

.rep-url-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 13px;
}

.rep-url-row input::placeholder {
  color: var(--text-muted);
}

.rep-btn-import {
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.rep-btn-import:hover {
  background: var(--primary-hover);
}

.rep-import-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Left panel - Video preview section */
.rep-video-preview-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rep-video-preview-section.hidden {
  display: none;
}

.rep-video-thumb {
  position: relative;
  aspect-ratio: 9/16;
  max-height: 200px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rep-video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rep-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: var(--transition-fast);
}

.rep-video-thumb:hover .rep-video-overlay {
  opacity: 1;
}

.rep-btn-play {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rep-btn-play i {
  font-size: 20px;
  color: var(--text-main);
}

.rep-video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.rep-video-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rep-filename {
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-btn-change {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.rep-btn-change:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Left panel - Sections */
.rep-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.rep-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
}

.rep-section-title i {
  font-size: 18px;
  color: var(--primary);
}

.rep-clickable {
  cursor: pointer;
}

.rep-toggle-icon {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.rep-collapsible .rep-collapse-content {
  display: none;
}

.rep-collapsible.expanded .rep-collapse-content {
  display: block;
}

.rep-collapsible.expanded .rep-toggle-icon {
  transform: rotate(180deg);
}

.rep-field {
  margin-bottom: 12px;
}

.rep-field:last-child {
  margin-bottom: 0;
}

.rep-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.rep-field input,
.rep-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
}

.rep-field input::placeholder {
  color: var(--text-muted);
}

.rep-product-images {
  display: flex;
  gap: 8px;
}

.rep-img-slot {
  width: 64px;
  height: 64px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.rep-img-slot:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.rep-img-slot i {
  font-size: 20px;
  color: var(--text-muted);
}

/* Left panel - Forge button */
.rep-btn-forge {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  transition: var(--transition-fast);
}

.rep-btn-forge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.rep-btn-forge:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.rep-btn-forge i {
  font-size: 18px;
}

/* Loading overlay */
.rep-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.rep-loading-overlay.active {
  display: flex;
}

.rep-loading-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  text-align: center;
  max-width: 400px;
}

.rep-loading-box h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin: 16px 0 8px 0;
}

.rep-loading-box p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px 0;
}

.rep-loading-spinner {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rep-loading-spinner .spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.rep-loading-spinner i {
  font-size: 24px;
  color: var(--primary);
}

.rep-loading-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rep-loading-progress .rep-progress-bar {
  flex: 1;
}

.rep-loading-progress span {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  min-width: 40px;
}

.rep-loading-content {
  text-align: center;
  color: white;
}

.rep-loading-content .spinner {
  font-size: 48px;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rep-loading-content p {
  font-size: 16px;
  margin: 8px 0 0 0;
}

.rep-progress-bar {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin-top: 16px;
  overflow: hidden;
}

.rep-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

/* ============================================
   Analysis State Layout
   ============================================ */

.rep-analysis-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  height: 100%;
}

.rep-storyboard-panel,
.rep-strategies-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.rep-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.rep-panel-header i {
  font-size: 18px;
  color: var(--primary);
}

.rep-panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

.rep-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Storyboard cards in analysis */
.rep-storyboard-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.rep-storyboard-card:last-child {
  margin-bottom: 0;
}

.rep-sb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.rep-sb-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rep-sb-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
}

.rep-sb-time {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.rep-sb-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rep-sb-field {
  background: var(--bg-card);
  padding: 10px;
  border-radius: var(--radius-sm);
}

.rep-sb-field label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.rep-sb-field p {
  font-size: 13px;
  color: var(--text-main);
  margin: 0;
  line-height: 1.5;
}

/* Strategy cards in analysis */
.rep-strategies-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rep-strategy-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.rep-strategy-card:hover {
  border-color: var(--primary);
}

.rep-strategy-card.recommended {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.rep-strategy-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.rep-strategy-badge {
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.rep-strategy-rec {
  padding: 4px 8px;
  background: #10b981;
  color: white;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-full);
}

.rep-strategy-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 6px 0;
}

.rep-strategy-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 10px 0;
  line-height: 1.5;
}

.rep-strategy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.rep-strategy-tag {
  padding: 4px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
}

.rep-btn-select {
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.rep-btn-select:hover {
  background: var(--primary-hover);
}

/* ============================================
   Confirm State Layout
   ============================================ */

.rep-confirm-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  height: 100%;
}

.rep-strategy-detail-panel,
.rep-selected-strategy-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.rep-strategy-detail {
  padding-top: 12px;
}

.rep-detail-badge,
.rep-selected-badge {
  padding: 6px 14px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 12px;
}

.rep-detail-title,
.rep-selected-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.rep-detail-desc,
.rep-selected-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.rep-detail-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rep-detail-item {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.rep-detail-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 4px;
}

.rep-detail-item-header i {
  color: var(--primary);
}

.rep-detail-item-content {
  font-size: 13px;
  color: var(--text-muted);
}

.rep-confirm-right-panel,
.rep-storyboard-edit-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rep-confirm-right-panel .rep-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rep-btn-regen {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.rep-btn-regen:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.rep-replication-storyboard {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.rep-gen-params {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.rep-param {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rep-param label {
  font-size: 12px;
  color: var(--text-muted);
}

.rep-param select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  min-width: 120px;
}

.rep-ref-img-preview {
  width: 48px;
  height: 48px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.rep-ref-img-preview:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.rep-ref-img-preview i {
  font-size: 20px;
  color: var(--text-muted);
}

.rep-gen-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.rep-credits-est {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.rep-credits-est i {
  color: var(--primary);
}

.rep-credits-est strong {
  color: var(--primary);
  font-weight: 600;
}

.rep-edit-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.rep-edit-row {
  display: flex;
  gap: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.rep-edit-row:last-child {
  margin-bottom: 0;
}

.rep-edit-num {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rep-edit-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rep-edit-field label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.rep-edit-field input,
.rep-edit-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
}

.rep-edit-field textarea {
  resize: vertical;
  min-height: 60px;
}

.rep-confirm-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.rep-btn-generate {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.rep-btn-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

/* ============================================
   Video Clip Modal (参考 CreatOK-videoclip.png)
   ============================================ */

.rep-clip-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.rep-clip-modal-overlay.active {
  display: flex;
}

.rep-clip-modal {
  width: 680px;
  max-width: 95vw;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: modalIn 0.25s ease;
}

.rep-clip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.rep-clip-title h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 4px 0;
}

.rep-clip-title p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.rep-clip-close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.rep-clip-close:hover {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.rep-clip-close i {
  font-size: 18px;
}

.rep-clip-body {
  padding: 24px;
}

.rep-clip-preview {
  position: relative;
  aspect-ratio: 9/16;
  max-height: 320px;
  margin: 0 auto 20px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rep-clip-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rep-clip-time-display {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 14px;
  color: white;
}

.rep-clip-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.rep-clip-ctrl-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.rep-clip-ctrl-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.rep-clip-ctrl-btn i {
  font-size: 18px;
}

.rep-clip-time-info {
  flex: 1;
  font-size: 14px;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.rep-clip-duration-badge {
  color: var(--primary);
  font-weight: 500;
}

.rep-clip-ctrl-right {
  display: flex;
  gap: 8px;
}

.rep-clip-timeline {
  margin-bottom: 16px;
}

.rep-clip-frames {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  height: 48px;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.rep-clip-frame {
  flex: 1;
  height: 100%;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
}

.rep-clip-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rep-clip-slider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rep-clip-track {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  position: relative;
}

.rep-clip-selection {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  opacity: 0.6;
}

.rep-clip-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 24px;
  background: var(--primary);
  border: 2px solid white;
  border-radius: 4px;
  cursor: ew-resize;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.rep-clip-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.rep-clip-playhead {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  background: white;
  z-index: 5;
  pointer-events: none;
}

.rep-clip-total-time {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.rep-clip-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.rep-clip-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.rep-btn-secondary {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.rep-btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

/* ============================================
   Generating State
   ============================================ */

.rep-generating-card {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
  padding: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.rep-generating-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin: 24px 0 8px 0;
}

.rep-generating-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}

.rep-gen-spinner {
  width: 80px;
  height: 80px;
  position: relative;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rep-gen-spinner .spinner-outer {
  position: absolute;
  inset: 0;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.rep-gen-spinner .spinner-inner {
  position: absolute;
  inset: 10px;
  border: 3px solid var(--border-color);
  border-bottom-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite reverse;
}

.rep-gen-spinner i {
  font-size: 24px;
  color: var(--primary);
}

.rep-gen-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}

.rep-gen-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}

.rep-gen-step .step-dot {
  width: 8px;
  height: 8px;
  background: var(--border-color);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.rep-gen-step.active {
  color: var(--text-main);
}

.rep-gen-step.active .step-dot {
  background: var(--primary);
  animation: pulse 1s ease infinite;
}

.rep-gen-step.completed .step-dot {
  background: #10b981;
}

.rep-gen-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rep-gen-progress .rep-progress-bar {
  flex: 1;
}

.rep-gen-progress span {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  min-width: 40px;
}

/* ============================================
   Complete State
   ============================================ */

.rep-complete-card {
  max-width: 600px;
  margin: 40px auto;
  text-align: center;
  padding: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.rep-complete-icon {
  font-size: 64px;
  color: #10b981;
  margin-bottom: 16px;
}

.rep-complete-card h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.rep-complete-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}

.rep-result-video-wrapper {
  aspect-ratio: 9/16;
  max-height: 320px;
  margin: 0 auto 24px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rep-result-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rep-complete-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}
