/* ============================================================
   pv.css — PPT-Video 模块全部样式
   依赖：tokens.css（CSS 变量：--pv-primary, --pv-text, --pv-border 等）
   ============================================================ */

/* 放在最顶部：Alpine 初始化前隐藏 */
[x-cloak] { display: none !important; }

/* ==================== 基础变量 + z-index 层级 ==================== */
:root {
  --pv-primary: #6366f1;
  --pv-primary-light: #818cf8;
  --pv-primary-dark: #4f46e5;
  --pv-success: #10b981;
  --pv-warning: #f59e0b;
  --pv-error: #ef4444;
  --pv-text: #1e293b;
  --pv-text-muted: #64748b;
  --pv-text-sm: #94a3b8;
  --pv-border: #e2e8f0;
  --pv-bg: #f1f5f9;
  --pv-bg-card: #ffffff;
  --pv-radius: 8px;
  --pv-radius-lg: 12px;
  --pv-shadow: 0 1px 3px rgba(0,0,0,0.08);
  --pv-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --pv-transition: 0.2s ease;
  --pv-z-sticky: 200;
  --pv-z-toast: 9999;
  --pv-z-error: 10000;
}

/* ==================== 容器 & 布局 ==================== */
.pv-workbench {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  font-size: 14px;
  color: var(--pv-text);
}

.pv-step-panel {
  animation: pvFadeIn 0.25s ease;
}

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

/* ==================== 步骤指示器 ==================== */
.pv-steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: var(--pv-bg-card);
  border-radius: var(--pv-radius-lg);
  box-shadow: var(--pv-shadow);
  overflow: hidden;
}

.pv-step {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--pv-text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--pv-transition);
}

.pv-step:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--pv-border);
}

.pv-step.active { color: var(--pv-primary); background: rgba(99,102,241,0.06); }
.pv-step.active::after { display: none; }
.pv-step.done { color: var(--pv-success); }
.pv-step:disabled { cursor: not-allowed; opacity: 0.45; }

/* ==================== 卡片 ==================== */
.pv-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.pv-card {
  background: var(--pv-bg-card);
  border: 2px solid var(--pv-border);
  border-radius: var(--pv-radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--pv-transition);
}

.pv-card:hover { border-color: var(--pv-primary-light); box-shadow: var(--pv-shadow-md); }

.pv-card.selected {
  border-color: var(--pv-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  transform: translateY(-2px);
}

.pv-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--pv-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-card p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--pv-text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pv-badge {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(99,102,241,0.08);
  color: var(--pv-primary);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

.pv-meta { font-size: 12px; color: var(--pv-text-sm); }

/* ==================== 选项行 & Chip ==================== */
.pv-option-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.pv-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--pv-text);
  margin-right: 4px;
  min-width: 60px;
}

.pv-chip {
  padding: 6px 14px;
  border: 1px solid var(--pv-border);
  border-radius: 20px;
  background: var(--pv-bg-card);
  font-size: 13px;
  color: var(--pv-text-muted);
  cursor: pointer;
  transition: var(--pv-transition);
  white-space: nowrap;
}

.pv-chip:hover { border-color: var(--pv-primary-light); color: var(--pv-primary); }
.pv-chip.active { background: var(--pv-primary); border-color: var(--pv-primary); color: #fff; }
.pv-chip-desc { display: block; font-size: 11px; opacity: 0.75; }

/* ==================== 按钮 ==================== */
.pv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--pv-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--pv-transition);
}

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

