/* 第二阶段（换客户自己的视频）新增样式，复用 /style.css 基础变量与组件 */

.back-home-link {
  color: var(--wood-accent);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.back-home-link:hover {
  color: var(--wood-accent-hover);
  text-decoration: underline;
}

/* ==================== ① 上传视频与最近上传 ==================== */
.upload-cancel-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.analyze-status-body {
  flex: 1;
  min-width: 0;
}

.analyze-status-body .status-row {
  margin-bottom: 4px;
}

.video-failed-box {
  margin-top: 12px;
  padding: 12px;
  background-color: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.video-failed-msg {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--error-text);
  word-break: break-word;
}

.video-ready-box {
  margin-top: 12px;
  padding: 10px 12px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--wood-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-ready-thumb {
  width: 68px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--wood-border);
  background-color: #231c16;
  flex-shrink: 0;
}

.video-ready-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.video-ready-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--status-done-text);
}

.video-ready-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* 最近上传列表 */
.recent-videos-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.recent-videos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.recent-videos-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.recent-videos-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recent-videos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-video-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background-color: #fcfaf7;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.recent-video-item:hover {
  background-color: var(--bg-subtle);
}

.recent-video-item.is-active {
  border-color: var(--wood-accent);
  background-color: var(--wood-soft);
}

.recent-video-thumb {
  display: block;
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--wood-border);
  flex-shrink: 0;
}

.recent-video-thumb.is-placeholder {
  background-color: var(--bg-subtle);
  border-color: var(--border-light);
}

.recent-video-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.recent-video-time {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ==================== ② 选板样 ==================== */
.texture-saved-bar {
  padding: 12px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--wood-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.texture-bar-actions {
  display: flex;
  gap: 8px;
}

.texture-bar-actions .btn {
  flex: 1;
}

.texture-picker-panel {
  margin-top: 12px;
}

#texture-saved-bar[hidden] + .texture-picker-panel {
  margin-top: 0;
}

/* ==================== ③ & ⑥ AI 要求与反馈 ==================== */
.textarea-input {
  resize: vertical;
  min-height: 82px;
  line-height: 1.45;
}

.plan-action-wrap {
  margin-top: 10px;
}

.field-hint-center {
  text-align: center;
}

.ai-reply-wrap {
  margin-top: 14px;
}

.ai-reply-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.ai-reply-bubble {
  position: relative;
  padding: 12px 14px;
  background-color: var(--wood-soft);
  border: 1px solid var(--wood-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.94rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==================== ④ 镜头点选卡片与叠加层 ==================== */
.shots-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.shot-card {
  border: 1px solid var(--wood-border);
  border-radius: var(--radius-md);
  background-color: #fcfaf7;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shot-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.shot-card-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.shot-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shot-selected-count {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--wood-accent);
  background-color: var(--wood-soft);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

.shot-selected-count.is-empty {
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  font-weight: 500;
}

.btn-clear-shot {
  min-height: 40px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

.shot-regions-retry {
  width: 100%;
  color: var(--error-text);
  border-color: var(--error-border);
  background-color: var(--error-bg);
}

/* 原图 / 换板后 预览切换栏 */
.shot-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.shot-mode-switch {
  display: inline-flex;
  border: 1px solid var(--wood-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.shot-mode-btn {
  min-height: 40px;
  padding: 4px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
}

.shot-mode-btn.is-active {
  background-color: var(--wood-accent);
  color: #ffffff;
  font-weight: 600;
}

.shot-expired-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--status-run-text);
  background-color: var(--status-run-bg);
  border: 1px solid #ebcfa8;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* 镜头画面与同尺寸叠加 Canvas */
.shot-stage {
  position: relative;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #1c1612;
  line-height: 0;
}

.shot-key-img,
.shot-preview-img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.shot-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: manipulation;
}

/* 参数区与看效果 */
.params-panel {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.params-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.params-panel-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
}

.preview-action-wrap {
  margin-top: 14px;
}

/* ==================== ⑤ 生成视频与任务列表 ==================== */
.vjobs-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.vjobs-header {
  margin-bottom: 10px;
}

.vjobs-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.job-thumbs-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
