/* =========================================================
   即梦 AI 漫剧生成平台 · 深色主题全局样式
   主色：黑 #0A0A0B  白 #FFFFFF  品牌紫 #7C5CFF
   ========================================================= */

/* ---------- 1. CSS 变量（设计令牌） ---------- */
:root {
  /* 背景层级 */
  --bg-base: #0A0A0B;
  --bg-surface: #141418;
  --bg-surface-2: #1C1C22;
  --bg-elevated: #22222A;

  /* 文字 */
  --text-primary: #FFFFFF;
  --text-secondary: #8E8E96;
  --text-tertiary: #5A5A63;

  /* 边框 / 分割线 */
  --border-default: #26262D;
  --border-hover: #3A3A45;

  /* 品牌色 - 霓虹紫 */
  --accent: #7C5CFF;
  --accent-hover: #8B6FFF;
  --accent-active: #6B4AFF;
  --accent-soft: rgba(124, 92, 255, 0.12);
  --accent-strong: #6B4AFF;
  --accent-glow: rgba(124, 92, 255, 0.35);

  /* 语义色（克制使用） */
  --success: #34D399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --warning: #FBBF24;
  --danger: #FF6B81;

  /* 阴影与辉光 */
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-dropdown: 0 8px 24px rgba(0, 0, 0, 0.55);
  --glow-accent: 0 0 18px var(--accent-glow);
  --glow-accent-strong: 0 0 28px var(--accent-glow);

  /* 圆角 */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* 间距（8px 基准） */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* 字号 */
  --font-xs: 12px;
  --font-sm: 13px;
  --font-base: 14px;
  --font-lg: 16px;
  --font-xl: 20px;
  --font-2xl: 24px;
  --font-3xl: 32px;

  /* 最小宽度 */
  --min-page-width: 1180px;
}

/* ---------- 2. 基础重置与全局布局 ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: var(--font-base);
  line-height: 1.55;
  min-width: var(--min-page-width);
  width: 100%;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--text-primary);
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: var(--font-base);
}

/* 数字等宽对齐 */
.num {
  font-variant-numeric: tabular-nums;
}

/* ---------- 3. 顶部导航栏（全局，固定吸附，不随滚动） ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
  min-width: var(--min-page-width);
  width: 100%;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-8);
  min-width: var(--min-page-width);
  width: 100%;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-logo {
  font-size: var(--font-lg);
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: var(--glow-accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav-user {
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.nav-link {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* 导航栏 Logo 旁的“员工操作台”标签 */
.nav-tag {
  margin-left: 8px;
}

/* ---------- 4. 页面容器（注意顶部预留 navbar 固定高度） ---------- */
.page {
  min-width: var(--min-page-width);
  width: 100%;
  padding: calc(var(--space-8) + 72px) var(--space-8) var(--space-8);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-5);
  flex-wrap: wrap;
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.page-title {
  font-size: var(--font-2xl);
  font-weight: 600;
  color: var(--text-primary);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-sm);
  margin-top: 4px;
}

/* 面包屑 / 返回 */
.back-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.back-link:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* 标题前的圆角正方形返回按钮（与文字等高） */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.back-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.25);
}

.project-title {
  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--text-primary);
}

.project-meta {
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

/* 标题旁的风格标签（如 16:9 · 480p） */
.title-tag {
  margin-left: 8px;
}

/* 副文案（标题下的元信息） */
.project-meta-sub {
  margin-top: 4px;
}

/* 标题后的紧凑统计信息（与标题同一行显示：章节 · 时长 · 已完成/总分镜组） */
.title-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: var(--space-5);
  padding-left: var(--space-5);
  border-left: 1px solid var(--border-default);
  font-size: var(--font-sm);
}

.title-stats .stat-item {
  display: inline-flex;
  align-items: baseline;
}

.title-stats .stat-label {
  color: var(--text-secondary);
}

.title-stats .stat-num {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
  margin-right: 2px;
}

.title-stats .stat-slash {
  color: var(--text-tertiary);
  padding: 0 2px;
}

.title-stats .stat-sep {
  color: var(--border-default);
  font-size: 12px;
}