.pv-btn--primary { background: var(--pv-primary); color: #fff; }
.pv-btn--primary:hover:not(:disabled) { background: var(--pv-primary-dark); }

.pv-btn--secondary { background: var(--pv-bg); color: var(--pv-text); border: 1px solid var(--pv-border); }
.pv-btn--secondary:hover:not(:disabled) { background: var(--pv-border); }

.pv-btn--ghost { background: transparent; color: var(--pv-text-muted); }
.pv-btn--ghost:hover:not(:disabled) { background: var(--pv-bg); color: var(--pv-text); }

.pv-btn--danger { background: transparent; color: var(--pv-error); border: 1px solid var(--pv-error); }
.pv-btn--danger:hover:not(:disabled) { background: var(--pv-error); color: #fff; }

.pv-btn--sm { padding: 5px 12px; font-size: 12px; }
.pv-btn--lg { padding: 14px 28px; font-size: 16px; }

.pv-btn--icon {
  width: 28px; height: 28px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; border-radius: 50%;
  font-size: 16px; color: var(--pv-text-muted); cursor: pointer;
}
.pv-btn--icon:hover { background: var(--pv-bg); color: var(--pv-error); }

/* ==================== 键盘聚焦态 ==================== */
.pv-btn:focus-visible,
.pv-chip:focus-visible,
.pv-card:focus-visible,
.pv-step:focus-visible,
.pv-input:focus-visible,
.pv-textarea:focus-visible,
.pv-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}

/* ==================== 区域面板 ==================== */
.pv-section { margin-bottom: 16px; }

.pv-section-box {
  background: var(--pv-bg-card);
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}
.pv-section-box h3 { margin: 0 0 8px; font-size: 15px; }

.pv-section-box--highlight {
  border-color: var(--pv-primary-light);
  background: rgba(99,102,241,0.03);
}

.pv-hint { font-size: 13px; color: var(--pv-text-muted); margin: 0 0 12px; }

/* ==================== 输入控件 ==================== */
.pv-input, .pv-textarea, .pv-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--pv-text);
  background: var(--pv-bg-card);
  transition: border-color var(--pv-transition);
  box-sizing: border-box;
}

.pv-input:focus, .pv-textarea:focus, .pv-select:focus {
  outline: none;
  border-color: var(--pv-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.pv-input:disabled, .pv-textarea:disabled, .pv-select:disabled {
  background: var(--pv-bg);
  color: var(--pv-text-sm);
  cursor: not-allowed;
  opacity: 0.8;
}

.pv-textarea { resize: vertical; min-height: 80px; }
.pv-input--sm { width: auto; padding: 5px 8px; font-size: 13px; }

.pv-hidden-input {
  position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none;
}

/* ==================== 步骤 1 扩展区 ==================== */
.pv-step1-options { animation: pvFadeIn 0.3s ease; }

.pv-structure-bar { display: flex; flex-wrap: wrap; gap: 4px; }

.pv-structure-chip {
  padding: 3px 10px;
  background: var(--pv-bg);
  border-radius: 12px;
  font-size: 11px;
  color: var(--pv-text-muted);
}

/* 角色 */
.pv-char-grid { display: flex; flex-wrap: wrap; gap: 12px; }

.pv-char-card { width: 80px; text-align: center; position: relative; }

.pv-char-card img {
  width: 64px; height: 64px;
  border-radius: 12px; object-fit: cover;
  border: 2px solid var(--pv-border);
}
.pv-char-card span { display: block; font-size: 11px; margin-top: 4px; color: var(--pv-text-muted); }
.pv-char-card .pv-btn--icon {
  position: absolute; top: -6px; right: -6px;
  background: var(--pv-bg-card); box-shadow: var(--pv-shadow);
}

.pv-char-placeholder {
  width: 64px; height: 64px;
  border-radius: 12px; border: 2px dashed var(--pv-border);
  background: var(--pv-bg); margin: 0 auto;
}

.pv-char-add {
  width: 64px; height: 64px;
  border-radius: 12px; border: 2px dashed var(--pv-border);
  background: transparent; font-size: 24px;
  color: var(--pv-text-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--pv-transition);
}
.pv-char-add:hover { border-color: var(--pv-primary-light); color: var(--pv-primary); }

/* ==================== 拆分进度 ==================== */
.pv-fill-status { padding: 8px 0; font-size: 13px; color: var(--pv-text-muted); }

/* ==================== 步骤 2：双栏编辑器 ==================== */
.pv-config-bar {
  padding: 12px 0;
  border-bottom: 1px solid var(--pv-border);
  margin-bottom: 16px;
}

.pv-editor-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  min-height: 400px;
}

/* 左侧缩略图列表 */
.pv-slide-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  padding-right: 4px;
}

/* 自定义滚动条 */
.pv-slide-list::-webkit-scrollbar,
.pv-textarea::-webkit-scrollbar { width: 6px; height: 6px; }
.pv-slide-list::-webkit-scrollbar-track,
.pv-textarea::-webkit-scrollbar-track { background: transparent; }
.pv-slide-list::-webkit-scrollbar-thumb,
.pv-textarea::-webkit-scrollbar-thumb { background: var(--pv-border); border-radius: 3px; }

