/* VibeOPC · 全局样式（原 HitForge 复刻版）。模块样式写在文件末尾各自的分区里，类名带模块前缀。
   10-25 换品牌：配色照 noctis-cinematic-hero 的墨黑 / 骨白 / 香槟金（出处见 brand/LICENSES.md），紫色系换成同一模板里的冷灰蓝；
   主色上的字用 --on-primary（墨黑），白字在香槟底上看不清。登录页和字标在 brand/brand.css。 */
:root {
  --bg: #07070A;
  --bg-card: #18181B;
  --bg-card-hover: #27272A;
  --bg-input: #1E1E1E;
  --border: #3F3F46;
  --text: #ECE6DA;
  --text-muted: #A1A1AA;
  --text-dim: #71717A;
  --primary: #CFA968;
  --primary-hover: #DDBF86;
  --primary-light: rgba(207, 169, 104, 0.12);
  --on-primary: #07070A;
  --accent: #E3C58F;
  --accent-light: rgba(227, 197, 143, 0.12);
  --gradient-fire: linear-gradient(135deg, #CFA968, #ECE6DA);
  --purple: #5B6B8C;
  --purple-dark: #4C5A78;
  --purple-light: rgba(91, 107, 140, 0.15);
  --blue: #3B82F6;
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.12);
  --warning: #FB923C;
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.12);
  --sidebar-w: 120px;
  --radius: 8px;
  --font: Inter, "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[x-cloak] { display: none !important; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(207, 169, 104, .35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 文字 ---------- */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--mono); }
