/* Shared site themes */

:root {
  color-scheme: dark;
  --surface: #151920;
  --panel: var(--surface);
  --accent-rgb: 69, 146, 242;
  --accent-2-rgb: 54, 96, 235;
  --neutral-rgb: 255, 255, 255;
  --recess-rgb: 0, 0, 0;
  --grad-lift: rgba(255,255,255,.19);
  --status-ink: #b5e6ff;
  --bg: #0a0b0e;
  --bg-2: #0e1014;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-2: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(20, 22, 28, 0.88);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f4f7;
  --text-dim: #9298a6;
  --text-faint: #5c616e;
  --accent: #4592f2;
  --accent-cyan: #56c2fb;
  --accent-2: #3660eb;
  --grad: linear-gradient(to top right, #3660eb, #56c2fb);
  --accent-soft: rgba(var(--accent-rgb), .15);
  --grad-control: linear-gradient(var(--grad-lift), var(--grad-lift)), var(--grad);
  --grad-tint: linear-gradient(to top right, rgba(var(--accent-2-rgb), .17), rgba(var(--accent-rgb), .16));
  --accent-on: #05121b;
  --star: var(--accent-cyan);
  --ok: var(--accent-cyan);
  --danger: var(--accent-cyan);
  --topbar-h: 60px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

/* 2026-11-11 修（README 第 107 节）：原来 html, body 都是 height: 100%，body 被定死成一屏高，
   顶栏的 sticky 只在 body 里有效 —— 往下滚过一屏顶栏就被带走了（AI产出记录、设计资产库翻到下面看不到导航）。
   body 改成 min-height，跟着内容变高；要整屏布局的页面自己写 height: 100%（canvas-page、viewer3d），登录页用 100vh */
html { height: 100%; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100%; }

body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55vw 55vw at 10% -12%, rgba(var(--accent-rgb), 0.16), transparent 60%),
    radial-gradient(48vw 48vw at 102% -4%, rgba(var(--accent-2-rgb), 0.14), transparent 58%),
    radial-gradient(45vw 45vw at 85% 115%, rgba(var(--accent-rgb), 0.08), transparent 60%),
    var(--bg);
}

::selection { background: rgba(var(--accent-rgb), 0.35); color: #fff; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(var(--neutral-rgb), .1); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(var(--neutral-rgb), .2); background-clip: content-box; }

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  height: var(--topbar-h);
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 12px;
  padding: 0 20px;
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topbar .brand { display: block; align-self: center; width: 130px; max-width: 100%; height: auto; transform: translate(15px, 3px); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.topbar-actions #whoami { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions button { flex-shrink: 0; }
.nav { display: flex; gap: 44px; justify-self: center; }
.nav a {
  padding: 7px 13px; border-radius: 8px; color: var(--text-dim);
  text-decoration: none; transition: .16s var(--ease); white-space: nowrap;
}
.nav a:hover { background: var(--glass-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--text); }
@media (max-width: 1100px) {
  :root { --topbar-h: 96px; }
  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0 8px; padding: 4px 12px;
  }
  .topbar .nav { gap: 8px; grid-row: 2; grid-column: 1 / -1; max-width: 100%; overflow-x: auto; }
  .topbar-actions { grid-row: 1; grid-column: 2; gap: 6px; }
  .topbar .nav a { padding-inline: 8px; }
}
.spacer { flex: 1; }

.badge {
  padding: 3px 9px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border-strong); color: var(--text-dim); white-space: nowrap;
}
.badge.warn { border-color: rgba(var(--accent-rgb), .4); color: var(--star); background: rgba(var(--accent-rgb), .08); }
.badge.live { border-color: rgba(var(--accent-rgb), .4); color: var(--ok); background: rgba(var(--accent-rgb), .08); }

/* ---------------- 按钮 ---------------- */
button, .btn {
  font: inherit; cursor: pointer;
  padding: 8px 15px; border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--glass-2); color: var(--text);
  transition: .16s var(--ease);
  display: inline-flex; align-items: center; gap: 7px;
}
button:hover, .btn:hover { background: rgba(var(--neutral-rgb), .11); border-color: rgba(255,255,255,.28); text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary, .btn.primary {
  background: var(--grad-control); border: none; color: var(--accent-on); font-weight: 700;
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), .28);
}
button.primary:hover { filter: brightness(1.08); }
button.danger { border-color: rgba(var(--accent-rgb), .45); color: var(--danger); background: rgba(var(--accent-rgb), .08); }
button.danger:hover { background: rgba(var(--accent-rgb), .18); }
button.ghost { background: transparent; }
button.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }

/* ---------------- 表单 ---------------- */
input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  font: inherit; width: 100%;
  padding: 9px 11px; border-radius: 9px;
  background: rgba(var(--recess-rgb), .28);
  border: 1px solid var(--border);
  color: var(--text);
  transition: .16s var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: rgba(var(--accent-rgb), .55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .13);
}
textarea { resize: vertical; line-height: 1.55; }
select option { background: var(--surface); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; margin-bottom: 5px; color: var(--text-dim); font-size: 12.5px; }
/* 后台的权限勾选块用 div.field 而不是 label.field：里面还有一排 label.check，
   label 套 label 会导致点子项时外层也被触发。样式跟 label.field 保持一致。 */
div.field { display: block; margin-bottom: 12px; }
div.field > span { display: block; margin-bottom: 5px; color: var(--text-dim); font-size: 12.5px; }
label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 12px; }
label.check input { width: auto; }
.hint { color: var(--text-faint); font-size: 12px; margin-top: 4px; line-height: 1.5; }

/* ---------------- 卡片 / 面板 ---------------- */
.panel {
  background: var(--glass); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px;
}
.panel h2, .panel h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: .3px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 26px 20px 60px; }
.grid { display: grid; gap: 16px; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 12.5px; }
tbody tr:hover { background: rgba(var(--neutral-rgb), .03); }

/* ---------------- 提示条 ---------------- */
.notice {
  border-radius: 12px; padding: 12px 15px; margin-bottom: 16px;
  border: 1px solid rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .09);
  color: var(--status-ink); line-height: 1.6;
}
.notice.info { border-color: rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .09); color: var(--status-ink); }
.notice.bad { border-color: rgba(var(--accent-rgb), .4); background: rgba(var(--accent-rgb), .09); color: var(--status-ink); }

/* ---------------- 弹层 ---------------- */
.modal-back {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(4,5,8,.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 22px; width: min(560px, 100%);
  max-height: 86vh; overflow: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.modal.wide { width: min(1080px, 100%); }
.modal h3 { margin: 0 0 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

#toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
/* 回到顶部（README 第 107 节）：右下角，滚下去才出现；出现时 toast 往上让 */
.back-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 850;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  font-size: 20px; line-height: 1; font-weight: 700;
  background: var(--glass-strong); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong); color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease), border-color .16s;
}
.back-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-top:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
body.has-backtop #toast { bottom: 76px; }
.toast {
  padding: 11px 16px; border-radius: 11px;
  background: var(--glass-strong); border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px); box-shadow: 0 12px 32px rgba(0,0,0,.45);
  animation: slidein .22s var(--ease); max-width: 460px; line-height: 1.5;
}
.toast.bad { border-color: rgba(var(--accent-rgb), .5); color: var(--status-ink); }
.toast.good { border-color: rgba(var(--accent-rgb), .5); color: var(--status-ink); }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================
   登录页
   ============================================================ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: min(400px, 100%); padding: 34px 30px;
  background: var(--glass-strong); border: 1px solid var(--border-strong);
  border-radius: 20px; backdrop-filter: blur(20px);
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.login-card h1 { margin: 0 0 6px; font-size: 21px; letter-spacing: .5px; }
.login-card .sub { color: var(--text-faint); margin-bottom: 24px; font-size: 13px; }
.login-card button { width: 100%; justify-content: center; margin-top: 6px; }
.login-err { color: var(--danger); min-height: 20px; font-size: 13px; margin-top: 10px; }

/* ============================================================
   门户
   ============================================================ */
.hero { padding: 40px 0 26px; }
.hero h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: .5px; }
.hero p { margin: 0; color: var(--text-dim); max-width: 720px; line-height: 1.7; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card {
  display: block; padding: 22px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  transition: .2s var(--ease); position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--glass-2); text-decoration: none; }
.card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad); opacity: .8;
}
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--text-dim); line-height: 1.65; font-size: 13px; }
.card .tag {
  display: inline-block; margin-top: 12px; padding: 3px 9px;
  border-radius: 999px; font-size: 11.5px; background: var(--accent-soft); color: var(--accent-cyan);
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { padding: 16px; border-radius: 13px; background: var(--glass); border: 1px solid var(--border); }
.stat .n { font-size: 25px; font-weight: 700; letter-spacing: .5px; }
.stat .k { color: var(--text-faint); font-size: 12.5px; margin-top: 3px; }

/* ============================================================
   素材库
   ============================================================ */
.lib-layout { display: grid; grid-template-columns: 232px 1fr; gap: 18px; align-items: start; }
.side { position: sticky; top: calc(var(--topbar-h) + 18px); }
/* 设计资产库工具栏吸顶（2026-11-10，README 第 98 节）：搜索、排序、上传、批量标签、批量归类、重新扫描滚下去也在 */
.lib-toolbar {
  position: sticky; top: var(--topbar-h); z-index: 60;
  margin-left: -10px; margin-right: -10px; padding: 10px;
  background: var(--glass-strong); backdrop-filter: blur(18px);
  border-radius: 0 0 12px 12px; transition: box-shadow .15s;
}
.lib-toolbar.stuck { box-shadow: 0 10px 24px rgba(0,0,0,.35); border-bottom: 1px solid var(--border); }
.side h4 { margin: 16px 0 7px; color: var(--text-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; }
.side h4:first-child { margin-top: 0; }
.side a.item {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 8px; color: var(--text-dim);
  cursor: pointer; text-decoration: none; font-size: 13px;
}
.side a.item:hover { background: var(--glass-2); color: var(--text); text-decoration: none; }
.side a.item.on { background: var(--accent-soft); color: var(--text); }
.side a.item span.n { color: var(--text-faint); font-size: 12px; }

/* 文件夹树：层级靠内联 padding-left 撑开，深度不设上限也不截断 */
.side .tree { margin: 0 -4px; }
.side .tree-row {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px 5px 0; border-radius: 8px;
  color: var(--text-dim); font-size: 13px; cursor: pointer; user-select: none;
}
.side .tree-row:hover { background: var(--glass-2); color: var(--text); }
.side .tree-row.on { background: var(--accent-soft); color: var(--text); }
.side .tree-row.col { color: var(--text); font-weight: 600; margin-top: 4px; }
.side .tree-row .tw {
  flex: 0 0 14px; text-align: center; font-size: 11px;
  color: var(--text-dim); line-height: 1;
}
.side .tree-row:hover .tw, .side .tree-row.on .tw { color: var(--text); }
/* 没有下级的节点三角淡掉但保留占位，否则同级文字左边缘会参差 */
.side .tree-row .tw.leaf { opacity: .3; cursor: default; }
.side .tree-row .tl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .tree-row .n { flex: 0 0 auto; color: var(--text-faint); font-size: 12px; }

/* 每一层右侧的「＋ 建子文件夹」：平时隐形，鼠标移到那一行才出现，
   否则一棵树上挂满加号，比找不到按钮还糟。
   2026-11-03 改成 display：按钮多了（↑↓＋✎🗑），留着占位会把文件夹名挤成「配色…」。
   代价是鼠标移上去时那一行的名字会缩短，平时名字完整显示。 */
.side .tree-row .mk {
  flex: 0 0 auto; display: none;
  width: 18px; height: 18px; padding: 0; margin: 0;
  border: none; border-radius: 5px; background: transparent;
  color: var(--text-faint); font-size: 13px; line-height: 1; cursor: pointer;
}
.side .tree-row:hover .mk { display: inline-block; }
.side .tree-row .mk:hover { background: var(--accent-soft); color: var(--text); }

.side a.item.newfolder {
  margin-top: 6px; color: var(--text-faint);
  border: 1px dashed var(--border-strong); justify-content: center;
}
.side a.item.newfolder:hover { color: var(--text); border-color: var(--accent); background: transparent; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px; }
.asset {
  border-radius: 13px; overflow: hidden; background: var(--glass);
  border: 1px solid var(--border); transition: .18s var(--ease);
  cursor: pointer; position: relative;
}
.asset:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.asset.sel { border-color: var(--accent-cyan); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .28); }
.asset .thumb {
  aspect-ratio: 1 / 1; background: var(--bg-2) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 12px;
}
.asset .meta { padding: 9px 10px; }
/* 设计资产库瀑布流（2026-11-10，README 第 97 节）：每行 6px，卡片按实际高度占几行（library.js 的 masonrySpan），
   缩略图框是图片真实比例（行内 aspect-ratio），所以 cover 不裁；特别细长的加 .fit 整张缩进去 */
.asset-grid.masonry { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: 6px; row-gap: 0; align-items: start; }
.asset-grid.masonry > .asset { margin-bottom: 14px; }
.asset-grid.masonry > :not(.asset) { grid-row: span 6; }
.asset-grid.masonry .thumb.fit { background-size: contain; }
.asset .meta .n {
  font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.asset .meta .d { color: var(--text-faint); font-size: 11.5px; margin-top: 2px; }
/* 下载次数角标：比同一行的尺寸/大小亮一档，因为它是「别人都在用」的信号 */
.asset .meta .dlc { color: var(--text-dim); white-space: nowrap; }
.asset .fav {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 8px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); border: 1px solid var(--border);
}
.asset .fav.on { color: var(--star); border-color: rgba(var(--accent-rgb), .5); }
.asset .kind {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 7px; border-radius: 6px; font-size: 10.5px;
  background: rgba(0,0,0,.6); border: 1px solid var(--border); color: var(--text-dim);
}

.tagline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-chip {
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
  background: var(--glass-2); border: 1px solid var(--border); color: var(--text-dim);
}

/* ============================================================
   节点画布
   ============================================================ */
.canvas-page { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.canvas-body { flex: 1; display: flex; min-height: 0; }

.palette {
  width: 196px; flex: none; padding: 12px;
  background: var(--glass-strong); border-right: 1px solid var(--border);
  overflow: auto;
}
.palette h4 { margin: 14px 0 6px; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.palette h4:first-child { margin-top: 0; }
.pal-item {
  padding: 8px 10px; border-radius: 9px; margin-bottom: 5px;
  background: var(--glass-2); border: 1px solid var(--border);
  cursor: grab; font-size: 13px; user-select: none;
  transition: .14s var(--ease);
  border-left: 3px solid var(--accent);
}
.pal-item:hover { background: rgba(var(--neutral-rgb), .1); transform: translateX(2px); }
.pal-item:active { cursor: grabbing; }

/* 画布视口：所有节点和连线都在 #gworld 里，靠 transform 平移缩放 */
#gviewport {
  flex: 1; position: relative; overflow: hidden; min-width: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(var(--neutral-rgb), .055) 1px, transparent 0) 0 0/22px 22px,
    var(--bg-2);
  cursor: default;
}
#gviewport.panning { cursor: grabbing; }
#gworld { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

/* SVG 连线层盖在节点下面，overflow 必须 visible 否则贝塞尔会被裁 */
#gwires { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
#gwires path { fill: none; stroke-width: 2.2; pointer-events: stroke; }
#gwires path.hit { stroke: transparent; stroke-width: 14px; cursor: pointer; }

/* ⚠️ 端口坐标靠 offsetLeft/offsetTop（布局值，不受 transform 缩放影响）。
   前提：节点内部除 .gnode 本身外，不能再出现 position:relative 的祖先，
   否则 offsetParent 会变，连线端点就会错位。改样式时必须守住这条。 */
.gnode {
  position: absolute;
  width: 232px;
  background: var(--glass-strong);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  user-select: none;
}
.gnode.sel { border-color: var(--accent-cyan); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .3), 0 10px 30px rgba(0,0,0,.45); }
.gnode.running { border-color: var(--star); }
.gnode.done { border-color: rgba(var(--accent-rgb), .55); }
.gnode.failed { border-color: var(--danger); }

.gnode .ghead {
  padding: 8px 11px; cursor: move;
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600;
}
.gnode .ghead .swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.gnode .ghead .st { margin-left: auto; font-size: 11px; color: var(--text-faint); font-weight: 400; }
.gnode .gbody { padding: 8px 11px 11px; }

.gports { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0 2px; }
.gports .col { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.gports .col.out { align-items: flex-end; }

.gport { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.gports .col.out .gport { flex-direction: row-reverse; }
.gport .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); cursor: crosshair; flex: none;
  transition: .14s var(--ease);
}
.gport .dot:hover { background: var(--accent-cyan); transform: scale(1.25); }
.gport .dot.linked { background: var(--accent); }
.gport .dot.text { border-color: var(--accent-cyan); }
.gport .dot.image { border-color: var(--ok); }
.gport .dot.values { border-color: var(--star); }
.gport .dot.video { border-color: var(--accent); }
.gport .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gfield { margin-top: 7px; }
.gfield > span { display: block; font-size: 11px; color: var(--text-faint); margin-bottom: 3px; }
.gfield textarea, .gfield input, .gfield select { font-size: 12.5px; padding: 6px 8px; border-radius: 7px; }
.gfield textarea { min-height: 56px; }
.gnode .gpreview {
  margin-top: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 4px;
}
.gnode .gpreview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; cursor: pointer; display: block; }
.gnode .gerr { margin-top: 8px; font-size: 11.5px; color: var(--status-ink); line-height: 1.5; word-break: break-all; }

/* 框选 */
#gmarquee {
  position: absolute; border: 1px solid var(--accent-cyan);
  background: rgba(var(--accent-rgb), .09); pointer-events: none; display: none;
}

/* 右侧检查器 */
.inspector {
  width: 300px; flex: none; padding: 14px;
  background: var(--glass-strong); border-left: 1px solid var(--border);
  overflow: auto;
}
.inspector h4 { margin: 0 0 10px; font-size: 13px; }
.insp-empty { color: var(--text-faint); font-size: 13px; line-height: 1.7; }

.cost-box {
  border: 1px solid var(--border); border-radius: 11px; padding: 12px;
  background: rgba(var(--recess-rgb), .25); margin-bottom: 12px;
}
.cost-box .big { font-size: 22px; font-weight: 700; }
.cost-box .line { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }

.runlog { font-size: 12px; line-height: 1.7; max-height: 220px; overflow: auto; }
.runlog .r { display: flex; gap: 7px; padding: 2px 0; }
.runlog .r .s { flex: none; width: 14px; }
.runlog .r.failed { color: var(--status-ink); }
.runlog .r.done { color: var(--text-dim); }
.runlog .r.running { color: var(--star); }

.toolbar {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); background: var(--glass);
  flex: none; flex-wrap: wrap;
}
.zoomlbl { font-size: 12px; color: var(--text-faint); min-width: 44px; text-align: center; }