.pv-slide-thumb {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border: 2px solid var(--pv-border);
  border-radius: var(--pv-radius);
  cursor: pointer;
  transition: var(--pv-transition);
  background: var(--pv-bg-card);
}
.pv-slide-thumb:hover { border-color: var(--pv-primary-light); }
.pv-slide-thumb.active {
  border-color: var(--pv-primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
}

.pv-slide-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--pv-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  color: var(--pv-text-muted); flex-shrink: 0;
}
.pv-slide-thumb.active .pv-slide-num { background: var(--pv-primary); color: #fff; }

.pv-slide-type-tag {
  font-size: 10px; padding: 1px 8px; border-radius: 10px;
  background: var(--pv-bg); color: var(--pv-text-muted); white-space: nowrap;
}

.pv-thumb-img { width: 40px; height: 28px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.pv-thumb-img img { width: 100%; height: 100%; object-fit: cover; }
.pv-thumb-img img.confirmed { box-shadow: 0 0 0 2px var(--pv-success); }

.pv-thumb-placeholder {
  width: 40px; height: 28px; border-radius: 4px;
  background: var(--pv-bg); flex-shrink: 0;
}

.pv-thumb-badge {
  font-size: 10px; width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: auto;
}
.pv-thumb-badge--ok { background: var(--pv-success); color: #fff; }
.pv-thumb-badge--warn { background: var(--pv-warning); color: #fff; }

.pv-thumb-title {
  font-size: 11px; color: var(--pv-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px;
}

.pv-slide-add {
  padding: 8px; border: 2px dashed var(--pv-border);
  border-radius: var(--pv-radius); background: transparent;
  font-size: 13px; color: var(--pv-text-sm); cursor: pointer;
  transition: var(--pv-transition);
}
.pv-slide-add:hover { border-color: var(--pv-primary-light); color: var(--pv-primary); }

/* 右侧编辑区 */
.pv-slide-editor {
  background: var(--pv-bg-card);
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius-lg);
  padding: 20px;
}

.pv-slide-editor label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--pv-text-muted); margin-bottom: 4px; margin-top: 14px;
}
.pv-slide-editor label:first-child { margin-top: 0; }

.pv-edit-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.pv-edit-row label { margin-top: 0; }

.pv-edit-preview { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--pv-border); }

.pv-preview-img-box {
  width: 100%; max-height: 400px; border-radius: var(--pv-radius);
  overflow: hidden; margin-bottom: 10px; background: var(--pv-bg);
  cursor: pointer;
}
.pv-preview-img-box img { max-width: 100%; max-height: 400px; object-fit: contain; display: block; margin: 0 auto; }

.pv-preview-empty {
  padding: 40px; text-align: center; color: var(--pv-text-sm);
  background: var(--pv-bg); border-radius: var(--pv-radius); margin-bottom: 10px;
}

.pv-preview-actions { display: flex; gap: 8px; }

.pv-edit-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--pv-border); }

/* ==================== 步骤 3：配置 + 渲染 ==================== */
.pv-plan-summary {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 12px 16px;
  background: var(--pv-bg); border-radius: var(--pv-radius);
  margin-bottom: 20px; font-size: 13px;
}

.pv-render-config { display: flex; flex-direction: column; gap: 16px; }

.pv-config-card {
  background: var(--pv-bg-card);
  border: 1px solid var(--pv-border);
  border-radius: var(--pv-radius-lg);
  padding: 20px;
}
.pv-config-card h3 { margin: 0 0 14px; font-size: 15px; color: var(--pv-text); }

.pv-config-grid { display: grid; gap: 20px; }
.pv-config-grid--3col { grid-template-columns: repeat(3, 1fr); }
.pv-config-grid--2col { grid-template-columns: repeat(2, 1fr); }

/* ==================== 渲染进度 ==================== */
.pv-render-progress,
.pv-render-done,
.pv-render-error { padding: 32px; text-align: center; }

.pv-progress-wrap { margin: 16px 0; }

.pv-progress-bar {
  width: 100%; height: 8px;
  background: var(--pv-bg); border-radius: 4px;
  overflow: hidden; margin-bottom: 8px;
}

