/* Creative Board — LibTV 风格深色无限画布 · by Legend */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0b0d12;
  --panel: #141820;
  --panel-2: #1a1f2b;
  --card: #191c23;
  --card-border: #2a2e38;
  --border: #262c3a;
  --border-light: #333b4d;
  --text: #e6e9f0;
  --text-dim: #8b93a5;
  --accent: #e2dbc8;
  --accent-ink: #17191f;
  --accent-soft: rgba(226, 219, 200, .14);
  --danger: #f2555a;
  --ok: #22c55e;
  --c-image: #22c55e;
  --c-text: #f5a623;
  --c-video: #a855f7;
  --c-model3d: #2dd4bf;
  --c-audio: #38bdf8;
  --radius: 12px;
}
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 13px;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
.ic { display: inline-flex; width: 100%; height: 100%; }
.ic svg { width: 100%; height: 100%; }

/* ---------- 顶栏 ---------- */
/* ---------- 顶部栏(浮动双面板,不再固定横铺) ---------- */
#topbar {
  position: fixed; top: 14px; left: 14px; right: 14px;
  z-index: 50; height: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; pointer-events: none;
  background: none; border: none; backdrop-filter: none; padding: 0;
}
#topbar > * { pointer-events: auto; }
.topbar-left, .topbar-right {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: rgba(13, 16, 22, .88); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .38);
}
/* 左侧:logo(按钮) + 项目名(可点击改名) */
.topbar-left .brand {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--text);
  font-size: 14px; font-weight: 600; padding: 0; cursor: pointer;
  transition: opacity .15s;
}
.topbar-left .brand:hover { opacity: .85; }
.topbar-left .brand svg { display: block; border-radius: 5px; }
.proj-sep { color: var(--text-dim); opacity: .45; font-size: 13px; }
.pn {
  font-size: 13px; color: var(--text); padding: 4px 10px;
  border-radius: 8px; cursor: text; border: 1px solid transparent;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.pn:hover { border-color: var(--border); background: rgba(255,255,255,.04); }
.pn.hidden { display: none; }
.pn .pn-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; vertical-align: 1px; }
.pn .pn-dot.saving { background: var(--accent); }
.pn .pn-dot.error { background: var(--danger); }
/* 右侧:工具按钮区 + 账户区(独立分组,样式区分) */
.topbar-tools { display: flex; align-items: center; gap: 6px; padding-right: 10px; border-right: 1px solid var(--border); }
.tbtool {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 11px; font-size: 12px; transition: .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.tbtool:hover { border-color: var(--border-light); background: #212836; }
.tbtool.danger:hover { border-color: var(--danger); color: var(--danger); }
.tbtool svg { width: 13px; height: 13px; }
.tbtool.ann-bell { position: relative; }
.ann-badge { position: absolute; top: -2px; right: -2px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--danger); color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }
.ann-badge.hidden { display: none; }
/* 账户区(独立 chip 风格,避免与工具按钮混淆) */
.topbar-account { display: inline-flex; align-items: center; gap: 6px; padding-left: 2px; }
.topbar-account .uc {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text); margin-right: 0;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(226, 219, 200, .08); border: 1px solid rgba(226, 219, 200, .22);
  cursor: pointer;
}
.topbar-account .uc:hover { background: rgba(226, 219, 200, .14); }
.topbar-account .uc .uc-mail { color: var(--text); max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account .uc .uc-bal { color: var(--accent); font-weight: 600; }
.topbar-account .uc.hidden { display: none; }
/* 容量 chip(独立可点击,跳转个人空间) */
.topbar-account .uc-media {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text);
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.topbar-account .uc-media:hover { border-color: var(--accent); background: rgba(226, 219, 200, .08); }
.topbar-account .uc-media.hidden { display: none; }
/* 头像(圆形,首字母) */
.topbar-account .account-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #d6cdb5);
  color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex: none;
}
.topbar-account #btn-auth {
  background: var(--accent); color: var(--accent-ink); border: none;
  border-radius: 999px; padding: 5px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.topbar-account #btn-auth:hover { background: #efe9db; }
/* 公告按钮(账户区最右) */
.topbar-account .ann-bell { padding: 5px 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 2px; }
.dot.on { background: var(--ok); }

/* 个人空间看板弹窗(需求9) */
.space-card { max-width: 400px; }
.sp-bar { height: 8px; border-radius: 99px; background: #0f131b; overflow: hidden; margin: 4px 0 8px; }
.sp-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .3s; }
.sp-bar i.warn { background: #d09a35; }
.sp-bar i.danger { background: var(--danger); }
.sp-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.sp-line .sp-percent { color: var(--text-dim); font-size: 12px; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 6px; }
.sp-item { background: #0f131b; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.sp-item b { font-size: 15px; }
.sp-item span { font-size: 11px; color: var(--text-dim); }
.sp-price { font-size: 12px; color: var(--text-dim); align-self: center; }
.modal-actions .tbtn:disabled { opacity: .45; cursor: not-allowed; }

/* 登录/注册弹窗 */
.auth-card { max-width: 380px; }
.auth-card .hint { font-size: 12px; color: var(--text-dim); line-height: 1.7; margin: 2px 0 4px; }
.auth-card .hint b { color: var(--accent); }
.auth-tip { display: none; font-size: 12px; color: var(--text-dim); margin: 8px 0 0; }
.auth-tip.show { display: block; }
.auth-tip.err { color: var(--danger); }
.tbtn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; transition: .15s;
}
.tbtn:hover { border-color: var(--border-light); background: #212836; }
.tbtn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.tbtn.primary:hover { background: #efe9db; }
.tbtn.danger:hover { border-color: var(--danger); color: var(--danger); }
.tbtn svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }

/* ---------- 画布视口 ---------- */
#viewport {
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, #1d2432 1px, transparent 1px);
  background-size: 26px 26px;
  cursor: default;
}
#viewport.panning { cursor: grabbing; }

/* 框选矩形(左键空白拖动) */
.marquee-rect {
  position: absolute; z-index: 60; pointer-events: none;
  border: 1px dashed var(--accent);
  background: rgba(226, 219, 200, .07);
  border-radius: 2px;
}
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#edges { position: absolute; left: 0; top: 0; width: 10px; height: 10px; overflow: visible; pointer-events: none; }
#edges path.edge-hit { pointer-events: stroke; cursor: pointer; }
#nodes { position: absolute; left: 0; top: 0; }

#empty-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
#empty-hint.hidden { display: none; }
.eh-card { text-align: center; opacity: .75; }
.eh-title { font-size: 16px; margin-bottom: 8px; }
.eh-sub { font-size: 12px; color: var(--text-dim); }

/* ---------- 节点基座 ---------- */
.node { position: absolute; user-select: none; isolation: isolate; }
.node.media, .node.util, .node.annotation { background: transparent; }
.node-body { position: relative; z-index: 2; }
/* 节点内所有原生文本滚动区在到达边界时也不把滚轮链传给画布。 */
.node textarea,
.node [contenteditable="true"] { overscroll-behavior: contain; }

/* 所有节点统一的左上角拖动抓手：
 * 参考图样式为贴在节点圆角下方的绿色直角三角，透明按钮只负责命中拖动。 */
.node::before {
  content: ""; position: absolute; top: -1px; left: -1px; z-index: 1;
  width: 17px; height: 17px;
  background: #20c86a;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  filter: drop-shadow(0 1px 5px rgba(20, 210, 111, .22));
  pointer-events: none;
  transition: background .15s, filter .15s;
}
.node-drag-handle {
  position: absolute; top: -1px; left: -1px; z-index: 14;
  width: 17px; height: 17px; padding: 0;
  border: 0; border-radius: 0; background: transparent;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  cursor: grab;
}
.node:hover::before, .node.selected::before {
  background: #31dc7c;
  filter: drop-shadow(0 2px 7px rgba(32, 200, 106, .4));
}
.node-drag-handle:active { cursor: grabbing; }

/* 浮动标签(左上名称 / 右上分辨率):无胶囊背景,图标+文字,与节点左对齐 */
.mf {
  position: absolute; z-index: 4;
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: rgba(255, 255, 255, .75);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .9);
  pointer-events: none; white-space: nowrap;
}
.mf .ic { width: 12px; height: 12px; opacity: .9; }
.mf-tl {
  top: -22px; left: 1px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}
.mf-tl .ic { width: 13px; height: 13px; color: var(--accent); opacity: 1; }
.mf-tl .mf-name { font-size: 11px; font-weight: 500; }
.mf-tl .mf-cost {
  font-size: 10.5px; font-weight: 400; color: var(--accent);
  padding: 1px 7px; margin-left: 4px; border-radius: 999px;
  background: rgba(226, 219, 200, .1);
}
.mf-tl:has(.mf-name.editable) { pointer-events: auto; }
.mf-name.editable {
  min-width: 28px; max-width: 240px; overflow: hidden; text-overflow: ellipsis;
  outline: none; cursor: text; pointer-events: auto; user-select: text;
  border-radius: 4px; padding: 1px 3px; margin-left: -3px;
}
.mf-name.editable:hover, .mf-name.editable:focus {
  color: #fff; background: rgba(20, 24, 32, .88);
  box-shadow: 0 0 0 1px var(--border-light);
}
.mf-tr { top: -22px; right: 2px; font-size: 10.5px; color: rgba(255, 255, 255, .45); }

/* 节点类型标签(所有节点统一:图标+文字,无胶囊背景,与节点左对齐) */
.node-type-tag {
  position: absolute; top: -22px; left: 1px; z-index: 6;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  pointer-events: none; white-space: nowrap;
}
.node-type-tag .ic { width: 13px; height: 13px; color: var(--accent); opacity: 1; display: block; }

/* 悬停删除小叉(浮窗 / 提示词卡) */
.node-x {
  position: absolute; top: -24px; right: 0; z-index: 6;
  width: 18px; height: 18px; border-radius: 6px;
  background: none; border: none; color: var(--text-dim);
  font-size: 13px; line-height: 1; opacity: 0; transition: .15s;
}
.node:hover .node-x { opacity: 1; }
.node-x:hover { color: var(--danger); background: rgba(242, 85, 90, .12); }

/* ---------- 边缘端口 ---------- */
.port {
  position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%;
  transform: translateY(-50%);
  background: var(--bg); border: 2px solid var(--text-dim);
  cursor: crosshair; transition: transform .12s, background .12s, opacity .15s; z-index: 6;
}
.port[data-type="image"] { border-color: var(--c-image); }
.port[data-type="text"] { border-color: var(--c-text); }
.port[data-type="video"] { border-color: var(--c-video); }
.port[data-type="model3d"] { border-color: var(--c-model3d); }
.port[data-type="audio"] { border-color: var(--c-audio); }
.port:hover, .port.compatible { transform: translateY(-50%) scale(1.4); background: #fff; }
.port.connected { background: var(--text-dim); }
.port[data-type="image"].connected { background: var(--c-image); }
.port[data-type="text"].connected { background: var(--c-text); }
.port[data-type="video"].connected { background: var(--c-video); }
.port[data-type="model3d"].connected { background: var(--c-model3d); }
.port[data-type="audio"].connected { background: var(--c-audio); }
.eport.in { left: -5px; }
.eport.out { right: -5px; }
/* 反推节点参考维度端口旁的可见文字 */
.port-label {
  position: absolute; left: 10px; z-index: 6;
  transform: translateY(-50%);
  font-size: 10px; line-height: 1; color: var(--text-dim);
  pointer-events: none; white-space: nowrap;
  background: rgba(20, 24, 32, .72); padding: 1px 5px; border-radius: 4px;
}
/* 反推节点:左侧留白给参考维度端口文字,避免与卡片内容重叠 */
.cmp-card.i2p-card { padding-left: 64px; }
/* 媒体/提示词节点:悬停或已连接时显示端口 */
.node.media .eport, .node.util .eport, .node.annotation .eport { opacity: 0; }
.node.media:hover .eport, .node.util:hover .eport, .node.annotation:hover .eport,
.node.media .eport.connected, .node.util .eport.connected,
.node.annotation .eport.connected { opacity: 1; }

/* ---------- 直接文本标注 ---------- */
.text-note-editor {
  min-height: 48px; padding: 4px 6px; color: var(--text);
  line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere;
  outline: none; cursor: text; user-select: text;
  border: 1px solid transparent; border-radius: 7px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .65);
}
.text-note-editor:empty::before {
  content: attr(data-placeholder); color: rgba(139, 147, 165, .65);
}
.node.annotation.selected .text-note-editor,
.node.annotation:hover .text-note-editor {
  border-color: rgba(226, 219, 200, .2);
  background: rgba(20, 24, 32, .18);
}
.text-note-toolbar {
  position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 12;
  display: flex; align-items: center; gap: 4px;
  transform: translateX(-50%); white-space: nowrap;
  padding: 5px; border-radius: 10px;
  background: rgba(20, 24, 32, .97); border: 1px solid var(--border-light);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: .15s;
}
.node.annotation:hover .text-note-toolbar,
.node.annotation.selected .text-note-toolbar {
  opacity: 1; pointer-events: auto;
}
.text-note-toolbar select,
.text-note-toolbar input[type="number"] {
  height: 27px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0 6px; font-size: 11px; outline: none;
}
.text-note-toolbar select { max-width: 130px; }
.type-size { width: 54px; }
.type-tool {
  height: 27px; min-width: 27px; padding: 0 7px;
  color: var(--text-dim); background: transparent;
  border: none; border-radius: 6px; font-size: 11px;
}
.type-tool:hover, .type-tool.active {
  color: var(--text); background: var(--panel-2);
}
.type-tool.active { color: var(--accent); box-shadow: inset 0 0 0 1px var(--border-light); }

.text-note-toolbar input[type="color"] {
  width: 27px; height: 27px; padding: 2px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2);
}

/* ---------- 媒体节点(内容全幅) ---------- */
.rmedia { position: relative; }
.rmedia-el {
  display: block; width: 100%; border-radius: 10px;
  background: #0f131b; border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .5);
}
video.rmedia-el { max-height: 460px; cursor: pointer; }
/* 音频结果播放器:占满卡片宽,深色底 */
audio.rmedia-el.rmedia-audio {
  width: 100%; height: 44px; display: block; margin-top: 6px;
  background: #0f131b; border-radius: 10px;
}
audio.rmedia-el.rmedia-audio::-webkit-media-controls-panel { background: #1a1f2b; }
audio.rmedia-el.rmedia-audio::-webkit-media-controls-enclosure { border-radius: 10px; }

/* 视频中央播放角标(暂停时显示,单击视频切换播放/暂停) */
.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 16, 22, .62); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .22); color: #fff;
  pointer-events: none; transition: opacity .18s, transform .18s;
}
.play-badge .ic { width: 22px; height: 22px; margin-left: 2px; }
.play-badge.hidden { opacity: 0; transform: translate(-50%, -50%) scale(.8); }

/* 3D 预览视图区 */
.m3d-view {
  position: relative; width: 100%; border-radius: 10px; overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(70, 84, 115, .55), rgba(13, 16, 23, .95) 72%),
    #0d1017;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 10px 32px rgba(0, 0, 0, .5);
  cursor: grab;
}
.m3d-view:active { cursor: grabbing; }
.m3d-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
/* 视图区右下角 2D 自由拉伸手柄(宽+高) */
.m3d-rz { z-index: 6; opacity: 0; transition: .15s; color: var(--text-dim); }
.m3d-view:hover .m3d-rz { opacity: .9; }
.m3d-rz:hover { color: var(--accent); }
.m3d-loading {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 12px; background: rgba(13, 16, 23, .55);
  pointer-events: none;
}
/* 加载/解析失败态:放开点击(重试按钮),文本换行 + 重试按钮纵向排布 */
.m3d-loading.m3d-err {
  pointer-events: auto; flex-direction: column; gap: 10px;
  padding: 18px 16px; text-align: center;
}
.m3d-err-text { line-height: 1.6; word-break: break-all; }
.m3d-retry {
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08);
  color: var(--text); border-radius: 6px; padding: 5px 20px; font-size: 12px;
  cursor: pointer; transition: .15s; font-family: inherit;
}
.m3d-retry:hover { background: var(--accent); border-color: var(--accent); color: #14161c; }
.node.media.selected .m3d-view { box-shadow: 0 0 0 2px var(--accent), 0 10px 32px rgba(0, 0, 0, .5); }
.node.media.selected .rmedia-el,
.node.media.selected .img-grid .img-cell:first-child { box-shadow: 0 0 0 2px var(--accent), 0 10px 32px rgba(0, 0, 0, .5); }

/* 3D 预览:左视窗 + 右操控面板(flex) */
.m3d-row { display: flex; gap: 8px; align-items: stretch; }
.m3d-row .m3d-view { flex: none; }
.m3d-panel {
  width: 218px; flex: none; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(22, 25, 32, .96); border: 1px solid var(--border-light);
  border-radius: 10px; padding: 10px; font-size: 11.5px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .5);
  scrollbar-width: thin;
}
.m3d-sec { margin-bottom: 12px; }
.m3d-sec:last-child { margin-bottom: 2px; }
.m3d-sec-t {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  padding-bottom: 4px; margin-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.m3d-r { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.m3d-r > label { width: 40px; flex: none; font-size: 11px; color: var(--text-dim); }
.m3d-r input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); cursor: pointer; }
.m3d-r select {
  flex: 1; min-width: 0; background: #0f131b; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 4px 6px;
  font-size: 11px; outline: none; font-family: inherit;
}
.m3d-r input[type=number] {
  width: 100%; min-width: 0; background: #0f131b; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 3px 4px;
  font-size: 11px; outline: none; font-family: inherit;
}
.m3d-r input[type=number]:focus { border-color: var(--accent); }
.m3d-r input[type=color] {
  width: 26px; height: 22px; flex: none; padding: 0; cursor: pointer;
  background: none; border: 1px solid var(--border); border-radius: 5px;
}
.m3d-val { width: 34px; flex: none; text-align: right; font-size: 11px; color: var(--text-dim); }
.m3d-xyz { display: flex; gap: 4px; flex: 1; min-width: 0; }
.m3d-btns { gap: 6px; flex-wrap: wrap; }
.m3d-ratios { flex-wrap: wrap; }
.m3d-btn {
  border: 1px solid var(--border-light); background: rgba(255, 255, 255, .06);
  color: var(--text); border-radius: 6px; padding: 4px 9px; font-size: 11px;
  cursor: pointer; transition: .12s; font-family: inherit;
}
.m3d-btn:hover { border-color: var(--accent); color: var(--accent); }
.m3d-btn.sm { padding: 3px 7px; }
.m3d-btn.cur { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.m3d-x {
  flex: none; width: 20px; height: 20px; line-height: 1; font-size: 13px;
  border: 1px solid var(--border); background: none; color: var(--text-dim);
  border-radius: 5px; cursor: pointer; transition: .12s; font-family: inherit;
}
.m3d-x:hover { color: var(--danger); border-color: var(--danger); }
/* 摄像机记录点(书签)chips */
.m3d-bms { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.m3d-bm {
  display: inline-flex; align-items: center; gap: 3px;
  min-width: 24px; padding: 2px 4px 2px 8px; border-radius: 6px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--border-light);
  color: var(--text); font-size: 11px; cursor: pointer; transition: .12s;
}
.m3d-bm:hover { border-color: var(--accent); color: var(--accent); }
.m3d-bm b { font-size: 12px; line-height: 1; padding: 0 3px; color: var(--text-dim); }
.m3d-bm b:hover { color: var(--danger); }

/* 悬停工具条(浮现于节点上方) */
.media-toolbar {
  position: absolute; bottom: calc(100% + 26px); left: 50%; transform: translateX(-50%);
  z-index: 9; display: flex; gap: 2px; white-space: nowrap;
  background: rgba(22, 25, 32, .96); backdrop-filter: blur(10px);
  border: 1px solid var(--border-light); border-radius: 11px; padding: 4px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: .15s;
}
.node.media:hover .media-toolbar,
.media-toolbar.tb-on { opacity: 1; pointer-events: auto; }
.mtb-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--text-dim);
  font-size: 11.5px; padding: 5px 9px; border-radius: 7px; transition: .12s;
}
.mtb-btn:hover { background: var(--panel-2); color: var(--text); }
.mtb-btn.danger:hover { color: var(--danger); background: rgba(242, 85, 90, .1); }
.mtb-btn .ic { width: 13px; height: 13px; }

/* 占位(无内容时) */
.media-ph {
  border: 1.5px dashed var(--border-light); border-radius: 12px;
  padding: 34px 14px; text-align: center; color: var(--text-dim); font-size: 12px;
  cursor: pointer; transition: .15s; background: rgba(20, 24, 32, .45);
}
.media-ph:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* 图片节点多图 */
.img-grid { display: grid; gap: 6px; }
.img-grid.c1 { grid-template-columns: 1fr; }
.img-grid.c2 { grid-template-columns: 1fr 1fr; }
.img-cell {
  position: relative; border-radius: 10px; overflow: hidden;
  background: #0f131b; border: 1px solid rgba(255, 255, 255, .08);
}
.img-cell img { display: block; width: 100%; cursor: zoom-in; }
.img-cell .rm {
  position: absolute; top: 4px; right: 4px; width: 18px; height: 18px;
  border-radius: 6px; background: rgba(10, 12, 18, .82);
  border: 1px solid var(--border-light); color: var(--text);
  font-size: 11px; line-height: 1; opacity: 0; transition: .12s; z-index: 2;
}
.img-cell:hover .rm { opacity: 1; }
.img-cell .rm:hover { color: var(--danger); border-color: var(--danger); }
.img-add {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; border: 1.5px dashed var(--border-light); border-radius: 10px;
  color: var(--text-dim); cursor: pointer; font-size: 18px; transition: .12s;
}
.img-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- 提示词浮窗(composer) ---------- */
.cmp-card {
  position: relative;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 14px; padding: 10px 12px 11px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5);
  transition: border-color .15s;
}
.node.composer.selected .cmp-card { border-color: var(--accent); }
.node.composer {
  display: flex; flex-direction: column; cursor: grab;
}
.node.composer:active { cursor: grabbing; }
/* 所有节点支持高度拉伸:resized-h 时节点/内容区撑满 */
.node.resized-h { display: flex; flex-direction: column; }
.node.resized-h > .node-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.node.resized-h > .node-body > .util-card,
.node.resized-h > .node-body > .cmp-card {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.node.resized-h > .node-body > .util-card textarea,
.node.resized-h > .node-body > .cmp-card .cmp-ta.ce-ta {
  flex: 1 1 auto; min-height: 0; resize: none;
}
.node.resized-h > .node-body > .pc-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.node.resized-h > .node-body > .pc-wrap .pc-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.node.resized-h.annotation .text-note-editor { height: 100%; }

/* chips 行 */
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cmp-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #22262f; border: 1px solid #2e333f; color: var(--text-dim);
  font-size: 11px; padding: 4px 9px; border-radius: 7px; transition: .12s;
}
.cmp-chip:hover { color: var(--text); border-color: #3d4350; }
.cmp-chip .ic { width: 11px; height: 11px; }
.cmp-chip .chv { width: 9px; height: 9px; opacity: .7; }

/* 参考图缩略图 */
.cmp-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cmp-ref {
  position: relative; width: 44px; height: 44px;
  border-radius: 8px; overflow: hidden; border: 1px solid #2e333f;
}
.cmp-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmp-ref .rm {
  position: absolute; top: 2px; right: 2px; width: 14px; height: 14px;
  border-radius: 4px; background: rgba(10, 12, 18, .85); border: none;
  color: var(--text); font-size: 10px; line-height: 1; opacity: 0; transition: .12s;
}
.cmp-ref:hover .rm { opacity: 1; }
.cmp-ref .rm:hover { color: var(--danger); }
.cmp-ref .lk {
  position: absolute; left: 2px; bottom: 2px;
  font-size: 9px; color: var(--c-image);
  background: rgba(10, 12, 18, .85); padding: 0 4px; border-radius: 4px;
}
/* 参考图序号角标(图N,与多图传参顺序一致) */
.cmp-ref .num {
  position: absolute; left: 2px; top: 2px; z-index: 1;
  font-size: 9px; color: var(--accent);
  background: rgba(10, 12, 18, .85); padding: 0 4px; border-radius: 4px;
  pointer-events: none;
}
/* 参考图拖拽排序 */
.cmp-ref.sortable { cursor: grab; }
.cmp-ref.sortable:active { cursor: grabbing; }
.cmp-ref.dragging { opacity: .35; }
.cmp-ref.drop-l { box-shadow: inset 3px 0 0 var(--accent); }
.cmp-ref.drop-r { box-shadow: inset -3px 0 0 var(--accent); }

/* 专用图片工具节点:高清超分 / 局部重绘 */
.tool-card { min-width: 286px; }
.tool-engine {
  margin-left: auto; align-self: center; color: var(--text-dim);
  font-size: 10.5px; white-space: nowrap;
}
.tool-preview {
  position: relative; width: 100%; max-height: 170px; margin: 3px 0 10px;
  overflow: hidden; border: 1px solid var(--border-light); border-radius: 9px;
  background: #0e1118;
}
.tool-preview img { display: block; width: 100%; max-height: 170px; object-fit: contain; }
.tool-preview-badge {
  position: absolute; left: 7px; bottom: 7px;
  padding: 3px 7px; border-radius: 999px; color: #fff; font-size: 10px;
  background: rgba(255, 42, 64, .82); box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
.tool-settings {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 4px 0 8px; color: var(--text-dim); font-size: 11.5px;
}
.tool-settings select {
  min-width: 88px; padding: 5px 24px 5px 9px;
  border: 1px solid var(--border-light); border-radius: 7px;
  background: var(--panel-2); color: var(--text); outline: none;
}
.cbtn.static { cursor: default; }
.mask-open { color: #ff7788; border-color: rgba(255, 68, 91, .28); }

/* 局部重绘蒙版画板 */
.mask-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 28px;
  background: rgba(5, 7, 11, .84); backdrop-filter: blur(9px);
}
.mask-panel {
  display: flex; flex-direction: column; width: min(1040px, 94vw); max-height: 92vh;
  padding: 16px; border: 1px solid var(--border-light); border-radius: 15px;
  background: #171a22; box-shadow: 0 28px 90px rgba(0, 0, 0, .7);
}
.mask-head { display: flex; align-items: baseline; gap: 14px; margin: 0 2px 12px; }
.mask-title { color: var(--text); font-size: 15px; font-weight: 600; }
.mask-help { color: var(--text-dim); font-size: 11.5px; }
.mask-stage {
  position: relative; align-self: center; max-width: 100%;
  max-height: calc(92vh - 128px); overflow: hidden; border-radius: 10px;
  background:
    linear-gradient(45deg, #222631 25%, transparent 25%),
    linear-gradient(-45deg, #222631 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222631 75%),
    linear-gradient(-45deg, transparent 75%, #222631 75%), #151820;
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.mask-stage canvas {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: block;
  /* 尺寸由内联 style 按原图等比设置,禁止 CSS 强制拉伸填满 stage(保持原图比例) */
}
.mask-layer { cursor: none; touch-action: none; opacity: .5; }
.brush-outline {
  position: absolute; border: 1.5px solid rgba(255,255,255,.9); border-radius: 50%;
  pointer-events: none; z-index: 10; box-shadow: 0 0 0 1px rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.2);
}
.mask-controls {
  display: flex; align-items: center; gap: 7px; padding-top: 12px;
}
.mask-controls button {
  border: 1px solid var(--border-light); border-radius: 7px; padding: 6px 12px;
  background: var(--panel-2); color: var(--text-dim); font-size: 11.5px;
}
.mask-controls button:hover, .mask-controls button.on { color: var(--text); border-color: #ff536a; }
.mask-controls button.primary { color: #fff; border-color: #ef3f58; background: #d9364f; }
.mask-controls input[type="range"] { width: 130px; accent-color: #ff536a; }
.mask-control-label { color: var(--text-dim); font-size: 11px; margin-left: 4px; }
.mask-spacer { flex: 1; }

/* 提示词输入 */
.cmp-ta {
  width: 100%; background: transparent; border: none; outline: none; resize: none;
  color: var(--text); font-size: 12.5px; line-height: 1.6;
  min-height: 52px; max-height: 180px; padding: 2px;
}
.cmp-ta::placeholder { color: #5d6474; }

/* 富文本提示词(contenteditable):@ 引用 chips + 素材菜单 */
.ce-ta { overflow-y: auto; white-space: pre-wrap; word-break: break-word; cursor: text; }
.ce-ta:empty::before { content: attr(data-ph); color: #5d6474; pointer-events: none; }
.ce-ta.ce-disabled { opacity: .5; pointer-events: none; }
.ref-chip {
  display: inline-block; vertical-align: baseline;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(226, 219, 200, .32); border-radius: 6px;
  padding: 0 5px; margin: 0 1px; font-size: 11.5px; line-height: 18px;
  white-space: nowrap; user-select: none; cursor: pointer;
  transition: color .12s, border-color .12s, background .12s, box-shadow .12s;
}
.ref-chip:hover, .ref-chip:focus-visible {
  color: #fff; border-color: var(--accent); background: rgba(226, 219, 200, .22);
  box-shadow: 0 0 0 2px rgba(226, 219, 200, .1); outline: none;
}
.ref-chip.stale {
  color: var(--text-dim); border-style: dashed; text-decoration: line-through;
}
.ref-menu {
  position: absolute; z-index: 30; left: 12px; right: 12px;
  max-height: 204px; overflow-y: auto; padding: 4px;
  background: #1c2029; border: 1px solid var(--border-light); border-radius: 10px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .6);
}
.ref-menu.ref-menu-switch { min-width: 180px; }
.ref-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 7px; cursor: pointer;
  font-size: 12px; color: var(--text);
}
.ref-menu-item:hover, .ref-menu-item.active { background: var(--accent-soft); }
.ref-menu-item img, .ref-menu-item video { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; flex: none; background: #0c0f15; }
.ref-menu-item .src { color: var(--text-dim); font-size: 10.5px; }
.ref-menu-empty { padding: 10px; text-align: center; color: var(--text-dim); font-size: 11.5px; }

/* 图层拆分:解析出的图层 chips */
.cmp-layers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.cmp-layers:empty { display: none; }
.ly-hint { font-size: 11px; color: var(--text-dim); opacity: .75; }
.ly-count { font-size: 11px; color: var(--text-dim); flex: none; }
.ly-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--accent-soft); border: 1px solid rgba(226, 219, 200, .28);
  color: var(--accent); border-radius: 999px;
  font-size: 11.5px; line-height: 1; padding: 4px 5px 4px 10px;
}
.ly-chip .rm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: none; border: none; color: inherit;
  font-size: 11px; line-height: 1; cursor: pointer; opacity: .65; transition: .12s;
}
.ly-chip .rm:hover { opacity: 1; background: rgba(242, 85, 90, .18); color: var(--danger); }

/* 状态行 */
.cmp-status { display: none; font-size: 11px; color: var(--text-dim); margin-top: 5px; }
.cmp-status:not(:empty) { display: block; }
.cmp-status.error { color: var(--danger); }
.cmp-status.ok { color: var(--ok); }

/* 生成进度条(阶段内为官方基线估算,完成跳 100%) */
.prog { display: block; margin-top: 2px; }
.prog-track {
  height: 4px; border-radius: 3px; overflow: hidden;
  background: rgba(255, 255, 255, .08);
}
.prog-track i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(226, 219, 200, .55), var(--accent));
  border-radius: 3px;
  transition: width .25s linear;
  box-shadow: 0 0 8px rgba(226, 219, 200, .35);
}
.prog-info {
  display: flex; align-items: center; gap: 8px; margin-top: 5px;
  font-size: 11px; color: var(--text-dim);
}
.prog-pct { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 34px; }
.prog-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 底部栏 */
.cmp-bar { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
/* 生成节点拉伸高度后:card 撑满、提示词区填充、底栏贴底(单行不换行) */
.node.composer .node-body { flex: 1 1 auto; min-height: 0; }
.node.composer .cmp-card.stretched {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.node.composer .cmp-card.stretched .cmp-ta.ce-ta { flex: 1 1 auto; min-height: 52px; max-height: none; }
.node.composer .cmp-card.stretched .cmp-bar { flex: none; }
.cbtn {
  display: inline-flex; align-items: center; gap: 4px;
  background: #22262f; border: 1px solid #2e333f; color: var(--text-dim);
  font-size: 11px; padding: 4px 8px; border-radius: 7px;
  max-width: 118px; transition: .12s;
}
.cbtn:hover { color: var(--text); border-color: #3d4350; }
.cbtn .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cbtn .chv { width: 9px; height: 9px; flex: none; opacity: .7; }
.cbtn.icon { padding: 4px 6px; max-width: none; }
.cbtn.icon .ic { width: 13px; height: 13px; }
.cbtn.on { color: var(--accent); border-color: rgba(226, 219, 200, .45); }
.cmp-spacer { flex: 1; }
/* 模型按钮:在 footer 居中优先级最高,自适应内容,完整显示名称 */
.cbtn.cbtn-model {
  max-width: none; flex: 1 1 auto; min-width: 0;
}
.cbtn.cbtn-model .lb { overflow: visible; white-space: nowrap; }

/* 费用点数(⚡476) */
.cmp-cost { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-dim); cursor: default; }
.cmp-cost .ic { width: 11px; height: 11px; color: var(--c-text); }

/* 白色圆形发送键 */
.cmp-send {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: #f2f2f4; border: none; color: #14161c;
  display: flex; align-items: center; justify-content: center;
  transition: .15s; padding: 0;
}
.cmp-send .ic { width: 15px; height: 15px; }
.cmp-send:hover:not(:disabled) { transform: scale(1.1); }
.cmp-send:disabled { opacity: .45; cursor: not-allowed; }
.cmp-send.loading .ic { display: none; }
.cmp-send.loading::after {
  content: ''; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(20, 22, 28, .25); border-top-color: #14161c;
  animation: cmp-spin .7s linear infinite;
}
@keyframes cmp-spin { to { transform: rotate(360deg); } }

/* 弹出菜单 */
.cmp-pop {
  position: absolute; z-index: 30;
  background: #22252d; border: 1px solid #343947; border-radius: 11px;
  padding: 5px; box-shadow: 0 18px 54px rgba(0, 0, 0, .62);
  width: max-content; min-width: 220px; max-width: 480px; max-height: 270px; overflow: auto;
}
.pop-item {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: none; border: none; color: var(--text);
  font-size: 12px; padding: 7px 9px; border-radius: 7px;
  text-align: left; white-space: normal; word-break: break-all; transition: .1s;
}
.pop-item > span:last-child { flex: 1; min-width: 0; }
.pop-item:hover { background: #2c303a; }
.pop-item .tick { width: 14px; flex: none; color: var(--accent); font-size: 11px; }
.pop-sep { height: 1px; background: #2e333f; margin: 5px 2px; }
.pop-input {
  width: 220px; background: #0f131b; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); padding: 7px 9px;
  font-size: 11.5px; outline: none;
}
.pop-input:focus { border-color: var(--accent); }
.pop-panel { min-width: 230px; padding: 10px; }
.pop-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pop-row:last-child { margin-bottom: 2px; }
.pop-row label { width: 44px; flex: none; font-size: 11px; color: var(--text-dim); }
.pop-row select {
  flex: 1; background: #0f131b; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); padding: 5px 7px;
  font-size: 11.5px; outline: none;
}
.pop-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); cursor: pointer; }
.pop-val { width: 34px; flex: none; text-align: right; font-size: 11px; color: var(--text-dim); }

/* ---------- 提示词(util)节点 ---------- */
.util-card {
  position: relative;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
}
.node.util.selected .util-card { border-color: var(--accent); }
.util-card textarea {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 12.5px; line-height: 1.6;
  resize: vertical; min-height: 78px;
}
.util-card textarea::placeholder { color: #5d6474; }
/* 提示词节点 AI 优化行 */
.prompt-opt-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.prompt-opt-btn { width: auto; }
.prompt-opt-status { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; }
.prompt-opt-copy {
  margin-left: auto; flex: none;
  background: #22262f; color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 12px; font-size: 12px; cursor: pointer; transition: .15s;
}
.prompt-opt-copy:hover { border-color: var(--accent); color: var(--accent); }
.prompt-opt-copy.hidden { display: none; }
/* 优化结果区:按维度字段块完全展开,模块间有分割线 + 空白,字段可独立编辑 */
.prompt-opt-out {
  width: 100%; margin-top: 8px;

  background: rgba(226, 219, 200, .05); border: 1px dashed var(--accent);
  border-radius: 8px; color: var(--text); font-size: 12.5px; line-height: 1.7;

  padding: 10px 12px;
  max-height: none; overflow: visible;
}
.prompt-opt-out.hidden { display: none; }
/* 单个字段块:标签 + 描述 */
.opt-block {
  padding: 6px 0;
}
.opt-block .opt-label {
  font-size: 11px; font-weight: 600; color: var(--accent);
  letter-spacing: .3px; margin-bottom: 4px;
}
.opt-block .opt-text {
  font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', Consolas, monospace;
  font-size: 12.5px; line-height: 1.7; color: var(--text);
  white-space: pre-wrap; outline: none;
  padding: 2px 6px; margin: -2px -6px; border-radius: 4px;
  transition: background .15s;
}
.opt-block .opt-text:focus { background: rgba(226, 219, 200, .08); }
/* 维度之间分割线 + 空白 */
.opt-sep {
  height: 0;
  border-top: 1px dashed rgba(255, 255, 255, .08);
  margin: 4px 0;
}
#toolbar button.on { border-color: var(--accent); color: var(--accent); background: rgba(226, 219, 200, .08); }

/* i2p 反推节点复用 composer 卡片(util 组)选中态 */
.node.util.selected .cmp-card { border-color: var(--accent); }

/* ---------- 风格模版节点(style) ---------- */
.sty-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.sty-row label { width: 46px; flex: none; font-size: 11px; color: var(--text-dim); }
.sty-row select {
  flex: 1; min-width: 0; background: #0f131b; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); padding: 5px 7px;
  font-size: 11.5px; outline: none;
}
.sty-row select:focus { border-color: var(--accent); }
.sty-custom {
  flex: 1; min-width: 0; background: #0f131b; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); padding: 5px 7px;
  font-size: 11.5px; outline: none;
}
.sty-custom:focus { border-color: var(--accent); }
.sty-custom.invalid { border-color: var(--danger); color: var(--danger); }
.sty-preview {
  margin-top: 4px; padding: 8px 10px; border-radius: 8px;
  background: #0f131b; border: 1px dashed var(--border-light);
  font-size: 12px; line-height: 1.7; color: var(--text);
  cursor: copy; word-break: break-all;
}
.sty-preview.empty { color: #5d6474; cursor: default; }
.sty-preview:not(.empty):hover { border-color: var(--accent); }

/* ---------- Prompt助手节点(promptcraft):顶端 TAB + 下方 chips ---------- */
.pc-wrap { display: flex; flex-direction: column; gap: 10px; }
.pc-tabs {
  flex: none; width: auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding-bottom: 2px;
}
.pc-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 6px; border: 1px solid var(--border); border-radius: 10px;
  background: #0f131b; color: var(--text-dim); cursor: pointer;
  min-width: 0;
}
.pc-tab .ic {
  width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.pc-tab .ic svg { width: 30px; height: 30px; display: block; }
.pc-tab-label {
  font-size: 11.5px; line-height: 1.2; text-align: center; color: inherit;
  max-width: 100%; overflow-wrap: anywhere;
}
.pc-tab:hover { border-color: var(--border-light); color: var(--text); }
.pc-tab.on { border-color: var(--accent); color: var(--accent); background: rgba(226, 219, 200, .07); }
.pc-main {
  flex: 1; min-width: 0;
  padding-right: 2px;
}
.pc-dim { margin-bottom: 10px; }
.pc-dim:last-child { margin-bottom: 2px; }
.pc-dim > label {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--accent);
  margin-bottom: 5px; letter-spacing: .3px;
}
.pc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-chip {
  padding: 3px 8px; border-radius: 999px; font-size: 11px; line-height: 1.5;
  background: #0f131b; border: 1px solid var(--border); color: var(--text-dim);
  cursor: pointer; white-space: nowrap;
}
.pc-chip:hover { border-color: var(--border-light); color: var(--text); }
.pc-chip.on { border-color: var(--accent); color: var(--accent); background: rgba(226, 219, 200, .1); }
/* 单选维度下拉框:合理固定宽度,不随节点卡片拉伸 */
.pc-sel {
  width: 100%; max-width: 260px;
  background: #0f131b; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 11.5px;
  padding: 5px 8px; outline: none;
}
.pc-sel:focus { border-color: var(--accent); }
.pc-extra {
  margin-top: 8px; min-height: 40px !important;
  background: #0f131b !important; border: 1px solid var(--border) !important;
  border-radius: 8px; padding: 6px 8px;
}
.pc-extra:focus { border-color: var(--accent) !important; }

/* ---------- 提示词融合节点(fuse) ---------- */
.fuse-srcs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.fuse-hint { font-size: 11px; color: #5d6474; line-height: 1.6; }
.fuse-src {
  font-size: 11px; color: var(--text-dim);
  background: #0f131b; border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px;
}
.fuse-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fuse-bar select {
  flex: 1; min-width: 0; background: #0f131b; border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); padding: 5px 7px;
  font-size: 11.5px; outline: none;
}
.fuse-bar select:focus { border-color: var(--accent); }
.fuse-btn {
  flex: none; background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 8px; padding: 6px 16px;
  font-size: 12px; font-weight: 600; transition: .12s;
  display: inline-flex; align-items: center; gap: 6px;
}
.fuse-btn .ic { width: 14px; height: 14px; display: inline-block; }
.fuse-btn .ic svg { width: 100%; height: 100%; }
.fuse-btn:hover:not(:disabled) { filter: brightness(1.08); }
.fuse-btn:disabled { opacity: .5; cursor: not-allowed; }
.fuse-status { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.fuse-status:empty { display: none; }

/* ---------- 反推提示词节点(i2p)结构化结果 ---------- */
.i2p-result {
  margin-top: 8px; border: 1px solid var(--border); border-radius: 8px;
  background: #0f131b; padding: 8px 10px;
  /* 默认无固定高度,按内容自动展开;节点过宽时内部滚动;用户可拖右下角手动调大 */
  resize: vertical; min-height: 120px; max-height: 80vh; overflow-y: auto;
}
.i2p-sec { display: flex; gap: 8px; padding: 3px 0; font-size: 11.5px; line-height: 1.6; }
.i2p-sec .k {
  flex: none; width: 58px; color: var(--c-text); font-size: 11px;
  padding-top: 1px;
}
.i2p-sec .v { flex: 1; color: var(--text); word-break: break-all; }
.i2p-combo {
  display: flex; gap: 8px; margin-top: 6px; padding: 7px 8px;
  border-radius: 7px; background: var(--accent-soft);
  font-size: 12px; line-height: 1.6; cursor: copy;
}
.i2p-combo:hover { outline: 1px solid var(--accent); }
.i2p-combo .k { flex: none; color: var(--accent); font-size: 11px; padding-top: 2px; }
.i2p-combo .v { flex: 1; color: var(--text); word-break: break-all; }

/* ---------- i2p 节点:主图 / 维度行 / 可编辑结果 ---------- */
.i2p-main { display: flex; gap: 6px; margin-bottom: 8px; }
.i2p-main .cmp-ref { width: 64px; height: 64px; }

.i2p-dim {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; margin-bottom: 6px;
  background: #0f131b; border: 1px solid var(--border); border-radius: 8px;
}
.i2p-dim.empty { background: transparent; border-style: dashed; }
.i2p-dim-name {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 1px solid #2e333f; color: var(--text-dim);
  font-size: 11px; padding: 4px 8px; border-radius: 6px; transition: .12s;
  min-width: 78px; justify-content: center;
}
.i2p-dim-name:hover { color: var(--text); border-color: var(--accent); }
.i2p-dim-name .chv { width: 9px; height: 9px; opacity: .6; }
.i2p-dim-thumb { flex: 1; display: flex; align-items: center; }
.i2p-dim-thumb .cmp-ref { width: 44px; height: 44px; }
.i2p-dim-add {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: transparent; border: 1px dashed #3a4150; color: var(--text-dim);
  font-size: 11px; padding: 6px 8px; border-radius: 6px; transition: .12s;
}
.i2p-dim-add:hover { color: var(--accent); border-color: var(--accent); }
.i2p-dim-add .ic { width: 12px; height: 12px; }

/* 类型标签 */
.i2p-type {
  display: flex; gap: 8px; padding: 4px 0 6px;
  border-bottom: 1px solid var(--border); margin-bottom: 6px;
  font-size: 12px;
}
.i2p-type .k { flex: none; width: 58px; color: var(--accent); font-size: 11px; padding-top: 1px; }
.i2p-type .v { flex: 1; color: var(--text); font-weight: 600; }

/* 反推节点:原图比例 + 比例提示词 */
.i2p-ratio {
  display: flex; gap: 8px; padding: 4px 0 6px;
  border-bottom: 1px dashed var(--border); margin-bottom: 6px;
  font-size: 12px;
}
.i2p-ratio .k { flex: none; width: 58px; color: var(--accent); font-size: 11px; padding-top: 1px; }
.i2p-ratio .v { flex: 1; color: var(--text); word-break: break-all; }

/* 反推节点:精准复刻开关 */
.i2p-rep {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; margin: 2px 0 6px;
  border: 1px solid var(--border); border-radius: 8px;
  background: rgba(226, 219, 200, .05);
  font-size: 11.5px; color: var(--text); cursor: pointer;
}
.i2p-rep input { width: 14px; height: 14px; accent-color: var(--accent); flex: none; margin: 0; }

/* 可编辑 section 值 */
.i2p-sec .v.i2p-editable {
  outline: none; border-radius: 4px; padding: 1px 4px; margin: -1px -4px;
  cursor: text; white-space: pre-wrap;
}
.i2p-sec .v.i2p-editable:focus {
  background: #1a2030; box-shadow: 0 0 0 1px var(--accent);
}

/* 组合提示词可编辑 textarea */
.i2p-combo .v.i2p-combo-edit {
  flex: 1; resize: vertical; min-height: 56px;
  background: transparent; border: none; color: var(--text);
  font: inherit; font-size: 12px; line-height: 1.6;
  outline: none; padding: 0; word-break: break-all;
}
.i2p-combo .v.i2p-combo-edit:focus { outline: 1px solid var(--accent); border-radius: 4px; padding: 2px 4px; margin: -2px -4px; }
.i2p-copy {
  flex: none; width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 6px; transition: .12s; margin-top: 2px;
}
.i2p-copy:hover { color: var(--accent); border-color: var(--accent); }
.i2p-copy .ic { width: 12px; height: 12px; }

/* ---------- 历史面板:文本产物卡 ---------- */
.hist-text {
  grid-column: 1 / -1; width: 100%; height: 100%; min-height: 72px;
  background: #0f131b; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 11.5px; line-height: 1.6; color: var(--text);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  cursor: copy;
}
.hist-text:hover { border-color: var(--accent); }

/* ---------- 个人资产弹窗:顶部容量条 ---------- */
.pa-quota { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); flex: none; }
.pa-quota .sp-bar { margin: 2px 0 6px; }
.pa-size-line { justify-content: flex-end; }
.pa-size { color: var(--accent); font-size: 10.5px; }

/* 缩放手柄 */
.resize-handle {
  position: absolute; right: 3px; bottom: 3px; width: 15px; height: 15px;
  cursor: nwse-resize; opacity: 0; transition: .15s; z-index: 7; color: var(--text-dim);
}
.node:hover .resize-handle { opacity: .85; }
.resize-handle:hover { color: var(--accent); }
.resize-handle svg { width: 100%; height: 100%; }

/* ---------- 群组 / 锁定 / 右键菜单 ---------- */
.node.locked .node-drag-handle,
.node.locked .resize-handle,
.node.locked .port { pointer-events: none !important; cursor: not-allowed !important; }
.node.locked .node-body input,
.node.locked .node-body textarea,
.node.locked .node-body select,
.node.locked .node-body button:not(.cmp-send):not(.cv-btn),
.node.locked .node-body [contenteditable="false"],
.node.locked .node-body [role="button"] { cursor: not-allowed !important; }
.node.locked .node-body input:disabled,
.node.locked .node-body textarea:disabled,
.node.locked .node-body select:disabled,
.node.locked .node-body button:disabled:not(.cmp-send) { opacity: .62; }
.node.locked .cmp-send:not(:disabled),
.node.locked .cv-btn:not(:disabled) { pointer-events: auto; cursor: pointer; opacity: 1; }
.node.locked .lock-badge { color: var(--accent); }
#groups { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.grp-frame {
  position: absolute; pointer-events: none;
  border: 1.5px dashed rgba(226, 219, 200, .38); border-radius: 12px;
}
.grp-label {
  position: absolute; top: -2px; left: 10px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(20, 24, 32, .94); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px 8px; font-size: 11px; color: var(--text);
  pointer-events: auto; cursor: grab; user-select: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.grp-label:active { cursor: grabbing; }
.grp-label > .ic { width: 12px; height: 12px; color: var(--accent); flex: none; }
.grp-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-btn {
  display: inline-flex; width: 17px; height: 17px; flex: none;
  align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-dim);
  border-radius: 4px; padding: 0; font-size: 12px; line-height: 1;
}
.grp-btn:hover { color: var(--accent); background: var(--panel-2); }
.grp-btn .ic { width: 12px; height: 12px; }

.lock-badge {
  position: absolute; top: 6px; right: 6px; z-index: 8;
  width: 20px; height: 20px; color: var(--accent);
  background: rgba(20, 24, 32, .88); border: 1px solid var(--border);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.lock-badge svg { width: 12px; height: 12px; }

.ctx-menu {
  position: fixed; z-index: 200; min-width: 158px;
  background: rgba(20, 24, 32, .97); border: 1px solid var(--border-light);
  border-radius: 10px; padding: 5px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .55);
}
.ctx-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; color: var(--text);
  font-size: 12px; padding: 7px 9px; border-radius: 7px;
  text-align: left; white-space: nowrap; transition: .1s;
}
.ctx-item:hover { background: #2c303a; }
.ctx-item.off { opacity: .38; cursor: not-allowed; }
.ctx-item .ic { width: 13px; height: 13px; color: var(--text-dim); flex: none; }

/* 输出端口松开后的竖排下级节点菜单 */
.downstream-menu {
  position: fixed; z-index: 220; width: 210px; max-height: min(520px, calc(100vh - 70px));
  overflow: auto; padding: 6px;
  background: rgba(20, 24, 32, .98); border: 1px solid var(--border-light);
  border-radius: 12px; box-shadow: 0 18px 54px rgba(0, 0, 0, .62);
}
.downstream-title {
  padding: 5px 8px 7px; color: var(--text-dim);
  font-size: 10.5px; letter-spacing: .06em;
}
.downstream-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px; color: var(--text); text-align: left;
  background: transparent; border: none; border-radius: 8px;
}
.downstream-item:hover { background: var(--panel-2); }
.downstream-item > .ic {
  width: 18px; height: 18px; flex: none; color: var(--accent);
}
.downstream-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.downstream-copy b { font-size: 12px; font-weight: 550; }
.downstream-copy small {
  overflow: hidden; color: var(--text-dim); font-size: 10px;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 连线 ---------- */
.edge-vis { fill: none; stroke: #3a4356; stroke-width: 2; transition: stroke .14s, stroke-width .14s, filter .14s; }
.edge-hit { fill: none; stroke: transparent; stroke-width: 12; }
.edge-g.selected .edge-vis { stroke: var(--accent); stroke-width: 2.5; }
.edge-g:hover .edge-vis { stroke: #55617a; }
.edge-g.selected:hover .edge-vis { stroke: var(--accent); }
.edge-g.upstream-active .edge-vis { stroke-width: 3.2; }
.edge-g.upstream-active[data-type="image"] .edge-vis {
  stroke: var(--c-image); filter: drop-shadow(0 0 4px rgba(34, 197, 94, .55));
}
.edge-g.upstream-active[data-type="text"] .edge-vis {
  stroke: var(--c-text); filter: drop-shadow(0 0 4px rgba(245, 166, 35, .55));
}
.edge-g.upstream-active[data-type="video"] .edge-vis {
  stroke: var(--c-video); filter: drop-shadow(0 0 4px rgba(168, 85, 247, .55));
}
.edge-g.upstream-active[data-type="model3d"] .edge-vis {
  stroke: var(--c-model3d); filter: drop-shadow(0 0 4px rgba(45, 212, 191, .55));
}
.edge-g.upstream-active[data-type="audio"] .edge-vis {
  stroke: var(--c-audio); filter: drop-shadow(0 0 4px rgba(56, 189, 248, .55));
}
.edge-g.upstream-active:hover .edge-vis { stroke-width: 3.5; }
#temp-edge { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 5; }

#zoom-label { font-size: 11px; color: var(--text-dim); min-width: 40px; text-align: center; }

/* ---------- 底部工具栏 ---------- */
#toolbar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 4px;
  background: rgba(20, 24, 32, .92); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 14px; padding: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
#toolbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: none; color: var(--text);
  font-size: 11px; padding: 6px 8px; border-radius: 9px; transition: .12s;
  white-space: nowrap; line-height: 1.2;
}
#toolbar button:hover { background: var(--panel-2); }
#toolbar button i { font-style: normal; display: inline-flex; width: 20px; height: 20px; }
#toolbar button i svg { width: 100%; height: 100%; }
#toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
/* 右侧生成按钮:logo 淡灰黄底 + icon/文字黑 */
#toolbar button.gen-hl {
  color: var(--accent-ink, #17191f);
  background: linear-gradient(135deg, var(--accent, #e2dbc8), #d6cdb5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
#toolbar button.gen-hl:hover {
  background: linear-gradient(135deg, #efe9db, #dccfb1);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .45);
}
/* 工具栏小按钮(snap/align)默认未启用:灰色低调 */
#toolbar #btn-snapgrid,
#toolbar #btn-align {
  color: #5f6471;
}
#toolbar #btn-snapgrid:hover,
#toolbar #btn-align:hover {
  color: var(--text);
}
/* 启用时(.on)用 logo accent 色高亮 */
#toolbar #btn-snapgrid.on,
#toolbar #btn-align.on {
  color: var(--accent-ink, #17191f);
  background: var(--accent, #e2dbc8);
  border-radius: 8px;
}
#zoom-label { font-size: 11px; color: var(--text-dim); min-width: 40px; text-align: center; }

/* ---------- 小地图 ---------- */
#minimap {
  position: fixed; left: 16px; bottom: 16px; z-index: 40;
  background: rgba(20, 24, 32, .9); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer;
}

/* ---------- 弹窗 / 灯箱 / 提示 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 7, 11, .6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden, #lightbox.hidden { display: none; }
.modal-card {
  width: 420px; max-width: calc(100vw - 40px);
  background: var(--panel); border: 1px solid var(--border-light); border-radius: 14px;
  padding: 20px; box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
.modal-card h3 { font-size: 15px; margin-bottom: 14px; }
.modal-card .fld-label { display: block; font-size: 11px; color: var(--text-dim); margin: 10px 0 4px; }
.modal-card input, .modal-card select {
  width: 100%; background: #0f131b; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 9px; font-size: 12px; outline: none;
}
.modal-card input:focus { border-color: var(--accent); }
.modal-card .hint { font-size: 11px; color: var(--text-dim); margin-top: 6px; line-height: 1.6; }
.modal-card .hint a { color: var(--accent); text-decoration: none; }
.modal-card .hint code { background: #0f131b; padding: 1px 5px; border-radius: 4px; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }

#lightbox {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(5, 7, 11, .88);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
#lightbox img, #lightbox video { max-width: 92vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.7); }

/* ---------- 生成历史面板 ---------- */
#history-panel {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(8, 10, 15, .62);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
#history-panel.open { opacity: 1; visibility: visible; }
/* 历史记录居中卡片 */
.hp-card {
  width: min(1180px, 96vw);
  max-height: 92vh; min-height: 520px;
  display: flex; flex-direction: column;
  background: rgba(18, 22, 30, .98); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.hp-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex: none; }
/* 底部操作条:清除所有内容(右下角) */
.hp-footer {
  display: flex; justify-content: flex-end; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--border); flex: none;
}
.hp-clear-btn {
  background: transparent; border: 1px solid rgba(242, 85, 90, .45);
  color: #f0a9a4; border-radius: 8px; padding: 6px 16px; font-size: 12px;
  cursor: pointer; transition: .15s; font-family: inherit;
}
.hp-clear-btn:hover { background: rgba(242, 85, 90, .12); border-color: var(--danger); color: #ffd6d2; }
.hp-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.hp-tabs { display: flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.hp-tabs button {
  background: none; border: none; color: var(--text-dim);
  font-size: 11px; padding: 4px 10px; border-radius: 6px;
}
.hp-tabs button.on { background: var(--accent-soft); color: var(--accent); }
.hp-head .spacer { flex: 1; }
.hp-icon-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 11px; padding: 4px 8px; border-radius: 6px;
}
.hp-icon-btn:hover { color: var(--danger); background: rgba(242, 85, 90, .1); }
.hp-close:hover { color: var(--text); background: var(--panel-2); }
.hp-grid {
  flex: 1 1 auto; min-height: 0;
  overflow-y: scroll; overscroll-behavior: contain;
  padding: 12px 14px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start;
}
/* 资产列表滚动条:明显可见 */
.hp-grid::-webkit-scrollbar { width: 8px; }
.hp-grid::-webkit-scrollbar-track { background: rgba(255, 255, 255, .04); border-radius: 4px; }
.hp-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 4px; }
.hp-grid::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .3); }
.hp-empty { grid-column: 1 / -1; text-align: center; color: var(--text-dim); font-size: 12px; padding: 48px 0; }
/* 分页条(资产超过一页时显示) */
.hp-pager {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 14px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.hp-page-btn {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim);
  font-size: 11.5px; padding: 4px 10px; border-radius: 7px; cursor: pointer; font-family: inherit;
}
.hp-page-btn:hover:not(.disabled) { border-color: var(--accent); color: var(--accent); }
.hp-page-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.hp-page-btn.disabled { opacity: .4; cursor: default; }
.hp-page-info { font-size: 11px; color: var(--text-dim); margin-left: 6px; }
.hist-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; width: 100%; position: relative; }
/* 卡片内容区:锁定宽度/高度,禁止压缩变形(缩略图 16:9 固定,meta 不挤压) */
.hist-card .hist-thumbs { width: 100%; min-width: 0; }
.hist-card .hist-actions { flex-wrap: wrap; }
/* 详细信息:悬浮层(默认隐藏,悬停卡片时浮现,盖在缩略图上,不占卡片高度) */
.hist-card .hist-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  min-width: 0; word-break: break-word;
  padding: 22px 9px 34px;
  background: linear-gradient(transparent, rgba(8, 10, 15, .94) 40%);
  opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease;
  pointer-events: none;
}
.hist-card:hover .hist-meta,
.hist-card .hist-meta:hover { opacity: 1; visibility: visible; }
.hist-thumbs { display: grid; gap: 2px; background: #0f131b; position: relative; align-items: start; }
.hist-thumbs.n1 { grid-template-columns: 1fr; }
.hist-thumbs.n2, .hist-thumbs.n3, .hist-thumbs.n4 { grid-template-columns: 1fr 1fr; }
/* 资产图 16:9 容器,图片 contain 完整显示,不压缩不拉伸(黑边由深底吸收) */
.hist-thumbs img, .hist-thumbs video {
  width: 100%; height: auto;
  display: block; cursor: zoom-in; background: #0f131b;
}
.hist-thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 16 / 9; background: #0d1017;
}
.hist-thumb img, .hist-thumb video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: center;
}
/* 图片资产:缓慢 Ken Burns 缩放(视频不动),让静态图也有"活"的视觉感 */
.hist-thumb img {
  animation: hist-kenburns 14s ease-in-out infinite alternate;
}
@keyframes hist-kenburns {
  from { transform: scale(1)    translate(0,    0); }
  to   { transform: scale(1.08) translate(-1.5%, -1%); }
}
.hist-thumb-del {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 20px; height: 20px; border-radius: 6px; border: none;
  background: rgba(10, 12, 18, .78); color: #f0b3ae; font-size: 14px; line-height: 1;
  cursor: pointer; opacity: 0; transition: .15s; display: flex; align-items: center; justify-content: center;
}
.hist-thumb:hover .hist-thumb-del { opacity: 1; }
.hist-thumb-del:hover { background: var(--danger); color: #fff; }
.hist-more {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(10, 12, 18, .8); border: 1px solid var(--border-light);
  color: var(--text); font-size: 10px; padding: 2px 7px; border-radius: 6px;
}

/* 历史面板 3D 占位卡 */
.hist-3d {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: #12161f; color: var(--c-model3d); cursor: pointer;
  font-size: 10.5px; letter-spacing: .5px; transition: .15s;
}
.hist-3d svg { width: 26px; height: 26px; opacity: .85; }
.hist-3d:hover { background: #171c27; }

/* 历史面板 音频占位卡:音波图标 + 波形 + 标签,点击播放 */
.hist-audio {
  position: relative;
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(135deg, #1a1530 0%, #142233 100%);
  color: #c792ff; cursor: pointer;
  font-size: 10.5px; letter-spacing: .5px; transition: .15s; overflow: hidden;
}
.hist-audio .ha-fab { width: 22px; height: 22px; opacity: .9; }
.hist-audio .ha-wave {
  position: absolute; left: 0; right: 0; bottom: 6px; height: 28px;
  color: #c792ff; opacity: .35; pointer-events: none;
}
.hist-audio:hover { background: linear-gradient(135deg, #221a3a 0%, #192a3f 100%); }
.hist-audio:hover .ha-wave { opacity: .55; }
.hist-audio.playing .ha-fab { color: #ff79c6; }
.hist-audio.playing .ha-wave { color: #ff79c6; opacity: .9; animation: ha-wave 1.1s linear infinite; }
.hist-audio .ha-label { z-index: 1; opacity: .85; }
@keyframes ha-wave {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-12px); }
}
.hist-meta { padding: 7px 9px 2px; }
.hist-line { font-size: 10.5px; color: var(--text-dim); display: flex; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.hist-model { color: var(--text); font-weight: 600; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-prompt {
  font-size: 10.5px; color: var(--text-dim); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hist-actions {
  position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 6;
  display: flex; gap: 4px;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease;
}
.hist-card:hover .hist-actions,
.hist-card .hist-actions:hover { opacity: 1; visibility: visible; }
.hist-actions button {
  flex: 1; background: rgba(10, 12, 18, .85); border: 1px solid var(--border-light);
  color: var(--text-dim); font-size: 10.5px; padding: 4px 0; border-radius: 6px; transition: .12s;
  backdrop-filter: blur(4px);
}
.hist-actions button:hover { color: var(--accent); border-color: var(--accent); }
.hist-actions button.del:hover { color: var(--danger); border-color: var(--danger); }

#toasts { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--panel); border: 1px solid var(--border-light); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font-size: 12.5px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  animation: toast-in .2s ease;
}
.toast.error { border-color: var(--danger); color: #ffb4b6; }
.toast.ok { border-color: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2c3446; border-radius: 4px; }

/* ===== 多画布首页(顶栏常驻,内容区从 48px 顶栏下方开始) ===== */
#home-view {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto;
  background: radial-gradient(circle at 50% 0%, #171c28, #0d1017 70%);
}
#home-view.hidden { display: none; }
body.home-mode #toolbar { display: none; }
/* 顶部留 110px 避开浮动 topbar(14px + 浮窗高),banner 整体下移 */
.hv-wrap { padding: 110px 26px 32px; max-width: 1240px; margin: 0 auto; }
.hv-banner {
  display: block; width: 100%; border-radius: 14px; margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.08); background: #14161c;
  aspect-ratio: 21 / 9; object-fit: cover; overflow: hidden;
  position: relative;
}
.hv-banner img, .hv-banner video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* banner 轮播:多图叠放淡入切换 + 底部圆点指示器 */
.hv-bslide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .55s ease;
  pointer-events: none;
}
.hv-bslide.active { opacity: 1; pointer-events: auto; }
.hv-bslide img, .hv-bslide video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hv-bdots {
  position: absolute; left: 0; right: 0; bottom: 10px; z-index: 3;
  display: flex; justify-content: center; gap: 6px;
}
.hv-bdots button {
  width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255, 255, 255, .45); cursor: pointer; transition: .2s;
}
.hv-bdots button:hover { background: rgba(255, 255, 255, .75); }
.hv-bdots button.on { background: #fff; width: 18px; border-radius: 5px; }
.hv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin: 0;
}
/* 工作流模版栏目(banner 下方):独立背景卡片区,与用户画布区分 */
.hv-tpl-sec {
  position: relative;
  margin-bottom: 22px;
  background: rgba(80, 96, 134, .14);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  padding: 16px 14px 10px;
}
.hv-tpl-sec.hidden { display: none; }
.hv-sec-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 2px 0 12px; }
/* 模版列表:单行横向,无滚动条,左右箭头浮在区域外侧两端(红色描边) */
#hv-tpl-grid {
  position: relative;
  display: flex; flex-wrap: nowrap; gap: 14px;
  overflow-x: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
#hv-tpl-grid .hv-card { flex: 0 0 250px; width: 250px; }
/* 左右箭头:浮在模版区外两端,极简箭头线条(无外框、无底色),白色细线 chevron */
.hv-tpl-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  background: none; border: none;
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s ease, color .2s ease, transform .2s ease;
  z-index: 5;
  padding: 0;
}
.hv-tpl-arrow-left { left: -52px; }
.hv-tpl-arrow-right { right: -52px; }
.hv-tpl-arrow:hover {
  color: #fff;
  transform: translateY(-50%) scale(1.14);
}
.hv-tpl-arrow.disabled { opacity: 0.18; cursor: not-allowed; pointer-events: none; }
.hv-tpl-arrow svg { width: 32px; height: 32px; display: block; stroke-width: 2.2; }
.hv-tpl .hv-cover { position: relative; }
.hv-tpl-badge {
  position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 9px;
  font-size: 10.5px; color: #14161c; background: var(--accent); font-weight: 600;
}
.hv-loading { grid-column: 1/-1; color: var(--text-dim); font-size: 13px; padding: 40px 0; text-align: center; }
.hv-empty { color: var(--text-dim); font-size: 13px; padding: 26px 4px; }
.hv-empty.hidden { display: none; }
.hv-mig {
  grid-column: 1/-1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(226,219,200,.07); border: 1px dashed rgba(226,219,200,.4);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 12px;
}
.hv-mig-text { flex: 1; min-width: 180px; font-size: 13px; color: var(--text); }
.hv-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; overflow: hidden; cursor: default; transition: .15s;
  user-select: none;
}
.hv-card:hover { border-color: rgba(255,255,255,.2); transform: translateY(-2px); }
.hv-card.dragging { opacity: .45; border-style: dashed; }
/* 拖拽排序位置标记:左侧竖线=插入前方,右侧竖线=插入后方 */
.hv-card.drop-left::before,
.hv-card.drop-right::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 3px;
  background: var(--accent); border-radius: 2px; z-index: 6; pointer-events: none;
}
.hv-card.drop-left::before { left: -4px; }
.hv-card.drop-right::after { right: -4px; }
.hv-cover {
  height: 108px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, rgba(70,84,115,.5), rgba(13,16,23,.9) 75%);
  cursor: pointer;
}
.hv-cover img, .hv-cover video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hv-cover-letter { font-size: 36px; font-weight: 600; color: var(--accent); opacity: .85; }
.hv-meta { padding: 7px 10px 2px; }
.hv-name { font-size: 12.5px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-time { font-size: 10.5px; color: var(--text-dim); margin-top: 2px; }
.hv-acts { display: flex; gap: 5px; padding: 6px 10px 9px; flex-wrap: wrap; }
.hv-acts .tbtn { padding: 3px 8px; font-size: 11px; }
/* 管理员拖拽排序:模版卡 */
.hv-tpl-draggable { cursor: grab; }
.hv-tpl-draggable:active { cursor: grabbing; }
.hv-tpl-draggable .hv-cover { cursor: grab; }
.hv-card.drag-over {
  border-color: var(--accent);
  outline: 2px dashed var(--accent); outline-offset: -2px;
}
/* 新建画布卡(虚线占位,网格首格) */
.hv-add {
  border: 1.5px dashed rgba(255,255,255,.18); background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 168px; cursor: pointer; gap: 6px;
}
.hv-add:hover { border-color: var(--accent); background: rgba(226,219,200,.05); transform: none; }
.hv-add-plus { font-size: 32px; color: var(--text-dim); font-weight: 300; line-height: 1; }
.hv-add:hover .hv-add-plus { color: var(--accent); }
.hv-add-text { font-size: 12.5px; color: var(--text-dim); }
.hv-add:hover .hv-add-text { color: var(--text); }
/* 首页底部免责声明 */
.hv-disclaimer {
  margin-top: 34px; padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
  color: rgba(255,255,255,.42); font-size: 11.5px; line-height: 1.8;
}
.hv-disclaimer b { color: inherit; font-weight: 600; margin-right: 8px; }
.hv-disclaimer p { margin: 0; }

/* 顶栏项目名(双击改名) */
.pn { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; font-size: 12.5px; color: var(--text-dim); cursor: text; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn.hidden { display: none; }
.pn-dot { width: 7px; height: 7px; border-radius: 50%; background: #3a4358; flex: none; }
.pn-dot.saved { background: var(--ok); }
.pn-dot.saving, .pn-dot.dirty { background: #d9a441; }
.pn-dot.error { background: var(--danger); }

/* ===== 充值弹窗 ===== */
.rc-card { max-width: 430px; }
.rc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 14px; }
.rc-pkg {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 4px;
  text-align: center; cursor: pointer; transition: .15s; background: var(--panel-2);
}
.rc-pkg:hover { border-color: var(--border-light); }
.rc-pkg.sel { border-color: var(--accent); background: rgba(226,219,200,.1); box-shadow: 0 0 0 1px var(--accent); }
.rc-cny { font-size: 16px; font-weight: 600; color: var(--text); }
.rc-pts { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.rc-flow { border-top: 1px dashed var(--border); padding-top: 10px; }
.rc-step { font-size: 12.5px; color: var(--text); line-height: 1.9; }
.rc-step b { color: var(--accent); margin-right: 4px; }
.rc-mailrow { display: flex; gap: 6px; margin: 6px 0; }
.rc-mailrow code {
  flex: 1; background: var(--panel-2); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 10px; font-size: 12.5px; color: var(--accent); overflow: hidden; text-overflow: ellipsis;
}
.rc-contact { color: var(--accent); user-select: all; }
#rc-wxpay:disabled { opacity: .45; cursor: not-allowed; }

/* ===== 分享只读模式 ===== */
/* 保留 #btn-home(LOGO / 返回首页)与右侧 #share-fork-btn(保存为我的项目);
 * 隐藏画板编辑/创作相关的工具栏与历史/资产按钮 */
body.share-mode #toolbar,
body.share-mode #minimap,
body.share-mode #btn-history,
body.share-mode #btn-showhidden,
body.share-mode #btn-export,
body.share-mode #btn-import,
body.share-mode #btn-clear,
body.share-mode #proj-name { display: none !important; }
body.share-mode .run, body.share-mode .fuse-btn { pointer-events: none; opacity: .4; }
/* 「显示隐藏」激活态 + 被隐藏节点的标示(作者开启显示隐藏后可见) */
#btn-showhidden.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.node.node-hidden { opacity: .45; filter: saturate(.6); }
.node.node-hidden::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  border: 1.5px dashed rgba(220, 190, 60, .55); pointer-events: none;
}
#share-banner {
  margin-left: 12px; font-size: 12px; color: var(--accent);
  border: 1px solid rgba(226,219,200,.35); border-radius: 99px; padding: 3px 10px;
}

/* 自定义尺寸双输入框 */
.cs-box { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.cs-num { width: 64px; text-align: center; }
.cs-x { color: var(--text-dim); font-size: 12px; }
.cs-note { font-size: 11px; color: var(--danger); margin-top: 2px; min-height: 0; }

/* 格式转换节点(视频→GIF) */
.cv-hint { font-size: 11px; color: var(--text-dim); line-height: 1.6; margin-bottom: 8px; }
.cv-hint.link-tip { color: var(--accent); font-weight: 500; }
.cv-params { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cv-pl { font-size: 11px; color: var(--text-dim); }
.cv-status { margin-bottom: 6px; }
.cv-result {
  width: 100%; border-radius: 8px; border: 1px solid var(--border);
  margin-bottom: 8px; cursor: zoom-in; display: block;
}
.cv-btn { width: 100%; }
.cs-note:empty { display: none; }

/* ---- 声音生成节点(MiniMax 语音/音乐) ---- */
.audio-ta {
  width: 100%; min-height: 64px; resize: vertical;
  background: #0f131b; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; line-height: 1.6;
  margin-bottom: 8px; font-family: inherit;
}
.audio-ta:focus { border-color: var(--accent); outline: none; }
.audio-player { width: 100%; margin-bottom: 8px; }
.audio-dl { margin-bottom: 8px; }

/* ---- 全站公告 ---- */
.ann-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10, 12, 16, .55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.ann-card {
  width: min(480px, 100%); max-height: 80vh; overflow: auto;
  background: var(--panel, #161a23); border: 1px solid var(--border, #262c3a);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.ann-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 10px;
}
.ann-tag {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
}
.ann-title { font-size: 15px; flex: 1; min-width: 0; }
.ann-close {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--text-dim, #8b93a5); padding: 2px 6px;
}
.ann-close:hover { color: var(--text, #e8ebf0); }
.ann-body {
  padding: 4px 16px 12px; font-size: 13.5px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-word;
}
.ann-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 16px 14px;
}
.ann-time { font-size: 11px; color: var(--text-dim, #8b93a5); }
.ann-ok {
  border: 1px solid var(--border, #262c3a); background: var(--accent, #e2dbc8);
  color: var(--accent-ink, #14161c); font-weight: 600;
  border-radius: 8px; padding: 6px 16px; font-size: 12.5px; cursor: pointer;
}
.ann-ok:hover { filter: brightness(1.05); }
.ann-foot-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ann-fb-link {
  border: none; background: none; cursor: pointer; padding: 0;
  font-size: 12px; color: var(--text-dim, #8b93a5); text-decoration: underline;
}
.ann-fb-link:hover { color: var(--text, #e8ebf0); }
.ann-fb { display: grid; gap: 8px; padding: 0 16px 14px; }
.ann-fb.hidden { display: none; }
.ann-fb-kind, .ann-fb-content, .ann-fb-contact {
  width: 100%; border: 1px solid var(--border, #262c3a); border-radius: 8px;
  background: var(--bg, #0f1218); color: var(--text, #e8ebf0);
  padding: 8px 10px; font: inherit; font-size: 12.5px; box-sizing: border-box;
}
.ann-fb-content { resize: vertical; min-height: 72px; }
.ann-fb-row { display: flex; align-items: center; gap: 10px; }
.ann-fb-submit {
  border: 1px solid var(--border, #262c3a); background: var(--accent, #e2dbc8);
  color: var(--accent-ink, #14161c); font-weight: 600;
  border-radius: 8px; padding: 6px 16px; font-size: 12.5px; cursor: pointer;
}
.ann-fb-submit:disabled { opacity: .6; cursor: default; }
.ann-fb-state { font-size: 11px; color: var(--text-dim, #8b93a5); }

/* ---------- 图片编辑节点(paint) ---------- */
.paint-ratios { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; }
.paint-ratio { font-size: 11px; padding: 2px 7px; }
.paint-ratio.on { background: var(--accent, #4f6bff); color: #fff; }
.paint-size { font-size: 10.5px; color: var(--text-dim); margin-left: auto; white-space: nowrap; }
.paint-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; }
.paint-tools .tbtn { font-size: 11px; padding: 2px 7px; }
.paint-cpicker { width: 26px; height: 22px; padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; background: none; cursor: pointer; }
.paint-rsize { width: 64px; height: 18px; accent-color: var(--accent, #4f6bff); }
.paint-stage { display: flex; justify-content: center; padding: 6px 0 4px; }
.paint-canvas { max-width: 100%; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: repeating-conic-gradient(#1a1f2b 0 25%, #222836 0 50%) 0 0/20px 20px; cursor: crosshair; touch-action: none; }
.paint-layers { border-top: 1px solid rgba(255,255,255,.08); padding: 6px 0 2px; max-height: 160px; overflow: auto; }
.paint-ltitle { font-size: 10.5px; color: var(--text-dim); margin-bottom: 4px; }
.paint-layer { display: flex; align-items: center; gap: 4px; padding: 2px 2px; border-radius: 5px; }
.paint-layer.on { background: rgba(79,107,255,.14); }
.paint-layer .tbtn { font-size: 10.5px; padding: 1px 5px; line-height: 1.5; }
.paint-layer .tbtn.dim { opacity: .45; }
.paint-layer .tbtn.danger { color: #ff6b6b; }
.paint-lname { flex: 1; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.paint-tset { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 6px; margin-top: 4px; }
.paint-tset .tbtn { font-size: 11px; padding: 1px 7px; }
.paint-llab { font-size: 10.5px; color: var(--text-dim); }
.paint-tset input[type=color] { width: 26px; height: 22px; padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; background: none; cursor: pointer; }
.paint-preview { width: 100%; margin-top: 6px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); cursor: zoom-in; }

/* i2p 参考图输出开关 */
.i2p-ref-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text); margin-bottom: 8px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; cursor: pointer; }
.i2p-ref-toggle input { accent-color: var(--accent, #4f6bff); cursor: pointer; }


/* 图片编辑 PS 风格:左画布 + 右面板 */
.paint-main { display: flex; gap: 8px; margin-top: 4px; align-items: flex-start; }
.paint-canvas-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; position: relative; }
.paint-canvas-wrap .paint-stage { position: relative; display: inline-block; }
.paint-canvas-wrap .paint-stage .paint-canvas { display: block; }
.paint-side { width: 200px; flex: 0 0 200px; display: flex; flex-direction: column; gap: 6px; max-height: 540px; overflow: auto; padding-right: 2px; }
.paint-side .paint-layers { border-top: none; padding: 0; max-height: none; }
/* 8 个 resize 手柄 + 选区边框 */
.paint-handles { position: absolute; pointer-events: none; z-index: 4; }
.paint-handles .ph { position: absolute; width: 10px; height: 10px; background: #fff; border: 1.5px solid #4096ff; border-radius: 2px; pointer-events: auto; }
.paint-handles .ph-nw { left: -5px; top: -5px; cursor: nwse-resize; }
.paint-handles .ph-n  { left: 50%; top: -5px; margin-left: -5px; cursor: ns-resize; }
.paint-handles .ph-ne { right: -5px; top: -5px; cursor: nesw-resize; }
.paint-handles .ph-e  { right: -5px; top: 50%; margin-top: -5px; cursor: ew-resize; }
.paint-handles .ph-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.paint-handles .ph-s  { left: 50%; bottom: -5px; margin-left: -5px; cursor: ns-resize; }
.paint-handles .ph-sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.paint-handles .ph-w  { left: -5px; top: 50%; margin-top: -5px; cursor: ew-resize; }

/* ---------- 图片编辑弹窗编辑器 ---------- */
.paint-editor-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 7, 11, .78); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.paint-editor-panel {
  width: min(1280px, 96vw); height: min(900px, 92vh);
  background: var(--panel, #171b24);
  border: 1px solid var(--border-light, #2a3140); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
.paint-editor-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}
.paint-editor-title { font-size: 13px; font-weight: 700; color: var(--text, #e8e9ed); }
/* 弹窗内编辑器主体(图二红框:工具条+画布+面板占满,无空白) */
.paint-editor-panel .util-card { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 10px 12px; }
.paint-editor-panel .util-card .paint-tools { margin: 0 0 8px; padding: 6px 8px; background: rgba(255,255,255,.04); border-radius: 8px; }
.paint-editor-panel .paint-main { flex: 1; min-height: 0; }
.paint-editor-panel .paint-canvas-wrap { justify-content: center; height: 100%; }
.paint-editor-panel .paint-canvas-wrap .paint-stage { flex: 1; max-height: 100%; }
/* 节点本体:合成图缩略 + 编辑按钮(图二问题:按钮下方空间过多,需要紧凑) */
.paint-node-prev { position: relative; border-radius: 10px; overflow: hidden; margin-bottom: 4px; background: #0f131b; }
.paint-node-img { display: block; width: 100%; max-height: 240px; object-fit: contain; border-radius: 8px; cursor: pointer; }
.paint-node-img.empty { min-height: 36px; padding: 10px 0; background: #161b25; cursor: default; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-dim, #8b93a5); }
.paint-node-img.empty::before { content: '空画布 · 编辑后输出合成图'; }
/* 实时预览态:接入但未合成的图片,加 logo 黄虚线边框提示 */
.paint-node-img.preview { border: 2px dashed rgba(255, 213, 79, .65); padding: 1px; background: #1a1d26; }
.paint-node-info { font-size: 11px; color: var(--text-dim, #8b93a5); margin-bottom: 4px; line-height: 1.5; }
.paint-node-prev + .paint-node-info { margin-top: 0; }

/* ---------- 图片编辑弹窗:PS 风格左侧工具条 ---------- */
.paint-tools-v {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 0 0 44px; width: 44px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07); border-radius: 8px;
  padding: 6px 0; align-self: flex-start;
}
.paint-tools-v .pt-tool {
  width: 34px; height: 34px; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--text-dim, #8b93a5);
  transition: background .12s, color .12s, transform .08s;
}
.paint-tools-v .pt-tool svg { width: 19px; height: 19px; }
.paint-tools-v .pt-tool:hover { background: rgba(255, 255, 255, .1); color: var(--text, #e8e9ed); }
.paint-tools-v .pt-tool:active { transform: scale(.92); }
.paint-tools-v .pt-tool.on {
  background: rgba(226, 219, 200, .16);
  color: #e2dbc8;
  box-shadow: inset 0 0 0 1px rgba(226, 219, 200, .55);
}
/* 主区横向:左侧工具条 + 画布 + 右面板 */
.paint-editor-panel .util-card { flex-direction: row; flex-wrap: wrap; gap: 10px; }
.paint-editor-panel .util-card > .paint-main { flex: 1; min-width: 0; }
.paint-tools-v + .paint-main { margin-left: 0; }
/* 画笔直径圆环(跟随鼠标) */
.paint-brush-ring {
  position: absolute; z-index: 6; pointer-events: none;
  border: 1.5px solid rgba(255, 90, 120, .9);
  border-radius: 50%;
  display: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
/* ring 中心小白点 = 笔刷精确位置(替代系统十字光标) */
.paint-brush-ring::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 0 3px rgba(0, 0, 0, .8);
}
/* 文字输入弹窗(自定义居中) */
.paint-text-modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(5, 7, 11, .6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
}
.paint-text-box {
  width: min(420px, 92vw);
  background: var(--panel, #171b24);
  border: 1px solid var(--border-light, #2a3140); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.paint-text-bar { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; }
.paint-text-bar .tbtn { font-size: 12px; }
.paint-text-ta {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px;
  background: #10141c; color: var(--text, #e8e9ed);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; outline: none;
}
.paint-text-ta:focus { border-color: rgba(226, 219, 200, .6); }
.paint-text-cfg { display: flex; align-items: center; gap: 6px; }
.paint-text-cfg select.sty-custom, .paint-text-cfg input[type=number] {
  background: #10141c; color: var(--text, #e8e9ed);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 6px;
  padding: 3px 6px; font-size: 12px;
}
.paint-text-cfg input[type=color] { width: 30px; height: 24px; padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; background: none; cursor: pointer; }
.paint-text-preview {
  border: 1px dashed rgba(255, 255, 255, .14); border-radius: 8px;
  padding: 14px; text-align: center; min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text, #e8e9ed); line-height: 1.4; word-break: break-all;
  background: rgba(255, 255, 255, .02);
}
/* 画板编辑器内居中确认弹窗(清空画布等)—— 复用 .paint-text-modal 遮罩 + .paint-text-box 卡片 */
.paint-confirm-msg {
  font-size: 13px; color: var(--text, #e8e9ed); line-height: 1.55;
  padding: 4px 2px 2px;
}

/* i2p 每张参考图的「输出参考图」开关 */
.i2p-out { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-dim, #8b93a5); cursor: pointer; user-select: none; margin-left: 8px; flex: 0 0 auto; }
.i2p-out input { accent-color: #e2dbc8; width: 12px; height: 12px; cursor: pointer; }
.i2p-out:hover { color: var(--text, #e8e9ed); }
.i2p-main .i2p-out { display: flex; margin-left: 0; margin-top: 4px; }
.i2p-dim .i2p-out { margin-top: 4px; }

/* 提示词节点上游输入预览区 */
.prompt-upstream { border: 1px solid rgba(226, 219, 200, .28); border-radius: 8px; background: rgba(226, 219, 200, .05); padding: 8px; margin-bottom: 8px; }
.prompt-up-head { font-size: 11px; font-weight: 700; color: #e2dbc8; margin-bottom: 6px; }
.prompt-up-pre { margin: 0; padding: 8px; background: #10141c; border: 1px solid rgba(255, 255, 255, .08); border-radius: 6px; font-size: 11.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: var(--text, #e8e9ed); max-height: 220px; overflow: auto; }
.prompt-up-actions { display: flex; gap: 6px; margin-top: 6px; }
.prompt-up-actions .tbtn { font-size: 11px; padding: 2px 8px; }

/* ---------- 图片编辑节点本体(紧凑优化) ---------- */
/* 卡片 flex 纵排;预览图区域 flex:1 跟随节点高度拉伸(拉高拉大图片,contain 等比不变形) */
.util-card.paint-card { display: flex; flex-direction: column; }
.util-card.paint-card .paint-node-prev {
  position: relative; border-radius: 10px; overflow: hidden; margin-bottom: 6px;
  background: #0f131b; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.paint-node-img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; cursor: pointer; display: block; margin: auto; }
/* 实时预览态:细黄边 */
.paint-node-img.preview { border: 1.5px dashed rgba(255, 213, 79, .55); padding: 1px; background: #1a1d26; }
/* 信息行:紧凑、单行截断、底部按钮紧凑 */
.paint-node-info { font-size: 10.5px; color: var(--text-dim, #8b93a5); margin-bottom: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 节点本体按钮(编辑画板):整行显示,紧凑 */
.paint-node-prev + .paint-node-info + .tbtn,
.paint-node-prev + .paint-node-info + button { display: block; width: 100%; text-align: center; font-size: 11.5px; padding: 6px 0; margin-top: 2px; }
/* paint 节点:删除实时预览虚线边框(用户要求) */
.paint-node-img.preview { border: 0 !important; padding: 0; background: transparent; }

/* ---------- 网站备案号底部 ----------
 * 默认不显示;需要在 body 加 .with-footer 才显示(画布/编辑器页面不显示,避免遮挡工具栏)。
 * 位置:正常文档流页脚,跟随在首页内容(免责声明)之后;无边框、纯文字居中,保持简洁 */
.site-footer {
  display: none;
  justify-content: center; align-items: center;
  padding: 4px 12px 20px;
  font-size: 11px; color: rgba(150,158,175,.55);
}
body.with-footer .site-footer {
  display: flex;
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--accent, #4f8cff); text-decoration: underline; }
.site-footer #gawb-beian a { display: inline-flex; align-items: center; gap: 4px; }
.site-footer #gawb-beian img { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- 登录弹窗:邮箱 / 手机验证码 tab ---------- */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.auth-tabs .atab {
  flex: 1; padding: 7px 0; font-size: 12.5px; color: var(--text-dim, #8b93a5);
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px; cursor: pointer; transition: all .15s;
}
.auth-tabs .atab.on { color: var(--accent-ink, #17191f); background: var(--accent, #e2dbc8); border-color: var(--accent, #e2dbc8); font-weight: 600; }
.auth-code-row { display: flex; gap: 8px; align-items: center; }
.auth-code-row input { flex: 1; min-width: 0; }
.auth-code-btn {
  flex-shrink: 0; padding: 9px 12px; font-size: 12.5px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06);
  color: var(--text, #e6e9f0); cursor: pointer; white-space: nowrap;
}
.auth-code-btn[disabled] { opacity: .45; cursor: not-allowed; }
.auth-tip { min-height: 18px; margin: 8px 0 4px; font-size: 12px; color: rgba(255,255,255,.5); display: none; }
.auth-tip.show { display: block; }
.auth-tip.err { color: var(--danger, #f2555a); }

/* ---------- 充值扫码支付弹窗 ---------- */
.rc-pay { display: flex; gap: 24px; align-items: center; padding: 14px 0 4px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 14px; }
.rc-pay-left { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rc-qr-wrap { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.rc-qr-wrap svg, .rc-qr-wrap img { width: 100%; height: 100%; display: block; }
.rc-tip { font-size: 12px; color: rgba(255,255,255,.6); }
.rc-pay-right { flex: 1; min-width: 0; }
.rc-amount { font-size: 28px; font-weight: 700; color: var(--accent, #e2dbc8); }
.rc-amount-pts { font-size: 14px; color: var(--text-dim, #8b93a5); margin: 4px 0 12px; }
.rc-order-no { font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 6px; word-break: break-all; }
.rc-order-no code { background: rgba(255,255,255,.04); padding: 1px 6px; border-radius: 3px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.rc-status { font-size: 13px; color: rgba(255,255,255,.8); margin-bottom: 14px; padding: 6px 10px; background: rgba(226,219,200,.08); border-radius: 6px; }
.rc-tip-sm { font-size: 11.5px; color: rgba(255,255,255,.45); margin-bottom: 10px; }
.rc-pay.hidden { display: none; }