.t-xs { font-size: 11px; }
.t-sm { font-size: 12px; }
.t-md { font-size: 13px; }
.t-lg { font-size: 15px; }
.t-bold { font-weight: 600; }
.t-orange { color: var(--primary); }
.t-green { color: var(--success); }
.t-red { color: var(--danger); }
.t-purple { color: #9fb0cc; }
.t-yellow { color: var(--accent); }
.t-blue { color: #60a5fa; }
.grad-text { background: var(--gradient-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 布局工具 ---------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.hr { height: 1px; background: var(--border); border: 0; margin: 16px 0; }
.hr-dashed { border: 0; border-top: 1px dashed var(--border); margin: 16px 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text); font: 600 12px/1.4 var(--font);
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--bg-card-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline { background: transparent; }
.btn-outline-orange { border-color: var(--primary); color: var(--primary); }
.btn-outline-orange:hover:not(:disabled) { background: var(--primary-light); }
.btn-purple { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn-purple:hover:not(:disabled) { background: var(--purple-dark); }
.btn-outline-purple { border-color: var(--purple); color: #c3cede; }
.btn-outline-purple:hover:not(:disabled) { background: var(--purple-light); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-ghost { border-color: transparent; }
.btn-sm { padding: 3px 8px; font-size: 11px; border-radius: 6px; }
.btn-xs { padding: 2px 6px; font-size: 10.5px; border-radius: 5px; }
.btn-lg { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-white { background: #fff; color: #09090b; border-color: #fff; }
.btn-icon { width: 22px; height: 22px; padding: 0; border-radius: 5px; font-size: 12px; }
.btn-x { width: 20px; height: 20px; padding: 0; border-radius: 4px; background: rgba(239, 68, 68, .85); border: 0; color: #fff; font-size: 11px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg > button { border: 0; border-radius: 0; background: transparent; color: var(--text-muted); padding: 6px 12px; font: 600 12px var(--font); cursor: pointer; }
.seg > button.on { background: var(--primary); color: var(--on-primary); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); font-size: 11px; font-weight: 600; background: transparent; color: var(--text); cursor: pointer; }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- 表单 ---------- */
.input, .select, .textarea {
  width: 100%; color: var(--text); font-family: var(--font); border: 1px solid var(--border); outline: none;
}
.input { background: transparent; border-radius: 6px; padding: 6px 12px; font-size: 12.8px; height: 32px; }
.select { background: var(--bg-input); border-radius: 6px; padding: 7px 10px; font-size: 13.12px; }
.textarea { background: var(--bg); border-radius: 8px; padding: 8px 12px; font-size: 13.12px; line-height: 1.6; resize: vertical; min-height: 64px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input-sm { height: 26px; font-size: 12px; padding: 4px 8px; }
.select-sm { padding: 4px 8px; font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--primary); margin: 0; }
.field-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; margin-bottom: 12px; }
.form-row > label { font-size: 12px; color: var(--text-muted); padding-top: 7px; }
.switch { position: relative; width: 34px; height: 18px; border-radius: 9px; background: #3f3f46; cursor: pointer; border: 0; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--primary); }
.switch.on::after { left: 18px; }

/* ---------- 卡片、徽章 ---------- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; }
.card-pad { padding: 16px; }
.box { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.box-dashed { border: 1px dashed var(--border); border-radius: 10px; padding: 12px; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; line-height: 1.6; }
.badge-orange { background: rgba(207, 169, 104, .2); color: var(--primary); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-purple { background: rgba(91, 107, 140, .25); color: #c3cede; }
.badge-gray { background: #27272a; color: var(--text-muted); }
.badge-yellow { background: var(--accent-light); color: var(--accent); }
.check-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--success); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.empty { color: var(--text-dim); font-size: 13px; text-align: center; padding: 40px 0; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #000; flex: none; }
.img-ph { display: flex; align-items: center; justify-content: center; background: #000; color: var(--text-dim); }

/* ---------- 弹窗、抽屉、提示 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 30px; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; max-height: calc(100vh - 60px); overflow: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { padding: 8px 22px 22px; }
.modal-x { background: transparent; border: 0; color: var(--text-muted); font-size: 18px; cursor: pointer; line-height: 1; }
.drawer-left { position: fixed; top: 0; left: 0; bottom: 0; width: 455px; background: var(--bg-card); border-right: 1px solid var(--border); z-index: 90; overflow: auto; box-shadow: 10px 0 40px rgba(0,0,0,.5); }
.drawer-right { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; background: var(--bg-card); border-left: 1px solid var(--border); z-index: 90; overflow: auto; box-shadow: -10px 0 40px rgba(0,0,0,.5); transition: transform .2s; }
.toast { position: fixed; bottom: 24px; right: 24px; padding: 10px 18px; background: var(--success); color: #fff; border-radius: 8px; font-size: 0.82rem; font-weight: 500; z-index: 10000; animation: slideUp .3s ease; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.confirm-box { width: 380px; padding: 22px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 380px; padding: 32px; }
.login-card h1 { font-size: 26px; margin: 0 0 4px; }
/* 复刻版独有：登录页「注册 / 登录」切换链接 */
.login-card .link { color: var(--primary); text-decoration: none; }
.login-card .link:hover { color: var(--primary-hover); text-decoration: underline; }

/* ---------- 首页 ---------- */
.home-header { height: 100px; padding: 20px 32px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.home-brand .logo { font-size: 20.8px; font-weight: 700; line-height: 1.6; }
.home-brand .vo-logo { margin: 2px 0 4px; }
.home-brand .sub { font-size: 12px; color: var(--text-muted); }
.home-brand .ver { font-size: 9.6px; color: var(--text-dim); margin-left: 4px; }
.home-nav { display: flex; align-items: center; gap: 10px; }
.user-badge { display: flex; align-items: center; gap: 6px; height: 38px; padding: 4px 12px 4px 4px; border-radius: 20px; background: var(--bg-card); border: 1px solid var(--border); font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #3f3f46; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; flex: none; overflow: hidden; }
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.home-main { padding: 26px 32px 40px; }
.home-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.home-title-row h2 { font-size: 17.6px; font-weight: 600; margin: 0; }
.project-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; }
.project-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; position: relative; transition: border-color .15s, transform .15s; }
.project-card:hover { border-color: #52525b; }
.pc-thumb { height: 100px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.pc-body { padding: 12px; }
.pc-name { font-size: 14px; font-weight: 600; line-height: 1.6; }
.pc-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.pc-spent { color: var(--accent); }   /* 一个剧累计消耗多少积分（团队管理员，10-25） */
.pc-actions { padding: 0 12px 10px; display: flex; gap: 4px; }
.pc-badges { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.pc-badge { font-size: 9.6px; font-weight: 600; padding: 2px 6px; border-radius: 4px; line-height: 1.5; }
.pc-badge.wip { color: var(--primary); background: rgba(207, 169, 104, .2); }
.pc-badge.mode { color: #e6ebf2; background: rgba(91, 107, 140, .55); }
.pc-badge.locale { color: #bbf7d0; background: rgba(34, 197, 94, .25); }
.pc-new { border: 1px dashed var(--border); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-muted); cursor: pointer; min-height: 223px; background: transparent; font-size: 13px; }
.pc-new:hover { border-color: var(--primary); color: var(--primary); }
.pc-new-plus { font-size: 2rem; line-height: 1; margin-bottom: 6px; }
.pc-actions .btn span { display: inline-flex; }
.home-search-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-muted); font-size: .85rem; line-height: 1; }

/* ---------- 工作区 ---------- */
.ws { display: flex; height: 100vh; overflow: hidden; }
.icon-sidebar { width: var(--sidebar-w); flex: none; background: var(--bg-card); border-right: 1px solid var(--border); padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sb-icon { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 8px 10px; border-radius: 8px; border: 0; background: transparent; color: var(--text-muted); font: 400 12px var(--font); cursor: pointer; text-align: left; }
.sb-icon svg { width: 18px; height: 18px; flex: none; }
.sb-icon:hover { background: var(--bg-card-hover); color: var(--text); }
.sb-icon.active { background: var(--primary); color: var(--on-primary); }
.sb-dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); }
.sb-dot.ok { background: var(--success); } .sb-dot.bad { background: var(--danger); } .sb-dot.warn { background: var(--warning); }
/* 导航小圆点：该面板有任务在跑（原站 .sb-badge） */
.sb-badge { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: sbBadgePulse 1.2s ease-in-out infinite; }
@keyframes sbBadgePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.7); } }
/* 底部后台任务条（原站 .bg-tasks-bar）：贴底、从导航右边铺满 */
.bg-tasks-bar { position: fixed; bottom: 0; left: var(--sidebar-w); right: 0; z-index: 900; display: flex; align-items: center; gap: 6px; padding: 6px 16px; font-size: .72rem; color: var(--accent); background: linear-gradient(135deg, rgba(227, 197, 143, .15), rgba(207, 169, 104, .12)); border-top: 1px solid rgba(227, 197, 143, .3); backdrop-filter: blur(12px); animation: bgTaskPulse 2s ease-in-out infinite; }
@keyframes bgTaskPulse { 0%, 100% { opacity: 1; } 50% { opacity: .8; } }
.bg-tasks-bar .spinner { width: 12px; height: 12px; border-width: 2px; flex-shrink: 0; }
.bg-tasks-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-tasks-stop { flex-shrink: 0; font-size: .65rem; padding: 1px 8px; line-height: 1.4; }
/* 已经开始生成、不能终止的任务（10-20 业主）：各处「◼ 停止 / 终止」按钮换成这行灰字，title 里说明会照常完成并扣费 */
.task-locked { flex-shrink: 0; font-size: .72rem; color: var(--text-dim); white-space: nowrap; cursor: help; }
.bg-tasks-bar .task-locked { font-size: .65rem; }
/* 看大图（原站 .lightbox-overlay）：点任意处关闭 */
.lightbox-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .85); cursor: zoom-out; }
.lightbox-overlay img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
/* 全站公告（复刻版独有，index.html / app.js loadNotice）：居中小弹窗，在业务弹窗之上（最高的 9500）、看大图 9999 和提示条 10000 之下；
   手机上左右各留 16px */
.notice-mask { position: fixed; inset: 0; z-index: 9600; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.notice-box { width: 440px; max-width: 100%; max-height: calc(100vh - 32px); overflow: auto; padding: 20px 22px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.notice-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--accent); }
.notice-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.65; color: var(--text); word-break: break-word; }
.notice-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.notice-ok { min-width: 96px; }
/* 已过期的视频（retention.py 清掉了文件）：素材库卡片、镜头右侧视频列表、历史提示词缩略图共用的占位，不挂播放器 */
.video-expired { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 100%; min-height: 60px; padding: 6px; background: var(--bg); color: var(--text-dim); font-size: 12px; line-height: 1.4; text-align: center; cursor: default; }
.video-expired small { font-size: 10.5px; }
.ws-main { flex: 1; min-width: 0; height: 100vh; overflow: auto; position: relative; }
.ws-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); gap: 8px; }

/* 角色/场景/物品通用两栏 */
.char-layout { display: flex; height: 100vh; }
.char-list { width: 250px; flex: none; background: var(--bg-card); border-right: 1px solid var(--border); padding: 8px; overflow-y: auto; }
.char-detail { flex: 1; min-width: 0; padding: 24px 28px; overflow-y: auto; }
.char-list-item { display: flex; align-items: center; gap: 10px; height: 60px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; position: relative; }
.char-list-item:hover { background: var(--bg-card-hover); }
.char-list-item.active { background: var(--primary-light); border-color: var(--primary); }
.cli-name { font-size: 13px; font-weight: 600; }
.cli-sub { font-size: 11px; color: var(--text-muted); }
.list-tools { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; }

/* 中栏面板（剧本信息左侧属性栏等） */
.side-col { width: 240px; flex: none; background: var(--bg-card); border-right: 1px solid var(--border); padding: 18px 16px; overflow-y: auto; height: 100vh; }

/* 全局浮层：失败任务 / 缺失素材 */
.float-panel { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }







