/* ============================================================
   DramaForge · 暗色电影质感 UI
   ============================================================ */
:root {
  --bg: #07080d;
  --bg-2: #0c0e16;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f6;
  --text-2: #9aa1b5;
  --text-3: #5d6478;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --amber: #fbbf24;
  --green: #34d399;
  --red: #fb7185;
  --grad: linear-gradient(120deg, #8b5cf6, #6366f1 45%, #22d3ee);
  --grad-soft: linear-gradient(120deg, rgba(139,92,246,.18), rgba(34,211,238,.12));
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.4); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }

/* ---------------- 背景氛围 ---------------- */
.bg-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(ellipse 90% 60% at 50% -10%, #131527 0%, var(--bg) 60%); }
.orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .35; animation: drift 26s ease-in-out infinite alternate; }
.orb-a { width: 560px; height: 560px; background: #4c1d95; top: -220px; left: -120px; }
.orb-b { width: 480px; height: 480px; background: #0e7490; bottom: -200px; right: -100px; animation-delay: -8s; }
.orb-c { width: 320px; height: 320px; background: #312e81; top: 40%; left: 55%; opacity: .25; animation-delay: -16s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(70px, 50px) scale(1.15); }
}
.grain {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- 通用组件 ---------------- */
.icon { width: 18px; height: 18px; flex-shrink: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text);
  font-family: var(--font); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all .18s ease; white-space: nowrap; user-select: none;
}
.btn:hover { background: rgba(255,255,255,.09); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn .icon { width: 15px; height: 15px; }

.btn-primary {
  background: var(--grad); border: none; color: #fff; font-weight: 600;
  box-shadow: 0 4px 24px rgba(124, 92, 246, 0.4);
}
.btn-primary:hover { background: var(--grad); filter: brightness(1.12); box-shadow: 0 6px 32px rgba(124, 92, 246, 0.55); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--panel-2); border-color: transparent; }

.btn-danger:hover { border-color: rgba(251,113,133,.5); color: var(--red); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }

.card {
  /* 不用 backdrop-filter:几十张卡片同时模糊会拖垮 GPU,造成全页卡顿 */
  background: rgba(22, 24, 35, 0.55); border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em;
  padding: 3px 10px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2);
}
.tag.violet { color: #c4b5fd; border-color: rgba(139,92,246,.35); background: rgba(139,92,246,.12); }
.tag.cyan { color: #67e8f9; border-color: rgba(34,211,238,.3); background: rgba(34,211,238,.1); }
.tag.green { color: #6ee7b7; border-color: rgba(52,211,153,.3); background: rgba(52,211,153,.1); }
.tag.amber { color: #fcd34d; border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.1); }
.tag.red { color: #fda4af; border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.1); }

input:not([type]), input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; padding: 10px 13px;
  background: rgba(0,0,0,.28); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 13.5px; line-height: 1.65;
  transition: border-color .15s, box-shadow .15s; resize: vertical;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: rgba(139,92,246,.6);
  box-shadow: 0 0 0 3px rgba(139,92,246,.15);
}
textarea { min-height: 66px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239aa1b5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
select option { background: #14161f; }

label.field { display: block; }
label.field > span {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--text-3);
  letter-spacing: .08em; margin-bottom: 6px; text-transform: uppercase;
}

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18); border-top-color: var(--accent-2);
  animation: spin .7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Toast ---------------- */
#toasts { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 13px; font-size: 13.5px; max-width: 380px;
  background: rgba(18, 20, 30, 0.92); border: 1px solid var(--border-strong);
  backdrop-filter: blur(20px); box-shadow: var(--shadow);
  animation: toast-in .28s cubic-bezier(.21,1.02,.73,1);
}
.toast.success { border-color: rgba(52,211,153,.4); }
.toast.success .icon { color: var(--green); }
.toast.error { border-color: rgba(251,113,133,.4); }
.toast.error .icon { color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } }
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

/* ============================================================
   首页
   ============================================================ */
.home { max-width: 1080px; margin: 0 auto; padding: 0 28px 80px; }

.home-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 20px 0; }
.logo { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 17px; letter-spacing: .02em; flex-shrink: 0; }
/* 右侧操作区:整体靠右,空间不够时整齐换行到下一行(不挤压、不重叠) */
.nav-actions {
  margin-left: auto; display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; row-gap: 10px; flex-wrap: wrap;
}
.nav-actions .tag {
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.nav-actions .online-badge { flex-shrink: 0; }
.nav-actions .btn-sm { white-space: nowrap; }
@media (max-width: 720px) {
  .nav-actions { width: 100%; justify-content: flex-start; }
  .nav-actions .tag { max-width: 100%; }
}
/* 会员头像chip(顶栏入口,点开会员中心) */
.member-chip {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 5px 12px 5px 5px; border-radius: 999px; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--border); color: var(--text-1);
  transition: border-color .15s, transform .15s, box-shadow .15s; font: inherit;
}
.member-chip:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.member-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.member-avatar.staff { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.member-avatar.active { background: linear-gradient(135deg, #22c55e, #06b6d4); }
.member-avatar.inactive { background: linear-gradient(135deg, #fb7185, #f59e0b); }
.member-chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.member-chip-text b { font-size: 13px; font-weight: 650; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.member-chip-text small { font-size: 11px; color: var(--text-3); }

/* 会员中心弹窗 */
.mc-profile { display: flex; align-items: center; gap: 14px; padding: 4px 2px 16px; }
.mc-avatar {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 24px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.mc-avatar.staff { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.mc-avatar.active { background: linear-gradient(135deg, #22c55e, #06b6d4); }
.mc-avatar.inactive { background: linear-gradient(135deg, #fb7185, #f59e0b); }
.mc-profile-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mc-profile-info b { font-size: 18px; font-weight: 700; }
.mc-profile-info small { font-size: 12px; color: var(--text-3); }
.mc-role { align-self: flex-start; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: rgba(124,92,246,.16); color: var(--accent2); }
.mc-role-active { background: rgba(34,197,94,.15); color: #22c55e; }
.mc-role-inactive { background: rgba(251,113,133,.15); color: var(--red); }
.mc-buy { width: 100%; justify-content: center; margin-bottom: 14px; }
.mc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mc-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 16px 8px; border-radius: 14px; cursor: pointer; font: inherit; text-align: center;
  background: var(--panel); border: 1px solid var(--border); color: var(--text-1);
  transition: border-color .15s, transform .15s, background .15s;
}
.mc-tile:hover { border-color: var(--accent); transform: translateY(-2px); background: rgba(124,92,246,.06); }
.mc-tile-ic { font-size: 20px; line-height: 1; display: grid; place-items: center; height: 24px; }
.mc-tile-ic .icon { width: 20px; height: 20px; color: var(--accent2); }
.mc-tile-label { font-size: 13px; font-weight: 600; }
.mc-tile-sub { font-size: 10.5px; color: var(--text-3); }
@media (max-width: 480px) { .mc-grid { grid-template-columns: repeat(2, 1fr); } }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; font-size: 17px;
  box-shadow: 0 4px 18px rgba(124,92,246,.45);
}
.logo small { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-3); letter-spacing: .14em; }

.hero { text-align: center; padding: 64px 0 44px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: #c4b5fd; padding: 6px 16px; border-radius: 99px;
  border: 1px solid rgba(139,92,246,.35); background: rgba(139,92,246,.1);
  margin-bottom: 18px;
}
.hero-badge .icon { width: 13px; height: 13px; }

/* 「无限使用」爆炸感徽章 —— 首页钩子主张,独立一行居中 */
.ub-row { display: block; text-align: center; margin-bottom: 24px; }
.unlimited-burst {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 9px 26px; border-radius: 99px;
  font-size: 15px; font-weight: 800; letter-spacing: .02em; line-height: 1;
  color: #fff; position: relative; isolation: isolate;
  background: linear-gradient(100deg, #ff7a18 0%, #ff2d7e 42%, #b14bff 100%);
  box-shadow: 0 8px 28px rgba(255,45,126,.45), 0 0 0 1px rgba(255,255,255,.18) inset, 0 0 44px rgba(177,75,255,.35);
  animation: ub-pop .55s cubic-bezier(.2,1.4,.45,1) both, ub-breathe 2.6s ease-in-out 1.2s infinite;
}
.unlimited-burst::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: inherit; filter: blur(14px); opacity: .55;
}
.unlimited-burst .ub-text {
  background: linear-gradient(180deg, #fff, #ffe9c2);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.unlimited-burst .ub-spark {
  font-size: 13px; color: #fff6cf; text-shadow: 0 0 10px rgba(255,225,120,.9);
  animation: ub-twinkle 1.4s ease-in-out infinite;
}
.unlimited-burst .ub-spark.ub-r { animation-delay: .7s; }
@keyframes ub-pop { from { opacity: 0; transform: scale(.6); } }
@keyframes ub-breathe { 0%,100% { box-shadow: 0 8px 28px rgba(255,45,126,.45), 0 0 0 1px rgba(255,255,255,.18) inset, 0 0 44px rgba(177,75,255,.35); } 50% { box-shadow: 0 10px 34px rgba(255,45,126,.62), 0 0 0 1px rgba(255,255,255,.22) inset, 0 0 64px rgba(177,75,255,.55); } }
@keyframes ub-twinkle { 0%,100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .unlimited-burst, .unlimited-burst .ub-spark { animation: none; } }
.hero h1 {
  font-size: clamp(34px, 5.2vw, 54px); font-weight: 800; line-height: 1.18; letter-spacing: -0.01em;
}
.hero h1 .grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--text-2); font-size: 15.5px; margin-top: 16px; line-height: 1.8; }

.idea-box {
  max-width: 720px; margin: 40px auto 0; position: relative;
  border-radius: 20px; padding: 1.5px; background: linear-gradient(120deg, rgba(139,92,246,.55), rgba(99,102,241,.25), rgba(34,211,238,.45));
  box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 80px rgba(124,92,246,.12);
}
.idea-inner {
  display: flex; gap: 10px; align-items: center;
  background: #0d0f18; border-radius: 19px; padding: 10px 10px 10px 22px;
}
.idea-inner input {
  flex: 1; background: none; border: none; box-shadow: none; padding: 12px 0;
  font-size: 16px; color: var(--text);
}
.idea-inner input:focus { box-shadow: none; }
.idea-inner .btn-primary { padding: 13px 26px; font-size: 14.5px; border-radius: 14px; }

.examples { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 18px; }
.example-chip {
  font-size: 12.5px; color: var(--text-2); padding: 7px 15px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--panel); cursor: pointer;
  transition: all .16s;
}
.example-chip:hover { color: var(--text); border-color: rgba(139,92,246,.5); background: rgba(139,92,246,.1); transform: translateY(-1px); }

/* 上传剧本 / 会员资源库 入口 */
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.hero-actions .btn.active { color: var(--text); border-color: rgba(139,92,246,.6); background: rgba(139,92,246,.14); }
.script-panel {
  max-width: 760px; margin: 12px auto 0; padding: 14px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--panel);
}
.script-panel textarea {
  width: 100%; min-height: 170px; resize: vertical; box-sizing: border-box;
  font-size: 13px; line-height: 1.7; color: var(--text);
  background: rgba(0,0,0,.25); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
}
.script-panel textarea:focus { outline: none; border-color: rgba(139,92,246,.5); }
.script-panel-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.script-panel-foot .btn-sm { padding: 7px 13px; font-size: 12.5px; }
.script-panel .btn label, label.btn { cursor: pointer; }

/* 会员资源库弹窗 */
.lib-tabs { display: flex; gap: 8px; padding: 4px 20px 0; }
.lib-tab {
  font-size: 13px; color: var(--text-2); padding: 7px 14px; border-radius: 10px 10px 0 0;
  cursor: pointer; border: 1px solid transparent; border-bottom: none;
}
.lib-tab.active { color: var(--text); background: var(--panel-2); border-color: var(--border); }
.lib-hint { font-size: 12px; color: var(--text-3); padding: 8px 20px 0; margin: 0; }
.lib-empty { text-align: center; color: var(--text-3); padding: 50px 20px; font-size: 13px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.lib-card {
  position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--panel); cursor: pointer; transition: all .15s;
}
.lib-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #000; }
.lib-card-name { font-size: 12px; color: var(--text); padding: 7px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-card:hover { border-color: rgba(139,92,246,.5); transform: translateY(-2px); }
.lib-card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139,92,246,.4); }
.lib-card .lib-check { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center; }
.lib-card.sel .lib-check { display: flex; }
.lib-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 8px; border: none;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.lib-card:hover .lib-del { opacity: 1; }

.flow-strip {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
  margin: 44px auto 0; padding: 16px 22px; max-width: 880px;
  border-radius: 14px; border: 1px dashed rgba(255,255,255,.1);
  color: var(--text-3); font-size: 12px;
}
.flow-strip b { color: var(--text-2); font-weight: 600; }
.flow-strip .sep { color: rgba(139,92,246,.7); margin: 0 2px; }

/* ---------------- 风格选择 ---------------- */
.style-section {
  max-width: 880px; margin: 38px auto 0; text-align: left;
  padding: 20px 22px 22px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border); backdrop-filter: blur(16px);
}
.style-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.style-section-head h3 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.style-section-head h3 .icon { color: var(--accent); width: 16px; height: 16px; }
.style-picked-name { font-size: 12.5px; color: #c4b5fd; font-weight: 600; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cat-chip {
  font-size: 12px; color: var(--text-2); padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--border); background: transparent; cursor: pointer; transition: all .15s;
  user-select: none;
}
.cat-chip:hover { color: var(--text); border-color: var(--border-strong); }
.cat-chip.active { color: #fff; background: var(--grad); border-color: transparent; font-weight: 600; }

.style-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px;
  max-height: 340px; overflow-y: auto; padding: 2px;
}
.style-card { cursor: pointer; user-select: none; }
.style-thumb {
  position: relative; aspect-ratio: 1; border-radius: 13px; overflow: hidden;
  border: 2px solid var(--border); transition: all .16s; background: var(--panel-2);
}
.style-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.style-card:hover .style-thumb { border-color: var(--border-strong); }
.style-card:hover .style-thumb img { transform: scale(1.06); }
.style-card.selected .style-thumb {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,.25), 0 6px 22px rgba(139,92,246,.3);
}
.auto-thumb {
  display: grid; place-items: center; font-size: 30px;
  background: var(--grad-soft);
}
.style-badge {
  position: absolute; top: 6px; left: 6px; font-size: 9.5px; font-weight: 800; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 6px; color: #fff;
  background: linear-gradient(120deg, #f43f5e, #fb923c); box-shadow: 0 2px 8px rgba(244,63,94,.4);
}
.style-check {
  position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); display: none; place-items: center; color: #fff;
  box-shadow: 0 2px 10px rgba(124,92,246,.5);
}
.style-check .icon { width: 12px; height: 12px; }
.style-card.selected .style-check { display: grid; }
.style-name { font-size: 12px; font-weight: 650; margin-top: 7px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.style-sub { font-size: 10.5px; color: var(--text-3); text-align: center; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal-wide { width: min(860px, calc(100vw - 40px)); }
.modal-wide .style-grid { max-height: 52vh; }

/* 画幅切换 */
.ratio-seg {
  display: inline-flex; gap: 3px; padding: 3px;
  border-radius: 11px; background: rgba(0,0,0,.3); border: 1px solid var(--border);
}
.ratio-opt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: all .15s; user-select: none;
}
.ratio-opt .icon { width: 13px; height: 13px; }
.ratio-opt:hover { color: var(--text); }
.ratio-opt.active { color: #fff; background: var(--grad); box-shadow: 0 2px 10px rgba(124,92,246,.35); }
.ratio-opt.disabled { opacity: .45; cursor: not-allowed; }
.ratio-seg.sm .ratio-opt { padding: 5px 11px; font-size: 11.5px; }

/* 分步模式开关 */
.step-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  padding: 7px 13px; border-radius: 10px; cursor: pointer; user-select: none;
  border: 1px solid var(--border); background: var(--panel-2); transition: all .15s;
}
.step-toggle .icon { width: 12px; height: 12px; }
.step-toggle .st-state { font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.1); }
.step-toggle.on { color: #c4b5fd; border-color: rgba(139,92,246,.45); background: rgba(139,92,246,.1); }
.step-toggle.on .st-state { background: var(--grad); color: #fff; }

/* 镜头素材绑定行 */
.bind-row {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-3); margin-bottom: 12px;
}

/* 工作台当前风格卡 */
.style-current { display: flex; align-items: center; gap: 18px; padding: 16px 18px; margin-bottom: 16px; flex-wrap: wrap; }
.style-current .sc-thumb {
  width: 84px; height: 84px; border-radius: 14px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border-strong); font-size: 30px;
}
.style-current .sc-info { flex: 1; min-width: 220px; }
.style-current .sc-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.style-current .sc-title b { font-size: 15.5px; font-weight: 700; }
.style-current .sc-sub { font-size: 12px; color: var(--text-3); }
.style-current .sc-info p { font-size: 12.5px; color: var(--text-2); line-height: 1.65; margin-top: 7px; }
.style-current .ep-tags { margin-top: 9px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 52px 0 18px; }
.section-title.compact { margin: 18px 0 10px; }
.section-title h2 { font-size: 18px; font-weight: 700; }
.section-title .count { color: var(--text-3); font-size: 13px; margin-left: 10px; font-weight: 500; }
.section-title .section-hint { color: var(--text-3); font-size: 12.5px; font-weight: 500; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

/* 示例作品:更紧凑的灵感画廊,弱化为次要内容,与「我的项目」形成层级 */
.showcase-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; opacity: .92; }
.showcase-grid .project-cover { height: 116px; }
.showcase-grid .project-card { border-radius: 12px; }
.showcase-grid .project-body { padding: 11px 13px 13px; }
.showcase-grid .project-body h3 { font-size: 13.5px; margin-bottom: 4px; }
.showcase-grid .project-body .idea { font-size: 11.5px; height: 34px; line-height: 1.5; margin-bottom: 9px; }
.showcase-grid .play-overlay { transform: scale(.82); }
.project-card {
  overflow: hidden; cursor: pointer; transition: all .2s ease; position: relative;
}
.project-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.project-cover {
  height: 150px; background: var(--grad-soft); position: relative;
  display: grid; place-items: center; overflow: hidden;
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-cover .placeholder { font-size: 38px; opacity: .5; }
.project-body { padding: 16px 18px 18px; }
.project-body h3 { font-size: 15px; font-weight: 650; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-body .idea { font-size: 12.5px; color: var(--text-2); line-height: 1.6; height: 40px; overflow: hidden; margin-bottom: 13px; }
.project-meta { display: flex; align-items: center; justify-content: space-between; }
.progress-track { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); margin-right: 12px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--grad); transition: width .4s ease; }
.project-meta .pct { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.project-del {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
  border-radius: 9px; display: grid; place-items: center;
  background: rgba(0,0,0,.5); border: 1px solid var(--border); color: var(--text-2);
  opacity: 0; transition: all .15s; cursor: pointer; backdrop-filter: blur(8px);
}
.project-card:hover .project-del { opacity: 1; }
.project-del:hover { color: var(--red); border-color: rgba(251,113,133,.5); }
.project-del .icon { width: 14px; height: 14px; }
.project-continue {
  position: absolute; top: 10px; right: 48px; width: 30px; height: 30px;
  border-radius: 9px; display: grid; place-items: center;
  background: rgba(0,0,0,.5); border: 1px solid var(--border); color: var(--text-2);
  opacity: 0; transition: all .15s; cursor: pointer; backdrop-filter: blur(8px);
}
.project-card:hover .project-continue { opacity: 1; }
.project-continue:hover { color: var(--accent2); border-color: var(--accent); }
.project-continue .icon { width: 15px; height: 15px; }
.season-modes { display: flex; flex-direction: column; gap: 10px; }
.season-mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s; }
.season-mode:has(input:checked) { border-color: var(--accent); background: rgba(124,77,255,.06); }
.season-mode input { margin-top: 3px; }
.season-mode b { display: block; font-size: 13.5px; color: var(--text); }
.season-mode span { display: block; font-size: 12px; color: var(--text-3); margin-top: 3px; }
.empty-hint { color: var(--text-3); text-align: center; padding: 44px 0; font-size: 14px; border: 1px dashed var(--border); border-radius: var(--radius); }

/* ============================================================
   工作台
   ============================================================ */
.workspace { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 22px; border-bottom: 1px solid var(--border);
  background: rgba(10, 11, 18, 0.75); backdrop-filter: blur(20px); z-index: 10;
}
.topbar .title-wrap { flex: 1; min-width: 0; }
.topbar input.title-input {
  background: transparent; border: 1px solid transparent; font-size: 16px; font-weight: 700;
  padding: 6px 10px; border-radius: 9px; width: 100%; max-width: 420px;
}
.topbar input.title-input:hover { border-color: var(--border); }
.topbar .subtitle { font-size: 11.5px; color: var(--text-3); padding: 0 10px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px; }
.run-progress { display: flex; align-items: center; gap: 10px; margin-right: 4px; }
.run-progress .bar { width: 130px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.run-progress .fill { height: 100%; background: var(--grad); border-radius: 3px; transition: width .5s ease; }
.run-progress span { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.ws-main { flex: 1; display: flex; min-height: 0; }

/* 步骤导航 */
.stepper {
  width: 248px; flex-shrink: 0; overflow-y: auto;
  padding: 18px 14px; border-right: 1px solid var(--border);
  background: rgba(8, 9, 14, 0.55);
}
.step {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px; cursor: pointer;
  transition: background .15s; margin-bottom: 2px;
  border: 1px solid transparent;
}
.step:hover { background: var(--panel-2); }
.step.active { background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.3); }
.step-dot {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-3);
  transition: all .2s;
}
.step-dot .icon { width: 15px; height: 15px; }
.step.done .step-dot { background: rgba(52,211,153,.13); border-color: rgba(52,211,153,.4); color: var(--green); }
.step.running .step-dot { background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.45); color: var(--accent-2); box-shadow: 0 0 16px rgba(34,211,238,.25); }
.step.error .step-dot { background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.45); color: var(--red); }
.step.stale .step-dot { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.35); color: var(--amber); }
.step-info { min-width: 0; flex: 1; }
.step-info .name { font-size: 13.5px; font-weight: 600; }
.step-info .status { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.step.running .status { color: var(--accent-2); }
.step.error .status { color: var(--red); }
.step.stale .status { color: var(--amber); }
.step-num { font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 内容区 */
.stage-panel { flex: 1; overflow-y: auto; padding: 26px 32px 100px; min-width: 0; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.stage-head h2 { font-size: 21px; font-weight: 750; display: flex; align-items: center; gap: 11px; }
.stage-head h2 .icon { width: 21px; height: 21px; color: var(--accent); }
.stage-head .desc { color: var(--text-3); font-size: 12.5px; margin-top: 5px; }
.stage-actions { display: flex; gap: 9px; }

.empty-stage {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 70px 20px; text-align: center; color: var(--text-3);
  border: 1.5px dashed rgba(255,255,255,.1); border-radius: var(--radius);
}
.empty-stage .big-icon { width: 52px; height: 52px; opacity: .35; }
.empty-stage p { font-size: 14px; line-height: 1.7; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 13px; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.block { padding: 20px; margin-bottom: 16px; }
.block-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.block-title h3 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 9px; }

/* 角色/场景卡片(紧凑) */
.entity-card { padding: 13px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.entity-del {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px;
  border-radius: 7px; display: grid; place-items: center;
  background: transparent; border: none; color: var(--text-3); cursor: pointer;
  opacity: 0; transition: all .15s;
}
.entity-card:hover .entity-del { opacity: 1; }
.entity-del:hover { color: var(--red); background: rgba(251,113,133,.1); }
.entity-del .icon { width: 12px; height: 12px; }
.entity-card textarea { font-size: 12px; padding: 8px 10px; min-height: 48px; }
.entity-card label.field > span { margin-bottom: 4px; }
.entity-head { display: flex; align-items: center; gap: 11px; }
.entity-avatar {
  width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: var(--grad-soft); display: grid; place-items: center;
  border: 1px solid var(--border); font-size: 18px;
}
.entity-avatar img { width: 100%; height: 100%; object-fit: cover; }
.entity-head input { font-size: 15px; font-weight: 650; background: transparent; border-color: transparent; padding: 4px 8px; }
.entity-head input:hover { border-color: var(--border); }

/* 分集 */
.episode-row {
  display: flex; gap: 15px; padding: 17px 19px; margin-bottom: 11px;
  cursor: pointer; transition: all .16s; align-items: flex-start;
}
.episode-row:hover { border-color: var(--border-strong); }
.episode-row.selected { border-color: rgba(139,92,246,.55); background: rgba(139,92,246,.07); box-shadow: 0 0 24px rgba(139,92,246,.1); }
.ep-no {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2);
}
.episode-row.selected .ep-no { background: var(--grad); color: #fff; border: none; }
.ep-body { flex: 1; min-width: 0; }
.ep-body h4 { font-size: 14.5px; font-weight: 650; margin-bottom: 5px; }
.ep-body p { font-size: 12.8px; color: var(--text-2); line-height: 1.65; }
.ep-tags { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }

/* 分镜 */
.shot-card { padding: 19px; margin-bottom: 15px; }
.shot-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.shot-no {
  width: 38px; height: 38px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
  box-shadow: 0 4px 14px rgba(124,92,246,.35);
}
.shot-title { font-weight: 650; font-size: 14.5px; flex: 1; }
.duration-pill { display: flex; align-items: center; gap: 7px; }
.duration-pill input { width: 58px; text-align: center; padding: 6px; }
.dlg-row { display: grid; grid-template-columns: 120px 110px 1fr 32px; gap: 8px; margin-bottom: 8px; align-items: center; }
.dlg-del { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: transparent; border: none; color: var(--text-3); cursor: pointer; }
.dlg-del:hover { color: var(--red); }
.dlg-del .icon { width: 14px; height: 14px; }
.timeline {
  display: flex; gap: 5px; height: 38px; margin-bottom: 22px;
  border-radius: 11px; overflow: hidden;
}
.timeline .tl-seg {
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, rgba(139,92,246,.75), rgba(99,102,241,.65));
  border-radius: 9px; min-width: 50px; letter-spacing: .03em;
}
.timeline .tl-seg:nth-child(2n) { background: linear-gradient(120deg, rgba(34,211,238,.6), rgba(99,102,241,.6)); }

/* 参考图(紧凑) */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.ref-card { overflow: hidden; }
.ref-img { aspect-ratio: 4/3; background: rgba(0,0,0,.35); position: relative; display: grid; place-items: center; }
.ref-img img { width: 100%; height: 100%; object-fit: cover; }
.ref-img .placeholder { color: var(--text-3); font-size: 12px; }
.ref-img .regen-btn {
  position: absolute; top: 7px; right: 7px; opacity: 0; transition: opacity .15s;
  background: rgba(0,0,0,.6); backdrop-filter: blur(8px); padding: 4px 9px; font-size: 11px;
}
.ref-card:hover .regen-btn { opacity: 1; }
.ref-body { padding: 9px 11px 11px; }
.ref-body h4 { font-size: 12.5px; font-weight: 650; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ref-body textarea { font-size: 11px; min-height: 40px; color: var(--text-2); padding: 7px 9px; }

/* 视频生成 */
.video-shot { padding: 19px; margin-bottom: 15px; }
.video-status-row { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; flex-wrap: wrap; }
.video-frame {
  border-radius: 13px; overflow: hidden; background: #000;
  border: 1px solid var(--border); max-width: 560px;
}
.video-frame video { width: 100%; display: block; }
.gen-shimmer {
  height: 130px; border-radius: 13px; max-width: 560px;
  background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(139,92,246,.14) 50%, rgba(255,255,255,.04) 70%);
  background-size: 200% 100%; animation: shimmer 1.6s linear infinite;
  display: grid; place-items: center; color: var(--text-3); font-size: 12.5px;
  border: 1px dashed rgba(139,92,246,.3);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* 成片 */
.final-stage { max-width: 860px; }
.final-player {
  border-radius: 18px; overflow: hidden; background: #000;
  border: 1px solid var(--border-strong); box-shadow: var(--shadow), 0 0 90px rgba(124,92,246,.14);
}
.final-player video { width: 100%; display: block; }
.final-stats { display: flex; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.stat-chip { padding: 13px 20px; text-align: center; flex: 1; min-width: 110px; }
.stat-chip b { display: block; font-size: 19px; font-weight: 750; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-chip span { font-size: 11px; color: var(--text-3); letter-spacing: .08em; }

/* 日志抽屉 */
.log-drawer {
  border-top: 1px solid var(--border); background: rgba(7, 8, 13, 0.9);
  backdrop-filter: blur(18px); flex-shrink: 0; z-index: 9;
  transition: height .25s ease; overflow: hidden;
}
.log-drawer.closed { height: 40px; }
.log-drawer.open { height: 230px; }
.log-head {
  display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 40px;
  cursor: pointer; user-select: none; font-size: 12px; color: var(--text-2); font-weight: 600;
}
.log-head .icon { width: 14px; height: 14px; color: var(--accent-2); }
.log-head .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-left: auto; animation: pulse 1.6s ease infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.log-body { height: calc(100% - 40px); overflow-y: auto; padding: 4px 18px 14px; font-family: var(--mono); font-size: 11.8px; line-height: 1.85; }
.log-line { display: flex; gap: 12px; }
.log-line .t { color: var(--text-3); flex-shrink: 0; }
.log-line.info .m { color: var(--text-2); }
.log-line.success .m { color: var(--green); }
.log-line.error .m { color: var(--red); }

/* ---------------- 设置弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(4, 5, 9, 0.7); backdrop-filter: blur(8px);
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: min(720px, calc(100vw - 40px)); max-height: 86vh; overflow-y: auto;
  background: #0e1019; border: 1px solid var(--border-strong);
  border-radius: 20px; box-shadow: var(--shadow);
  animation: modal-in .25s cubic-bezier(.21,1.02,.73,1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 26px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #0e1019; z-index: 2;
}
.modal-head h2 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modal-head h2 .icon { color: var(--accent); }
.modal-body { padding: 22px 26px 28px; }
.provider-block { padding: 18px; margin-bottom: 15px; }
.provider-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.provider-head h3 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 9px; }
.provider-head h3 .icon { color: var(--accent-2); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.admin-user-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* 会员管理 —— 紧凑两段式:信息占满整行(标签/并发信息不再被挤换行),操作按钮收窄成一排小按钮置于下方 */
.member-row { display: flex; flex-direction: column; align-items: stretch; gap: 7px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel); margin-bottom: 6px; }
.member-main { min-width: 0; }
.member-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; color: var(--text); }
.member-name .tag { padding: 1px 7px; font-size: 10.5px; }
.member-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.member-acts { display: flex; gap: 5px; flex-wrap: wrap; }
.member-acts .btn-sm { padding: 4px 9px; font-size: 11.5px; line-height: 1.5; }

/* 登录弹窗 */
.login-modal { overflow: hidden; }
.login-brand { text-align: center; padding: 28px 20px 8px; background: linear-gradient(180deg, rgba(139,92,246,.16), transparent); }
.login-logo { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; font-size: 30px;
  display: flex; align-items: center; justify-content: center; background: var(--grad, linear-gradient(135deg,#8b5cf6,#22d3ee)); }
.login-title { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: .5px; }
.login-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.login-tabs { display: flex; gap: 6px; background: rgba(0,0,0,.25); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.login-tab { flex: 1; text-align: center; padding: 8px; font-size: 13.5px; color: var(--text-2); border-radius: 8px; cursor: pointer; transition: all .15s; }
.login-tab.active { background: var(--panel-2); color: var(--text); font-weight: 600; }
.login-field input { width: 100%; box-sizing: border-box; }
.login-submit { width: 100%; justify-content: center; margin-top: 18px; font-size: 15px; padding: 11px; letter-spacing: 2px; }
.login-err { color: var(--red); font-size: 12px; margin-top: 10px; display: none; text-align: center; }
.login-admin { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.login-admin #admin-toggle { font-size: 12px; color: var(--text-3); cursor: pointer; }
.login-admin #admin-toggle:hover { color: var(--text-2); }
.login-admin input { width: 100%; box-sizing: border-box; }
.admin-code-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 14px; margin-bottom: 10px;
}
.mono-code { font-family: var(--mono); letter-spacing: .08em; font-size: 14px; }
.muted-line { color: var(--text-3); font-size: 11.5px; line-height: 1.6; margin-top: 3px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.test-result { font-size: 12px; margin-top: 10px; padding: 9px 13px; border-radius: 9px; display: none; }
.test-result.ok { display: block; color: var(--green); background: rgba(52,211,153,.08); border: 1px solid rgba(52,211,153,.25); }
.test-result.fail { display: block; color: var(--red); background: rgba(251,113,133,.08); border: 1px solid rgba(251,113,133,.25); }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 18px; border-radius: var(--radius); margin-bottom: 15px;
  background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.25);
}
.switch-row .sw-info b { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.switch-row .sw-info p { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.6; }
.switch {
  position: relative; width: 46px; height: 26px; border-radius: 99px; flex-shrink: 0;
  background: rgba(255,255,255,.12); cursor: pointer; transition: background .2s;
  border: 1px solid var(--border);
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: transform .2s;
}
.switch.on { background: var(--grad); border-color: transparent; }
.switch.on::after { transform: translateX(20px); }

.mock-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 12.5px; color: #fcd34d;
  background: rgba(251,191,36,.08); border-bottom: 1px solid rgba(251,191,36,.2);
}
.mock-banner .icon { width: 14px; height: 14px; }
.mock-banner a { color: #fde68a; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- 分组步进器 ---------------- */
.step-group-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--text-3);
  padding: 14px 12px 8px; text-transform: uppercase;
}
.step-group-label .icon { width: 13px; height: 13px; color: var(--accent); }
.step-group-label.ep { border-top: 1px solid var(--border); margin-top: 10px; flex-wrap: wrap; }
.ep-select {
  flex: 1; min-width: 0; font-size: 11.5px; padding: 5px 24px 5px 9px; border-radius: 8px;
}

/* 分集制作行 */
.ep-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.ep-side .duration-pill { display: flex; align-items: center; gap: 6px; }
.ep-side .duration-pill input { width: 60px; text-align: center; padding: 5px; }

/* ---------------- 媒体预览(大图 / 视频弹窗) ---------------- */
.media-mask {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  background: rgba(3, 4, 8, 0.88); backdrop-filter: blur(10px);
  animation: fade-in .18s ease;
}
.media-box {
  max-width: min(92vw, 1100px); max-height: 92vh; display: flex; flex-direction: column;
  animation: modal-in .22s cubic-bezier(.21,1.02,.73,1);
}
.media-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 4px 10px; color: var(--text-2); font-size: 13px; font-weight: 600;
}
.media-box img, .media-box video {
  max-width: min(92vw, 1100px); max-height: 82vh; object-fit: contain;
  border-radius: 14px; border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), 0 0 90px rgba(124,92,246,.15); background: #000;
}
.video-expired {
  max-width: min(92vw, 520px); padding: 28px 24px; text-align: center;
  color: var(--text-2); font-size: 14px; line-height: 1.7;
  border-radius: 14px; border: 1px solid var(--border-strong); background: var(--panel);
}
.version-badge {
  position: fixed; right: 12px; bottom: 8px; z-index: 50;
  font-size: 11px; color: var(--text-3); opacity: .55;
  pointer-events: none; user-select: none; letter-spacing: .3px;
}
.contact-badge {
  position: fixed; right: 16px; bottom: 34px; z-index: 60;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--panel); border: 1px solid var(--accent);
  box-shadow: 0 4px 18px rgba(0,0,0,.25); backdrop-filter: blur(8px);
  cursor: pointer; transition: transform .15s, border-color .15s;
}
.contact-badge svg { width: 15px; height: 15px; }
.contact-badge:hover { border-color: var(--accent2); transform: translateY(-1px); }
.contact-badge:active { transform: translateY(0); }
.ref-stats { display: flex; gap: 10px; margin-top: 16px; }
.ref-stat { flex: 1; text-align: center; padding: 12px 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.ref-num { font-size: 18px; font-weight: 700; color: var(--accent2); }
.ref-lbl { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.member-search {
  width: 100%; margin: 4px 0 10px; padding: 9px 12px; box-sizing: border-box;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 13px;
}
.member-search:focus { border-color: var(--accent); outline: none; }
.member-scroll { max-height: 600px; overflow-y: auto; padding-right: 4px; }
/* 阶段前置未完成提示(防跳步) */
.prereq-note {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 12px 16px; border-radius: 12px;
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.35);
  color: var(--amber); font-size: 13.5px; font-weight: 600;
}
.prereq-note .btn { margin-left: auto; }
/* 弹窗内长列表(队列/会员/激活码):固定高度,内部滚动,不撑大弹窗。带独立的细滚动条(小滑块) */
.panel-scroll {
  max-height: 360px; overflow-y: auto; padding-right: 6px;
  border: 1px solid var(--border); border-radius: 12px; padding: 8px 8px 8px 10px;
  background: rgba(255,255,255,.015);
}
.panel-scroll::-webkit-scrollbar { width: 6px; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border: none; border-radius: 4px; }
.panel-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.3); }
.panel-scroll { scrollbar-width: thin; }
[data-theme="light"] .panel-scroll { background: rgba(0,0,0,.015); }
[data-theme="light"] .panel-scroll::-webkit-scrollbar-thumb { background: rgba(28,33,58,.22); }
.source-compare { display: flex; gap: 14px; }
.source-col { flex: 1; min-width: 0; }
.source-col h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.source-col pre {
  white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.7;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; max-height: 60vh; overflow-y: auto; margin: 0; color: var(--text); font-family: inherit;
}
@media (max-width: 700px) { .source-compare { flex-direction: column; } }
.online-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.online-badge .online-num { color: var(--accent2); font-size: 14px; }
.online-badge .online-sep { color: var(--text-3); opacity: .55; margin: 0 1px; }
.online-badge .online-queue { color: var(--text-2); }
.online-badge .queue-num { color: var(--amber); font-size: 14px; }
.update-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--accent); color: #fff; text-align: center;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.update-banner button {
  margin-left: 10px; background: rgba(255,255,255,.25); color: #fff;
  border: none; padding: 4px 14px; border-radius: 6px; cursor: pointer; font-weight: 700;
}
.update-banner button:hover { background: rgba(255,255,255,.4); }
.online-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #2ecc71;
  animation: onlinePulse 2s infinite;
}
@keyframes onlinePulse {
  0% { box-shadow: 0 0 0 0 rgba(46,204,113,.5); }
  70% { box-shadow: 0 0 0 6px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}
.queue-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
}
.queue-user { font-weight: 600; min-width: 86px; color: var(--text); }
.queue-stats { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.qtag {
  font-size: 12px; padding: 3px 9px; border-radius: 8px;
  background: rgba(255,255,255,.04); color: var(--text-3); border: 1px solid var(--border);
}
.qtag.on { color: var(--text); border-color: var(--accent); }
.qtag-proj { color: var(--accent2); }
.btn-danger { background: rgba(239,68,68,.15); color: #ef6868; border: 1px solid rgba(239,68,68,.4); }
.btn-danger:hover { background: rgba(239,68,68,.28); }
.entity-avatar[data-preview-img], .ref-img[data-preview-img] { cursor: zoom-in; }

/* ---------------- 视频缩略图(紧凑) ---------------- */
.shots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.video-shot { padding: 13px; margin-bottom: 0; }
.video-shot .shot-no { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
.video-shot .shot-title { font-size: 12.5px; }
.video-thumb {
  position: relative; border-radius: 11px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); background: #000; aspect-ratio: 16/10; max-height: 170px;
}
.video-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.25); transition: background .15s;
}
.play-overlay .icon {
  width: 44px; height: 44px; color: #fff; padding: 13px; box-sizing: content-box;
  background: rgba(124,92,246,.85); border-radius: 50%;
  box-shadow: 0 6px 24px rgba(0,0,0,.5); transition: transform .15s;
}
.video-thumb:hover .play-overlay { background: rgba(0,0,0,.1); }
.video-thumb:hover .play-overlay .icon { transform: scale(1.08); }

/* 成片展示(紧凑) */
.ep-result-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ep-result-player {
  position: relative; border-radius: 13px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border-strong); background: #000;
  width: 300px; aspect-ratio: 16/9; flex-shrink: 0;
  box-shadow: 0 10px 36px rgba(0,0,0,.45);
}
.ep-result-player.portrait { width: 180px; aspect-ratio: 9/16; }
.ep-result-player video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-result-info h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.ep-result-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.ep-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.ep-mini {
  position: relative; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); background: #000; aspect-ratio: 16/10;
  transition: all .15s;
}
.ep-mini:hover { border-color: rgba(139,92,246,.5); transform: translateY(-1px); }
.ep-mini video { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; }
.ep-mini-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  padding: 14px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.85));
}
.ep-mini-label .icon { width: 10px; height: 10px; }
.ep-mini.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-style: dashed; background: transparent; cursor: default;
  color: var(--text-3); font-size: 12px; font-weight: 600;
}
.ep-mini.empty small { font-size: 10px; font-weight: 400; }

/* 收尾 */
.fade-in { animation: stage-in .3s ease; }
@keyframes stage-in { from { opacity: 0; transform: translateY(8px); } }

/* 镜头片段操作行 */
.clip-actions { display: flex; gap: 4px; margin-top: 7px; flex-wrap: wrap; }
.clip-actions .btn { padding: 4px 9px; font-size: 11px; }

/* ============================================================
   亮色主题 data-theme="light":翻转 CSS 变量 + 覆盖写死的白/黑/深底。
   纯增量,不影响暗色;切换由 app.js 在 <html> 上设 data-theme 控制。
   ============================================================ */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #ffffff;
  --panel: rgba(28, 33, 58, 0.04);
  --panel-2: rgba(28, 33, 58, 0.065);
  --border: rgba(28, 33, 58, 0.12);
  --border-strong: rgba(28, 33, 58, 0.2);
  --text: #1b1f2e;
  --text-2: #565d75;
  --text-3: #8b91a6;
  --accent: #7c3aed;
  --accent-2: #0891b2;
  --amber: #d97706;
  --green: #059669;
  --red: #e11d48;
  --grad-soft: linear-gradient(120deg, rgba(124,58,237,.12), rgba(8,145,178,.09));
  --shadow: 0 18px 48px rgba(28, 33, 58, 0.14);
}
[data-theme="light"] ::selection { background: rgba(124,58,237,.22); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(28,33,58,.2); border-color: var(--bg); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(28,33,58,.34); }
[data-theme="light"] .bg-fx { background: radial-gradient(ellipse 90% 60% at 50% -10%, #e9ecff 0%, var(--bg) 60%); }
[data-theme="light"] .orb { opacity: .2; filter: blur(120px); }
[data-theme="light"] .orb-a { background: #c4b5fd; }
[data-theme="light"] .orb-b { background: #99f6e4; }
[data-theme="light"] .orb-c { background: #ddd6fe; opacity: .16; }
[data-theme="light"] .btn:hover { background: rgba(28,33,58,.05); }
[data-theme="light"] .spinner { border-color: rgba(28,33,58,.16); border-top-color: var(--accent-2); }
[data-theme="light"] select option { background: #fff; color: var(--text); }
[data-theme="light"] .idea-box { background: #fff; border: 1px solid var(--border); }
[data-theme="light"] .flow-strip { border-color: rgba(28,33,58,.14); }
[data-theme="light"] .empty-stage { border-color: rgba(28,33,58,.16); }
[data-theme="light"] .step-toggle .st-state { background: rgba(28,33,58,.08); }
[data-theme="light"] .progress-track,
[data-theme="light"] .run-progress .bar { background: rgba(28,33,58,.1); }
[data-theme="light"] .switch { background: rgba(28,33,58,.2); }
[data-theme="light"] .modal,
[data-theme="light"] .modal-head { background: #ffffff; }
[data-theme="light"] .modal-mask { background: rgba(40, 44, 72, 0.42); }
/* 媒体容器:亮色下黑底改浅灰,避免大块黑洞;图片/视频仍清晰 */
[data-theme="light"] .lib-card img,
[data-theme="light"] .video-frame,
[data-theme="light"] .final-player,
[data-theme="light"] .video-thumb,
[data-theme="light"] .ep-result-player,
[data-theme="light"] .ep-mini { background: #e9ecf4; }
/* 状态标签:亮色下文字改深色保证对比 */
[data-theme="light"] .tag.violet { color: #6d28d9; border-color: rgba(124,58,237,.28); background: rgba(124,58,237,.1); }
[data-theme="light"] .tag.cyan { color: #0e7490; border-color: rgba(8,145,178,.28); background: rgba(8,145,178,.1); }
[data-theme="light"] .tag.green { color: #047857; border-color: rgba(5,150,105,.28); background: rgba(5,150,105,.1); }
[data-theme="light"] .tag.amber { color: #b45309; border-color: rgba(217,119,6,.3); background: rgba(217,119,6,.12); }
[data-theme="light"] .tag.red { color: #be123c; border-color: rgba(225,29,72,.3); background: rgba(225,29,72,.1); }
/* 亮色:卡片/输入框/内嵌面(原本是深玻璃 rgba(0,0,0,.x) / rgba(22,24,35,.55))→ 浅色 */
[data-theme="light"] .card { background: rgba(255, 255, 255, 0.72); border-color: var(--border); }
[data-theme="light"] input:not([type]),
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] textarea,
[data-theme="light"] select { background: #ffffff; border-color: var(--border); color: var(--text); }
[data-theme="light"] .script-panel textarea { background: #ffffff; }
[data-theme="light"] .ratio-seg,
[data-theme="light"] .login-tabs { background: rgba(28, 33, 58, 0.06); }
[data-theme="light"] .ref-img { background: #e9ecf4; }
[data-theme="light"] .project-del,
[data-theme="light"] .project-continue { background: rgba(28, 33, 58, 0.55); }
/* 亮色:工作区顶栏 / 阶段侧栏 / 底部日志抽屉(原本深玻璃)→ 浅色 */
[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.82); }
[data-theme="light"] .stepper { background: rgba(255, 255, 255, 0.5); }
[data-theme="light"] .log-drawer { background: rgba(247, 249, 253, 0.96); }
/* 公告横幅(首页示例作品上方) */
.announce-banner {
  max-width: 880px; margin: 40px auto 4px; padding: 14px 24px; border-radius: 14px;
  background: linear-gradient(120deg, #f9b234, #fc4a1a); color: #fff;
  font-size: 14px; font-weight: 600; line-height: 1.65; text-align: center;
  box-shadow: 0 6px 22px rgba(252, 74, 26, 0.32);
}
/* 首页入口按钮:上传剧本(紫)/ 会员资源库(青)—— 醒目、有区分、整体协调。亮暗皆可 */
.entry-btn { padding: 11px 22px; font-size: 14px; font-weight: 700; border-radius: 12px; transition: all .15s; }
.entry-script { color: var(--accent); border: 1.5px solid var(--accent); background: rgba(139, 92, 246, .1); }
.entry-script:hover { background: rgba(139, 92, 246, .18); transform: translateY(-1px); }
.entry-script.on { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 3px 14px rgba(139, 92, 246, .42); }
.entry-library { color: var(--accent-2); border: 1.5px solid var(--accent-2); background: rgba(34, 211, 238, .1); }
.entry-library:hover { background: rgba(34, 211, 238, .18); transform: translateY(-1px); }
/* 公告横幅移到选择题材上方后,收紧外边距 */
.announce-banner { margin: 8px auto 18px; }
/* 亮色:创意输入框内层(原黑底)→ 白,输入透明融入,阴影柔化 */
[data-theme="light"] .idea-inner { background: #ffffff; }
[data-theme="light"] .idea-inner input { background: transparent; }
[data-theme="light"] .idea-box { box-shadow: 0 16px 44px rgba(28, 33, 58, .14), 0 0 60px rgba(124, 58, 237, .08); }

/* 三模型徽章:突出真实模型名,颜色对比好(亮暗皆可) */
.model-badge { gap: 9px; font-size: 12.5px; padding: 8px 20px; flex-wrap: wrap; max-width: 94vw; color: var(--text-2); }
.model-badge > span { color: var(--text); font-weight: 700; white-space: nowrap; }
.model-badge > span i { font-style: normal; font-weight: 600; font-size: 11px; margin-right: 5px; opacity: .9; }
.model-badge .mb-text i { color: #8b5cf6; }
.model-badge .mb-img i { color: #06b6d4; }
.model-badge .mb-vid i { color: #ec4899; }
.model-badge .mb-sep { color: var(--text-3); font-weight: 400; }
