.video-creation {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: var(--spacing-md); /* 减小间隔 */
}

/* Step Indicator */
.step-indicator {
  position: relative;
  padding: 0 var(--spacing-lg);
  margin-top: -8px; /* 整体上移 */
}

.step-progress-track {
  position: absolute;
  top: 18px;
  left: 60px;
  right: 60px;
  height: 3px;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  z-index: 0;
}

.step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
}

.step-dots {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  padding: 0 8px;
  z-index: 2;
  border: none;
  cursor: default;
  padding: 0;
  font-family: var(--font-family);
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 3;
  background: var(--bg-primary);
  justify-content: center;
  font-size: var(--font-sm);
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-tertiary);
  border: 2px solid var(--border-color);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.step-dot.active .step-number {
  background: var(--primary-gradient);
  color: var(--text-inverse);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgb(54 178 106 / 30%);
  transform: scale(1.1);
}

.step-dot.completed .step-number {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

.step-label {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.step-dot.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

.step-dot.completed .step-label {
  color: var(--text-secondary);
}

.step-dot.disabled {
  cursor: default;
  opacity: 0.5;
}

.step-dot.disabled:hover .step-number {
  transform: none;
  border-color: var(--border-color);
}

/* Dirty step indicator */
.step-dot.dirty .step-number {
  border-color: #f5a623;
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
}

.step-dot.completed.dirty .step-number {
  background: #f5a623;
  border-color: #f5a623;
}

.step-dot.dirty .step-label {
  color: #d46b08;
  font-weight: 500;
}

/* Step dirty banner */
.step-dirty-banner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  margin: 0 var(--spacing-lg) var(--spacing-md);
  background: #fff8f0;
  border: 1px solid #ffe8d0;
  border-radius: var(--radius-lg);
  border-left: 3px solid #f5a623;
}

.step-dirty-banner span {
  font-size: var(--font-sm);
  color: #d46b08;
}

/* Step Content */
.step-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Step Navigation */
.step-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
  border-top: 1px solid var(--border-light);
}

.btn-disabled {
  cursor: default !important;
  pointer-events: none;
  opacity: 0.5;
}

.step-navigation .btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

.step-counter {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  font-weight: 500;
}

.step-counter-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 导航按钮统一宽度 */
.nav-btn-prev,
.nav-btn-next {
  width: 120px;
}

/* Shared Step Layout */
.step-layout {
  display: grid;
  grid-template-columns: 40fr 60fr;
  gap: var(--spacing-xl);
  height: 100%;
  min-height: 400px;
}

.step-layout.video-gen-layout {
  grid-template-columns: 55fr 45fr;
}

.step-panel-left {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  overflow-y: auto;
  padding-right: var(--spacing-md);
}

.step-panel-right {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  overflow-y: auto;
  padding-right: var(--spacing-md);
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.panel-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.panel-sublabel {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
}

/* Option Cards */
.option-cards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.option-card {
  flex: 1;
  min-width: 100px;
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  text-align: center;
  font-size: var(--font-sm);
  font-family: var(--font-family);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

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

.option-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

/* Script Editor */
.script-editor {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.script-segment {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

.script-segment:hover {
  box-shadow: var(--shadow-md);
}

.segment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--bg-input);
  border-bottom: 1px solid var(--border-light);
}

.segment-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.segment-duration {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  background: var(--bg-card);
  padding: 2px var(--spacing-sm);
  border-radius: var(--radius-sm);
}

.segment-body {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.segment-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.segment-field-label {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.segment-field-value {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.segment-field textarea {
  min-height: 60px;
  font-size: var(--font-sm);
}

.segment-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--border-light);
}

/* Material Selector */
.material-selector {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.material-selector:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.material-selector.selected {
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-light);
}

.material-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.material-selector.selected .material-icon {
  background: var(--primary);
  color: white;
}

.material-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
  align-items: flex-start;
  justify-content: center;
}

.material-name {
  font-size: var(--font-base);
  font-weight: 500;
  color: var(--text-primary);
  text-align: left;
  width: 100%;
  display: block;
}

/* Video Player Placeholder */
.video-player-placeholder {
  flex: 1;
  min-height: 300px;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  color: var(--text-tertiary);
  border: 1px solid var(--border-light);
}

.video-player-placeholder svg {
  opacity: 0.4;
}

/* Empty State */
.empty-state {
  flex: 1;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-placeholder);
}

.empty-state-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state-desc {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  text-align: center;
  max-width: 280px;
  line-height: 1.6;
}

/* Material Grid - Refined 4-column layout */
.material-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
  padding: var(--spacing-xs);
}