/* ---------- 5. 按钮体系 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-weight: 500;
  line-height: 1;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--glow-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--glow-accent-strong);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--accent-active);
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-ghost:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.btn-sm {
  padding: 8px 14px;
  font-size: var(--font-xs);
}

/* ---------- 6. 标签 / 状态胶囊 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--font-xs);
  font-weight: 500;
  line-height: 1.6;
}

.tag-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-success {
  background: var(--success-bg);
  color: var(--success);
}

.tag-neutral {
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}

.tag-dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}

.tag-accent.tag-dot::before { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.tag-success.tag-dot::before { background: var(--success); }

.tag-processing {
  background: rgba(59, 130, 246, 0.14);
  color: #60A5FA;
}

.tag-processing.tag-dot::before { background: #60A5FA; animation: dotPulse 1.6s ease-in-out infinite; }

.tag-failed {
  background: rgba(255, 107, 129, 0.14);
  color: var(--danger);
}

.tag-failed.tag-dot::before { background: var(--danger); }

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- 7. 数据卡 / 统计卡 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  width: 100%;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-card .stat-label {
  color: var(--text-secondary);
  font-size: var(--font-sm);
  margin-bottom: var(--space-5);
}

.stat-card .stat-values {
  display: flex;
  gap: var(--space-8);
}

.stat-card .stat-value-block {
  display: flex;
  flex-direction: column;
}

.stat-card .stat-number {
  font-size: var(--font-3xl);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-card .stat-number.accent {
  color: var(--accent);
}

.stat-card .stat-unit {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ---------- 8. 章节标题 ---------- */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.section-title h2 {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.section-title .hint {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
}

/* ---------- 9. 项目列表卡片网格 ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-5);
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(124, 92, 255, 0.15);
}

.project-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #1C1C22 0%, #2A2145 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-default);
}

.project-cover .cover-placeholder {
  font-size: var(--font-xl);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 2px;
  opacity: 0.8;
}

.project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.project-name {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.project-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.project-footer {
  margin-top: auto;
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-default);
}

.project-footer .btn {
  flex: 1;
}

/* ---------- 10. 工具栏（分镜页顶部） ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5);
  margin-bottom: var(--space-5);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* 工具栏里的复选框标签（右侧留间距） */
.checkbox-label {
  margin-right: 4px;
}

/* 工具栏副文本（例如“已选 0 组”） */
.toolbar-sub {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
}

.tab-group {
  display: inline-flex;
  gap: var(--space-1);
  background: var(--bg-surface-2);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.tab-group .tab {
  padding: 8px 16px;
  border-radius: 5px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.tab-group .tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.3);
}

/* 章节自定义选择组件（零系统样式，与整体深色主题一致）
 * 结构：
 *   .chapter-select-wrap
 *     ├── .chapter-tab.chapter-tab-all  （「全部」按钮，与 tab-group 风格一致）
 *     └── .chapter-dropdown
 *           ├── .chapter-dropdown-trigger  （触发器，显示当前章节 + 下拉箭头）
 *           └── .chapter-dropdown-menu     （自定义展开面板，1–20 章）
 */
.chapter-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-2);
  padding: 3px;
  border-radius: var(--radius-sm);
}

/* 「全部」按钮：与 tab-group 保持一致，active 态为品牌紫 */
.chapter-tab {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chapter-tab:hover {
  color: var(--text-primary);
}

.chapter-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.3);
}

/* 自定义下拉容器 */
.chapter-dropdown {
  position: relative;
  display: inline-block;
}

/* 触发器按钮：胶囊形按钮样式，三态（默认/悬浮/展开）清晰可辨 */
.chapter-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 16px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  white-space: nowrap;
}

/* 悬浮态：背景略亮，边框变紫色光晕 */
.chapter-dropdown-trigger:hover {
  background: var(--bg-elevated);
  border-color: rgba(124, 92, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
  color: var(--text-primary);
}

/* 展开态：背景品牌紫，白字，箭头同步变白 */
.chapter-dropdown.open .chapter-dropdown-trigger {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.4);
}

/* 下拉箭头：默认向下，展开时 180° 旋转，展开时箭头同步变白 */
.chapter-dropdown-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: transform 0.2s ease, color 0.15s ease;
  line-height: 0;
}

.chapter-dropdown.open .chapter-dropdown-chevron {
  transform: rotate(180deg);
  color: #fff;
}

/* 下拉菜单面板：绝对定位，向下展开，带阴影 + 顶部小箭头 */
.chapter-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.18s ease;
  z-index: 150;
}

/* 顶部指向触发器的小箭头 */
.chapter-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 20px;
  width: 10px;
  height: 10px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  border-top: 1px solid var(--border-default);
  transform: rotate(45deg);
}