/* 大图查看 */
#lightbox {
  position: fixed; inset: 0; z-index: 800; display: none;
  background: rgba(3,4,6,.9); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 30px; cursor: zoom-out; overflow: hidden;
}
#lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 70px rgba(0,0,0,.7); cursor: zoom-in; user-select: none; }
#lightbox img.zoomed { cursor: grab; }
#lightbox img.dragging { cursor: grabbing; }
#lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 64px; border-radius: 12px; font-size: 34px; line-height: 1;
  background: rgba(var(--neutral-rgb), .08); border: 1px solid rgba(var(--neutral-rgb), .14); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
#lightbox .lb-nav:hover { background: rgba(var(--neutral-rgb), .18); }
#lightbox .lb-prev { left: 18px; }
#lightbox .lb-next { right: 18px; }
#lightbox .lb-top { position: absolute; top: 14px; right: 18px; display: flex; align-items: center; gap: 8px; cursor: default; }
#lightbox .lb-n { color: var(--text-dim); font-size: 12.5px; margin-right: 6px; }
#lightbox .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: var(--text-dim); font-size: 12.5px; line-height: 1.6; text-align: center;
}

@media (max-width: 900px) {
  .lib-layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .palette { width: 150px; }
  .inspector { width: 240px; }
}

/* ============================================================
   3D 产品组（设计资产库）
   ============================================================ */
.sec-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 4px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.sec-head h3 { margin: 0; font-size: 15px; letter-spacing: .3px; }
.sec-head h3 .muted { font-weight: 400; font-size: 13px; }
label.check.inline { margin-bottom: 0; font-size: 13px; color: var(--text-dim); }

/* 产品卡片：封面不裁成正方形，工业品多是竖长或横长的 */
.asset.prod .thumb { aspect-ratio: 4 / 3; background-size: contain; background-color: var(--bg-2); }
.asset.prod .thumb.none {
  flex-direction: column; gap: 4px; text-align: center; padding: 10px;
  background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 9px, var(--surface) 9px, var(--surface) 18px);
}
.asset.prod .thumb.none small { font-size: 10.5px; opacity: .7; line-height: 1.5; }
.asset.prod .meta .n { font-size: 13px; font-weight: 600; }

.fmts { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 3px; }
.fmt {
  padding: 1px 6px; border-radius: 5px; font-size: 10.5px; letter-spacing: .4px;
  border: 1px solid var(--border-strong); color: var(--text-dim);
}
.fmt.on { border-color: rgba(var(--accent-rgb), .45); color: var(--ok); background: rgba(var(--accent-rgb), .10); }
.fmt.off { border-color: rgba(var(--accent-rgb), .4); color: var(--danger); background: rgba(var(--accent-rgb), .07); }

/* 卡片上的格式徽章同时就是下载/补传按钮 —— 组员来这儿就是为了拿文件，
   不该逼人先点开详情再找下载 */
a.fmt.dl, button.fmt {
  cursor: pointer; text-decoration: none; font: inherit;
  font-size: 10.5px; padding: 1px 6px; line-height: 1.7;
}
a.fmt.dl:hover { background: rgba(var(--accent-rgb), .24); border-color: var(--ok); }
button.fmt.off:hover { background: rgba(var(--accent-rgb), .2); border-color: var(--danger); }

.hint.warn { color: var(--star); }

/* 产品详情 */
.prod-detail { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 18px; }
.prod-detail .pd-cover img { width: 100%; border-radius: 10px; display: block; }
.prod-detail .pd-cover .noimg {
  aspect-ratio: 4 / 3; border-radius: 10px; border: 1px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--text-faint); font-size: 13px; line-height: 1.8;
}
/* 没封面时这块本身就是上传区：.droparea 的 padding 会把 4/3 撑变形，
   所以这里把它按回去，只留边框高亮和手型指针那部分行为 */
.prod-detail .pd-cover .noimg.droparea { padding: 12px; }
.prod-detail .pd-cover .noimg.droparea b { color: var(--text-dim); font-size: 14px; }
.prod-detail .pd-cover .noimg.droparea:hover b { color: var(--text); }
.filelist td { font-size: 13px; }
.filelist .btn.sm, .filelist button.sm { margin-left: 6px; }

/* 拖放上传区 */
.droparea {
  border: 1.5px dashed var(--border-strong); border-radius: 12px;
  padding: 30px 18px; text-align: center; cursor: pointer;
  transition: .15s var(--ease);
}
.droparea:hover, .droparea.over { border-color: var(--accent-cyan); background: rgba(var(--accent-rgb), .06); }

@media (max-width: 720px) {
  .prod-detail { grid-template-columns: 1fr; }
}

/* ============================================================
   AI生图画布：基础画布（套模板）/ 高级画布（自定义）—— 2026-11-02
   ============================================================ */
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.ghost { background: transparent; }
.btn { color: var(--text); }

/* 「基础 | 高级」切换条（没有高级画布权限的人看不到） */
.cv-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid var(--border); background: rgba(var(--recess-rgb), .25); flex: none; }
.cv-tabs a { padding: 5px 12px; border-radius: 7px; color: var(--text-dim); font-size: 13px; text-decoration: none; white-space: nowrap; }
.cv-tabs a small { margin-left: 5px; font-size: 11px; color: var(--text-faint); }
.cv-tabs a:hover { color: var(--text); background: var(--glass-2); }
.cv-tabs a.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35); }
.cv-tabs a.on small { color: var(--accent-cyan); }

.bc-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { padding: 5px 12px; border-radius: 999px; font-size: 13px; background: transparent; color: var(--text-dim); }
.chip small { color: var(--text-faint); margin-left: 2px; }
.chip.on { background: var(--accent-soft); color: var(--text); border-color: rgba(var(--accent-rgb), .45); }

/* 模板墙 */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tpl-card {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--glass); transition: .18s var(--ease);
}
.tpl-card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--glass-2); }
.tpl-thumb {
  aspect-ratio: 4 / 3; background: var(--bg-2) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 12.5px;
}
.tpl-thumb span { padding: 4px 10px; border: 1px dashed var(--border-strong); border-radius: 8px; }
.tpl-cover-edit { max-width: 280px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; }
.tpl-cover-edit.over { border-color: var(--border-strong); background-color: var(--glass-2); }
.tpl-meta { padding: 11px 13px 13px; }
.tpl-name { font-weight: 650; font-size: 14.5px; }
.tpl-desc { color: var(--text-dim); font-size: 12.5px; line-height: 1.6; margin-top: 4px; min-height: 20px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; font-size: 12px; }
.tpl-empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--text-dim); }
.tpl-empty b { font-size: 15px; color: var(--text); }
.tpl-empty p { line-height: 1.8; max-width: 620px; margin: 10px auto 0; }

/* 填表页 */
.bc-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.bc-side { position: sticky; top: calc(var(--topbar-h) + 18px); }
.bc-cover { width: 100%; border-radius: 10px; display: block; cursor: zoom-in; }
.bc-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bc-field { margin-bottom: 16px; }
.bc-field > span { font-size: 13px; color: var(--text); font-weight: 600; }
.bc-field em.req { color: var(--danger); font-style: normal; }
.bc-pic { max-width: 320px; min-height: 150px; padding: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.bc-pic img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; }
.bc-pic.busy { opacity: .5; pointer-events: none; }
.bc-pic-name { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; word-break: break-all; text-align: center; }
.bc-pic-empty { display: flex; flex-direction: column; gap: 4px; align-items: center; color: var(--text-dim); font-size: 13px; }
.bc-pic-empty small { color: var(--text-faint); font-size: 11.5px; }
.bc-cost { margin: 4px 0 14px; padding: 10px 12px; border-radius: 9px; background: rgba(var(--recess-rgb), .25); border: 1px solid var(--border); font-size: 13px; color: var(--text-dim); }
.bc-cost b { color: var(--text); font-size: 16px; }
.bc-cost .faint { margin-left: 6px; }
.bc-cost.warn { color: var(--star); border-color: rgba(var(--accent-rgb), .35); }
.bc-bar { height: 6px; border-radius: 4px; background: rgba(var(--neutral-rgb), .06); overflow: hidden; }
.bc-bar i { display: block; height: 100%; background: var(--grad); transition: width .4s var(--ease); }
.bc-out .thumb { cursor: zoom-in; }
.bc-out .meta { gap: 6px; }

/* 高级画布：检查器里的「开放给基础画布」 */
.openf { padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; margin-bottom: 4px; }
.openf.on { border-color: rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .06); }
.openf .openf-more { display: flex; flex-direction: column; gap: 5px; margin: 6px 0 2px 24px; }
.openf .openf-more input[type=text] { padding: 6px 9px; font-size: 12.5px; }
/* 节点角标：作者一眼看出组员能动哪几个节点。⚠️ 只用 .gnode 自身的定位，
   不给节点内部加 position:relative（README 第 8 节第 8 条） */
.gnode.opened::after {
  content: attr(data-opened); position: absolute; top: -10px; right: 10px;
  padding: 1px 7px; border-radius: 6px; font-size: 10.5px; line-height: 1.6;
  background: var(--surface); color: var(--star); border: 1px solid rgba(var(--accent-rgb), .5); pointer-events: none;
}

/* 模板设置弹层 */
.tpl-set { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.tpl-cover {
  aspect-ratio: 4 / 3; border-radius: 10px; border: 1px dashed var(--border-strong); cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-dim); font-size: 13px; line-height: 1.7;
}
.tpl-cover:hover { border-color: var(--accent-cyan); }
.tpl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-cover small { color: var(--text-faint); }

@media (max-width: 900px) {
  .bc-layout, .tpl-set { grid-template-columns: 1fr; }
  .bc-side { position: static; }
}
/* 反推提示词节点：结果文字回显（2026-11-02）。⚠️ 不加 position:relative（README 第 8 节第 8 条） */
.gnode .gpreview.texts { display: flex; flex-direction: column; gap: 6px; }
.gnode .gtext { border: 1px solid rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .07); border-radius: 8px; padding: 7px 8px; cursor: auto; }
.gnode .gtext-lbl { font-size: 10.5px; color: var(--accent-cyan); margin-bottom: 3px; }
.gnode .gtext-body {
  font-size: 11.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word;
  max-height: 150px; overflow-y: auto; user-select: text; cursor: text;
}
.gnode .gtext-act { display: flex; gap: 5px; margin-top: 6px; }
.gnode .gtext-act button.sm { padding: 3px 8px; font-size: 11.5px; }
/* 检查器信息框：左边的项名不换行，长说明在右边折行 */
.cost-box .line > span:first-child { flex: none; white-space: nowrap; margin-right: 12px; }
.cost-box .line > span:last-child { text-align: right; }

/* 文本输出节点：可删改的文字框（2026-11-02） */
.gnode .gtext.editable textarea.gtext-body {
  width: 100%; min-height: 170px; max-height: 420px; resize: vertical;
  padding: 6px 7px; border-radius: 6px; font: inherit; font-size: 11.5px; line-height: 1.6;
  background: rgba(var(--recess-rgb), .25); border: 1px solid var(--border); color: var(--text);
}
.gnode .gtext.editable textarea.gtext-body:focus { outline: none; border-color: rgba(var(--accent-rgb), .6); }
.gnode .gtext.editable textarea.gtext-body::selection { background: rgba(var(--accent-rgb), .45); }
/* 图片输入节点：本地上传 / 拖拽（2026-11-02）。⚠️ 不加 position:relative（README 第 8 节第 8 条） */
.gnode .gasset { display: flex; flex-direction: column; gap: 6px; }
.gnode .gdrop {
  min-height: 92px; border: 1px dashed var(--border-strong); border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px; text-align: center; color: var(--text-dim); font-size: 12px; background: rgba(var(--recess-rgb), .18);
}
.gnode .gdrop small { font-size: 10.5px; color: var(--text-faint); }
.gnode .gdrop:hover { border-color: var(--accent-cyan); background: rgba(var(--accent-rgb), .06); color: var(--text); }
.gnode .gdrop.has { border-style: solid; padding: 5px; }
.gnode .gdrop img { max-width: 100%; max-height: 170px; border-radius: 6px; display: block; cursor: zoom-in; }
.gnode .gdrop-name { font-size: 10.5px; color: var(--text-faint); word-break: break-all; }
.gnode .gasset-act { display: flex; gap: 5px; }
.gnode .gasset-act button.sm { flex: 1; justify-content: center; padding: 4px 6px; font-size: 11.5px; }
/* 从电脑拖图片悬停在图片输入节点上时整块高亮；上传中半透明 */
.gnode.filedrop { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .35); }
.gnode.filedrop .gdrop { border-color: var(--accent-cyan); background: rgba(var(--accent-rgb), .1); }
.gnode.uploading .gdrop { opacity: .45; pointer-events: none; }
/* 反推分类结果：按维度分块（2026-11-02） */
.gnode .gtext-body.gsecs { max-height: 360px; white-space: normal; display: flex; flex-direction: column; gap: 6px; }
.gnode .gsec { border-left: 2px solid rgba(var(--accent-rgb), .55); padding: 1px 0 1px 7px; }
.gnode .gsec.empty { border-left-color: var(--border); opacity: .55; }
.gnode .gsec-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gnode .gsec-head span { font-size: 10.5px; font-weight: 700; color: var(--accent-cyan); letter-spacing: .3px; }
.gnode .gsec-copy {
  padding: 0 6px; font-size: 10px; line-height: 1.6; border-radius: 5px;
  background: transparent; border: 1px solid var(--border); color: var(--text-faint);
}
.gnode .gsec-copy:hover { color: var(--text); border-color: rgba(var(--accent-rgb), .6); background: rgba(var(--accent-rgb), .12); }
.gnode .gsec-text { white-space: pre-wrap; }
/* ============================================================
   节点可拖拽调整大小（2026-11-02）
   右下角把手；拉过高度的节点加 .sized，内部变纵向弹性布局，
   多出来的高度全给文字结果区（反推 / 文本输出）。
   ⚠️ 把手用 .gnode 自己的定位（它本来就是 absolute），节点内部不新增
      position:relative 的元素 —— 否则端口 offsetTop 会错位（README 第 8 节第 8 条）
   ============================================================ */
.gnode .gresize {
  position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
  border-radius: 0 0 12px 0; opacity: .45; transition: opacity .15s;
  background:
    linear-gradient(135deg, transparent 0 55%, var(--text-faint) 55% 61%, transparent 61% 70%, var(--text-faint) 70% 76%, transparent 76%);
}
.gnode:hover .gresize, .gnode.resizing .gresize { opacity: 1; }
.gnode .gresize:hover { background-color: rgba(var(--accent-rgb), .12); }
.gnode.resizing { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .45); }

.gnode.sized { display: flex; flex-direction: column; }
.gnode.sized .ghead { flex: none; }
.gnode.sized .gbody { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.gnode.sized .gbody > * { flex: none; }
.gnode.sized .gbody > .gpreview.texts { flex: 1 1 auto; min-height: 0; }
.gnode.sized .gpreview.texts .gtext { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.gnode.sized .gtext-body,
.gnode.sized .gtext-body.gsecs { flex: 1 1 auto; min-height: 60px; max-height: none; }
.gnode.sized .gtext.editable textarea.gtext-body { min-height: 60px; max-height: none; resize: none; }
.gnode.sized .gdrop img { max-height: none; }
/* ============================================================
   一体式出图节点「图片生成」（2026-11-03）
   出图区在上（没出图时是一块占位）、提示词在中、底部一排紧凑选择 + 生成按钮。
   ⚠️ 只用 flex 的 order 调顺序，不加任何 position:relative（守住端口坐标那条规矩）
   ============================================================ */
.gnode.compose { width: 360px; }
.gnode.compose .gbody { display: flex; flex-direction: column; }
.gnode.compose .gports { order: 0; }
.gnode.compose .gpreview { order: 1; grid-template-columns: repeat(2, 1fr); gap: 6px; align-items: start; }
.gnode.compose .gpreview img { aspect-ratio: auto; height: auto; object-fit: contain; }
.gnode.compose .gpreview:empty {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; border: 1px dashed var(--border-strong); border-radius: 9px;
  color: var(--text-faint); font-size: 12px;
}
.gnode.compose .gpreview:empty::before { content: '生成的图会显示在这里'; }
.gnode.compose .gpreview img:only-child { grid-column: 1 / -1; aspect-ratio: auto; max-height: 360px; object-fit: contain; background: rgba(var(--recess-rgb), .25); }
.gnode.compose .gfields { order: 2; }
.gnode.compose .gerr { order: 3; }
.gnode.compose .gfield textarea { min-height: 72px; }

.gchips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; }
.gchip select {
  width: auto; max-width: 118px; font-size: 11px; padding: 4px 6px; border-radius: 999px;
  background: rgba(var(--neutral-rgb), .06); border: 1px solid var(--border-strong); color: var(--text);
  cursor: pointer;
}
.gchip select:hover { border-color: var(--accent-cyan); }
.gchips .grun {
  margin-left: auto; padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent); border: none; color: #1a1206; cursor: pointer;
}
.gchips .grun:hover { filter: brightness(1.1); }
.gchips .grun:disabled { opacity: .5; cursor: default; }
.gnode.sized.compose .gbody > .gpreview { flex: 1 1 auto; min-height: 0; overflow: auto; }

/* 扩图节点（2026-11-06，README 第 71 节）。导入窗口和比例框在上、结果在下；舞台的 position 不在端口的祖先链上 */
.gnode.outpaint .gpreview { order: 3; margin-top: 8px; }
.gnode.outpaint .gerr { order: 4; }
.gnode.outpaint .gpreview:empty { display: none; }
.gframe { margin-bottom: 8px; }
.gframe-stage {
  position: relative; height: 230px; overflow: hidden; border-radius: 9px;
  background: rgba(var(--recess-rgb), .28); border: 1px solid var(--border);
}
.gframe-stage .gframe-fill, .gframe-stage .gframe-img, .gframe-stage .gframe-box { position: absolute; display: none; }
.gframe-stage.ready .gframe-fill, .gframe-stage.ready .gframe-img, .gframe-stage.ready .gframe-box { display: block; }
.gframe-fill { background: #fff; }   /* 新增的部分就是纯白，和发给模型的一样 */
.gframe-stage .gframe-img { max-width: none; pointer-events: none; user-select: none; }
.gframe-box { outline: 2px solid var(--accent-cyan); cursor: move; }
/* ⚠️ 手柄别用 .sw 这类短类名，和全局样式撞名（2026-11-06 踩过） */
.gframe-h { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid var(--accent-cyan); border-radius: 2px; }
.gframe-h.h-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.gframe-h.h-n { left: calc(50% - 6px); top: -6px; cursor: ns-resize; }
.gframe-h.h-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.gframe-h.h-e { right: -6px; top: calc(50% - 6px); cursor: ew-resize; }
.gframe-h.h-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.gframe-h.h-s { left: calc(50% - 6px); bottom: -6px; cursor: ns-resize; }
.gframe-h.h-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.gframe-h.h-w { left: -6px; top: calc(50% - 6px); cursor: ew-resize; }
.gframe-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer; color: var(--text-dim); font-size: 12px;
}
.gframe-empty small { color: var(--text-faint); font-size: 11px; }
.gframe-empty:hover { background: rgba(var(--accent-rgb), .06); }
.gframe-stage.ready .gframe-empty { display: none; }
.gnode.outpaint.filedrop .gframe-stage { border-color: var(--accent-cyan); }
.gframe-info { margin-top: 5px; min-height: 14px; font-size: 10.5px; line-height: 1.5; color: var(--text-faint); }
.gframe-act { margin-top: 6px; }
.notice-list { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 6px; line-height: 1.6; }
.notice-item .muted { font-size: 13px; margin-top: 2px; }
.bc-frame.droparea { padding: 8px; cursor: default; text-align: left; }
.bc-frame.busy { opacity: .5; pointer-events: none; }
.bc-frame .gframe-stage { height: 360px; }   /* 基础画布的原图框比节点上宽，留大一点好拖 */
.bc-frame.over .gframe-stage { border-color: var(--accent-cyan); }

