/* 设计变量：中性灰底 + 单一青色强调（数值对齐参考站 liblib.tv 的实测值：
   底 #141414 / 卡 #171717 / 悬浮 rgba(255,255,255,.06) / 描边 rgba(255,255,255,.08) / 强调 #04caf6） */
:root {
  /* 原生控件（下拉弹层 / 滚动条 / 播放器 / 单选框）跟随系统：
     系统深色 → 深色，系统浅色 → 浅色。界面配色本身不跟着变（仍是深色皮肤）。 */
  color-scheme: light dark;
  --bg: #141414;
  --panel: #171717;
  --panel-2: rgba(255, 255, 255, .06);
  --panel-3: #232323;
  --raised: rgba(255, 255, 255, .06);
  --raised-2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .08);
  --line-soft: rgba(255, 255, 255, .05);
  --line-2: rgba(255, 255, 255, .16);
  --text: #f7f7f7;
  --muted: #a8a8a8;
  --muted-2: #6f6f6f;
  --accent: #04caf6;
  --accent-soft: rgba(4, 202, 246, .12);
  --accent-2: #04caf6;
  --accent-grad: #04caf6;
  --light: #f7f7f7;                       /* 主按钮：近白底 + 深色字 */
  --light-ink: #141414;
  --warm: #ffb84d;
  --ok: #35d39a;
  --warn: #ffb84d;
  --err: #ff6b6b;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.2, .7, .3, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