.chapter-dropdown.open .chapter-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 单个章节选项 */
.chapter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 5px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  text-align: left;
  line-height: 1.4;
}

.chapter-option:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.chapter-option[aria-selected="true"] {
  background: rgba(124, 92, 255, 0.12);
  color: var(--accent);
  font-weight: 600;
}

/* 选中项右侧显示小圆点，提示当前章节 */
.chapter-option[aria-selected="true"]::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(124, 92, 255, 0.6);
}

/* 下拉面板滚动条美化（替换浏览器默认样式） */
.chapter-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}
.chapter-dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
}
.chapter-dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}
.chapter-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-inline input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-hover);
  border-radius: 4px;
  background: var(--bg-surface-2);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.checkbox-inline input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-inline input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- 11. 分组章节（分镜页） ---------- */
.shot-chapter {
  margin-bottom: var(--space-8);
}

.chapter-header {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-primary);
  padding: var(--space-3) 0;
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.chapter-header .count {
  color: var(--text-secondary);
  font-size: var(--font-sm);
  font-weight: 400;
}

/* ---------- 12. 分镜组卡片 ---------- */
.shot-group {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.shot-group:hover {
  border-color: var(--border-hover);
}

.shot-group.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.2), 0 8px 24px rgba(124, 92, 255, 0.08);
}

.shot-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-default);
}

.shot-group-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.shot-group-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-primary);
}

.shot-group-meta {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

/* ---------- 13. 分镜行（时间分段） ---------- */
.shot-segment {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-default);
}

.shot-segment:last-child {
  border-bottom: none;
}

.shot-time {
  font-size: var(--font-xs);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-4);
  letter-spacing: 0.5px;
}

.shot-assets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.asset-tile {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color 0.2s ease;
}

.asset-tile:hover {
  border-color: var(--accent);
}

.asset-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, #1C1C22, #2A2145);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-image .ph {
  font-size: var(--font-lg);
  color: var(--accent);
  font-weight: 700;
}

.asset-caption {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.asset-caption .name {
  color: var(--text-primary);
  font-weight: 500;
}

/* ---------- 14. 分镜信息表（双列） ---------- */
.shot-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3) var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-base);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}

.shot-meta-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--font-sm);
}

.shot-meta-row .k {
  color: var(--text-tertiary);
  min-width: 56px;
  flex-shrink: 0;
}

.shot-meta-row .v {
  color: var(--text-primary);
}

.shot-dialog {
  padding: 0 var(--space-5) var(--space-2);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.7;
}

.shot-dialog .speaker {
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
  margin-right: 4px;
}

/* ---------- 15. 视频播放器页 ---------- */
.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--space-5);
}

.video-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.video-stage {
  background: #000;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-stage .video-frame,
.video-stage .video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-stage .video-placeholder {
  font-size: var(--font-2xl);
  color: var(--accent);
  opacity: 0.6;
  letter-spacing: 2px;
}

.video-stage .group-tag {
  position: absolute;
  left: var(--space-4);
  bottom: var(--space-4);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: var(--font-xs);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* 播放控制条 */
.player-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  flex-wrap: wrap;
}

.player-controls .status {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: var(--font-xs);
}

/* 时间轴 */
.timeline-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}

.timeline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.timeline-header .t {
  font-size: var(--font-base);
  font-weight: 600;
}

.timeline-header .c {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.timeline-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  min-height: 40px;
}

.timeline-seg {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xs);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.timeline-seg:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.timeline-seg.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--glow-accent);
}

.timeline-seg.secondary {
  background: rgba(124, 92, 255, 0.08);
  border-color: rgba(124, 92, 255, 0.25);
}

.timeline-legend {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-dot.core { background: var(--accent); }

/* ============================================================
   18. 分镜列表页（分镜组 + 资产卡 + 镜头信息 + 提示词 + 视频区）
   设计语言：近黑背景 + 白色文字 + 品牌紫点缀，无其他杂色
   ============================================================ */

/* ---------- 18.1 章节区块标题 ---------- */
.chapter-block {
  margin-bottom: var(--space-10);
}

.chapter-block-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.chapter-block-title .t {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-base);
}

/* ---------- 18.2 镜头组整体 ---------- */
.shot-group {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  transition: border-color 0.18s ease;
}

/* 选中状态（被勾选时的高亮 */
.shot-group.selected {
  border-color: var(--accent);
}

/* 镜头组头部 */
.shot-group-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
}