.pv-progress-fill,
.pv-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pv-primary), var(--pv-primary-light));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.pv-progress-meta,
.pv-progress-info {
  display: flex; justify-content: center; gap: 20px;
  font-size: 13px; color: var(--pv-text-muted); margin-bottom: 8px;
}

.pv-status-tag {
  display: inline-block; padding: 3px 10px;
  border-radius: 12px; font-size: 12px; font-weight: 500;
}
.pv-status-tag--running   { background: rgba(99,102,241,0.1); color: var(--pv-primary); }
.pv-status-tag--done      { background: rgba(16,185,129,0.1); color: var(--pv-success); }
.pv-status-tag--error     { background: rgba(239,68,68,0.1); color: var(--pv-error); }
.pv-status-tag--cancelled { background: rgba(100,116,139,0.1); color: var(--pv-text-muted); }

.pv-video-player {
  width: 100%; max-width: 480px;
  border-radius: var(--pv-radius);
  box-shadow: var(--pv-shadow-md);
}

.pv-output-info {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 16px;
  margin: 12px 0; font-size: 13px; color: var(--pv-text-muted);
}
.pv-output-info code { font-size: 11px; background: var(--pv-bg); padding: 2px 6px; border-radius: 4px; }

/* ==================== QA 结果 ==================== */
.pv-qa-result { margin-top: 16px; text-align: left; }
.pv-qa-item { padding: 8px 12px; border-radius: 6px; margin-bottom: 6px; font-size: 13px; }
.pv-qa--pass  { background: rgba(16,185,129,0.08); color: #065f46; }
.pv-qa--warn  { background: rgba(245,158,11,0.08); color: #92400e; }
.pv-qa--fail  { background: rgba(239,68,68,0.08); color: #991b1b; }

/* ==================== Toast ==================== */
.pv-toast {
  position: fixed; left: 50%; bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: var(--pv-radius);
  background: rgba(15,23,42,0.92);
  color: #fff;
  font-size: 14px; line-height: 1.5;
  box-shadow: var(--pv-shadow-md);
  z-index: var(--pv-z-toast);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: 80vw; text-align: center;
}

.pv-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pv-toast--success { background: rgba(16,185,129,0.95); }
.pv-toast--warning { background: rgba(245,158,11,0.95); }
.pv-toast--error   { background: rgba(239,68,68,0.95); }
.pv-toast--info    { background: rgba(99,102,241,0.95); }

/* ==================== 提示块 ==================== */
.pv-alert {
  padding: 10px 14px;
  border-radius: var(--pv-radius);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.pv-warning, .pv-alert--warning {
  padding: 10px 14px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--pv-radius);
  color: #b45309;
  font-size: 13px;
  margin-bottom: 12px;
}

.pv-alert--error {
  padding: 10px 14px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--pv-radius);
  color: #b91c1c;
  font-size: 13px;
  margin-bottom: 12px;
}

.pv-alert--info {
  padding: 10px 14px;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--pv-radius);
  color: var(--pv-primary-dark);
  font-size: 13px;
  margin-bottom: 12px;
}

.pv-text-error { color: var(--pv-error); font-size: 14px; }
.pv-text-warn  { color: var(--pv-warning); }
.pv-text-muted { color: var(--pv-text-muted); }
.pv-text-sm    { font-size: 12px; }

/* ==================== 粘性底栏 ==================== */
.pv-sticky-bar {
  position: sticky; bottom: 0;
  z-index: var(--pv-z-sticky);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: var(--pv-bg-card);
  border-top: 1px solid var(--pv-border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  margin-top: 20px;
  border-radius: 0 0 var(--pv-radius-lg) var(--pv-radius-lg);
}

.pv-stats { flex: 1; font-size: 13px; color: var(--pv-text-muted); }
.pv-stats strong { color: var(--pv-text); }

/* ==================== 通用操作栏 ==================== */
.pv-actions { display: flex; align-items: center; gap: 12px; padding: 16px 0; }
.pv-flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ==================== Lightbox 翻页 ==================== */
.pv-lightbox {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center;
}
.pv-lightbox__close {
  position: absolute; top: 16px; right: 24px;
  z-index: 10; background: rgba(255,255,255,0.15);
  color: #fff; border: none; font-size: 32px;
  width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.pv-lightbox__close:hover { background: rgba(255,255,255,0.3); }

.pv-lightbox__arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10; background: rgba(255,255,255,0.12);
  color: #fff; border: none; font-size: 48px;
  width: 52px; height: 80px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; border-radius: 4px;
}
.pv-lightbox__arrow:hover { background: rgba(255,255,255,0.25); }
.pv-lightbox__arrow.is-disabled { opacity: 0.25; pointer-events: none; }
.pv-lightbox__arrow--prev { left: 8px; }
.pv-lightbox__arrow--next { right: 8px; }

.pv-lightbox__img-wrap { display: flex; align-items: center; justify-content: center; }
.pv-lightbox__img-wrap img {
  max-width: 90vw; max-height: 85vh;
  width: auto; height: auto;
  object-fit: contain; border-radius: 6px;
}
.pv-lightbox__loading, .pv-lightbox__error {
  position: absolute; color: #aaa; font-size: 14px;
}
.pv-lightbox__error { color: #f66; }

.pv-lightbox__pagination {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.5); color: #ddd; font-size: 13px;
  padding: 4px 14px; border-radius: 12px;
}

/* ==================== 编辑区左右布局 ==================== */
.pv-edit-preview-row {
  display: flex; gap: 16px; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--pv-border);
}
.pv-edit-preview-col {
  flex: 0 0 52%; min-width: 0;
  display: flex; flex-direction: column;
}
.pv-edit-preview-col .pv-preview-img-box {
  max-height: 360px; flex-shrink: 0;
}
.pv-edit-preview-col .pv-preview-img-box img { max-height: 360px; }
.pv-edit-preview-col .pv-preview-empty {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 200px;
}
.pv-edit-preview-col .pv-preview-actions { justify-content: center; margin-top: 8px; }

.pv-edit-prompt-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.pv-edit-prompt-col label { margin-bottom: 4px; font-size: 13px; color: var(--pv-text-sm); }
.pv-edit-prompt-col textarea {
  flex: 1; min-height: 200px; resize: vertical;
}

@media (max-width: 900px) {
  .pv-edit-preview-row { flex-direction: column; }
  .pv-edit-preview-col { flex: none; }
  .pv-edit-preview-col .pv-preview-empty { min-height: 120px; }
  .pv-edit-prompt-col textarea { min-height: 120px; }
}

/* ==================== 全局错误边界 ==================== */
.pv-error-boundary {
  position: fixed; inset: 0;
  background: var(--pv-bg-card);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: var(--pv-z-error);
  text-align: center; padding: 20px;
}
.pv-error-boundary[hidden] { display: none; }
.pv-error-boundary h3 { font-size: 18px; color: var(--pv-text); margin: 0 0 8px; }
.pv-error-boundary p { color: var(--pv-text-muted); margin: 0 0 16px; }
.pv-error-boundary a { color: var(--pv-primary); }

/* ==================== 骨架屏 ==================== */
.pv-skeleton {
  background: linear-gradient(90deg, var(--pv-bg) 25%, #eef2f7 50%, var(--pv-bg) 75%);
  background-size: 200% 100%;
  animation: pvSkeleton 1.5s infinite linear;
  border-radius: var(--pv-radius);
}

@keyframes pvSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.pv-skeleton-card { height: 120px; border-radius: var(--pv-radius-lg); }
.pv-skeleton-line { height: 14px; margin-bottom: 8px; }

/* ==================== 空状态 ==================== */
.pv-empty {
  padding: 48px 20px; text-align: center; color: var(--pv-text-sm);
}
.pv-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.pv-empty h4 { margin: 0 0 6px; font-size: 15px; color: var(--pv-text-muted); }
.pv-empty p { margin: 0; font-size: 13px; }

/* ==================== 响应式 ==================== */
@media (max-width: 900px) {
  .pv-editor-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pv-slide-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding-bottom: 8px;
  }

  .pv-slide-thumb {
    flex-shrink: 0;
    width: 120px;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .pv-workbench { padding: 16px 12px 60px; }

  .pv-card-grid { grid-template-columns: 1fr; }

  .pv-steps { flex-direction: column; }

  .pv-step:not(:last-child)::after {
    right: auto; bottom: 0; left: 10%; top: auto;
    width: 80%; height: 1px;
  }

  .pv-config-grid--3col,
  .pv-config-grid--2col { grid-template-columns: 1fr; }

  .pv-sticky-bar { flex-wrap: wrap; }
  .pv-stats { flex-basis: 100%; order: -1; }
}