.material-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg) var(--spacing-sm);
  cursor: pointer;
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  text-align: center;
  box-shadow: var(--shadow-sm);

  /* Glassmorphism Effect */
  backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.material-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  background: var(--bg-hover);
}

.material-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow:
    0 0 0 2px var(--primary-light),
    var(--shadow-md);
}

/* Selected Checkmark Indicator */
.material-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: all var(--transition-normal);
  border: 1.5px solid var(--border-light);
}

.material-card.selected .material-card-avatar {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  transform: scale(1.05);
}

.material-card-name {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-primary);
}

.material-desc {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  text-align: left;
  width: 100%;
  display: block;
}

/* 音色卡片中的描述 - 居中对齐 */
.material-card-desc {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  text-align: center;
  width: 100%;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0 var(--spacing-xs);
  max-width: 100%;
}

/* Add/Clone Voice Style - Special Card */
.material-card.add-card {
  border: 2px dashed var(--border-color);
  background: var(--bg-input);
  opacity: 0.8;
}

.material-card.add-card:hover {
  border-style: solid;
  border-color: var(--primary);
  background: var(--primary-light);
  opacity: 1;
}

.material-card.add-card .material-card-avatar {
  background: var(--bg-input);
  color: var(--text-tertiary);
  border: 2px dashed var(--border-color);
}

.material-card.add-card:hover .material-card-avatar {
  color: var(--primary);
  border-color: var(--primary);
  background: white;
}

/* Storyboard – Vertical */
.storyboard-vertical {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--spacing-xs) 0;
  max-height: 340px;
}

.storyboard-vertical-item {
  display: flex;
  flex-direction: column;
}

/* Scene Card – Vertical */
.storyboard-vcard {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.storyboard-vcard:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.storyboard-vcard.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.storyboard-vcard-thumb {
  width: 80px;
  min-height: 64px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
  position: relative;
}

.storyboard-vcard-thumb .scene-number {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgb(0 0 0 / 50%);
  color: white;
  font-size: var(--font-xs);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.storyboard-vcard-info {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  justify-content: center;
}

.storyboard-vcard-desc {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.storyboard-vcard-voiceover {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.storyboard-vcard-duration {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  background: var(--bg-input);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  align-self: flex-start;
  margin-top: 2px;
}

/* Transition Slot */
.storyboard-transition-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Placeholder (no transition yet) */
.storyboard-transition-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0;
}

.transition-connector-line {
  width: 2px;
  height: 10px;
  background: var(--border-color);
}

.transition-add-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-tertiary);
  font-size: var(--font-xs);
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.transition-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 2px 8px rgb(54 178 106 / 15%);
  transform: translateY(-1px);
}

.transition-add-btn svg {
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.transition-add-btn:hover svg {
  opacity: 1;
}

/* Transition Card (inserted) */
.storyboard-transition-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.transition-connector {
  width: 2px;
  height: 8px;
  background: var(--primary);
}

.transition-card-body {
  width: calc(100% - 40px);
  margin: 0 20px;
  padding: 8px var(--spacing-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: row;
  gap: var(--spacing-md);
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition-fast);
}

.transition-card-body:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.transition-card-body::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-gradient);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  opacity: 0.6;
}

.transition-card-preview {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  position: relative;
}

.transition-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.transition-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.transition-card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.transition-tag {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--primary);
  background: rgb(54 178 106 / 15%);
  padding: 1px 8px;
  border-radius: var(--radius-sm);
}

.transition-card-duration {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  background: var(--bg-input);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.transition-card-voiceover {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.transition-card-actions {
  display: flex;
  gap: var(--spacing-xs);
  margin-left: auto;
}

/* Transition Modal Split Layout */
.transition-modal-split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--spacing-lg);
}

.transition-modal-left,
.transition-modal-right {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.transition-gen-type {
  display: flex;
  gap: var(--spacing-xs);
}

.transition-gen-type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: 6px 10px;
  font-size: var(--font-xs);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.transition-gen-type-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.transition-gen-type-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.transition-preview-box {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
}

.transition-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.transition-preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  padding: var(--spacing-sm);
  background: linear-gradient(transparent, rgb(0 0 0 / 50%));
}

