/* ============================================
   光影AI漫剧 - 全局样式（还原目标站视觉）
   背景 rgb(2,8,23) 深蓝黑 / 青绿渐变主按钮 / 玻璃拟态
   ============================================ */
:root {
  --bg: #020817;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-input: rgba(0, 0, 0, 0.35);
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);
  --text: #f8fafc;
  --text-secondary: rgba(248, 250, 252, 0.6);
  --text-muted: rgba(248, 250, 252, 0.38);
  --primary: #07f4f2;
  --primary-grad: linear-gradient(135deg, #07f4f2, #c1fab8);
  --danger: #f87171;
  --radius: 12px;
  --shadow-primary: 0 4px 16px -4px rgba(7, 244, 242, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { opacity: 0.85; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶部导航（对齐参考源：h-16、tab 圆角块、青绿 active） ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px 0 24px; height: 64px;
  background: rgba(2, 8, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 600; color: var(--text);
  white-space: nowrap; flex-shrink: 0;
}
.nav-logo .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary-grad);
  box-shadow: var(--shadow-primary);
}
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; overflow-x: auto; }
.nav-tab {
  padding: 8px 16px; border-radius: 12px;
  font-size: 14px; color: rgba(255,255,255,0.9);
  transition: all .2s; white-space: nowrap;
}
.nav-tab:hover { background: rgba(255,255,255,0.06); }
.nav-tab.active {
  color: #00f5d4;
  background: rgba(38, 38, 38, 0.5);
  border: none; box-shadow: none;
}
.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-doc {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 8px;
  font-size: 13px; color: #a1a1aa;
  transition: all .2s; white-space: nowrap;
}
.nav-doc:hover { color: #fff; background: rgba(255,255,255,0.06); opacity: 1; }
.nav-balance {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px; color: #a1a1aa; cursor: pointer; transition: all .2s;
  white-space: nowrap;
}
.nav-balance:hover { border-color: rgba(255,255,255,0.2); }
.nav-balance .nb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #07f4f2; animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.nav-balance b { font-size: 14px; font-weight: 600; color: #e4e4e7; font-variant-numeric: tabular-nums; }
.nav-balance i { width: 1px; height: 12px; background: rgba(255,255,255,0.1); margin: 0 2px; }
.nav-balance .nb-recharge { font-size: 12px; font-weight: 500; color: #a1a1aa; transition: color .2s; }
.nav-balance:hover .nb-recharge { color: #07f4f2; }
.nav-user { display: flex; align-items: center; gap: 10px; cursor: pointer; transition: opacity .2s; }
.nav-user:hover { opacity: 0.8; }
.nav-user .nu-name { font-size: 14px; font-weight: 500; color: #e4e4e7; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user .nu-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35); color: #e4e4e7;
  font-weight: 600; font-size: 14px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1); transition: border-color .2s;
  flex-shrink: 0;
}
.nav-user:hover .nu-avatar { border-color: rgba(7,244,242,0.4); }
.nav-user .nu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-logout {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #a1a1aa; transition: all .2s; flex-shrink: 0;
}
.nav-logout:hover { color: #fff; background: #27272a; }
@media (max-width: 640px) {
  .nav-doc, .nav-user .nu-name, .nav-balance i, .nav-balance .nb-recharge { display: none; }
}

/* ---------- 布局 ---------- */
.page {
  max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px;
  width: 100%;
}
.page-head { margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.page-head-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 16px; height: 34px; border-radius: 999px;
  font-size: 13px; font-weight: 500;
  transition: all .2s; white-space: nowrap; user-select: none;
}
.btn-primary {
  background: var(--primary-grad); color: #0a0a0a;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px -4px rgba(7,244,242,0.5); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: rgba(0, 0, 0, 0.6); color: rgba(255,255,255,0.9);
  border: 1px solid var(--border); backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.08); }
.btn-danger { background: rgba(248,113,113,0.12); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 24px; font-size: 14px; }
.btn-block { width: 100%; }
.btn .spinner { border-color: rgba(10,10,10,0.25); border-top-color: #0a0a0a; }
.btn-ghost .spinner { border-color: rgba(255,255,255,0.25); border-top-color: #fff; }

/* ---------- 输入框 ---------- */
.input, .textarea, .select {
  width: 100%; padding: 0 14px; height: 38px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(7,244,242,0.5);
  box-shadow: 0 0 0 3px rgba(7,244,242,0.1);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.select option { background: #0b1120; color: var(--text); }
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.field-tip { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card-hover:hover {
  border-color: rgba(7,244,242,0.3);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.6);
}
.project-card .cover {
  position: relative; aspect-ratio: 9/16; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}
.project-card.ratio-16x9 .cover { aspect-ratio: 16/9; }
.project-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.project-card .cover .ratio-badge {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  font-size: 11px; color: var(--text-secondary);
}
.project-card .body { padding: 14px 16px 16px; }
.project-card .name { font-size: 15px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card .desc {
  font-size: 12px; color: var(--text-muted); height: 38px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: 12px;
}
.project-card .actions { display: flex; gap: 8px; }
.project-card .actions .btn { flex: 1; }
.project-card .cover .cover-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 28px;
}

/* ---------- 网格 ---------- */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(3, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 分段器/标签 ---------- */
.segmented {
  display: inline-flex; padding: 4px; border-radius: 999px;
  background: var(--bg-input); border: 1px solid var(--border); gap: 2px;
}
.segmented .seg-item {
  padding: 5px 16px; border-radius: 999px; font-size: 13px;
  color: var(--text-secondary); transition: all .2s;
}
.segmented .seg-item.active {
  background: var(--primary-grad); color: #0a0a0a; font-weight: 600;
  box-shadow: var(--shadow-primary);
}

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, #0b1220, #080f1e);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 24px; box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  transform: translateY(12px); transition: transform .2s;
}
.modal-mask.show .modal { transform: translateY(0); }
.modal-lg { max-width: 760px; }
.modal-w80 { width: 80vw; max-width: 80vw; height: min(88vh, 900px); display: flex; flex-direction: column; }
.modal-w80 > .modal-head { flex: none; }
.modal-w80 .modal-foot { flex: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-close {
  width: 28px; height: 28px; border-radius: 8px; font-size: 16px;
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 9px 20px; border-radius: 999px; font-size: 13px;
  background: rgba(15, 23, 42, 0.95); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .25s ease;
}
.toast.success { border-color: rgba(7,244,242,0.4); }
.toast.error { border-color: rgba(248,113,113,0.5); }
.toast.info { border-color: rgba(96,165,250,0.4); }
.toast .t-dot { width: 6px; height: 6px; border-radius: 50%; }
.toast.success .t-dot { background: var(--primary); }
.toast.error .t-dot { background: var(--danger); }
.toast.info .t-dot { background: #60a5fa; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all .3s; }

/* ---------- 加载 ---------- */
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; color: var(--text-muted); text-align: center; gap: 8px;
}
.empty .e-icon { font-size: 40px; opacity: 0.5; }
.empty .e-text { font-size: 14px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--border); background: var(--bg-card); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 12px 16px; font-weight: 500;
  color: var(--text-secondary); background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.02); }
.badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; border: 1px solid var(--border);
}
.badge.green { color: #4ade80; background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.3); }
.badge.yellow { color: #facc15; background: rgba(250,204,21,0.1); border-color: rgba(250,204,21,0.3); }
.badge.red { color: #f87171; background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.3); }
.badge.blue { color: #60a5fa; background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.3); }
.badge.gray { color: var(--text-secondary); background: rgba(255,255,255,0.06); }

/* ---------- 项目卡片（参考源样式：16:9 封面 / hover 青绿特效） ---------- */
.proj-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px;
}
@media (max-width: 1280px) { .proj-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1024px) { .proj-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .proj-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .proj-grid { grid-template-columns: 1fr; } }

.proj-card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  overflow: hidden; border-radius: 16px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(113, 113, 122, 0.9);
  transition: all .3s; cursor: pointer;
}
.proj-card:hover {
  background: rgba(39, 39, 42, 0.5); border-color: rgba(7, 244, 242, 0.45);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.6), 0 0 24px -8px rgba(7, 244, 242, 0.15);
  transform: translateY(-3px);
}
.proj-card .pc-cover {
  position: relative; aspect-ratio: 16/9; overflow: hidden; background: rgba(0, 0, 0, 0.4);
}
.proj-card .pc-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease-out;
}
.proj-card:hover .pc-cover img { transform: scale(1.06); }
.proj-card .pc-cover .pc-glow {
  position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: linear-gradient(135deg, rgba(7, 244, 242, 0.1), transparent, rgba(193, 250, 184, 0.1));
}
.proj-card:hover .pc-cover .pc-glow { opacity: 1; }
.proj-card .pc-cover .pc-shade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 50%; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
}
.proj-card .pc-cover .cover-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: rgba(255,255,255,0.3);
}
.ratio-chip {
  position: absolute; bottom: 10px; left: 10px; z-index: 1;
  padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 500;
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.85); border: 1px solid rgba(255, 255, 255, 0.1);
}
.example-chip {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 500;
  background: linear-gradient(135deg, rgba(7, 244, 242, 0.2), rgba(193, 250, 184, 0.15));
  color: #07f4f2; border: 1px solid rgba(7, 244, 242, 0.25);
}
.proj-card .pc-body { display: flex; flex-direction: column; gap: 6px; padding: 14px; flex: 1; }
.proj-card .pc-name {
  font-size: 14px; font-weight: 600; color: #fff; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color .2s;
}
.proj-card:hover .pc-name { color: #07f4f2; }
.proj-card .pc-desc {
  font-size: 12px; color: #71717a; line-height: 1.5; flex: 1;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.dup-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px;
  border-radius: 8px; font-size: 11px; font-weight: 500;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all .2s;
}
.dup-btn:hover { background: rgba(0, 0, 0, 0.8); color: #fff; border-color: rgba(7, 244, 242, 0.3); }
.dup-btn:disabled { opacity: 0.5; pointer-events: none; }
.del-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: all .2s;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.8); border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0; pointer-events: none;
}
.proj-card:hover .del-btn { opacity: 1; pointer-events: auto; }
.del-btn:hover { background: rgba(0, 0, 0, 0.8); color: #fff; border-color: rgba(7, 244, 242, 0.3); }

/* 页面区块标题（参考源样式） */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.section-head .sh-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.section-head .sh-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.proj-section { margin-top: 48px; }
.proj-section:first-child { margin-top: 0; }

/* 项目管理页面容器（参考源：全宽流式） */
.proj-page { width: 100%; padding: 16px 20px 56px; }
@media (min-width: 1024px) { .proj-page { padding: 24px; } }

/* 卡片链接与右上角操作区 */
.pc-link { display: flex; flex-direction: column; flex: 1; height: 100%; }
.pc-corner { position: absolute; top: 10px; right: 10px; z-index: 20; }
.pc-corner .del-btn, .pc-corner .proj-menu { position: static; }
.pc-corner .dropdown { position: absolute; top: 34px; right: 0; }
.proj-menu {
  display: flex; width: 28px; height: 28px; align-items: center; justify-content: center;
  border-radius: 8px; transition: all .2s;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.1);
  opacity: 0; pointer-events: none;
}
.proj-card:hover .proj-menu { opacity: 1; pointer-events: auto; }
.proj-menu:hover { background: rgba(0,0,0,0.8); color: #fff; border-color: rgba(7,244,242,0.3); }
.pc-corner .dup-btn { position: static; }

/* 项目示例区块标题（参考源：图标 + 文本） */
.ex-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.ex-head .ex-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7,244,242,0.15); color: #07f4f2;
}
.ex-head .ex-text { text-align: left; }
.ex-head .ex-title { font-size: 14px; font-weight: 500; line-height: 1.2; }
.ex-head .ex-sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); line-height: 1.2; }