.shot-group-header-left {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.shot-group-title {
  font-size: var(--font-base);
  color: var(--text-primary);
  font-weight: 600;
}

.shot-group-header-right {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------- 18.3 单个镜头面板 ---------- */
.shot-panel {
  border-bottom: 1px solid var(--border-default);
}

.shot-panel:last-child {
  border-bottom: none;
}

/* 镜头头部（镜号标题 + 编辑按钮） */
.shot-panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
}

.shot-panel-title {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  font-weight: 600;
}

.shot-panel-actions {
  margin-left: auto;
}

/* 编辑按钮（纯文字） */
.edit-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--font-xs);
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.edit-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* 镜头布局容器：三列 — 左侧资产区 | 中间首尾帧 | 右侧信息区 */
.shot-layout {
  display: grid;
  grid-template-columns: 1fr 112px 1fr;
  gap: var(--space-6);
  padding: var(--space-5);
}

/* ---------- 18.4 资产区 ---------- */
.assets-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.assets-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.assets-row-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

/* 资产行标题栏：标签 + 添加按钮 */
.assets-row-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.asset-add-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  padding: 0;
  box-shadow: 0 0 0 0 rgba(124, 92, 255, 0);
}

.asset-add-btn svg {
  width: 10px;
  height: 10px;
  display: block;
  flex-shrink: 0;
}

.asset-add-btn:hover {
  background: var(--accent-strong);
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(124, 92, 255, 0.4);
}

.assets-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* 单个资产卡（正方形，宽90px） */
.asset-card {
  width: 92px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

.asset-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-base);
  overflow: hidden;
  position: relative;
}

.asset-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 无图片时的虚线占位框（静态展示，不可上传） */
.asset-card-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-base);
  border: 1px dashed var(--border-default);
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 10px;
}

/* 资产名称 */
.asset-card-name {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-primary);
  line-height: 1.3;
  text-align: center;
}

/* 资产卡删除按钮（有图片时 hover 显示） */
.asset-delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  border: none;
  font-family: inherit;
  z-index: 5;
}

.asset-card-img:hover .asset-delete-btn {
  opacity: 1;
}

.asset-delete-btn:hover {
  background: var(--danger);
  color: #fff;
}

/* 隐藏文件上传控件 */
.upload-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 角色有音频时：图片顶部叠加长条形播放按钮 */
.asset-audio-btn {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  height: 20px;
  border-radius: 10px;
  background: rgba(10, 10, 11, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  font-size: 10px;
  font-family: inherit;
  padding: 0 8px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.asset-audio-btn:hover {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(124, 92, 255, 0.45);
}

.asset-audio-btn svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* ---------- 18.5 首尾帧图片列（独立列） ---------- */
.frames-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 var(--space-2);
}

.frames-section-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

.frame-assets {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.frame-card {
  width: 92px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.frame-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-base);
  overflow: hidden;
  position: relative;
}

.frame-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 无图片时的占位图（可点击上传） */
.frame-card-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-base);
  border: 1px dashed var(--border-default);
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.frame-card-placeholder:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.frame-card-label {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  height: 16px;
  border-radius: 8px;
  background: rgba(10, 10, 11, 0.7);
  color: var(--text-primary);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.frame-card-name {
  padding: 5px 8px;
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
}

/* ---------- 18.6 信息区 ---------- */
.info-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.info-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--font-sm);
}

.info-label {
  color: var(--text-secondary);
  min-width: 56px;
  flex-shrink: 0;
}

.info-value {
  color: var(--text-primary);
  flex: 1;
  line-height: 1.5;
}

/* 台词用斜体展示 */
.info-dialog {
  color: var(--text-primary);
  flex: 1;
  font-style: italic;
  line-height: 1.5;
}

/* 时长自定义下拉（替换原生 select） */
.duration-dropdown {
  position: relative;
  display: inline-flex;
}

.duration-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 5px 14px 5px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  min-width: 80px;
}

.duration-dropdown-trigger:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-1);
}

.duration-dropdown.open .duration-dropdown-trigger,
.edit-duration-dropdown.open .duration-dropdown-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.duration-dropdown-chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.duration-dropdown.open .duration-dropdown-chevron,
.edit-duration-dropdown.open .duration-dropdown-chevron {
  transform: rotate(180deg);
}

.duration-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 86px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
  z-index: 300;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

