/* ===== 结果查看器（全屏沉浸式，双画面对比）===== */
.tv-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(10, 6, 26, .97); display: none; flex-direction: column; }
.tv-overlay.show { display: flex; }
body.tv-open { overflow: hidden; }

.tv-shell { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 12px 18px 10px; gap: 10px; }

.tv-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(255,255,255,.08); color: #F5F3FF; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 8px 14px; min-height: 40px; font-size: 13.5px; cursor: pointer; text-decoration: none; font-family: inherit; transition: background .15s ease; }
.tv-btn:hover { background: rgba(255,255,255,.16); }
.tv-btn.active { background: rgba(255,255,255,.18); color: #FFFFFF; border-color: rgba(255,255,255,.35); font-weight: 700; }
.tv-btn[disabled] { opacity: .55; cursor: default; }
.tv-btn[disabled]:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); }

/* 顶部按钮行：原视频 | 生成视频 | 详细信息 | 下载 | 关闭（紧凑高度） */
.tv-seg { display: flex; gap: 6px; }
.tv-seg > * { flex: 1; }
.tv-seg-btn { padding: 5px 6px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); background: transparent; color: #C9BFE8; min-height: 34px; cursor: pointer; font-size: 14px; font-family: inherit; }
.tv-seg-btn.active { background: rgba(255,255,255,.18); color: #FFFFFF; font-weight: 700; border-color: rgba(255,255,255,.35); }
.tv-btn.tv-top-btn { min-height: 34px; padding: 5px 6px; }
/* 顶栏图标（统一风格：线性、同尺寸、跟随文字颜色） */
.tv-ic { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.tv-main { flex: 1; display: flex; gap: 10px; min-height: 0; }
.tv-pane { flex: 1; position: relative; display: flex; flex-direction: column; min-width: 0; background: #150E2B; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 10px; }
.tv-video { width: 100%; flex: 1; min-height: 0; object-fit: contain; background: #0F0B1E; border-radius: 10px; }

/* 自绘视频控制条（替代原生 controls，点击播放后中央无浏览器图标反馈） */
.tv-vwrap { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #0F0B1E; border-radius: 10px; overflow: hidden; }
.tv-vwrap .tv-video { height: 100%; background: transparent; border-radius: 0; }
.tv-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; background: rgba(10,6,26,.55); border: 1px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; transition: opacity .2s ease; padding: 0; }
.tv-center.hidden { opacity: 0; pointer-events: none; }
.tv-center svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }
.tv-ctrl { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 3; display: flex; align-items: center; gap: 8px; background: rgba(10,6,26,.62); border-radius: 8px; padding: 6px 10px; transition: opacity .25s ease; }
.tv-ctrl.tv-hidden { opacity: 0; pointer-events: none; }
.tv-pp, .tv-fs { background: none; border: none; color: #fff; cursor: pointer; width: 34px; height: 30px; display: flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.tv-pp svg, .tv-fs svg { width: 18px; height: 18px; fill: #fff; }
.tv-sync-mini { background: none; border: none; color: #C9BFE8; cursor: pointer; font-size: 12px; padding: 0; flex: none; font-family: inherit; white-space: nowrap; }
.tv-sync-mini.active { color: #fff; font-weight: 700; }
.tv-bar { flex: 1; height: 6px; background: rgba(255,255,255,.25); border-radius: 999px; cursor: pointer; position: relative; touch-action: none; }
.tv-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--color-accent, #EC4899); border-radius: 999px; }
.tv-time { color: #fff; font-size: 11.5px; font-variant-numeric: tabular-nums; flex: none; }
.tv-pane-foot { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; margin-top: 8px; }
.tv-fail { color: #FF8A8A; font-size: 13px; text-align: center; line-height: 1.5; }

.tv-bottom { display: flex; align-items: center; gap: 8px; }
.tv-bottom .tv-strip { min-width: 120px; }
.tv-nav { flex: none; background: rgba(255,255,255,.08); color: #F5F3FF; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; font-family: inherit; font-size: 13.5px; }
.tv-nav:hover { background: rgba(255,255,255,.16); }

/* 手机端滑动切换的过渡动画 */
.tv-main.tv-slide .tv-pane { animation: tvSlideIn .25s ease; }
@keyframes tvSlideIn { from { opacity: .25; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.tv-nav[disabled] { opacity: .35; cursor: not-allowed; }
.tv-strip { flex: 1; display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tv-strip-item { flex: none; width: 58px; height: 74px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #241C3F; display: flex; align-items: center; justify-content: center; }
.tv-strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tv-strip-item.sel { border-color: var(--color-accent, #EC4899); }
.tv-thumb-ph { color: #8F82B8; font-size: 11px; text-align: center; padding: 2px; }
.tv-strip-loading { color: #8F82B8; font-size: 13px; padding: 8px; }

/* 详细信息抽屉 */
.tv-details { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: #1A1430; color: #F5F3FF; z-index: 160; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,.5); }
.tv-details.show { transform: translateX(0); }
.tv-details-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.tv-details-body { overflow-y: auto; padding: 14px 16px 30px; font-size: 13.5px; -webkit-overflow-scrolling: touch; }
.tv-kv { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 12.5px; align-items: baseline; }
.tv-kv b { flex: none; width: 16px; color: var(--color-accent, #EC4899); }
.tv-kv .dim { color: #C9BFE8; }
.tv-art { margin-top: 10px; }
.tv-art img, .tv-art video { width: 100%; border-radius: 8px; margin-top: 6px; background: #0F0B1E; }
.tv-art a { color: var(--color-accent, #EC4899); font-size: 12.5px; }

/* 手势说明引导层（首次进入 + 顶栏 ? 随时重看） */
.tv-gesture { position: fixed; inset: 0; z-index: 170; background: rgba(10,6,26,.85); display: none; align-items: center; justify-content: center; padding: 20px; }
.tv-gesture.show { display: flex; }
.tv-gesture-card { background: #1A1430; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 22px 20px; max-width: 400px; width: 100%; color: #F5F3FF; }
.tv-gesture-title { font-size: 17px; font-weight: 700; text-align: center; margin-bottom: 16px; }
.tv-gesture-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.tv-gesture-anim { flex: none; width: 64px; height: 84px; border-radius: 10px; background: #150E2B; border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.tv-gesture-text { font-size: 13.5px; color: #C9BFE8; line-height: 1.55; }
.tv-gesture-text b { color: #F5F3FF; display: block; margin-bottom: 2px; font-size: 14px; }
.tv-gesture-ok { width: 100%; margin-top: 6px; background: var(--color-accent, #EC4899); color: #000; border-color: transparent; }
.tv-gesture-ok:hover { filter: brightness(1.08); }
/* 手指圆点动画 */
.g-dot { width: 22px; height: 22px; border-radius: 50%; background: #EC4899; box-shadow: 0 0 0 6px rgba(236,72,153,.22); display: block; }
.g-ud { animation: gUD 1.6s ease-in-out infinite; }
.g-lr { animation: gLR 1.6s ease-in-out infinite; }
.g-tap { animation: gTap 1.4s ease-in-out infinite; }
@keyframes gUD { 0%,100% { transform: translateY(-9px); } 50% { transform: translateY(9px); } }
@keyframes gLR { 0%,100% { transform: translateX(-9px); } 50% { transform: translateX(9px); } }
@keyframes gTap { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.72); opacity: .55; } }

/* 桌面端：双画面并排，顶部原视频/生成视频按钮高亮对应画面 */
@media (min-width: 769px) {
  .tv-main[data-tab="source"] .tv-pane[data-pane="source"],
  .tv-main[data-tab="final"] .tv-pane[data-pane="final"] { border-color: rgba(255,255,255,.4); }
}
/* 移动端：单画面显示，由顶部按钮切换；画面贴边最大化，pane 底栏/同步隐藏 */
@media (max-width: 768px) {
  .tv-shell { padding: 3px 3px 1px; gap: 1px; }
  .tv-seg { display: flex; gap: 4px; }
  .tv-seg-btn { font-size: 13px; padding: 4px 2px; min-height: 30px; }
  .tv-btn.tv-top-btn { font-size: 11.5px; padding: 3px 2px; min-height: 28px; }
  .tv-ic { width: 12px; height: 12px; }
  .tv-main { gap: 0; touch-action: none; }
  .tv-pane { padding: 0; border: none; border-radius: 0; }
  .tv-vwrap { border-radius: 0; }
  .tv-video { border-radius: 0; }
  .tv-ctrl { left: 6px; right: 6px; bottom: 6px; }
  .tv-main[data-tab="source"] .tv-pane[data-pane="final"] { display: none; }
  .tv-main[data-tab="final"] .tv-pane[data-pane="source"] { display: none; }
  .tv-pane-foot { display: none; }
  .tv-sync-mini { display: none; }
  .tv-bottom { gap: 3px; }
  .tv-strip { padding: 2px; }
  .tv-nav { padding: 2px 6px; font-size: 12px; min-height: 24px; }
  .tv-strip-item { width: 42px; height: 44px; }
  .tv-details { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .tv-details { transition-duration: .01ms !important; }
  .g-ud, .g-lr, .g-tap { animation: none; }
}