/* 图片生成节点：单张大图 + 翻页条（2026-11-03）。同样不加 position */
.gnode.compose .gpreview.gview { display: flex; flex-direction: column; gap: 6px; }
.gnode.compose .gpreview .gview-img {
  width: 100%; height: auto; aspect-ratio: auto; max-height: 380px; object-fit: contain;
  background: rgba(var(--recess-rgb), .25); border-radius: 8px; cursor: zoom-in;
}
.gnode.compose .gpreview .gview-video { cursor: default; background: #000; }
.gview-bar { display: flex; align-items: center; gap: 6px; }
.gview-btn {
  width: 26px; height: 24px; padding: 0; border-radius: 7px; font-size: 16px; line-height: 1;
  background: rgba(var(--neutral-rgb), .06); border: 1px solid var(--border-strong); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.gview-btn:hover { border-color: var(--accent-cyan); }
.gview-n { font-size: 11.5px; color: var(--text-dim); min-width: 34px; text-align: center; }
.gview-dl {
  margin-left: auto; font-size: 11.5px; padding: 4px 10px; border-radius: 999px;
  background: rgba(var(--accent-rgb), .14); border: 1px solid rgba(var(--accent-rgb), .4); color: var(--text); cursor: pointer;
}
.gview-dl:hover { background: rgba(var(--accent-rgb), .24); }
.gview-up { padding: 3px 9px; font-size: 11.5px; border-radius: 6px; color: #fff; background: var(--accent); border: none; cursor: pointer; }
.gview-up:disabled { opacity: .6; cursor: default; }

/* AI产出记录：筛选条 + 卡片日期（2026-11-03） */
.ai-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--glass); }
.ai-filters .fl { font-size: 12px; color: var(--text-faint); }
.ai-filters .fl:not(:first-child) { margin-left: 8px; }
.ai-filters select { width: auto; font-size: 12.5px; padding: 5px 8px; }
.ai-filters .chip { font-size: 12.5px; padding: 4px 11px; }
.ai-filters .sws { display: inline-flex; flex-wrap: wrap; gap: 6px; }
/* 大家都在用（2026-11-09，README 第 88 节）：筛选条里单独一行 */
.ai-filters .hot-row { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  padding-top: 8px; border-top: 1px dashed var(--border); }
.ai-filters .chip.hot { font-weight: 600; }
.ai-filters .chip.hot.on { background: rgba(var(--accent-rgb), .18); border-color: var(--accent); color: var(--status-ink); }
.ai-filters .hot-row .chip small { opacity: .75; margin-left: 2px; }
.sw { width: 20px; height: 20px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid rgba(255,255,255,.28); box-shadow: inset 0 0 0 1px rgba(var(--recess-rgb), .25); }
.sw:hover { transform: scale(1.12); }
.sw.on { box-shadow: 0 0 0 2px var(--bg, var(--bg-2)), 0 0 0 4px var(--accent-cyan); }
.sw.sm { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 4px; cursor: default; }
.asset .meta .gdate { color: var(--text-dim); }
.asset .meta .ai-tpl {
  display: block; width: fit-content; max-width: 100%; box-sizing: border-box; margin-bottom: 5px; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; line-height: 1.5; color: var(--text);
  background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .32);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asset .meta .ai-info { float: right; font-size: 11.5px; cursor: pointer; }
.asset .meta .ai-info + .ai-info { margin-right: 10px; }   /* 找回步骤（README 第 96 节），浮动后排在「详情」左边 */

/* 基础画布：两步模板（反推 → 改提示词 → 垫图出图，2026-11-03） */
.bc-steps { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.bc-step-h { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.bc-step-h > b { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-cyan); color: #04121a; font-size: 12px; }
.bc-step-h .spacer { flex: 1; }
.bc-caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.bc-cap > span { font-size: 13px; font-weight: 600; }
.bc-cap small { font-weight: 400; color: var(--text-faint, var(--text-dim)); margin-left: 4px; }
.bc-cap textarea { min-height: 96px; resize: vertical; }
.bc-cap.empty textarea { border-color: var(--danger); }
.bc-cap.empty small { color: var(--danger); }
@media (max-width: 760px) { .bc-caps { grid-template-columns: 1fr; } }

/* 高级画布：参考图编号与 @ 引用（2026-11-04） */
.grefno { flex: none; margin-left: 6px; padding: 0 6px; border-radius: 9px; background: var(--accent-cyan); color: #04121a; font-size: 11px; font-weight: 700; line-height: 17px; }
.gmentions { display: flex; flex-wrap: wrap; gap: 4px; }
.gmentions:not(:empty) { margin-top: 5px; }
.gmention { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 2px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 11px; color: var(--text); }
.gmention img { width: 20px; height: 20px; object-fit: cover; border-radius: 4px; }
.gmention.bad { padding-left: 6px; color: var(--danger); border-color: var(--danger); }
.gmention-pop { position: fixed; z-index: 1000; width: 260px; max-height: 280px; overflow: auto; padding: 4px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.gmention-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.gmention-item.on, .gmention-item:hover { background: rgba(var(--accent-rgb), .14); }
.gmention-item img, .gmention-noimg { flex: none; width: 36px; height: 36px; object-fit: cover; border-radius: 5px; background: rgba(var(--neutral-rgb), .06); }
.gmention-item b { flex: none; }
.gmention-item span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-dim); }
.gmention-empty { padding: 8px; font-size: 12px; line-height: 1.6; color: var(--text-dim); }

/* 基础画布：提示词填空模板（2026-11-04） */
.bf-capcols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bf-capcol { padding: 12px; border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.bf-capt { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.bf-lead { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.bf-lead .t { padding-top: 30px; font-size: 14px; }
.bf-lead .bf-block { flex: 1 1 200px; min-width: 0; }
.bf-lead .bf-block.sel { flex: 0 0 110px; }
.bf-rowwrap { margin-bottom: 14px; }
.bf-rowlabel { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bf-lead.plain { align-items: center; margin-bottom: 4px; }
.bf-lead.plain .t { padding-top: 0; line-height: 1.7; }
.bf-lead.plain .bf-block { flex: 0 1 260px; margin-bottom: 0; }
.bf-opt { flex: none; margin: 0; }
.bf-presets { margin-bottom: 8px; }
.bf-presets .chip:disabled { opacity: .45; cursor: not-allowed; }
.bf-block.empty input[type=text], .bf-block.empty textarea { border-color: var(--danger); }
.bf-block textarea:disabled { opacity: .45; }
.bf-prev { margin-top: 4px; padding: 12px; border: 1px dashed var(--border); border-radius: 10px; }
.bf-preview { font-size: 13px; line-height: 1.7; color: var(--text-dim); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
@media (max-width: 760px) { .bf-capcols { grid-template-columns: 1fr; } }

/* 模板墙：管理员的隐藏 / 删除（2026-11-03） */
.tpl-admin { display: flex; gap: 6px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border-strong); }
.tpl-admin button { flex: 1 1 auto; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
/* 多组并排（2026-11-05，README 第 64 节）：外层一排 iframe，每个 iframe 是一份完整的表单 */
.wrap.bc-wide { max-width: 1840px; }
.bg-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.bg-cols { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; }
.bg-col { flex: 1 1 0; min-width: 320px; }
.bg-col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; min-height: 28px; }
.bg-col iframe { display: block; width: 100%; height: 760px; border: 0; }
html.bc-embed, html.bc-embed body { height: auto; min-height: 0; padding: 0; overflow: hidden; background: transparent; }
html.bc-embed body::before, html.bc-embed body::after { display: none; }
html.bc-embed .topbar, html.bc-embed .bc-head, html.bc-embed #notice, html.bc-embed #wall,
html.bc-embed .bc-side, html.bc-embed #bcBack, html.bc-embed a[href^="/canvas-advanced"] { display: none !important; }
html.bc-embed .wrap { max-width: none; padding: 0; }
html.bc-embed .bc-layout { display: block; }
.folder-link { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.folder-link-logo { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; }
.folder-link-logo img { display: block; height: 28px; width: auto; }
/* AI 产出里的视频（2026-11-05，README 第 69 节） */
.ai-card .thumb { position: relative; }
.ai-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 17px; line-height: 44px; text-align: center; pointer-events: none; }
.ai-video { display: block; width: 100%; max-height: 72vh; border-radius: 10px; background: #000; }
/* 后台用量图表（2026-11-05，README 第 66 节） */
.chart-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 14px; }
@media (max-width: 820px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card { padding: 16px; border-radius: 13px; background: var(--glass); border: 1px solid var(--border); min-width: 0; }
.chart-title { margin: 0 0 14px; font-size: 14px; font-weight: 600; }
.chart-title .faint { font-weight: 400; font-size: 12px; margin-left: 4px; }
.chart-empty { padding: 28px 0; text-align: center; }
.day-chart { display: flex; gap: 8px; }
.day-axis { height: 150px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; min-width: 22px; font-size: 11.5px; color: var(--text-faint); line-height: 1; }
.day-plot { flex: 1; min-width: 0; display: flex; gap: 2px; height: 150px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
  background: linear-gradient(var(--border), var(--border)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--border), var(--border)) 0 50% / 100% 1px no-repeat; }
.day-slot { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.day-slot:hover, .day-slot:focus-visible { background: var(--glass-2); }
.day-bar { position: relative; width: 100%; max-width: 24px; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.day-peak { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); padding-bottom: 3px; font-size: 12px; font-weight: 600; color: var(--text); }
.day-x { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); padding-top: 5px; font-size: 11.5px; color: var(--text-faint); }
.seg-bar { display: flex; gap: 2px; height: 28px; }
.seg { min-width: 3px; border-radius: 4px; padding: 0 8px; font-size: 12px; font-weight: 600; line-height: 28px; color: #0a0b0e; overflow: hidden; white-space: nowrap; outline: none; }
.seg:focus-visible { box-shadow: 0 0 0 2px var(--text); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-dim); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.member-row { display: grid; grid-template-columns: 76px minmax(60px, 1fr) 138px; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 6px; font-size: 13px; outline: none; }
.member-row:hover, .member-row:focus-visible { background: var(--glass-2); }
.member-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-track i { display: block; height: 14px; min-width: 2px; background: var(--accent); border-radius: 0 4px 4px 0; }
.member-val { text-align: right; white-space: nowrap; color: var(--text); }
.member-val small { margin-left: 8px; color: var(--text-faint); font-size: 12px; }
#chartTip { display: none; position: fixed; z-index: 90; padding: 5px 9px; border-radius: 7px; font-size: 12.5px; color: var(--text); background: var(--glass-strong); border: 1px solid var(--border-strong); pointer-events: none; white-space: nowrap; }
#users .team-row td { background: var(--glass-2); padding-top: 10px; padding-bottom: 10px; }
.tpl-card[draggable="true"] { cursor: grab; }
.tpl-card.dragging { opacity: .45; }
.tpl-card.drag-over { border-color: var(--border-strong); box-shadow: 0 0 0 2px var(--border-strong); }
.tpl-card.hidden-tpl .tpl-thumb { opacity: .45; filter: grayscale(.6); }

/* 出图完成提醒（2026-11-10，README 第 95 节）：右上角（顶栏下面）卡片，不自动消失，等用户自己关。右下角是 toast */
#runDone { position: fixed; right: 18px; top: 72px; z-index: 700; display: flex; flex-direction: column; gap: 10px; width: min(320px, calc(100vw - 32px)); }
.run-done {
  position: relative; padding: 12px 34px 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 16px 40px rgba(0,0,0,.5);
  animation: rd-in .25s var(--ease, ease-out);
}
.run-done.good { border-left: 4px solid var(--accent); }
.run-done.warn { border-left: 4px solid var(--accent-2); }
.run-done.bad { border-left: 4px solid var(--accent); }
.run-done .rd-head { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.run-done .rd-name { font-size: 13px; color: var(--text); word-break: break-all; }
.run-done .rd-err { font-size: 12px; color: var(--text-faint); margin-top: 4px; line-height: 1.5; }
.run-done .rd-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.run-done .rd-btns:empty { display: none; }
.run-done .rd-x { position: absolute; top: 6px; right: 6px; background: none; border: 0; color: var(--text-faint); cursor: pointer; font-size: 13px; padding: 4px 6px; }
.run-done .rd-x:hover { color: var(--text); }
@keyframes rd-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 批量标签：要去掉的标签划掉（2026-11-10，README 第 94 节） */
.chip.strike { text-decoration: line-through; opacity: .55; border-style: dashed; }

/* 上传同名对比（2026-11-10，README 第 93 节） */
.dup-modal { width: min(880px, 94vw); }
.dup-list { display: flex; flex-direction: column; gap: 12px; max-height: 64vh; overflow: auto; padding-right: 4px; }
.dup-row { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.dup-row.chosen { border-color: var(--border-strong); }
.dup-pair { display: flex; gap: 12px; align-items: stretch; }
.dup-side { width: 200px; flex: 0 0 auto; }
.dup-old { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 auto; align-content: flex-start; }
.dup-old .dup-tag { flex-basis: 100%; }
.dup-side img, .dup-noimg { width: 200px; height: 150px; object-fit: contain; background: var(--bg-2); border-radius: 8px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text-faint); font-size: 12px; cursor: zoom-in; }
.dup-noimg { cursor: default; line-height: 1.6; }
.dup-side.new img, .dup-side.new .dup-noimg { border-color: var(--border-strong); }
.dup-tag { font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }
.dup-cap { font-size: 12px; margin-top: 4px; word-break: break-all; line-height: 1.5; }
.dup-vs { align-self: center; color: var(--text-faint); font-size: 12px; writing-mode: vertical-rl; letter-spacing: 2px; }
.dup-same { margin-top: 8px; }
.dup-same:empty { display: none; }
.dup-pick { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.dup-pick button.on { background: var(--glass-2); border-color: var(--text); color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .dup-pair { flex-direction: column; } .dup-vs { writing-mode: horizontal-tb; } }

/* 设计资产库智能标签（2026-11-10，README 第 92 节）：用户要求不要太明显 —— 筛选条上一个淡淡的文字按钮，点开才列 */
.smart-toggle {
  background: none; border: 1px dashed transparent; color: var(--text-faint); font-size: 12px;
  padding: 3px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.smart-toggle:hover, .smart-toggle.open { color: var(--text); border-color: var(--border-strong); }
.smart-toggle.on { color: var(--text); border-style: solid; border-color: var(--border-strong); background: var(--glass-2); }
.smart-toggle .caret { font-size: 10px; opacity: .7; }
.smart-row { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 10px; margin-top: 2px; border-radius: 10px; border: 1px dashed var(--border); }
.smart-row .chip { font-size: 12px; }
.smart-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.smart-chip { display: inline-flex; align-items: center; border: 1px dashed var(--border-strong); border-radius: 999px; overflow: hidden; }
.smart-chip button { background: none; border: 0; color: var(--text-dim, var(--text)); font-size: 12px; padding: 2px 8px; cursor: pointer; }
.smart-chip button[disabled] { cursor: default; }
.smart-chip .smart-x { padding: 2px 6px 2px 2px; color: var(--text-faint); }
.smart-chip .smart-x:hover { color: var(--bad, var(--accent)); }
/* 智能标签校正（README 第 100 节） */
.smart-fix { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--border, #ccc); border-radius: 8px; }
.smart-fix-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; }
.smart-fix-label { width: 34px; color: var(--text-faint); font-size: 12px; }
/* 智能标签排序弹窗（README 第 110 节） */
.smart-order { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.smart-order-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; }
.smart-order-n { width: 20px; color: var(--text-faint); font-size: 12px; text-align: right; }
.smart-order-name { flex: 1; }
.smart-chip .smart-name:not([disabled]):hover { background: var(--glass-2); }

/* 模板使用指南（2026-11-10，README 第 90 节）：封面右上角的按钮 + 查看 / 编辑窗口 */
.tpl-thumb { position: relative; }
.tpl-guide-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; line-height: 1.4;
  background: rgba(10, 12, 16, .72); color: #fff; border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(4px); cursor: pointer; white-space: nowrap;
}
.tpl-guide-btn:hover { background: rgba(10, 12, 16, .9); border-color: rgba(255, 255, 255, .55); }
.tpl-guide-btn.empty { border-style: dashed; color: rgba(255, 255, 255, .8); }
.tpl-card.hidden-tpl .tpl-thumb .tpl-guide-btn { opacity: 1; }
.guide-modal { width: min(760px, 92vw); max-width: none; }
.guide-body { max-height: 62vh; overflow: auto; }
.guide-text { white-space: pre-wrap; word-break: break-word; line-height: 1.8; font-size: 14px; margin: 0 0 12px; }
.guide-empty { color: var(--text-faint); }
.guide-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.guide-imgs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; display: block; }
.guide-meta { color: var(--text-faint); font-size: 12px; margin-top: 10px; }
.guide-edit-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.guide-edit-imgs .gi { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-2) center / cover no-repeat; }
.guide-edit-imgs .gi .gi-tools { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; gap: 4px; justify-content: flex-end; }
.guide-edit-imgs .gi button { padding: 1px 7px; font-size: 12px; }
.guide-drop { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 12px; text-align: center; color: var(--text-faint); cursor: pointer; margin-top: 8px; }
.guide-drop.over { background: var(--glass-2); }
.tpl-card.hidden-tpl .tpl-name { color: var(--text-faint, var(--text-dim)); }

/* 顶栏「组员网址」：管理员用 localhost 打开时高亮提醒（2026-11-03） */
.topbar .warn-btn { border-color: rgba(var(--accent-rgb), .6); color: var(--star); }

/* 设计资产库：批量归类 / 拖到文件夹（2026-11-03） */
#btnSelect.on { border-color: var(--accent-cyan); color: var(--accent-cyan); }
body.selecting .asset[data-id], body.selecting .asset[data-pid] { cursor: pointer; }
.asset.picked { outline: 3px solid var(--accent-cyan); outline-offset: -3px; }
.asset.picked::after { content: '✓'; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-cyan); color: #04121a; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; z-index: 2; }
.asset[draggable="true"] { -webkit-user-drag: element; }
body.dragging-assets #side .tree-row { outline: 1px dashed rgba(var(--accent-rgb), .25); }
#side .tree-row.drop { background: rgba(var(--accent-rgb), .18); outline: 2px solid var(--accent-cyan); }
.selbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px;
  width: min(820px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 12px;
  background: var(--panel, #15181d); border: 1px solid var(--accent-cyan); box-shadow: 0 8px 30px rgba(0,0,0,.45); }
@media (max-width: 700px) { .selbar .muted { display: none; } }

body.selecting main { padding-bottom: 90px; }

/* 拖文件进设计资产库直接上传（2026-11-03）：全屏提示层，不挡鼠标事件 */
.drophint { position: fixed; inset: 0; z-index: 80; pointer-events: none; display: flex; align-items: center; justify-content: center;
  background: rgba(var(--accent-rgb), .07); border: 3px dashed var(--accent-cyan); }
.drophint > div { background: var(--panel, #15181d); border: 1px solid var(--accent-cyan); border-radius: 14px; padding: 18px 26px;
  font-size: 16px; text-align: center; line-height: 1.8; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.drophint small { color: var(--text-faint, var(--text-dim)); font-size: 12.5px; }

/* 取色：配色参考（2026-11-03）—— 圆形色块 + 底下色值，点击复制 */
.pal-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 4px; padding: 2px 8px 10px; }
.pal-strip .pc { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px; min-width: 0;
  background: none; border: none; cursor: copy; color: var(--text-dim, #a8b0bd); }
.pal-strip .pc i { display: block; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(var(--neutral-rgb), .18);
  box-shadow: 0 1px 4px rgba(0,0,0,.35); transition: transform .12s; }
.pal-strip .pc span { font: 10px/1.2 ui-monospace, Consolas, monospace; letter-spacing: -.2px; white-space: nowrap; }
.pal-strip .pc:hover i { transform: scale(1.15); }
.pal-strip .pc:hover span { color: var(--text); }
.pal-strip.big { display: flex; flex-wrap: wrap; padding: 4px 0 6px; gap: 10px 14px; }
.pal-strip.big .pc { flex: 0 0 auto; max-width: none; }
.pal-strip.big .pc i { width: 46px; height: 46px; }
.pal-strip.big .pc span { font-size: 12px; }
.pal-loading { grid-column: 1 / -1; font-size: 11px; color: var(--text-faint, var(--text-dim)); padding: 4px 0; }

/* 管理员调整取色（2026-11-03） */
.pal-strip .pc.editing { position: relative; cursor: default; padding-top: 4px; }
.pal-strip .pc .pc-x { position: absolute; top: -4px; right: -6px; width: 18px; height: 18px; border-radius: 50%; padding: 0;
  font-size: 10px; line-height: 16px; background: var(--danger); color: #fff; border: none; cursor: pointer; }
.pal-strip .pc .pc-mv { display: flex; gap: 2px; min-height: 18px; }
.pal-strip .pc .pc-mv button { padding: 0 6px; font-size: 12px; line-height: 16px; border-radius: 4px; }
.pal-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; padding: 10px 12px;
  border: 1px dashed var(--accent-cyan); border-radius: 10px; }
img.picking { cursor: crosshair !important; outline: 2px dashed var(--accent-cyan); outline-offset: 2px; }
.pal-loupe { position: fixed; z-index: 200; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 8px; background: var(--panel, #15181d); border: 1px solid var(--border-strong); font: 12px ui-monospace, Consolas, monospace;
  box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.pal-loupe i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); }
.pal-loupe small { color: var(--text-faint, var(--text-dim)); font-family: inherit; }

/* 场景合成编辑器（2026-11-06，README 第 74 节，scene-editor.js）。铺满全屏，所以要盖掉 .modal-back 的居中和留白 */
.se-back { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; background: var(--bg-2); backdrop-filter: none; }
.se-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.se-tools { display: flex; gap: 4px; }
.se-tools button.on { background: var(--accent-cyan); border-color: var(--accent-cyan); color: #06121a; }
.se-size { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.se-size input { width: 110px; }
.se-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.se-flex { flex: 1; }
.se-work { flex: 1; min-height: 0; margin: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.se-stage { position: relative; flex: none; overflow: hidden; box-shadow: 0 0 0 1px var(--border); user-select: none; }
.se-work.panning, .se-work.panning * { cursor: grab !important; }
.se-stage.over { box-shadow: 0 0 0 2px var(--accent-cyan); }
.se-stage.painting { cursor: none; }
.se-base, .se-paint { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.se-products { position: absolute; inset: 0; }
.se-stage.painting .se-products { pointer-events: none; }
.se-prod { position: absolute; cursor: move; }
.se-prod img { width: 100%; height: 100%; display: block; pointer-events: none; }
.se-prod.on { outline: 1px solid var(--accent-cyan); }
.se-h { display: none; position: absolute; width: 12px; height: 12px; margin: -6px; background: #fff; border: 1px solid #06121a; }
.se-prod.on .se-h { display: block; }
.se-h.h-nw { left: 0; top: 0; cursor: nwse-resize; }
.se-h.h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.se-h.h-sw { left: 0; top: 100%; cursor: nesw-resize; }
.se-h.h-se { left: 100%; top: 100%; cursor: nwse-resize; }
.se-cursor { display: none; position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid #000; box-shadow: 0 0 0 1px #fff; pointer-events: none; }
.se-tip { padding: 0 14px 10px; font-size: 12px; color: var(--text-faint); text-align: center; }
.se-warn { margin-top: 8px; color: var(--accent-cyan); font-size: 14px; font-weight: 700; line-height: 1.6; }
.se-warn-top { margin: 10px 14px 0; text-align: center; font-size: 15px; }
/* 结果图局部编辑（README 第 81 节，public/js/box-edit.js） */
.be-stage { position: relative; display: inline-block; line-height: 0; cursor: crosshair; user-select: none; box-shadow: 0 0 0 1px var(--border); }
.be-img { display: block; max-width: calc(100vw - 40px); max-height: calc(100vh - 250px); }
.be-boxes { position: absolute; inset: 0; }
.be-box { position: absolute; border: 2px solid var(--accent); background: rgba(var(--accent-rgb), .12); box-sizing: border-box; line-height: 1; }
.be-box span { position: absolute; left: -2px; top: -20px; background: var(--accent); color: #fff; font-size: 12px; padding: 2px 6px; border-radius: 3px 3px 0 0; }
.be-box i { position: absolute; right: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-size: 14px; text-align: center; line-height: 20px; cursor: pointer; }
.be-panel { padding: 10px 14px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.be-panel textarea { flex: 1; min-width: 0; }
.be-status { font-size: 13px; min-height: 18px; color: var(--text-faint); }
.be-status.bad { color: var(--accent-cyan); }
.be-status.good { color: var(--accent-cyan); }
.bc-btext { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.bc-btext b { flex: none; width: 64px; padding-top: 6px; font-weight: 600; font-size: 13px; }
.bc-btext textarea { flex: 1; min-width: 0; }
.bc-pairs { flex: 1; min-width: 0; }
.bc-pair { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.bc-pair input { flex: 1; min-width: 0; }
.bc-pair-eq { flex: none; font-weight: 700; font-size: 16px; color: var(--text-faint); }
.bc-pair.half input { border-color: var(--accent-cyan); }
/* 九宫格产品动画：9 个镜头框 + 选镜头（2026-11-09，README 第 85 节） */
.bc-shot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
.bc-shot-grid .bc-cap textarea { min-height: 72px; }
.bc-pick { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.bc-pick-img { position: relative; border-radius: 8px; overflow: hidden; background: var(--panel-2, var(--surface)); }
.bc-pick-img img { display: block; width: 100%; height: auto; }
.bc-pick-cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.bc-pick-cell { all: unset; box-sizing: border-box; cursor: pointer; border: 1px solid rgba(255,255,255,.25); position: relative; }
.bc-pick-cell:hover { background: rgba(var(--neutral-rgb), .08); }
.bc-pick-cell i, .bc-pick-cell b { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; line-height: 22px; text-align: center;
  border-radius: 11px; font-size: 12px; font-style: normal; background: rgba(0,0,0,.55); color: #fff; }
.bc-pick-cell.on { border: 3px solid var(--accent, var(--accent)); background: rgba(var(--accent-rgb), .12); }
.bc-pick-cell.on b { background: var(--accent, var(--accent)); }
.bc-pick-list { display: flex; flex-direction: column; gap: 8px; }
.bc-pk-item { border: 1px solid var(--border, var(--border-strong)); border-radius: 8px; padding: 8px; }
.bc-pk-item textarea { width: 100%; margin-top: 6px; min-height: 64px; resize: vertical; }
@media (max-width: 760px) { .bc-shot-grid { grid-template-columns: 1fr; } .bc-pick { grid-template-columns: 1fr; } }
.tpl-count { margin-top: 6px; font-size: 12px; color: var(--text-dim); }

/* 高级画布：视频提示词放大编辑。节点内不加定位祖先，保留连线坐标。 */
.gfield > .gprompt-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gprompt-expand { padding: 2px 7px; font-size: 11px; line-height: 1.5; }
.modal.gprompt-dialog { width: min(960px, 100%); }
.gprompt-editor { display: block; width: 100%; height: 55vh; min-height: 180px; max-height: 62vh; resize: vertical; font-size: 14px; line-height: 1.8; }
/* 场景参考图局部截取 */
.modal.rc-dialog { width: min(1080px, 100%); }
.rc-work { display: flex; justify-content: center; align-items: center; margin: 14px 0; min-height: 120px; background: var(--bg-2); overflow: hidden; }
.rc-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; touch-action: none; cursor: crosshair; user-select: none; overflow: hidden; }
.rc-stage img { display: block; max-width: 100%; max-height: 54vh; width: auto; height: auto; }
.rc-selection { position: absolute; border: 2px solid var(--accent-cyan); box-shadow: 0 0 0 9999px rgba(0,0,0,.58); pointer-events: none; box-sizing: border-box; }
.rc-selection.movable { pointer-events: auto; cursor: move; }

/* 四边手柄放在选框内，贴近原图边缘时仍可抓取。 */
.rc-handle { display: none; position: absolute; z-index: 1; padding: 0; margin: 0; min-width: 0; border: 1px solid #fff; border-radius: 4px; background: var(--accent); box-shadow: 0 1px 5px #0008; pointer-events: auto; touch-action: none; }
.rc-selection.ready .rc-handle { display: block; }
.rc-handle-n, .rc-handle-s { width: 28px; height: 12px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
.rc-handle-n { top: 0; } .rc-handle-s { bottom: 0; }
.rc-handle-w, .rc-handle-e { width: 12px; height: 28px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.rc-handle-w { left: 0; } .rc-handle-e { right: 0; }

/* BGM 音乐卡片：原生进度条支持定位、音量，额外提供醒目的播放/暂停按钮。 */
.bgm-player { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; padding: 20px 12px 14px; background: linear-gradient(135deg, var(--accent-soft), var(--glass-2)); border-radius: 10px; }
.bgm-play { display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border-radius: 50%; border: 1px solid var(--accent-cyan); background: var(--accent); color: #fff; font-size: 22px; cursor: pointer; }
.bgm-play:hover { background: var(--accent-2); }
.bgm-note { font-size: 36px; color: var(--status-ink); }
.bgm-player audio { display: block; width: 100%; min-width: 0; height: 38px; }
.bgm-download { display: inline-block; margin-top: 8px; font-size: 12px; }

/* Basic canvas template switcher */
.bc-switch{position:fixed;left:12px;top:116px;bottom:20px;width:210px;z-index:30;padding:12px;background:var(--bg-2,#0e1014);color:var(--text,#f3f4f7);border:1px solid var(--border-strong,#343842);border-radius:12px;box-shadow:0 4px 18px #0006;overflow:auto;color-scheme:inherit}
.bc-switch[hidden],#bcSwitchBody[hidden]{display:none}
.bc-switch-toggle{width:100%;text-align:left;font-weight:600;margin-bottom:12px}
#bcSwitchBody input{width:100%;box-sizing:border-box;margin-bottom:10px}
.bc-switch-list{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
.bc-switch-list a{display:block;padding:10px;border-radius:7px;color:inherit;text-decoration:none;overflow-wrap:anywhere}
.bc-switch-list a:hover{background:var(--glass-2);color:var(--text)}.bc-switch-list a.active{background:var(--accent-soft);color:var(--accent-cyan);font-weight:600}


body.bc-has-switch:not(.bc-switch-expanded) .bc-switch{width:92px;padding:8px}
body.bc-has-switch:not(.bc-switch-expanded) .bc-switch-toggle{white-space:nowrap;padding:8px 2px;margin-bottom:0;text-align:center}
@media(max-width:800px){.bc-switch{top:110px;bottom:16px;box-shadow:0 4px 20px #0003}}

.bc-switch-toggle{background:var(--glass-2);color:var(--text);border:1px solid var(--border-strong)}
#bcSwitchBody input{background:var(--bg);color:var(--text);border:1px solid var(--border-strong)}
#bcSwitchBody input::placeholder,.bc-switch .hint{color:var(--text-dim)}
.bc-switch a:focus-visible,.bc-switch button:focus-visible,.bc-switch input:focus-visible{outline:2px solid var(--accent-cyan);outline-offset:2px}

/* The floating switcher never changes the centered canvas geometry. */
.bc-switch-cover{aspect-ratio:4/3;width:100%;height:auto;min-height:0;flex:none;overflow:hidden;border-radius:6px;background:var(--bg);display:flex;align-items:center;justify-content:center;color:var(--text-dim);font-size:12px}
.bc-switch-cover{position:relative}.bc-switch-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;display:block}
.bc-switch-name{display:block;width:100%;margin-top:7px;line-height:1.5;text-align:center}
body.bc-has-switch:not(.bc-switch-expanded) .bc-switch{bottom:auto;overflow:visible}

/* Only template cards scroll; navigation and search stay visible. */
.bc-switch{display:flex;flex-direction:column;overflow:hidden}
.bc-switch-toggle{flex:none}
#bcSwitchBody{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
#bcSwitchBody input{flex:none}
.bc-switch-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.bc-switch-list a{flex:none}
#bcSwitchBody>.hint{flex:none}

/* Two-group forms always reserve the expanded template switcher width. */
body.bc-has-switch .wrap.basic-canvas.bc-wide{margin-left:246px;margin-right:12px;width:calc(100% - 258px);max-width:1840px}
body.bc-has-switch .basic-canvas.bc-wide .bg-cols{width:100%;min-width:0}
@media(min-width:2340px){body.bc-has-switch .wrap.basic-canvas.bc-wide{margin-left:auto;margin-right:auto}}

.bc-layout.bc-no-intro{display:block}
.bc-layout.bc-no-intro>.bc-main{width:100%;min-width:0}

#pg .thumb{position:relative}
.scene-pick-preview{position:absolute;right:8px;bottom:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:1px solid #ffffff55;border-radius:50%;background:#10141de6;color:#fff;box-shadow:0 2px 8px #0005;cursor:zoom-in}
.scene-pick-preview:hover{background:var(--accent);color:#fff}
.scene-pick-preview:focus-visible{outline:2px solid var(--accent-cyan);outline-offset:2px}

.vs-material{min-height:240px;border:1px dashed var(--border-strong);border-radius:10px;background:var(--bg-2);display:flex;align-items:center;justify-content:center;padding:12px;transition:border-color .15s,background .15s}
.vs-material.over{border-color:var(--accent-cyan);background:var(--accent-soft)}
.vs-material video{display:block;width:100%;max-height:420px;border-radius:8px;background:var(--bg)}
.vs-material video[hidden],.vs-material .bc-pic-empty[hidden]{display:none}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f8fc;
  --bg-2: #edf3f9;
  --surface: #fff;
  --glass: rgba(25,54,88,.035);
  --glass-2: rgba(25,54,88,.065);
  --glass-strong: rgba(255,255,255,.96);
  --border: rgba(25,54,88,.14);
  --border-strong: rgba(25,54,88,.27);
  --text: #152235;
  --text-dim: #42536a;
  --text-faint: #53657c;
  --accent: #246fa8;
  --accent-cyan: #146185;
  --accent-2: #1c7892;
  --accent-rgb: 67, 154, 221;
  --accent-2-rgb: 51, 173, 199;
  --neutral-rgb: 25, 54, 88;
  --recess-rgb: 65, 92, 127;
  --grad: linear-gradient(to top right, #69adfe, #66eefd);
  --grad-lift: transparent;
  --status-ink: #174767;
}
.topbar .theme-switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 0;
  width: 62px; height: 30px; flex: 0 0 62px; padding: 2px;
  align-items: center; border-radius: 999px; background: var(--bg-2);
  color: var(--text-dim); border: 1px solid var(--border-strong);
}
.theme-switch::before {
  content: ""; position: absolute; inset: 2px auto 2px 2px; width: calc((100% - 4px) / 2);
  border-radius: 999px; background: var(--grad); transform: translateX(100%);
  transition: transform .18s var(--ease);
}
.theme-switch span { position: relative; text-align: center; font-size: 13px; line-height: 1; }
.theme-switch span:last-child, :root[data-theme="light"] .theme-switch span:first-child { color: #071522; }
:root[data-theme="light"] .theme-switch::before { transform: translateX(0); }
:root[data-theme="light"] .theme-switch span:last-child { color: var(--text-dim); }
:root[data-theme="light"] .topbar .brand img { filter: brightness(0); }
.theme-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .theme-switch::before { transition: none; } }

/* Theme accents for controls, selection and chart marks. */
.nav a.on, .cv-tabs a.on, .side a.item.on, .side .tree-row.on, .side .tree-row .mk:hover,
.chip.on, .ai-filters .chip.hot.on, .fmt.on, .openf.on, .smart-toggle.on, .dup-pick button.on,
#btnSelect.on, #btnBatchTag.on, .gmention-item.on, .gmention-item:hover, .bc-pick-cell.on,
.badge.live, .badge.warn, .notice.info, .notice.bad, .gview-dl, .gview-dl:hover,
.bgm-player, #side .tree-row.drop, .gnode.filedrop .gdrop { background: var(--grad-tint); }
.card .tag, .gport .dot:hover, .gport .dot.linked, .grefno, .grefnum,
.se-tools button.on, .be-box span, .be-box i, .rc-handle, .gview-up,
.bc-pick-cell.on b, .bgm-play, .bgm-play:hover, .day-bar, .member-track i { background: var(--grad-control); }
.card .tag, .grefno, .grefnum, .se-tools button.on, .be-box span,
.be-box i, .gview-up, .bc-pick-cell.on b, .bgm-play { color: var(--accent-on); }
.home-cards .tag { background: none; color: var(--accent-cyan); }