.transition-upload-placeholder {
  width: 100%;
  flex: 1;
  min-height: 120px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  color: var(--text-tertiary);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-input);
}

.transition-upload-placeholder:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.transition-preview-916 {
  aspect-ratio: 9 / 16;
  min-height: unset;
  flex: unset;
}

/* Template Selection */
.template-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.template-card {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

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

.template-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.template-preview {
  height: 80px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  border: 1px solid var(--border-light);
}

.template-name {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
}

/* Cover Design */
.cover-preview {
  flex: 1;
  min-height: 360px;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.cover-preview-inner {
  width: 240px;
  height: 320px;
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  color: white;
  padding: var(--spacing-xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.cover-preview-title {
  font-size: var(--font-xl);
  font-weight: 700;
  line-height: 1.3;
}

/* Synthesis */
.synthesis-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  gap: var(--spacing-2xl);
  text-align: center;
}

.synthesis-progress {
  width: 100%;
  max-width: 500px;
}

.synthesis-percentage {
  font-size: var(--font-2xl);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--spacing-sm);
}

.synthesis-detail {
  font-size: var(--font-sm);
  color: var(--text-tertiary);
  margin-top: var(--spacing-sm);
}

/* ===== Post Edit Layout ===== */

/* Layout variant: same as video-gen-layout (50:50 split) */
.step-layout.post-edit-variant {
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
}

/* Cover design variant: Balanced layout 55:45 */
.step-layout.cover-design-variant {
  grid-template-columns: 55fr 45fr;
  gap: var(--spacing-xl);
}

.cover-config-panel {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  overflow-y: auto;
  padding-right: var(--spacing-sm);
}

.cover-template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md); /* Reasonable gap as requested */
}

.cover-generate-btn {
  width: 100%;
  font-size: var(--font-md);
  font-weight: 600;
  margin-top: 4px;
}

.cover-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

.cover-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-sm);
  text-align: center;
}

.cover-option-card svg {
  margin-bottom: 2px;
}

/* Left panel scrollable with custom padding */
.post-edit-left {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  overflow-y: auto;
  padding-right: var(--spacing-sm);
}

/* Template section header: label + slider on same row */
.post-edit-template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.post-edit-template-header .slider-group {
  margin: 0;
  width: 180px;
  background: transparent;
  padding: 0;
}

.post-edit-template-header .slider-header {
  margin-bottom: 2px;
}

.post-edit-template-header .slider-label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* Title templates: 3-column grid */
.post-edit-title-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
}

/* Subtitle templates: 2-column grid */
.post-edit-subtitle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
}

/* Template card compact style for post-edit */
.post-edit-title-grid .template-card,
.post-edit-subtitle-grid .template-card {
  padding: var(--spacing-sm);
  display: flex;
  flex-direction: column;
}

/* Ensure all title template cards have uniform height */
.post-edit-title-grid .template-card {
  min-height: 0;
}