/* 菜单滚动条美化 */
.duration-dropdown-menu::-webkit-scrollbar {
  width: 5px;
}

.duration-dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.duration-dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}

.duration-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

.duration-dropdown.open .duration-dropdown-menu,
.edit-duration-dropdown.open .duration-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.duration-option {
  display: block;
  width: 100%;
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--font-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.duration-option:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.duration-option[aria-selected="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* ---------- 18.6 最终拼接提示词区 ---------- */
.final-prompt-section {
  border-top: 1px solid var(--border-default);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.final-prompt-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.final-prompt-title {
  font-size: var(--font-sm);
  color: var(--text-primary);
  font-weight: 600;
}

.final-prompt-box {
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  font-family: inherit;
  font-size: var(--font-sm);
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}

/* 提示词框的滚动条美化 */
.final-prompt-box::-webkit-scrollbar { width: 6px; }
.final-prompt-box::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
.final-prompt-box::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- 18.7 已生成视频区 ---------- */
.video-section {
  border-top: 1px solid var(--border-default);
  padding: var(--space-5);
}

.video-section-title {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  font-weight: 600;
}

.video-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* 单个视频卡片 */
.video-card {
  width: 180px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
  position: relative;
}

.video-card:hover {
  border-color: var(--accent);
}

.video-card-cover {
  aspect-ratio: 16 / 9;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.video-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 视频播放按钮（悬浮时出现） */
.video-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(10, 10, 11, 0.55);
  transition: opacity 0.18s ease;
  color: #fff;
  cursor: pointer;
  border: none;
  width: 100%;
}

.video-card:hover .video-card-play {
  opacity: 1;
}

/* 视频卡片底部信息栏 */
.video-card-footer {
  padding: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.video-card-duration {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

/* 下载视频按钮（淡背景色） */
.video-download-btn {
  margin-left: auto;
  background: var(--bg-surface-2);
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--font-xs);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}

.video-download-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* 已采纳浮动标签（下载后出现在封面右上角） */
.video-adopt-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-size: 10px;
  background: rgba(52, 211, 153, 0.94);
  color: #0A0A0B;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  z-index: 10;
  pointer-events: none;
  animation: badgePopIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePopIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* 视频列表底部生成按钮 */
.video-gen-btn {
  width: 180px;
  min-height: 120px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
  font-size: var(--font-xs);
}

.video-gen-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.legend-dot.trans { background: rgba(124, 92, 255, 0.2); }
.legend-dot.amb { background: var(--bg-surface-2); border: 1px solid var(--border-default); }

/* 详情面板 */
.detail-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: sticky;
  top: calc(64px + var(--space-5));
  height: fit-content;
}

.detail-panel .detail-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-primary);
}

/* 详情面板标题行：左侧标题 + 右侧操作员工标签，垂直居中对齐 */
.detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-4);
}

/* 操作员工标签（右上角圆角矩形，与标题垂直居中） */
.detail-operator-tag {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.detail-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--font-sm);
}

.detail-row .k {
  color: var(--text-tertiary);
  min-width: 60px;
  flex-shrink: 0;
}

.detail-row .v {
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.detail-divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-3) 0;
}

.detail-thumb {
  width: 80px;
  height: 80px;
  margin-top: var(--space-3);
  background: linear-gradient(135deg, #1C1C22, #2A2145);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.detail-thumb .ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  font-size: var(--font-lg);
}

/* 素材缩略图下的标题说明文字 */
.detail-caption {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---------- 16. 响应式断点（仅调整列数，不做移动端降级） ---------- */
/* 宽屏（> 1680px）：分镜页信息列数更宽 */
@media (min-width: 1680px) {
  .stats-grid {
    gap: var(--space-5);
  }
  .stat-card .stat-values {
    gap: var(--space-10);
  }
}

/* 中屏（1280–1680px）：使用默认布局 */

/* 接近最小宽度（1180–1280px）：详情面板收窄，信息密度更高 */
@media (max-width: 1380px) {
  .player-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .page {
    padding: calc(var(--space-6) + 72px) var(--space-6) var(--space-6);
  }
}

@media (max-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .player-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

/* ---------- 17. 导航栏组件（头像 / 下拉菜单 / 修改密码与退出弹窗） ---------- */
.user-menu {
  position: relative;
  display: inline-block;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2A2145, #3d2f7a);
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.user-menu:hover .user-avatar {
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.5);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 150px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.18s ease;
  z-index: 200;
}

/* 三角形小箭头（顶部） */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 14px;
  width: 10px;
  height: 10px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  border-top: 1px solid var(--border-default);
  transform: rotate(45deg);
}

.user-menu:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: var(--font-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

/* 模态弹窗（修改密码 / 退出登录确认） */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: 420px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(124, 92, 255, 0.08);
  overflow: hidden;
  animation: slideUp 0.25s ease;
}

.modal-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  border: none;
  font-family: inherit;
}

.modal-close:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6) var(--space-5);
}