.app { display: flex; height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 208px; flex: 0 0 208px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; padding: 6px 8px 16px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 0; color: var(--muted); font-size: 14px;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.side-foot { margin-top: auto; padding: 10px 8px; font-size: 12px; color: var(--muted); }
.key-state { margin-bottom: 4px; }
.tiny { font-size: 11px; color: var(--muted-2); }

/* 主区 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; flex: 0 0 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.view-title { font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.balance { color: var(--muted); font-size: 13px; }

.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.btn:hover { border-color: var(--line-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #e6e6e6; }
.btn.block { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.notice { margin: 12px 18px 0; padding: 10px 14px; border-radius: 8px; font-size: 13px;
  background: #2a1f12; border: 1px solid #4a3416; color: var(--warn); }
.notice.err { background: #2a1414; border-color: #4a2020; color: var(--err); }
.notice.ok { background: rgba(53, 211, 154, .08); border-color: rgba(53, 211, 154, .28); color: var(--ok); }

.view { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 14px 18px 16px; overflow: auto; }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar label { color: var(--muted); font-size: 13px; }
select, input.search, textarea, .param input, .param select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none;
}
select:focus, input:focus, textarea:focus { border-color: rgba(4, 202, 246, .5); }
.meta { color: var(--muted); font-size: 12px; }

/* 对话（气泡已去掉：用户消息右对齐浅色，AI 纯正文） */
.messages { flex: 1; overflow: auto; padding: 4px 2px 12px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 780px; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; }
.msg.assistant { align-self: flex-start; }
.msg.err { align-self: stretch; color: var(--err); }
.msg .who { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.composer { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.composer textarea { flex: 1; resize: none; max-height: 180px; }
.empty { color: var(--muted-2); font-size: 13px; padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

/* 图片/视频 */
.work { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 14px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-height: 88px; }
.panel-head { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.field { display: block; margin-bottom: 10px; }
.field > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.field textarea { width: 100%; }
.params { display: flex; flex-direction: column; gap: 10px; }
.param { display: flex; flex-direction: column; gap: 5px; }
.param > label { color: var(--muted); font-size: 12px; }
.param .req { color: var(--err); margin-left: 3px; }
.param .hint { color: var(--muted-2); font-size: 11px; }
.param .choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
  padding: 5px 10px; border-radius: 7px; font-size: 12px; cursor: pointer; }
.choice.on { border-color: var(--accent); color: #fff; background: var(--accent-soft); }
.results { display: flex; flex-wrap: wrap; gap: 10px; }
.results img, .results video { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); display: block; }
.results .card { max-width: 420px; }
.progress { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .07); overflow: hidden; margin: 7px 0; }
.progress > i { display: block; height: 100%; background: var(--accent); opacity: .6; width: 0; border-radius: 2px; transition: width .4s var(--ease); }
.progress.done > i { background: #3ecf8e; opacity: .5; }

/* 模型广场 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card-model { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.card-model h3 { margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card-model h3 img { width: 18px; height: 18px; border-radius: 4px; }
.card-model .name { color: var(--muted); font-size: 11px; font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.card-model p { color: var(--muted); font-size: 12px; margin: 8px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-model .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.tagline { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11px; color: var(--muted); background: var(--panel-3); border: 1px solid var(--line); padding: 1px 7px; border-radius: 20px; }
.price { color: var(--ok); font-size: 12px; white-space: nowrap; }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.badge.no { color: var(--err); border-color: #4a2020; }
.tabs { display: flex; gap: 4px; }
.tab { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 5px 11px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.tab.active { color: #fff; border-color: var(--accent); background: var(--accent-soft); }
.search { width: 260px; }

/* 账户区 */
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 20px; font-weight: 600; margin-top: 3px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 500; font-size: 12px; }
table.data tbody tr:hover { background: var(--panel-2); }
.keybox { font-family: ui-monospace, Consolas, monospace; background: #101010; border: 1px solid var(--line);
  padding: 8px 10px; border-radius: 8px; word-break: break-all; margin: 6px 0; }
.row-actions { display: flex; gap: 6px; align-items: center; }
a.btn { text-decoration: none; display: inline-block; }
.btn.sm { padding: 4px 9px; font-size: 12px; }

/* ============================================================
   设计系统（覆盖上面的基础样式，后面的规则优先）
   原则：扁平中性灰、层级靠「表面亮度」而不是彩色的阴影；
        只有一个强调色（青），主按钮用近白底深字。
   ============================================================ */

/* --- 背景与滚动条 --- */
body {
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #454545; background-clip: content-box; }
::selection { background: rgba(4, 202, 246, .3); }

/* --- 侧栏 / 图标栏 --- */
.sidebar { padding: 16px 12px; background: var(--panel); }
.brand { font-size: 14.5px; letter-spacing: .2px; }
.brand .dot { box-shadow: none; background: var(--accent); }
.nav-item { border-radius: var(--r-sm); transition: background .14s var(--ease), color .14s var(--ease); }
.nav-item:hover { background: var(--raised); }
.nav-item.active { background: var(--raised); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }

/* --- 顶栏 --- */
.topbar { background: rgba(20, 20, 20, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft); }
.topbar .actions { overflow-x: auto; scrollbar-width: none; }
.topbar .actions::-webkit-scrollbar { height: 0; }
.view-title { letter-spacing: .2px; font-size: 15px; }

/* --- 控件 --- */
.btn {
  height: 32px; padding: 0 14px; border-radius: 10px; font-size: 13px; white-space: nowrap; flex: 0 0 auto;
  background: var(--raised); border: 1px solid var(--line); color: var(--text);
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.btn:hover { background: var(--raised-2); border-color: var(--line-2); }
.btn:active { background: rgba(255, 255, 255, .14); }
.btn.primary { background: var(--light); border-color: var(--light); color: var(--light-ink); font-weight: 600; box-shadow: none; }
.btn.primary:hover { background: #fff; border-color: #fff; filter: none; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--raised); }
.btn.danger { color: var(--err); border-color: rgba(255, 107, 107, .28); background: rgba(255, 107, 107, .08); }
.btn.danger:hover { background: rgba(255, 107, 107, .14); }
.btn.subtle { background: transparent; border-color: transparent; color: var(--muted); }
.btn.subtle:hover { background: var(--raised); color: var(--text); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea, .param input, .param select {
  background: #101010; border: 1px solid var(--line); border-radius: 10px; color: var(--text);
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus,
select:focus, input:focus, textarea:focus {
  outline: none; border-color: rgba(4, 202, 246, .5); box-shadow: 0 0 0 3px var(--accent-soft);
}
.panel, .card-model, .stat, .auth-card { box-shadow: none; }
.panel { border-radius: var(--r-lg); }

/* --- 提示条 --- */
.notice { background: var(--raised); border: 1px solid var(--line); color: var(--text); }

/* --- 对话 --- */
.messages { gap: 20px; }
.msg { animation: rise .18s var(--ease); }
.msg.err { color: #ffc9c9; }
.msg .who { letter-spacing: .3px; text-transform: none; font-size: 11px; color: var(--muted-2); }
.msg .body code.inline { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); }
.code-wrap pre { background: #0d0d0d; border: 1px solid var(--line); border-radius: var(--r-md); }
.code-wrap .code-copy { background: var(--raised-2); border: 1px solid var(--line); }
.code-wrap .code-copy:hover { border-color: var(--line-2); }
.caret { background: var(--accent); }
.chat-meta { color: var(--muted-2); }

/* --- 参数胶囊 --- */
.choice { border-radius: var(--r-sm); background: #101010; }
.choice:hover { border-color: var(--line-2); color: var(--text); }
.choice.on { background: var(--accent-soft); border-color: rgba(4, 202, 246, .6); color: var(--text); }
.param-group { border-top: 1px solid var(--line-soft); }

/* --- 任务卡片 --- */
.task-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.task-card .prompt { color: var(--muted); }
.task-card .links a { color: var(--accent); text-decoration: none; }
.progress { background: var(--raised); }
.progress > i { background: var(--accent); box-shadow: none; }
.skeleton { background: linear-gradient(90deg, #1a1a1a 25%, #222 37%, #1a1a1a 63%); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --- 卡片 --- */
.card-model { transition: border-color .16s var(--ease), background .16s var(--ease); cursor: pointer; }
.card-model:hover { border-color: var(--line-2); background: #1a1a1a; box-shadow: none; }
.card-model .go { color: var(--accent); }
.tag { color: var(--muted); background: var(--raised); border: 1px solid var(--line); border-radius: 999px; }
.price { color: var(--text); }
.badge { border-radius: 999px; }

/* --- 模型卡：能调什么（比例/时长/画质/可上传）+ 详情浮层 --- */
.cm-ability { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.ab-tag { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; color: var(--muted); }
.ab-tag.up { border-color: rgba(4, 202, 246, .4); color: #04caf6; }
.ab-tag.more { border-style: dashed; color: var(--muted-2); }
.cm-detail { margin-left: auto; padding: 3px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.cm-detail:hover { border-color: var(--line-2); color: var(--text); }
.ms-ov { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 20px; }
.ms-box { width: min(560px, 94vw); max-height: 84vh; overflow: auto; background: var(--panel-3); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.ms-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ms-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.ms-x { border: 0; background: transparent; color: var(--muted-2); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.ms-x:hover { color: var(--text); }
.ms-sub { color: var(--muted-2); font-size: 11.5px; font-family: ui-monospace, Consolas, monospace; margin-top: 4px; word-break: break-all; }
.ms-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ms-meta span { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 11.5px; color: var(--muted); }
.ms-meta .ms-price { border-color: rgba(4, 202, 246, .4); color: #04caf6; }
.ms-desc { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.ms-group { margin-top: 14px; color: var(--muted-2); font-size: 11.5px; letter-spacing: .04em; }
.ms-ab { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ms-ab-row { display: flex; gap: 10px; padding: 8px 11px; border-top: 1px solid var(--line-soft); font-size: 12px; }
.ms-ab-row:first-child { border-top: 0; }
.ms-ab-row b { flex: 0 0 84px; color: var(--text); font-weight: 500; }
.ms-ab-val { color: var(--muted); line-height: 1.5; }
.ms-ab-val.faint { color: var(--muted-2); }
.ms-box .btn.block { margin-top: 16px; }

/* --- Tab / 分段控件 --- */
.tabs { gap: 2px; background: var(--raised); padding: 3px; border-radius: 999px; }
.tab { border: 0; background: transparent; border-radius: 999px; padding: 5px 14px; font-size: 12.5px; }
.tab:hover { color: var(--text); }
.tab.active { background: rgba(255, 255, 255, .12); color: var(--text); border: 0; }

/* --- 画布模板选择面板 --- */
.cv-menu {
  position: fixed; z-index: 60; min-width: 210px; padding: 5px;
  background: #1f1f1f; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
.cv-menu-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; cursor: pointer;
  padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font-family: inherit;
}
.cv-menu-item:hover { background: var(--raised); }
.cv-menu-item b { font-size: 13px; font-weight: 600; }
.cv-menu-item span { font-size: 11px; color: var(--muted-2); }
.cv-menu-tip { padding: 7px 10px 4px; font-size: 11px; color: var(--muted-2); border-top: 1px solid var(--line-soft); margin-top: 4px; }

/* --- Toast --- */
.toasts { right: 20px; bottom: 20px; }
.toast {
  background: #1f1f1f; border: 1px solid var(--line); border-left: 0;
  padding: 11px 14px; border-radius: var(--r-md); font-size: 13px; box-shadow: var(--shadow-lg);
}
.toast.ok { border-color: rgba(53, 211, 154, .35); }
.toast.err { border-color: rgba(255, 107, 107, .35); }

/* --- 空状态 --- */
.empty {
  border: 0; background: transparent; color: var(--muted-2);
  border-radius: 0; padding: 36px 24px; font-size: 13px;
}

/* --- 表格（工作台各处共用） --- */
table.data th { color: var(--muted-2); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
table.data td { border-bottom: 1px solid var(--line-soft); }
table.data tbody tr:hover { background: rgba(255, 255, 255, .022); }
.keybox { background: #101010; border: 1px solid var(--line); }

/* ============================================================
   壳层：一级图标栏 + 二级面板 + 主区（参考图一 / 图二）
   ============================================================ */
.rail {
  width: 64px; flex: 0 0 64px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 0 10px; background: #101010; border-right: 1px solid var(--line-soft); z-index: 5;
}
.rail-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(4, 202, 246, .14); margin-bottom: 12px; text-decoration: none; }
.rail-logo .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-grad); box-shadow: 0 0 14px rgba(4, 202, 246, .9); }
.rail-items { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.rail-item {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; position: relative; transition: all .16s var(--ease);
}
.rail-item svg { width: 20px; height: 20px; }
.rail-item:hover { background: var(--panel-2); color: var(--text); }
.rail-item.active { background: linear-gradient(135deg, rgba(4, 202, 246, .22), rgba(122, 162, 255, .12)); color: #fff; }
.rail-item.active::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 3px; background: var(--accent-grad);
}
.rail-item .rail-tip {
  position: absolute; left: 54px; white-space: nowrap; background: var(--panel-3); color: var(--text);
  border: 1px solid var(--line); padding: 4px 9px; border-radius: 7px; font-size: 12px;
  opacity: 0; pointer-events: none; transition: opacity .14s var(--ease); z-index: 30;
}
.rail-item:hover .rail-tip { opacity: 1; }
.rail-foot { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.rail-btn { width: 38px; height: 38px; border-radius: 10px; background: transparent; border: 0; color: var(--muted-2);
  display: grid; place-items: center; cursor: pointer; }
.rail-btn svg { width: 18px; height: 18px; }
.rail-btn:hover { background: var(--panel-2); color: var(--text); }

.panel-side {
  width: 300px; flex: 0 0 300px; background: var(--panel); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; min-height: 0;
  transition: width .2s var(--ease), flex-basis .2s var(--ease);
}
.panel-top { height: 56px; flex: 0 0 56px; display: flex; align-items: center; padding: 0 16px;
  border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: 14px; }
.panel-body { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.panel-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line-soft); }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--raised-2); color: var(--text); font-weight: 600; font-size: 13px; }
.pu-info { flex: 1; min-width: 0; }
.pu-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pu-balance { font-size: 11px; color: var(--muted); }
.panel-state { padding: 0 12px 10px; font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.panel-closed .panel-side { width: 0; flex-basis: 0; border-right: 0; overflow: hidden; }

/* 「创作 / 无限画布」：图标 + 文字按钮（一眼能认），留在左侧栏里 */
.rail-item.rail-text {
  width: 54px; height: 52px; border-radius: 12px; row-gap: 3px;
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .05);
  color: var(--muted);
}
.rail-item.rail-text svg { width: 18px; height: 18px; }
.rail-item.rail-text .rail-label {
  font-size: 10px; line-height: 12px; font-weight: 500; letter-spacing: .2px; white-space: nowrap;
}
.rail-item.rail-text:hover { background: rgba(255, 255, 255, .1); color: var(--text); border-color: rgba(255, 255, 255, .1); }
.rail-item.rail-text.active {
  background: linear-gradient(135deg, rgba(4, 202, 246, .3), rgba(122, 162, 255, .18));
  color: #fff; border-color: rgba(4, 202, 246, .35);
  box-shadow: 0 4px 16px rgba(4, 202, 246, .22);
}
.rail-item.rail-text.active::before { display: none; }
/* 文字入口组与下面的图标组拉开一点，视觉上分两层 */
.rail-items .rail-text + .rail-item:not(.rail-text) { margin-top: 10px; }
.p-tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; flex: 0 0 auto; min-height: 28px; }
.p-tabs::-webkit-scrollbar { display: none; }
.p-tab { flex: 0 0 auto; border: 1px solid transparent; background: var(--raised); color: var(--muted); font-size: 12px;
  padding: 4px 11px; border-radius: 999px; cursor: pointer; transition: background .14s var(--ease), color .14s var(--ease); }
.p-tab:hover { color: var(--text); background: var(--raised-2); }
.p-tab.active { color: var(--text); background: rgba(255, 255, 255, .16); border-color: transparent; }
.p-search { width: 100%; height: 34px; flex: 0 0 auto; padding: 0 11px; font-size: 13px; }
.p-model { display: flex; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid transparent; transition: background .14s var(--ease), border-color .14s var(--ease); }
.p-model:hover { background: var(--raised); border-color: transparent; }
.p-model.on { background: var(--raised); border-color: var(--line); box-shadow: inset 2px 0 0 var(--accent); }
.p-model .ic { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: var(--panel-3);
  display: grid; place-items: center; overflow: hidden; font-size: 12px; color: var(--muted); }
.p-model .ic img { width: 100%; height: 100%; object-fit: cover; }
.p-model .txt { min-width: 0; flex: 1; }
.p-model .nm { font-size: 13px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.p-model .nm b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-model .nm em { font-style: normal; font-size: 11px; color: var(--ok); white-space: nowrap; }
.p-model .ds { font-size: 11px; color: var(--muted-2); line-height: 1.5; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-empty { color: var(--muted-2); font-size: 12px; padding: 16px; text-align: center; }
.p-stat { display: flex; justify-content: space-between; font-size: 12px; padding: 8px 11px;
  background: var(--panel-2); border-radius: var(--r-sm); }
.p-key { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 8px 11px;
  background: var(--panel-2); border-radius: var(--r-sm); }
.p-key code { font-size: 11px; color: var(--muted); }
.p-key em { font-style: normal; font-size: 11px; color: var(--ok); }
.p-key em.off { color: var(--err); }

/* 首页（参考图二）：新建画布条 + 快捷入口 */
.hero { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 13px 16px; border-radius: var(--r-lg); cursor: pointer; color: var(--text); font: inherit;
  background: linear-gradient(90deg, rgba(4, 202, 246, .07), rgba(4, 202, 246, 0) 58%), var(--panel);
  border: 1px solid var(--line); transition: border-color .16s var(--ease); margin-bottom: 16px; }
.hero:hover { border-color: rgba(4, 202, 246, .38); }
.hero-plus { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(4, 202, 246, .14); color: var(--accent); font-size: 22px; line-height: 1; }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hero-title { font-size: 14.5px; font-weight: 600; }
.hero-sub { font-size: 12px; color: var(--muted); }
.hero-go { flex: 0 0 auto; font-size: 12.5px; color: var(--muted-2); white-space: nowrap; }
.hero:hover .hero-go { color: var(--accent); }
.quickrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 24px; }
.qbtn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 13px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; cursor: pointer; color: var(--accent);
  font: inherit; transition: border-color .16s var(--ease), background .16s var(--ease); text-align: left; }
.qbtn svg { width: 19px; height: 19px; opacity: .95; }
.qbtn span { font-size: 13px; color: var(--text); font-weight: 500; }
.qbtn i { font-style: normal; font-size: 11px; color: var(--muted-2); }
.qbtn:hover { border-color: var(--line-2); background: #1a1a1a; }
.sect-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 10px;
  font-size: 13.5px; font-weight: 600; }
.recent-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  cursor: pointer; transition: all .18s var(--ease); }
.recent-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.recent-card .thumb { width: 100%; height: 140px; object-fit: cover; display: block; background: #101010; }
.recent-card .thumb-ph { width: 100%; height: 140px; display: grid; place-items: center; color: var(--muted-2);
  font-size: 12px; background: #101010; }
.recent-card .meta2 { padding: 8px 10px; font-size: 11px; color: var(--muted); display: flex;
  justify-content: space-between; gap: 6px; }
.recent-card .meta2 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-model { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px;
  cursor: pointer; display: flex; gap: 10px; align-items: center; transition: all .18s var(--ease); }
.mini-model:hover { border-color: var(--line-2); }
.mini-model img, .mini-model .ph { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 26px;
  background: var(--panel-3); display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.mini-model .t { min-width: 0; flex: 1; }
.mini-model .t b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-model .t i { font-style: normal; font-size: 11px; color: var(--muted-2); }

/* ============================================================
   模型工作区（图一的右侧）：标题行 + 全宽记录流 + 底部创作栏
   ============================================================ */
.ws { overflow: hidden; padding-bottom: 0; }
.ws-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ws-model {
  display: flex; align-items: center; gap: 9px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 15px 6px 8px; cursor: pointer; color: var(--text); font: inherit;
  transition: all .16s var(--ease);
}
.ws-model:hover { border-color: var(--line-2); }
.ws-ico {
  width: 24px; height: 24px; border-radius: 7px; background: var(--panel-3); display: grid; place-items: center;
  overflow: hidden; font-size: 11px; color: var(--muted);
}
.ws-ico img { width: 100%; height: 100%; object-fit: contain; }
.ws-name { font-size: 13px; font-weight: 600; }

.ws-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 2px 2px 14px; }
/* 结果区还是「一条一条往下排」（像消息）：一次提交多张时，在同一个卡片里排成宫格 */
.ws-scroll .results { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
/* 结果预览别占满整屏（用户要求：不用放那么大）——点「打开原文件」看大图 */
.ws-scroll .task-card { width: 100%; max-width: 340px; }
/* 结果卡顶部的引用条：引用我发的那句话（灰字 + 左侧竖线，最多两行） */
.task-card .tq {
  margin: 10px 12px 0; padding: 1px 0 1px 9px; border-left: 2px solid var(--line-2);
  color: var(--muted); font-size: 12px; line-height: 1.6; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.task-card .tq + .media,
.task-card .tq + .ph-media { margin-top: 9px; }
/* 结果预览：卡片跟内容同宽（用户要求：别放那么大）——点图看原图 */
.results .task-card .media img,
.results .task-card .media video { max-width: 100%; cursor: zoom-in; }
.results .task-card .media img { display: block; }
/* 生成中占位：按所选比例的空框 + 扫光动画 */
.ph-media {
  border-radius: 10px; border: 1px dashed var(--line);
  background: #101010; position: relative; overflow: hidden;
}
.ph-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, .07) 50%, transparent 75%);
  animation: phSweep 1.5s linear infinite;
}
@keyframes phSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ws-scroll .empty { width: 100%; max-width: 720px; }

/* ---------- 一次提交多张/多条：同一个卡片里排成宫格 ---------- */
.ws-scroll .task-card.batch { max-width: 560px; }
.batch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 9px 12px 12px; }
.batch-tile {
  position: relative; border-radius: 10px; overflow: hidden;
  background: #101010; border: 1px solid var(--line-soft);
}
.batch-tile .media img, .batch-tile .media video, .batch-tile .media audio { width: 100%; display: block; }
.batch-tile .ph-media { border: 0; border-radius: 0; }

/* ---------- 操作按钮：缩小后贴在图上 ---------- */
/* （图片贴左下；视频/音频的播放控件在下方，所以贴左上） */
.ws-scroll .media-box { position: relative; margin: 9px 12px 12px; max-width: calc(100% - 24px); }
.ws-scroll .media-box .task-acts {
  position: absolute; left: 6px; bottom: 6px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px;
  max-width: calc(100% - 12px);
}
.ws-scroll .media-box.ctrl-top .task-acts { top: 6px; bottom: auto; }
.ws-scroll .media-box .task-acts a {
  color: #fff !important; font-size: 11px; line-height: 1.2; padding: 3px 7px; border: 0; border-radius: 7px;
  background: rgba(10, 12, 16, .62); backdrop-filter: blur(4px); opacity: .9;
}
.ws-scroll .media-box .task-acts a:hover { background: rgba(10, 12, 16, .85); opacity: 1; }
/* 宫格里的每一格更小一点 */
.ws-scroll .batch-tile .media-box { margin: 0; max-width: 100%; }
.ws-scroll .batch-tile .task-acts { left: 4px; bottom: 4px; gap: 3px; max-width: calc(100% - 8px); }
.ws-scroll .batch-tile .task-acts a { font-size: 10px; padding: 2px 5px; }

.composer-bar {
  flex: 0 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 12px 14px 10px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 9px;
  box-shadow: 0 -10px 34px rgba(0, 0, 0, .38); max-height: 52vh;
}
.composer-bar:focus-within { border-color: rgba(4, 202, 246, .45); }
.composer-bar > textarea {
  flex: 0 0 auto; width: 100%; resize: none; font: inherit; font-size: 14px; line-height: 1.7;
  background: #0d0d0d; border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; min-height: 54px; max-height: 96px; transition: border-color .16s var(--ease);
}
.composer-bar > textarea:focus { border-color: rgba(4, 202, 246, .45); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-bar .params {
  flex: 1 1 auto; min-height: 0; overflow: auto; flex-direction: row; flex-wrap: wrap;
  gap: 8px; align-items: center; padding-bottom: 2px;
}
/* 参数：一行胶囊，说明收进悬停提示 */
.composer-bar .param {
  flex: 0 1 auto; min-width: 0; flex-direction: row; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; height: 34px; transition: border-color .16s var(--ease);
}
.composer-bar .param:hover { border-color: var(--line-2); }
.composer-bar .param > label {
  display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap;
}
.composer-bar .param .info { font-size: 10px; color: var(--muted-2); cursor: help; }
.composer-bar .param .req { color: var(--err); }
.composer-bar .param select,
.composer-bar .param > input {
  border: 0; background: transparent; box-shadow: none; padding: 2px 2px;
  font-size: 12.5px; color: var(--text); max-width: 180px;
}
.composer-bar .param select:focus,
.composer-bar .param > input:focus { box-shadow: none; border: 0; }
.composer-bar .param.chip .choices { gap: 5px; }
.composer-bar .param.chip .choice { padding: 2px 9px; font-size: 12px; }
.composer-bar .hint { font-size: 11px; color: var(--muted-2); }
.cache-note { font-size: 11px; color: var(--muted-2); cursor: help; white-space: nowrap; align-self: center; }
.ws-scroll .empty { padding: 16px; }
.card-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 11.5px; color: var(--muted-2); }
.card-meta span + span::before { content: '·'; margin-right: 12px; color: var(--line); }

/* ---------- 无限画布 ---------- */
.grow { flex: 1; }
#view-canvas { overflow: hidden; padding-bottom: 0; }
/* 画布文档选择：自绘下拉（原生 select 的弹层在暗色下是白底，改不掉） */
.cv-doc-picker { display: flex; align-items: center; max-width: 320px; height: 30px; padding: 0 10px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.cv-doc-picker .dd { min-width: 0; max-width: 300px; }
.cv-doc-picker .dd-btn { font-size: 12px; color: var(--text); max-width: 300px; }
.cv-pick-empty { font-size: 12px; color: var(--muted-2); }
/* 点图片节点的小窗口：看大图 */
.cv-view-mask { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(4, 6, 10, .78); backdrop-filter: blur(3px); animation: fadeIn .12s var(--ease); }
.cv-view {
  display: flex; flex-direction: column; max-width: min(980px, 88vw); max-height: 86vh;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: popIn .16s var(--ease);
}
.cv-view-head { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--line-soft); }
.cv-view-head b { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-view-a { padding: 4px 10px; font-size: 11.5px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.cv-view-a:hover { color: var(--text); border-color: var(--line-2); }
.cv-view-x { width: 24px; height: 24px; font-size: 16px; line-height: 1; color: var(--muted-2); background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.cv-view-x:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.cv-view-img { display: block; max-width: 100%; max-height: calc(86vh - 44px); object-fit: contain; background: #0a0c11; }
.cv-view-video { display: block; max-width: 100%; max-height: calc(86vh - 44px); background: #000; }
/* 广场排序：同样是自绘下拉，给个胶囊底 */
#plazaSort .dd-btn { padding: 5px 10px; font-size: 12px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
#plazaSort .dd-btn:hover { border-color: var(--line-2); }
.cv-viewport {
  position: relative; flex: 1; min-height: 0; margin-bottom: 14px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-md); cursor: grab;
  background-color: #0a0c11;
  background-image: radial-gradient(circle at 1px 1px, #232323 1px, transparent 0);
  background-size: 26px 26px;
}
.cv-viewport.grabbing { cursor: grabbing; }
/* 框选模式：鼠标就是正常的框选光标（十字），拖动时才是抓取的样子 */
.cv-viewport.cv-drag-select:not(.grabbing) { cursor: crosshair; }
.cv-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.cv-edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.cv-edge { fill: none; stroke: url(#cvGrad); stroke-width: 2; stroke-linecap: round; opacity: .8; }
.cv-edge-glow { fill: none; stroke: #04caf6; stroke-width: 7; opacity: .1; stroke-linecap: round; }
.cv-edges g.lit .cv-edge { stroke: #04caf6; opacity: 1; stroke-width: 2.4; }
.cv-edges g.lit .cv-edge-glow { opacity: .26; }
/* 拖动节点时：跟它相连的线跑动起来（一眼看出连了哪些节点） */
.cv-edges g.flow .cv-edge { stroke: #04caf6; opacity: 1; stroke-width: 2.4; stroke-dasharray: 7 9; animation: cvFlow .55s linear infinite; }
.cv-edges g.flow .cv-edge-glow { opacity: .22; }
@keyframes cvFlow { to { stroke-dashoffset: -16; } }
.cv-edge.temp { stroke: var(--accent); stroke-dasharray: 6 6; }
.cv-edge-hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; cursor: pointer; }
.cv-node {
  position: absolute; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .34); overflow: visible;
  user-select: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  display: flex; flex-direction: column;
}
.cv-node:hover { border-color: var(--line-2); }
.cv-node.dragging { box-shadow: 0 18px 46px rgba(0, 0, 0, .5); border-color: var(--line-2); }
.cv-node.sel { border-color: rgba(4, 202, 246, .7); box-shadow: 0 0 0 2px rgba(4, 202, 246, .16), 0 10px 30px rgba(0, 0, 0, .45); }
.cv-node.link-hover { border-color: rgba(53, 211, 154, .6); box-shadow: 0 0 0 2px rgba(53, 211, 154, .16), 0 10px 30px rgba(0, 0, 0, .45); }
/* 拖到别人身上：边框亮橙色提醒（松手会自动让开）；让开时滑过去，别瞬间跳 */
.cv-node.jam { border-color: rgba(255, 184, 77, .8); box-shadow: 0 0 0 2px rgba(255, 184, 77, .18), 0 10px 30px rgba(0, 0, 0, .45); }
.cv-node.snapping { transition: left .2s ease, top .2s ease; }
/* 节点名字：放在节点框外面的左上角，兼当拖动手柄 */
.cv-node-name {
  position: absolute; left: 2px; top: -20px; z-index: 2; max-width: calc(100% - 16px);
  font-size: 11.5px; line-height: 18px; color: var(--muted);
  background: transparent; padding: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  pointer-events: auto; cursor: move; user-select: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .75);
}
.cv-node-name:hover { color: var(--text); }
/* 就地改名用的输入框（双击名字时出现） */
.cv-node-name-in {
  width: 148px; max-width: 100%; height: 18px; padding: 0 5px;
  font: inherit; font-size: 11.5px; color: var(--text);
  background: var(--panel-2); border: 1px solid rgba(4, 202, 246, .55); border-radius: 5px; outline: none;
}
/* 音频节点：播放器周围留一圈能抓的地方 */
.cv-node[data-type="audio"] .cv-node-body { padding: 8px; }
.cv-node-acts {
  position: absolute; right: 7px; top: 6px; z-index: 3;
  display: flex; gap: 3px; opacity: 0; transition: opacity .14s var(--ease);
}
.cv-node-acts button { background: rgba(8, 10, 14, .6); backdrop-filter: blur(6px); }
.cv-node:hover .cv-node-acts, .cv-node.sel .cv-node-acts { opacity: 1; }
.cv-node-a, .cv-node-x {
  width: 22px; height: 22px; line-height: 1; font-size: 13px; color: #d6d6d6;
  border: 0; border-radius: 6px; cursor: pointer;
}
.cv-node-a { font-size: 14px; }
.cv-node-a:hover { color: #fff; background: rgba(255, 255, 255, .16); }
.cv-node-x { font-size: 16px; }
.cv-node-x:hover { color: var(--err); background: rgba(255, 107, 107, .2); }
.cv-node-body { min-height: 44px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cv-node-body textarea {
  display: block; width: 100%; flex: 1; min-height: 88px; padding: 10px 11px; resize: none;
  font: inherit; font-size: 13px; line-height: 1.7; color: var(--text);
  background: transparent; border: 0; outline: none; border-radius: 13px;
}
.cv-node-body textarea.auto { flex: none; }
.cv-node-body img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
/* 视频 / 音频节点：播放控件自带，点控件不要触发拖拽（JS 里已排除） */
.cv-node-body video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 13px; }
.cv-node-body audio { display: none; }
/* 音频节点自绘的播放器 */
.cv-audio { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #0c0f13; border: 1px solid var(--line); border-radius: 12px; }
.cv-audio-play { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; font-size: 12px; color: #eaf6ff; background: rgba(255, 255, 255, .08); border: 0; border-radius: 50%; cursor: pointer; }
.cv-audio-play:hover { background: rgba(255, 255, 255, .16); }
.cv-audio-time { flex: 0 0 auto; font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.cv-audio-seek { flex: 1 1 auto; min-width: 50px; height: 4px; accent-color: #04caf6; }
.cv-node[data-type="video"] .cv-badge { background: rgba(255, 107, 107, .16); color: #ff9a9a; }
/* 右下角：拖它改大小 */
.cv-resize {
  position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; z-index: 3;
  cursor: nwse-resize; opacity: 0; transition: opacity .14s var(--ease);
  background:
    linear-gradient(135deg, transparent 46%, var(--muted-2) 47%, var(--muted-2) 54%, transparent 55%),
    linear-gradient(135deg, transparent 68%, var(--muted-2) 69%, var(--muted-2) 76%, transparent 77%);
}
.cv-node:hover .cv-resize, .cv-node.sel .cv-resize { opacity: .85; }
.cv-resize:hover { opacity: 1; }
.cv-node[data-type="audio"] .cv-badge { background: rgba(53, 211, 154, .16); color: #6ee7b7; }
.cv-img-bad { padding: 22px 12px; text-align: center; font-size: 12px; color: var(--muted-2); }
/* 【按需求移除】老的头栏图标/类型名与底部标题样式（现已改成左上角名字） */
.cv-cap {
  padding: 7px 11px 9px; font-size: 12px; line-height: 1.6; color: var(--muted);
  border-top: 1px solid var(--line-soft);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cv-port {
  position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; border-radius: 50%;
  transform: translateY(-50%);
  background: #10141b; border: 2px solid #45505f; cursor: crosshair; z-index: 2;
  transition: background .14s var(--ease), transform .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease);
}
/* 左进右出：左边是输入口，右边是输出口 */
.cv-port.in { right: auto; left: -7px; }
.cv-node:hover .cv-port.out, .cv-node.sel .cv-port.out { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(4, 202, 246, .12); }
.cv-node:hover .cv-port.in, .cv-node.sel .cv-port.in { border-color: #9db8ff; box-shadow: 0 0 0 4px rgba(157, 184, 255, .12); }
.cv-port.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(4, 202, 246, .16); }
.cv-port.in.on { background: #9db8ff; border-color: #9db8ff; box-shadow: 0 0 0 3px rgba(157, 184, 255, .16); }
.cv-port::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
}
.cv-port:hover { transform: translateY(-50%) scale(1.25); }

/* 悬浮工具条 */
.cv-tools {
  position: absolute; left: 12px; top: 12px; z-index: 3;
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: rgba(23, 23, 23, .94); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.cv-tools button {
  display: flex; align-items: center; gap: 5px; padding: 6px 10px; cursor: pointer;
  font-size: 12px; color: var(--muted); background: transparent; border: 0; border-radius: 8px;
}
.cv-tools button:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.cv-tools svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cv-tools .cv-sep { width: 1px; height: 16px; margin: 0 4px; background: var(--line); }

/* 空白处双击的「加节点」菜单 */
.cv-add-menu {
  position: fixed; z-index: 90; width: 240px; padding: 5px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); animation: popIn .14s var(--ease);
}
.cv-add-item {
  display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 9px;
  width: 100%; padding: 6px 8px; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-radius: 8px; color: var(--text);
}
.cv-add-item:hover { background: rgba(255, 255, 255, .06); }
.cv-add-item i {
  grid-row: 1 / span 2; align-self: center; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; background: rgba(4, 202, 246, .12); color: var(--accent);
}
.cv-add-item i svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cv-add-item b { font-size: 12.5px; font-weight: 500; }
.cv-add-item span { font-size: 11px; color: var(--muted-2); }
.cv-add-group { padding: 7px 9px 2px; font-size: 11px; color: var(--muted-2); letter-spacing: .04em; }

/* 空节点：一个淡淡的类型标 + 两件真能点的事（上传 / 从生成记录选） */
.cv-blank {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 16px 12px; border-radius: 13px;
}
.cv-blank-mark { opacity: .16; }
.cv-blank-mark svg { width: 38px; height: 38px; fill: none; stroke: #eaf6ff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.cv-try { width: 100%; display: flex; flex-direction: column; gap: 1px; }
.cv-try > b { padding: 0 6px 5px; font-size: 11px; font-weight: 400; color: var(--muted-2); }
.cv-try-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 7px; text-align: left;
  font-size: 12px; color: var(--muted); background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
.cv-try-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.cv-try-btn i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: rgba(255, 255, 255, .06); }
.cv-try-btn i svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cv-node.drop-hover { border-color: rgba(4, 202, 246, .75); box-shadow: 0 0 0 2px rgba(4, 202, 246, .18), 0 10px 30px rgba(0, 0, 0, .45); }

/* 点节点才出现的输入框：贴在节点下面的一块独立卡片；宽度跟着内容走（参数永远横着排一行），跟节点居中对齐 */
.cv-cmp {
  display: none;
  position: absolute; left: 50%; top: calc(100% + 8px); z-index: 6;
  transform: translateX(-50%);
  width: max-content; min-width: 380px; max-width: min(860px, calc(100vw - 32px));
  padding: 9px 10px 10px;
  background: var(--panel-3);
  border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--shadow-lg);
}
.cv-node.sel .cv-cmp { display: block; }
.cv-multi-selection .cv-node.sel .cv-cmp { display: none; }
.cv-node.cv-focus .cv-cmp, .cv-cmp:focus-within { border-color: rgba(4, 202, 246, .45); box-shadow: 0 0 0 2px rgba(4, 202, 246, .1), var(--shadow-lg); }
/* 上面一行小胶囊（＋参考素材 这类真能点的东西） */
.cv-cmp-chips { display: flex; flex-wrap: nowrap; gap: 6px; margin-bottom: 6px; }
/* 连进来的素材缩略图（跟着「＋参考素材」摆在同一行） */
.cv-cmp-refs { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; }
.cv-ref-thumb {
  position: relative; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line);
}
.cv-ref-thumb img, .cv-ref-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cv-ref-thumb:hover { border-color: rgba(4, 202, 246, .5); }
.cv-ref-play { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 10px; color: #fff; background: rgba(0, 0, 0, .32); }
.cv-ref-ico { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }
.cv-ref-ico svg { width: 16px; height: 16px; }
.cv-ref-more { flex: 0 0 auto; font-size: 11px; color: var(--muted-2); }
/* 输入框里打 @ 挑素材的小菜单 */
.cv-at-menu {
  position: fixed; z-index: 96; width: 216px; padding: 5px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); animation: popIn .12s var(--ease);
}
.cv-at-tip { padding: 2px 7px 6px; font-size: 10.5px; color: var(--muted-2); }
.cv-at-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; cursor: pointer;
  font-size: 12px; color: var(--text); text-align: left; background: transparent; border: 0; border-radius: 8px;
}
.cv-at-item:hover { background: rgba(255, 255, 255, .08); }
.cv-at-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-at-item .cv-ref-thumb { width: 24px; height: 24px; border-radius: 6px; }
.cv-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; cursor: pointer;
  font-size: 11.5px; color: var(--muted); background: rgba(255, 255, 255, .05);
  border: 1px solid transparent; border-radius: 999px; max-width: 100%;
}
.cv-chip:hover { color: var(--text); background: rgba(255, 255, 255, .09); }
.cv-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-chip i { font-style: normal; font-size: 12px; line-height: 1; }
.cv-chip.on { color: var(--text); border-color: rgba(4, 202, 246, .45); background: rgba(4, 202, 246, .12); }
/* 参数胶囊：标签灰 + 值白，整体一个小圆角胶囊 */
.cv-cmp-chip { display: inline-flex; min-width: 0; }
.cv-cmp-chip .dd-btn {
  max-width: 200px; padding: 4px 10px; font-size: 11.5px; color: var(--text);
  background: rgba(255, 255, 255, .05); border-radius: 999px;
}
.cv-cmp-chip .dd-btn:hover { background: rgba(255, 255, 255, .09); }
.cv-chip-lab { font-style: normal; font-size: 10.5px; color: var(--muted-2); }
/* 提示词：不画框，卡片本身就是它的底（点进去也不要在里面再画一圈） */
.cv-cmp-tawrap { position: relative; }
.cv-cmp-ta {
  display: block; width: 100%; padding: 4px 2px; resize: none; position: relative; z-index: 1;
  font: inherit; font-size: 12.5px; line-height: 1.65; color: var(--text);
  background: transparent; border: 0; outline: none; overflow-y: auto;
}
/* 底下那层「高亮层」：字是透明的，只把 @素材 画成一小块底色；文字和间距跟输入框一模一样 */
.cv-cmp-hl {
  position: absolute; left: 0; top: 0; bottom: 0; right: 0; z-index: 0;
  padding: 4px 2px; pointer-events: none; overflow: hidden;
  font: inherit; font-size: 12.5px; line-height: 1.65;
  color: transparent; white-space: pre-wrap; word-break: break-word;
}
.cv-cmp-hl mark { color: transparent; background: rgba(4, 202, 246, .2); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(4, 202, 246, .35); }
.cv-cmp .cv-cmp-ta:focus, .cv-cmp .cv-cmp-ta:focus-visible {
  background: transparent; border: 0; outline: none; box-shadow: none;
}
.cv-cmp-ta::placeholder { color: var(--muted-2); }
/* 参数：能选的做成一个个小胶囊排在下行，要打字的带标签列在这里 */
.cv-cmp-params:not(:empty) { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.cv-cmp-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.cv-cmp-row > label { flex: 0 0 74px; font-size: 11.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-cmp-row .dd { flex: 1 1 120px; min-width: 0; }
.cv-cmp-row .choices { display: flex; flex-wrap: wrap; gap: 5px; flex: 1 1 100%; min-width: 0; }
.cv-cmp-row .choices .choice { flex: 0 0 auto; padding: 2px 8px; font-size: 11.5px; }
.cv-cmp-input { flex: 1; min-width: 0; height: 28px; padding: 0 8px; font-size: 12px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.cv-cmp-area { height: auto; min-height: 54px; padding: 7px 9px; line-height: 1.6; resize: vertical; }
.cv-cmp-note { font-size: 11.5px; line-height: 1.6; color: var(--muted-2); }
.cv-cmp-warn { font-size: 11.5px; line-height: 1.6; color: #ffb84d; }
.cv-cmp-unlink { margin-left: 2px; padding: 0; font: inherit; font-size: 11.5px; color: #ffb84d; text-decoration: underline; background: transparent; border: 0; cursor: pointer; }
.cv-cmp-unlink:hover { color: #ffd08a; }
.cv-cmp-foot { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; margin-top: 8px; }
.cv-cmp-foot > .dd { flex: 0 1 auto; min-width: 0; }
.cv-cmp-tags { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; min-width: 0; }
.cv-cmp-hint { margin-top: 6px; font-size: 11px; color: var(--muted-2); }
.cv-cmp-hint:empty { display: none; }
/* 输入框最左边：这个模型按现在的参数大概多少钱 */
.cv-cmp-price { display: flex; flex-direction: column; flex: 0 0 auto; line-height: 1.3; }
.cv-cmp-price:empty { display: none; }
.cv-cmp-price b { font-size: 11.5px; font-weight: 500; color: #7ee0ff; white-space: nowrap; }
.cv-cmp-price span { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
/* 有「线路」胶囊时：价格折进胶囊里（一行小字，怎么算的放悬停提示里），不再单独占最左边 */
.cv-line .dd-btn { max-width: 330px; }
.cv-line .cv-cmp-price { flex-direction: row; align-items: baseline; gap: 4px; padding-left: 3px; }
.cv-line .cv-cmp-price b { font-size: 11px; }
.cv-line .cv-cmp-price span { display: none; }
/* 提交生成：图标 + 「生成」文字（只有图标的话新用户找不到） */
.cv-gen {
  margin-left: auto; min-width: 30px; height: 30px; padding: 0 12px 0 10px; display: inline-flex; align-items: center; gap: 5px;
  color: #06131a; background: var(--accent); border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600;
  transition: filter .14s var(--ease), opacity .14s var(--ease);
}
.cv-gen:hover { filter: brightness(1.08); }
.cv-gen[disabled] { opacity: .5; cursor: default; }
.cv-gen svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* 节点里的小菜单（＋参考素材） */
.cv-mini-menu {
  position: fixed; z-index: 94; width: 172px; padding: 4px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); animation: popIn .12s var(--ease);
}
.cv-mini-item {
  display: block; width: 100%; padding: 7px 9px; text-align: left; cursor: pointer;
  font-size: 12px; color: var(--text); background: transparent; border: 0; border-radius: 7px;
}
.cv-mini-item:hover { background: rgba(255, 255, 255, .07); }

/* 生成版本弹层（节点右上角那枚 ⧉）：一版一张缩略图，点了就切过去 */
.cv-vers {
  position: fixed; z-index: 95; width: 268px; max-height: 62vh; overflow: auto;
  padding: 8px; display: flex; flex-direction: column; gap: 7px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); animation: popIn .12s var(--ease);
}
.cv-vers-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; }
.cv-vers-head b { font-size: 12px; font-weight: 600; color: var(--text); }
.cv-vers-x { width: 20px; height: 20px; line-height: 1; font-size: 14px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.cv-vers-x:hover { color: var(--text); background: var(--panel-2); }
.cv-vers-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.cv-vers-card { position: relative; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; }
.cv-vers-card.on { border-color: rgba(4, 202, 246, .7); box-shadow: 0 0 0 1px rgba(4, 202, 246, .3); }
.cv-vers-pick { display: block; width: 100%; padding: 0; text-align: left; background: transparent; border: 0; cursor: pointer; }
.cv-vers-thumb { display: block; width: 100%; height: 72px; object-fit: cover; background: rgba(255, 255, 255, .05); }
.cv-vers-audio { display: grid; place-items: center; font-size: 18px; color: var(--muted); }
.cv-vers-tag { display: block; padding: 4px 6px 0; font-size: 10.5px; color: var(--text); }
.cv-vers-meta { display: block; padding: 1px 6px 5px; font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-vers-del { position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; line-height: 1; font-size: 13px; color: #fff; background: rgba(8, 10, 14, .62); border: 0; border-radius: 5px; cursor: pointer; }
.cv-vers-del:hover { background: rgba(255, 107, 107, .85); }
.cv-vers-again { width: 100%; padding: 7px 9px; font-size: 12px; color: var(--accent); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.cv-vers-again:hover { background: var(--panel-3); }

/* 取景器：按画幅看构图（三分线 / 中心线 / 安全框） */
.cv-vf {
  width: min(980px, calc(100vw - 48px)); max-height: 90vh; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); animation: popIn .12s var(--ease);
}
.cv-vf-stage { display: grid; place-items: center; padding: 2px 0; }
.cv-vf-frame { position: relative; overflow: hidden; background: #0B0D12; border: 1px solid var(--line-2); border-radius: 6px; }
.cv-vf-media { position: absolute; inset: 0; }
.cv-vf-media img, .cv-vf-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cv-vf-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12.5px; }
.cv-vf-grid { position: absolute; inset: 0; pointer-events: none; }
.cv-vf-line { position: absolute; background: rgba(255, 255, 255, .72); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .55); }
.cv-vf-line.v { top: 0; bottom: 0; width: 1px; }
.cv-vf-line.h { left: 0; right: 0; height: 1px; }
.cv-vf-safe { position: absolute; border: 1px dashed rgba(255, 255, 255, .82); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .45); border-radius: 3px; }
.cv-vf-prompt { margin: 0; max-height: 78px; overflow: auto; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* 功能面板（Ctrl+K）：所有功能集中可搜 */
.cv-cmd-mask { position: fixed; inset: 0; z-index: 132; display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 16px; background: rgba(4, 6, 10, .55); backdrop-filter: blur(3px); animation: fadeIn .12s var(--ease); }
.cv-cmd { width: min(640px, 100%); max-height: 76vh; display: flex; flex-direction: column; overflow: hidden; background: var(--panel-3); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); animation: popIn .14s var(--ease); }
.cv-cmd-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--line); }
.cv-cmd-input { flex: 1; min-width: 0; padding: 9px 11px; font: inherit; font-size: 13.5px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; outline: none; }
.cv-cmd-input:focus { border-color: var(--accent); }
.cv-cmd-list { flex: 1; overflow: auto; padding: 6px; }
.cv-cmd-group { padding: 9px 10px 4px; color: var(--muted); font-size: 11px; }
.cv-cmd-item { display: flex; width: 100%; align-items: baseline; gap: 8px; padding: 8px 10px; text-align: left; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.cv-cmd-item b { font-size: 13px; font-weight: 600; color: var(--text); }
.cv-cmd-item span { font-size: 11.5px; color: var(--muted); }
.cv-cmd-item.on { background: var(--panel-2); }
.cv-cmd-item.on b { color: var(--accent); }
.cv-cmd-item.off { opacity: .42; cursor: default; }
.cv-cmd-empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }
.cv-cmd-tip { padding: 9px 12px; color: var(--muted-2); font-size: 11px; border-top: 1px solid var(--line); }

/* 使用说明（右上角「? 说明」）：画布怎么用 + 快捷键，分组列 */
.cv-more.cv-help-btn { width: auto; min-width: 30px; padding: 0 10px 0 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.cv-more.cv-help-btn > span { font-size: 13px; font-weight: 700; }
.cv-more.cv-stage-btn { width: auto; min-width: 30px; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cv-more.cv-stage-btn.on { color: var(--accent); }
/* 左键拖拽模式开关（底部模式栏） */
#cvModePan.on, #cvModeSelect.on { color: var(--accent); background: var(--accent-soft); }
/* 底部模式栏：＋ / 移动 / 框选 / 连线（放在屏幕下方居中） */
.cv-modebar {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; padding: 3px;
  background: rgba(23, 23, 23, .94); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.cv-modebar button {
  min-width: 30px; height: 26px; padding: 0 10px; cursor: pointer; font-size: 13px;
  color: var(--muted); background: transparent; border: 0; border-radius: 7px;
}
.cv-modebar button:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
#cvModeAdd { font-size: 15px; padding: 0 8px; }
.cv-modebar .cv-sep { width: 1px; height: 16px; margin: 0 4px; background: var(--line); border-radius: 1px; }
#cvEdgesToggle.on { color: var(--accent); background: var(--accent-soft); }
/* 隐藏所有连线：只看画面（Ctrl+Shift+L / 底部「连线」） */
.cv-viewport.cv-edges-hidden .cv-edges { display: none; }
/* 框选之后冒出来的「一次全连上」圆点 */
.cv-batch-dot {
  position: absolute; z-index: 7; transform: translateY(-50%);
  width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 2px solid var(--accent); background: var(--panel-3); color: var(--accent);
  font-size: 12px; line-height: 1; cursor: crosshair; box-shadow: 0 0 0 4px rgba(4, 202, 246, .12);
}
.cv-batch-dot:hover { background: var(--accent); color: #04121a; }
/* 框选之后的选框：松手也一直看得见，右边中间是输出点（成组/解组在左边工具条上） */
.cv-selframe {
  position: absolute; z-index: 5; pointer-events: none;
  border: 1.5px dashed rgba(4, 202, 246, .75); border-radius: 10px;
  background: rgba(4, 202, 246, .05);
}
.cv-help-mask { position: fixed; inset: 0; z-index: 134; display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px 16px; background: rgba(4, 6, 10, .55); backdrop-filter: blur(3px); animation: fadeIn .12s var(--ease); }
.cv-help { width: min(780px, 100%); max-height: 82vh; display: flex; flex-direction: column; overflow: hidden; background: var(--panel-3); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); animation: popIn .14s var(--ease); }
.cv-help-head { display: flex; align-items: baseline; gap: 9px; padding: 12px 10px 12px 16px; border-bottom: 1px solid var(--line); }
.cv-help-head b { font-size: 14px; font-weight: 650; color: var(--text); }
.cv-help-sub { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); }
.cv-help-body { flex: 1; overflow: auto; padding: 4px 16px 14px; }
.cv-help-sec { padding-top: 13px; }
.cv-help-sec h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 650; color: var(--accent); }
.cv-help-sec ul { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cv-help-sec li { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; line-height: 1.65; color: var(--text); }
.cv-help-sec li::before { content: '·'; color: var(--muted-2); }
.cv-help-text { flex: 1; min-width: 0; }
.cv-help-keys { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; min-width: 124px; }
.cv-help-keys kbd { padding: 1px 5px; font: inherit; font-size: 11px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; }
.cv-help-keys i { font-style: normal; font-size: 11px; color: var(--muted-2); }
.cv-help-foot { padding: 10px 16px; color: var(--muted-2); font-size: 11.5px; border-top: 1px solid var(--line); }
@media (max-width: 620px) { .cv-help-keys { min-width: 96px; } }

/* 节点操作菜单：一条两行（名字 + 一句说明） */
.cv-node-menu { width: 240px; max-height: 72vh; overflow: auto; }
.cv-node-menu .cv-mini-item { display: block; }
.cv-node-menu .cv-mini-item b { display: block; font-size: 12.5px; font-weight: 600; }
.cv-node-menu .cv-mini-item span { display: block; margin-top: 1px; font-size: 10.5px; color: var(--muted); }
.cv-node-menu .cv-mini-item:hover span { color: var(--text); }
.cv-node-menu .cv-mini-item:disabled { opacity: .45; cursor: default; }

/* 3D 导演台 */
.cv-stage {
  width: min(1220px, calc(100vw - 40px)); max-height: 94vh; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); animation: popIn .12s var(--ease);
}
.cv-stage-sub { margin-left: 8px; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.cv-stage-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; }
.cv-stage-view { position: relative; min-height: 420px; overflow: hidden; background: #0E1117; border: 1px solid var(--line-soft); border-radius: 10px; }
.cv-stage-canvas { display: block; width: 100%; height: 520px; cursor: grab; touch-action: none; }
.cv-stage-canvas:active { cursor: grabbing; }
.cv-stage-side { display: flex; min-width: 0; max-height: 76vh; overflow: auto; flex-direction: column; gap: 8px; }
.cv-stage-side-title { color: var(--muted); font-size: 11.5px; }
.cv-stage-preview { position: relative; overflow: hidden; background: #0E1117; border: 1px solid var(--line-soft); border-radius: 10px; aspect-ratio: 16 / 9; }
.cv-stage-plan { aspect-ratio: 4 / 3; }
.cv-stage-preview-canvas { display: block; width: 100%; height: 100%; }
.cv-stage-info { color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.cv-stage-list { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow: auto; }
.cv-stage-row { position: relative; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; }
.cv-stage-row.on { border-color: var(--accent); }
.cv-stage-row-pick { display: block; width: 100%; padding: 7px 26px 7px 9px; text-align: left; background: transparent; border: 0; cursor: pointer; }
.cv-stage-row-pick b { display: block; font-size: 12px; font-weight: 600; color: var(--text); }
.cv-stage-row-pick span { display: block; font-size: 10.5px; color: var(--muted); }
.cv-stage-row.on .cv-stage-row-pick b { color: var(--accent); }
.cv-stage-in { display: inline-block; margin-top: 4px; padding: 1px 6px; font-size: 10px; font-style: normal; color: #12170D; background: #5BE08A; border-radius: 999px; }
.cv-stage-none { display: inline-block; margin-top: 4px; padding: 1px 6px; font-size: 10px; font-style: normal; color: var(--muted); background: var(--panel-3); border: 1px solid var(--line-soft); border-radius: 999px; }
.cv-stage-name-in { width: 100%; padding: 1px 4px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text); background: var(--panel-3); border: 1px solid var(--accent); border-radius: 5px; outline: none; }
.cv-stage-empty { padding: 9px; font-size: 11.5px; color: var(--muted); line-height: 1.6; background: var(--panel-2); border: 1px dashed var(--line-soft); border-radius: 8px; }
.cv-stage-row-x { position: absolute; right: 5px; top: 50%; margin-top: -9px; width: 18px; height: 18px; line-height: 1; font-size: 13px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.cv-stage-row-x:hover { color: var(--err); background: var(--panel-3); }
.cv-stage-params { display: flex; flex-direction: column; gap: 5px; }
.cv-stage-field { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.cv-stage-field input[type=number] { width: 100%; padding: 5px 7px; font: inherit; font-size: 12px; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; outline: none; }
.cv-stage-field input[type=range] { width: 100%; }
.cv-stage-field i { min-width: 40px; font-style: normal; font-size: 10.5px; color: var(--muted-2); text-align: right; }
@media (max-width: 880px) { .cv-stage-body { grid-template-columns: minmax(0, 1fr); } }

/* 框选：在空白处拖出来的选择框 */
.cv-marquee {
  position: absolute; z-index: 6; pointer-events: none;
  border: 1.5px solid rgba(4, 202, 246, .9); border-radius: 3px;
  background: rgba(4, 202, 246, .14);
}
/* 拖动节点时的对齐参考线 */
.cv-guides { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.cv-guide { position: absolute; background: #FF4D8D; box-shadow: 0 0 3px rgba(255, 77, 141, .6); }
.cv-guide.x { width: 1px; }
.cv-guide.y { height: 1px; }
/* 小地图 */
.cv-minimap { position: absolute; right: 14px; bottom: 74px; z-index: 8; width: 190px; height: 130px; padding: 4px; background: rgba(12, 14, 20, .82); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); cursor: crosshair; }
.cv-minimap canvas { display: block; width: 100%; height: 100%; }

/* 对齐菜单：八个动作，太高就滚 */
.cv-align-menu { max-height: 62vh; overflow: auto; }

/* 图片编辑：旋转 / 翻转 / 裁剪 */
.cv-img-edit {
  width: min(980px, calc(100vw - 48px)); max-height: 90vh; overflow: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); animation: popIn .12s var(--ease);
}
.cv-img-stage { position: relative; display: grid; place-items: center; min-height: 220px; padding: 4px; overflow: hidden; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-soft); border-radius: 10px; touch-action: none; }
.cv-img-stage canvas { display: block; max-width: 100%; max-height: 56vh; }
.cv-img-crop { position: absolute; border: 1px solid #FFFFFF; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); pointer-events: none; }

/* 预演播放器 */
.cv-player {
  width: min(1100px, calc(100vw - 48px)); max-height: 92vh;
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); animation: popIn .12s var(--ease);
}
.cv-player-stage { display: grid; place-items: center; min-height: 240px; max-height: 62vh; overflow: hidden; background: #08090C; border: 1px solid var(--line-soft); border-radius: 10px; }
.cv-player-stage img, .cv-player-stage video { display: block; max-width: 100%; max-height: 62vh; }
.cv-player-stage audio { width: min(420px, 80%); }
.cv-player-empty { color: var(--muted); font-size: 13px; padding: 44px 12px; }
.cv-player-caption { color: var(--text); font-size: 13px; }
.cv-player-bar { display: flex; gap: 3px; }
.cv-player-seg { flex: 1; height: 4px; border-radius: 3px; background: var(--line); }
.cv-player-seg.done { background: var(--muted-2); }
.cv-player-seg.on { background: var(--accent); }

/* 「从生成记录选择」的弹层 */
.cv-pick-mask { position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; background: rgba(4, 6, 10, .62); backdrop-filter: blur(3px); animation: fadeIn .12s var(--ease); }
.cv-pick {
  width: min(680px, calc(100vw - 48px)); max-height: 74vh; display: flex; flex-direction: column;
  padding: 14px; background: var(--panel-3); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-lg); animation: popIn .16s var(--ease);
}
.cv-pick-head { display: flex; align-items: center; margin-bottom: 10px; }
.cv-pick-head b { flex: 1; font-size: 13px; }
.cv-pick-x { width: 24px; height: 24px; font-size: 16px; line-height: 1; color: var(--muted-2); background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.cv-pick-x:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.cv-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; overflow: auto; }
.cv-pick-item { position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.cv-pick-item:hover { border-color: rgba(4, 202, 246, .55); }
.cv-pick-item img, .cv-pick-item video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cv-pick-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.cv-pick-audio { display: grid; place-items: center; width: 100%; height: 100%; color: var(--accent); }
.cv-pick-audio svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* 缩放控件 */
.cv-zoom {
  position: absolute; right: 12px; bottom: 12px; z-index: 3;
  display: flex; align-items: center; padding: 3px;
  background: rgba(23, 23, 23, .94); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); backdrop-filter: blur(8px);
}
.cv-zoom button {
  min-width: 28px; height: 26px; padding: 0 6px; cursor: pointer; font-size: 13px;
  color: var(--muted); background: transparent; border: 0; border-radius: 7px;
}
.cv-zoom button:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
#cvZoomVal { font-size: 11.5px; min-width: 46px; }

/* 空状态 */
.cv-empty {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 48px)); padding: 22px 24px; text-align: center;
  background: rgba(16, 16, 16, .82); border: 0; border-radius: var(--r-lg);
  backdrop-filter: blur(4px);
}
.cv-empty.hidden { display: none; }
.cv-empty h3 { margin: 0 0 8px; font-size: 15px; }
.cv-empty p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.cv-empty-acts { display: flex; gap: 8px; justify-content: center; }
.cv-empty-tpl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.cv-tpl-label { font-size: 11.5px; color: var(--muted-2); margin-right: 2px; }
.cv-tpl-chip {
  padding: 4px 12px; font-size: 12px; font-family: inherit; cursor: pointer;
  color: var(--muted); background: var(--raised); border: 1px solid var(--line); border-radius: 999px;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.cv-tpl-chip:hover { color: var(--text); background: var(--raised-2); border-color: var(--line-2); }
.cv-tips {
  position: absolute; left: 12px; bottom: 10px; padding: 5px 10px; font-size: 11px; color: var(--muted-2);
  background: rgba(8, 9, 13, .72); border: 1px solid var(--line-soft); border-radius: 12px; pointer-events: none;
  max-width: min(780px, calc(100vw - 340px)); line-height: 1.8;
}
/* 快捷键清单：提示面板展开时才有这块（一行一个，好扫） */
.cv-tips-keys {
  display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 7px; padding-top: 7px;
  border-top: 1px solid var(--line-soft); line-height: 1.9;
}
.cv-tips-keys b { margin-right: 2px; color: var(--muted); }
.cv-tips-keys span { white-space: nowrap; }
.cv-tips-keys kbd {
  display: inline-block; min-width: 12px; padding: 0 4px; font: inherit; font-size: 10.5px;
  color: var(--text); background: var(--panel-3); border: 1px solid var(--line); border-radius: 4px;
}

/* ---------- 弹窗（充值等） ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(4, 5, 8, .68); backdrop-filter: blur(3px); }
.modal-box {
  position: relative; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto;
  padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--panel); box-shadow: var(--shadow-lg); animation: popIn .16s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-head b { font-size: 15px; }
.modal-head .meta { margin-left: auto; }
.modal-x {
  width: 26px; height: 26px; font-size: 17px; line-height: 1; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.modal-x:hover { color: var(--text); border-color: var(--line-2); }

/* ---------- 站内输入弹窗（替代原生 prompt） ---------- */
.ui-label { margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.ui-input {
  width: 100%; height: 34px; padding: 0 10px; font-size: 13px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.ui-input:focus { border-color: rgba(4, 202, 246, .5); outline: none; }
.ui-err { min-height: 16px; margin-top: 6px; font-size: 12px; color: var(--err); }
.ui-hint { font-size: 12px; line-height: 1.6; color: var(--muted-2); }
.ui-text { font-size: 13px; line-height: 1.7; color: var(--muted); }
.ui-acts { display: flex; gap: 8px; margin-top: 14px; }
.ui-acts .btn { flex: 1; text-align: center; }
.pay-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-tier {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 6px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text);
}
.pay-tier b { font-size: 15px; }
.pay-tier span { font-size: 10.5px; color: var(--muted-2); }
.pay-tier:hover { border-color: var(--line-2); }
.pay-tier.active { border-color: var(--accent); background: rgba(4, 202, 246, .12); }
/* 套餐卡：基础 + 赠送 拆分显示，角标和不可购买态 */
.pay-tier i { font-size: 10px; font-style: normal; color: var(--muted-2); }
.pay-tier em {
  position: absolute; top: -7px; right: 6px; font-style: normal; font-size: 9.5px; padding: 1px 6px;
  border-radius: 999px; color: var(--accent); background: rgba(4, 202, 246, .12); border: 1px solid rgba(4, 202, 246, .3);
}
.pay-tier { position: relative; }
.pay-tier.off { opacity: .45; cursor: not-allowed; }
.pay-tier.off:hover { border-color: var(--line); }
.pay-custom { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-size: 12.5px; color: var(--muted); }
.pay-custom input {
  flex: 1; height: 32px; padding: 0 10px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.pay-chs { display: flex; gap: 8px; margin: 12px 0 4px; }
.pay-ch {
  padding: 7px 14px; font-size: 12.5px; color: var(--muted); cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
}
.pay-ch.active { color: var(--text); border-color: var(--accent); background: rgba(4, 202, 246, .12); }
.pay-amount-line { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.pay-amount-line b { font-size: 17px; }
/* 支付二维码：白底是必须的（暗色主题下二维码扫不出来），所以这里固定白底黑点 */
.pay-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 12px 0 6px; }
.pay-qr-canvas {
  padding: 10px; background: #fff; border-radius: 12px; line-height: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.pay-qr-canvas canvas { display: block; border-radius: 4px; }
.pay-qr-hint { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; }
.pay-target { margin: 10px 0; }
.pay-target input {
  width: 100%; height: 34px; padding: 0 10px; margin-bottom: 8px; font-size: 12px;
  color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.pay-acts { display: flex; gap: 8px; margin-top: 10px; }
.pay-acts .btn { flex: 1; text-align: center; text-decoration: none; }
.pay-state { margin-top: 12px; line-height: 1.7; word-break: break-all; }
.pay-state code { padding: 1px 5px; background: var(--panel-3); border-radius: 5px; color: var(--muted); }

/* 下拉（值优先：胶囊里只显示当前值，说明放进菜单） */
.dd { position: relative; display: inline-flex; align-items: center; }
.dd-btn {
  background: transparent; border: 0; color: var(--text); font: inherit; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; padding: 2px 0; max-width: 190px;
}
.dd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-val.dd-empty { color: var(--muted-2); }
.dd-caret { color: var(--muted-2); font-size: 9px; transition: transform .16s var(--ease); }
.dd-btn.open .dd-caret { transform: rotate(180deg); }
.dd-menu {
  position: fixed; z-index: 60; min-width: 220px; max-width: 340px; max-height: 340px; overflow: auto;
  overscroll-behavior: contain; /* 滚到菜单边界不要把页面带着滚（否则菜单会飞） */
  background: #1b1b1b; border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); display: none;
}
.dd-menu.open { display: block; animation: rise .16s var(--ease); }
.dd-opt { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.dd-opt:hover { background: var(--panel-3); }
.dd-opt b { font-weight: 500; font-size: 12.5px; color: var(--text); }
.dd-opt i { font-style: normal; font-size: 11px; color: var(--muted-2); line-height: 1.45; }
.dd-opt.on b { color: var(--accent-2); }
.dd-opt.off { opacity: .45; cursor: not-allowed; }
.dd-opt.off:hover { background: transparent; }
.choice.off { opacity: .4; cursor: not-allowed; }
.choice.off:hover { border-color: var(--line); color: var(--muted); }
.dd-title { font-size: 12px; color: var(--muted); padding: 4px 10px 2px; }
.dd-hint { font-size: 11px; color: var(--muted-2); padding: 6px 10px 2px; }
.size-menu { min-width: 272px; }
.size-presets { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 8px; }
.size-line { display: flex; align-items: center; gap: 6px; padding: 4px 8px 6px; }
.size-line input { width: 78px; }
.size-x { color: var(--muted-2); font-size: 12px; }
.composer-foot {
  display: flex; align-items: center; justify-content: flex-start; gap: 14px;
  border-top: 1px solid var(--line-soft); padding-top: 10px;
}
.composer-foot > button { margin-left: auto; }
.composer-foot .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-foot .btn.primary {
  padding: 9px 26px; border-radius: 10px; letter-spacing: .5px;
  box-shadow: 0 8px 24px rgba(4, 202, 246, .32);
}
.results .task-card .head { font-size: 12px; }
.results .task-card .links { margin-top: 10px; flex-wrap: wrap; }
.task-acts a { color: var(--muted) !important; padding: 4px 12px; border: 1px solid var(--line); border-radius: 8px; }
.task-acts a:hover { color: var(--text) !important; border-color: var(--line-2); background: var(--panel-3); }

/* 上传类参数：一个「+」方块（参考图 / 首帧图 / 音频） */
.composer-bar .param.up {
  background: transparent; border: 0; padding: 0; height: auto; gap: 8px; flex-wrap: wrap;
}
.upload-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upload-tile {
  position: relative; overflow: hidden; width: 52px; height: 52px; flex: 0 0 52px;
  border: 1px dashed var(--line-2); border-radius: 12px; display: grid; place-items: center;
  background: rgba(23, 23, 23, .55); cursor: pointer; transition: all .16s var(--ease);
}
.upload-tile:hover { border-color: var(--accent); background: rgba(4, 202, 246, .08); }
.upload-tile input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-tile .plus { font-size: 20px; line-height: 1; color: var(--muted); pointer-events: none; }
.upload-preview { display: flex; gap: 6px; flex-wrap: wrap; }
.upload-preview img { width: 52px; height: 52px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

/* --- 窄屏 --- */
@media (max-width: 1100px) {
  .panel-side { width: 256px; flex-basis: 256px; }
}
@media (max-width: 860px) {
  body.panel-closed .panel-side, .panel-side { width: 0; flex-basis: 0; border-right: 0; overflow: hidden; }
  .work { grid-template-columns: 1fr; }
  .quickrow { grid-template-columns: repeat(3, 1fr); }
  .composer-bar .param { min-width: 110px; }
}

/* ============================================================
   运营中心下发到前台的内容（公告 / 横幅 / 通知）—— 由 notice.js 渲染
   放在公共 style.css 里，工作台和官网首页共用同一套外观；
   各页的排版差异（内边距等）写在各页自己的 css 里。
   ============================================================ */
.nb-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid rgba(4, 202, 246, .28); background: rgba(4, 202, 246, .07); color: var(--text);
  font-size: 13px; line-height: 1.5;
}
.nb-bar.pin { border-color: rgba(255, 176, 32, .35); background: rgba(255, 176, 32, .07); }
.nb-bar b { font-weight: 600; white-space: nowrap; }
.nb-bar span { color: var(--muted); flex: 1; min-width: 0; }
.nb-bar .nb-more { color: var(--accent); text-decoration: none; white-space: nowrap; font-size: 12.5px; }
.nb-bar .nb-x {
  border: 0; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 16px;
  line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.nb-bar .nb-x:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

.nb-card {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--text);
  transition: border-color .16s var(--ease);
}
.nb-card:hover { border-color: rgba(4, 202, 246, .5); }
.nb-card img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; flex: 0 0 64px; }
.nb-card-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nb-card-txt b { font-size: 13.5px; }
.nb-card-txt span { font-size: 12px; color: var(--muted); }
.nb-card-txt em { font-style: normal; font-size: 12px; color: var(--accent); }

/* 顶栏通知入口 */
.nb-msg-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid transparent; background: transparent;
  cursor: pointer; color: var(--muted);
}
.nb-msg-btn:hover { background: var(--panel-2); color: var(--text); }
.nb-msg-ico { font-size: 16px; }
.nb-dot {
  position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: #08131a; background: var(--accent); border-radius: 999px;
}

/* 公告弹窗 / 公告与通知列表 */
.nb-pop-body { font-size: 13px; line-height: 1.75; color: var(--muted); max-height: 46vh; overflow: auto; }
.nb-pop-body p { margin: 0 0 8px; }
.nb-pop-body p:last-child { margin-bottom: 0; }
.nb-msgs-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; }
.nb-sec { display: flex; flex-direction: column; gap: 8px; }
.nb-sec-t { font-size: 11.5px; color: var(--muted-2); letter-spacing: .3px; }
.nb-msg {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02); cursor: pointer;
}
.nb-msg:hover { border-color: rgba(4, 202, 246, .35); }
.nb-msg.read { opacity: .6; }
.nb-msg-head { display: flex; align-items: baseline; gap: 8px; }
.nb-msg-head b { font-size: 13px; }
.nb-msg b { font-size: 13px; }
.nb-msg p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.nb-msg-time { font-size: 11px; color: var(--muted-2); margin-left: auto; white-space: nowrap; }
.nb-msg .nb-more { font-size: 12px; color: var(--accent); text-decoration: none; }
/* 公告列表（只读卡片，没有已读态） */
.nb-ann {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02);
}
.nb-ann b { font-size: 13px; }
.nb-ann p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.nb-ann .nb-more { font-size: 12px; color: var(--accent); text-decoration: none; }

/* 充值弹窗里的活动块 */
.nb-camps {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(53, 211, 154, .3); background: rgba(53, 211, 154, .07);
}
.nb-camps-t { font-size: 11.5px; color: var(--muted-2); letter-spacing: .3px; }
.nb-camp { display: flex; flex-direction: column; gap: 3px; }
.nb-camp-head { display: flex; align-items: baseline; gap: 8px; }
.nb-camp-head b { font-size: 13px; }
.nb-camp-tag { font-size: 11px; color: var(--muted-2); }
.nb-camp p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; white-space: pre-wrap; }