/* Template preview black box */
.post-edit-template-preview {
  background: #000;
  height: 60px;
  margin-bottom: 6px;
  border: none;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Normalize title-fx elements inside preview cards so all cards look uniform */
.post-edit-template-preview > [class^='title-fx-'],
.post-edit-template-preview > [class^='sub-fx-'] {
  padding: 4px 8px !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  margin: 0 !important;
  max-width: 90%;
  box-sizing: border-box;
}

/* Subtitle template preview - neutral dark background for better contrast of both white/black text */
.post-edit-subtitle-grid .post-edit-template-preview {
  background: #333;
  background-image:
    linear-gradient(45deg, #3a3a3a 25%, transparent 25%),
    linear-gradient(-45deg, #3a3a3a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #3a3a3a 75%),
    linear-gradient(-45deg, transparent 75%, #3a3a3a 75%);
  background-size: 10px 10px;
  background-position:
    0 0,
    0 5px,
    5px 5px,
    5px 0;
}

/* Template card label */
.post-edit-template-label {
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  text-align: center;
}

.template-card.selected .post-edit-template-label {
  color: var(--primary);
}

/* Section divider */
.post-edit-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--spacing-xs) 0;
}

/* Right column: preview + scene config, stacked vertically */
.post-edit-right {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  border-left: 1px solid var(--border-light);
  padding-left: var(--spacing-lg);
  overflow: hidden;
  min-height: 0;
}

/* Monitor wrapper */
.post-edit-monitor {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--bg-input);
  border-radius: var(--radius-xl);
}

/* Phone frame */
.post-edit-phone {
  height: min(420px, 55vh);
  width: calc(min(420px, 55vh) * 9 / 16);
  background: #000;
  border-radius: 28px;
  border: 6px solid #1a1a1a;
  box-shadow: 0 16px 40px rgb(0 0 0 / 25%);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

/* Slightly smaller phone for better window fit */
.post-edit-phone.cover-phone {
  height: min(480px, 65vh);
  width: calc(min(480px, 65vh) * 9 / 16);
  border-radius: 28px;
}

.post-edit-phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

/* Notch */
.post-edit-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: #333;
  border-radius: var(--radius-sm);
  z-index: 11;
}

/* Play icon watermark */
.post-edit-play-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* Scene config area */
.post-edit-scene-area {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex: 1;
  min-height: 0;
}

.post-edit-scene-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

/* Scene item card */
.post-edit-scene-item {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.post-edit-scene-item:hover {
  border-color: var(--primary);
}

.post-edit-scene-item.active {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* Scene item header row */
.post-edit-scene-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.post-edit-scene-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-tertiary);
}

.post-edit-scene-item.active .post-edit-scene-label {
  color: var(--primary);
}

/* Transition tag */
.post-edit-scene-tag {
  font-size: var(--font-xs);
  background: rgb(0 0 0 / 5%);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}

/* Scene title input */
.post-edit-scene-input {
  height: 32px;
  font-size: var(--font-sm);
}

.post-edit-scene-item.active .post-edit-scene-input {
  background: var(--bg-card);
}

.post-edit-field-label {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  display: block;
}

.post-edit-scene-item.active .post-edit-field-label {
  color: var(--primary);
  opacity: 0.8;
}

.post-edit-scene-voiceover {
  margin-bottom: 8px;
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgb(0 0 0 / 2%);
  border-radius: var(--radius-sm);
}

.post-edit-scene-item.active .post-edit-scene-voiceover {
  background: rgb(255 255 255 / 30%);
}

.post-edit-voiceover-text {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.post-edit-scene-input-wrapper {
  display: flex;
  flex-direction: column;
}

/* Title Templates Rendering */
.title-overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: var(--spacing-2xl);

  /* 顶部留白 */
  z-index: 10;
}

.post-edit-section-title {
  display: flex;
  flex-direction: column;
}

/* 
 * 6套短视频标题字效 (Short-video Title Effects) - 纯文本无背景
 */
.title-fx-base {
  transition: all var(--transition-normal);
  line-height: 1.4;
  word-break: break-word; /* Let browser wrap words naturally instead of aggressively cutting them */
  font-weight: 800; /* Bolder text for short video titles layer */
  text-align: center;
}

/* --- User Provided Specific Templates (8 Sets) --- */

/* 1. 强对比描边风 (Stroke: Classic Hit) */
.title-fx-1 {
  font-family: 'Alibaba PuHuiTi', 'Alibaba Sans', sans-serif;
  color: #fff;
  -webkit-text-stroke: 3px #000;
  paint-order: stroke fill;
  display: inline-block;
  padding: 6px 0; /* Add safety margin to prevent stroke clipping at top/bottom */
  letter-spacing: 2px;
}

/* 2. 至臻磨砂 (Glassmorphism) */
.title-fx-2 {
  font-family: 'DouyinSans', sans-serif;
  color: #fff;
  background: rgb(255 255 255 / 15%);
  backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 4px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgb(255 255 255 / 40%);
  box-shadow: 0 8px 32px rgb(0 0 0 / 40%);
  display: inline-block;
  font-weight: 800;
  letter-spacing: 1px;
}

/* 3. 漫画波普风 (Comic: High Saturation Clash) */
.title-fx-3 {
  font-family: OPPOSans, 'OPPO Sans', sans-serif;
  font-weight: 900;
  color: #000;
  background-color: #ffe600;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  box-shadow:
    6px 6px 0 #f05,
    8px 8px 10px rgb(0 0 0 / 40%);
  transform: rotate(-2deg);
  display: inline-block;
}

/* 4. 爆款引流风 (Viral: TikTok Red) */
.title-fx-4 {
  font-family: Impact, 'Arial Black', 'DouyinSans', sans-serif;
  color: #fff;
  background: #ff004c; /* TikTok红/抖音红 */
  padding: 6px 12px;
  display: inline-block;
  box-shadow: 6px 6px 0 rgb(0 0 0 / 50%); /* 硬阴影 */
  text-shadow: 2px 2px 0 #000;
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

/* 5. 极简黑底 (Classic Black Bar) */
.title-fx-5 {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  background-color: #000;
  padding: 8px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 4px;
  border-radius: 0; /* 无圆角，直角矩形 */
  line-height: 1;
}

/* 6. 新闻纪实风 (News: Journalistic) */
.title-fx-6 {
  font-family: 'DouyinSans', sans-serif;
  font-weight: 700;
  color: #000;
  background: #e0e0e0; /* 浅灰色 */
  padding: 6px 20px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  line-height: 1;
}

/* 7. 先锋潮流 (Brutal: Brutalism) */
.title-fx-7 {
  font-family: 'Arial Black', Impact, sans-serif;
  font-weight: 900;
  font-style: italic;
  color: #000;
  background: #cf0; /* 荧光绿 */
  border: 3px solid #000;
  padding: 4px 10px; /* Adjusted to visually match template 4 accounting for the 3px border */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 0 #000; /* 缩小后的硬阴影 */
  text-transform: uppercase;
  line-height: 1;
}

/* 8. 圆润胶囊风 (Pill: Modern Capsule) */
.title-fx-8 {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  color: #fff;
  background: #ff8c00; /* 亮橙色 */
  padding: 6px 12px; /* Set to match Template 4 (6px 12px) */
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgb(255 140 0 / 30%);
  line-height: 1;
}

/* 9. 复古像素 (Y2K: Win95 Retro) */
.title-fx-9 {
  font-family: 'Arial Narrow', sans-serif;
  font-weight: 900;
  color: #000;
  background: #c0c0c0; /* 经典Win95灰 */
  border: 3px solid #000;
  padding: 6px 12px;
  display: inline-block;
  position: relative;
  box-shadow: 6px 6px 0 #000;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

/* --- Animations --- */
@keyframes flash-white {
  0% {
    filter: brightness(10) contrast(1.5);
    opacity: 0;
  }

  100% {
    filter: brightness(1) contrast(1);
    opacity: 1;
  }
}

@keyframes fade-in-slow {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes long-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 0.85;
  }
}

@keyframes bubble-in {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  80% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slow-zoom-in {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes snap-in {
  from {
    transform: scale(1.5);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 
 * 2套短视频字幕字效 (Short-video Subtitle Effects) - 纯文本无背景
 */
.sub-fx-base {
  transition: all var(--transition-normal);
  line-height: 1.3;
  font-weight: 700;
}

/* 1. 经典纯白 (White text with dark background) */
.sub-fx-1 {
  font-family: 'DouyinSans', sans-serif;
  color: #fff;
  background: rgb(0 0 0 / 20%);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  text-shadow: 0 1px 2px rgb(0 0 0 / 50%);
}

/* 2. 极简纯黑 (Black text with white background) */
.sub-fx-2 {
  font-family: 'DouyinSans', sans-serif;
  color: #000;
  background: rgb(255 255 255 / 20%);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  text-shadow: none;
  box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
}

/* Constrain Video Preview to 9:16 */
.video-player-preview-916 {
  position: relative;
  overflow: hidden;
  background: linear-gradient(45deg, #1f1f23, #111113);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  aspect-ratio: 9 / 16;
  height: 100%;
  width: auto;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Title constraint strictly 2 lines max */
.title-overlay-clamped {
  display: block;
  line-height: 1.4 !important;
  max-height: 2.8em; /* 1.4 * 2 lines */
  overflow: hidden;
  text-overflow: clip;

  /* Removed max-width: 90% to prevent premature wrapping inside inline-block parents */
  white-space: normal !important;
  word-break: break-word;
}

/* ============================================
   音色分类 Tab 样式
   ============================================ */

.voice-category-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--spacing-lg);
}

.tab-item {
  padding: var(--spacing-sm) var(--spacing-xl);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-light);
  border-right: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 120px;
}

.tab-item:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.tab-item:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-right: 1px solid var(--border-light);
}

.tab-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab-item.active {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

.tab-item.active + .tab-item {
  border-left-color: var(--primary);
}