/* 新建项目弹窗：比例选择 */
.ratio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ratio-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-input);
  transition: all .2s; font-size: 12px; color: var(--text-secondary);
}
.ratio-opt:hover { border-color: var(--border-hover); }
.ratio-opt.active {
  border-color: rgba(7, 244, 242, 0.6); color: var(--text);
  box-shadow: 0 0 0 1px rgba(7, 244, 242, 0.4), 0 0 14px rgba(7, 244, 242, 0.12);
}
.ratio-opt .r-box {
  width: 34px; height: 34px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.25);
  position: relative; transition: all .2s;
}
.ratio-opt[data-ratio="9:16"] .r-box { width: 20px; height: 34px; }
.ratio-opt[data-ratio="16:9"] .r-box { width: 34px; height: 20px; }
.ratio-opt[data-ratio="4:3"] .r-box { width: 34px; height: 26px; }
.ratio-opt[data-ratio="3:4"] .r-box { width: 26px; height: 34px; }
.ratio-opt[data-ratio="1:1"] .r-box { width: 30px; height: 30px; }
.ratio-opt[data-ratio="21:9"] .r-box { width: 34px; height: 15px; }
.ratio-opt.active .r-box { border-color: #07f4f2; background: rgba(7,244,242,0.12); }

/* 项目全局分辨率选择 */
.res-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.res-opt {
  flex: 1; min-width: 70px; text-align: center; padding: 10px 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-input);
  transition: all .2s; font-size: 13px; color: var(--text-secondary);
}
.res-opt:hover { border-color: var(--border-hover); }
.res-opt.active {
  border-color: rgba(7, 244, 242, 0.6); color: var(--text); font-weight: 600;
  box-shadow: 0 0 0 1px rgba(7, 244, 242, 0.4), 0 0 14px rgba(7, 244, 242, 0.12);
}

/* 元素创作：角色音色设置（音色库按钮 + 当前音色名） */
.el-timbre-row { display: flex; align-items: center; gap: 10px; }
.el-timbre-name { font-size: 13px; color: var(--text-secondary); }
.el-timbre-name.set { color: #07f4f2; }

/* 风格选择按钮 */
.style-pick {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px; height: 38px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-input);
  font-size: 13px; color: var(--text-secondary); transition: all .2s;
}
.style-pick:hover { border-color: var(--border-hover); color: var(--text); }
.style-pick .sp-arrow { font-size: 10px; opacity: 0.7; }

/* ---------- 下拉菜单（⋮ 操作菜单 / 风格下拉） ---------- */
.dropdown {
  position: absolute; z-index: 300; min-width: 150px;
  background: rgba(18, 18, 18, 0.95); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  padding: 4px; display: none;
}
.dropdown.show { display: block; animation: ddIn .15s ease; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: rgba(255,255,255,0.9); text-align: left;
  transition: background .15s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); }
.dropdown-item svg { width: 14px; height: 14px; opacity: 0.7; flex-shrink: 0; }
.dropdown-item.danger { color: #f87171; }
.dropdown-item.danger:hover { background: rgba(248,113,113,0.12); }
.dropdown .dd-sep { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 8px; }

/* 风格下拉面板（选择预设风格） */
.style-dropdown {
  position: absolute; z-index: 300; left: 0; right: 0; top: calc(100% + 6px);
  background: rgba(18, 18, 18, 0.97); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  padding: 8px; max-height: 260px; overflow-y: auto;
  display: none;
}
.style-dropdown.show { display: block; animation: ddIn .15s ease; }
.style-opt {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: rgba(255,255,255,0.9); text-align: left;
  transition: background .15s;
}
.style-opt:hover { background: rgba(255,255,255,0.06); }
.style-opt .so-thumb {
  width: 30px; height: 30px; border-radius: 8px; overflow: hidden;
  background: rgba(255,255,255,0.06); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.style-opt .so-thumb img { width: 100%; height: 100%; object-fit: cover; }
.style-opt .so-name { font-weight: 500; }
.style-opt .so-prompt { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 项目封面（编辑弹窗） ---------- */
.cover-edit { display: flex; align-items: center; gap: 12px; }
.cover-edit .ce-preview {
  width: 96px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--text-muted); position: relative;
}
.cover-edit .ce-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-edit .ce-actions { display: flex; flex-direction: column; gap: 8px; }
.cover-edit .ce-actions .btn { width: 100%; justify-content: flex-start; height: 32px; padding: 0 12px; font-size: 12px; }
.cover-edit .ce-actions .btn svg { width: 13px; height: 13px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-secondary); font-size: 13px;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.page-btn:hover { color: var(--text); border-color: var(--border-hover); }
.page-btn.active { background: var(--primary-grad); color: #0a0a0a; border-color: transparent; font-weight: 600; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 登录页 ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; position: relative;
  background:
    radial-gradient(800px 400px at 20% -10%, rgba(7,244,242,0.07), transparent 60%),
    radial-gradient(800px 400px at 90% 110%, rgba(193,250,184,0.06), transparent 60%),
    var(--bg);
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.auth-logo .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-grad); box-shadow: var(--shadow-primary); }
.auth-logo .name { font-size: 22px; font-weight: 700; }
.auth-card {
  width: 100%; max-width: 400px; padding: 36px 32px 32px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 20px;
  backdrop-filter: blur(12px);
}
.auth-tabs { display: flex; margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.auth-tab {
  flex: 1; text-align: center; padding: 10px 0; font-size: 15px;
  color: var(--text-muted); position: relative; transition: color .2s;
}
.auth-tab.active { color: var(--text); font-weight: 600; }
.auth-tab.active::after {
  content: ""; position: absolute; left: 30%; right: 30%; bottom: -1px; height: 2px;
  background: var(--primary-grad); border-radius: 2px;
}
.auth-footer { margin-top: 24px; text-align: center; font-size: 12px; color: var(--text-muted); }

/* ---------- 工作台 ---------- */
.workspace-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 24px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 999px;
  overflow-x: auto;
}
.workspace-tabs .wtab {
  padding: 7px 18px; border-radius: 999px; font-size: 13px;
  color: var(--text-secondary); white-space: nowrap; transition: all .2s;
  display: flex; align-items: center; gap: 6px;
}
.workspace-tabs .wtab.active {
  background: var(--primary-grad); color: #0a0a0a; font-weight: 600;
}
.workspace-tabs .wtab .cnt {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: rgba(255,255,255,0.15); font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.workspace-tabs .wtab.active .cnt { background: rgba(10,10,10,0.15); }

/* 剧集卡片 */
.episode-card { padding: 18px 20px; display: flex; align-items: center; gap: 16px; }
.episode-card .ep-num {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: rgba(7,244,242,0.1); border: 1px solid rgba(7,244,242,0.25);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.episode-card .ep-info { flex: 1; min-width: 0; }
.episode-card .ep-name { font-weight: 600; font-size: 14px; }
.episode-card .ep-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.episode-card .ep-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 元素卡片 */
.element-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.element-card .el-preview {
  aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border); cursor: pointer;
}
.element-card .el-preview img { width: 100%; height: 100%; object-fit: cover; }
.element-card .el-preview .el-add {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px;
  align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px;
}
.element-card .el-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.element-card .el-desc { font-size: 12px; color: var(--text-muted); min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.element-card .el-actions { display: flex; gap: 8px; }
.element-card .el-actions .btn { flex: 1; }

/* 分镜 */
.storyboard-item {
  display: flex; gap: 16px; padding: 16px; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--border); margin-bottom: 12px;
}
.storyboard-item .sb-index {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.storyboard-item .sb-main { flex: 1; min-width: 0; }
.storyboard-item .sb-field { margin-bottom: 8px; }
.storyboard-item .sb-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.storyboard-item .sb-text { font-size: 13px; color: var(--text-secondary); word-break: break-word; }
.storyboard-item .sb-media { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.storyboard-item .sb-media .media-item {
  width: 120px; aspect-ratio: 9/16; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); position: relative; background: #000;
}
.storyboard-item .sb-media .media-item img, .storyboard-item .sb-media .media-item video { width: 100%; height: 100%; object-fit: cover; }
.storyboard-item .sb-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }

/* 工具条 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }

/* 聊天式剧本区 */
.script-view {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 24px; white-space: pre-wrap;
  font-size: 14px; line-height: 1.9; max-height: 560px; overflow-y: auto;
}
.script-empty {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 60px 20px; color: var(--text-muted); text-align: center;
}

/* 步骤条 */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 12px; color: var(--text-secondary);
  background: var(--bg-input);
}
.step .s-num {
  width: 18px; height: 18px; border-radius: 50%; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
}
.step.done { border-color: rgba(7,244,242,0.4); color: var(--text); }
.step.done .s-num { background: var(--primary-grad); color: #0a0a0a; }
.step.current { border-color: rgba(7,244,242,0.5); color: var(--text); box-shadow: 0 0 12px rgba(7,244,242,0.1); }
.step-arrow { color: var(--text-muted); font-size: 12px; }

/* 提示词卡片 */
.prompt-card { padding: 18px 20px; }
.prompt-card .p-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.prompt-card .p-title { font-weight: 600; font-size: 14px; }
.prompt-card .p-cat { margin-bottom: 4px; }
.prompt-card .p-summary { font-size: 12px; color: var(--text-muted); min-height: 18px; }
.prompt-card .p-content {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(0,0,0,0.3); font-size: 12px; color: var(--text-secondary);
  max-height: 90px; overflow-y: auto; white-space: pre-wrap;
}
.prompt-card .p-actions { display: flex; gap: 8px; margin-top: 12px; }

/* 设置项 */
.setting-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; }
.setting-item .s-label { font-weight: 500; }
.setting-item .s-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.setting-item .s-value { color: var(--text-secondary); font-size: 14px; }

/* 积分充值面板 */
.recharge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 768px) { .recharge-grid { grid-template-columns: repeat(2, 1fr); } }
.recharge-option {
  padding: 20px 16px; border-radius: 14px; text-align: center; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-input); transition: all .2s;
}
.recharge-option:hover { border-color: var(--border-hover); }
.recharge-option.active { border-color: rgba(7,244,242,0.6); box-shadow: 0 0 16px rgba(7,244,242,0.12); }
.recharge-option .r-amount { font-size: 20px; font-weight: 700; }
.recharge-option .r-credits { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.mt-4 { margin-top: 16px; } .mt-8 { margin-top: 32px; } .mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.flex-1 { flex: 1; } .min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ============================================
 * 项目详情页（参考源单页滚动工作台）
 * ============================================ */
.ws-page { width: 100%; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 16px; }

/* 标题行（对齐源：返回 48×40、项目名 20px、隐藏描述） */
.ws-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ws-back {
  width: 48px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-secondary); border: 1px solid transparent; transition: all .2s; flex-shrink: 0;
}
.ws-back:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ws-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.ratio-badge {
  padding: 2px 10px; border-radius: 6px; font-size: 12px; color: #a1a1aa;
  background: rgba(39,39,42,0.9); border: 1px solid rgba(63,63,70,0.9); flex-shrink: 0;
}
.ws-desc { display: none; }

/* 工具条卡片（对齐源：背景 #18181b、padding 12px、圆角 12px、左栏竖排 + 分隔线 + 右侧滚动区） */
.wbar {
  display: flex; align-items: stretch; gap: 0; padding: 12px;
  background: #18181b; border: 1px solid rgba(39,39,42,0.9);
  border-radius: 12px; flex-wrap: nowrap;
}
.wbar.glass { background: #18181b; border-color: rgba(39,39,42,0.9); backdrop-filter: blur(8px); }
.wbar-left {
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  flex: none; min-width: 160px; padding-right: 12px; margin-right: 0;
  border-right: 1px solid rgba(255,255,255,0.08); flex-wrap: nowrap;
}
.wbar-left.wide { min-width: 261px; }
.wbar-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wbar-icon {
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.wbar-icon.teal { background: rgba(7,244,242,0.12); color: #07f4f2; }
.wbar-icon.purple { background: rgba(168,85,247,0.12); color: #c084fc; }
.wbar-icon.orange { background: rgba(249,115,22,0.12); color: #fb923c; }
.wbar-icon.blue { background: rgba(59,130,246,0.12); color: #60a5fa; }
.wbar-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wbar-title { font-size: 14px; font-weight: 600; white-space: nowrap; }
.wbar-sub { font-size: 12px; color: #71717a; white-space: nowrap; }
.wbar-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wbar-scroll-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
.scroll-btn {
  width: 32px; height: 32px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: #a1a1aa; transition: all .2s;
}
.scroll-btn:hover {
  background: linear-gradient(135deg, #1af8f6, #d4fccf); color: #0a0a0a;
}
.wbar-scroll { display: flex; gap: 8px; overflow-x: auto; align-items: center; flex: 1; min-width: 0; padding: 4px 2px; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* 小按钮（对齐源：28px / 圆角 6 / 实心 #27272a；primary 渐变深字） */
.mini-btn {
  height: 28px; padding: 0 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: #27272a; color: #d4d4d8; border: 1px solid #3f3f46;
  cursor: pointer; transition: all .2s; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.mini-btn:hover {
  background: linear-gradient(135deg, #1af8f6, #d4fccf); color: #0a0a0a; border-color: transparent;
}
.mini-btn.primary {
  background: linear-gradient(135deg, #07f4f2, #c1fab8); color: #0a0a0a; border-color: transparent; font-weight: 600;
}
.mini-btn.primary:hover { background: linear-gradient(135deg, #1af8f6, #d4fccf); }
.mini-btn.danger { color: #f87171; }
.mini-btn.locked { opacity: .45; cursor: not-allowed; }
.mini-btn.locked:hover { background: #27272a; color: #d4d4d8; border-color: #3f3f46; }
.mini-btn.danger:hover { background: rgba(248,113,113,0.15); color: #fca5a5; border-color: rgba(248,113,113,0.3); }

/* 剧集卡 */
.ep-tile {
  position: relative; display: flex; flex-direction: column; align-items: stretch;
  width: 80px; height: 80px; border-radius: 12px; border: 1px solid;
  padding: 6px 6px 4px; flex: none; cursor: pointer; overflow: hidden;
  background: rgba(24,24,27,0.3); border-color: #3f3f46; color: #71717a;
  transition: all .2s; text-align: center;
}
.ep-tile:hover { background: #27272a; border-color: #52525b; color: #d4d4d8; }
.ep-tile.active {
  background: linear-gradient(135deg, #1af8f6, #d4fccf); border-color: transparent;
  color: #0a0a0a; box-shadow: 0 4px 16px -2px rgba(7,244,242,0.45);
}
.ep-tile .ep-name { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; line-height: 1.3; word-break: break-all; }
.ep-tile .ep-prog { font-size: 10px; text-align: center; padding-top: 2px; opacity: 0.7; }
.ep-tile .ai-pill {
  position: absolute; left: 6px; right: 6px; bottom: 4px; z-index: 2;
  border-radius: 9999px; padding: 3px 0; font-size: 9px; font-weight: 500; text-align: center;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.9); backdrop-filter: blur(2px);
  transition: all .2s;
}
.ep-tile .ai-pill:hover {
  background: rgba(255,255,255,0.85); color: #333;
}
.ep-tile.dash {
  border: 1px dashed #52525b; background: rgba(24,24,27,0.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #71717a;
}
.ep-tile.dash:hover { background: rgba(63,63,70,0.5); border-color: #71717a; color: #d4d4d8; }
.ep-tile .ep-hover {
  position: absolute; top: 2px; right: 2px; z-index: 3;
  display: flex; gap: 3px; opacity: 0; transition: opacity .15s; pointer-events: none;
}
.ep-tile:hover .ep-hover { opacity: 1; pointer-events: auto; }
.ep-tile .ep-hover button {
  height: 16px; padding: 0 4px; border-radius: 4px; font-size: 9px; line-height: 16px;
  background: rgba(0,0,0,0.55); color: #fff; border: 1px solid rgba(255,255,255,0.25);
}
.ep-tile .ep-hover button:hover { background: rgba(7,244,242,0.25); border-color: #07f4f2; }
.ep-tile .ep-hover .ep-del:hover { background: rgba(239,68,68,0.3); border-color: #f87171; }

/* 角色/场景/道具三栏 */
.ws-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1024px) { .ws-trio { grid-template-columns: 1fr; } }
.trio-col {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(24,24,27,0.5); border: 1px solid rgba(39,39,42,0.9);
  border-radius: 12px; padding: 12px; min-width: 0;
  /* 容器查询：供内部以 cqi 单位按栏宽自适应计算可见高度 */
  container-type: inline-size;
}
.trio-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.trio-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.trio-icon {
  width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.trio-icon.blue { background: rgba(59,130,246,0.12); color: #60a5fa; }
.trio-icon.purple { background: rgba(74,222,128,0.12); color: #4ade80; }
.trio-icon.orange { background: rgba(250,204,21,0.12); color: #facc15; }
.trio-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.trio-btns .mini-btn { height: 28px; padding: 0 12px; font-size: 12px; }
/* 元素网格：恒 6 列，可见窗口固定 3 行（高度随栏宽自适应，单元格大小一致），悬停可上下滚动 */
.trio-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* 3 行可见 = 3*(单元格宽+名称约19px) + 2*间距；单元格宽=(100cqi-5*8px)/6 */
  max-height: calc((100cqi - 40px) / 2 + 73px);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  padding-right: 2px;
}
.trio-grid:hover { scrollbar-color: rgba(255,255,255,0.4) transparent; }
.trio-grid::-webkit-scrollbar { width: 6px; }
.trio-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.trio-grid::-webkit-scrollbar-thumb:hover { background: rgba(7,244,242,0.5); }

/* 元素小卡（对齐参考源：hover 黑色半透明遮罩 + 白色胶囊"生成"按钮 + 右上角更多） */
.el-tile {
  position: relative; width: 100%; border-radius: 10px; overflow: visible; cursor: pointer;
  transition: all .2s; display: flex; flex-direction: column; gap: 2px;
}
.el-tile .el-img {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: rgba(39,39,42,0.6); border: 1px solid rgba(63,63,70,0.9); transition: border-color .2s;
}
.el-tile:hover .el-img { border-color: #71717a; }
.el-tile .el-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.el-tile .el-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 18px; opacity: 0.5;
}
.el-hover {
  position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.2); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.el-tile:hover .el-hover { opacity: 1; }
.el-gen {
  pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  height: 22px; padding: 0 7px; border-radius: 999px; background: #fff; color: #09090b;
  font-size: 10px; font-weight: 500; white-space: nowrap; transition: background .15s;
}
.el-gen:hover { background: #f4f4f5; }
.el-more {
  position: absolute; top: 3px; right: 3px; z-index: 2; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; pointer-events: auto;
}
.el-tile:hover .el-more { opacity: 1; }
.el-more:hover { background: rgba(0,0,0,0.7); }
.el-tile .el-name {
  padding: 1px 2px 0; font-size: 10px; font-weight: 400; color: #a1a1aa; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%;
}
.el-menu {
  position: absolute; right: 0; top: 24px; z-index: 30; min-width: 110px;
  background: #18181b; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
  padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.el-menu button {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  padding: 7px 10px; font-size: 12px; color: #e4e4e7; border-radius: 7px;
}
.el-menu button:hover { background: rgba(255,255,255,0.08); }
.el-menu button.danger { color: #f87171; }
.el-tile.dash {
  border: 1px dashed #52525b; background: rgba(39,39,42,0.2); aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center; color: #71717a; border-radius: 10px;
}
.el-tile.dash:hover { background: rgba(63,63,70,0.4); border-color: #71717a; color: #d4d4d8; }

/* 元素创作弹窗（对齐参考源：左提示词+模型/比例/立即生成，右前置模板+生成记录） */
.modal-xl { max-width: 960px; height: min(86vh, 860px); display: flex; flex-direction: column; }
.modal-xl > .modal-head { flex: none; }
.modal-xl .modal-foot { flex: none; }

/* ============ 配音管理 ============ */
.vm-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); flex: none; }
.vm-title { font-size: 17px; font-weight: 600; color: #f8fafc; }
.vm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0; }
/* 价格栏 + 工具栏 */
.vm-price-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); flex-wrap: wrap; }
.vm-price { font-size: 13px; color: #a1a1aa; flex-shrink: 0; }
.vm-price b { color: #07f4f2; font-weight: 600; }
.vm-toolbar { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 600px; }
.vm-search { flex: 1; height: 34px; border-radius: 8px; padding: 0 12px; font-size: 13px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); color: #f8fafc; outline: none; transition: border-color .15s; box-sizing: border-box; }
.vm-search:focus { border-color: rgba(7,244,242,0.4); }
.vm-toolbar-btns { display: flex; gap: 8px; flex-shrink: 0; }
/* 按钮 */
.vm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 32px; border-radius: 8px; padding: 0 12px; font-size: 13px; font-weight: 500; border: none; cursor: pointer; transition: all .15s; white-space: nowrap; }
.vm-btn-primary { background: linear-gradient(135deg, #07f4f2, #c1fab8); color: #0a0a0a; }
.vm-btn-primary:hover { opacity: .9; box-shadow: 0 2px 12px rgba(7,244,242,0.3); }
.vm-btn-ghost { background: transparent; color: #d4d4d8; border: 1px solid rgba(255,255,255,0.15); }
.vm-btn-ghost:hover { background: rgba(255,255,255,0.06); color: #fff; }
.vm-btn-sm { height: 30px; font-size: 12px; padding: 0 10px; }
.vm-btn:disabled { opacity: .5; cursor: not-allowed; }
/* 网格卡片 */
.vm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; padding: 16px 20px; }
@media (max-width: 760px) { .vm-grid { grid-template-columns: 1fr; } }
.vm-card { border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; background: rgba(255,255,255,0.02); padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.vm-card:hover { border-color: rgba(255,255,255,0.15); }
.vm-card.done { border-color: rgba(34,197,94,0.25); }
.vm-card-top { display: flex; align-items: center; gap: 8px; }
.vm-card-num { font-size: 11px; font-weight: 600; color: #07f4f2; background: rgba(7,244,242,0.12); border-radius: 999px; padding: 1px 8px; flex-shrink: 0; }
.vm-card-char { flex: 1; min-width: 0; height: 30px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; padding: 0 10px; font-size: 13px; color: #f8fafc; outline: none; transition: border-color .15s; box-sizing: border-box; }
.vm-card-char:focus { border-color: rgba(7,244,242,0.4); }
.vm-card-text { width: 100%; min-height: 70px; max-height: 140px; resize: vertical; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: #f8fafc; outline: none; font-family: inherit; line-height: 1.6; transition: border-color .15s; box-sizing: border-box; }
.vm-card-text:focus { border-color: rgba(7,244,242,0.4); }
.vm-card-voice { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; background: rgba(255,255,255,0.04); cursor: pointer; transition: all .15s; }
.vm-card-voice:hover { border-color: rgba(7,244,242,0.4); }
.vm-card-audio { width: 100%; height: 36px; }
.vm-card-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
/* 情感选择器 */
.vm-card-emotion { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.vm-emo-label { font-size: 12px; color: #a1a1aa; flex-shrink: 0; }
.vm-emo-select {
  flex: 0 0 auto; height: 28px; border-radius: 6px; padding: 0 8px; font-size: 12px;
  background: #1e1e2e; border: 1px solid rgba(255,255,255,0.18); color: #f8fafc; cursor: pointer;
  appearance: auto; -webkit-appearance: menulist;
}
.vm-emo-select option { background: #1e1e2e; color: #f8fafc; padding: 4px 6px; }
.vm-emo-select:focus { border-color: rgba(7,244,242,0.5); outline: none; background: #2a2a3e; }
.vm-emo-select:disabled { color: #71717a; background: rgba(30,30,46,0.4); cursor: not-allowed; }
.vm-emo-select:disabled option { color: #71717a; }
.vm-emo-desc { font-size: 11px; color: #71717a; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 音色选择器 */
.vm-vs-icon { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #07f4f2, #c1fab8); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.vm-vs-info { flex: 1; min-width: 0; }
.vm-vs-name { font-size: 13px; font-weight: 600; color: #f8fafc; }
.vm-vs-meta { font-size: 11px; color: #71717a; margin-top: 2px; }
.vm-vs-arrow { font-size: 12px; color: #71717a; flex-shrink: 0; }
/* 标签 */
.vm-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; border-radius: 999px; padding: 2px 8px; flex-shrink: 0; }
.vm-tag-green { color: #22c55e; background: rgba(34,197,94,0.15); }
.vm-tag-blue { color: #3b82f6; background: rgba(59,130,246,0.15); }
.vm-tag-pink { color: #ec4899; background: rgba(236,72,153,0.15); }
.vm-tag-gray { color: #a1a1aa; background: rgba(255,255,255,0.08); }
.vm-tag-purple { color: #a855f7; background: rgba(168,85,247,0.15); }
.vm-tag-orange { color: #f97316; background: rgba(249,115,22,0.15); }
/* 空状态 */
.vm-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 40px 20px; }
.vm-empty-ic { font-size: 36px; }
.vm-empty-tx { font-size: 13px; color: #71717a; }
/* 音色库 */
.vl-body { padding: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.vl-tabs { display: flex; align-items: center; gap: 4px; padding: 12px 20px 0; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.vl-tab { padding: 8px 16px; font-size: 14px; font-weight: 500; color: #71717a; background: transparent; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all .15s; }
.vl-tab:hover { color: #d4d4d8; }
.vl-tab.active { color: #07f4f2; border-bottom-color: #07f4f2; }
.vl-tab-right { margin-left: auto; }
.vl-search-wrap { padding: 12px 20px; flex-shrink: 0; }
.vl-search { width: 100%; height: 36px; border-radius: 8px; padding: 0 12px; font-size: 13px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); color: #f8fafc; outline: none; transition: border-color .15s; box-sizing: border-box; }
.vl-search:focus { border-color: rgba(7,244,242,0.4); }
.vl-filter-area { padding: 0 20px 12px; flex-shrink: 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.vl-filters { display: flex; flex-direction: column; gap: 8px; }
.vl-filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.vl-filter-label { font-size: 12px; font-weight: 600; color: #71717a; width: 36px; flex-shrink: 0; }
.vl-filter-btn { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 999px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); color: #a1a1aa; cursor: pointer; transition: all .15s; }
.vl-filter-btn:hover { border-color: rgba(255,255,255,0.2); color: #d4d4d8; }
.vl-filter-btn.active { background: rgba(7,244,242,0.12); border-color: rgba(7,244,242,0.4); color: #07f4f2; }
.vl-content { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px 20px; }
.vl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vl-card { position: relative; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; background: rgba(255,255,255,0.04); padding: 12px; cursor: pointer; transition: all .15s; }
.vl-card:hover { border-color: rgba(7,244,242,0.4); }
.vl-card.selected { border-color: rgba(7,244,242,0.6); background: rgba(7,244,242,0.06); }
.vl-play { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,0.08); color: #d4d4d8; border: none; font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.vl-play:hover { background: rgba(255,255,255,0.15); color: #fff; }
.vl-name { font-size: 14px; font-weight: 600; color: #f8fafc; margin-bottom: 6px; padding-right: 30px; }
.vl-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.vl-meta { font-size: 11px; color: #71717a; margin-top: 6px; }
/* 声音设计表单 */
.vd-form { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.vd-form-title { font-size: 15px; font-weight: 600; color: #f8fafc; margin-bottom: 4px; }
.vd-form-desc { font-size: 12px; color: #71717a; margin-bottom: 12px; }
.vd-input { width: 100%; height: 36px; border-radius: 8px; padding: 0 12px; font-size: 13px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); color: #f8fafc; margin-bottom: 10px; }
.vd-input:focus { border-color: rgba(7,244,242,0.5); outline: none; }
.vd-textarea { width: 100%; min-height: 80px; max-height: 160px; border-radius: 8px; padding: 8px 12px; font-size: 13px; line-height: 1.5; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); color: #f8fafc; resize: vertical; font-family: inherit; margin-bottom: 10px; }
.vd-textarea:focus { border-color: rgba(7,244,242,0.5); outline: none; }
.vd-form-foot { display: flex; align-items: center; justify-content: space-between; }
.vd-count { font-size: 11px; color: #71717a; }
.vd-tips { margin-top: 12px; padding: 10px 12px; background: rgba(7,244,242,0.04); border: 1px solid rgba(7,244,242,0.12); border-radius: 8px; }
.vd-tips-title { font-size: 12px; font-weight: 600; color: #07f4f2; margin-bottom: 6px; }
.vd-tips div { font-size: 11px; color: #a1a1aa; line-height: 1.6; }
.vd-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vd-del { position: absolute; top: 8px; right: 8px; font-size: 10px; color: #ef4444; background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); border-radius: 4px; padding: 2px 6px; cursor: pointer; }
.vd-del:hover { background: rgba(239,68,68,0.2); }
.elc-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; overflow: hidden; }
@media (max-width: 900px) { .elc-layout { grid-template-columns: 1fr; overflow-y: auto; } }
.elc-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.elc-right { display: flex; flex-direction: column; gap: 12px; min-height: 0; border-left: 1px solid rgba(255,255,255,0.08); padding-left: 16px; }
@media (max-width: 900px) {
  .elc-right { border-left: none; padding-left: 0; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; }
}
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex: none; }
.field-label-row .field-label { margin-bottom: 0; }
.sys-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #a0a5b5; cursor: pointer; padding: 6px 0; }
.sys-check input { width: 16px; height: 16px; accent-color: #07f4f2; cursor: pointer; }
.elc-label-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.elc-sample-btn {
  height: 26px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #0a0a0a; background: linear-gradient(135deg, rgba(96,165,250,0.95), #6366f1);
  box-shadow: 0 2px 10px -2px rgba(99,102,241,0.4); border: none; cursor: pointer; transition: all .15s;
}
.elc-sample-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.elc-sample-frame { flex: 1; min-height: 0; min-height: 560px; }
.elc-sample-frame iframe { width: 100%; height: 100%; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; background: #0f1117; display: block; }
.elc-charcard-btn {
  height: 26px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #0a0a0a; background: linear-gradient(135deg, rgba(251,191,36,0.95), #f97316);
  box-shadow: 0 2px 10px -2px rgba(249,115,22,0.4); border: none; cursor: pointer; transition: all .15s;
}
.elc-charcard-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.cc-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cc-field-row { display: flex; align-items: stretch; gap: 6px; }
.cc-field-row .cc-field { flex: 1; min-width: 0; }
.cc-word-btn {
  flex: none; align-self: center; height: 24px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: #fbbf24; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.35); cursor: pointer; transition: all .15s;
}
.cc-word-btn:hover { color: #0a0a0a; background: linear-gradient(135deg, #fbbf24, #f97316); border-color: transparent; }
.cc-word-groups { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 4px; }
.cc-word-group { display: flex; flex-direction: column; gap: 8px; }
.cc-word-cat {
  font-size: 12px; font-weight: 600; color: #07f4f2; letter-spacing: 1px;
  display: flex; align-items: center; gap: 8px; flex: none;
}
.cc-word-cat::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(7,244,242,0.35), transparent); }
.cc-chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-chip {
  height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; color: #d4d4d8;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); cursor: pointer; transition: all .15s;
}
.cc-chip:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.cc-chip.on {
  color: #0a0a0a; font-weight: 600; border-color: transparent;
  background: linear-gradient(135deg, #07f4f2, #c1fab8);
  box-shadow: 0 2px 10px -2px rgba(7,244,242,0.4);
}
.elc-prompt { flex: 1; min-height: 180px; resize: vertical; }
.elc-ratio { display: flex; gap: 6px; flex-wrap: wrap; }
.ratio-pill {
  height: 26px; padding: 0 10px; border-radius: 999px; font-size: 11px; color: #a1a1aa;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); transition: all .15s;
}
.ratio-pill:hover { color: #fff; border-color: rgba(255,255,255,0.25); }
.ratio-pill.active {
  background: linear-gradient(135deg, #07f4f2, #c1fab8); color: #0a0a0a; border-color: transparent;
  font-weight: 600; box-shadow: 0 2px 10px -2px rgba(7,244,242,0.4);
}
.elc-submit {
  height: 34px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #0a0a0a;
  background: linear-gradient(135deg, #07f4f2, #c1fab8); box-shadow: 0 4px 16px -4px rgba(7,244,242,0.4);
  transition: all .15s;
}
.elc-submit:hover { background: linear-gradient(135deg, #1af8f6, #d4fccf); }
.elc-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.gen-title { font-size: 13px; font-weight: 600; color: #e4e4e7; flex: none; }
.gen-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.gen-card {
  position: relative; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.25); aspect-ratio: 1;
}
.gen-card img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.gen-card.used { border-color: transparent; box-shadow: 0 0 0 2px rgba(7,244,242,0.4); }
.gen-view {
  position: absolute; left: 5px; bottom: 5px; z-index: 2; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.gen-card:hover .gen-view { opacity: 1; }
.gen-used {
  position: absolute; left: 5px; top: 5px; z-index: 2; padding: 1px 6px; border-radius: 999px;
  background: linear-gradient(135deg, #07f4f2, #c1fab8); color: #0a0a0a; font-size: 10px; font-weight: 600;
}
.gen-del {
  position: absolute; right: 5px; top: 5px; z-index: 3; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.gen-card:hover .gen-del { opacity: 1; }
.gen-del:hover { background: rgba(0,0,0,0.75); }
.gen-hover {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); opacity: 0; transition: opacity .2s;
}
.gen-card:hover .gen-hover { opacity: 1; }
.gen-act { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.gen-act.pick { background: linear-gradient(135deg, #07f4f2, #c1fab8); color: #0a0a0a; }
.gen-act.pick:hover { background: linear-gradient(135deg, #1af8f6, #d4fccf); }
.gen-act.cancel { background: rgba(239,68,68,0.85); color: #fff; }
.gen-act.cancel:hover { background: #ef4444; }

/* 分镜小卡（对齐源：112×112、hover 白色胶囊 + 深底阴影） */
.sb-tile {
  position: relative; width: 112px; height: 112px; border-radius: 12px; flex: none;
  background: rgba(24,24,27,0.5); border: 1px solid rgba(39,39,42,0.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; overflow: hidden; transition: all .2s; color: #a1a1aa;
}
.sb-tile:hover {
  border-color: #52525b; background: rgba(39,39,42,0.9); color: #d4d4d8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.sb-tile .sb-hover {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  width: 60px; height: 27px; border-radius: 999px;
  background: #fff; color: #09090b; font-size: 12px; font-weight: 500;
  opacity: 0; transition: opacity .15s; box-shadow: 0 2px 8px rgba(0,0,0,0.35); z-index: 2;
}
.sb-tile:hover .sb-hover { opacity: 1; }
.sb-tile .sb-no { font-size: 15px; font-weight: 700; }
.sb-tile .sb-meta { font-size: 10px; color: inherit; opacity: 0.8; }
.sb-tile.dash {
  border: 1px dashed #52525b; background: rgba(24,24,27,0.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #71717a;
}
.sb-tile.dash:hover { background: rgba(63,63,70,0.4); border-color: #71717a; color: #d4d4d8; box-shadow: none; }

/* 配音集卡（对齐源：112×112 方块 + 进度条 + hover 白色胶囊） */
.vc-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 112px; height: 112px; flex: none;
  border-radius: 12px; background: rgba(24,24,27,0.5); border: 1px solid rgba(39,39,42,0.9);
  cursor: pointer; overflow: hidden; transition: all .2s; color: #a1a1aa;
}
.vc-tile:hover {
  border-color: #52525b; background: rgba(39,39,42,0.9); color: #d4d4d8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.vc-tile.active { border-color: rgba(7,244,242,0.5); }
.vc-tile .vc-name { font-size: 13px; font-weight: 600; }
.vc-tile .vc-prog { font-size: 10px; opacity: 0.8; }
.vc-tile .vc-bar { width: 60%; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; }
.vc-tile .vc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #07f4f2, #c1fab8); border-radius: 999px; }
.vc-tile::after {
  content: '配音管理';
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 27px; border-radius: 999px;
  background: #fff; color: #09090b; font-size: 12px; font-weight: 500;
  opacity: 0; transition: opacity .15s; box-shadow: 0 2px 8px rgba(0,0,0,0.35); z-index: 2;
}
.vc-tile:hover::after { opacity: 1; }

/* 合成集卡（对齐源：112×112 方块 + 状态徽章 + hover 白色胶囊） */
.comp-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 112px; height: 112px; flex: none;
  border-radius: 12px; background: rgba(24,24,27,0.5); border: 1px solid rgba(39,39,42,0.9);
  cursor: pointer; overflow: hidden; transition: all .2s; color: #a1a1aa;
}
.comp-tile:hover {
  border-color: #52525b; background: rgba(39,39,42,0.9); color: #d4d4d8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.comp-tile.active { border-color: rgba(7,244,242,0.5); }
.comp-tile .comp-name { font-size: 13px; font-weight: 600; }
.comp-tile .comp-status { font-size: 10px; padding: 2px 8px; border-radius: 999px; }
.comp-tile .comp-status.ok { background: rgba(16,185,129,0.15); color: #34d399; }
.comp-tile .comp-status.no { background: rgba(255,255,255,0.06); color: #a1a1aa; }
.comp-tile .comp-hover {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  width: 60px; height: 27px; border-radius: 999px;
  background: #fff; color: #09090b; font-size: 12px; font-weight: 500;
  opacity: 0; transition: opacity .15s; box-shadow: 0 2px 8px rgba(0,0,0,0.35); z-index: 2;
}
.comp-tile:hover .comp-hover { opacity: 1; }
.comp-tile.locked { opacity: .45; cursor: not-allowed; }
.comp-tile.locked:hover { border-color: rgba(39,39,42,0.9); background: rgba(24,24,27,0.5); color: #a1a1aa; box-shadow: none; }
.comp-tile.locked .comp-hover { display: none; }

.ws-empty { color: #71717a; font-size: 12px; padding: 10px 4px; }

/* 管理列表行 */
.mg-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; margin-bottom: 8px;
  background: rgba(255,255,255,0.02);
}
.mg-prev {
  width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0; overflow: hidden;
  background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.08); font-size: 20px;
}
.mg-prev img { width: 100%; height: 100%; object-fit: cover; }
.mg-main { flex: 1; min-width: 0; }
.mg-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-meta { font-size: 12px; color: #71717a; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

/* 剧集序号步进器（参考源） */
.stepper { display: inline-flex; align-items: center; }
.st-btn {
  width: 40px; height: 40px; border: 1px solid #3f3f46; background: #27272a; color: #d4d4d8;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.st-btn:first-child { border-radius: 10px 0 0 10px; }
.st-btn:last-child { border-radius: 0 10px 10px 0; }
.st-btn:hover { background: #3f3f46; }
.st-val {
  width: 64px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: #09090b; border-top: 1px solid #3f3f46; border-bottom: 1px solid #3f3f46;
  font-size: 14px; font-weight: 600;
}

/* AI 剧本创作弹窗（左右布局） */
.sc-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
@media (max-width: 768px) { .sc-layout { grid-template-columns: 1fr; } }
.sc-form { min-width: 0; }
.sc-preview {
  display: flex; flex-direction: column; min-width: 0; max-height: 480px;
  border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; overflow: hidden;
}
.sc-preview-title { padding: 10px 14px; font-size: 12px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.08); color: #a1a1aa; }
.sc-preview-body { flex: 1; overflow-y: auto; min-height: 200px; background: rgba(0,0,0,0.2); }
.sc-ph { padding: 40px 16px; text-align: center; color: #52525b; font-size: 12px; }
.sc-text { padding: 14px; font-size: 12px; line-height: 1.8; color: #d4d4d8; white-space: pre-wrap; word-break: break-word; }
.sc-loading { padding: 40px 16px; text-align: center; color: #a1a1aa; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.sc-outline-title { padding: 12px 14px 4px; font-size: 13px; font-weight: 600; color: #f8fafc; }
.sc-outline-item { padding: 6px 14px; font-size: 12px; line-height: 1.6; color: #a1a1aa; }
.sc-outline-item b { color: #e4e4e7; margin-right: 8px; }
.sc-line { padding: 7px 14px; font-size: 12px; line-height: 1.6; color: #a1a1aa; }
.sc-running { color: #e4e4e7; }
.sc-running::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(7,244,242,0.3); border-top-color: #07f4f2; animation: scSpin .8s linear infinite; margin-right: 8px; vertical-align: -1px; }
.sc-done { color: #07f4f2; }
@keyframes scSpin { to { transform: rotate(360deg); } }
.billing-tip {
  padding: 10px 14px; border-radius: 10px; font-size: 12px; color: #a1a1aa;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
}
.billing-tip b { color: #07f4f2; }
.prompt-row { display: flex; gap: 8px; }
.prompt-row .select { flex: 1; min-width: 0; }

/* 导入剧本说明卡 */
.import-card {
  padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 8px;
}
.import-card p { font-size: 13px; color: #a1a1aa; line-height: 1.6; margin: 0; }

/* 图片上传网格 */
.up-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 768px) { .up-grid { grid-template-columns: repeat(2, 1fr); } }
.up-item { width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); background: #000; }
.up-item img { width: 100%; height: 100%; object-fit: cover; }

/* ============ 剧集管理整页（对齐参考源） ============ */
.epm-page { height: calc(100vh - 64px); display: flex; flex-direction: column; min-height: 0; }
.epm-head {
  display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 40px;
  border-bottom: 1px solid rgba(63,63,70,0.8); background: #18181b; flex-shrink: 0;
}
.epm-back { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #d4d4d8; transition: color .2s; }
.epm-back:hover { color: #a1a1aa; }
.epm-title { font-size: 13px; font-weight: 500; color: #e4e4e7; }
.epm-project { font-size: 12px; color: #71717a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.epm-main { flex: 1; display: flex; min-height: 0; }
.epm-side { width: 320px; flex: none; border-right: 1px solid var(--border); background: #101014; display: flex; flex-direction: column; min-height: 0; }
.epm-side-head {
  height: 40px; flex: none; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px;
}
.epm-side-title { font-size: 13px; font-weight: 500; color: #e4e4e7; margin: 0; }
.epm-add {
  display: flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; color: #a1a1aa; background: transparent; border: none; cursor: pointer; transition: all .15s;
}
.epm-add:hover { background: #27272a; color: #fff; }
.epm-list { flex: 1; overflow-y: auto; padding: 8px; }
.epm-empty { padding: 32px 12px; text-align: center; font-size: 12px; color: #52525b; }
.epm-row {
  display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; color: #a1a1aa; transition: all .15s; user-select: none;
}
.epm-row:hover { background: rgba(63,63,70,0.35); color: #e4e4e7; }
.epm-row.sel { background: #27272a; border-color: rgba(113,113,122,0.5); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.epm-row.dragging { opacity: 0.4; }
.epm-grip { cursor: grab; border-radius: 6px; padding: 4px; color: #71717a; transition: all .15s; flex: none; }
.epm-grip:hover { background: rgba(63,63,70,0.7); color: #d4d4d8; }
.epm-grip:active { cursor: grabbing; }
.epm-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.epm-row-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epm-row-status { font-size: 10px; color: #52525b; }
.epm-del { flex: none; border-radius: 6px; padding: 6px; color: #a1a1aa; opacity: 0.6; background: transparent; border: none; cursor: pointer; transition: all .15s; }
.epm-row:hover .epm-del { opacity: 1; }
.epm-del:hover { background: rgba(239,68,68,0.2); color: #f87171; }
.epm-form { flex: 1; min-width: 0; background: rgba(9,9,11,0.5); display: flex; flex-direction: column; min-height: 0; }
.epm-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 14px 24px;
  border-bottom: 1px solid var(--border); background: rgba(24,24,27,0.5); flex: none;
}
.epm-lbl { font-size: 12px; color: #71717a; font-family: ui-monospace, monospace; white-space: nowrap; }
.epm-num {
  width: 72px; height: 32px; border-radius: 6px; text-align: center; font-family: ui-monospace, monospace;
  background: rgba(9,9,11,0.5); border: 1px solid #3f3f46; color: #e4e4e7; font-size: 13px; outline: none; transition: border-color .15s;
}
.epm-num:focus { border-color: #3b82f6; }
.epm-name {
  flex: 1; min-width: 0; height: 32px; padding: 0 8px; font-size: 18px; font-weight: 700;
  background: transparent; border: 1px solid transparent; border-radius: 6px; color: #fafafa; outline: none; transition: border-color .15s;
}
.epm-name:hover { border-color: #3f3f46; }
.epm-name:focus { border-color: #71717a; }
.epm-ai {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: none; border-radius: 6px;
  background: linear-gradient(135deg, #07f4f2, #c1fab8); color: #0a0a0a; font-size: 13px; font-weight: 500; cursor: pointer; transition: opacity .15s;
}
.epm-ai:hover { opacity: 0.9; }
.epm-ai-name { max-width: 120px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(10,10,10,0.6); }
.epm-save {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: none; border-radius: 6px;
  background: #f4f4f5; color: #18181b; font-size: 13px; font-weight: 500; cursor: pointer; transition: opacity .15s;
}
.epm-save:hover { opacity: 0.85; }
.epm-ai:disabled, .epm-save:disabled, .epm-add:disabled { opacity: 0.4; cursor: not-allowed; }
.epm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.epm-field { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.epm-field:last-child { flex: none; }
.epm-label { font-size: 13px; color: #a1a1aa; }
.epm-content {
  flex: 1; min-height: 220px; padding: 12px 14px; border-radius: 10px; resize: vertical;
  background: rgba(9,9,11,0.5); border: 1px solid #27272a; color: #e4e4e7; font-size: 13px; line-height: 1.7; outline: none; font-family: inherit;
}
.epm-content:focus { border-color: #52525b; }
.epm-remark {
  min-height: 80px; padding: 10px 14px; border-radius: 10px; resize: vertical;
  background: rgba(9,9,11,0.5); border: 1px solid #27272a; color: #e4e4e7; font-size: 13px; line-height: 1.6; outline: none; font-family: inherit;
}
.epm-remark:focus { border-color: #52525b; }
.epm-ai-sub { margin-left: 6px; font-size: 14px; font-weight: 400; color: #a1a1aa; }

/* AI 剧本分析弹窗 */
.ai-warn {
  display: flex; align-items: center; gap: 8px; margin: 12px 0; padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); color: #fbbf24; font-size: 13px;
}
.ai-opts { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.ai-opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; text-align: left; cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); color: #d4d4d8; transition: all .15s;
}
.ai-opt:hover { border-color: rgba(255,255,255,0.2); }
.ai-opt:disabled { cursor: not-allowed; opacity: 0.45; }
.ai-opt.on { border-color: #07f4f2; }
.ai-check {
  flex: none; width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  border: 1px solid #71717a; background: transparent; color: #fff; transition: all .15s;
}
.ai-opt.on .ai-check { background: #07f4f2; border-color: #07f4f2; color: #0a0a0a; }
.ai-opt-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-opt-main b { font-size: 13px; font-weight: 500; color: #f4f4f5; }
.ai-opt-main i { font-size: 12px; font-style: normal; color: #71717a; }
.ai-includes { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); margin-bottom: 4px; }
.ai-includes-title { font-size: 12px; color: #a1a1aa; margin-bottom: 6px; }
.ai-includes ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.ai-includes li { font-size: 12px; color: #71717a; }

/* ============ 分镜列表整页（对齐参考源） ============ */

/* 剧集切换条（对齐参考源：全宽横向滚动 pills，无箭头，激活为亮青绿渐变） */
.sbm-switch { flex: none; border-bottom: 1px solid rgba(63,63,70,0.8); background: transparent; }
.sbm-sw-list { display: flex; gap: 8px; overflow-x: auto; padding: 6px 16px; scrollbar-width: thin; }
.sbm-sw-pill {
  flex: none; display: flex; align-items: center; max-width: 280px; height: 40px; padding: 0 24px; border-radius: 8px; cursor: pointer;
  background: rgba(24,24,27,0.3); border: 1px solid rgba(255,255,255,0.1); color: #a1a1aa;
  font-size: 14px; transition: all .15s; white-space: nowrap;
}
.sbm-sw-pill:hover { background: rgba(255,255,255,0.06); color: #e4e4e7; }
.sbm-sw-pill.active { background: linear-gradient(135deg, #1af8f6, #d4fccf); border: none; color: #0a0a0a; font-weight: 600; }
.sbm-sw-name { overflow: hidden; text-overflow: ellipsis; font-size: 14px; }

/* 侧栏 */
.sbm-side-acts { display: flex; align-items: center; gap: 4px; }
.sbm-delall, .sbm-add {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 6px;
  background: transparent; border: none; color: #a1a1aa; cursor: pointer; transition: all .15s;
  font-size: 12px;
}
.sbm-delall:hover { background: rgba(239,68,68,0.12); color: #f87171; }
.sbm-add:hover { background: #27272a; color: #fff; }
.sbm-meta { font-size: 10px; color: #71717a; font-family: ui-monospace, monospace; }
.sbm-row-edit {
  flex: none; border-radius: 6px; padding: 6px; color: #a1a1aa; opacity: 0; background: transparent; border: none; cursor: pointer; transition: all .15s;
}
.epm-row:hover .sbm-row-edit { opacity: 1; }
.sbm-row-edit:hover { background: #3f3f46; color: #93c5fd; }

/* 工具条（单行：tabs 左 + 操作右） */
.sbm-toolbar { justify-content: space-between; gap: 12px; flex-wrap: nowrap; padding: 12px 16px; background: rgba(0,0,0,0.2); }
.sbm-tabs { display: flex; gap: 10px; flex-wrap: nowrap; overflow-x: auto; }
.sbm-tab {
  flex: none; min-width: 160px; height: 62px; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 12px; cursor: pointer;
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.1); color: #94a3b8;
  transition: all .15s;
}
.sbm-tab:hover { background: rgba(255,255,255,0.05); color: #e4e4e7; }
.sbm-tab.active { border-color: rgba(7,244,242,0.5); background: rgba(7,244,242,0.1); color: #fff; }
.sbm-tab-ico { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; flex: none; }
.sbm-tab-ico.teal { background: rgba(7,244,242,0.1); color: #07f4f2; }
.sbm-tab-ico.green { background: rgba(193,250,184,0.12); color: #c1fab8; }
.sbm-tab-ico.blue { background: rgba(7,244,242,0.1); color: #07f4f2; }
.sbm-tab-txt { display: flex; flex-direction: column; text-align: left; min-width: 0; }
.sbm-tab-name { font-size: 14px; font-weight: 500; line-height: 1.3; }
.sbm-tab-sub { font-size: 12px; color: #71717a; line-height: 1.3; }
.sbm-tool-right { display: flex; align-items: center; gap: 8px; flex: none; }
.sbm-op {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 6px;
  background: transparent; border: none; color: #d4d4d8; font-size: 13px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.sbm-op:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sbm-op-grad { background: linear-gradient(to right bottom, #07f4f2, #c1fab8); color: #0a0a0a; font-weight: 500; }
.sbm-op-grad:hover { background: linear-gradient(to right bottom, #20f8f6, #cdfcba); color: #0a0a0a; }
.sbm-op-ep { font-size: 12px; opacity: .75; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 工作区 13fr/7fr */
.sbm-workspace {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 13fr 7fr; gap: 16px;
  padding: 14px 16px 16px; overflow: hidden;
}
.sbm-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow-y: auto; padding: 2px; }
.sbm-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow-y: auto; padding: 2px; }
.sbm-pane { display: flex; flex-direction: column; gap: 14px; }

/* 卡片 */
.sbm-card { border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sbm-settings-card { padding: 16px; border-radius: 16px; gap: 14px; }
.sbm-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sbm-card-label { font-size: 14px; font-weight: 600; color: #e4e4e7; }
.sbm-card-hint { font-size: 12px; color: #71717a; }
.sbm-card-hint b { color: #07f4f2; }

/* 提示词编辑器 */
.sbm-ed-card { position: relative; }
.sbm-editor {
  display: block; width: 100%; min-height: 560px; max-height: 720px; overflow-y: auto;
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03);
  padding: 284px 20px 56px; font-size: 16px; line-height: 28px; color: #e4e4e7; outline: none;
  resize: none; font-family: inherit; word-break: break-word;
}
.sbm-editor:focus { border-color: rgba(7,244,242,0.4); }
.sbm-editor::placeholder { color: #52525b; }
.sbm-wand {
  position: absolute; bottom: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: #a1a1aa; border: none; cursor: pointer; transition: all .15s;
}

/* 参考媒体区（半透明悬浮层，固定在编辑器顶部，三行垂直排列） */
.sbm-vid-refs {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 5;
  display: flex; flex-direction: column; gap: 8px;
  padding: 6px;
  background: rgba(10,10,10,0.5); backdrop-filter: blur(6px);
  border-radius: 12px;
}
.sbm-vid-group { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px; width: 100%; }
.sbm-vid-card {
  flex: 0 0 140px;
  display: flex; flex-direction: column; justify-content: space-between;
  height: 80px; border-radius: 16px; border: 1px solid #3f3f46;
  background: rgba(24,24,27,0.85); padding: 8px 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.sbm-vid-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sbm-vid-label { font-size: 12px; font-weight: 500; color: #e4e4e7; }
.sbm-vid-count { font-size: 11px; color: #71717a; }
.sbm-vid-card-btns { display: flex; align-items: center; gap: 8px; }
.sbm-vid-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 32px; border-radius: 12px; padding: 0 8px; font-size: 12px; font-weight: 500;
  color: #d4d4d8; background: transparent; border: none; cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.sbm-vid-btn:hover { background: #27272a; color: #fff; }
.sbm-vid-btn svg { margin-right: 2px; }
.sbm-vid-upload-wrap { display: inline-block; position: relative; }
.sbm-vid-hidden { display: none; }
.sbm-vid-thumbs { display: flex; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden; padding-bottom: 2px; }
.sbm-vid-thumbs::-webkit-scrollbar { height: 6px; }
.sbm-vid-thumbs::-webkit-scrollbar-track { background: transparent; }
.sbm-vid-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.sbm-vid-empty {
  display: flex; align-items: center; justify-content: center;
  width: 80px; height: 80px; border-radius: 16px;
  border: 1px dashed #3f3f46; background: rgba(24,24,27,0.6); color: #71717a;
}
.sbm-vid-thumb {
  position: relative; width: 80px; height: 80px; border-radius: 12px; overflow: hidden;
  border: 1px solid #3f3f46; background: #18181b;
}
.sbm-vid-thumb video { width: 100%; height: 100%; object-fit: cover; }
.sbm-vid-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sbm-vid-aud { display: flex; align-items: center; justify-content: center; color: #71717a; }
.sbm-vid-thumb-mask {
  position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 4px; background: linear-gradient(135deg, transparent 60%, rgba(0,0,0,0.5));
  opacity: 0; transition: opacity .15s;
}
.sbm-vid-thumb:hover .sbm-vid-thumb-mask { opacity: 1; }
.sbm-vid-x {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.7);
  color: #d4d4d8; border: none; cursor: pointer;
}
.sbm-vid-x:hover { background: #ef4444; color: #fff; }

/* 素材库选择对话框（对齐源：标签页 + 多选 + 确认） */
.sbm-mat-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 16px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sbm-mat-tab {
  padding: 8px 14px; font-size: 13px; color: #a1a1aa; background: transparent;
  border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all .15s;
  border-radius: 6px 6px 0 0;
}
.sbm-mat-tab:hover { color: #e4e4e7; }
.sbm-mat-tab.active { color: #07f4f2; border-bottom-color: #07f4f2; }
.sbm-mat-tab-cnt { font-size: 11px; color: #52525b; margin-left: 2px; }
.sbm-mat-tab.active .sbm-mat-tab-cnt { color: rgba(7,244,242,0.6); }
.sbm-mat-pane { padding: 12px 16px; max-height: 400px; overflow-y: auto; }
.sbm-mat-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sbm-mat-item {
  position: relative; width: 88px; height: 88px; border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; background: #18181b; cursor: pointer; padding: 0;
  transition: border-color .15s;
}
.sbm-mat-item img { width: 100%; height: 100%; object-fit: cover; }
.sbm-mat-item.sel { border-color: #07f4f2; }
.sbm-mat-name {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 2px 4px; font-size: 10px;
  color: #e4e4e7; background: linear-gradient(transparent, rgba(0,0,0,0.8));
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sbm-mat-check {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border-radius: 50%; background: #07f4f2; color: #0a0a0a;
  display: none; align-items: center; justify-content: center;
}
.sbm-mat-item.sel .sbm-mat-check { display: flex; }
.sbm-mat-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.08);
}
.sbm-mat-count { font-size: 13px; color: #a1a1aa; margin-right: auto; }
.sbm-mat-cancel, .sbm-mat-ok {
  padding: 7px 16px; font-size: 13px; border-radius: 8px; cursor: pointer; border: none;
  transition: all .15s;
}
.sbm-mat-cancel { background: rgba(255,255,255,0.08); color: #d4d4d8; }
.sbm-mat-cancel:hover { background: rgba(255,255,255,0.12); }
.sbm-mat-ok { background: linear-gradient(135deg, #07f4f2, #0a8d80); color: #0a0a0a; font-weight: 600; }
.sbm-mat-ok:hover { opacity: 0.9; }
.sbm-wand:hover { background: rgba(24,24,27,0.9); color: #fff; }

/* 设置字段 */
.sbm-frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sbm-fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sbm-fld.full { grid-column: 1 / -1; }
.sbm-fld-label { font-size: 12px; color: #a1a1aa; }
.sbm-ratio-wrap { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.sbm-seed {
  width: 100%; height: 48px; padding: 0 12px; border-radius: 16px; outline: none;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1); color: #f4f4f5; font-size: 14px;
}
.sbm-seed:focus { border-color: rgba(7,244,242,0.4); }

/* 下拉 */
.sbm-dd { position: relative; }
.sbm-dd-trig {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 48px; padding: 0 12px;
  border-radius: 16px; background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1);
  color: #f4f4f5; font-size: 14px; cursor: pointer; transition: all .15s; text-align: left;
}
.sbm-dd-trig:hover { border-color: rgba(255,255,255,0.2); }
.sbm-dd-trig > svg:first-child { flex: none; color: #a1a1aa; }
.sbm-dd-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbm-dd-chev { flex: none; color: #71717a; transition: transform .15s; }
.sbm-dd.open .sbm-dd-chev { transform: rotate(180deg); }
.sbm-dd-clear {
  flex: none; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); color: #a1a1aa; border: none; cursor: pointer;
}
.sbm-dd-clear:hover { background: rgba(239,68,68,0.2); color: #f87171; }
.sbm-dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  max-height: 260px; overflow-y: auto; padding: 6px; border-radius: 12px;
  background: rgba(18,18,18,0.98); border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  display: none;
}
.sbm-dd.open .sbm-dd-menu { display: block; }
.sbm-dd-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border-radius: 10px;
  background: transparent; border: none; color: #e4e4e7; font-size: 13px; cursor: pointer; text-align: left;
}
.sbm-dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbm-dd-sub { flex: none; font-size: 12px; color: #94a3b8; }
.sbm-dd-item:hover, .sbm-dd-item.sel { background: rgba(255,255,255,0.08); color: #fff; }

/* 分段按钮（对齐参考源：内嵌页签，激活为渐变深色字） */
.sbm-seg { display: flex; gap: 6px; }
.sbm-seg button {
  flex: 1; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1);
  background: transparent; color: #a1a1aa; font-size: 13px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.sbm-seg button:hover { color: #e4e4e7; border-color: rgba(255,255,255,0.2); }
.sbm-seg button:disabled { opacity: .35; cursor: not-allowed; color: #71717a; border-color: rgba(255,255,255,0.06); }
.sbm-seg button:disabled:hover { color: #71717a; border-color: rgba(255,255,255,0.06); }
.sbm-seg button.active { background: linear-gradient(135deg, #07f4f2, #c1fab8); border: none; color: #0a0a0a; font-weight: 600; }

/* 比例按钮 */
.sbm-ratio {
  flex: none; width: 58px; height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.35);
  color: #a1a1aa; font-size: 11px; cursor: pointer; transition: all .15s;
}
.sbm-ratio:hover { color: #e4e4e7; border-color: rgba(255,255,255,0.2); }
.sbm-ratio.active { background: linear-gradient(135deg, #07f4f2, #c1fab8); border: none; color: #0a0a0a; font-weight: 600; }
.sbm-ratio-ico { border: 1px solid currentColor; border-radius: 2px; opacity: 0.8; }

/* 生成按钮（对齐参考源：右对齐，自适应宽度） */
.sbm-gen-row { display: flex; justify-content: flex-end; }
.sbm-gen-btn {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px;
  border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(to right bottom, #07f4f2, #c1fab8); color: #0a0a0a; font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 16px -4px rgba(7,244,242,0.35); transition: all .15s;
}
.sbm-gen-btn:hover { opacity: 0.9; box-shadow: 0 6px 20px -4px rgba(7,244,242,0.5); }
.sbm-gen-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sbm-cost { font-weight: 700; }

/* 台词 */
.sbm-dlg-input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; outline: none;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1); color: #f4f4f5; font-size: 14px;
}
.sbm-dlg-input:focus { border-color: rgba(7,244,242,0.4); box-shadow: 0 0 0 3px rgba(7,244,242,0.1); }
.sbm-dlg-input::placeholder { color: #52525b; }

/* @提及 */
.sbm-mention { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 3px; background: rgba(59,130,246,0.2); border-radius: 6px; color: #93c5fd; font-size: 13px; vertical-align: middle; }
.sbm-mention img { width: 14px; height: 14px; border-radius: 4px; object-fit: cover; }
.sbm-mention b { font-weight: 500; }
.sbm-mention-pop {
  position: fixed; z-index: 1000; min-width: 260px; max-width: 320px; max-height: 320px; overflow-y: auto;
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.12); background: #18181b;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); padding: 6px; display: none;
}
.sbm-mention-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; background: transparent; border: none; color: #e4e4e7; font-size: 13px; cursor: pointer; text-align: left; }
.sbm-mention-item:hover, .sbm-mention-item.hover { background: rgba(7,244,242,0.1); }
.sbm-mention-item img, .sbm-mention-ph { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; flex: none; }
.sbm-mention-ph { display: flex; align-items: center; justify-content: center; background: rgba(7,244,242,0.15); color: #07f4f2; font-size: 12px; }
.sbm-mention-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbm-mention-type { font-size: 11px; color: #71717a; flex: none; }

/* 元素引用工具条 */
.sbm-mention-bar { display: flex; align-items: center; gap: 10px; padding: 8px 4px 2px; }
.sbm-mention-add {
  display: inline-flex; align-items: center; gap: 5px; flex: none; height: 28px; padding: 0 10px;
  border-radius: 14px; border: 1px solid rgba(7,244,242,0.35); background: rgba(7,244,242,0.1);
  color: #07f4f2; font-size: 12px; cursor: pointer;
}
.sbm-mention-add:hover { background: rgba(7,244,242,0.2); }
.sbm-mention-strip { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; flex: 1; align-items: center; }
.sbm-mention-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 240px; height: 26px; padding: 0 6px 0 3px;
  border-radius: 13px; background: rgba(59,130,246,0.18); border: 1px solid rgba(59,130,246,0.3);
  color: #93c5fd; font-size: 12px;
}
.sbm-mention-chip img, .sbm-mention-chip .sbm-mention-ph { width: 20px; height: 20px; border-radius: 10px; object-fit: cover; flex: none; }
.sbm-mention-chip .sbm-mention-ph { display: flex; align-items: center; justify-content: center; background: rgba(7,244,242,0.15); color: #07f4f2; font-size: 11px; }
.sbm-mention-chip b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbm-mention-chip .sbm-mention-tag { font-style: normal; font-size: 10px; color: #71717a; }
.sbm-mention-chip em { font-style: normal; font-size: 11px; color: #60a5fa; flex: none; }
.sbm-mention-x {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex: none;
  border: none; border-radius: 50%; background: transparent; color: #9ca3af; font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
}
.sbm-mention-x:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* 右列面板 */
.sbm-panel { border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); padding: 0; display: flex; flex-direction: column; gap: 0; overflow: hidden; }
.sbm-panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sbm-panel-title { display: flex; align-items: center; gap: 6px; color: #07f4f2; font-size: 16px; flex: none; }
.sbm-panel-cur { font-size: 12px; color: #71717a; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbm-refresh { width: 58px; height: 32px; padding: 0; justify-content: center; border-radius: 12px; display: flex; align-items: center; gap: 4px; color: #a1a1aa; background: transparent; border: none; cursor: pointer; font-size: 12px; }
.sbm-refresh:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sbm-nodata { padding: 28px 18px; border: 1px dashed rgba(255,255,255,0.12); border-radius: 10px; text-align: center; font-size: 12px; color: #52525b; width: 100%; }
.sbm-rec-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 44px 16px; color: #71717a; font-size: 12px; text-align: center; }
.sbm-rec-empty p { margin: 0; }

/* 视频记录（对齐参考源：grid-cols-3，hover 右上角播放/删除 + 中央取消遮罩） */
.sbm-vidgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px; }
.sbm-vid2 { position: relative; aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.3); }
.sbm-vid2.used { box-shadow: 0 0 0 2px rgba(7,244,242,0.4); }
.sbm-vid2 video { width: 100%; height: 100%; object-fit: cover; }
.sbm-vid2-badge {
  position: absolute; left: 6px; top: 6px; z-index: 20; width: 42px; height: 19px;
  display: flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 10px;
  background: linear-gradient(to right bottom, #07f4f2, #c1fab8); color: #0a0a0a; font-weight: 600;
}
.sbm-vid2-acts { position: absolute; inset: 0; z-index: 10; opacity: 0; transition: opacity .2s; }
.sbm-vid2:hover .sbm-vid2-acts { opacity: 1; }
.sbm-vid2-top { position: absolute; top: 6px; right: 6px; z-index: 30; display: flex; gap: 6px; }
.sbm-vid2-act { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; transition: all .15s; }
.sbm-vid2-act.play { background: rgba(0,0,0,0.5); color: #fff; }
.sbm-vid2-act.play:hover { background: rgba(0,0,0,0.75); }
.sbm-vid2-act.del { background: rgba(239,68,68,0.7); color: #fff; }
.sbm-vid2-act.del:hover { background: rgba(239,68,68,0.95); }
.sbm-vid2-mask { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.55); }
.sbm-vid2-cancel { height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(239,68,68,0.85); color: #fff; font-size: 12px; border: none; cursor: pointer; transition: background .15s; }
.sbm-vid2-cancel:hover { background: #ef4444; }

/* 延长视频：参考视频区（对齐参考源：浅绿提示条 + 计数 + 选择/上传） */
.sbm-ext-top { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(193,250,184,0.1); }
.sbm-ext-head { display: flex; align-items: center; gap: 8px; }
.sbm-ext-tip { flex: 1; min-width: 0; font-size: 12px; color: #a1a1aa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbm-ext-count { font-size: 12px; color: #71717a; flex: none; }
.sbm-ext-thumbs .sbm-ref-thumbs { margin-top: 0; }

/* 参考视频选择弹窗 */
.sbm-vid-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0 10px; }
.sbm-vid-pick-item { aspect-ratio: 9/16; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); background: #000; cursor: pointer; padding: 0; position: relative; }
.sbm-vid-pick-item:hover { border-color: rgba(7,244,242,0.5); }
.sbm-vid-pick-item.sel { border-color: #07f4f2; box-shadow: 0 0 0 2px rgba(7,244,242,0.45); }
.sbm-vid-pick-item.sel:after { content: '✓'; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: #07f4f2; color: #0a0a0a; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sbm-vid-pick-item video { width: 100%; height: 100%; object-fit: cover; }

/* 分镜图创作 */
.sbm-img-card { position: relative; border-radius: 28px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); overflow: hidden; }
.sbm-img-top { position: absolute; left: 0; right: 0; top: 0; z-index: 10; background: rgba(18,18,18,0.95); padding: 20px 20px 8px; }
.sbm-ref-badge { display: flex; align-items: center; gap: 8px; }
.sbm-ref-title { font-size: 12px; font-weight: 500; color: #e4e4e7; }
.sbm-ref-count { color: #71717a; font-size: 11px; font-weight: 400; }
.sbm-ref-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 58px; height: 32px; padding: 0 12px; border-radius: 12px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: #d4d4d8; font-size: 12px; cursor: pointer; transition: all .15s;
}
.sbm-ref-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.sbm-ref-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sbm-ref-thumb { position: relative; width: 78px; height: 78px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); flex: none; }
.sbm-ref-thumb img, .sbm-ref-thumb video { width: 100%; height: 100%; object-fit: cover; }
.sbm-ref-thumb-mask { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); opacity: 0; transition: opacity .2s; }
.sbm-ref-thumb:hover .sbm-ref-thumb-mask { opacity: 1; }
.sbm-ref-x {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(239,68,68,0.2); color: #fff; border: none; cursor: pointer;
}
.sbm-ref-x:hover { background: rgba(239,68,68,0.5); }
.sbm-img-textarea {
  width: 100%; min-height: 440px; padding: 128px 20px 112px; resize: none; outline: none; border-radius: 12px;
  background: transparent; border: none; color: #f4f4f5; font-size: 16px; line-height: 1.8; font-family: inherit;
}
.sbm-img-textarea::placeholder { color: #52525b; }
.sbm-img-bar { display: flex; align-items: center; gap: 12px; padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.sbm-img-bar .sbm-fld { flex: 1; min-width: 0; }
.sbm-img-bar .sbm-fld:first-child { flex: 1.4; }
.sbm-img-bar .sbm-gen-btn { flex: none; padding: 0 24px; font-size: 16px; }

/* 生成记录（对齐参考源：grid-cols-3） */
.sbm-img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; }
.sbm-img2 { aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); background: #000; }
.sbm-img2 img { width: 100%; height: 100%; object-fit: cover; }

/* 参考图选择弹窗 */
.sbm-frame-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0 10px; }
.sbm-frame-pick-item { aspect-ratio: 9/16; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); background: #000; cursor: pointer; padding: 0; }
.sbm-frame-pick-item:hover { border-color: rgba(7,244,242,0.5); }
.sbm-frame-pick-item img { width: 100%; height: 100%; object-fit: cover; }

/* 空态 */
.sbm-empty { padding: 32px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sbm-empty-title { font-size: 14px; color: #e4e4e7; }
.sbm-empty-sub { font-size: 12px; color: #71717a; line-height: 1.6; }
.sbm-empty-btn { margin-top: 6px; padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; background: linear-gradient(135deg, #07f4f2, #c1fab8); color: #0a0a0a; font-size: 13px; font-weight: 500; }
.sbm-loading { padding: 24px; text-align: center; font-size: 12px; color: #71717a; }

/* 添加/编辑弹窗 */
.sbm-dlg { display: flex; flex-direction: column; gap: 14px; padding: 2px 0; max-height: 70vh; overflow-y: auto; }

/* ---------- 风格选择对话框（对齐参考源：分类 tab + 卡片网格） ---------- */
.stp-mask { position: fixed; inset: 0; z-index: 9999; background: rgba(2, 8, 23, 0.72); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.stp-box { width: 896px; max-width: 96vw; height: 694px; max-height: 88vh; background: rgba(18,18,18,0.95); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,0.5); display: flex; flex-direction: column; overflow: hidden; }
.stp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.stp-title b { font-size: 16px; color: #f8fafc; }
.stp-title p { margin-top: 4px; font-size: 12px; color: rgba(248,250,252,0.5); }
.stp-close { width: 28px; height: 28px; border-radius: 8px; border: none; background: rgba(255,255,255,0.06); color: rgba(248,250,252,0.7); font-size: 18px; line-height: 1; cursor: pointer; }
.stp-close:hover { background: rgba(255,255,255,0.14); color: #f8fafc; }
.stp-tabs { display: flex; gap: 8px; padding: 12px 22px; overflow-x: auto; border-bottom: 1px solid rgba(255,255,255,0.08); }
.stp-tab { flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12); background: transparent; color: rgba(248,250,252,0.6); font-size: 12px; cursor: pointer; white-space: nowrap; }
.stp-tab:hover { border-color: rgba(7,244,242,0.5); color: #f8fafc; }
.stp-tab.active { background: linear-gradient(135deg, #07f4f2, #c1fab8); border-color: transparent; color: #0a0a0a; font-weight: 600; }
.stp-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: min-content; gap: 16px; padding: 18px 22px 22px; align-content: start; }
.stp-card { display: flex; flex-direction: column; gap: 8px; padding: 0 0 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); cursor: pointer; overflow: hidden; }
.stp-card:hover { border-color: rgba(7,244,242,0.45); background: rgba(255,255,255,0.06); }
.stp-card.sel { border-color: #07f4f2; box-shadow: 0 0 0 1px #07f4f2; }
.stp-thumb { aspect-ratio: 4/3; min-height: 100px; background: linear-gradient(135deg, rgba(7,244,242,0.28), rgba(193,250,184,0.18), rgba(124,58,237,0.22)); position: relative; }
.stp-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.stp-card:nth-child(3n+1) .stp-thumb { background: linear-gradient(135deg, rgba(7,244,242,0.30), rgba(59,130,246,0.22)); }
.stp-card:nth-child(3n+2) .stp-thumb { background: linear-gradient(135deg, rgba(193,250,184,0.26), rgba(7,244,242,0.20)); }
.stp-card:nth-child(3n+3) .stp-thumb { background: linear-gradient(135deg, rgba(124,58,237,0.30), rgba(7,244,242,0.16)); }
.stp-name { padding: 0 10px; font-size: 12px; color: rgba(248,250,252,0.82); text-align: center; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stp-foot { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid rgba(255,255,255,0.08); }
.stp-count { flex: 1; font-size: 14px; color: #a1a1aa; }
.stp-cancel { height: 38px; padding: 0 20px; border-radius: 9999px; background: transparent; border: 1px solid rgba(255,255,255,0.15); color: #d4d4d8; font-size: 13px; cursor: pointer; transition: all .15s; }
.stp-cancel:hover { background: rgba(255,255,255,0.06); color: #fff; }
.stp-ok { height: 38px; padding: 0 24px; border-radius: 9999px; border: none; background: linear-gradient(to right bottom, #07f4f2, #c1fab8); color: #0a0a0a; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 16px -4px rgba(7,244,242,0.35); }
.stp-ok:hover { opacity: 0.9; }

/* ---------- AI 剧本分析弹窗（对齐参考源：模型选择 + 分析开关 + 覆盖子项） ---------- */
.ana-sub { font-size: 12px; font-weight: 400; color: rgba(248,250,252,0.5); }
.ana-desc { font-size: 13px; color: rgba(248,250,252,0.55); margin-bottom: 4px; }
.ana-warn { margin: 10px 0; padding: 8px 12px; border-radius: 8px; font-size: 12px; color: #fbbf24; background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.18); }
.ana-block { border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); border-radius: 12px; padding: 12px; margin-top: 12px; }
.ana-block-head { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.ana-cb { width: 16px; height: 16px; margin-top: 2px; accent-color: #07f4f2; cursor: pointer; }
.ana-cb-sm { width: 13px; height: 13px; accent-color: #07f4f2; cursor: pointer; }
.ana-info b { font-size: 13px; color: #f8fafc; }
.ana-info p { margin-top: 3px; font-size: 12px; color: rgba(248,250,252,0.5); }
.ana-subrow { margin: 10px 0 0 26px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.08); }
.ana-sub-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #d4d4d8; cursor: pointer; }
.ana-sub-line:has(.ana-cb-sm:disabled) { opacity: 0.45; cursor: not-allowed; }
.ana-tip { margin-top: 4px; font-size: 11px; color: rgba(248,250,252,0.4); }
.ana-prompt { margin: 10px 0 0 26px; }
.ana-prompt-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ana-prompt-row b { font-size: 12px; color: #d4d4d8; font-weight: 600; }
.ana-include { margin-top: 14px; font-size: 12px; color: rgba(248,250,252,0.6); }
.ana-include ul { margin: 6px 0 0 18px; display: flex; flex-direction: column; gap: 3px; list-style: disc; }
.ana-include li { font-size: 12px; color: rgba(248,250,252,0.5); }
.ana-foot { margin-top: 16px; }
.ana-go { height: 36px; padding: 0 22px; border: none; border-radius: 9999px; font-size: 13px; font-weight: 600; color: #0a0a0a; cursor: pointer; background: linear-gradient(135deg, #07f4f2, #c1fab8); box-shadow: 0 2px 12px -2px rgba(7,244,242,0.45); }
.ana-go:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ============ 全局任务悬浮窗 ============ */
.task-float { position: fixed; top: 64px; right: 10px; width: 10vw; height: 30vh; min-width: 170px; min-height: 130px; display: flex; flex-direction: column; background: #fff; border: 1px solid #e3e8f0; border-radius: 10px; box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14); z-index: 9999; overflow: hidden; font-size: 13px; --tf-running: #dc2626; --tf-done: #15803d; --tf-failed: #dc2626; opacity: 0.7; transition: opacity 0.2s; }
.task-float:hover { opacity: 1; }
.task-float-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: #f6f8fb; border-bottom: 1px solid #eef1f6; cursor: move; user-select: none; }
.task-float-title { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #1f2937; }
.tf-pulse { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); animation: tf-pulse 1.4s infinite; }
@keyframes tf-pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); } 70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.task-float-close { border: 0; background: none; color: #9ca3af; font-size: 14px; line-height: 1; padding: 2px 5px; cursor: pointer; border-radius: 4px; }
.task-float-close:hover { color: #ef4444; background: #fee2e2; }
.task-float-list { flex: 1; overflow-y: auto; padding: 6px 10px 8px; }
.task-float-item { display: flex; align-items: center; gap: 7px; padding: 4px 0; border-bottom: 1px dashed #f1f3f7; font-size: 12.5px; }
.task-float-item:last-child { border-bottom: 0; }
.task-float-item .tf-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.task-float-item .tf-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-float-item .tf-state { flex: none; font-size: 12px; }
.task-float-item.tf-running { color: var(--tf-running); }
.task-float-item.tf-running .tf-dot { background: var(--tf-running); }
.task-float-item.tf-done { color: var(--tf-done); }
.task-float-item.tf-done .tf-dot { background: var(--tf-done); }
.task-float-item.tf-failed { color: var(--tf-failed); }
.task-float-item.tf-failed .tf-dot { background: var(--tf-failed); }
.tf-empty { padding: 18px 0; text-align: center; color: #c0c8d4; font-size: 12px; }
.task-float-toggle { position: fixed; top: 64px; right: 10px; z-index: 9999; display: none; align-items: center; gap: 6px; padding: 7px 12px; background: #fff; border: 1px solid #e3e8f0; border-radius: 999px; box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12); font-size: 12.5px; color: #374151; cursor: pointer; }
.task-float-toggle:hover { border-color: #07f4f2; }