.modal-tip {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 表单项 */
.form-group {
  margin-bottom: var(--space-4);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-sm);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.form-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-sm);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  resize: vertical;
  min-height: 64px;
  line-height: 1.6;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.modal-edit .modal {
  width: 640px;
  max-width: 94vw;
  overflow: visible;
}

.modal-edit .modal-body {
  overflow: visible;
}

/* 编辑弹窗中的时长自定义下拉（与页面内下拉一致但适配弹窗宽度） */
.edit-duration-dropdown {
  position: relative;
  display: block;
  width: 100%;
  z-index: 10;
}

.edit-duration-dropdown .duration-dropdown-trigger {
  width: 100%;
  justify-content: space-between;
  padding: 10px 14px;
  min-width: 0;
}

.edit-duration-dropdown .duration-dropdown-menu {
  width: 100%;
  min-width: 0;
  z-index: 520;
}

.edit-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.edit-form-grid .form-group-full {
  grid-column: 1 / -1;
}

/* 隐藏按钮（替代 inline style） */
.btn-hidden {
  display: none;
}

/* 批量弹窗宽度 */
.modal-batch .modal {
  width: 480px;
  max-width: 94vw;
}

.modal-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-default);
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

/* 弹窗动画 */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ---------- 图片灯箱 ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 600;
  cursor: pointer;
}

.lightbox-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  cursor: default;
  animation: lightboxZoom 0.25s ease;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background 0.15s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

@keyframes lightboxZoom {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* 可预览图片 hover 时显示放大光标 */
.asset-card-img img,
.frame-card-img img {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.asset-card-img:hover img,
.frame-card-img:hover img {
  transform: scale(1.05);
}

/* ---------- 生成进度弹窗（锁定遮罩，不可点击关闭） ---------- */
.modal-overlay.modal-locked {
  cursor: default;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.progress-modal {
  text-align: center;
}

.progress-modal .modal {
  width: 400px;
}

.progress-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.progress-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60A5FA;
  animation: dotPulse 1.6s ease-in-out infinite;
}

.progress-status-text {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* 进度条轨道 */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-base);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #A78BFA);
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.active {
  animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(124, 92, 255, 0.3); }
  50% { box-shadow: 0 0 14px rgba(124, 92, 255, 0.6); }
}

/* 进度提示文字 */
.progress-hint {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

/* 批量生成列表 */
.batch-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 340px;
  overflow-y: auto;
}

.batch-item {
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
}

.batch-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.batch-item-name {
  font-size: var(--font-sm);
  color: var(--text-primary);
  font-weight: 500;
}

.batch-item-status {
  font-size: var(--font-xs);
  display: flex;
  align-items: center;
  gap: 4px;
}

.batch-item-status.processing { color: #60A5FA; }
.batch-item-status.queued    { color: var(--text-tertiary); }
.batch-item-status.success   { color: var(--success); }
.batch-item-status.failed    { color: var(--danger); }

.batch-item-status.processing .batch-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #60A5FA;
  animation: dotPulse 1.6s ease-in-out infinite;
}

.batch-progress-track {
  width: 100%;
  height: 4px;
  background: var(--bg-surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.batch-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #A78BFA);
  border-radius: 2px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 素材选择弹窗 ---------- */
.material-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 550;
}

.material-picker-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.material-picker {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 94vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  animation: slideUp 0.25s ease;
}

.material-picker-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.material-picker-title {
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-primary);
}

.material-picker-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  border: none;
  font-family: inherit;
}

.material-picker-close:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.material-picker-body {
  padding: var(--space-5);
  overflow-y: auto;
  flex: 1;
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.material-item {
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.material-item:hover {
  border-color: var(--border-hover);
}

.material-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.material-item-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-surface-2);
  overflow: hidden;
}

.material-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.material-item-name {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-primary);
  text-align: center;
}

.material-item-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.material-item.selected .material-item-check {
  display: flex;
}

.material-picker-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-default);
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}
