
  :root{
    --bg:#0a0a0c; --node:#15151a; --node-2:#1c1c23; --field:#0f0f13;
    --line:rgba(255,255,255,.08); --line-2:rgba(255,255,255,.16);
    --text:#f4f4f7; --dim:#8e8e9c; --dim-2:#5f5f6c;
    --accent:#ffffff; --accent-2:#d8d8e2;
    --ok:#3ddc97; --warn:#ffb648;     --danger:#ff5f5f;
    --r:14px;
    /* 让没单独写 ::-webkit-scrollbar 的滚动区也走深色系统条，不会冒出一条白底粗轨 */
    color-scheme:dark;
  }
  *{box-sizing:border-box;margin:0;padding:0}
  html,body{height:100%;overflow:hidden}
  body{
    background:var(--bg); color:var(--text);
    font-family:var(--font);
    font-size:13px; -webkit-font-smoothing:antialiased; user-select:none;
  }

  /* ---------------- 画布 ---------------- */
  #board{
    position:fixed; inset:0; cursor:default; overflow:hidden;
    background-color:#0a0a0c;
    background-image:
      linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),
      linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);
    background-size:44px 44px;
  }
  #board.spacepan{cursor:grab}
  #board.panning{cursor:grabbing}
  #board::before{
    content:""; position:absolute; inset:0; pointer-events:none;
    background:
      radial-gradient(1000px 620px at 16% -8%, rgba(255,255,255,0.06), transparent 62%),
      radial-gradient(820px 500px at 88% 6%, rgba(75,140,255,.09), transparent 58%);
  }
  #world{
    position:absolute; left:0; top:0; width:0; height:0;
    z-index:2;   /* 高于 #guides，保证参考线不会盖住节点 */
    zoom:1;   /* 用 zoom 而非 transform:scale，缩放后文字仍按真实尺寸排版，不会发虚 */
  }
  #links{
    position:absolute; left:-50000px; top:-50000px;
    width:100000px; height:100000px; overflow:visible; pointer-events:none;
  }
  #nodes{position:absolute; left:0; top:0}

  /* ---------------- 顶栏 ---------------- */
  .bar{
    position:fixed; left:14px; right:14px; top:12px; height:50px; z-index:30;
    display:flex; align-items:center; gap:12px; padding:0 14px;
    border:1px solid var(--line); border-radius:var(--r);
    background:rgba(18,18,23,.82); backdrop-filter:blur(16px); user-select:none;
    box-shadow:0 12px 34px rgba(0,0,0,.38);
  }
  .brand{display:flex;align-items:center;gap:9px;font-weight:650;letter-spacing:.2px;font-size:14px}
  /* 品牌词标：用户给的那张透明底手写体（白字，深色底上直接放，不加圆框不加底板）。
     亮色主题下用 invert 变黑 —— 白字放浅色底上会看不见。 */
  .mark{
    height:21px; width:auto; display:block; flex:0 0 auto;
    object-fit:contain; border:0; border-radius:0; background:none;
    filter:drop-shadow(0 2px 10px rgba(255,255,255,.14));
    transition:filter .16s ease;
  }
  body.light .mark{filter:invert(1) drop-shadow(0 1px 6px rgba(20,20,40,.18))}
  .brand small{color:var(--dim-2);font-weight:500;font-size:11px;margin-left:1px}
  /* 左上角 logo = 返回主页的按钮（原来的「←」已经删掉，别再把它当普通图片放那儿） */
  .markbtn{
    display:grid; place-items:center; padding:0; border:0; background:transparent;
    border-radius:8px; cursor:pointer; flex:0 0 auto;
    transition:transform .14s ease;
  }
  .markbtn:hover{transform:translateY(-1px)}
  .markbtn:hover .mark{filter:drop-shadow(0 0 14px rgba(255,255,255,.55))}
  body.light .markbtn:hover .mark{filter:invert(1) drop-shadow(0 0 10px rgba(20,20,40,.3))}
  .markbtn:active{transform:scale(.94)}
  .markbtn:focus-visible{outline:2px solid rgba(255,255,255,.6); outline-offset:2px}
  .brand .mark{pointer-events:none}
  /* 项目名：平时就是一行灰字，悬停浮出铅笔；双击文字或点铅笔都能就地改名 */
  .pwrap{display:flex;align-items:center;gap:2px;margin-left:1px;min-width:0}
  .pwrap #canvasName{
    cursor:text; border-radius:5px; padding:1px 4px; margin-left:-4px;
    max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    transition:background .15s, color .15s;
  }
  .pwrap:hover #canvasName{background:rgba(255,255,255,.075); color:var(--accent-2)}
  .penedit{
    display:inline-flex; align-items:center; justify-content:center;
    width:19px; height:19px; padding:0; border:0; border-radius:5px;
    background:transparent; color:var(--dim); cursor:pointer; flex:none;
    opacity:0; transform:translateX(-4px); pointer-events:none;
    transition:opacity .15s, transform .15s, background .15s, color .15s;
  }
  .pwrap:hover .penedit, .penedit:focus-visible{
    opacity:1; transform:none; pointer-events:auto; color:var(--accent-2);
  }
  .penedit:hover{background:rgba(255,255,255,.14); color:var(--accent)}
  .penedit:active{transform:scale(.94)}
  .cninput{
    width:150px; min-width:96px; max-width:240px;
    font:inherit; font-size:11px; font-weight:500; letter-spacing:.2px;
    color:var(--text); background:rgba(255,255,255,.09);
    border:1px solid var(--line-2); outline:none; border-radius:5px; padding:1px 4px;
  }
  .cninput:focus{border-color:rgba(255,255,255,.45); background:rgba(255,255,255,.13)}
  body.light .pwrap:hover #canvasName{background:rgba(20,20,30,.07); color:#1b1b21}
  body.light .penedit{color:rgba(28,28,40,.45)}
  body.light .pwrap:hover .penedit{color:#1b1b21}
  body.light .penedit:hover{background:rgba(20,20,30,.09); color:#1b1b21}
  body.light .cninput{background:#fff; color:#1b1b21; border-color:rgba(20,20,30,.22)}
  body.light .cninput:focus{border-color:rgba(20,20,30,.45)}
  .bar .grow{flex:1}
  .chip{
    display:flex;align-items:center;gap:6px;height:27px;padding:0 10px;
    border:1px solid var(--line);border-radius:99px;background:rgba(255,255,255,.03);
    color:var(--dim);font-size:11.5px;font-family:inherit;cursor:pointer;transition:.15s;
  }
  button.chip:hover{border-color:rgba(255,255,255,0.2);color:#dcdce6;background:rgba(255,255,255,0.04)}
  .dot.wait{background:#ff9f0a; box-shadow:0 0 6px rgba(255,159,10,.7)}

  .dot{width:6px;height:6px;border-radius:50%;background:var(--dim-2)}
  .dot.on{background:var(--ok);box-shadow:0 0 8px var(--ok)}
  .dot.off{background:var(--danger);box-shadow:0 0 8px var(--danger)}
  .tbtn{
    height:30px;padding:0 12px;border-radius:9px;border:1px solid var(--line-2);
    background:rgba(255,255,255,.05);color:#dedee8;font-size:12px;cursor:pointer;
    font-family:inherit;transition:.15s;display:flex;align-items:center;gap:6px;white-space:nowrap;
  }
  .tbtn:hover{background:rgba(255,255,255,.1)}
  .tbtn.primary{
    background:linear-gradient(135deg,#ffffff,#e4e4ec);
    border-color:transparent;font-weight:600;color:#0b0b0f;
    box-shadow:0 4px 16px rgba(255,255,255,.16);
  }
  .tbtn.primary:hover{filter:brightness(1.08)}

  /* ---------------- 缩放控件 ---------------- */
  .zoomer{
    position:fixed; left:14px; bottom:14px; z-index:30; height:38px; padding:0 6px;
    display:flex; align-items:center; gap:2px;
    border:1px solid var(--line); border-radius:11px;
    background:rgba(18,18,23,.86); backdrop-filter:blur(14px);
    box-shadow:0 10px 28px rgba(0,0,0,.4);
  }
  .zoomer button{
    width:28px;height:28px;border:0;border-radius:8px;background:transparent;
    color:var(--dim);cursor:pointer;font-size:15px;line-height:1;font-family:inherit;
    display:grid;place-items:center;transition:.14s;
  }
  .zoomer button:hover{background:rgba(255,255,255,.09);color:#fff}
  .zoomer button svg{display:block}
  .zoomer .val{
    min-width:46px;text-align:center;font-size:11.5px;color:#cfcfdc;
    font-variant-numeric:tabular-nums;cursor:pointer;
  }
  .zoomer .sep{width:1px;height:18px;background:var(--line);margin:0 3px}

  .hint{
    position:fixed; right:14px; bottom:14px; z-index:30;
    display:flex; gap:14px; padding:8px 13px;
    border:1px solid var(--line); border-radius:11px;
    background:rgba(18,18,23,.78); backdrop-filter:blur(14px);
    color:var(--dim-2); font-size:11px;
  }
  .hint b{color:#a9a9ba;font-weight:600}

  /* ---------------- 左侧导航栏（新建节点 / 导入素材） ----------------
     竖排胶囊，图标居中、悬停从右侧浮出名字。顶栏原来那三个按钮（适应 / 清空 /
     新建节点）收掉了，新建能力搬到这里；「适应」在左下缩放条里有 ⛶，
     「清空」也挪到了那条里。 */
  .navrail{
    position:fixed; left:14px; top:50%; transform:translateY(-50%); z-index:31;
    display:flex; flex-direction:column; align-items:center; gap:4px;
    padding:7px 6px; border:1px solid var(--line); border-radius:19px;
    background:rgba(18,18,23,.82);
    -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px);
    box-shadow:0 12px 34px rgba(0,0,0,.38); user-select:none;
  }
  .navrail .nv{
    position:relative; width:38px; height:38px; padding:0; border:0; border-radius:11px;
    background:transparent; color:#c9c9d6; cursor:pointer; font-family:inherit;
    display:grid; place-items:center;
    transition:background .14s, color .14s, transform .12s;
  }
  .navrail .nv svg{width:19px; height:19px; display:block}
  .navrail .nv:hover{background:rgba(255,255,255,.11); color:#fff}
  .navrail .nv:active{transform:scale(.93)}
  .navrail .nv.soon::after{
    content:''; position:absolute; top:7px; right:7px; width:5px; height:5px; border-radius:50%;
    background:#ff9f0a; box-shadow:0 0 6px rgba(255,159,10,.8);
  }
  .navrail .nsep{width:20px; height:1px; background:var(--line); margin:3px 0}
  /* 名字靠自己浮出来，不用原生 title（那个要等一秒，而且和这个会叠一起） */
  .navrail .nv::before{
    content:attr(data-tip); position:absolute; left:calc(100% + 13px); top:50%;
    transform:translateY(-50%) translateX(-4px);
    white-space:nowrap; padding:5px 9px; border-radius:8px;
    background:rgba(26,26,33,.95); border:1px solid var(--line);
    color:#e6e6ee; font-size:11.5px; letter-spacing:.2px; font-weight:500;
    opacity:0; pointer-events:none;
    transition:opacity .14s, transform .14s;
    box-shadow:0 8px 20px rgba(0,0,0,.34);
  }
  .navrail .nv:hover::before{opacity:1; transform:translateY(-50%)}

  /* ---------------- 节点 ---------------- */
  .node{
    position:absolute; left:0; top:0; width:340px;
    background:var(--node); border:1px solid var(--line); border-radius:var(--r);
    box-shadow:0 16px 44px rgba(0,0,0,.5);
    display:flex; flex-direction:column; user-select:none;
    transition:border-color .15s, box-shadow .15s;
  }
  .node.sel{border-color:rgba(255,255,255,0.34); box-shadow:0 0 0 2px rgba(255,255,255,0.09), 0 18px 50px rgba(0,0,0,.55)}
  .node.video{width:372px; padding:0; overflow:hidden}
  .node-head{
    display:flex; align-items:center; gap:7px; padding:9px 11px;
    border-bottom:1px solid var(--line); cursor:grab; border-radius:var(--r) var(--r) 0 0;
    background:linear-gradient(180deg,rgba(255,255,255,.035),transparent);
  }
  .node-head:active{cursor:grabbing}
  .node-head .t{
    font-family:inherit; font-size:12px; font-weight:600; letter-spacing:0;
    color:#c6c6d2; line-height:1;
  }
  .node-head .idx{
    width:17px;height:17px;border-radius:5px;background:rgba(255,255,255,0.08);
    color:#b4a8ff;font-size:10px;display:grid;place-items:center;font-weight:700;
  }
  .node-head .grow{flex:1}
  .node-head .x{
    width:19px;height:19px;border:0;border-radius:6px;background:transparent;
    color:var(--dim-2);cursor:pointer;font-size:13px;line-height:1;
    display:grid;place-items:center;transition:.14s;
  }
  .node-head .x:hover{background:rgba(255,95,95,.16);color:#ff9d9d}
  .node-body{padding:10px 11px 11px; display:flex; flex-direction:column; gap:8px}

  /* 模式 */
  .modes{display:grid;grid-template-columns:repeat(4,1fr);gap:3px;background:var(--field);padding:3px;border-radius:9px;border:1px solid var(--line)}
  .modes button{
    height:25px;border:0;border-radius:7px;background:transparent;color:var(--dim-2);
    font-size:11px;font-family:inherit;cursor:pointer;transition:.14s;white-space:nowrap;
  }
  .modes button:hover{color:var(--text)}
  .modes button:disabled{opacity:.3;cursor:not-allowed}
  .modes button.on{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#fff;font-weight:600}

  textarea{
    width:100%;background:var(--field);border:1px solid var(--line);border-radius:9px;
    color:var(--text);font-family:inherit;font-size:12px;padding:8px 9px;outline:0;
    resize:none;line-height:1.6;min-height:74px;transition:.15s;user-select:text;
  }
  textarea:focus{border-color:rgba(255,255,255,0.26);box-shadow:0 0 0 3px rgba(255,255,255,0.05)}
  textarea::placeholder{color:var(--dim-2)}

  .media{display:flex; gap:6px; flex-wrap:wrap}
  .slot{
    position:relative; width:52px;height:52px;border-radius:8px;border:1px dashed var(--line-2);
    background:var(--field); cursor:pointer; display:grid; place-items:center;
    color:var(--dim-2); font-size:10px; text-align:center; line-height:1.25; transition:.15s;
  }
  .slot:hover{border-color:var(--accent);color:#e4e4ec;background:rgba(255,255,255,0.03)}
  .slot.add{font-size:16px;color:var(--dim-2)}
  .slot img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:7px}
  /* 素材轨 */
  /* 素材轨滚动条：不用系统默认那条白粗条（它会把整张卡片的留白撑开、还带箭头），
     改成和卡片同一套语言——一条 6px 的细槽 + 圆头滑块，静止时很淡，hover 才提亮。
     注意别在这里写 scrollbar-width，Chromium 一旦看到它，下面 ::-webkit-scrollbar 的定制会整体失效。 */
  .arail{
    display:flex;gap:6px;overflow-x:auto;overflow-y:hidden;
    padding:2px 1px 8px;overscroll-behavior-x:contain;
  }
  .arail::-webkit-scrollbar{height:6px;background:transparent}
  .arail::-webkit-scrollbar-track{background:rgba(255,255,255,.045);border-radius:99px;margin:0 1px}
  .arail::-webkit-scrollbar-thumb{background:rgba(255,255,255,.22);border-radius:99px}
  .arail::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.34)}
  .arail::-webkit-scrollbar-thumb:active{background:rgba(255,255,255,.46)}
  .arail::-webkit-scrollbar-corner{background:transparent}
  /* 只在 Firefox 上退化成系统细滚动条（它不认 ::-webkit-scrollbar） */
  @supports not (selector(::-webkit-scrollbar)){
    .arail{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.22) transparent}
  }
  .acard{
    position:relative;flex:0 0 auto;width:54px;height:54px;border-radius:10px;
    border:1px solid var(--line-2);background:var(--field);cursor:pointer;
    display:grid;place-items:center;overflow:hidden;transition:.15s;
  }
  .acard:hover{border-color:var(--accent)}
  .acard img{width:100%;height:100%;object-fit:cover;display:block;-webkit-user-drag:none;user-select:none}
  .acard.aud{background:rgba(255,255,255,0.05);border-color:rgba(255,255,255,0.15)}
  .acard .muse{font-size:18px;color:#e4e4ec;margin-top:4px}
  .acard .arole{
    position:absolute;left:2px;top:2px;font-size:9px;line-height:1.3;padding:1px 3.5px;
    border-radius:4px;background:rgba(0,0,0,.7);color:#d5d5e2;letter-spacing:.2px;pointer-events:none;
  }
  /* 参考模式里素材已在轨道上、正文却没 @ 它：角标改「浅底 + 细描边」。不是报错，
     只是提醒「模型拿不到这张图叫什么」，悬停有完整说明。别太透 —— 白底图片上会看不见 */
  .acard .arole.unused{
    background:rgba(0,0,0,.34);color:#f2f2f8;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.72);
    text-shadow:0 1px 2px rgba(0,0,0,.7);
  }
  .acard .adel{
    position:absolute;right:1px;top:1px;width:14px;height:14px;border:0;border-radius:50%;
    background:rgba(0,0,0,.75);color:#ffb3b3;font-size:9px;line-height:1;cursor:pointer;
    display:none;place-items:center;font-family:inherit;
  }
  .acard:hover .adel{display:grid}
  .acard.up{
    border-style:dashed;color:var(--dim-2);flex-direction:column;gap:3px;font-size:9.5px;
    display:flex;align-items:center;justify-content:center;
  }
  .acard.up:hover{color:#e4e4ec;border-color:var(--accent);background:rgba(255,255,255,0.04)}
  /* 首尾帧模式：「首帧 / 尾帧」两个槽。空槽是虚线 + 号，有图就退回普通素材卡。
     注意要写完整 border —— 后面那段「无边框玻璃风」的 .acard{border:0} 会把宽度清成 0 */
  .acard.flslot.empty{
    border:1px dashed rgba(255,255,255,.26);
    background:rgba(255,255,255,.035);
    color:var(--dim-2);
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
  }
  .acard.flslot.empty:hover{
    color:#e4e4ec; border-color:var(--accent); background:rgba(255,255,255,.06);
  }
  .acard.flslot .flplus{font-size:15px; line-height:1; margin-top:1px}
  /* 两个槽中间留空：一是别贴在一起，二是放一个「对调」按钮。
     尾帧是钉住的（见 flSlots），所以要换顺序只能点这里，拖是拖不动的。 */
  .flpair{display:flex; align-items:center; flex:0 0 auto}
  .flswap{
    flex:0 0 auto; width:24px; height:24px; margin:0 7px; padding:0;
    display:grid; place-items:center; border-radius:50%;
    border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.06);
    color:#cfcfdc; cursor:pointer; font-family:inherit; transition:.14s;
  }
  .flswap svg{width:13px; height:13px; display:block}
  .flswap:hover:not(:disabled){background:rgba(255,255,255,.17); color:#fff; transform:scale(1.07)}
  .flswap:disabled{opacity:.3; cursor:default}
  /* 尾帧空槽点一下：把「还没显示的那几张」铺出来让用户自己挑 */
  .flmenu{
    position:fixed; z-index:340; display:flex; gap:7px; padding:8px;
    max-width:calc(100vw - 20px); overflow-x:auto;
    border:1px solid var(--line); border-radius:12px;
    background:rgba(22,22,28,.96);
    -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
    box-shadow:0 14px 34px rgba(0,0,0,.5);
  }
  .flmenu .flmi{
    flex:0 0 auto; width:52px; height:52px; padding:0; border:0; border-radius:8px;
    overflow:hidden; background:rgba(255,255,255,.07); cursor:pointer;
    display:grid; place-items:center; color:#cfcfdc; font-family:inherit; transition:.14s;
  }
  .flmenu .flmi img{width:100%; height:100%; object-fit:cover; display:block}
  .flmenu .flmi:hover{outline:2px solid rgba(255,255,255,.55); outline-offset:-2px}
  /* 拖动排序：长按后跟手的那张「抬起来」——脱出轨道挂到 body 上跟指针走，
     原位留一个空位（.acard-ph），旁边的卡平滑让开；松手就落位。
     手感对齐首页生成条那一摞：位移 -3px、歪 -2°、放大 1.09。 */
  .acard.drag{
    z-index:300; cursor:grabbing; will-change:transform;
    box-shadow:0 16px 34px rgba(0,0,0,.62), 0 0 0 1.5px var(--accent);
  }
  /* 拎起来的卡是 position:fixed 挂在 body 上的：画布缩放后尺寸由内联 rect 接管 */
  .acard.ghost{
    position:fixed !important; margin:0 !important; pointer-events:none;
    transform-origin:50% 50%; transition:none !important;
  }
  /* 空位：只占住尺寸，不画任何东西 —— 拖开一张，中间就空出一格，和首页一样 */
  .acard-ph{flex:0 0 auto; border-radius:10px; background:transparent}
  .arail.dragging{user-select:none;cursor:grabbing}
  .arail.dragging .acard{transition:none}

  /* 富文本提示词 */
  .ptext-wrap{position:relative}
  .expand-btn{
    position:absolute;right:14px;top:6px;z-index:3;width:20px;height:20px;border-radius:6px;
    border:1px solid transparent;background:rgba(255,255,255,.05);color:var(--dim-2);
    cursor:pointer;font-size:11px;line-height:1;display:grid;place-items:center;
    font-family:inherit;transition:.15s;opacity:.7;
  }
  .ptext-wrap:hover .expand-btn{opacity:1}
  .expand-btn:hover{color:#fff;background:rgba(255,255,255,0.1);border-color:rgba(255,255,255,0.18)}
  .ptext{
    min-height:78px;max-height:230px;overflow-y:auto;white-space:pre-wrap;word-break:break-word;
    background:var(--field);border:1px solid var(--line);border-radius:9px;
    padding:8px 36px 8px 9px;font-size:12px;line-height:1.7;outline:0;transition:.15s;user-select:text;
  }
  /* 只在 Firefox 上退化成系统细滚动条：Chromium 里一旦写 scrollbar-width，
     下面那套 ::-webkit-scrollbar 定制就整体失效了（会被打回默认灰粗条） */
  @supports not (selector(::-webkit-scrollbar)){
    .ptext{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.22) transparent}
  }
  /* 滚动条：细、圆、淡淡一条，悬停才亮 —— 跟卡片里其它控件一个调子（别用浏览器默认那根白底灰块的粗条） */
  .ptext::-webkit-scrollbar{width:6px;height:6px}
  .ptext::-webkit-scrollbar-track{background:transparent;margin:7px 0}
  .ptext::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.17);border-radius:99px;min-height:34px;
  }
  .ptext::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.34)}
  .ptext::-webkit-scrollbar-thumb:active{background:rgba(255,255,255,.46)}
  .ptext::-webkit-scrollbar-corner{background:transparent}
  /* 放大编辑里那块大文本框也套同一套，别留一根又粗又亮的默认条 */
  .big-body .ptext{padding-right:20px}
  .big-body .ptext::-webkit-scrollbar{width:8px}
  .big-body .ptext::-webkit-scrollbar-thumb{background:rgba(255,255,255,.19)}
  .ptext:focus{border-color:rgba(255,255,255,0.26);box-shadow:0 0 0 3px rgba(255,255,255,0.05)}
  .ptext:empty::before{content:attr(data-ph);color:var(--dim-2);pointer-events:none}
  .mention{
    display:inline-block;padding:0 5px;margin:0 1px;border-radius:5px;
    background:rgba(255,255,255,0.09);color:#e4e4ec;font-size:11px;
    border:1px solid rgba(255,255,255,0.16);white-space:nowrap;user-select:all;
    line-height:1.55;vertical-align:baseline;
  }
  .mlist{
    position:fixed;left:0;top:0;z-index:320;
    min-width:158px;max-width:270px;max-height:212px;overflow-y:auto;
    background:rgba(26,26,33,.99);
    -webkit-backdrop-filter:blur(24px) saturate(180%);backdrop-filter:blur(24px) saturate(180%);
    border:1px solid rgba(255,255,255,.2);border-radius:12px;
    padding:5px;display:none;
    box-shadow:0 18px 44px rgba(0,0,0,.72), 0 0 0 1px rgba(0,0,0,.35);
  }
  .mlist.on{display:block}
  .mi{display:flex;align-items:center;gap:8px;padding:5px 6px;border-radius:7px;cursor:pointer;font-size:11.5px;color:#cfcfdc}
  .mi:hover{background:rgba(255,255,255,0.07)}
  .mi.on{background:rgba(255,255,255,.11)}       /* ↑↓ 选中的那一行 */
  .mi img{width:22px;height:22px;border-radius:5px;object-fit:cover}
  .mi .muse{width:22px;height:22px;border-radius:5px;background:rgba(255,255,255,0.08);color:#e4e4ec;display:grid;place-items:center;font-size:11px;flex:0 0 auto}
  .mempty{padding:9px;font-size:11px;color:var(--dim-2);text-align:center}

  /* 悬浮预览：鼠标移到图片/音频素材上（素材轨卡片、@引用 chip、放大编辑里的条目），
     就在它上方弹一个预览 —— 图片给完整缩略图，音频给原生播放器 */
  .apop{
    position:fixed;left:0;top:0;z-index:330;display:none;
    padding:6px;border-radius:14px;
    background:rgba(26,26,33,.98);
    -webkit-backdrop-filter:blur(24px) saturate(180%);backdrop-filter:blur(24px) saturate(180%);
    border:1px solid rgba(255,255,255,.16);
    box-shadow:0 18px 44px rgba(0,0,0,.72), 0 0 0 1px rgba(0,0,0,.35);
    color-scheme:dark;max-width:calc(100vw - 20px);
  }
  .apop.on{display:block}
  .apop audio{display:block;width:272px;height:32px;background:transparent}
  /* 图片预览：整张图完整可见（不裁切），过大就等比缩到 360 见方 */
  .apop img{
    display:block;width:auto;height:auto;min-width:160px;
    max-width:min(360px, calc(100vw - 26px));max-height:min(360px, 60vh);
    border-radius:9px;background:rgba(255,255,255,.05);
    border:1px solid rgba(255,255,255,.09);box-sizing:content-box;
  }
  .apop .apop-cap{
    max-width:360px;margin:5px 4px 1px;font-size:10.5px;line-height:1.4;
    color:rgba(255,255,255,.58);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  }
  .apop .apop-cap:empty{display:none}
  .apop.is-aud img{display:none}
  .apop.is-img audio{display:none}

  /* 文本预览：只铺正文 + 一条滚动条，不加框不加后缀，尽量干净 */
  .apop .apop-txt{display:none}
  .apop.is-txt .apop-txt{
    display:block; width:302px; max-width:calc(100vw - 32px);
    max-height:min(304px, 54vh); overflow:auto; overscroll-behavior:contain;
    padding:10px 8px 8px 12px; box-sizing:border-box; cursor:pointer;
    color:rgba(241,241,249,.92); font-size:12px; line-height:1.85; letter-spacing:.2px;
    white-space:pre-wrap; word-break:break-word;
  }
  .apop.is-txt .apop-txt::-webkit-scrollbar{width:6px}
  .apop.is-txt .apop-txt::-webkit-scrollbar-track{background:transparent}
  .apop.is-txt .apop-txt::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18); border-radius:3px}
  .apop.is-txt .apop-txt::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.3)}
  .apop.is-txt .apop-txt.empty{color:rgba(255,255,255,.34); font-style:normal}
  .apop.is-txt img, .apop.is-txt audio{display:none}
  .apop.is-txt .apop-cap{display:none}

  .row{display:flex; gap:6px}
  select{
    flex:1; min-width:0; height:28px; background:var(--field); color:#dcdce6;
    border:1px solid var(--line); border-radius:8px; font-family:inherit; font-size:11.5px;
    padding:0 6px; outline:0; cursor:pointer; transition:.15s;
  }
  select:focus{border-color:rgba(255,255,255,0.24)}
  .iconbtn{
    flex:0 0 28px; width:28px; height:28px; border-radius:8px; border:1px solid var(--line);
    background:var(--field); color:var(--dim-2); cursor:pointer; font-size:12px;
    display:grid; place-items:center; transition:.15s; font-family:inherit;
  }
  .iconbtn:hover{color:#fff;border-color:var(--line-2)}
  .iconbtn.on{color:#e4e4ec;border-color:rgba(255,255,255,0.22);background:rgba(255,255,255,0.06)}

  .go{
    height:34px;border:0;border-radius:9px;cursor:pointer;font-family:inherit;
    background:linear-gradient(135deg,#ffffff,#e4e4ec);color:#0b0b0f;
    font-size:12.5px;font-weight:650;letter-spacing:.3px;transition:.16s;
    display:flex;align-items:center;justify-content:center;gap:7px;
    box-shadow:0 6px 18px rgba(255,255,255,0.12);
  }
  .go:hover{filter:brightness(1.08)}
  .go:active{transform:translateY(1px)}
  .go:disabled{opacity:.5;cursor:not-allowed;box-shadow:none}
  .go .sub{font-weight:400;font-size:10.5px;opacity:.82}

  /* 视频节点 */
  .vstage{
    position:relative; background:#08080b; display:grid; place-items:center;
    min-height:210px; overflow:hidden;
  }
  .vstage video{width:100%; height:100%; display:block; object-fit:contain; background:#000}
  .vstage .ph{color:var(--dim-2); font-size:11px}
  .ring-wrap{display:flex; flex-direction:column;align-items:center;gap:9px;padding:26px 0}
  .ring{width:78px;height:78px;transform:rotate(-90deg)}
  .ring circle{fill:none;stroke-width:4;stroke-linecap:round}
  .ring .bgc{stroke:rgba(255,255,255,.07)}
  .ring .fgc{stroke:url(#gr);transition:stroke-dashoffset .5s ease}
  .ringbox{position:relative}
  .ringnum{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:1px;font-size:17px;font-weight:700}
  .ringnum span{font-size:10px;color:var(--dim);font-weight:500;transform:translateY(1px)}
  .vstage .st{font-size:11px;color:var(--dim)}
  .vfail{padding:22px 16px;text-align:center}
  .vfail h4{font-size:12px;color:#ffd2d2;margin-bottom:7px;font-weight:600}
  .vfail pre{
    font-size:10px;color:var(--dim);background:#0c0c10;border:1px solid var(--line);
    border-radius:8px;padding:8px;text-align:left;max-height:96px;overflow:auto;
    white-space:pre-wrap;word-break:break-all;line-height:1.55;
    font-family:inherit;user-select:text;
  }
  .vfoot{display:flex;align-items:center;gap:6px;padding:8px 10px;border-top:1px solid var(--line)}
  .vfoot .meta{flex:1;min-width:0}
  .vfoot .meta b{display:block;font-size:10.5px;color:#c6c6d4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}
  .vfoot .meta span{font-size:9.5px;color:var(--dim-2);font-variant-numeric:tabular-nums}
  .vfoot a,.vfoot button{
    height:24px;padding:0 8px;border-radius:8px;border:1px solid rgba(255,255,255,.13);
    background:rgba(255,255,255,.08);color:#e2e2ec;font-size:10.5px;cursor:pointer;
    font-family:inherit;display:flex;align-items:center;text-decoration:none;transition:.14s;
  }
  .vfoot a:hover,.vfoot button:hover{background:rgba(255,255,255,.11)}
  .badge{
    font-size:9.5px;padding:2px 7px;border-radius:99px;background:rgba(255,255,255,.06);
    color:var(--dim);letter-spacing:.3px;
  }
  .badge.run{color:#e4e4ec;background:rgba(255,255,255,0.06)}
  .badge.ok{color:#9dffcf;background:rgba(61,220,151,.14)}
  .badge.bad{color:#ffb3b3;background:rgba(255,95,95,.14)}

  .toast{
    position:fixed;left:50%;bottom:70px;transform:translate(-50%,10px);z-index:1300;
    background:rgba(26,26,32,.97);border:1px solid var(--line-2);border-radius:10px;
    padding:9px 16px;font-size:12px;color:#e6e6ee;opacity:0;pointer-events:none;transition:.22s;
    box-shadow:0 10px 30px rgba(0,0,0,.5);
  }
  .toast.show{opacity:1;transform:translate(-50%,0)}

  /* ============ 和服务失联时的提示条 ============
     只在 /api/ping 打不通（或请求直接失败）时出现，平时 display:none 不占位。
     目的：把「连不上后端服务，确认一下它还在跑」这种猜谜，变成一句能照做的指示。 */
  .netbar{
    position:fixed; left:50%; top:10px; transform:translateX(-50%);
    z-index:120; display:flex; align-items:center; gap:10px;
    max-width:min(760px, calc(100vw - 24px));
    padding:9px 10px 9px 12px; border-radius:12px;
    background:rgba(38,20,22,.96); border:1px solid rgba(255,120,110,.42);
    box-shadow:0 14px 40px rgba(0,0,0,.5);
    font-size:12px; line-height:1.5; color:#ffd9d4;
    -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
    pointer-events:none;        /* 只挡自己两个按钮，别把顶栏的点击也吃掉 */
  }
  .netbar .nb-btn, .netbar .nb-x{pointer-events:auto}
  .netbar[hidden]{display:none}
  .netbar .nb-ico{
    flex:0 0 auto; width:17px; height:17px; border-radius:50%;
    display:grid; place-items:center; font-size:11px; font-weight:700;
    background:rgba(255,120,110,.22); color:#ffb3aa; border:1px solid rgba(255,120,110,.4);
  }
  .netbar .nb-txt{flex:1; min-width:0}
  .netbar .nb-btn, .netbar .nb-x{
    flex:0 0 auto; height:26px; border-radius:8px; cursor:pointer;
    font-family:inherit; font-size:11.5px; color:#ffd9d4;
    background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.16);
    transition:.15s;
  }
  .netbar .nb-btn{padding:0 11px}
  .netbar .nb-x{width:26px; font-size:14px; line-height:1; padding:0}
  .netbar .nb-btn:hover, .netbar .nb-x:hover{background:rgba(255,255,255,.14)}
  .netbar .nb-btn:disabled{opacity:.5; cursor:default}
  body.light .netbar{
    background:rgba(255,244,242,.97); border-color:rgba(214,88,76,.35);
    color:#7d2b22; box-shadow:0 14px 40px rgba(80,30,24,.16);
  }
  body.light .netbar .nb-ico{background:rgba(214,88,76,.12); color:#b4402f; border-color:rgba(214,88,76,.32)}
  body.light .netbar .nb-btn, body.light .netbar .nb-x{
    color:#7d2b22; background:rgba(20,20,30,.05); border-color:rgba(20,20,30,.14);
  }
  body.light .netbar .nb-btn:hover, body.light .netbar .nb-x:hover{background:rgba(20,20,30,.1)}

  /* 默认是一根安静的灰线；只有「被关联的节点被选中」时才点亮成淡蓝（见 .lgrp.lit） */
  .link-path{fill:none;stroke:rgba(255,255,255,.2);stroke-width:2;transition:stroke .2s, stroke-width .2s}
  .link-path.active{stroke:rgba(126,192,255,.5)}
  .link-path.ok{stroke:rgba(255,255,255,.2)}
  .link-path.bad{stroke:rgba(255,95,95,.4)}
  @keyframes flow{to{stroke-dashoffset:-28}}

  /* ---- 连线：点亮后是「管道 + 一段药液源源不断推进」 ---- */
  .link-hit{
    fill:none; stroke:transparent; stroke-width:22;
    pointer-events:stroke; cursor:pointer;
  }
  /* 药液用四层同心色带叠出来：外圈长而淡、内芯短而亮、最前面一颗液头。
     再给整组套一层小半径模糊，前后两端就变成羽化过渡，不再是生硬的圆头。 */
  .lfw{
    opacity:0; pointer-events:none;
    transition:opacity .24s linear;
    filter:blur(.85px) drop-shadow(0 0 5px rgba(160,205,255,.6));
  }
  .lfw.r{filter:blur(.85px) drop-shadow(0 0 6px rgba(198,155,255,.55)) drop-shadow(0 0 13px rgba(120,190,255,.45))}
  .lf{
    fill:none; stroke-linecap:round; pointer-events:none;
    animation:lfFlow 1.7s linear infinite;
  }
  /* 白药液（选中 / 悬停） */
  .lfw.b .lf1{stroke:#fff; stroke-width:2.1; stroke-dasharray:46 54; opacity:.22}
  .lfw.b .lf2{stroke:#fff; stroke-width:2.5; stroke-dasharray:33 67; opacity:.55; animation-delay:-.095s}
  .lfw.b .lf3{stroke:#fff; stroke-width:2.3; stroke-dasharray:20 80; opacity:1;    animation-delay:-.185s}
  .lfw.b .lf4{stroke:#fff; stroke-width:3;   stroke-dasharray:5 95;  opacity:1;    animation-delay:-.663s}
  /* 炫彩药液（正在跑视频） */
  .lfw.r .lf1{stroke:url(#lrb); stroke-width:2.2; stroke-dasharray:46 54; opacity:.26}
  .lfw.r .lf2{stroke:url(#lrb); stroke-width:2.6; stroke-dasharray:33 67; opacity:.6; animation-delay:-.095s}
  .lfw.r .lf3{stroke:url(#lrb); stroke-width:2.4; stroke-dasharray:20 80; opacity:1;  animation-delay:-.185s}
  .lfw.r .lf4{stroke:#fff;      stroke-width:3;   stroke-dasharray:5 95;  opacity:.92; animation-delay:-.663s}
  @keyframes lfFlow{from{stroke-dashoffset:0}to{stroke-dashoffset:-100}}

  /* 悬停某条线 */
  .lgrp.on > .lfw.b{opacity:.95}
  .lgrp.on > .link-path{stroke:rgba(126,192,255,.88); stroke-width:2.2}
  /* 选中了节点：它关联的每一根线都亮起来 */
  .lgrp.lit > .lfw.b{opacity:1}
  .lgrp.lit > .link-path{stroke:rgba(126,192,255,.9); stroke-width:2.4}
  /* 跑视频：白色药液换成炫彩药液；管壁的彩也跟着过渡液一起推进，不硬切 */
  .lgrp.run > .lfw.b{opacity:0}
  .lgrp.run > .lfw.r{opacity:1}
  .lgrp.run > .lfw .lf{animation-duration:1.15s}
  .link-tube{
    fill:none; stroke:url(#lrb); stroke-width:2.4; stroke-opacity:.6;
    opacity:0; pointer-events:none;
  }
  .lgrp.run > .link-tube{opacity:1}

  /* ---- 换液过渡：一股新的药液从源头推进，把旧的整条挤出去 ---- */
  .sweep{
    fill:none; stroke:#fff; stroke-width:3; stroke-linecap:round;
    stroke-dasharray:0 100; opacity:0; pointer-events:none;
    filter:blur(.6px) drop-shadow(0 0 4px rgba(255,255,255,.45)) drop-shadow(0 0 12px rgba(190,150,255,.6));
  }
  .lgrp.swap > .sweep{animation:sweepFill 1.16s cubic-bezier(.45,.03,.35,1) var(--sd,0s) both}
  .lgrp.swap.to-run > .sweep{
    stroke:url(#lrs);
    filter:blur(.6px) drop-shadow(0 0 4px rgba(255,255,255,.4)) drop-shadow(0 0 12px rgba(196,146,255,.7));
  }
  .lgrp.swap.to-idle > .sweep{stroke:url(#lfb)}
  /* 管壁的炫彩也按同一节奏沿路径铺过去 / 退回去 */
  .lgrp.swap.to-run > .link-tube{opacity:1; animation:tubeFill 1.16s cubic-bezier(.45,.03,.35,1) var(--sd,0s) both}
  .lgrp.swap.to-idle > .link-tube{opacity:1; animation:tubeDrain 1.16s cubic-bezier(.45,.03,.35,1) var(--sd,0s) both}
  @keyframes tubeFill{from{stroke-dasharray:0 100}to{stroke-dasharray:100 0}}
  @keyframes tubeDrain{from{stroke-dasharray:100 0}to{stroke-dasharray:0 100}}
  /* 旧药液一直留到过渡液快推完才淡掉，中间由过渡液顶住，不出现硬切 */
  .lgrp.swap.to-run > .lfw.b{opacity:1; animation:fadeOut .8s linear calc(var(--sd,0s) + .1s) both}
  /* 新药液的「淡入」只给开头，终态交还给当前状态（点亮才亮、没点亮就该消失）。
     这样过渡演完摘掉 swap 类时，线会自然回到灰线，而不是把一坨药液钉在上面。 */
  .lgrp.swap.to-run > .lfw.r{animation:fadeUp .55s linear calc(var(--sd,0s) + .58s) backwards}
  .lgrp.swap.to-idle > .lfw.r{animation:fadeOut .8s linear calc(var(--sd,0s) + .1s) both}
  .lgrp.swap.to-idle > .lfw.b{animation:fadeUp .55s linear calc(var(--sd,0s) + .58s) backwards}
  @keyframes fadeUp{from{opacity:0}}
  @keyframes sweepFill{
    0%  {stroke-dasharray:0 100; opacity:0}
    10% {opacity:1}
    74% {opacity:1}
    100%{stroke-dasharray:100 0; opacity:0}
  }
  @keyframes fadeOut{from{opacity:1}to{opacity:0}}

  /* 剪刀：跟着鼠标走，选中连线后可点 */
  #scissor{
    position:absolute; left:0; top:0; width:30px; height:30px; z-index:9;
    display:none; place-items:center; pointer-events:none;
    transform:translate(-50%,-50%);
    color:#fff;
    filter:drop-shadow(0 2px 6px rgba(0,0,0,.7));
    transition:width .12s, height .12s, background .12s;
  }
  #scissor::before{
    content:""; position:absolute; inset:4px; border-radius:50%;
    background:rgba(14,14,19,.62);
    box-shadow:0 0 0 1px rgba(255,255,255,.14) inset;
  }
  #scissor svg{position:relative}
  #scissor.on{display:grid}
  #scissor.armed{
    pointer-events:auto; cursor:pointer; width:36px; height:36px; border-radius:50%;
    background:rgba(20,20,26,.94); box-shadow:0 0 0 1px rgba(255,255,255,.3), 0 6px 18px rgba(0,0,0,.6);
  }
  #scissor.armed::before{display:none}
  #scissor.armed:hover{background:#fff; color:#12121a; box-shadow:0 0 0 1px transparent, 0 6px 22px rgba(0,0,0,.65)}
  #scissor svg{display:block}

  /* ---------------- 站内使用手册 ---------------- */
  .big-panel.gd-panel{width:min(1120px,96vw); height:min(880px,92vh)}
  .gd-wrap{flex:1; min-height:0; display:flex}
  .gd-nav{
    width:198px; flex:none; overflow:auto; padding:14px 10px 20px;
    border-right:1px solid var(--line);
  }
  .gd-nav-t{font-size:11px; color:var(--dim-2); padding:0 8px 9px; letter-spacing:.02em}
  .gd-nav a{
    display:block; padding:6px 9px; border-radius:8px; font-size:12px; line-height:1.5;
    color:var(--dim); text-decoration:none; white-space:nowrap; overflow:hidden;
    text-overflow:ellipsis;
  }
  .gd-nav a:hover{background:rgba(255,255,255,.08); color:#fff}
  .gd-body{
    flex:1; min-width:0; overflow:auto; padding:26px 34px 64px;
    font-size:14px; line-height:1.86; color:var(--text); scroll-behavior:smooth;
  }
  /* 手册两条滚动条（目录 / 正文）用画布面板同一套细胶囊：透明轨道、圆角 thumb、悬停变亮。
     Chromium 里一旦写 scrollbar-width，下面 ::-webkit-scrollbar 会整体失效，所以降级放 @supports。 */
  .gd-body::-webkit-scrollbar, .gd-nav::-webkit-scrollbar{width:10px; height:10px}
  .gd-body::-webkit-scrollbar-track, .gd-nav::-webkit-scrollbar-track{
    background:transparent; margin:12px 0;
  }
  .gd-body::-webkit-scrollbar-thumb, .gd-nav::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.21); border-radius:99px;
    border:3px solid transparent; background-clip:padding-box;
  }
  .gd-body::-webkit-scrollbar-thumb:hover, .gd-nav::-webkit-scrollbar-thumb:hover{
    background:rgba(255,255,255,.32); background-clip:padding-box;
  }
  .gd-body::-webkit-scrollbar-thumb:active, .gd-nav::-webkit-scrollbar-thumb:active{
    background:rgba(255,255,255,.44); background-clip:padding-box;
  }
  .gd-body::-webkit-scrollbar-corner, .gd-nav::-webkit-scrollbar-corner{background:transparent}
  /* 表格横向滚的那条同样收细 */
  .gd-tw::-webkit-scrollbar{height:8px}
  .gd-tw::-webkit-scrollbar-track{background:transparent; margin:0 8px}
  .gd-tw::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.16); border-radius:99px;
    border:2px solid transparent; background-clip:padding-box;
  }
  .gd-tw::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.3); background-clip:padding-box}
  body.light .gd-body::-webkit-scrollbar-thumb,
  body.light .gd-nav::-webkit-scrollbar-thumb{
    background:rgba(18,18,30,.26); background-clip:padding-box;
  }
  body.light .gd-body::-webkit-scrollbar-thumb:hover,
  body.light .gd-nav::-webkit-scrollbar-thumb:hover{
    background:rgba(18,18,30,.36); background-clip:padding-box;
  }
  body.light .gd-body::-webkit-scrollbar-thumb:active,
  body.light .gd-nav::-webkit-scrollbar-thumb:active{
    background:rgba(18,18,30,.48); background-clip:padding-box;
  }
  body.light .gd-tw::-webkit-scrollbar-thumb{background:rgba(18,18,30,.18); background-clip:padding-box}
  @supports not (selector(::-webkit-scrollbar)){
    .gd-body, .gd-nav{scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.22) transparent}
    body.light .gd-body, body.light .gd-nav{scrollbar-color:rgba(18,18,30,.28) transparent}
  }
  .gd-body h2{
    font-size:19px; font-weight:650; letter-spacing:.01em; margin:36px 0 12px;
    padding-top:16px; border-top:1px solid var(--line);
  }
  .gd-body h2:first-child{margin-top:0; padding-top:0; border-top:0}
  .gd-body h3{font-size:15px; font-weight:600; margin:24px 0 8px; color:var(--text)}
  .gd-body h4{font-size:14px; font-weight:650; margin:20px 0 6px; color:var(--text); opacity:.92}
  .gd-body p{margin:9px 0}
  .gd-body strong{font-weight:650; color:var(--text)}
  .gd-body code{
    font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px;
    padding:1.5px 5px; border-radius:5px; background:rgba(255,255,255,.08);
    color:#e6e6f0; white-space:nowrap;
  }
  .gd-hr{border:0; border-top:1px solid var(--line); margin:30px 0}
  .gd-list{margin:8px 0 12px; padding-left:22px}
  .gd-list li{margin:4px 0}
  .gd-quote{
    margin:14px 0; padding:10px 14px; border-left:2px solid rgba(255,255,255,.22);
    background:rgba(255,255,255,.04); border-radius:0 9px 9px 0;
    color:var(--dim); font-size:12.5px;
  }
  .gd-tw{overflow-x:auto; margin:14px 0}
  .gd-body table{border-collapse:collapse; width:100%; font-size:12.5px}
  .gd-body th, .gd-body td{
    border:1px solid var(--line); padding:7px 11px; text-align:left; vertical-align:top;
    line-height:1.7;
  }
  .gd-body th{background:rgba(255,255,255,.055); font-weight:600; white-space:nowrap}
  .gd-fig{margin:16px 0 22px}
  /* 横图撑满正文宽；竖图（节点特写）按高度收住，不然一张图占掉一屏半 */
  .gd-fig img{
    display:block; width:auto; height:auto; max-width:100%;
    max-height:min(72vh,720px); margin:0 auto;
    border-radius:12px; border:1px solid var(--line); background:#0c0c10;
  }
  /* 正文限宽 900：一行 40 来字读着舒服，表格 / 图也还放得开 */
  .gd-body > h2, .gd-body > h3, .gd-body > h4, .gd-body > p,
  .gd-body > ul, .gd-body > ol, .gd-body > figure,
  .gd-body > .gd-tw, .gd-body > .gd-quote{max-width:900px; margin-left:auto; margin-right:auto}
  .gd-fig figcaption{
    margin-top:7px; font-size:11.5px; color:var(--dim-2); text-align:center;
  }
  body.light .gd-nav a:hover{background:rgba(20,20,30,.07); color:#15151d}
  body.light .gd-body code{background:rgba(20,20,30,.07); color:#25252f}
  body.light .gd-quote{background:rgba(20,20,30,.035); border-left-color:rgba(20,20,30,.2)}
  body.light .gd-body th{background:rgba(20,20,30,.05)}
  @media (max-width:820px){
    .gd-nav{display:none}
    .gd-body{padding:20px 16px 50px}
  }

  /* ---------------- 弹层 ---------------- */
  /* hidden 属性就该是「藏起来」。display:flex / grid 的组件会盖掉默认的
     display:none（.ctl-ico、.tbtn、.nbadge 都踩过这个坑），这里统一按 HTML 语义兜住 */
  [hidden]{display:none !important}
  .modal{
    position:fixed;inset:0;z-index:100;display:none;align-items:center;justify-content:center;
    background:rgba(6,6,9,.74);backdrop-filter:blur(7px);padding:26px;
  }
  .modal.on{display:flex}
  .big-panel{
    width:min(1080px,96vw);height:min(760px,92vh);display:flex;flex-direction:column;
    background:var(--node);border:1px solid var(--line-2);border-radius:16px;
    box-shadow:0 30px 80px rgba(0,0,0,.65);overflow:hidden;
  }
  .big-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line)}
  .big-title{font-size:13px;font-weight:600;color:#ececf4}
  .big-sub{font-size:11px;color:var(--dim-2)}
  .big-head .grow{flex:1}
  .big-body{flex:1;min-height:0;padding:16px;display:flex;flex-direction:column}
  .big-body .ptext-wrap{flex:1;min-height:0;display:flex;flex-direction:column}
  .big-body .ptext{
    flex:1;min-height:0;max-height:none;font-size:14px;line-height:1.9;padding:18px 34px 18px 20px;
    border-radius:12px;
  }
  .big-body .expand-btn{display:none}
  /* 文本节点的放大编辑窗：比提示词那个小一圈，只有一个大输入区 */
  #textBig .big-panel{height:min(620px,86vh)}
  #textBigArea{
    flex:1; min-height:0; width:100%; box-sizing:border-box; resize:none;
    background:var(--field); border:1px solid var(--line-2); border-radius:12px;
    padding:18px 20px; color:var(--text);
    font-family:inherit; font-size:14px; line-height:1.95; letter-spacing:.2px; outline:none;
    transition:border-color .15s, box-shadow .15s;
  }
  #textBigArea:focus{border-color:rgba(255,255,255,.3); box-shadow:0 0 0 3px rgba(255,255,255,.06)}
  #textBigArea::placeholder{color:var(--dim-2)}
  body.light #textBigArea:focus{border-color:rgba(20,20,30,.4); box-shadow:0 0 0 3px rgba(20,20,30,.07)}
  /* 底部：左边素材条（可横向滚动），右边「价格 + 提交」——和节点卡片底栏同一套手感 */
  .big-foot{
    border-top:1px solid var(--line);padding:10px 16px;min-height:56px;
    display:flex; align-items:center; gap:14px;
  }
  .big-assets{display:flex;gap:8px;overflow-x:auto;align-items:center;padding-bottom:2px;flex:1 1 auto;min-width:0;background:transparent}
  /* 面板里的金额比卡片上稍亮一点：大面积留白下同一种灰会显得发飘 */
  .big-send .cost{font-size:12px; color:rgba(232,232,242,.8)}
  body.light .big-send .cost{color:rgba(28,28,40,.72)}
  /* 这条素材条只放 chips：容器本身不能有底色/边框，否则 chips 排完后的空白处
     会露出一块空矩形（用户反馈的「多出来的矩形」）。横向滚动条也收掉，
     靠滚轮 / 触控板横滑，底栏保持干净一条。 */
  .big-assets::-webkit-scrollbar{height:0}
  .big-assets::-webkit-scrollbar-thumb{background:transparent}
  .ba{
    flex:0 0 auto;height:34px;padding:0 10px 0 4px;border-radius:9px;cursor:pointer;
    border:1px solid var(--line-2);background:rgba(255,255,255,.04);color:#d3d3e0;
    display:flex;align-items:center;gap:7px;font-size:11px;font-family:inherit;transition:.15s;
  }
  .ba:hover{border-color:rgba(255,255,255,0.24);background:rgba(255,255,255,0.06);color:#e4e4ec}
  .ba.up{color:var(--dim-2);border-style:dashed;gap:5px;padding:0 11px}
  .ba.up:hover{color:#e4e4ec;border-color:var(--accent);background:rgba(255,255,255,.06)}
  body.light .ba.up{color:#5f6070;border-color:rgba(20,20,30,.22)}
  body.light .ba.up:hover{color:#22222b;border-color:var(--accent);background:rgba(20,20,30,.05)}
  .ba img{width:26px;height:26px;border-radius:6px;object-fit:cover;display:block}
  .ba .muse{width:26px;height:26px;border-radius:6px;background:rgba(255,255,255,0.08);color:#e4e4ec;display:grid;place-items:center;font-size:13px}
  .ba>span{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ba-empty{font-size:11px;color:var(--dim-2)}

  .key-panel{
    width:min(540px,94vw);max-height:min(92vh,720px);display:flex;flex-direction:column;
    background:var(--node);border:1px solid var(--line-2);border-radius:16px;
    box-shadow:0 30px 80px rgba(0,0,0,.65);overflow:hidden;
  }
  .kp-head{display:flex;align-items:center;padding:13px 16px;border-bottom:1px solid var(--line)}
  .kp-head .grow{flex:1}
  .kp-title{font-size:13px;font-weight:600;color:#ececf4}
  .kp-x{
    width:24px;height:24px;border:0;border-radius:7px;background:transparent;color:var(--dim-2);
    cursor:pointer;font-size:15px;line-height:1;display:grid;place-items:center;font-family:inherit;
  }
  .kp-x:hover{background:rgba(255,95,95,.16);color:#ffb3b3}
  .kp-body{padding:16px;display:flex;flex-direction:column;gap:10px;overflow:auto}
  .kp-cur{font-size:11.5px;color:var(--dim)}
  .kp-cur code{
    font-family:inherit;color:#e4e4ec;
    background:rgba(255,255,255,0.05);border-radius:5px;padding:1px 6px;font-size:11px;
  }
  .kp-body input[type=password],.kp-body input[type=text]{
    width:100%;height:36px;background:var(--field);border:1px solid var(--line);
    border-radius:9px;color:var(--text);font-family:inherit;
    font-size:12px;padding:0 11px;outline:0;transition:.15s;
  }
  .kp-body input:focus{border-color:rgba(255,255,255,0.26);box-shadow:0 0 0 3px rgba(255,255,255,0.05)}
  .kp-list{display:flex;flex-direction:column;gap:13px}
  .kp-row{display:flex;flex-direction:column;gap:6px}
  .kp-row .hd{display:flex;align-items:center;gap:7px;font-size:11.5px;flex-wrap:wrap;row-gap:3px}
  .kp-row .hd .nm{color:#e6e6ef;font-weight:600;letter-spacing:.2px;min-width:0}
  /* 名字后面那截小字 = 这条 Key 在上游中转站里绑的分组，跟输入框里的 Key 一起看 */
  .kp-row .hd .ktag{
    font-size:10px;font-weight:400;color:rgba(236,236,245,.52);letter-spacing:.2px;
    white-space:nowrap;flex:0 0 auto;
  }
  body.light .kp-row .hd .ktag{color:rgba(28,28,40,.6)}
  .kp-row .hd .st{width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.2);flex:0 0 auto}
  .kp-row .hd .st.on{background:#4ade80;box-shadow:0 0 6px rgba(74,222,128,.55)}
  .kp-row .hd .st.off{background:rgba(255,255,255,.18)}
  .kp-row .hd .st.inherited{background:rgba(240,190,90,.9)}
  .kp-row .hd .cur{
    margin-left:auto;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
    font-size:10.5px;color:var(--dim-2);
  }
  .kp-row .hd .cur.ok{color:#7ee2a8}
  .kp-row .hd .cur.warn{color:#f2c063}
  .kp-row .hd .cur.bad{color:#ff9d9d}
  .kp-show{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--dim);cursor:pointer}
  .kp-show input{accent-color:#ffffff}
  .kp-note{font-size:10.5px;color:var(--dim-2);line-height:1.6}
  /* 诊断结果：正常时是普通说明色，只有真出问题才用红 —— 别让「✓ 网络正常」看着像报错 */
  .kp-note.diag{white-space:pre-line; color:#c6cedd; max-height:132px; overflow:auto}
  .kp-note.diag.bad{color:#ffb3ad}
  body.light .kp-note.diag{color:#4a4a58}
  body.light .kp-note.diag.bad{color:#b3362c}
  .kp-foot{display:flex;align-items:center;gap:8px;padding:12px 16px;border-top:1px solid var(--line)}
  .kp-foot .grow{flex:1}

  /* ============================================================
     参数栏：时长滑杆 + 模型 / 比例·分辨率 / 生成
     ============================================================ */
  .toolbar{
    position:relative; margin-top:2px; padding-top:10px;
    border-top:1px solid rgba(255,255,255,.08);
    display:flex; flex-direction:column; gap:9px;
  }
  .dur-line{display:flex; align-items:center; gap:8px}
  .dur-auto{
    flex:0 0 auto; width:22px; height:22px; border-radius:7px;
    border:1px solid rgba(255,255,255,.13); background:rgba(255,255,255,.05);
    color:var(--dim-2); cursor:pointer; font-size:12px; line-height:1;
    display:grid; place-items:center; font-family:inherit; transition:.16s;
  }
  .dur-auto:hover{color:#fff; background:rgba(255,255,255,.12)}
  .dur-auto.on{color:#0b0b0f; background:rgba(255,255,255,.92); border-color:transparent; font-weight:700}

  .dur-range{
    flex:1; min-width:0; height:20px; -webkit-appearance:none; appearance:none;
    background:transparent; outline:0; cursor:pointer;
  }
  .dur-range::-webkit-slider-runnable-track{
    height:4px; border-radius:99px;
    background:linear-gradient(90deg,
      rgba(255,255,255,.92) 0%, rgba(255,255,255,.92) var(--p,20%),
      rgba(255,255,255,.14) var(--p,20%), rgba(255,255,255,.14) 100%);
  }
  .dur-range::-webkit-slider-thumb{
    -webkit-appearance:none; width:15px; height:15px; border-radius:50%;
    background:#fff; margin-top:-5.5px;
    box-shadow:0 1px 4px rgba(0,0,0,.45), 0 0 0 .5px rgba(0,0,0,.06);
    transition:transform .12s;
  }
  .dur-range:active::-webkit-slider-thumb{transform:scale(1.12)}
  .dur-range:disabled{opacity:.32; cursor:default}
  .dur-fix{flex:1; min-width:0; height:20px; display:flex; align-items:center}
  .dur-fix i{
    display:block; width:100%; height:4px; border-radius:99px;
    background:linear-gradient(90deg, rgba(255,255,255,.92), rgba(255,255,255,.5));
  }
  .dur-val{
    flex:0 0 auto; min-width:32px; text-align:right; font-size:11px;
    color:var(--dim); font-variant-numeric:tabular-nums;
  }

  .bar-line{display:flex; align-items:center; gap:6px}
  .model-sel{
    flex:0 0 auto; width:auto; max-width:120px; height:30px; padding:0 6px;
    font-size:11px; border-radius:9px;
    background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12);
  }
  .pill{
    flex:1; min-width:0; height:30px; padding:0 9px; border-radius:9px;
    background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12);
    color:var(--dim); font-size:11px; font-family:inherit; cursor:pointer;
    display:flex; align-items:center; justify-content:center; gap:5px;
    transition:.16s; white-space:nowrap; overflow:hidden;
  }
  .pill:hover{background:rgba(255,255,255,.12); color:#fff}
  .pill.on{background:rgba(255,255,255,.16); color:#fff; border-color:rgba(255,255,255,.22)}
  .send{
    flex:0 0 auto; width:32px; height:32px; border-radius:50%; border:0;
    background:#fff; color:#0b0b0f; font-size:15px; font-weight:700; line-height:1;
    cursor:pointer; display:grid; place-items:center; font-family:inherit;
    box-shadow:0 2px 10px rgba(0,0,0,.4), 0 0 0 .5px rgba(0,0,0,.06);
    transition:.16s;
  }
  .send:hover{background:#dceaff; transform:translateY(-1px)}
  .send:active{transform:translateY(0) scale(.96)}
  .send:disabled{opacity:.45; cursor:not-allowed; transform:none}
  /* 金额 + 发送：始终绑在一起靠右，窄卡片上整组换行 */
  .send-group{display:flex; align-items:center; gap:7px; margin-left:auto; flex:0 0 auto}
  /* 单次预估花费：贴在发送按钮左边 */
  .cost{
    flex:0 0 auto; padding:0 1px;
    font-size:11.5px; color:rgba(232,232,242,.66); letter-spacing:.2px;
    font-variant-numeric:tabular-nums; white-space:nowrap; cursor:pointer;
  }
  .cost:hover{color:rgba(232,232,242,.95)}
  .cost.unknown{color:rgba(232,232,242,.3)}
  body.light .cost{color:rgba(28,28,40,.6)}
  body.light .cost.unknown{color:rgba(28,28,40,.28)}

  /* 参数弹层 */
  .pop{
    position:absolute; left:0; right:0; bottom:calc(100% + 9px); z-index:30;
    display:none; flex-direction:column; gap:11px; padding:13px;
    border-radius:16px;
    background:rgba(32,32,39,.97);
    -webkit-backdrop-filter:blur(40px) saturate(180%);
    backdrop-filter:blur(40px) saturate(180%);
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 20px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.1);
  }
  .pop.on{display:flex}
  .pop-label{font-size:10px; color:var(--dim-2); letter-spacing:.5px; margin-bottom:6px}
  .ratio-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:5px}
  .rg{
    height:50px; border-radius:11px; cursor:pointer; font-family:inherit;
    border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04);
    color:var(--dim); display:flex; flex-direction:column; align-items:center;
    justify-content:center; gap:5px; font-size:9.5px; transition:.15s;
  }
  .rg i{display:block; border:1.5px solid currentColor; border-radius:2px; opacity:.85}
  .rg:hover{background:rgba(255,255,255,.09); color:#e8e8f0}
  .rg.on{border-color:rgba(255,255,255,.42); background:rgba(255,255,255,.15); color:#fff}
  .pillseg{
    display:flex; gap:3px; padding:3px; border-radius:11px;
    background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.1);
  }
  .pillseg button{
    flex:1; height:27px; border:0; border-radius:8px; background:transparent;
    color:var(--dim); font-size:11px; cursor:pointer; font-family:inherit; transition:.15s;
  }
  .pillseg button:hover{color:#fff}
  .pillseg button.on{background:rgba(255,255,255,.9); color:#0b0b0f; font-weight:600}

  /* ============================================================
     苹果风毛玻璃皮肤
     ============================================================ */
  :root{
    --bg:#08080b;
    --node:rgba(255,255,255,.055);
    --node-2:rgba(255,255,255,.1);
    --field:rgba(255,255,255,.05);
    --line:rgba(255,255,255,.09);
    --line-2:rgba(255,255,255,.16);
    --stroke:rgba(255,255,255,.11);
    --stroke-2:rgba(255,255,255,.18);
    --text:#f5f5f7;
    --dim:rgba(235,235,245,.62);
    --dim-2:rgba(235,235,245,.34);
    --accent:#ffffff;
    --accent-2:#d8d8e2;
  }
  body::before{
    background:
      radial-gradient(860px 580px at 12% -8%, rgba(255,255,255,.12), transparent 62%),
      radial-gradient(780px 540px at 88% 2%, rgba(255,255,255,.10), transparent 60%),
      radial-gradient(760px 640px at 62% 104%, rgba(255,90,150,.13), transparent 62%),
      radial-gradient(520px 420px at 46% 42%, rgba(120,255,220,.06), transparent 66%);
  }
  #board{background-color:rgba(8,8,11,.5)}
  #board::before{
    background:
      radial-gradient(900px 560px at 16% -6%, rgba(255,255,255,.07), transparent 64%),
      radial-gradient(760px 500px at 86% 8%, rgba(255,255,255,0.05), transparent 60%);
  }

  /* 卡片 */
  .node{
    background:linear-gradient(168deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.038) 48%, rgba(255,255,255,.065) 100%);
    -webkit-backdrop-filter:blur(30px) saturate(180%);
    backdrop-filter:blur(30px) saturate(180%);
    border:1px solid rgba(255,255,255,.13);
    border-radius:20px;
    box-shadow:0 20px 56px rgba(0,0,0,.42),
               inset 0 1px 0 rgba(255,255,255,.1),
               inset 0 -1px 0 rgba(255,255,255,.03);
  }
  /* 生成节点不能裁剪：右侧那颗连线加号是挂在卡片外面的，
     overflow:hidden 会把它切掉一半。画面本身由 .vstage 自己 overflow:hidden 兜住。 */
  .node.video{background:rgba(255,255,255,.05); border-radius:20px; overflow:visible}
  .node.sel{
    border-color:rgba(255,255,255,0.34);
    box-shadow:0 0 0 3px rgba(255,255,255,.09), 0 22px 60px rgba(0,0,0,.5);
  }
  .node-head{
    border-bottom:1px solid rgba(255,255,255,.07);
    border-radius:20px 20px 0 0;
    background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,0));
  }
  .node-head .idx{
    background:rgba(255,255,255,.14); color:#fff; border-radius:6px;
  }

  /* 顶栏 / 悬浮控件 */
  .bar{
    background:rgba(24,24,30,.5);
    -webkit-backdrop-filter:blur(34px) saturate(180%);
    backdrop-filter:blur(34px) saturate(180%);
    border:1px solid rgba(255,255,255,.11);
    border-radius:18px;
    box-shadow:0 12px 36px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.09);
  }
  /* 顶栏只留上/左/右三边的细高光，底下那条边线去掉：
     玻璃底本来就压着一层影子，再加一条线看起来像「第二层边框」，和画布割了一刀 */
  .bar{border-bottom-color:transparent}
  .zoomer,.hint{
    background:rgba(24,24,30,.5);
    -webkit-backdrop-filter:blur(30px) saturate(180%);
    backdrop-filter:blur(30px) saturate(180%);
    border:1px solid rgba(255,255,255,.11);
    border-radius:16px;
    box-shadow:0 10px 30px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.08);
  }
  .chip{background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.11)}
  button.chip:hover{background:rgba(255,255,255,.13); border-color:rgba(255,255,255,.2); color:#fff}
  .tbtn{
    background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.12);
    border-radius:10px; transition:.16s;
  }
  .tbtn:hover{background:rgba(255,255,255,.16)}
  .tbtn.primary{
    background:linear-gradient(135deg,#ffffff,#e2e2ea); border-color:transparent;
    box-shadow:0 6px 18px rgba(255,255,255,.20);
  }
  /* 词标不再有圆底 / 描边；首页顶栏与画布顶栏同高，词标也跟着同高 */
  .hbar .mark{height:21px}

  /* 分段控件：iOS segmented */
  .modes{
    background:rgba(255,255,255,.055); border:1px solid rgba(255,255,255,.08);
    border-radius:11px; padding:3px;
  }
  .modes button{border-radius:8px; color:var(--dim)}
  .modes button:hover{color:#fff}
  .modes button.on{
    background:rgba(255,255,255,.92); color:#0b0b0f; font-weight:600;
    box-shadow:0 1px 4px rgba(0,0,0,.32);
  }

  /* 输入 / 下拉 / 素材卡
     注意：.big-assets 不在这条里 —— 它是一条「横向滚动条」容器，
     给它铺半透明底会在 chips 排完之后露出来一块空矩形（像多出来的输入框）。 */
  .ptext,select,.acard,.mlist{
    background:rgba(255,255,255,.05); border-color:rgba(255,255,255,.1);
  }
  .ptext:focus{border-color:rgba(255,255,255,.42); box-shadow:0 0 0 3px rgba(255,255,255,.08)}
  .acard:hover{border-color:rgba(255,255,255,.42); background:rgba(255,255,255,0.05)}
  .acard.aud{border-color:rgba(255,255,255,0.16); background:rgba(255,255,255,.06)}
  .acard .muse{color:#e4e4ec}
  .expand-btn{background:rgba(255,255,255,.07); color:var(--dim)}
  .expand-btn:hover{background:rgba(255,255,255,.16); border-color:rgba(255,255,255,0.2); color:#fff}

  .mention{
    background:rgba(255,255,255,.12); color:#e4e4ec; border-color:rgba(255,255,255,0.18);
  }
  .mi:hover{background:rgba(255,255,255,0.08)}
  .mi .muse{background:rgba(255,255,255,.10); color:#e4e4ec}
  .ba .muse{background:rgba(255,255,255,.10); color:#e4e4ec}
  .ba:hover{border-color:rgba(255,255,255,.34); background:rgba(255,255,255,0.06)}
  .go{background:linear-gradient(135deg,#ffffff,#e2e2ea); box-shadow:0 6px 18px rgba(255,255,255,0.14)}

  /* 弹层 */
  .big-panel,.key-panel{
    background:rgba(28,28,34,.72);
    -webkit-backdrop-filter:blur(46px) saturate(180%);
    backdrop-filter:blur(46px) saturate(180%);
    border:1px solid rgba(255,255,255,.14);
    box-shadow:0 30px 90px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.1);
  }
  .modal{background:rgba(5,5,8,.62)}
  .kp-body input:focus{border-color:rgba(255,255,255,.42); box-shadow:0 0 0 3px rgba(255,255,255,.08)}
  .kp-show input{accent-color:#ffffff}
  .kp-cur code{background:rgba(255,255,255,.08); color:#e4e4ec}

  /* 连线 */
  .link-path{stroke:rgba(255,255,255,.18)}
  .link-path.active{stroke:rgba(126,192,255,.5)}
  .link-path.ok{stroke:rgba(255,255,255,.18)}

  /* 拖拽对齐参考线（吸附命中时出现；z-index 低于 #world，永远压在节点下面） */
  #guides{position:absolute; inset:0; pointer-events:none; z-index:1; display:none}
  #guides.on{display:block}
  #guides i{position:absolute; display:none}
  /* 虚线：用 repeating-linear-gradient 画 6px 实 / 6px 空 */
  #guides .gx{
    top:0; bottom:0; width:1px;
    background-image:repeating-linear-gradient(to bottom,#4b8cff 0,#4b8cff 6px,transparent 6px,transparent 12px);
  }
  #guides .gy{
    left:0; right:0; height:1px;
    background-image:repeating-linear-gradient(to right,#4b8cff 0,#4b8cff 6px,transparent 6px,transparent 12px);
  }
  /* 中线对齐：虚线更密，和"贴边对齐"一眼能区分开 */
  #guides .gx.mid{
    background-image:repeating-linear-gradient(to bottom,#4b8cff 0,#4b8cff 3px,transparent 3px,transparent 7px);
  }
  #guides .gy.mid{
    background-image:repeating-linear-gradient(to right,#4b8cff 0,#4b8cff 3px,transparent 3px,transparent 7px);
  }

  /* 框选（marquee）：按住空白拖出来的蓝色选框 */
  #marquee{
    position:absolute; left:0; top:0; width:0; height:0; display:none;
    border:1px solid rgba(86,150,255,.95);
    border-radius:2px;
    background:rgba(86,150,255,.14);
    box-shadow:0 0 0 1px rgba(86,150,255,.16) inset;
    pointer-events:none; z-index:3;
  }
  #marquee.on{display:block}
  body.light #marquee{
    border-color:rgba(40,110,235,.9);
    background:rgba(60,130,255,.12);
  }
  /* 框选时框到的节点给个轻量的高亮，松手才正式选中 */
  .node.marq, .pfloat.marq{outline:1.5px solid rgba(86,150,255,.85); outline-offset:2px}
  body.light .node.marq, body.light .pfloat.marq{outline-color:rgba(40,110,235,.85)}

  
  /* 参数平铺控件 */
  .bar-line{flex-wrap:wrap; gap:5px; row-gap:6px}
  .ctl{
    flex:0 0 auto; height:30px; max-width:112px; padding:0 5px; border-radius:9px;
    background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12);
    color:#e2e2ec; font-size:11px; font-family:inherit; cursor:pointer; outline:0;
    transition:.16s;
  }
  .ctl:hover{background:rgba(255,255,255,.13); border-color:rgba(255,255,255,.2)}
  .ctl:focus{border-color:rgba(255,255,255,.42)}
  /* 下拉式参数按钮：原生 select 的弹层既不能做毛玻璃，也没法和节点 UI 对齐 */
  .ctl-sel{
    position:relative; display:flex; align-items:center; justify-content:center;
    /* 左右留一样宽：右边那 16px 是箭头的地盘，左边对称留白 —— 文字才落在按钮正中，
       而不是被箭头挤得偏左 */
    padding:0 16px; white-space:nowrap; text-align:center;
    overflow:hidden;               /* 模型名太长时收在按钮里省略，别爬到旁边的控件上 */
  }
  .ctl-sel .ctl-t{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis;
    text-align:center; letter-spacing:.1px}
  .ctl-sel::after{
    content:""; position:absolute; right:7px; top:50%; width:5px; height:5px;
    margin-top:-4px; border-right:1.3px solid currentColor; border-bottom:1.3px solid currentColor;
    transform:rotate(45deg); opacity:.55;
  }
  .ctl-sel.on{background:rgba(255,255,255,.16); border-color:rgba(255,255,255,.28); color:#fff}
  .ctl-sel.model{max-width:132px; min-width:96px}
  .ctl-sel.ratio{min-width:56px}
  .ctl-sel.res{min-width:62px}
  /* 2.6 独有的一行：画质 / 格式 / 背景。左边一个小标签，右边是当前值，
     三个并排一行；选了「默认」就把值调暗，一眼能看出这项没发给上游。 */
  .adv-line{display:flex; align-items:center; gap:5px; flex-wrap:wrap}
  .ctl-sel.adv{max-width:110px; padding:0 17px 0 6px; gap:4px; justify-content:flex-start}
  .ctl-sel.adv .k{flex:0 0 auto; font-size:10px; color:var(--dim-2); letter-spacing:.2px}
  .ctl-sel.adv .ctl-t.isdef{color:var(--dim-2); font-weight:400}
  .ctl-sel.adv .ctl-t{text-align:left}

  /* ============================================================
     参数下拉浮层：毛玻璃 + 分段卡片，与节点面板同一套质感
     ============================================================ */
  .qmenu{
    position:fixed; z-index:1200; padding:8px; border-radius:16px;
    background:rgba(30,30,37,.82);
    -webkit-backdrop-filter:blur(34px) saturate(190%);
    backdrop-filter:blur(34px) saturate(190%);
    border:1px solid rgba(255,255,255,.16);
    box-shadow:0 22px 54px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.12);
    opacity:0; transform:translateY(5px) scale(.985);
    transition:opacity .13s ease, transform .13s cubic-bezier(.2,.9,.3,1);
  }
  .qmenu.on{opacity:1; transform:none}
  .qmenu-t{
    font-size:10px; font-weight:500; letter-spacing:.6px;
    color:rgba(236,236,245,.5); padding:2px 6px 8px;
  }
  .qmenu-body{display:flex; flex-direction:column; gap:2px}
  /* 模型列表现在有 10 个，太长就内部滚动，别顶出屏幕 */
  .qmenu:not(.grid) .qmenu-body{max-height:min(64vh, 420px); overflow-y:auto; overscroll-behavior:contain}
  /* 栅格换行：图片画幅最多 16 档，一排 8 个刚好两行（4 档的视频比例不会触发换行） */
  .qmenu.grid .qmenu-body{display:flex; flex-direction:row; flex-wrap:wrap; gap:3px;
    max-width:min(474px, 92vw); justify-content:flex-start}
  .qi{
    border:0; background:transparent; border-radius:10px; cursor:pointer;
    font-family:inherit; color:rgba(240,240,248,.9);
    font-size:12px; font-weight:500; letter-spacing:.2px;
    display:flex; align-items:center; gap:8px; padding:9px 11px;
    text-align:left; white-space:nowrap; transition:background .12s, color .12s;
  }
  .qi:hover{background:rgba(255,255,255,.12); color:#fff}
  .qi.on{background:rgba(255,255,255,.16); color:#fff; box-shadow:inset 0 0 0 1px rgba(255,255,255,.22)}
  .qi em{font-style:normal; margin-left:auto; padding-left:10px; font-size:10px; color:rgba(236,236,245,.42)}
  /* 比例 / 分辨率：图标（或数值）在上、说明在下 */
  .qmenu.grid .qi{
    flex-direction:column; gap:6px; padding:9px 7px 7px; min-width:56px;
    align-items:center; font-size:10.5px; letter-spacing:0;
  }
  .qi .ic{
    display:block; width:18px; height:10px; border:1.4px solid currentColor;
    border-radius:2.5px; opacity:.85;
  }
  .qi .ic.r916{width:10px; height:18px}
  .qi .ic.r11{width:14px; height:14px}
  .qi .ic.auto{width:17px; height:12px; border-style:dashed}
  /* 图片画幅：每种比例一个小矩形，一眼能看出横竖 */
  .qi .ic.r43{width:16px; height:12px}
  .qi .ic.r34{width:12px; height:16px}
  .qi .ic.r32{width:18px; height:12px}
  .qi .ic.r23{width:12px; height:18px}
  .qi .ic.r219{width:21px; height:9px}
  .qi .ic.r21{width:18px; height:9px}
  .qi .ic.r12{width:9px; height:18px}
  .qi .ic.r54{width:16px; height:13px}
  .qi .ic.r45{width:13px; height:16px}
  .qi .ic.r31{width:21px; height:7px}
  .qi .ic.r13{width:7px; height:21px}
  .qi .ic.r921{width:20px; height:8px}
  .qi.on .ic{opacity:1}
  .qi .num{font-size:12px; font-weight:600; letter-spacing:.2px; line-height:1.1}
  .qi .sub{font-size:9.5px; color:rgba(236,236,245,.4); letter-spacing:.2px}
  .qi.on .sub{color:rgba(255,255,255,.62)}

  /* ---------------- 生成参数面板（比例 / 分辨率 / 数量 三合一） ----------------
     卡片底栏只留「模型 + 参数 + 发送」，其余参数全收进这个面板：点参数按钮从
     按钮上方弹开，改一项就地生效、面板不关，连着调也不用来回点。 */
  .ppanel{
    position:fixed; z-index:1210; width:min(340px, 92vw);
    padding:12px 12px 11px; border-radius:16px;
    background:rgba(30,30,37,.86);
    -webkit-backdrop-filter:blur(34px) saturate(190%);
    backdrop-filter:blur(34px) saturate(190%);
    border:1px solid rgba(255,255,255,.16);
    box-shadow:0 22px 54px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.12);
    opacity:0; transform:translateY(6px) scale(.985);
    transition:opacity .13s ease, transform .13s cubic-bezier(.2,.9,.3,1);
  }
  .ppanel.on{opacity:1; transform:none}
  .pp-sec + .pp-sec{margin-top:13px}
  .pp-t{font-size:10.5px; color:rgba(236,236,245,.5); letter-spacing:.4px; margin:0 2px 7px}
  .pp-row{display:flex; gap:5px}
  /* 超过 6 档（图片最多 16 种画幅）就折成 6 列网格，一行排不下也别挤成一条线 */
  .pp-row.wrap{flex-wrap:wrap}
  .pp-row.wrap .pp-b{flex:0 0 calc((100% - 25px) / 6)}
  .pp-b{
    flex:1 1 0; min-width:0; border:0; cursor:pointer; font-family:inherit;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
    padding:9px 2px; border-radius:10px;
    background:rgba(255,255,255,.055); color:rgba(236,236,245,.74);
    font-size:11px; line-height:1; font-variant-numeric:tabular-nums;
    transition:background .13s, color .13s;
  }
  .pp-b:hover{background:rgba(255,255,255,.13); color:#fff}
  .pp-b.dis{opacity:.42; cursor:not-allowed}
  .pp-b.dis:hover{background:rgba(255,255,255,.055); color:rgba(236,236,245,.74)}
  .pp-b.on{background:#fff; color:#12121a; font-weight:600}
  .pp-b .ic{display:block; width:18px; height:10px; border:1.6px solid currentColor;
    border-radius:3px; opacity:.95}
  .pp-b .ic.r916{width:10px; height:18px}
  .pp-b .ic.r11{width:15px; height:15px}
  .pp-b .ic.r43{width:16px; height:12px}
  .pp-b .ic.r34{width:12px; height:16px}
  .pp-b .ic.r32{width:16px; height:10.7px}
  .pp-b .ic.r23{width:10.7px; height:16px}
  .pp-b .ic.r54{width:15.3px; height:12.2px}
  .pp-b .ic.r45{width:12.2px; height:15.3px}
  .pp-b .ic.r219{width:19px; height:8.2px}
  .pp-b .ic.r21{width:17px; height:8.5px}
  .pp-b .ic.r12{width:8.5px; height:17px}
  .pp-b .ic.r31{width:19.6px; height:6.5px}
  .pp-b .ic.r13{width:6.5px; height:19.6px}
  .pp-b .ic.r921{width:8.2px; height:19px}
  .pp-b .ic.auto{width:18px; height:12px; border-style:dashed}
  .pp-b .lbl{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%}
  .pp-b .tag{font-size:9px; color:rgba(236,236,245,.42); font-weight:400}
  .pp-b.on .tag{color:rgba(18,18,26,.5)}
  .pp-note{font-size:10px; color:rgba(236,236,245,.42); padding:3px 2px 0; line-height:1.5}
  body.light .ppanel{
    background:rgba(250,250,253,.92);
    border-color:rgba(20,20,30,.12);
    box-shadow:0 22px 50px rgba(20,20,30,.22), inset 0 1px 0 rgba(255,255,255,.9);
  }
  body.light .pp-t{color:rgba(30,30,44,.55)}
  body.light .pp-b{background:rgba(20,20,30,.06); color:rgba(18,18,30,.86)}
  body.light .pp-b:hover{background:rgba(20,20,30,.1); color:#000}
  body.light .pp-b.on{background:#1b1b21; color:#fff; box-shadow:none}
  body.light .pp-b .tag{color:rgba(18,18,30,.5)}
  body.light .pp-b.on .tag{color:rgba(255,255,255,.55)}
  body.light .pp-note{color:rgba(26,26,38,.42)}
  /* 生成中：发送键灰掉，光标也明说不能点 */
  .send:disabled{opacity:.32; cursor:not-allowed; filter:grayscale(1)}
  /* 提交卡在「请求发出去了、任务号还没回来」这几秒：那只 ↑ 原地转圈。
     灰得像没点着反而让人以为没提交上，所以 pending 态不再压暗。 */
  .send.pending,
  .send.pending:disabled{opacity:.9; cursor:progress; filter:none; transform:none}
  .send.pending:hover{background:#fff; transform:none}
  .send .sp{
    width:15px; height:15px; border-radius:50%;
    border:2.2px solid rgba(11,11,15,.14);
    border-top-color:#0b0b0f; border-right-color:#0b0b0f;
    animation:spinRing .72s linear infinite;
  }
  body.light .send .sp{border-color:rgba(255,255,255,.22); border-top-color:#fff; border-right-color:#fff}
  @keyframes spinRing{to{transform:rotate(360deg)}}
  /* 参数按钮上要放得下「16:9 · 1080P · 5条」，别被 112px 的通用上限截掉 */
  .bar-line .ctl.params{max-width:none; flex:0 1 auto; min-width:86px}

  .ctl-ico{
    flex:0 0 auto; width:30px; height:30px; border-radius:9px;
    background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12);
    color:var(--dim); font-size:12px; cursor:pointer; font-family:inherit;
    display:grid; place-items:center; transition:.16s;
  }
  .ctl-ico:hover{background:rgba(255,255,255,.13); color:#fff}
  .ctl-ico.on{background:rgba(255,255,255,.14); border-color:rgba(255,255,255,0.23); color:#e4e4ec}
  .bar-line .send{margin-left:auto}

  /* Wan 3.0 专有参数（扩写 / 种子）：跟模型行并排同一行，比下拉控件小一号 */
  .wan-params{display:inline-flex; align-items:center; gap:3px; flex:0 0 auto; margin-left:4px}
  .bar-line .ctl.param{
    height:26px; max-width:none; padding:0 7px; border-radius:8px;
    display:inline-flex; align-items:center; gap:5px;
    font-size:10.5px; letter-spacing:.2px; color:var(--dim-2);
  }
  .bar-line .ctl.param .k{color:var(--dim)}
  .bar-line .ctl.param .v{color:var(--text); font-weight:600}
  .bar-line .ctl.param.on{
    background:rgba(255,255,255,.15); border-color:rgba(255,255,255,.28);
  }
  .bar-line .ctl.param.on .k{color:#cfcfdb}
  .bar-line .ctl.param.on .v{color:#fff}

  /* 右下角缩放把手 */
  .rsz{
    position:absolute; right:1px; bottom:1px; width:16px; height:16px; z-index:6;
    cursor:nwse-resize; opacity:.42; transition:opacity .15s;
    background:
      linear-gradient(135deg, transparent 42%, currentColor 42%, currentColor 50%, transparent 50%),
      linear-gradient(135deg, transparent 62%, currentColor 62%, currentColor 70%, transparent 70%);
    color:rgba(255,255,255,.75);
    border-bottom-right-radius:18px;
  }
  .rsz:hover{opacity:1}

  /* 编辑器可自定义高度 */
  .ptext.fixed{max-height:none}

  /* 视频舞台按比例 */
  .vstage{min-height:0}

  /* ============================================================
     素材节点 / 连线加号 / 视频框 / 历史记录
     ============================================================ */





  /* 素材节点 / 连线加号 / 视频框 / 历史记录 */




  


  /* ---- 素材节点（照即梦的样子）：图片/视频直接是一块圆角画面，音频是一张深灰波形卡 ---- */
  .node.asset{overflow:visible; background:transparent; border:0 !important; box-shadow:none; padding:0}
  .node.asset.sel{box-shadow:none}
  /* 顶部浮一条透明工具条（在卡片外面、卡片正上方）：左边文件名、右边删除，兼作拖动把手 */
  .node.asset .node-head{
    position:absolute; left:0; right:0; bottom:100%; top:auto; z-index:4;
    padding:0 3px 5px; border:0; background:transparent; border-radius:0;
    display:flex; align-items:center; gap:6px;
    height:auto; cursor:grab;
  }
  .node.asset .node-head:active{cursor:grabbing}
  /* 名字和叉号都不带底框，直接浮在画布上，靠投影保证任何背景上都看得清 */
  .node.asset .atag{
    display:block; flex:1 1 auto; min-width:0; max-width:100%;
    font-size:11px; line-height:1.3; letter-spacing:.15px;
    color:rgba(255,255,255,.84);
    background:none; border:0; padding:0;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    text-shadow:0 1px 3px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.7);
  }
  /* 右上角工具：下载 ⤓（跟生成节点预览窗那颗一致，鼠标进卡片才亮起来）
     + 删除 ×（只在选中时露出来，免得手一滑把素材删掉） */
  .node.asset .adl{
    width:18px; height:18px; flex:0 0 auto; padding:0; border:0; border-radius:6px;
    display:grid; place-items:center; cursor:pointer;
    background:none; color:rgba(255,255,255,.66);
    text-shadow:0 1px 3px rgba(0,0,0,.95);
    opacity:0; pointer-events:none; transition:opacity .15s, background .15s, color .15s;
  }
  .node.asset .adl svg{width:12px; height:12px}
  .node.asset:hover .adl, .node.asset.sel .adl{opacity:1; pointer-events:auto}
  .node.asset .adl:hover{background:rgba(255,255,255,.14); color:#fff}
  .node.asset .adl.busy{opacity:.45; pointer-events:none}
  .node.asset .x{
    width:18px; height:18px; flex:0 0 auto; border-radius:6px; border:0;
    background:none; color:rgba(255,255,255,.62);
    display:grid; place-items:center; font-size:14px; line-height:1; cursor:pointer;
    text-shadow:0 1px 3px rgba(0,0,0,.95);
    opacity:0; pointer-events:none; transition:opacity .15s, background .15s, color .15s;
  }
  .node.asset.sel .x{opacity:1; pointer-events:auto}
  .node.asset .x:hover{color:#ff9b9b; background:rgba(255,255,255,.1)}
  /* 触屏没有 hover：两个按钮常驻，不然手机上没法下载/删除 */
  @media (pointer:coarse){
    .node.asset .adl, .node.asset .x{opacity:1; pointer-events:auto}
  }

  .node.asset .abody{
    border-radius:15px; overflow:hidden; background:rgba(0,0,0,.28);
    line-height:0; box-shadow:0 14px 38px rgba(0,0,0,.45);
    transition:box-shadow .16s;
  }
  .node.asset.sel .abody{box-shadow:0 0 0 1.5px rgba(255,255,255,.42), 0 18px 46px rgba(0,0,0,.55)}
  .node.asset .abody img,.node.asset .abody video{width:100%; display:block; -webkit-user-drag:none}
  /* 视频：右下角一颗圆形播放键，点开才出原生控制条 */
  .node.asset .abody.vd{position:relative; background:#0b0b0f}
  .node.asset .abody.vd video{border-radius:15px}

  /* 音频卡：毛玻璃底（半透明 + 模糊）+ 中间波形 + 蓝色游标 + 左下时间 + 右下播放。
     ⚠️ 玻璃底必须画在 .node.asset.is-aud 上，不能挂在 .abody 上：
     .node 自己已经有 backdrop-filter，它就是一个「backdrop root」，
     子元素再写 backdrop-filter 只能采样节点内部（等于什么都没采到，实测前后截图逐字节相同）。
     这里也刻意不写 box-shadow —— 会和 .node.asset.sel .abody 的选中描边同级打架。 */
  .node.asset.is-aud{
    border-radius:15px;
    background:linear-gradient(180deg, rgba(48,48,60,.52), rgba(21,21,28,.64));
    border:1px solid rgba(255,255,255,.13) !important;
    border-top-color:rgba(255,255,255,.22) !important;
  }
  .node.asset.is-aud .abody.au{
    /* 内层再压一层薄暗纱：玻璃底本身很透，压到亮色图片上时白波形会糊掉，这层保证任何背景都能看清 */
    background:rgba(10,10,14,.2); border:0; border-radius:14px;
    line-height:1.4; position:relative; padding-top:14px;
  }
  .awave{position:relative; height:78px; margin:0 14px; cursor:pointer; touch-action:none}
  .awave canvas{width:100%; height:64px; display:block; pointer-events:none}
  .acur{
    position:absolute; top:4px; bottom:8px; left:0; width:2px; margin-left:-1px;
    border-radius:2px; background:#3a92ff; box-shadow:0 0 8px rgba(58,146,255,.85);
    pointer-events:none; transform:translateX(0);
  }
  .acur::before{
    content:""; position:absolute; left:50%; top:-2px; width:7px; height:7px;
    margin-left:-3.5px; border-radius:50%; background:#3a92ff;
  }
  .afoot{display:flex; align-items:center; justify-content:space-between; padding:0 12px 11px 14px; gap:8px}
  .atime{
    font-size:11px; color:rgba(255,255,255,.66); letter-spacing:.5px;
    font-variant-numeric:tabular-nums; white-space:nowrap;
  }
  .apb{
    width:26px; height:26px; flex:0 0 auto; border-radius:50%; border:0; padding:0; cursor:pointer;
    background:rgba(255,255,255,.13); color:#fff;
    display:grid; place-items:center; transition:background .15s, transform .12s;
  }
  .apb:hover{background:rgba(255,255,255,.26); transform:scale(1.06)}
  .apb svg{display:block}
  .node.asset .abody.vd .apb{
    position:absolute; right:10px; bottom:10px; width:29px; height:29px;
    background:rgba(10,10,14,.66); border:1px solid rgba(255,255,255,.14);
    -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  }
  .node.asset .abody.vd .apb:hover{background:rgba(30,30,38,.86)}

  /* ---- 文本节点：外壳和素材节点同一套（透明无壳 + 卡片上方浮一条工具条） ---- */
  .node.text{overflow:visible; background:transparent; border:0 !important; box-shadow:none; padding:0}
  .node.text.sel{box-shadow:none}
  .node.text .node-head{
    position:absolute; left:0; right:0; bottom:100%; top:auto; z-index:4;
    padding:0 3px 5px; border:0; background:transparent; border-radius:0;
    display:flex; align-items:center; gap:6px;
    height:auto; cursor:grab;
  }
  .node.text .node-head:active{cursor:grabbing}
  .node.text .txi{flex:0 0 auto; line-height:0; color:rgba(255,255,255,.5)}
  .node.text .atag{
    display:block; flex:0 1 auto; min-width:0; max-width:100%;
    font-size:11px; line-height:1.3; letter-spacing:.15px;
    color:rgba(255,255,255,.84);
    background:none; border:0; padding:0;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
    text-shadow:0 1px 3px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.7);
  }
  .node.text .x{
    width:18px; height:18px; flex:0 0 auto; border-radius:6px; border:0;
    background:none; color:rgba(255,255,255,.62);
    display:grid; place-items:center; font-size:14px; line-height:1; cursor:pointer;
    text-shadow:0 1px 3px rgba(0,0,0,.95);
    opacity:0; pointer-events:none; transition:opacity .15s, background .15s, color .15s;
  }
  .node.text:hover .x, .node.text.sel .x{opacity:1; pointer-events:auto}
  .node.text .x:hover{color:#ff9b9b; background:rgba(255,255,255,.1)}
  /* 右上角「放大编辑」：不用悬停就露出来，不然没人知道这块文本能点开放大 */
  .node.text .txb{
    width:20px; height:20px; opacity:.5; pointer-events:auto; color:rgba(255,255,255,.72);
  }
  .node.text .txb:hover{color:#fff; background:rgba(255,255,255,.1)}
  .node.text .txb svg{display:block}
  /* 标题行中间那颗「前缀 / 自由」小药丸：两段式，当前模式亮起来 */
  .node.text .txmode{
    display:inline-flex; align-items:center; gap:1px; flex:0 0 auto;
    height:20px; padding:2px; border-radius:99px;
    background:rgba(22,22,28,.82);
    border:1px solid rgba(255,255,255,.1);
    box-shadow:0 4px 12px rgba(0,0,0,.42);
    -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  }
  .node.text .txmode .txm{
    height:16px; padding:0 8px; border:0; border-radius:99px;
    background:none; color:rgba(255,255,255,.48);
    font-family:inherit; font-size:10px; line-height:1; letter-spacing:.3px;
    cursor:pointer; transition:background .15s, color .15s;
  }
  .node.text .txmode .txm:hover{color:rgba(255,255,255,.86)}
  .node.text .txmode .txm.on{
    background:rgba(255,255,255,.17); color:#fff;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.14);
  }
  /* 自由模式用一点冷色，扫一眼就知道这段不会自动进前缀 */
  .node.text.free .txmode{background:rgba(20,26,40,.86); border-color:rgba(120,170,255,.26)}
  .node.text.free .txmode .txm.on{
    background:rgba(96,148,240,.3); color:#eaf2ff;
    box-shadow:inset 0 0 0 1px rgba(140,184,255,.32);
  }

  .node.text .abody.tx{
    position:relative; border-radius:15px; overflow:hidden;
    background:linear-gradient(180deg, rgba(30,30,37,.97), rgba(21,21,27,.97));
    border:1px solid rgba(255,255,255,.09);
    box-shadow:0 14px 38px rgba(0,0,0,.42);
    line-height:1.4; transition:box-shadow .16s, border-color .16s;
  }
  .node.text.sel .abody.tx{
    border-color:rgba(255,255,255,.2);
    box-shadow:0 0 0 1.5px rgba(255,255,255,.42), 0 18px 46px rgba(0,0,0,.55);
  }
  .node.text .txta{
    display:block; width:100%; height:100%; box-sizing:border-box; margin:0;
    padding:15px 17px 16px; background:transparent; border:0; outline:none;
    resize:none; overflow:auto; color:rgba(240,240,248,.93); caret-color:#fff;
    font-family:inherit; font-size:12.5px; line-height:1.9; letter-spacing:.2px;
    -webkit-user-drag:none;
    /* 默认让鼠标穿透到卡片上：整张卡都能拖着走；双击才进编辑态 */
    pointer-events:none;
  }
  .node.text.editing .txta{pointer-events:auto}
  /* 编辑态用淡蓝圈标一下：深色画布上白光太弱，看不出「这一块正在写」 */
  .node.text.editing .abody.tx{
    border-color:rgba(150,192,255,.45);
    box-shadow:0 0 0 1px rgba(150,192,255,.3), 0 18px 46px rgba(0,0,0,.5);
  }
  .node.text .txta::placeholder{color:rgba(255,255,255,.28)}
  /* 全局 textarea:focus 有一圈描边，卡片里的文本框不要它（卡片的选中态自己会亮） */
  .node.text .txta:focus{border:0; box-shadow:none}
  .node.text .txta::-webkit-scrollbar{width:6px; background:transparent}
  .node.text .txta::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16); border-radius:99px}
  .node.text .txta::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.26)}

  /* 生成节点里那行「提示词前缀」：只是告诉你有几段文字会在提交时拼到最前面 */
  .txpre{display:flex; align-items:center; gap:5px; flex-wrap:wrap; padding:0 1px 8px}
  .txpre .txpre-l{font-size:10.5px; color:var(--dim-2); letter-spacing:.2px}
  .txpre .txpre-t{
    display:inline-flex; align-items:center; gap:4px; height:20px; padding:0 7px 0 6px;
    border-radius:6px; cursor:pointer; font-size:10.5px; letter-spacing:.1px;
    color:rgba(232,232,242,.82);
    background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1);
    transition:background .15s, border-color .15s;
  }
  .txpre .txpre-t:hover{background:rgba(255,255,255,.13); border-color:rgba(255,255,255,.2)}
  .txpre .txpre-t svg{flex:0 0 auto; opacity:.55}

  /* 素材轨里的文本卡：T 图标 + 左上角「文1」角标（位置、删除键都跟音1一致） */
  .acard.txt{background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.16)}
  .acard.txt .muse{font-size:15px; font-weight:600; color:#e4e4ec; margin-top:0; line-height:1}
  .acard.txt .arole{max-width:48px; overflow:hidden; text-overflow:ellipsis}
  /* 自由文本卡左下角一个小 @：提醒它不是自动前缀，要在正文里 @ 才生效 */
  .acard.txt .afree{
    position:absolute; left:4px; bottom:1px; font-size:10px; font-weight:700; line-height:1;
    color:rgba(150,190,255,.95); pointer-events:none;
    text-shadow:0 1px 3px rgba(0,0,0,.8);
  }

  .plus{
    position:absolute; right:-32px; top:50%; transform:translateY(-50%);
    width:24px; height:24px; border-radius:50%; z-index:8; padding:0;
    border:1px solid rgba(255,255,255,.26); background:rgba(28,28,36,.94);
    color:#e4e4ec; cursor:crosshair; display:grid; place-items:center;
    font-size:15px; line-height:1; font-family:inherit; font-weight:600;
    box-shadow:0 4px 14px rgba(0,0,0,.5); transition:.16s;
  }
  .plus:hover{background:#ffffff; color:#fff; border-color:transparent; transform:translateY(-50%) scale(1.14)}

  /* 节点内视频框 */
  .vbox{
    position:relative; width:100%; border-radius:12px; overflow:hidden;
    background:#0d0f14; border:1px solid rgba(255,255,255,.1);
    display:grid; place-items:center; max-height:246px;
    --p:0;
    --pca:rgba(126,172,255,.34);   /* 水体上沿 */
    --pcb:rgba(92,136,238,.22);    /* 水体下沿 */
  }
  .vbox video{width:100%; max-height:246px; object-fit:contain; display:block; background:#000}
  /* ---- 视频预览的自绘控制条 ----
     不用原生 controls：它自带的黑色羽化渐变压画面，图标也是浏览器那套。
     这里是一条贴在画面底部的玻璃胶囊：平时完全藏起来（鼠标没靠近、节点也没选中时
     不该有东西挡画面），鼠标进框 / 节点被选中时从下方 8px 上移淡入。 */
  .vctl{
    position:absolute; left:8px; right:8px; bottom:8px; z-index:4;
    display:flex; align-items:center; gap:5px;
    height:30px; padding:0 5px; border-radius:9px;
    background:rgba(12,12,18,.62);
    -webkit-backdrop-filter:blur(18px) saturate(165%);
    backdrop-filter:blur(18px) saturate(165%);
    border:1px solid rgba(255,255,255,.16);
    box-shadow:0 8px 22px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.1);
    color:rgba(255,255,255,.95);
    opacity:0; transform:translateY(8px); pointer-events:none;
    transition:opacity .17s ease, transform .22s cubic-bezier(.2,.82,.28,1);
  }
  .vbox:hover .vctl,
  .node.sel .vbox .vctl,
  .pfloat.sel .vctl,
  .vctl:focus-within,
  .vctl.pin{opacity:1; transform:none; pointer-events:auto}
  .vcb{
    flex:0 0 auto; width:22px; height:22px; padding:0; border:0; border-radius:6px;
    display:grid; place-items:center; cursor:pointer; font-family:inherit;
    background:transparent; color:inherit; transition:background .14s, color .14s;
  }
  .vcb:hover{background:rgba(255,255,255,.16); color:#fff}
  .vcb:active{transform:scale(.92)}
  .vcb svg{display:block}
  .vtime{
    flex:0 0 auto; font-size:10px; line-height:1; letter-spacing:.2px;
    font-variant-numeric:tabular-nums; color:rgba(255,255,255,.92);
    display:flex; align-items:center; gap:1px;
  }
  .vtime i{font-style:normal; color:rgba(255,255,255,.45)}
  /* 进度：3px 细线 + 悬停加粗，拖动时出现小圆点。点击/拖动都按比例 seek */
  .vtrack{
    flex:1 1 auto; min-width:26px; height:18px; margin:0 3px;
    display:flex; align-items:center; cursor:pointer; position:relative;
  }
  .vtrack::before{
    content:''; position:absolute; left:0; right:0; top:50%; height:3px; margin-top:-1.5px;
    border-radius:99px; background:rgba(255,255,255,.3); transition:height .12s, margin .12s;
  }
  .vtrack .vfill{
    position:absolute; left:0; top:50%; height:3px; margin-top:-1.5px; width:0;
    border-radius:99px; background:#fff; transition:height .12s, margin .12s;
  }
  .vtrack .vknob{
    position:absolute; left:0; top:50%; width:7px; height:7px; margin:-3.5px 0 0 -3.5px;
    border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.45);
    opacity:0; transform:scale(.6); transition:opacity .12s, transform .12s;
  }
  .vtrack:hover::before, .vtrack:hover .vfill{height:5px; margin-top:-2.5px}
  .vtrack:hover .vknob, .vtrack.drag .vknob{opacity:1; transform:none}
  .vtrack.drag::before, .vtrack.drag .vfill{height:5px; margin-top:-2.5px}
  /* 浅色主题：白玻璃胶囊 → 深字深图标，仍然不压画面 */
  body.light .vctl{
    background:rgba(255,255,255,.72); border-color:rgba(20,20,30,.12);
    color:rgba(24,24,32,.86); box-shadow:0 6px 18px rgba(20,20,40,.16), inset 0 1px 0 rgba(255,255,255,.9);
  }
  body.light .vcb:hover{background:rgba(20,20,30,.1); color:#111}
  body.light .vtime{color:rgba(24,24,32,.8)}
  body.light .vtime i{color:rgba(24,24,32,.38)}
  body.light .vtrack::before{background:rgba(20,20,30,.18)}
  body.light .vtrack .vfill{background:#22222c}
  body.light .vtrack .vknob{background:#22222c}
  /* 图片节点：预览框里放静态图，等比铺满（不裁切），底色跟视频一致。
     有图时不锁比例，让框贴着图片本身的高度收，竖图才不会留一大片空。 */
  .vbox img.vimg{width:100%; max-height:320px; object-fit:contain; display:block; background:#0b0b10}
  .vbox.has-image{max-height:none}
  .vbox.is-img .vempty-ico{width:26px; height:26px}
  .imgnote{font-size:10px; color:var(--dim-2); letter-spacing:.2px; white-space:nowrap; padding:0 2px}
  /* 有视频时外层不再做圆角裁剪 —— 画布是带 transform 缩放的，缩放后的圆角裁剪
     会把视频切成上下两块分别合成，交界处冒出一条 1px 黑线（还带一点亮度错位）。
     现在圆角由 video 自己画，外层不裁，并把视频单独提到一个合成层，接缝就没了。 */
  .vbox.has-video{overflow:visible}
  .vbox.has-video video{
    border-radius:inherit; transform:translateZ(0);
    -webkit-backface-visibility:hidden; backface-visibility:hidden;
  }
  /* 全屏：控制条常显，画面铺满，圆角撤掉 */
  .vbox:fullscreen{
    max-height:none; width:100vw; height:100vh; border:0; border-radius:0;
    background:#000; overflow:hidden;
  }
  .vbox:fullscreen video{max-height:none; width:100%; height:100%; border-radius:0}
  .vbox:fullscreen .vctl{
    opacity:1; transform:none; pointer-events:auto;
    left:18px; right:18px; bottom:18px; height:36px;
  }
  /* 生成中：整个预览框就是进度条，填充宽度 = 生成进度。
     水体分三层，各管一件事：
       .vw-body  水体本体 —— 浪形遮罩（一条振幅不规则的水面线，纵向滚 = 上下起伏），
                 外加轻微横向摇摆，浪头一直在动，不是一条固定曲线；
       ::before  水波流光（从左侧灌进来、向右推进）
       ::after   水面纹理（细波纹线横向漂）
       .vw-foam  浪头飞沫 —— 不参与遮罩裁剪，能甩到水体外面；水里另有几个上浮气泡。
     注意：宽浪层要和左侧实心层重叠几个像素，遮罩横向摇摆时才不会露出接缝。 */
  .vbox .vprog{
    /* 两股浪：短周期「碎浪」叠长周期「涌浪」，取并集 —— 轮廓一处深一处浅，
       而且两股移速不同，叠出来的形状不会看起来像同一个扇贝反复出现。 */
    --wvA:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='64'><path d='M0 0 L15 0C18 3 19 5 18 8C16.5 11 12.5 12 10.5 15C8.5 18 9.5 21 12.5 24C15 27 18.5 28 19.5 31C20.5 34 17.5 36 14 38C10.5 40 7 42 5.5 45C4 48 5 51 7.5 54C10 57 13 58 15 61C15.8 62.5 15.5 63.5 15 64 L0 64 Z' fill='%23000'/></svg>");
    --wvB:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='160'><path d='M0 0 L15 0C18 6 20 11 19 17C18 23 12 26 9 32C6 38 7 44 11 49C15 54 20 58 21 64C22 70 16 73 9 79C5 85 8 90 13 96C18 102 21 107 20 113C19 119 13 122 10 128C8 134 13 140 16 146C19 152 18 156 15 160 L0 160 Z' fill='%23000'/></svg>");
    --foamc:rgba(238,247,255,.95);
    --foamg:rgba(176,212,255,.55);
    position:absolute; left:0; top:0; bottom:0; z-index:1; pointer-events:none;
    width:max(6px, calc(var(--p) * 1% - 14px));
    transition:width .6s cubic-bezier(.33,0,.2,1);
  }
  /* 水体本体：实心层 + 两股浪层取并集。实心层故意和浪层重叠 6px，
     浪层横向摇摆时才不会在接缝处露出一条缝。 */
  .vbox .vw-body{
    position:absolute; inset:0; display:block;
    background:linear-gradient(180deg, var(--pca), var(--pcb));
    /* 三层并集：实心层 + 两股浪。两股浪的振幅区间故意交叠（4~22 / 6~20），
       谁鼓出来谁就是轮廓，深度和节奏因此不重复；实心层和浪层重叠 6px，
       浪层横向摇摆时接缝处才不露缝。 */
    -webkit-mask-image:linear-gradient(#000,#000), var(--wvA), var(--wvB);
    -webkit-mask-size:max(0px, calc(100% - 20px)) 100%, 26px 64px, 26px 160px;
    -webkit-mask-position:0 0, 100% 0, 100% 0;
    -webkit-mask-repeat:no-repeat, repeat-y, repeat-y;
    mask-image:linear-gradient(#000,#000), var(--wvA), var(--wvB);
    mask-size:max(0px, calc(100% - 20px)) 100%, 26px 64px, 26px 160px;
    mask-position:0 0, 100% 0, 100% 0;
    mask-repeat:no-repeat, repeat-y, repeat-y;
    animation:waveFlow 5.2s linear infinite;
  }
  /* 水波流光：一条柔和亮带从左侧灌入、向右推进 */
  .vbox .vw-body::before{
    content:""; position:absolute; inset:0;
    /* 90deg 而非斜角：渐变两端正好落在图层边缘，alpha=0，不会留下一条硬边 */
    background-image:linear-gradient(90deg,
      rgba(255,255,255,0) 0%, rgba(255,255,255,.13) 50%, rgba(255,255,255,0) 100%);
    background-size:90% 100%;
    background-repeat:no-repeat;
    animation:progFlow 3.6s linear infinite;
  }
  /* 水面纹理：横向波纹线随水流向右漂移 */
  .vbox .vw-body::after{
    content:""; position:absolute; inset:0;
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='26'%3E%3Cpath d='M0 13 Q30 5 60 13 T120 13' fill='none' stroke='%23ffffff' stroke-opacity='0.065' stroke-width='1'/%3E%3C/svg%3E"),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='44'%3E%3Cpath d='M0 22 Q42 12 85 22 T170 22' fill='none' stroke='%23ffffff' stroke-opacity='0.042' stroke-width='1'/%3E%3C/svg%3E");
    background-size:120px 26px, 170px 44px;
    background-position:0 0, 26px 10px;
    animation:waterFlow 5.6s linear infinite;
  }
  /* 水体里往上浮的小气泡（被遮罩裁在水里，不会漏到框外） */
  .vbox .vw-body .bub{
    position:absolute; bottom:0; width:2px; height:2px; border-radius:50%;
    background:rgba(255,255,255,.6); opacity:0;
    animation:bubbleUp 7s linear infinite;
  }
  .vbox .vw-body .bub:nth-child(1){left:22%; animation-delay:.4s}
  .vbox .vw-body .bub:nth-child(2){left:47%; animation-delay:2.6s}
  .vbox .vw-body .bub:nth-child(3){left:68%; animation-delay:4.7s}
  /* 浪头飞沫：贴着填充的右边缘（也就是水面）往上散开，不参与遮罩裁剪 */
  .vbox .vw-foam{position:absolute; inset:0; display:block; pointer-events:none}
  .vbox .vw-foam b{
    position:absolute; right:1px; width:3px; height:3px; border-radius:50%;
    background:radial-gradient(circle at 34% 30%, #fff 0 36%, var(--foamc) 58%, transparent 72%);
    box-shadow:0 0 6px var(--foamg);
    opacity:0; animation:foamSpray 3.2s ease-out infinite;
  }
  .vbox .vw-foam b:nth-child(1){top:4%;  --fx:-8px;  --fy:-14px; animation-delay:0s;   animation-duration:3.1s; width:4px; height:4px}
  .vbox .vw-foam b:nth-child(2){top:15%; --fx:-14px; --fy:-6px;  animation-delay:.7s;  animation-duration:3.7s; width:2px; height:2px}
  .vbox .vw-foam b:nth-child(3){top:26%; --fx:6px;   --fy:-12px; animation-delay:1.2s; animation-duration:2.6s; width:2px; height:2px}
  .vbox .vw-foam b:nth-child(4){top:36%; --fx:-6px;  --fy:-16px; animation-delay:1.9s; animation-duration:3.4s}
  .vbox .vw-foam b:nth-child(5){top:47%; --fx:-12px; --fy:-9px;  animation-delay:.35s; animation-duration:4s;   width:2px; height:2px}
  .vbox .vw-foam b:nth-child(6){top:56%; --fx:-4px;  --fy:-15px; animation-delay:2.4s; animation-duration:3.3s}
  .vbox .vw-foam b:nth-child(7){top:66%; --fx:5px;   --fy:-9px;  animation-delay:1.5s; animation-duration:2.8s; width:2px; height:2px}
  .vbox .vw-foam b:nth-child(8){top:77%; --fx:-13px; --fy:-5px;  animation-delay:.9s;  animation-duration:3.6s; width:2px; height:2px}
  .vbox .vw-foam b:nth-child(9){top:88%; --fx:-8px;  --fy:-13px; animation-delay:2.9s; animation-duration:3s;   width:4px; height:4px}
  @keyframes progFlow{ from{background-position:-95% 0} to{background-position:195% 0} }
  @keyframes waterFlow{ from{background-position:0 0, 26px 10px} to{background-position:120px 0, 196px 10px} }
  /* 浪头纵向滚动 + 轻微横向摇摆：两层错速，滚满各自波长即无缝循环 */
  /* 浪头纵向滚动（滚满一个波长 100px 即无缝循环）+ 中途轻微横向摇摆：
     摇摆只在中间帧往右 3px，首尾都回原位，所以循环处不会跳。 */
  @keyframes waveFlow{
    from{
      -webkit-mask-position:0 0, 100% 0, 100% 0;
      mask-position:0 0, 100% 0, 100% 0;
    }
    34%{
      -webkit-mask-position:0 0, calc(100% + 3px) 22px, calc(100% + 3px) 54px;
      mask-position:0 0, calc(100% + 3px) 22px, calc(100% + 3px) 54px;
    }
    67%{
      -webkit-mask-position:0 0, calc(100% - 1px) 43px, calc(100% - 1px) 107px;
      mask-position:0 0, calc(100% - 1px) 43px, calc(100% - 1px) 107px;
    }
    to{
      -webkit-mask-position:0 0, 100% 64px, 100% 160px;
      mask-position:0 0, 100% 64px, 100% 160px;
    }
  }
  @keyframes bubbleUp{
    0%   {transform:translate3d(0,0,0);      opacity:0}
    12%  {opacity:.55}
    80%  {opacity:.4}
    100% {transform:translate3d(-6px,-150px,0); opacity:0}
  }
  @keyframes foamSpray{
    0%   {transform:translate3d(0,4px,0) scale(.45);                          opacity:0}
    22%  {                                                                    opacity:.95}
    100% {transform:translate3d(var(--fx,-8px), var(--fy,-12px),0) scale(1.05); opacity:0}
  }
  /* 系统开了「减少动态效果」就只留进度变化，别一直晃 */
  @media (prefers-reduced-motion:reduce){
    .vbox .vw-body, .vbox .vw-body::before, .vbox .vw-body::after,
    .vbox .vw-body .bub, .vbox .vw-foam b{animation:none !important}
    .vbox .vw-foam b{display:none}
  }
  /* 排队中：留一小段预备波，表示任务已在队列里 */
  .vbox.is-queued .vprog{width:34px; animation:queueBreath 1.8s ease-in-out infinite}
  @keyframes queueBreath{ 0%,100%{opacity:.34} 50%{opacity:.62} }

  /* 提交在途 / 排队中：画框正中压一枚转圈 + 一句状态。
     上游卡住时进度一直是 0%、水波几乎不动，光看数字分不清「在转」还是「死了」；
     这里给一个一眼就能看懂的忙碌指示，等真出进度（running 且 >0）就让回给水波。 */
  .vbox.is-pending .vempty{visibility:hidden}
  .vbox.is-pending .vph.prog{visibility:hidden}
  .vbox .vspin{
    position:absolute; inset:0; z-index:3;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px;
    background:rgba(10,12,17,.42);
    -webkit-backdrop-filter:blur(1px); backdrop-filter:blur(1px);
  }
  .vbox .vspin .ring{
    width:28px; height:28px; border-radius:50%;
    border:2.6px solid rgba(255,255,255,.18);
    border-top-color:#fff; border-right-color:rgba(255,255,255,.62);
    animation:spinRing .78s linear infinite;
    filter:drop-shadow(0 0 7px rgba(150,190,255,.35));
  }
  .vbox .vspin span{
    font-size:11px; font-weight:500; color:#eef3ff; letter-spacing:.4px;
    text-shadow:0 1px 3px rgba(0,0,0,.5);
  }
  body.light .vbox .vspin{background:rgba(243,244,248,.7)}
  body.light .vbox .vspin .ring{
    border-color:rgba(20,20,30,.14);
    border-top-color:#1b1b21; border-right-color:rgba(20,20,30,.42);
    filter:none;
  }
  body.light .vbox .vspin span{color:#1b1b21; text-shadow:none}
  @media (prefers-reduced-motion:reduce){
    .vbox .vspin .ring{animation-duration:2.4s}
  }

  .vbox .vph{position:relative; z-index:2; font-size:10.5px; padding:12px 14px; line-height:1.6;
    text-align:left; width:100%; max-height:100%; overflow:auto; user-select:text;
    word-break:break-word; -webkit-user-select:text}
  /* 进度文字：整个画框内居中，字号字重与右上角 ⏱ 按钮（.hbtn 10px/常规）一致 */
  .vbox .vph.prog{
    display:flex; align-items:center; justify-content:center;
    text-align:center; font-size:10px; font-weight:400; letter-spacing:normal;
    color:#f6f8fd; text-shadow:0 1px 2px rgba(0,0,0,.45);
  }
  /* 失败提示仍用红色，但不再是刺眼浅红 */
  .vbox .vph.err{color:#ffb3b3}
  /* 失败卡片上的「重试」：小、低调，但点得到 */
  .vbox .vretry{
    display:block; margin-top:8px; padding:3px 11px; border-radius:7px;
    border:1px solid rgba(255,180,180,.42); background:rgba(255,120,120,.12);
    color:#ffd2d2; font-size:10.5px; font-family:inherit; cursor:pointer;
    transition:.15s;
  }
  .vbox .vretry:hover{background:rgba(255,120,120,.24); border-color:rgba(255,180,180,.7)}
  body.light .vbox .vretry{border-color:rgba(190,40,40,.35); background:rgba(190,40,40,.07); color:#a32424}
  body.light .vbox .vretry:hover{background:rgba(190,40,40,.14)}
  .hbtn{
    position:absolute; right:6px; top:6px; z-index:4; height:21px; padding:0 7px;
    border-radius:99px; border:1px solid rgba(255,255,255,.2);
    background:rgba(12,12,16,.78); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
    color:#e4e4ec; font-size:10px; cursor:pointer; font-family:inherit;
    display:flex; align-items:center; gap:4px; transition:.15s; white-space:nowrap;
  }
  .hbtn:hover{background:rgba(255,255,255,.34); border-color:rgba(255,255,255,.42); color:#fff}
  .vbox-wrap{position:relative}
  /* 独立预览窗：从提示词卡片里拆出来，浮在卡片正上方居中，可单独拖动；
     不再有外框/底色/内边距，视频本身就是一块圆角画面，直接融进画布 */
  .pfloat{
    position:absolute; left:0; top:0; width:420px; z-index:4;
    padding:0; border:0; background:transparent; box-shadow:none;
    display:flex; flex-direction:column; gap:5px;
  }
  .pfloat.sel{z-index:5}      /* 选中的预览窗排在其他预览窗前面 */
  /* 记录面板翻到下方时会压到展开的卡片上；把预览窗临时抬到卡片（z-index:6）之上，
     否则面板被卡片盖住、点都点不到 */
  .pfloat.histopen{z-index:7}
  .pf-head{
    display:flex; align-items:center; gap:5px; height:15px; flex:0 0 auto;
    color:rgba(255,255,255,.34); font-size:10px; letter-spacing:.2px;
    cursor:grab; user-select:none; padding:0 1px; transition:color .15s;
  }
  .pfloat:hover .pf-head{color:rgba(255,255,255,.55)}
  .pf-head:active{cursor:grabbing}
  .pf-grip{
    width:8px; height:8px; flex:0 0 auto; opacity:.65;
    background-image:radial-gradient(currentColor 1px, transparent 1.1px);
    background-size:4px 4px; border-radius:2px;
  }
  .pf-tag{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:text}
  .pf-tag:hover{color:rgba(255,255,255,.82)}
  .pf-tag.named{color:rgba(255,255,255,.62)}
  .pfloat:hover .pf-tag.named{color:rgba(255,255,255,.92)}
  body.light .pf-tag:hover{color:rgba(28,28,40,.85)}
  body.light .pf-tag.named{color:rgba(28,28,40,.68)}
  /* 双击改名：浮在标签上的一格输入框。position:fixed，不参与画布缩放 */
  .renamer{
    position:fixed; z-index:72; display:flex; align-items:center; gap:1px;
    padding:5px 10px; min-height:33px; box-sizing:border-box; border-radius:9px;
    background:#23232c; border:1px solid rgba(255,255,255,.26);
    box-shadow:0 18px 44px rgba(0,0,0,.72);
    font-size:13px; line-height:1.5; color:var(--text);
  }
  .renamer .nr-in{
    flex:1 1 auto; min-width:0; width:100%; padding:0; margin:0;
    background:none; border:0; outline:0;
    font:inherit; color:inherit; letter-spacing:inherit;
  }
  .renamer .nr-in::selection{background:rgba(86,150,255,.5)}
  .renamer .nr-ext{flex:0 0 auto; color:var(--dim); user-select:none}
  body.light .renamer{background:#fff; border-color:rgba(20,20,30,.22);
    box-shadow:0 14px 34px rgba(20,20,40,.22)}
  /* 触屏上 16px 才不会被 iOS 自动放大整页 */
  @media (pointer:coarse){ .renamer .nr-in{font-size:16px} .renamer{min-height:38px} }
  /* 预览窗顶栏右端的下载：平时淡着，鼠标进窗就亮起来 */
  .pf-dl{
    margin-left:auto; flex:0 0 auto; width:16px; height:15px; padding:0;
    display:grid; place-items:center; border:0; border-radius:5px;
    background:transparent; color:inherit; cursor:pointer; opacity:.6;
    transition:.15s; font-family:inherit;
  }
  .pfloat:hover .pf-dl{opacity:1}
  .pf-dl:hover{background:rgba(255,255,255,.18); color:#fff}
  .pf-dl:active{transform:scale(.92)}
  body.light .pf-dl:hover{background:rgba(20,20,30,.1); color:#1c1c28}
  /* 画面本体：无边框，靠圆角 + 柔和投影浮在画布上 */
  .pfloat .vbox{
    max-height:none; border:0 !important; background:transparent !important;
    border-radius:15px; box-shadow:0 20px 60px rgba(0,0,0,.55);
  }
  .pfloat .vbox video{max-height:none; border-radius:15px}
  /* 有画面的视频要把内容区撑满：容器高度是 aspect-ratio 算出来的小数（420×16:9 = 236.25），
     video 按自身比例排出来是另一个小数，两个数一取整就差 1~2px —— 底部会露出一条容器底色，
     看着像「控制条没盖住视频」。height:100% 让视频严格等于容器高，误差全留在 video 自己的
     黑底里（object-fit:contain），不会露出画布。 */
  .pfloat .vbox video,
  .vbox.has-video video{height:100%}
  /* 图片节点的空框：1:1 / 9:16 按比例会撑到 420～746 高，靠顶边时整块跑出屏幕，
     这里给它一个上限（出图后由图片自身高度决定，见 .vbox.has-image） */
  .pfloat .vbox.is-img{max-height:340px; margin-left:auto; margin-right:auto}
  .pfloat .vbox.has-image{max-height:none}
  /* 出图后按图片本身的比例显示（不裁、不留黑边、不为了塞进 320 高被压扁） */
  .pfloat .vbox img.vimg{width:auto; max-width:100%; max-height:min(68vh,620px); background:transparent}
  /* 空预览框：还没生成也留一块跟比例一致的占位，中间一个播放标记 */
  .vempty{position:absolute; inset:0; display:grid; place-items:center}
  .vempty-ico{
    width:34px; height:34px; border-radius:10px; display:grid; place-items:center;
    background:rgba(255,255,255,.07); color:rgba(255,255,255,.6);
    box-shadow:0 0 0 1px rgba(255,255,255,.09) inset;
  }
  .pfloat .vbox.is-empty{
    background:rgba(255,255,255,.035) !important;
    box-shadow:0 0 0 1px rgba(255,255,255,.1) inset, 0 20px 56px rgba(0,0,0,.42);
  }
  body.light .pfloat .vbox.is-empty{
    background:rgba(20,20,30,.035) !important;
    box-shadow:0 0 0 1px rgba(20,20,30,.1) inset, 0 16px 40px rgba(20,20,40,.12);
  }
  body.light .vempty-ico{
    background:rgba(20,20,30,.06); color:rgba(28,28,40,.42);
    box-shadow:0 0 0 1px rgba(20,20,30,.08) inset;
  }
  .pfloat.sel .vbox{box-shadow:0 0 0 1px rgba(255,255,255,.3), 0 20px 60px rgba(0,0,0,.55)}
  .pfloat.moving .vbox{box-shadow:0 0 0 1px rgba(255,255,255,.3), 0 28px 76px rgba(0,0,0,.62)}
  /* 预览画面（含视频本体）按住就能拖走：按住时给一点下压反馈，光标变抓手 */
  .pfloat .pf-stage{cursor:grab}
  .pfloat .pf-stage video,.pfloat .pf-stage img{cursor:grab; -webkit-user-drag:none}
  .pfloat.moving .pf-stage,.pfloat.moving .pf-stage video{cursor:grabbing}
  .pfloat.pressing .vbox{
    box-shadow:0 0 0 1px rgba(255,255,255,.26), 0 14px 34px rgba(0,0,0,.5) !important;
    transition:box-shadow .16s ease;
  }
  body.pf-drag{cursor:grabbing; user-select:none}
  .pfloat .vbox-empty{
    height:auto; padding:11px 0; border:0 !important; background:transparent !important;
    color:rgba(255,255,255,.24) !important; font-size:10.5px; letter-spacing:.2px;
  }
  /* 记录面板往上弹，别盖住下面的提示词编辑区 */
  .pfloat .hist{top:auto; bottom:calc(100% + 8px)}
  /* 上面塞不下（节点贴着视口顶）就翻到下面去，别被裁掉 */
  .pfloat .hist.down{top:calc(100% + 8px); bottom:auto}
  .vbox-empty{height:34px; border-radius:11px; border:1px dashed rgba(255,255,255,.13); display:flex; align-items:center; justify-content:center; font-size:10.5px; color:var(--dim-2); background:rgba(255,255,255,.02)}

  /* 历史面板 */
  .hist{
    position:fixed; left:0; top:0; width:320px; z-index:88; display:none;
    /* 毛玻璃：底色压到五成，靠 blur + 顶部高光把下面的画面「磨」出来，
       不再是原来那层 97% 不透明的实心黑板 */
    background:
      linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,0) 42%),
      linear-gradient(180deg, rgba(34,34,44,.8), rgba(15,15,21,.88));
    -webkit-backdrop-filter:blur(30px) saturate(185%);
    backdrop-filter:blur(30px) saturate(185%);
    border:1px solid rgba(255,255,255,.15); border-radius:14px; padding:7px;
    box-shadow:0 22px 54px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.1);
    max-height:320px; overflow-y:auto; overscroll-behavior:contain;
  }
  /* 面板里的滚动条：跟画布其它滚动区同一套细胶囊，不要系统那条带箭头的粗白条 */
  .hist::-webkit-scrollbar{width:8px}
  .hist::-webkit-scrollbar-track{background:transparent; margin:6px 0}
  .hist::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.2); border-radius:99px;
    border:2px solid transparent; background-clip:padding-box;
  }
  .hist::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.34); background-clip:padding-box}
  @supports not (selector(::-webkit-scrollbar)){
    .hist{scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.24) transparent}
  }
  .hist.on{display:block; animation:histIn .16s ease-out}
  @keyframes histIn{from{opacity:0; transform:translateY(4px)} to{opacity:1; transform:none}}
  @media (prefers-reduced-motion:reduce){ .hist.on{animation:none} }
  .hist-head{display:flex; align-items:center; gap:6px; font-size:10.5px; color:var(--dim); padding:4px 5px 8px}
  .hist-head .grow{flex:1}
  .hit{display:flex; gap:8px; padding:6px; border-radius:9px; cursor:pointer; align-items:center; transition:.14s}
  .hit:hover{background:rgba(255,255,255,.08)}
  .hit.on{background:rgba(255,255,255,.09)}
  .hthumb{width:56px; height:32px; border-radius:6px; overflow:hidden; background:#0a0a0e; flex:0 0 auto; display:grid; place-items:center; font-size:9px; color:var(--dim-2); border:1px solid rgba(255,255,255,.08)}
  .hthumb video,.hthumb img{width:100%; height:100%; object-fit:cover; display:block; pointer-events:none}
  .hmeta{flex:1; min-width:0}
  .hmeta b{display:block; font-size:10.5px; color:#e0e0ea; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .hmeta span{font-size:9.5px; color:var(--dim-2); font-variant-numeric:tabular-nums}
  .hdel{flex:0 0 auto; width:18px; height:18px; border:0; border-radius:50%; background:rgba(255,95,95,.16); color:#ffb3b3; cursor:pointer; font-size:10px; display:grid; place-items:center; font-family:inherit}

  /* 拖拽连线 */
  #tempLink, .temp-link{fill:none; stroke:rgba(255,255,255,.95); stroke-width:2.2; stroke-dasharray:7 6; pointer-events:none}
  /* 多选批量出线：每股线用流动彩虹色，鼠标处一个发光小点收束 */
  #tempFan .temp-link{stroke:url(#lr); stroke-width:2.4; stroke-dasharray:none; opacity:.95}
  #tempFan circle.temp-hub{fill:#fff; stroke:rgba(255,255,255,.55); stroke-width:6; opacity:.9}
  /* 松手后钉住的「待接线」：虚线往前流 + 线头呼吸，和已连好的实线一眼区分
     （还停在这儿 = 正在等你从新建菜单里选一个节点接上去） */
  #tempFan.waiting .temp-link{stroke-dasharray:11 9; animation:ghostFlow .85s linear infinite}
  #tempFan.waiting circle.temp-hub{animation:ghostPulse 1.1s ease-in-out infinite}
  @keyframes ghostFlow{to{stroke-dashoffset:-20}}
  @keyframes ghostPulse{0%,100%{opacity:.55} 50%{opacity:1}}
  #board.linking{cursor:crosshair}
  .node.linktarget{border-color:rgba(255,255,255,.90) !important; box-shadow:0 0 0 3px rgba(255,255,255,0.13) !important}
  .dropzone{position:fixed; inset:0; z-index:200; display:none; place-items:center; pointer-events:none; background:rgba(6,8,16,.7); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px)}
  .dropzone.on{display:grid}
  .dropzone .dz{padding:26px 42px; border-radius:20px; border:2px dashed rgba(255,255,255,0.32); background:rgba(255,255,255,.06); color:#e4e4ec; font-size:14px; letter-spacing:.4px}

  /* 连进来的素材与上传的素材外观完全一致：不再挂「链 / 本地」角标，
     只在 title 里说明来源，删除时的行为照旧（连线素材是断开、上传素材是移除）。 */

  /* ============ 主页 / 画布 双视图 ============ */
  body.home-mode #app{display:none}
  body.app-mode #home{display:none}
  /* 首页要能滚：画布视图才是 overflow:hidden（否则项目一多、窗口一矮，下面的卡片直接被切掉且滚不动） */
  body.home-mode{overflow-y:auto; overflow-x:hidden}
  #home{display:flex; flex-direction:column; min-height:100vh}
  body.app-mode #home{display:none}
  #home .brand{font-size:14px}

  /* 主页顶栏 = 画布顶栏同一块玻璃：悬浮圆角条、同高、同描边、同模糊。
     主页要能滚，所以用 sticky（画布那边是 fixed）；top/margin 都用 12/14，
     两边的「离屏幕边缘距离」看起来才是一回事。 */
  .hbar{
    position:sticky; top:12px; z-index:20; height:50px; margin:12px 14px 0; padding:0 14px;
    flex:0 0 auto;
    display:flex; align-items:center; gap:12px;
    border:1px solid rgba(255,255,255,.11); border-radius:18px;
    background:rgba(24,24,30,.5);
    -webkit-backdrop-filter:blur(34px) saturate(180%); backdrop-filter:blur(34px) saturate(180%);
    box-shadow:0 12px 36px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.09);
  }
  .hbar .grow{flex:1}

  .hmain{width:100%; max-width:1180px; margin:0 auto; padding:14vh 24px 80px; flex:1}

  .hero{text-align:center; margin-bottom:52px}
  .hero h1{
    font-size:37px; font-weight:700; letter-spacing:.6px; line-height:1.28; margin-bottom:12px;
    background:linear-gradient(180deg,#ffffff,#a9bcff);
    -webkit-background-clip:text; background-clip:text; color:transparent;
  }
  .hero p{font-size:13.5px; color:var(--dim); margin-bottom:30px}

  .hacts{display:flex; gap:12px; justify-content:center; flex-wrap:wrap}
  .hnew{
    display:flex; align-items:center; gap:12px; padding:0 24px; height:64px;
    border-radius:18px; border:1px solid rgba(255,255,255,.16); cursor:pointer;
    background:linear-gradient(135deg,rgba(255,255,255,.20),rgba(255,255,255,.10));
    -webkit-backdrop-filter:blur(20px) saturate(180%); backdrop-filter:blur(20px) saturate(180%);
    color:#fff; font-family:inherit; transition:.18s;
    box-shadow:0 12px 34px rgba(255,255,255,.12), inset 0 1px 0 rgba(255,255,255,.18);
  }
  .hnew:hover{transform:translateY(-2px); box-shadow:0 18px 44px rgba(255,255,255,.20)}
  .hplus{
    width:34px; height:34px; border-radius:11px; display:grid; place-items:center;
    /* 深色主题下这块是白底，加号必须是深色，不然白底白字什么都看不见 */
    background:rgba(255,255,255,.92); color:#14141a; font-size:19px; font-weight:600;
  }
  .htxt{text-align:left}
  .htxt b{display:block; font-size:14.5px; font-weight:650}
  .htxt em{display:block; font-size:11px; color:rgba(255,255,255,.62); font-style:normal; margin-top:2px}

  .hq{
    width:152px; height:64px; padding:0 14px; border-radius:16px; cursor:pointer;
    border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.055);
    -webkit-backdrop-filter:blur(20px) saturate(180%); backdrop-filter:blur(20px) saturate(180%);
    color:#e6e6f0; font-family:inherit; text-align:left; transition:.18s;
    display:flex; flex-direction:column; justify-content:center; gap:3px;
  }
  .hq:hover{background:rgba(255,255,255,.11); transform:translateY(-2px); border-color:rgba(255,255,255,.2)}
  .hq b{font-size:12.5px; font-weight:600}
  .hq em{font-size:10px; color:var(--dim-2); font-style:normal}

  /* 我的画布 */
  .hsec-head{display:flex; align-items:center; gap:9px; margin-bottom:16px}
  .hsec-head h2{font-size:15px; font-weight:650; letter-spacing:.3px}
  .hcnt{font-size:11px; color:var(--dim-2); background:rgba(255,255,255,.07); padding:1px 7px; border-radius:99px}
  .hsec-head .grow{flex:1}

  .hgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(232px,1fr)); gap:14px}
  .pcard{
    position:relative; border-radius:16px; overflow:hidden; cursor:pointer;
    border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.05);
    -webkit-backdrop-filter:blur(22px) saturate(180%); backdrop-filter:blur(22px) saturate(180%);
    transition:.18s; box-shadow:0 8px 26px rgba(0,0,0,.28);
  }
  .pcard:hover{transform:translateY(-3px); border-color:rgba(255,255,255,.34); box-shadow:0 16px 40px rgba(0,0,0,.42)}
  .pcard:hover .pinfo b{color:#fff}
  .pcard:hover .pinfo b{color:#fff}
  .pthumb{position:relative; aspect-ratio:16/9; overflow:hidden;
    background:linear-gradient(135deg,rgba(255,255,255,.10),rgba(255,255,255,.05))}
  .pthumb img,.pthumb video{width:100%; height:100%; object-fit:cover; display:block}
  .pempty{
    width:100%; height:100%; display:grid; place-items:center; color:var(--dim-2); font-size:11px;
    background:linear-gradient(135deg,rgba(255,255,255,.08),rgba(255,255,255,.04));
  }
  .pinfo{padding:10px 12px 12px}
  .pinfo b{display:block; font-size:12.5px; color:#ececf4; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
  .pinfo span{font-size:10px; color:var(--dim-2)}

  .pmenu{position:absolute; right:6px; top:6px; z-index:2}
  .pmenu>button{
    width:24px; height:24px; border-radius:8px; border:1px solid rgba(255,255,255,.16);
    background:rgba(10,10,14,.7); color:#dcdce8; cursor:pointer; font-size:13px; line-height:1;
    display:grid; place-items:center; font-family:inherit;
    -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); opacity:0; transition:.15s;
  }
  .pcard:hover .pmenu>button{opacity:1}
  .pmenu .pm{
    position:absolute; right:0; top:28px; display:none; min-width:100px;
    background:rgba(30,30,38,.98); border:1px solid rgba(255,255,255,.16);
    border-radius:10px; padding:4px; box-shadow:0 14px 34px rgba(0,0,0,.6); z-index:3;
  }
  .pmenu .pm.on{display:block}
  .pmenu .pm button{
    display:block; width:100%; text-align:left; padding:6px 9px; border:0; border-radius:7px;
    background:transparent; color:#e2e2ee; font-size:11.5px; font-family:inherit; cursor:pointer;
  }
  .pmenu .pm button:hover{background:rgba(255,255,255,.1)}
  .pmenu .pm button.danger{color:#ffb3b3}
  .pmenu .pm button.danger:hover{background:rgba(255,95,95,.18)}

  .hempty{
    grid-column:1/-1; padding:48px 20px; text-align:center; border-radius:16px;
    border:1px dashed rgba(255,255,255,.14); color:var(--dim-2); font-size:12px;
  }
  .tbtn.back{width:30px; padding:0; justify-content:center; font-size:15px; flex:0 0 auto}

  /* ============================================================
     首页 · 生成 / 画布 双模式
     生成模式：一句提示词 + 图片/视频切换，直接开一块画布跑；
     画布模式：原样保留「新建画布 + 三个模板 + 我的画布」。
     ============================================================ */
  #home[data-mode="gen"] #hActs{display:none}
  #home[data-mode="canvas"] .hcomposer{display:none}
  #home[data-mode="gen"] #btnAllHist{display:flex}
  #home[data-mode="canvas"] #btnAllHist{display:none}

  /* 生成 / 画布 切换胶囊：和画布里的模式胶囊同一套手感 */
  .hseg{
    display:inline-flex; gap:3px; padding:3px; margin:0 auto 26px;
    border-radius:99px; border:1px solid rgba(255,255,255,.13);
    background:rgba(255,255,255,.055);
    -webkit-backdrop-filter:blur(20px) saturate(180%); backdrop-filter:blur(20px) saturate(180%);
  }
  .hseg-b{
    height:33px; min-width:112px; padding:0 24px; border:0; border-radius:99px;
    background:transparent; color:var(--dim); font-size:12.5px; font-weight:500;
    font-family:inherit; cursor:pointer; transition:background .18s, color .18s, box-shadow .18s;
  }
  .hseg-b:hover{color:#fff}
  .hseg-b.on{
    background:rgba(255,255,255,.94); color:#0b0b0f; font-weight:650;
    box-shadow:0 6px 18px rgba(0,0,0,.34);
  }

  /* ---- 对话式生成条 ---- */
  .hcomposer{max-width:960px; margin:0 auto}
  .hc{
    padding:14px 14px 11px; border-radius:20px; text-align:left;
    border:1px solid rgba(255,255,255,.13);
    background:linear-gradient(180deg,rgba(34,34,42,.86),rgba(20,20,26,.84));
    -webkit-backdrop-filter:blur(30px) saturate(180%); backdrop-filter:blur(30px) saturate(180%);
    box-shadow:0 26px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.1);
    transition:border-color .18s, box-shadow .18s;
  }
  .hc:focus-within{border-color:rgba(255,255,255,.28); box-shadow:0 26px 70px rgba(0,0,0,.5), 0 0 0 3px rgba(255,255,255,.05), inset 0 1px 0 rgba(255,255,255,.12)}
  .hc.dragover{border-color:rgba(255,255,255,.5); box-shadow:0 0 0 3px rgba(255,255,255,.14), 0 26px 70px rgba(0,0,0,.5)}
  .hc-top{display:flex; gap:12px; align-items:flex-start}
  /* 素材堆：没展开时只占 52px 见方（一摞照片），鼠标压上去才向右展开成一行 ——
     以前是一条横排缩略图，放三张就把右边的提示词编辑区挤掉 200 多像素。 */
  .hc-refs{
    position:relative; flex:0 0 auto; width:52px; height:52px;
    margin:1px 2px 0 0; z-index:6;
  }
  .hc-refs:hover, .hc-refs.dragging{z-index:40}
  /* 展开时垫一块底：中间那些缝不至于把下面的正文透出来 */
  .hc-refs::before{
    content:''; position:absolute; left:-10px; top:-9px; z-index:0;
    width:calc(var(--n,0) * 60px + 62px); height:70px; border-radius:15px;
    background:linear-gradient(180deg,rgba(32,32,40,.97),rgba(18,18,24,.97));
    border:1px solid rgba(255,255,255,.13);
    box-shadow:0 18px 44px rgba(0,0,0,.55);
    opacity:0; pointer-events:none; transition:opacity .16s;
  }
  .hc-refs:hover::before, .hc-refs.dragging::before{opacity:1}
  /* 展开后铺一块看不见的「桥」：把卡片之间那 8px 的缝、末尾到加号那 20 多像素的死区全盖住。
     它只在**已经展开**时才存在（:hover / .dragging 才画出来），所以不会自己触发展开；
     z-index 压在卡片（1~20）和加号（19）下面，点击照旧落在卡片本身。
     没有它的时候：指针一走进缝里 :hover 就断，整摞立刻收回；收回后卡片又滑回指针底下 →
     再次展开 —— 看上去就是「左右横移一直在抖」，想点最右边的加号也会被半路收回去。 */
  .hc-refs:hover::after, .hc-refs.dragging::after{
    content:''; position:absolute; left:-10px; top:-9px; z-index:0;
    width:calc(var(--n,0) * 60px + 50px); height:70px;
  }
  .hc-refs.is-empty::after{display:none}
  .hc-tile{
    position:absolute; left:0; top:0; z-index:calc(var(--i,0) + 1);
    width:52px; height:52px; border-radius:10px; overflow:hidden; background:#0c0c10;
    box-shadow:0 0 0 2px rgba(244,244,250,.9), 0 8px 18px rgba(0,0,0,.46);
    transform:translate(var(--ox,0),var(--oy,0)) rotate(var(--r,0deg));
    transition:transform .26s cubic-bezier(.22,.82,.28,1), box-shadow .2s;
    will-change:transform;
  }
  .hc-refs:hover .hc-tile, .hc-refs.dragging .hc-tile{
    z-index:20; transform:translateX(calc(var(--i,0) * 60px)) rotate(0deg);
    box-shadow:0 0 0 2px rgba(246,246,252,.96), 0 12px 26px rgba(0,0,0,.55);
  }
  /* 长按拖动：被拎起来的那张脱离排位、跟着指针走；松手前不改数据，只改 --i */
  .hc-refs:hover .hc-tile{cursor:grab}
  .hc-tile.drag{
    transition:none !important; cursor:grabbing;
    box-shadow:0 0 0 2px rgba(255,255,255,.99), 0 0 0 4px rgba(255,255,255,.34), 0 26px 48px rgba(0,0,0,.72);
  }
  /* 展开态那条 `.hc-refs:hover .hc-tile{z-index:20}` 比 `.hc-tile.drag` 权重大，
     被拎起来的那张要单独抬到最上面，否则会钻到旁边那张底下 */
  .hc-refs.dragging .hc-tile.drag{z-index:60}
  .hc-tile.drag .x{opacity:0}
  .hc-tile img{width:100%; height:100%; object-fit:cover; display:block; -webkit-user-drag:none; user-select:none}
  .hc-tile .au{width:100%; height:100%; display:grid; place-items:center; color:#cfd4e4; font-size:16px; background:rgba(255,255,255,.06)}
  .hc-tile .x{
    position:absolute; right:1px; top:1px; width:15px; height:15px; border:0; border-radius:50%;
    background:rgba(8,8,12,.72); color:#fff; font-size:10px; line-height:1; cursor:pointer;
    display:grid; place-items:center; font-family:inherit; opacity:0; transition:.14s;
    -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
  }
  .hc-tile:hover .x{opacity:1}
  /* 加号：有素材时是压在角落的一颗小圆钮，展开后跟着排到队尾 */
  .hc-add{
    position:absolute; left:0; top:0; z-index:19; padding:0; cursor:pointer;
    width:26px; height:26px; border-radius:50%;
    border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.16);
    color:#fff; font-size:15px; line-height:1; font-family:inherit;
    display:flex; align-items:center; justify-content:center;
    -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
    transform:translate(33px,34px);
    transition:transform .26s cubic-bezier(.22,.82,.28,1), background .16s, border-color .16s;
  }
  .hc-add:hover{background:rgba(255,255,255,.28); border-color:rgba(255,255,255,.4)}
  .hc-refs:hover .hc-add, .hc-refs.dragging .hc-add{transform:translate(calc(var(--i,0) * 60px + 13px),13px)}
  .hc-add em{font-size:9px; font-style:normal; letter-spacing:.2px}
  /* 一个素材都没有：还是原来那颗虚线「＋参考」方片 */
  .hc-refs.is-empty::before{display:none}
  .hc-refs.is-empty .hc-add,
  .hc-refs.is-empty:hover .hc-add{
    width:52px; height:52px; border-radius:11px; gap:2px;
    border:1px dashed rgba(255,255,255,.24); background:rgba(255,255,255,.04);
    color:var(--dim); font-size:16px; flex-direction:column; justify-content:center;
    transform:none; -webkit-backdrop-filter:none; backdrop-filter:none;
  }
  .hc-refs.is-empty .hc-add:hover{color:#fff; border-color:rgba(255,255,255,.44); background:rgba(255,255,255,.09)}
  .hc-input{flex:1; min-width:0}
  .hc-ed .ptext-wrap{display:flex; flex-direction:column}
  /* 提示词编辑区：和画布卡片里那块富文本同一个东西（@ 引用、chip、放大都用一套），
     只把壳抹平 —— 高度给到 104，写两三行再提交不用先放大。 */
  #hcBox .ptext{
    background:transparent; border:0; border-radius:0; box-shadow:none;
    padding:7px 42px 6px 2px; min-height:104px; max-height:280px;
    font-size:13.5px; line-height:1.72;
  }
  #hcBox .ptext:focus{border:0; box-shadow:none; background:transparent}
  /* 右上角那颗放大：卡片里是「hover 才浮出来」的弱按钮，首页这块要一眼看得见 */
  #hcBox .expand-btn{
    right:6px; top:5px; width:26px; height:26px; font-size:12.5px; border-radius:8px;
    background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.12);
    color:rgba(235,235,245,.66); opacity:.95;
  }
  #hcBox .expand-btn:hover{background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.26); color:#fff}
  body.light #hcBox .expand-btn{
    background:rgba(20,20,30,.05); border-color:rgba(20,20,30,.1); color:rgba(28,28,40,.55);
  }
  body.light #hcBox .expand-btn:hover{background:rgba(20,20,30,.1); border-color:rgba(20,20,30,.2); color:#111}
  /* 搬进放大窗之后交给面板：铺满整个编辑区，字号和画布那扇窗一致 */
  #bigBody #hcText{
    flex:1; min-height:0; max-height:none; font-size:14px; line-height:1.9;
    padding:18px 34px 18px 20px; border-radius:12px;
  }
  /* 时长跟模型 / 参数同一行：左边一条竖细分隔线，滑杆收窄到 160px */
  .hc-dur{display:flex; align-items:center; gap:7px; flex:0 0 auto;
    margin-left:2px; padding-left:10px; border-left:1px solid rgba(255,255,255,.1)}
  .hc-dur .dur-range{flex:0 0 160px; width:160px; height:18px}
  .hc-dur .dur-val{min-width:26px}
  .hc-dur[hidden]{display:none}
  .hc-bar{display:flex; align-items:center; gap:7px; margin-top:9px; flex-wrap:wrap; row-gap:8px}
  .hc-bar .grow{flex:1}
  /* 首页这条比节点宽，模型名和参数摘要可以摊开写，不必像卡片里那样截断 */
  .hc .ctl-sel.model{max-width:180px; min-width:118px; height:30px; font-size:11.5px}
  .hc .ctl-sel.params{max-width:230px; height:30px; font-size:11.5px}
  /* 图片 / 视频 切换：一颗小胶囊，放最前面（和画布里的 .modes 同一套视觉） */
  .hc-kind{
    display:flex; gap:2px; padding:2px; flex:0 0 auto; border-radius:9px;
    background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.1);
  }
  .hc-kind button{
    height:26px; padding:0 12px; border:0; border-radius:7px; background:transparent;
    color:var(--dim); font-size:11.5px; font-family:inherit; cursor:pointer;
    white-space:nowrap; transition:background .15s, color .15s;
  }
  .hc-kind button:hover{color:#fff}
  .hc-kind button.on{background:rgba(255,255,255,.92); color:#0b0b0f; font-weight:650}

  /* ---- 广告位：自动翻滚，中间一张放大、两侧露边 ---- */
  .hads{
    position:relative; height:206px; margin:0 0 46px;
    -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 5%,#000 95%,transparent 100%);
    mask-image:linear-gradient(90deg,transparent 0,#000 5%,#000 95%,transparent 100%);
  }
  .had-stage{position:absolute; inset:0 0 26px}
  .had{
    position:absolute; left:50%; top:0; width:min(420px,37%); height:100%;
    border-radius:16px; overflow:hidden; color:#fff; cursor:pointer;
    border:1px solid rgba(255,255,255,.13);
    box-shadow:0 18px 46px rgba(0,0,0,.46);
    opacity:0; pointer-events:none;
    transform:translate(-50%,0) scale(.72);
    transition:transform .62s cubic-bezier(.22,.82,.28,1), opacity .42s ease;
    will-change:transform, opacity;
    -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
  }
  .had.on{
    opacity:1; pointer-events:auto; z-index:3;
    transform:translate(-50%,0) scale(1);
    box-shadow:0 24px 60px rgba(0,0,0,.56);
  }
  .had.pv, .had.nx{opacity:.5; z-index:2; pointer-events:auto}
  .had.pv{transform:translate(calc(-50% - 90%),0) scale(.8)}
  .had.nx{transform:translate(calc(-50% + 90%),0) scale(.8)}
  .had.pv:hover, .had.nx:hover{opacity:.82}
  .had::after{
    content:""; position:absolute; inset:0; pointer-events:none;
    background:radial-gradient(110% 130% at 84% 12%, rgba(255,255,255,.20), transparent 58%);
  }
  .had.has-img::after{
    z-index:1;
    background:linear-gradient(180deg, rgba(6,8,14,.06) 0%, rgba(6,8,14,.16) 36%, rgba(6,8,14,.68) 76%, rgba(6,8,14,.86) 100%);
  }
  .had-bg{
    position:absolute; inset:0; width:100%; height:100%;
    object-fit:cover; object-position:center; pointer-events:none; z-index:0;
    transition:transform .7s cubic-bezier(.22,.82,.28,1);
  }
  .had.on:hover .had-bg{transform:scale(1.04)}
  /* 卡片里的装饰光斑：纯 CSS，不依赖任何图片，离线也不会空一块 */
  .had .glow{position:absolute; border-radius:50%; filter:blur(26px); opacity:.55; pointer-events:none}
  .had-in{position:absolute; left:22px; right:22px; bottom:18px; z-index:2}
  .had.has-img .had-in{text-shadow:0 2px 12px rgba(0,0,0,.55)}
  .had-tag{display:block; font-size:9.5px; letter-spacing:1.4px; opacity:.72; margin-bottom:7px}
  .had.has-img .had-tag{opacity:.88}
  .had b{display:block; font-size:clamp(17px,2vw,24px); font-weight:750; letter-spacing:.3px; line-height:1.2}
  .had em{display:block; font-size:11.5px; font-style:normal; opacity:.74; margin-top:7px}
  .had.has-img em{opacity:.88}
  .had .go{
    position:absolute; right:16px; top:14px; z-index:2;
    font-size:10.5px; padding:4px 9px; border-radius:99px;
    background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.22);
    -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  }
  .had.has-img .go{background:rgba(10,12,18,.42); border-color:rgba(255,255,255,.28)}
  .haddots{position:absolute; left:0; right:0; bottom:0; display:flex; justify-content:center; gap:6px}
  .haddots button{
    width:6px; height:6px; padding:0; border:0; border-radius:99px; cursor:pointer;
    background:rgba(255,255,255,.24); transition:width .25s, background .25s;
  }
  .haddots button.on{width:18px; background:rgba(255,255,255,.86)}

  /* ---- 生成历史卡片：沿用画布卡片的壳，只补一个类型角标 ---- */
  .gbadge{
    position:absolute; left:8px; bottom:8px; z-index:2;
    display:inline-flex; align-items:center; gap:4px;
    height:18px; padding:0 7px; border-radius:99px; font-size:9.5px; letter-spacing:.2px;
    background:rgba(8,8,12,.62); color:#ececf4; border:1px solid rgba(255,255,255,.18);
    -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  }
  .gbadge i{width:5px; height:5px; border-radius:50%; background:#8fd4ff; display:block}
  .gbadge.img i{background:#ffd479}
  body.light .gbadge{background:rgba(255,255,255,.86); color:#1b1b21; border-color:rgba(20,20,30,.12)}

  /* 还在跑的生成记录：缩略图位置直接铺画布那块预览框 ——
     同一套水波进度、同一句居中状态字（连排队时的转圈也一样），
     不再另起一套「大转圈 + 底部细条」。浅色主题跟着 body.light .vbox 走，不用重复写。 */
  .gcard.running{cursor:default}
  .gcard .pthumb > .vbox.gwave{
    position:absolute; inset:0; width:100%; height:100%;
    max-height:none; aspect-ratio:auto; border:0; border-radius:0;
  }
  /* 失败：没有进度可言，只留一层暗底把红字托起来 */
  .gcard .gw{
    position:absolute; inset:0; display:flex; flex-direction:column;
    align-items:center; justify-content:center; gap:8px;
    background:linear-gradient(135deg,rgba(72,90,146,.34),rgba(24,26,38,.92));
  }
  .gcard .gtxt{font-size:10.5px; color:#cfd4e4; letter-spacing:.2px; font-variant-numeric:tabular-nums}
  .gcard .gbadge.err i{background:#ff8f8f}
  body.light .gcard .gw{background:linear-gradient(135deg,rgba(198,212,244,.62),rgba(242,244,250,.95))}
  body.light .gcard .gtxt{color:#3a3a48}

  .linkbox{display:flex; gap:5px; align-items:center; margin-top:6px}
  .linkbox input{
    flex:1; min-width:0; height:28px; border-radius:8px; font-family:inherit;
    background:var(--field); border:1px solid var(--line); color:var(--text);
    font-size:10.5px; padding:0 8px; outline:0; transition:.15s;
  }
  .linkbox input:focus{border-color:rgba(255,255,255,.42); box-shadow:0 0 0 3px rgba(255,255,255,.06)}
  .linkbox .lbx{
    flex:0 0 auto; width:24px; height:24px; border:0; border-radius:50%;
    background:rgba(255,255,255,.09); color:var(--dim); cursor:pointer;
    font-size:12px; line-height:1; font-family:inherit;
  }
  .linkbox .lbx:hover{background:rgba(255,95,95,.2); color:#ffb3b3}

  /* ============ 首页生成记录的预览（只放这一条，不牵出画布的记录） ============ */
  #ghModal .ghm{
    position:relative;
    width:min(920px,94vw); max-height:88vh; display:flex; flex-direction:column;
    background:var(--node); border:1px solid var(--line-2); border-radius:18px;
    box-shadow:0 30px 80px rgba(0,0,0,.65); overflow:hidden;
  }
  .ghm-stage{
    position:relative; flex:1; min-height:0; display:grid; place-items:center;
    padding:14px 14px 0; background:rgba(0,0,0,.34);
  }
  .ghm-stage img,.ghm-stage video{
    max-width:100%; max-height:calc(88vh - 124px); display:block; border-radius:12px; background:#000;
  }
  .ghm-x{
    position:absolute; right:12px; top:12px; z-index:3;
    width:28px; height:28px; border-radius:50%; cursor:pointer; font-family:inherit;
    border:1px solid rgba(255,255,255,.18); background:rgba(10,10,14,.66); color:#e6e6f0;
    font-size:15px; line-height:1; display:grid; place-items:center;
    -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  }
  .ghm-x:hover{background:rgba(255,255,255,.16); color:#fff}
  .ghm-foot{display:flex; align-items:center; gap:10px; padding:11px 15px}
  .ghm-foot b{
    font-size:12.5px; font-weight:600; color:#ececf4; max-width:54%;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .ghm-foot span{font-size:11px; color:var(--dim-2); white-space:nowrap}
  .ghm-foot .grow{flex:1}
  .ghm-foot .tbtn{text-decoration:none; display:inline-flex; align-items:center; height:26px}
  body.light .ghm-foot b{color:#17171f}
  body.light .ghm-x{background:rgba(255,255,255,.86); color:#1b1b21; border-color:rgba(20,20,30,.14)}

  /* ============ 生成记录弹窗 ============ */
  /* 模式切换：浮在左侧舞台顶部居中，不占排版高度 */
  .gal-left{position:relative}
  .gal-seg{
    position:absolute; top:14px; left:50%; transform:translateX(-50%); z-index:4;
    display:flex; gap:2px; padding:3px; border-radius:99px;
    background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.13);
    -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px);
    box-shadow:0 6px 22px rgba(0,0,0,.42);
  }
  .gseg-b{
    height:26px; padding:0 15px; border:0; border-radius:99px; background:transparent;
    color:var(--dim); font-size:11.5px; font-weight:500; cursor:pointer;
    font-family:inherit; white-space:nowrap;
    transition:background .15s, color .15s;
  }
  .gseg-b:hover{color:#fff}
  .gseg-b.on{background:rgba(255,255,255,.93); color:#0b0b0f; font-weight:600}
  /* 类型切换：贴在面板左缘、竖向排（视频 / 图片），把两类结果彻底分流。
     竖着放是为了不跟顶部的「当前画布 / 所有画布」抢位置，也不占列表宽度。 */
  .gal-modes{
    position:absolute; left:12px; top:50%; transform:translateY(-50%); z-index:5;
    display:flex; flex-direction:column; gap:2px; padding:3px; border-radius:99px;
    background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.13);
    -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px);
    box-shadow:0 6px 22px rgba(0,0,0,.42);
  }
  .gmode-b{
    width:42px; height:46px; border:0; border-radius:99px; background:transparent;
    color:var(--dim); font-size:10.5px; font-weight:500; cursor:pointer; font-family:inherit;
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
    transition:background .15s, color .15s; padding:0;
  }
  .gmode-b svg{display:block; opacity:.9}
  .gmode-b:hover{color:#fff}
  .gmode-b.on{background:rgba(255,255,255,.93); color:#0b0b0f; font-weight:600}
  .gmode-b.on svg{opacity:1}
  .gal-panel{
    width:min(1260px,96vw); height:min(780px,92vh); display:flex; overflow:hidden;
    background:rgba(23,23,28,.97);
    -webkit-backdrop-filter:blur(46px) saturate(180%); backdrop-filter:blur(46px) saturate(180%);
    border:1px solid rgba(255,255,255,.14); border-radius:16px;
    box-shadow:0 30px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.08);
  }
  .gal-left{flex:1; min-width:0; display:flex; flex-direction:column; background:#07070a}
  /* 舞台是可伸缩的一块：网格行必须是 minmax(0,1fr)，
     否则隐式行会按内容撑高，max-height:100% 就形同虚设，
     图片/视频会一路长到缩略图条底下（画面糊在「历史生成记录」那条线上）。
     左侧留出 72px 给竖排的类型切换胶囊。 */
  .gal-stage{
    flex:1; min-height:0; display:grid; position:relative;
    grid-template:minmax(0,1fr) / minmax(0,1fr);
    place-items:center; padding:56px 20px 16px 72px; overflow:hidden;
  }
  .gal-stage video{max-width:100%; max-height:100%; border-radius:10px; display:block; background:#000}
  .gal-stage img.gal-img{max-width:100%; max-height:100%; border-radius:10px; display:block; object-fit:contain}
  .gal-empty{color:var(--dim-2); font-size:12px}
  .gal-fail{
    color:#ffb3b3; font-size:11.5px; text-align:center; padding:24px;
    max-width:540px; line-height:1.9; user-select:text; word-break:break-word;
  }
  .gal-strip{
    flex:0 0 auto; display:flex; gap:8px; padding:10px 14px 14px 72px;
    overflow-x:auto; border-top:1px solid rgba(255,255,255,.07);
  }
  .gal-strip::-webkit-scrollbar{height:6px}
  .gal-strip::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16); border-radius:99px}
  .gthumb{
    position:relative; flex:0 0 auto; width:92px; height:56px; border-radius:8px;
    overflow:hidden; cursor:pointer; border:1px solid rgba(255,255,255,.12);
    background:#101014; transition:.15s;
  }
  .gthumb:hover{border-color:rgba(255,255,255,.42)}
  .gthumb.on{border-color:#fff; box-shadow:0 0 0 2px rgba(255,255,255,.2)}
  .gthumb video,.gthumb img{width:100%; height:100%; object-fit:cover; display:block; pointer-events:none}
  /* 新查回来的记录：从缩略图条左端「挤」进来 —— 宽度从 0 展开，把老缩略图整体往右推，
     同时淡入 + 轻微右移收位，能一眼看出「刚多出来这几条」，而不是整条刷一遍。 */
  .gthumb.in-new{animation:gthumbIn .46s cubic-bezier(.2,.86,.24,1) both}
  @keyframes gthumbIn{
    0%{opacity:0; flex-basis:0; width:0; padding:0; transform:translateX(-12px) scale(.94)}
    55%{opacity:1}
    100%{opacity:1; flex-basis:92px; width:92px; transform:none}
  }
  @media (prefers-reduced-motion:reduce){ .gthumb.in-new{animation:none} }
  .gthumb .gtag{
    position:absolute; left:3px; bottom:3px; font-size:8px; line-height:1.3;
    padding:1px 3px; border-radius:3px; background:rgba(0,0,0,.72); color:#e2e2ea;
  }
  /* 生成失败的缩略图：不再是一块纯黑，给灰白「失败」字样 */
  .gthumb.faild{border-style:dashed; border-color:rgba(255,255,255,.17); background:#15151a}
  .gthumb .gfail{
    position:absolute; inset:0; display:grid; place-items:center;
    color:rgba(228,228,238,.62); font-size:10.5px; letter-spacing:.6px;
  }
  /* 缩略图右上角的删除：鼠标进缩略图才出现，点了就从记录里删掉（失败的记录清理起来最方便） */
  .gthumb .gdel{
    position:absolute; right:3px; top:3px; z-index:2;
    width:16px; height:16px; padding:0; border:0; border-radius:5px;
    display:grid; place-items:center; cursor:pointer; font-family:inherit;
    background:rgba(12,12,17,.66); color:rgba(255,255,255,.86);
    -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
    opacity:0; transform:translateY(-3px) scale(.9); transition:.14s;
  }
  .gthumb:hover .gdel, .gthumb:focus-within .gdel{opacity:1; transform:none}
  .gthumb .gdel:hover{background:rgba(255,86,86,.92); color:#fff}
  body.light .gthumb .gdel{background:rgba(255,255,255,.82); color:#2a2a36; box-shadow:0 1px 4px rgba(20,20,40,.18)}
  body.light .gthumb .gdel:hover{background:#e5484d; color:#fff}

  .gal-info{
    flex:0 0 348px; display:flex; flex-direction:column;
    border-left:1px solid rgba(255,255,255,.1);
    background:rgba(255,255,255,.02);
  }
  .gal-head{
    display:flex; align-items:center; gap:8px; padding:14px 16px 10px;
    font-size:12.5px; font-weight:600; color:#f0f0f5;
  }
  .gal-head .grow{flex:1}
  .gal-sync{
    display:inline-flex; align-items:center; gap:5px; margin-left:8px;
    color:rgba(126,172,255,.78); font-size:10px; font-weight:400;
  }
  .gal-sync::before{
    content:""; width:5px; height:5px; border-radius:50%; background:currentColor;
    animation:csyncPulse 1.05s ease-in-out infinite;
  }
  .gal-sync[hidden]{display:none}
  body.light .gal-sync{color:rgba(46,110,220,.8)}
  .gal-x{
    width:24px; height:24px; border:0; border-radius:7px; background:transparent;
    color:var(--dim); cursor:pointer; font-size:16px; line-height:1;
    font-family:inherit; display:grid; place-items:center;
  }
  .gal-x:hover{background:rgba(255,255,255,.12); color:#fff}
  .gal-body{
    flex:1; min-height:0; overflow-y:auto; padding:0 16px 16px;
    display:flex; flex-direction:column; gap:14px;
  }
  .gal-body::-webkit-scrollbar{width:6px}
  .gal-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16); border-radius:99px}
  .gsec{display:flex; flex-direction:column; gap:7px}
  .gsec-t{font-size:10px; color:var(--dim-2); letter-spacing:.6px}
  .gtime{font-size:11.5px; color:#e8e8f0; user-select:text}
  body.light .gtime{color:#2a2a34}
  .gsec-t .ghint{
    margin-left:6px; letter-spacing:.2px; font-size:9.5px; color:rgba(255,255,255,.3);
  }
  body.light .gsec-t .ghint{color:rgba(28,28,40,.34)}
  .kv{display:grid; grid-template-columns:56px 1fr; gap:5px 10px; font-size:11.5px; line-height:1.65}
  .kv dt{color:var(--dim-2)}
  .kv dd{color:#e8e8f0; word-break:break-word; user-select:text}
  .grefs{display:flex; gap:6px; flex-wrap:wrap}
  .gref{
    position:relative; width:46px; height:46px; border-radius:7px; overflow:hidden;
    border:1px solid rgba(255,255,255,.14); background:#121216;
    display:grid; place-items:center; font-size:9px; color:var(--dim-2);
    transition:border-color .15s, transform .15s;
  }
  .gref img{width:100%; height:100%; object-fit:cover; display:block}
  /* 悬停：跟素材轨一个手感 —— 亮一下边，鼠标移上去就有完整缩略图 / 播放器 */
  .gref[data-peek]{cursor:default}
  .gref[data-peek]:hover{border-color:rgba(255,255,255,.44); transform:translateY(-1px)}
  /* 音频参考：一块迷你波形片，下面压一条「音频 1」的角标 */
  .gref.aud{
    background:linear-gradient(160deg, rgba(126,172,255,.18), rgba(126,172,255,.06));
    border-color:rgba(126,172,255,.26); color:rgba(226,238,255,.9);
  }
  .gref.aud:hover{border-color:rgba(126,172,255,.62)}
  .gref.aud .gwave{display:flex; align-items:flex-end; gap:1.5px; height:15px}
  .gref.aud .gwave i{
    display:block; width:2px; border-radius:1px; background:currentColor; opacity:.85;
  }
  .gref .glab{
    position:absolute; left:0; right:0; bottom:0; padding:1px 0 2px; text-align:center;
    font-size:7.5px; letter-spacing:.2px; line-height:1.3; color:#dfe6f5;
    background:linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.72));
  }
  .gref.vid{background:rgba(255,255,255,.06)}
  /* 链接失效 / 读不到图：虚线框 + 灰字，别留一块黑 */
  .gref.off, .gref.off[data-peek]{border-style:dashed; opacity:.62; cursor:default}
  .gref .gplay{
    position:absolute; inset:0; display:grid; place-items:center; font-size:13px;
    color:rgba(255,255,255,.82); pointer-events:none;
  }
  .gprompt{
    background:rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.1);
    border-radius:9px; padding:9px 10px; font-size:11px; line-height:1.85;
    color:#dcdce6; white-space:pre-wrap; word-break:break-word;
    max-height:190px; overflow-y:auto; user-select:text;
  }
  .gprompt::-webkit-scrollbar{width:5px}
  .gprompt::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16); border-radius:99px}
  .gcopy{
    align-self:flex-start; height:24px; padding:0 9px; border-radius:7px;
    border:1px solid rgba(255,255,255,.16); background:transparent;
    color:var(--dim); font-size:10.5px; cursor:pointer; font-family:inherit;
    transition:.15s;
  }
  .gcopy:hover{border-color:rgba(255,255,255,.42); color:#fff}
  .gal-dl{
    height:36px; border-radius:9px; display:flex; align-items:center; justify-content:center;
    gap:7px; text-decoration:none; font-size:12px; font-weight:600; width:100%;
    background:#fff; color:#0b0b0f; transition:.15s; border:0;
    font-family:inherit; cursor:pointer;
  }
  .gal-dl:hover{background:#e2e2ea}
  .gal-dl:disabled{opacity:.62; cursor:default}
  .gal-dl.off{background:transparent; border:1px dashed rgba(255,255,255,.2); color:var(--dim-2); pointer-events:none}
  .gal-dl-note{
    margin:0 0 8px; font-size:10.5px; line-height:1.5; color:rgba(126,172,255,.82);
  }
  body.light .gal-dl-note{color:rgba(40,86,180,.9)}
  /* 舞台左下角：本地副本还没转好时的提示，不挡控制条 */
  .gal-hint{
    position:absolute; left:12px; bottom:52px; z-index:2; pointer-events:none;
    padding:4px 9px; border-radius:999px; font-size:10.5px;
    color:rgba(255,255,255,.86); background:rgba(12,12,16,.62);
    -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
    border:1px solid rgba(255,255,255,.12);
  }

  /* ============ 生成消费记录（点余额胶囊打开） ============ */
  .cost-panel{
    width:min(780px,94vw); height:auto; max-height:min(680px,90vh);
    display:flex; flex-direction:column;
    overflow:hidden; background:rgba(23,23,28,.97);
    -webkit-backdrop-filter:blur(46px) saturate(180%); backdrop-filter:blur(46px) saturate(180%);
    border:1px solid rgba(255,255,255,.14); border-radius:16px;
    box-shadow:0 30px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.08);
  }
  .cost-head{display:flex; align-items:center; gap:10px; padding:15px 18px 12px}
  .cost-title{font-size:13px; font-weight:600; color:#f0f0f5}
  .cost-sub{font-size:11px; color:var(--dim-2)}
  .cost-sub .cost-split{color:rgba(255,255,255,.34); margin-left:2px}
  body.light .cost-sub .cost-split{color:rgba(28,28,40,.4)}
  .cost-sub .csync{
    display:inline-flex; align-items:center; gap:5px; margin-left:6px;
    color:rgba(126,172,255,.78); font-size:10.5px;
  }
  .cost-sub .csync::before{
    content:""; width:5px; height:5px; border-radius:50%; background:currentColor;
    animation:csyncPulse 1.05s ease-in-out infinite;
  }
  @keyframes csyncPulse{ 0%,100%{opacity:.25; transform:scale(.8)} 50%{opacity:1; transform:scale(1)} }
  body.light .cost-sub .csync{color:rgba(46,110,220,.8)}
  .cost-head .grow{flex:1}
  .cost-sum{display:flex; gap:30px; padding:0 18px 15px; border-bottom:1px solid rgba(255,255,255,.08)}
  .cost-sum .cs b{
    display:block; font-size:20px; font-weight:650; color:#fff;
    letter-spacing:.2px; font-variant-numeric:tabular-nums; line-height:1.25;
  }
  .cost-sum .cs span{font-size:10px; color:var(--dim-2); letter-spacing:.5px}
  .cost-list{flex:1 1 auto; min-height:96px; max-height:min(440px,62vh);
    overflow-y:auto; padding:8px 12px 14px}
  .cost-list::-webkit-scrollbar{width:7px}
  .cost-list::-webkit-scrollbar-track{background:transparent}
  .cost-list::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16); border-radius:99px}
  .cost-list::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.28)}
  .crow{
    display:flex; align-items:center; gap:11px; padding:9px 9px; border-radius:10px;
    cursor:pointer; transition:background .13s;
  }
  .crow:hover{background:rgba(255,255,255,.055)}
  /* 新记录从上方挤进来：旧记录原地下移，新的一条自上而下展开 + 淡入，
     再闪一下左侧的高亮条，让人一眼看到"刚多出来一条"，而不是整屏重刷。 */
  .crow.is-new{animation:crowIn .46s cubic-bezier(.2,.86,.24,1) both}
  .crow.is-new::before{
    content:""; position:absolute; left:0; top:6px; bottom:6px; width:2px; border-radius:2px;
    background:linear-gradient(rgba(126,172,255,.9), rgba(126,172,255,0));
    animation:crowBar 2.4s ease-out both;
  }
  .crow{position:relative}
  @keyframes crowIn{
    0%{opacity:0; transform:translateY(-18px) scale(.985)}
    60%{opacity:1}
    100%{opacity:1; transform:none}
  }
  @keyframes crowBar{ 0%{opacity:0} 18%{opacity:1} 100%{opacity:0} }
  /* 已有记录状态变了（生成中 → 成功 / 失败）：原地亮一下，位置不动 */
  .crow.just-upd{animation:crowUpd 1.1s ease-out}
  @keyframes crowUpd{
    0%{background:rgba(126,172,255,.16)}
    100%{background:transparent}
  }
  @media (prefers-reduced-motion:reduce){
    .crow.is-new, .crow.is-new::before, .crow.just-upd{animation:none}
  }
  .cthumb{
    position:relative; flex:0 0 58px; width:58px; height:35px; border-radius:6px;
    overflow:hidden; border:1px solid rgba(255,255,255,.1); background:#101014;
    display:grid; place-items:center; font-size:9px; color:var(--dim-2);
  }
  /* 视频解码出来之前先放个播放记号，免得是一整块死黑 */
  .cthumb .cico{
    position:absolute; inset:0; display:grid; place-items:center;
    font-size:10px; color:rgba(255,255,255,.3); pointer-events:none;
  }
  .cthumb video,.cthumb img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; pointer-events:none}
  .cmeta{flex:1; min-width:0}
  .cmeta b{
    display:block; font-size:11.5px; font-weight:500; color:#eaeaF2;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .cmeta span{font-size:10.5px; color:var(--dim-2)}
  .cstat{
    flex:none; font-size:10px; padding:1.5px 7px; border-radius:99px;
    border:1px solid rgba(255,255,255,.14); color:var(--dim); white-space:nowrap;
  }
  .cstat.ok{color:#8fe0b0; border-color:rgba(120,220,160,.28); background:rgba(120,220,160,.09)}
  .cstat.bad{color:#ffb3b3; border-color:rgba(255,140,140,.28); background:rgba(255,140,140,.09)}
  .cmoney{
    flex:0 0 74px; text-align:right; font-size:12px; font-weight:600; color:#fff;
    font-variant-numeric:tabular-nums;
  }
  .cmoney.free{color:var(--dim-2); font-weight:500; font-size:11px}
  .cost-empty{padding:40px 18px; text-align:center; font-size:11.5px; color:var(--dim-2)}
  .cost-tip{padding:10px 18px 14px; font-size:10.5px; color:var(--dim-2); line-height:1.7}

  /* ============ 字体统一 ============ */
  :root{
    --font:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB",
           "Microsoft YaHei UI","Microsoft YaHei",system-ui,sans-serif;
  }
  html,body{font-family:var(--font)}
  button,input,select,textarea,option{font-family:inherit}

  /* ============================================================
     即梦式扁平化：卡片内部不再用一层层小方框把内容切开
     · 模式 → 纯文字 tab，选中项由一颗白色胶囊标出来（胶囊在标签底下左右滑）
     · 素材 → 裸缩略图，没有边框和底色
     · 正文 → 一整片透明书写区，聚焦时不套光圈
     · 参数 → 「文字 + 小箭头」，没有按钮底框
     只保留卡片本身那一层毛玻璃，作为唯一的分块。
     ============================================================ */
  .node{border-color:transparent}
  /* 素材块（图片/音频/成片）也融进画布：不留描边，只靠圆角与投影分界 */
  .node.asset, .node.video{border-color:transparent}
  .node.sel{
    border-color:transparent;
    box-shadow:0 0 0 1px rgba(255,255,255,.22), 0 0 0 4px rgba(255,255,255,.055),
               0 24px 64px rgba(0,0,0,.5);
  }
  .node-head{border-bottom:0; background:transparent; padding:10px 12px 3px}
  .node-head .t{color:rgba(232,232,242,.7)}
  .node-head .idx{
    width:auto; min-width:10px; height:auto; background:transparent; border-radius:0;
    color:rgba(255,255,255,.3); font-weight:600; font-size:10px;
  }
  .node-body{padding:3px 12px 12px; gap:6px}

  /* 模式切换：一颗白色胶囊在标签底下左右滑过去。
     容器本身不含描边 / 底色（胶囊外面不再套一层框），标签只用文字 + 胶囊表示状态。 */
  .modes{
    position:relative; background:transparent; border:0; border-radius:0; padding:0; gap:0;
    --n:4; --i:0;
    grid-template-columns:repeat(var(--n),1fr);
  }
  .modes::before{
    content:""; position:absolute; z-index:0; pointer-events:none;
    top:0; bottom:0; left:0; width:calc(100% / var(--n));
    border-radius:999px; background:#fff;
    box-shadow:0 1px 3px rgba(0,0,0,.36);
    transform:translateX(calc(var(--i) * 100%));
    transition:transform .27s cubic-bezier(.32,.72,.28,1);
  }
  .modes button{
    position:relative; z-index:1; height:28px; border-radius:999px;
    background:transparent; border:0;
    color:rgba(226,226,236,.42); font-size:11.5px;
    transition:color .18s ease;
    white-space:nowrap;
  }
  .modes button:hover{color:#fff}
  .modes button.on{background:transparent; color:#101016; font-weight:600; box-shadow:none}

  .arail{gap:7px; padding:2px 1px 8px}
  .acard{border:0; background:transparent; border-radius:11px}
  .acard:hover{background:rgba(255,255,255,.07); border:0}
  .acard.aud{background:rgba(255,255,255,.07); border:0}
  .acard.up{
    border:0; border-style:solid; background:rgba(255,255,255,.05);
    color:rgba(226,226,236,.48);
  }
  .acard.up:hover{background:rgba(255,255,255,.12); color:#fff; border:0}

  .ptext{
    background:transparent; border:0; border-radius:0;
    padding:8px 36px 8px 2px; min-height:92px; font-size:12.5px; line-height:1.8;
  }
  .ptext:focus{border:0; box-shadow:none; background:transparent}
  .expand-btn{background:transparent}
  .expand-btn:hover{background:rgba(255,255,255,.1); border-color:transparent}

  .toolbar{border-top:0; padding-top:0; gap:7px; margin-top:0}
  .dur-val{color:rgba(226,226,236,.5)}
  .dur-auto{border:0; background:transparent}
  .dur-auto:hover{background:rgba(255,255,255,.08)}
  .dur-auto.on{background:rgba(255,255,255,.9); color:#0b0b0f; border:0}

  .bar-line{gap:2px}
  .adv-line{gap:0}
  .ctl{
    height:26px; border:0; border-radius:7px; background:transparent;
    color:rgba(232,232,242,.7); font-size:11.5px;
  }
  .ctl:hover{background:rgba(255,255,255,.08); border:0}
  .ctl:focus{border:0; box-shadow:none}
  /* 卡片里的下拉也照样左右对称：右边让出箭头，左边同宽，
     文字才落在按钮正中（以前左 4 右 16，模型名整体偏左 6px） */
  .ctl-sel{padding:0 16px}
  .ctl-sel.on{background:rgba(255,255,255,.1); color:#fff}
  .ctl-ico{
    width:26px; height:26px; border:0; border-radius:7px; background:transparent;
    color:rgba(226,226,236,.5);
  }
  .ctl-ico:hover{background:rgba(255,255,255,.08); color:#fff}
  .ctl-ico.on{background:rgba(255,255,255,.12); border:0; color:#fff}
  .bar-line .ctl.param{border:0; background:transparent; color:rgba(226,226,236,.5); padding:0 6px}
  .bar-line .ctl.param.on{background:rgba(255,255,255,.1); border:0}

  /* ============ 卡片默认收起：点上面的预览窗才弹出来 ============
     位置由 transform 负责，收起动画走独立的 translate / scale 属性，
     两者按规范叠加，互不覆盖，所以弹出时不会抢掉节点的 x/y。 */
  .node.prompt{
    transform-origin:50% 0;
    z-index:1;
    transition:opacity .2s ease, scale .34s cubic-bezier(.16,.86,.24,1),
               translate .34s cubic-bezier(.16,.86,.24,1), filter .3s ease;
  }
  /* 展开的提示词卡片永远压在所有预览窗（z-index 4/5）上面，不允许被别的节点盖住 */
  .node.prompt:not(.collapsed){z-index:6}
  .node.prompt.collapsed{
    opacity:0; pointer-events:none; filter:blur(3px);
    scale:.94; translate:0 -14px;
    transition:opacity .15s ease, scale .2s cubic-bezier(.4,0,.92,.4),
               translate .2s cubic-bezier(.4,0,.92,.4), filter .18s ease;
  }

  /* ============ 预览窗左右两侧的连线加号 ============ */
  .pf-stage{position:relative}
  .pf-zone{position:absolute; top:0; bottom:0; width:32px; z-index:7; display:grid; place-items:center}
  .pf-zone.in{left:-32px}
  .pf-zone.out{right:-32px}
  .pf-port{
    width:22px; height:22px; border-radius:50%; padding:0;
    background:rgba(22,22,28,.8); border:1px solid rgba(255,255,255,.16);
    color:rgba(255,255,255,.66); cursor:crosshair;
    font-family:inherit; font-size:13px; font-weight:500; line-height:1;
    display:grid; place-items:center;
    opacity:0; transform:scale(.78); pointer-events:none;
    -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
    transition:opacity .16s ease, transform .18s cubic-bezier(.2,.9,.3,1),
               background .16s, color .16s, border-color .16s;
  }
  .pf-zone:hover .pf-port, .pf-port.on{opacity:1; transform:scale(1); pointer-events:auto}
  .pf-port:hover{background:rgba(255,255,255,.94); color:#101016; border-color:transparent; transform:scale(1.12)}
  .pfloat.linktarget .vbox,
  .node.linktarget{box-shadow:0 0 0 2px rgba(150,192,255,.75), 0 20px 60px rgba(0,0,0,.55) !important}

  /* ============ 素材节点右侧加号：不靠近就藏起来 ============
     整颗加号吊在节点外面，跟右侧边框留出 10px 呼吸位（right:-32 = 22 直径 + 10 间距），
     不再是压在边框线上的半颗。 */
  .plus{
    right:-32px; width:22px; height:22px;
    border:1px solid rgba(255,255,255,.14); background:rgba(20,20,26,.72);
    color:rgba(255,255,255,.62); cursor:crosshair;
    opacity:0; transform:translateY(-50%) scale(.8); pointer-events:none;
    -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
    transition:opacity .16s ease, transform .18s cubic-bezier(.2,.9,.3,1),
               background .16s, color .16s, border-color .16s;
  }
  /* 加号用两条 1.5px 的横竖短线画出来（不再用「+」字形）。
     字形在字框里天然偏下：22px 的圆里实测整整低了 2.2px，看着就是「没居中」。
     两条背景线都按 center 对齐，横竖同长、粗细同宽，圆心上分毫不差。 */
  .plus::before{
    content:''; position:absolute; left:50%; top:50%; width:9px; height:9px;
    transform:translate(-50%,-50%);
    background:
      linear-gradient(currentColor,currentColor) center/9px 1.5px no-repeat,
      linear-gradient(currentColor,currentColor) center/1.5px 9px no-repeat;
  }
  /* 悬停桥：加号挪到节点外之后，鼠标从卡片移过去要经过那段空白，
     空白一进入就判定「离开节点」会让加号当场消失、根本点不到。
     这里把空白也算进加号身上（只在节点热着的时候生效，平时不吃画布的点击）。 */
  .plus::after{
    content:''; position:absolute; top:-13px; bottom:-13px; right:100%; width:14px;
    pointer-events:none;
  }
  .node:hover .plus::after, .node.sel .plus::after{pointer-events:auto}
  .node:hover .plus, .node.sel .plus{opacity:1; transform:translateY(-50%) scale(1); pointer-events:auto}
  /* 框选了一批之后，每颗节点自己的加号不再常驻 —— 整批的引线口统一收到
     多选框右侧那一颗（它一直亮着）。鼠标靠回某颗节点上，那颗的加号照旧浮出来，
     想单独引一颗还是能引。 */
  body.multi-sel .node.sel .plus{opacity:0; transform:translateY(-50%) scale(.8); pointer-events:none}
  body.multi-sel .node.sel .plus::after{pointer-events:none}
  body.multi-sel .node.sel:hover .plus{opacity:1; transform:translateY(-50%) scale(1); pointer-events:auto}
  body.multi-sel .node.sel:hover .plus::after{pointer-events:auto}
  .plus:hover{background:rgba(255,255,255,.94); color:#101016; border-color:transparent; transform:translateY(-50%) scale(1.12)}

  /* ============ 打组框 ============
     包住一组上传素材（图片 / 音频 / 文本）的容器。设计要求：
     边角圆润、边框很淡（只用来提示范围，不要抢节点的视觉）、底子是一层毛玻璃，
     鼠标按在框里拖 = 整组一起走；框右侧中点挂一颗加号，从这里拖线能把整组素材
     一次接到生成节点上。 */
  #groups{position:absolute; left:0; top:0}
  /* 多选框：选中两颗以上时把这一批圈起来的淡框。
     它只负责「框住范围」，框内照样能直接点节点（pointer-events 全放穿），
     只有右边那个加号是活的 —— 按住拖出去，整批节点一起引线到下一个生成节点。 */
  #selset{position:absolute; left:0; top:0}
  .sbox{
    position:absolute; border-radius:18px; pointer-events:none;
    border:1px solid rgba(126,166,255,.36);
    background:rgba(110,152,255,.055);
    box-shadow:0 0 0 1px rgba(126,166,255,.05), inset 0 0 40px rgba(110,152,255,.045);
    transition:border-color .2s ease, background .2s ease, box-shadow .2s ease;
  }
  .sbox .gplus{
    opacity:1; transform:translateY(-50%) scale(1); pointer-events:auto;
    background:rgba(16,16,24,.86);
    border-color:rgba(126,166,255,.38);
    color:rgba(208,224,255,.94);
    /* 框里的加号吊在框外，正好可能压到旁边那张没被选中的卡片上：
       节点层在 DOM 里排在多选框后面，不抬这一层就会被卡片盖住。 */
    z-index:12;
  }
  .sbox .gplus::after{pointer-events:auto}
  .sbox .gplus:hover{
    background:rgba(126,166,255,.96); color:#0b1020; border-color:transparent;
    transform:translateY(-50%) scale(1.12);
  }
  body.light .sbox{
    border-color:rgba(70,110,220,.32);
    background:rgba(90,130,240,.05);
    box-shadow:0 0 0 1px rgba(70,110,220,.05), inset 0 0 40px rgba(90,130,240,.05);
  }
  body.light .sbox .gplus{background:rgba(255,255,255,.96); border-color:rgba(70,110,220,.32); color:rgba(38,58,120,.82)}
  body.light .sbox .gplus:hover{background:#2b56d8; color:#fff; border-color:transparent}
  .gbox{
    position:absolute; border-radius:20px;
    background:rgba(255,255,255,.05);
    border:1px solid rgba(255,255,255,.10);
    -webkit-backdrop-filter:blur(9px) saturate(112%); backdrop-filter:blur(9px) saturate(112%);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 18px 48px rgba(0,0,0,.13);
    cursor:grab;
    transition:background .18s ease, border-color .18s ease, box-shadow .18s ease;
  }
  .gbox:hover{background:rgba(255,255,255,.062); border-color:rgba(255,255,255,.145)}
  .gbox.dragging{cursor:grabbing; background:rgba(255,255,255,.075); border-color:rgba(255,255,255,.18)}
  /* 正拖着一颗素材悬在框上：亮一圈光，表示松手就会并进这一组 */
  .gbox.joinhot{
    background:rgba(255,255,255,.105);
    border-color:rgba(255,255,255,.66);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.16),
               0 0 0 1px rgba(255,255,255,.28),
               0 0 26px rgba(184,208,255,.42),
               0 0 68px rgba(140,175,255,.24);
  }
  /* 组名：挂在框外左上角（框里那圈留白被素材卡的文件名条占着），双击改名。
     平时淡得像框的一部分，悬停才亮 */
  .gbox .gname{
    position:absolute; left:2px; bottom:100%; margin-bottom:5px;
    max-width:calc(100% - 34px);
    padding:1px 8px; border-radius:7px;
    font-size:11.5px; line-height:16px; letter-spacing:.01em;
    color:rgba(255,255,255,.5); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    background:rgba(255,255,255,.055);
    cursor:text; user-select:none;
    text-shadow:0 1px 3px rgba(0,0,0,.9);
    transition:color .15s ease, background .15s ease;
  }
  .gbox:hover .gname{color:rgba(255,255,255,.8); background:rgba(255,255,255,.085)}
  .gbox .gname:hover{background:rgba(255,255,255,.14)}
  /* 改名输入框：占组名同一个位置，回车 / 失焦存，Esc 撤 */
  .gbox .gnin{
    position:absolute; left:0; bottom:100%; margin-bottom:3px;
    width:min(190px, calc(100% - 34px)); height:21px;
    padding:0 6px; border-radius:6px; outline:none;
    border:1px solid rgba(255,255,255,.26); background:rgba(16,16,22,.92);
    color:#f0f0f6; font-size:11.5px; font-family:inherit;
    box-shadow:0 6px 18px rgba(0,0,0,.4);
  }
  /* 拆组叉号：右上角、同样挂在框外。平时淡着摆在那儿（找得到），悬停框才完全亮起来，
     点了就拆框 —— 和右侧加号一个脾气 */
  .gbox .gx{
    position:absolute; right:0; bottom:100%; margin-bottom:4px;
    width:18px; height:18px; padding:0;
    display:grid; place-items:center; border:1px solid transparent; border-radius:50%;
    background:transparent; color:rgba(255,255,255,.5);
    opacity:.42; cursor:pointer;
    transition:opacity .15s ease, background .15s, color .15s;
  }
  .gbox .gx svg{width:9px; height:9px; display:block}
  .gbox:hover .gx{opacity:1; color:rgba(255,255,255,.72)}
  .gbox .gx:hover{background:rgba(255,255,255,.16); color:#fff}
  .gplus{
    position:absolute; right:-32px; top:50%; width:22px; height:22px; padding:0;
    border:1px solid rgba(255,255,255,.14); border-radius:50%;
    background:rgba(20,20,26,.72); color:rgba(255,255,255,.62);
    cursor:crosshair; opacity:0; pointer-events:none;
    transform:translateY(-50%) scale(.8);
    -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
    transition:opacity .16s ease, transform .18s cubic-bezier(.2,.9,.3,1),
               background .16s, color .16s, border-color .16s;
  }
  /* 同上：加号两条线画出来，横竖都以圆心对齐（「+」字形会偏下 2px） */
  .gplus::before{content:''; position:absolute; left:50%; top:50%; width:9px; height:9px;
    transform:translate(-50%,-50%);
    background:
      linear-gradient(currentColor,currentColor) center/9px 1.5px no-repeat,
      linear-gradient(currentColor,currentColor) center/1.5px 9px no-repeat}
  /* 加号吊在框外 10px，鼠标从框里斜着挪过去要跨过那段空白，光靠 22px 的小圆点很难按准。
     这里给它补一块**大一圈的透明热区**：左边压进框里 16px、上下各放开 26px、右边也留 16px，
     接近就接管，不必精确命中圆点，也不会「一出画框加号就没了」。 */
  .gplus::after{
    content:''; position:absolute; top:-26px; bottom:-26px; left:-26px; right:-16px;
    border-radius:16px; pointer-events:none;
  }
  .gbox:hover .gplus::after{pointer-events:auto}
  .gbox:hover .gplus{opacity:1; transform:translateY(-50%) scale(1); pointer-events:auto}
  .gplus:hover{background:rgba(255,255,255,.94); color:#101016; border-color:transparent; transform:translateY(-50%) scale(1.12)}
  /* 光标刚离开框的那半秒里保持「热」：从框里往外够加号时，加号不会一出门就灭 */
  .gbox.warm .gplus::after{pointer-events:auto}
  .gbox.warm .gplus{opacity:1; transform:translateY(-50%) scale(1); pointer-events:auto}
  .gbox.warm .gx{opacity:1; color:rgba(255,255,255,.72)}
  .gbox.warm .gname{color:rgba(255,255,255,.8); background:rgba(255,255,255,.085)}
  body.light .gbox{
    background:rgba(255,255,255,.42); border-color:rgba(20,20,30,.17);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.7), 0 18px 44px rgba(30,30,60,.08);
  }
  body.light .gbox:hover{background:rgba(255,255,255,.6); border-color:rgba(20,20,30,.26)}
  body.light .gbox.joinhot{
    background:rgba(255,255,255,.72); border-color:rgba(20,20,30,.34);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.8),
               0 0 0 1px rgba(20,20,30,.1),
               0 0 26px rgba(120,150,255,.22);
  }
  body.light .gplus{background:rgba(255,255,255,.92); border-color:rgba(20,20,30,.12); color:rgba(28,28,40,.66)}
  body.light .gplus:hover{background:#1b1b21; color:#fff; border-color:transparent}
  body.light .gbox .gname{color:rgba(28,28,40,.52); background:rgba(255,255,255,.6); text-shadow:none}
  body.light .gbox:hover .gname{color:rgba(28,28,40,.8); background:rgba(255,255,255,.82)}
  body.light .gbox .gname:hover{background:#fff}
  body.light .gbox .gnin{background:#fff; border-color:rgba(20,20,30,.22); color:#15151c}
  body.light .gbox .gx{color:rgba(28,28,40,.55)}
  body.light .gbox .gx:hover{background:rgba(20,20,30,.1); color:#111}

  /* ============ 触屏 / 小屏适配（给网页端上线用） ============
     画布本身是可拖可缩的，浏览器再插一脚就会「拖不动 / 页面跟着晃」：
     横向素材轨只让浏览器管横向滚动，卡片禁止长按弹系统菜单。 */
  .arail{touch-action:pan-x; -webkit-overflow-scrolling:touch}
  .acard, .pfloat .pf-head, .node-head{-webkit-touch-callout:none}
  .pfloat, .node{-webkit-user-select:none}
  .ptext{-webkit-user-select:text; user-select:text}

  /* 视口窄的时候：节点和预览窗都不许顶出屏幕（原来写死 420px，手机上会横着溢出去） */
  .pfloat{width:min(420px, calc(100vw - 28px))}
  .node{max-width:calc(100vw - 20px)}
  .big-panel{width:min(1080px, 96vw); height:min(760px, 92vh)}
  .modal{padding:14px}

  /* ============ 右上角账号胶囊 ============ */
  /* 一整块浅底把五个入口 + 头像收在一起，和左侧 navrail 的胶囊呼应 */
  .hgroup{
    display:flex; align-items:center; gap:2px; flex:none;
    padding:3px; border-radius:14px;
    border:1px solid rgba(255,255,255,.09);
    background:rgba(255,255,255,.05);
  }
  .hicon{
    position:relative; display:inline-flex; align-items:center; justify-content:center;
    width:32px; height:32px; padding:0; border:0; border-radius:9px;
    background:transparent; color:#cfcfdc; cursor:pointer; text-decoration:none;
    transition:background .15s, color .15s, transform .1s;
    -webkit-tap-highlight-color:transparent;
  }
  .hicon:hover{background:rgba(255,255,255,.1); color:#fff}
  .hicon:active{transform:scale(.93)}
  .hicon.on{background:rgba(255,255,255,.15); color:#fff}
  .hicon .dot{position:absolute; right:5px; top:5px; width:5px; height:5px}
  /* 密钥正常时不再冒绿点（看着像「有新消息」又赶不走）；只有缺密钥 / 服务断开才露红点 */
  .hicon .dot.on{display:none}
  /* 消息按钮的未读数：不再用宝蓝实心圆，改成和全站同一套单色胶囊（深色主题=白底黑字），
     靠一圈淡淡的光晕「呼吸」着提醒，不去抢铃铛本身的视线 */
  .nbadge{
    --nb-fill:#f4f4f9;
    --nb-line:rgba(15,15,20,.94);
    --nb-glow:246,246,251;
    position:absolute; right:0; top:0; min-width:15px; height:15px; padding:0 4px;
    border-radius:9px;
    background:var(--nb-fill); color:#16161c;
    font-size:9.5px; font-weight:700; line-height:15px; letter-spacing:.1px;
    font-style:normal; text-align:center; font-variant-numeric:tabular-nums;
    box-shadow:0 0 0 1.6px var(--nb-line);
    animation:bellBreath 2.9s ease-in-out infinite;
  }
  /* 两段呼吸叠一起：整体光晕慢慢亮一下，外加一圈很浅的涟漪往外扩，
     幅度都压得很小，扫一眼能注意到、盯着看不闹 */
  .nbadge::after{
    content:''; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
    animation:bellRing 2.9s ease-out infinite;
  }
  @keyframes bellBreath{
    0%, 100%{ box-shadow:0 0 0 1.6px var(--nb-line), 0 0 0 0 rgba(var(--nb-glow), 0); }
    50%     { box-shadow:0 0 0 1.6px var(--nb-line), 0 0 8px 1.5px rgba(var(--nb-glow), .34); }
  }
  @keyframes bellRing{
    0%  { box-shadow:0 0 0 0 rgba(var(--nb-glow), .40); }
    60% { box-shadow:0 0 0 5px rgba(var(--nb-glow), 0); }
    100%{ box-shadow:0 0 0 0 rgba(var(--nb-glow), 0); }
  }
  @media (prefers-reduced-motion: reduce){
    .nbadge, .nbadge::after{animation:none}
  }
  .hicon #keyText{display:none}
  /* 「本画布消耗」是唯一带文字的：金额用等宽数字，数字跳动时不会左右抖 */
  .costchip{
    display:flex; align-items:center; gap:6px; height:32px; padding:0 11px;
    border:0; border-radius:9px; background:rgba(255,255,255,.06);
    color:#e6e6ef; font-size:11.5px; font-family:inherit; cursor:pointer;
    font-variant-numeric:tabular-nums; white-space:nowrap; transition:background .15s;
  }
  .costchip:hover{background:rgba(255,255,255,.13); color:#fff}
  .costchip .cc-lab{color:#c7c7d6}
  .costchip .dot{flex:none}
  /* 先铺上次查到的金额时数字压暗一点，查完变亮 —— 一眼能看出「这是旧的，正在后台刷新」 */
  .costchip.cached #balText{color:rgba(230,230,239,.52)}
  /* 金额涨了闪一下，让「累加」看得见（不是绿色，别和涨跌混起来） */
  .costchip.bump #balText{animation:costBump .95s ease-out}
  @keyframes costBump{
    0%  {color:#cfe4ff; text-shadow:0 0 12px rgba(150,195,255,.7)}
    100%{color:#e6e6ef; text-shadow:none}
  }
  /* 头像：默认是纯线条人像（深色=白线 / 浅色=黑线），设了自定义头像就换成图片 */
  .ava{
    width:30px; height:30px; margin-left:4px; padding:0; border:0; border-radius:50%;
    overflow:hidden; cursor:pointer; flex:none; background:rgba(255,255,255,.07); line-height:0;
    color:#f2f2f7;
    box-shadow:0 0 0 1.5px rgba(255,255,255,.26), 0 2px 8px rgba(0,0,0,.42);
    transition:box-shadow .15s, transform .12s;
  }
  .ava:hover{transform:scale(1.05); box-shadow:0 0 0 1.5px rgba(255,255,255,.6), 0 3px 12px rgba(0,0,0,.5)}
  .ava.on{box-shadow:0 0 0 2px #6f8ff5, 0 4px 14px rgba(90,130,240,.4)}
  .ava svg{width:100%; height:100%; display:block}
  .ava-line{fill:none; stroke:currentColor; stroke-width:1.85;
    stroke-linecap:round; stroke-linejoin:round}
  .ava-img{display:none; width:100%; height:100%; object-fit:cover}
  .ava.has-img .ava-img{display:block}
  .ava.has-img .ava-line{display:none}

  /* ============ 账号菜单 ============ */
  .umenu{
    position:fixed; z-index:70; width:274px; padding:8px; display:none;
    border:1px solid rgba(255,255,255,.12); border-radius:16px;
    background:rgba(26,26,33,.97);
    -webkit-backdrop-filter:blur(28px) saturate(160%);
    backdrop-filter:blur(28px) saturate(160%);
    box-shadow:0 26px 64px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.07);
    transform-origin:top right;
  }
  .umenu.on{display:block; animation:umIn .14s ease-out}
  @keyframes umIn{from{opacity:0; transform:translateY(-6px) scale(.97)} to{opacity:1; transform:none}}
  .um-head{
    display:flex; align-items:center; gap:10px; padding:7px 8px 12px;
    border-radius:10px; text-decoration:none; color:inherit;
    transition:background .14s;
  }
  .um-head:hover{background:rgba(255,255,255,.06)}
  .um-out{
    width:14px; height:14px; flex:none; opacity:.36;
    transition:opacity .14s, transform .14s;
  }
  .um-head:hover .um-out, .um-item:hover .um-out{opacity:.9; transform:translate(1px,-1px)}
  .um-ava{
    position:relative; width:38px; height:38px; border-radius:50%; overflow:hidden; flex:none; line-height:0;
    background:rgba(255,255,255,.07); color:#f2f2f7; cursor:pointer;
    box-shadow:0 0 0 1px rgba(255,255,255,.18);
  }
  .um-ava > svg{width:100%; height:100%; display:block}
  .um-ava .um-img{display:none; width:100%; height:100%; object-fit:cover}
  .um-ava.has-img .um-img{display:block}
  .um-ava.has-img > svg{display:none}
  /* 换头像的入口放在菜单里的头像上：悬停盖一层「上传」，一级导航栏不再挂角标，免得误触 */
  .um-up{
    position:absolute; inset:0; border-radius:50%; display:grid; place-items:center;
    background:rgba(10,10,16,.6); color:#fff; opacity:0; cursor:pointer;
    -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
    transition:opacity .14s;
  }
  .um-up svg{width:15px; height:15px}
  .um-ava:hover .um-up, .um-up:focus-visible{opacity:1}
  /* 触屏没有 hover：常驻半透明蒙层，点一下就是换头像 */
  @media (pointer:coarse){
    .um-up{opacity:1; background:rgba(10,10,16,.42)}
  }
  .um-id{display:flex; flex-direction:column; gap:2px; min-width:0}
  .um-id b{font-size:13.5px; font-weight:650; color:#f1f1f7; letter-spacing:.2px}
  .um-id small{font-size:11px; color:var(--dim-2)}
  /* .um-item 明确写了 display:flex，[hidden] 会被它压掉 —— 必须补一条 */
  .um-item[hidden]{display:none}
  .um-item{
    width:100%; display:flex; align-items:center; gap:9px;
    height:38px; padding:0 9px; border:0; border-radius:10px;
    background:transparent; color:#dcdce6; font-size:12.5px; font-family:inherit;
    cursor:pointer; text-align:left; transition:background .14s;
  }
  .um-item:hover{background:rgba(255,255,255,.085)}
  .um-item svg{width:16px; height:16px; flex:none; opacity:.8}
  .um-label{flex:1; white-space:nowrap}
  .um-val{font-variant-numeric:tabular-nums; font-weight:650; color:#fff}
  .um-tag{
    font-size:10.5px; color:#8f8fa2; background:rgba(255,255,255,.07);
    padding:2px 6px; border-radius:6px;
  }
  .um-item.danger{color:#ff8585}
  .um-item.danger:hover{background:rgba(255,90,90,.14)}
  .um-sw{
    width:34px; height:19px; border-radius:99px; background:rgba(255,255,255,.18);
    position:relative; flex:none; transition:background .16s;
  }
  .um-sw i{
    position:absolute; top:2px; left:2px; width:15px; height:15px; border-radius:50%;
    background:#fff; transition:transform .16s; display:block;
  }
  .um-sw.on{background:#5b8cff}
  .um-sw.on i{transform:translateX(15px)}

  /* ============ 更换头像（1:1 裁剪） ============ */
  /* 底色必须不透明：苹果皮肤把 --node 设成半透明白，直接用会透出画布上的卡片和工具栏 */
  .ava-panel{
    width:min(560px, 94vw); max-height:92vh; overflow:auto;
    display:flex; flex-direction:column; gap:14px;
    padding:18px 20px 20px; border-radius:20px;
    background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,0) 40%), #16161c;
    border:1px solid var(--line-2);
    box-shadow:0 30px 80px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.07);
  }
  .ava-head{display:flex; align-items:center; gap:10px}
  .ava-title{font-size:15px; font-weight:600; letter-spacing:.3px; color:#ececf4}
  .pava-x{
    margin-left:auto; width:28px; height:28px; padding:0; border:0; border-radius:50%;
    background:rgba(255,255,255,.07); color:#d8d8e4; font-size:17px; line-height:1;
    font-family:inherit; cursor:pointer; transition:.14s;
  }
  .pava-x:hover{background:rgba(255,255,255,.15); color:#fff}
  .ava-stage{display:flex; flex-direction:column; align-items:center; gap:12px; padding:4px 0 2px}
  .ava-crop{
    position:relative; width:min(320px, 66vw); aspect-ratio:1 / 1;
    border-radius:50%; overflow:hidden; background:#0f0f15;
    cursor:grab; touch-action:none;
    box-shadow:0 0 0 1px rgba(255,255,255,.12), 0 18px 50px rgba(0,0,0,.5);
  }
  .ava-crop.dragging{cursor:grabbing}
  .ava-crop img{
    position:absolute; left:0; top:0; max-width:none; max-height:none;
    user-select:none; -webkit-user-drag:none; pointer-events:none;
  }
  .ava-crop img:not([src]){display:none}
  .ava-crop::after{
    content:''; position:absolute; inset:0; border-radius:50%; pointer-events:none;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);
  }
  .ava-hint{font-size:11.5px; color:var(--dim-2); text-align:center}
  .ava-foot{display:flex; align-items:center; justify-content:flex-end; gap:10px; padding-top:2px}
  .ava-foot .grow{flex:1}
  .pava-btn.ghost{
    min-width:0; padding:0 12px; border-color:transparent; background:transparent;
    color:var(--dim); font-size:12px;
  }
  .pava-btn.ghost:hover{background:rgba(255,255,255,.08); color:var(--text)}
  .pava-btn{
    height:36px; min-width:88px; padding:0 20px; border-radius:999px;
    border:1px solid rgba(255,255,255,.18); background:transparent;
    color:#eaeaf4; font-size:12.5px; font-family:inherit; font-weight:500;
    cursor:pointer; transition:.14s;
  }
  .pava-btn:hover{background:rgba(255,255,255,.08)}
  .pava-btn.primary{background:#f1f1f6; border-color:transparent; color:#17171e; font-weight:600}
  .pava-btn.primary:hover{background:#fff}
  body.light .ava-panel{background:#fff; border-color:rgba(20,20,30,.1);
    box-shadow:0 26px 60px rgba(20,20,40,.24)}
  body.light .ava-title{color:#16161d}
  body.light .pava-x{background:rgba(20,20,30,.06); color:#5a5a6c}
  body.light .pava-x:hover{background:rgba(20,20,30,.12); color:#111}
  body.light .ava-crop{background:#f0f1f5;
    box-shadow:0 0 0 1px rgba(20,20,30,.12), 0 16px 40px rgba(20,20,40,.18)}
  body.light .ava-crop::after{box-shadow:inset 0 0 0 1px rgba(20,20,30,.14)}
  body.light .pava-btn{border-color:rgba(20,20,30,.16); color:#26262f}
  body.light .pava-btn:hover{background:rgba(20,20,30,.06)}
  body.light .pava-btn.primary{background:#1c1c24; border-color:transparent; color:#fff}
  body.light .pava-btn.primary:hover{background:#000}
  body.light .pava-btn.ghost{color:rgba(28,28,40,.55)}
  body.light .pava-btn.ghost:hover{background:rgba(20,20,30,.06); color:#1b1b21}

  /* ============ 登录 / 注册 ============ */
  /* 首页右上角的「登录 / 注册」：未登录才出现，已登录换成头像（和画布顶栏一致） */
  .hlogin{
    height:30px; padding:0 12px; margin-left:2px; border:0; border-radius:9px;
    background:rgba(255,255,255,.92); color:#14141a;
    font-family:inherit; font-size:12px; font-weight:600; letter-spacing:.2px;
    cursor:pointer; white-space:nowrap; transition:background .15s, transform .12s;
  }
  .hlogin:hover{background:#fff; transform:translateY(-1px)}
  body.light .hlogin{background:#1c1c24; color:#fff}
  body.light .hlogin:hover{background:#000}

  /* 弹窗本体：不用 var(--node) —— 苹果皮肤把它改成半透明白，面板会透出后面的画布。
     参考图是浅色表单，这里两套主题各给一套：深色=深玻璃 + 淡填充，浅色=白卡 + 淡蓝填充。 */
  .auth-panel{
    position:relative; width:min(392px, 94vw); padding:32px 34px 30px;
    border:1px solid rgba(255,255,255,.13); border-radius:20px;
    background:#17171e;
    box-shadow:0 34px 90px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.08);
  }
  .auth-x{
    position:absolute; right:11px; top:11px; width:28px; height:28px; padding:0;
    border:0; border-radius:8px; background:transparent; color:rgba(255,255,255,.44);
    font-size:18px; line-height:1; cursor:pointer; transition:.14s;
  }
  .auth-x:hover{background:rgba(255,255,255,.09); color:#fff}
  .auth-face{display:flex; flex-direction:column}
  .auth-face[hidden]{display:none}
  .auth-face h2{font-size:26px; font-weight:700; letter-spacing:.5px; color:#fff; margin:0 0 8px}
  .auth-sub{font-size:13px; color:var(--dim); margin:0 0 26px}
  .auth-link{
    padding:0; border:0; background:none; color:#eaeaF2; font:inherit; cursor:pointer;
    text-decoration:underline; text-underline-offset:3px; text-decoration-thickness:1px;
  }
  .auth-link:hover{color:#fff}
  .auth-field{margin-bottom:16px}
  .auth-field:last-of-type{margin-bottom:0}
  .auth-lab{display:block; font-size:12.5px; font-weight:600; color:#e6e6ef; margin:0 0 8px}
  .auth-labrow{display:flex; align-items:center; justify-content:space-between; margin:0 0 8px}
  .auth-labrow .auth-lab{margin:0}
  .auth-forgot{
    padding:0; border:0; background:none; color:var(--dim); font:inherit; font-size:12px; cursor:pointer;
  }
  .auth-forgot:hover{color:#fff}
  .auth-inp{
    width:100%; height:44px; box-sizing:border-box; padding:0 14px;
    border:1px solid rgba(255,255,255,.1); border-radius:12px;
    background:rgba(255,255,255,.055); color:#f2f2f8;
    font-family:inherit; font-size:13px; outline:none;
    transition:border-color .15s, background .15s, box-shadow .15s;
  }
  .auth-inp::placeholder{color:rgba(255,255,255,.3)}
  .auth-inp:focus{
    border-color:rgba(110,170,255,.62); background:rgba(255,255,255,.08);
    box-shadow:0 0 0 3px rgba(70,140,255,.16);
  }
  .auth-inp.bad{border-color:rgba(255,110,110,.72)}
  .auth-pw{position:relative}
  .auth-pw .auth-inp{padding-right:46px}
  .auth-eye{
    position:absolute; right:6px; top:50%; transform:translateY(-50%);
    width:32px; height:32px; padding:0; display:grid; place-items:center;
    border:0; border-radius:8px; background:transparent; color:rgba(255,255,255,.42);
    cursor:pointer; transition:.14s;
  }
  .auth-eye:hover{color:#fff; background:rgba(255,255,255,.08)}
  .auth-eye svg{width:17px; height:17px}
  /* SVG 不认 HTML 的 [hidden]（UA 那条 [hidden]{display:none} 只作用在 HTML 元素上），
     两个眼睛会一起竖着排在按钮里 —— 必须自己补一条 */
  .auth-eye svg[hidden]{display:none}
  .auth-tip{margin:10px 0 0; min-height:14px; font-size:12px; color:#ff9a9a}
  .auth-tip.ok{color:#8fe0b0}
  .auth-go{
    margin-top:14px; width:100%; height:46px; border:0; border-radius:12px;
    display:flex; align-items:center; justify-content:center; gap:8px;
    background:linear-gradient(135deg,#4fb6f8,#2f8ce6); color:#fff;
    font-family:inherit; font-size:14px; font-weight:600; letter-spacing:.3px;
    cursor:pointer; box-shadow:0 12px 26px rgba(47,140,230,.3);
    transition:filter .16s, transform .12s;
  }
  .auth-go:hover{filter:brightness(1.06); transform:translateY(-1px)}
  .auth-go:active{transform:none}
  .auth-go[disabled]{opacity:.62; cursor:default; transform:none; filter:none}
  .auth-go svg{width:17px; height:17px}
  .auth-go .spin{
    width:14px; height:14px; border-radius:50%;
    border:2px solid rgba(255,255,255,.35); border-top-color:#fff;
    animation:authSpin .7s linear infinite;
  }
  @keyframes authSpin{to{transform:rotate(360deg)}}

  body.light .auth-panel{
    background:#fff; border-color:rgba(20,20,30,.1);
    box-shadow:0 30px 80px rgba(20,20,40,.22);
  }
  body.light .auth-x{color:rgba(20,20,30,.4)}
  body.light .auth-x:hover{background:rgba(20,20,30,.07); color:#000}
  body.light .auth-face h2{color:#0f0f16}
  body.light .auth-sub{color:rgba(28,28,40,.6)}
  body.light .auth-link{color:#0f0f16}
  body.light .auth-link:hover{color:#000}
  body.light .auth-lab{color:#1b1b23}
  body.light .auth-forgot{color:rgba(28,28,40,.55)}
  body.light .auth-forgot:hover{color:#000}
  body.light .auth-inp{
    background:#eaf2fb; border-color:#dae7f7; color:#141420;
  }
  body.light .auth-inp::placeholder{color:#8ea2b8}
  body.light .auth-inp:focus{
    background:#fff; border-color:#7cb6ee; box-shadow:0 0 0 3px rgba(70,150,240,.14);
  }
  body.light .auth-eye{color:#7c8b9c}
  body.light .auth-eye:hover{color:#141420; background:rgba(20,40,70,.06)}
  body.light .auth-tip{color:#d14343}
  body.light .auth-tip.ok{color:#1f8a53}

  /* ============ 节点搜索面板 ============ */
  .spanel{
    position:fixed; z-index:72; width:302px; display:none;
    border:1px solid rgba(255,255,255,.12); border-radius:15px;
    background:rgba(26,26,33,.97);
    -webkit-backdrop-filter:blur(28px) saturate(160%);
    backdrop-filter:blur(28px) saturate(160%);
    box-shadow:0 26px 64px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.07);
    overflow:hidden;
  }
  .spanel.on{display:flex; flex-direction:column; animation:umIn .14s ease-out}
  .sp-top{display:flex; align-items:center; gap:8px; padding:11px 12px 9px}
  .sp-ico{width:14px; height:14px; color:#7c7c8c; flex:none}
  .sp-input{
    flex:1; min-width:0; height:22px; border:0; background:transparent; outline:none;
    color:#eaeaf2; font-size:12.5px; font-family:inherit;
  }
  .sp-input::placeholder{color:#6e6e7c}
  .sp-clear{
    width:18px; height:18px; padding:0; border:0; border-radius:50%;
    background:rgba(255,255,255,.1); color:#bcbcca; font-size:13px; line-height:1;
    cursor:pointer; display:none; align-items:center; justify-content:center; flex:none;
  }
  .spanel.hasq .sp-clear{display:flex}
  .sp-clear:hover{background:rgba(255,255,255,.2); color:#fff}
  .sp-tabs{
    display:flex; align-items:center; gap:1px; padding:0 8px 7px;
    overflow-x:auto; scrollbar-width:none;
  }
  .sp-tabs::-webkit-scrollbar{display:none}
  .spt{
    flex:none; height:24px; padding:0 7px; border:0; border-radius:7px;
    background:transparent; color:#9a9aab; font-size:11.5px; font-family:inherit;
    cursor:pointer; white-space:nowrap; transition:.14s;
  }
  .spt i{font-style:normal; font-size:10.5px; opacity:.62; margin-left:2px}
  .spt:hover{background:rgba(255,255,255,.07); color:#e6e6f0}
  .spt.on{background:rgba(255,255,255,.14); color:#fff}
  .spt.on i{opacity:.85}
  .sp-list{
    display:flex; flex-direction:column; gap:1px; padding:0 6px;
    max-height:min(620px, calc(100vh - 210px));
    overflow-y:auto; overscroll-behavior:contain;
  }
  /* 滑轨和资产库 / 消息中心同一套：8px 宽、2px 透明边收成细圆头、悬停提亮。
     注意别在这里写 scrollbar-width —— Chromium 一旦看到它，下面 ::-webkit-scrollbar 就整体失效，
     又会变回系统那条粗白条（这条踩过一次，别再加）。 */
  .sp-list::-webkit-scrollbar{width:8px}
  .sp-list::-webkit-scrollbar-track{background:transparent; margin:4px 0}
  .sp-list::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.18); border-radius:99px;
    border:2px solid transparent; background-clip:padding-box;
  }
  .sp-list::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.32); background-clip:padding-box}
  .sp-list::-webkit-scrollbar-corner{background:transparent}
  @supports not (selector(::-webkit-scrollbar)){
    .sp-list{scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.22) transparent}
  }
  .sp-item{
    display:flex; align-items:center; gap:9px; width:100%;
    padding:3px 6px 3px 3px; border:0; border-radius:9px;
    background:transparent; color:inherit; font-family:inherit;
    cursor:pointer; text-align:left; transition:background .12s;
  }
  .sp-item:hover{background:rgba(255,255,255,.075)}
  .sp-th{
    position:relative; width:38px; height:38px; border-radius:7px; flex:none;
    overflow:hidden; background:rgba(255,255,255,.06);
    display:flex; align-items:center; justify-content:center; color:#8a8a9a;
  }
  .sp-th img, .sp-th video{width:100%; height:100%; object-fit:cover; display:block}
  .sp-th > svg{width:17px; height:17px}
  .sp-idx{
    position:absolute; left:2px; top:2px; min-width:12px; height:12px; padding:0 3px;
    border-radius:3px; background:rgba(0,0,0,.62); color:#eaeaf4;
    font-size:9px; line-height:12px; text-align:center;
    font-variant-numeric:tabular-nums; pointer-events:none;
  }
  .sp-play{
    position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
    width:16px; height:16px; border-radius:50%; background:rgba(0,0,0,.52);
    display:flex; align-items:center; justify-content:center; pointer-events:none;
  }
  .sp-play svg{width:7px; height:7px; color:#fff; margin-left:1px}
  .sp-txt{min-width:0; flex:1; display:flex; flex-direction:column; gap:1px}
  .sp-name{
    font-size:12px; color:#e2e2ec; white-space:nowrap;
    overflow:hidden; text-overflow:ellipsis;
  }
  .sp-kind{font-size:10.5px; color:#747484}
  .sp-item.hit .sp-name{color:#fff}
  .sp-empty{padding:30px 12px; text-align:center; font-size:12px; color:#6f6f7d}
  .sp-page{
    display:flex; align-items:center; gap:5px; padding:7px 9px 9px;
    border-top:1px solid rgba(255,255,255,.07); margin-top:5px;
  }
  .spp{
    width:25px; height:22px; padding:0; border:0; border-radius:6px;
    background:rgba(255,255,255,.07); color:#cfcfdd;
    font-size:9.5px; font-family:inherit; cursor:pointer; transition:.14s;
  }
  .spp:hover:not(:disabled){background:rgba(255,255,255,.17); color:#fff}
  .spp:disabled{opacity:.28; cursor:default}
  .sp-count{
    flex:1; text-align:center; font-size:11.5px; color:#a4a4b4;
    font-variant-numeric:tabular-nums;
  }

  /* ============ 消息中心 ============ */
  .mspanel{
    position:fixed; z-index:73; width:372px; display:none; flex-direction:column;
    border:1px solid rgba(255,255,255,.12); border-radius:16px;
    background:rgba(26,26,33,.975);
    -webkit-backdrop-filter:blur(28px) saturate(160%);
    backdrop-filter:blur(28px) saturate(160%);
    box-shadow:0 28px 68px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.07);
    overflow:hidden;
  }
  .mspanel.on{display:flex; animation:umIn .14s ease-out}
  .ms-head{display:flex; align-items:center; gap:7px; padding:12px 11px 9px}
  .ms-ico{width:15px; height:15px; color:#c9c9d8; flex:none}
  .ms-title{font-size:13px; font-weight:600; color:#ececf4; letter-spacing:.2px}
  .ms-x{
    margin-left:auto; width:22px; height:22px; padding:0; border:0; border-radius:7px;
    background:transparent; color:#9a9aab; font-size:16px; line-height:1; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
  }
  .ms-x:hover{background:rgba(255,255,255,.1); color:#fff}
  /* 运维解答 / 官方消息：一条轨道里两等分的分段控件 */
  .ms-tabs{
    display:flex; gap:3px; margin:0 11px 9px; padding:3px; border-radius:10px;
    background:rgba(255,255,255,.06);
  }
  .mst{
    flex:1; height:27px; border:0; border-radius:8px; background:transparent;
    color:#a2a2b2; font-size:11.5px; font-family:inherit; cursor:pointer;
    display:flex; align-items:center; justify-content:center; gap:4px; transition:.15s;
  }
  .mst:hover{color:#eaeaf4}
  .mst.on{background:rgba(255,255,255,.15); color:#fff; box-shadow:0 1px 2px rgba(0,0,0,.28)}
  .mst i{
    font-style:normal; font-size:9.5px; opacity:.6; font-variant-numeric:tabular-nums;
  }
  .mst.on i{opacity:.85}
  .ms-list{
    display:flex; flex-direction:column; min-height:0; padding:0 6px 7px;
    overflow-y:auto; overscroll-behavior:contain;
  }
  .ms-list::-webkit-scrollbar{width:8px}
  .ms-list::-webkit-scrollbar-track{background:transparent}
  .ms-list::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.18); border-radius:99px;
    border:2px solid transparent; background-clip:padding-box;
  }
  .ms-list::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.32); background-clip:padding-box}
  @supports not (selector(::-webkit-scrollbar)){
    .ms-list{scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.22) transparent}
  }
  .ms-item{
    display:flex; gap:10px; width:100%; padding:9px 7px; border:0; border-radius:11px;
    background:transparent; color:inherit; font-family:inherit; text-align:left;
    cursor:pointer; transition:background .12s;
  }
  .ms-item:hover{background:rgba(255,255,255,.07)}
  /* 消息图标：和顶栏一致 —— 细线条图标 + 淡淡一圈底，不用实心蓝圆 */
  .ms-ic{
    width:32px; height:32px; border-radius:50%; flex:none; display:grid; place-items:center;
    color:#cbcbdc;
    background:rgba(255,255,255,.055);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.1);
  }
  .ms-ic svg{width:16px; height:16px}
  .ms-item:hover .ms-ic{color:#e6e6f2; box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}
  .ms-txt{min-width:0; flex:1; display:flex; flex-direction:column; gap:2px}
  .ms-nm{display:flex; align-items:center; gap:5px; font-size:12.2px; line-height:1.35}
  .ms-nm b{
    flex:1; min-width:0; font-weight:600; color:#ececf4;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .ms-newdot{
    width:6px; height:6px; border-radius:50%; flex:none;
    background:#6f8ff5; box-shadow:0 0 7px rgba(111,143,245,.85);
  }
  .ms-desc{
    font-size:11px; color:#9b9bab; line-height:1.5;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  }
  .ms-time{font-size:10px; color:#6f6f7f; margin-top:1px}
  .ms-empty{padding:44px 12px; text-align:center; font-size:12px; color:#6f6f7d}
  .ms-empty b{display:block; margin-bottom:6px; font-size:12.5px; font-weight:600; color:#a9a9b9}
  .ms-empty span{display:block; line-height:1.7}

  /* ---- 运维解答：聊天窗 ---- */
  .mspanel.chat{height:min(520px, calc(100vh - 120px))}
  .ms-chat{display:none; flex:1; min-height:0; flex-direction:column}
  .mspanel.chat .ms-chat{display:flex}
  .mspanel.chat .ms-list{display:none}
  .msc-list{
    flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain;
    display:flex; flex-direction:column; gap:10px; padding:2px 12px 10px;
    user-select:text; -webkit-user-select:text;
  }
  /* 消息少的时候贴着输入框排（聊天窗的常规样子），多了才从顶上滚 */
  .msc-list::before{content:''; margin-top:auto}
  .msc-row{display:flex; gap:8px; align-items:flex-start}
  .msc-row.me{flex-direction:row-reverse}
  .msc-ava{
    width:24px; height:24px; border-radius:50%; flex:none; display:grid; place-items:center;
    color:#cbcbdc; background:rgba(255,255,255,.055);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.1); margin-top:2px;
  }
  .msc-ava svg{width:13px; height:13px}
  .msc-mid{min-width:0; max-width:min(calc(100% - 34px), 80%); display:flex; flex-direction:column; gap:3px}
  .msc-row.me .msc-mid{align-items:flex-end}
  .msc-bub{
    padding:8px 11px; border-radius:12px; font-size:12.2px; line-height:1.62;
    color:#e4e4ef; background:rgba(255,255,255,.07);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
    word-break:break-word; overflow-wrap:anywhere; white-space:pre-wrap;
    /* 消息正文必须能选中复制（母版 body 上是 user-select:none） */
    user-select:text; -webkit-user-select:text; cursor:text;
  }
  .msc-row.me .msc-bub{
    color:#14141a; background:rgba(244,244,249,.92); box-shadow:none;
  }
  .msc-bub img{
    display:block; max-width:100%; max-height:180px; border-radius:9px; margin:1px 0;
    object-fit:cover; cursor:zoom-in; -webkit-user-drag:none;
  }
  .msc-bub img + img{margin-top:6px}
  .msc-time{font-size:9.5px; color:#6f6f7f; letter-spacing:.2px; user-select:text; -webkit-user-select:text}
  .msc-sys{
    align-self:center; max-width:88%; padding:4px 10px; border-radius:8px;
    font-size:10.5px; line-height:1.6; color:#8a8a9a; text-align:center;
    background:rgba(255,255,255,.04); user-select:text; -webkit-user-select:text;
  }
  .msc-empty{
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:7px; padding:26px 20px 30px; text-align:center;
  }
  .msc-empty svg{
    width:26px; height:26px; color:#8e8ea1; margin-bottom:2px;
  }
  .msc-empty b{font-size:12.8px; font-weight:600; color:#e2e2ee}
  .msc-empty span{font-size:11.5px; line-height:1.75; color:#8a8a9a; max-width:250px}
  .msc-bar{
    display:flex; align-items:flex-end; gap:6px; padding:9px 10px 11px;
    border-top:1px solid rgba(255,255,255,.07); flex:none;
  }
  .msc-ib{
    width:30px; height:30px; flex:none; padding:0; border:0; border-radius:9px;
    display:grid; place-items:center; cursor:pointer;
    background:rgba(255,255,255,.06); color:#c2c2d2; transition:.14s;
  }
  .msc-ib svg{width:15px; height:15px}
  .msc-ib:hover{background:rgba(255,255,255,.14); color:#fff}
  .msc-in{
    flex:1; min-width:0; min-height:30px; max-height:104px; resize:none;
    padding:6px 10px; border-radius:9px; border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.05); color:#ececf4;
    font:inherit; font-size:12.2px; line-height:1.55; outline:0;
    transition:border-color .14s, background .14s;
  }
  .msc-in::placeholder{color:#7a7a8c}
  .msc-in:focus{border-color:rgba(255,255,255,.3); background:rgba(255,255,255,.08)}
  /* 输入框和消息列表的滚动条：跟全站同一套细胶囊，别用系统那条带箭头的白粗条 */
  .msc-in::-webkit-scrollbar{width:8px}
  .msc-in::-webkit-scrollbar-track{background:transparent; margin:4px 0}
  .msc-in::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.22); border-radius:99px;
    border:2px solid transparent; background-clip:padding-box;
  }
  .msc-in::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.36); background-clip:padding-box}
  .msc-list::-webkit-scrollbar{width:8px}
  .msc-list::-webkit-scrollbar-track{background:transparent}
  .msc-list::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.2); border-radius:99px;
    border:2px solid transparent; background-clip:padding-box;
  }
  .msc-list::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.34); background-clip:padding-box}
  @supports not (selector(::-webkit-scrollbar)){
    .msc-in, .msc-list{scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.24) transparent}
  }
  body.light .msc-in::-webkit-scrollbar-thumb,
  body.light .msc-list::-webkit-scrollbar-thumb{background:rgba(20,20,30,.22); background-clip:padding-box}
  body.light .msc-in::-webkit-scrollbar-thumb:hover,
  body.light .msc-list::-webkit-scrollbar-thumb:hover{background:rgba(20,20,30,.36); background-clip:padding-box}
  .msc-send{
    flex:none; height:30px; padding:0 13px; border:0; border-radius:9px;
    background:#f0f0f5; color:#191920; font-size:12px; font-weight:500;
    font-family:inherit; cursor:pointer; transition:.14s;
  }
  .msc-send:hover{background:#fff}
  .msc-send:active{transform:scale(.96)}

  /* 站内看图：聊天里点图片就在本站弹层里放大，不再跳浏览器自带的看图页 */
  .imgview{
    position:fixed; inset:0; z-index:150; display:none; place-items:center; padding:44px 40px;
    background:rgba(6,7,11,.82);
    -webkit-backdrop-filter:blur(16px) saturate(150%);
    backdrop-filter:blur(16px) saturate(150%);
  }
  .imgview.on{display:grid; animation:ivIn .16s ease-out}
  @keyframes ivIn{from{opacity:0} to{opacity:1}}
  .imgview img{
    max-width:min(94vw,1500px); max-height:86vh; border-radius:12px; display:block;
    background:#0b0b10; box-shadow:0 34px 96px rgba(0,0,0,.72);
    cursor:zoom-out; -webkit-user-drag:none;
  }
  .imgview .ivx{
    position:absolute; right:20px; top:18px; width:34px; height:34px; padding:0;
    border:1px solid rgba(255,255,255,.16); border-radius:11px; cursor:pointer;
    background:rgba(255,255,255,.08); color:#eaeaf4; font-family:inherit;
    display:grid; place-items:center; transition:.14s;
  }
  .imgview .ivx:hover{background:rgba(255,255,255,.18); color:#fff}
  .imgview .ivt{
    position:absolute; left:0; right:0; bottom:14px; text-align:center;
    font-size:10.5px; color:rgba(255,255,255,.5); letter-spacing:.3px;
  }
  body.light .imgview{background:rgba(244,245,250,.9)}
  body.light .imgview img{box-shadow:0 30px 80px rgba(20,20,45,.32)}
  body.light .imgview .ivx{background:rgba(255,255,255,.9); border-color:rgba(20,20,30,.14); color:#2a2a36}
  body.light .imgview .ivx:hover{background:#fff; color:#000}
  body.light .imgview .ivt{color:rgba(28,28,40,.5)}

  /* ============ 消息详情弹窗 ============ */
  .msg-panel{
    width:min(660px, 94vw); max-height:86vh; display:flex; flex-direction:column;
    background:var(--node); border:1px solid var(--line-2); border-radius:18px;
    box-shadow:0 30px 80px rgba(0,0,0,.65); overflow:hidden;
  }
  .msg-head{display:flex; align-items:center; gap:6px; padding:14px 14px 10px 18px}
  .msg-title{font-size:13.5px; font-weight:600; color:#ececf4}
  .msg-hd{
    width:26px; height:26px; margin-left:0; padding:0; border:0; border-radius:7px;
    background:transparent; color:#9a9aab; cursor:pointer;
    display:flex; align-items:center; justify-content:center; transition:.14s;
  }
  .msg-hd:hover{background:rgba(255,255,255,.1); color:#fff}
  .msg-hd svg{width:14px; height:14px}
  .msg-hd.x{font-size:17px; line-height:1}
  .msg-head .medit{margin-left:auto}
  .msg-panel.editing .medit{background:rgba(111,143,245,.2); color:#b9caff}
  .msg-tools{display:none; align-items:center; gap:6px; padding:0 18px 9px; flex-wrap:wrap}
  .msg-panel.editing .msg-tools{display:flex}
  .mtool{
    height:25px; padding:0 9px; border:1px solid rgba(255,255,255,.14); border-radius:7px;
    background:rgba(255,255,255,.06); color:#d8d8e4; font-size:11px; font-family:inherit;
    cursor:pointer; transition:.14s;
  }
  .mtool:hover{background:rgba(255,255,255,.14); color:#fff}
  .mtool b{font-weight:700}
  .mtool i{font-style:italic}
  .msg-tip{font-size:10.5px; color:#7c7c8c; line-height:1.5}
  .msg-body{flex:1; min-height:0; overflow-y:auto; padding:0 26px 4px; overscroll-behavior:contain}
  .msg-h{font-size:15.5px; line-height:1.65; font-weight:600; color:#f2f2f8; margin:2px 0 9px}
  .msg-date{font-size:11px; color:#75758a; margin-bottom:14px}
  .msg-rich{font-size:13.4px; line-height:2; color:#dcdce8; letter-spacing:.2px}
  .msg-rich p{margin:0 0 12px}
  .msg-rich p:last-child{margin-bottom:0}
  .msg-rich strong{color:#f4f4fa}
  .msg-rich a{
    color:#8ab4ff; text-decoration:none;
    border-bottom:1px solid rgba(138,180,255,.38); transition:.14s;
  }
  .msg-rich a:hover{color:#aecbff; border-bottom-color:#aecbff}
  .msg-rich img{
    display:block; max-width:100%; max-height:260px; width:auto; height:auto;
    object-fit:contain; border-radius:12px; margin:14px auto;
    box-shadow:0 0 0 1px rgba(255,255,255,.07);
  }
  .msg-rich ul, .msg-rich ol{margin:0 0 12px; padding-left:20px}
  .msg-rich li{margin:2px 0}
  .msg-rich[contenteditable="true"]{
    outline:1px dashed rgba(255,255,255,.24); outline-offset:10px;
    border-radius:6px; min-height:140px; cursor:text;
  }
  .msg-rich[contenteditable="true"]:focus{outline-color:rgba(111,143,245,.7)}
  .msg-foot{
    display:flex; justify-content:flex-end; gap:8px; padding:12px 16px 14px;
    border-top:1px solid rgba(255,255,255,.06); margin-top:6px;
  }
  .msg-btn{
    height:30px; padding:0 16px; border:0; border-radius:9px;
    background:rgba(255,255,255,.1); color:#eaeaf4; font-size:12px;
    font-family:inherit; cursor:pointer; transition:.14s;
  }
  .msg-btn:hover{background:rgba(255,255,255,.17)}
  .msg-btn.primary{background:#f0f0f5; color:#191920; font-weight:500}
  .msg-btn.primary:hover{background:#fff}
  .msg-btn[hidden]{display:none}

  @media (max-width: 760px){
    /* 顶栏按钮在手机上太挤：缩字号、收紧间距，免得换行把画布顶下去 */
    header.bar{gap:6px; padding:0 10px; height:48px}
    header.bar .tbtn, header.bar .chip{font-size:11px; padding:0 7px; height:26px}
    /* 再窄一点：只留 logo 和「本画布消耗」的金额，其它文字全收掉（否则会竖着一字一行） */
    header.bar .brand span{display:none}
    header.bar .chip{padding:0 6px; gap:0}
    header.bar .costchip .cc-lab{display:none}
    header.bar .costchip{padding:0 8px; font-size:11px}
    /* 五个入口在手机上按 28px 排，整组连同头像一起收窄，别把画布名挤掉 */
    header.bar .hgroup{gap:0; padding:2px}
    header.bar .hicon{width:27px; height:27px}
    header.bar .hicon svg{width:15px; height:15px}
    header.bar .costchip{height:27px}
    header.bar .ava{width:25px; height:25px; margin-left:3px}
    /* 手机图标只有 25px，角标跟着缩一圈，别把铃铛盖掉一半 */
    header.bar .nbadge{
      min-width:13px; height:13px; padding:0 3px; line-height:13px;
      font-size:8.5px; right:-1px; top:-1px; border-radius:8px;
    }
    header.bar .pwrap #canvasName{max-width:72px}
    /* 超窄屏（安卓常见 360/390）：再挤一点，别让胶囊顶出屏幕右边把头像切掉 */
    @media (max-width: 430px){
      header.bar{gap:4px; padding:0 8px}
      header.bar .hgroup{padding:1px}
      header.bar .hicon{width:25px; height:25px}
      header.bar .costchip{height:25px; padding:0 6px; font-size:10.5px}
      header.bar .ava{width:24px; height:24px; margin-left:2px}
      header.bar .pwrap #canvasName{max-width:40px}
      header.bar .penedit{width:14px}
      @media (max-width: 375px){
        header.bar .hicon{width:23px; height:23px}
        header.bar .hicon svg{width:14px; height:14px}
        header.bar .ava{width:22px; height:22px}
        header.bar .pwrap #canvasName{max-width:28px}
        header.bar .costchip{font-size:10px; padding:0 5px}
      }
      @media (max-width: 340px){
        header.bar .hicon{width:21px; height:21px}
        header.bar .ava{width:21px; height:21px}
        header.bar .penedit{display:none}
        header.bar .pwrap #canvasName{max-width:20px}
      }
    }
    /* 左侧导航占了 60px：卡片和预览窗都让出这块，不然会被压在图标底下 */
    .node{max-width:calc(100vw - 88px)}
    .pfloat{width:calc(100vw - 96px)}
    /* 消息面板 / 详情窗在手机上贴边收窄 */
    .mspanel{width:calc(100vw - 20px)}
    .msg-head{padding:12px 10px 8px 14px}
    .msg-body{padding:0 16px 4px}
    .msg-tools{padding:0 14px 8px}
    .msg-h{font-size:14px}
    .pf-head{height:18px}
    /* 手机上没有键盘，底部快捷键提示只会挤成一团 */
    .hint{display:none}
    /* 导航栏缩一圈，往边上贴，别占画布正中的位置；悬停提示在触屏上没意义，关掉 */
    .navrail{left:8px; gap:2px; padding:5px 4px; border-radius:16px}
    .navrail .nv{width:34px; height:34px}
    .navrail .nv svg{width:17px; height:17px}
    .navrail .nv::before{display:none}
    .flswap{margin:0 4px; width:22px; height:22px}
  }
  /* 手机横屏 / 小笔电：高度不够时导航从顶部开始排，不居中，免得压到左下角的缩放条 */
  @media (max-height: 560px){
    .navrail{top:62px; transform:none; gap:2px; padding:5px 4px}
    .navrail .nv{width:32px; height:32px}
  }
  /* 触屏设备的 hit 面积：素材卡和工具按钮抬高到 40px 以上，手指点得着 */
  @media (pointer: coarse){
    .acard{width:60px; height:60px}
    .acard .adel{width:18px; height:18px; font-size:11px}
    .pf-dl{width:22px; height:22px}
    .arail{gap:8px}
    .navrail .nv{width:42px; height:42px}
    .navrail .nv svg{width:21px; height:21px}
    .flswap{width:28px; height:28px}
  }



  /* ============ 白天模式 ============ */
  .zoomer .ico-sun{display:none}
  body.light .zoomer .ico-moon{display:none}
  body.light .zoomer .ico-sun{display:block}

  body.light{
    --bg:#eef0f4;
    --node:rgba(255,255,255,.8);
    --node-2:rgba(255,255,255,.94);
    --field:#ffffff;
    --line:rgba(20,20,30,.1);
    --line-2:rgba(20,20,30,.18);
    --stroke:rgba(20,20,30,.12);
    --stroke-2:rgba(20,20,30,.2);
    --text:#1b1b21;
    --dim:rgba(28,28,40,.64);
    --dim-2:rgba(28,28,40,.42);
    --accent:#1b1b21;
    --accent-2:#3a3a48;
    background:#eef0f4 !important;
    color-scheme:light;
  }
  body.light::before{
    background:radial-gradient(860px 580px at 12% -8%, rgba(122,144,205,.22), transparent 62%),
      radial-gradient(780px 540px at 88% 2%, rgba(255,186,132,.18), transparent 60%),
      radial-gradient(760px 640px at 62% 104%, rgba(150,200,255,.2), transparent 62%),
      radial-gradient(520px 420px at 46% 42%, rgba(200,235,220,.16), transparent 66%) !important;
  }
  body.light #board{background-color:rgba(238,240,244,.86)}
  body.light #board::before{
    background:radial-gradient(900px 560px at 16% -6%, rgba(122,144,205,.14), transparent 64%),
      radial-gradient(760px 500px at 86% 8%, rgba(255,186,132,.1), transparent 60%) !important;
  }
  /* 网格线在浅色下要变成浅灰 */
  body.light #board{
    background-image:linear-gradient(rgba(20,20,30,.055) 1px, transparent 1px),
      linear-gradient(90deg, rgba(20,20,30,.055) 1px, transparent 1px) !important;
  }

  /* 顶栏 / 悬浮控件 */
  body.light .bar, body.light .hbar, body.light .zoomer, body.light .hint,
  body.light .navrail{
    background:rgba(255,255,255,.86) !important;
    border-color:rgba(20,20,30,.1) !important;
    box-shadow:0 10px 30px rgba(20,20,40,.12), inset 0 1px 0 rgba(255,255,255,.9) !important;
  }
  /* 和深色一样：画布顶栏不留底下那条边线（上面那条 border-color 是 !important，这里必须跟着） */
  body.light .bar{border-bottom-color:transparent !important}
  body.light .navrail .nv{color:#3a3a48}
  body.light .navrail .nv:hover{background:rgba(20,20,30,.09); color:#111}
  body.light .navrail .nv::before{
    background:#fff; border-color:rgba(20,20,30,.12); color:#1b1b21;
    box-shadow:0 8px 20px rgba(20,20,40,.16);
  }
  /* 右上账号胶囊 + 菜单 */
  body.light .hgroup{background:rgba(255,255,255,.72); border-color:rgba(20,20,30,.09)}
  body.light .hicon{color:#3d3d4c}
  body.light .hicon:hover{background:rgba(20,20,30,.08); color:#111}
  body.light .hicon.on{background:rgba(20,20,30,.11); color:#111}
  body.light .costchip{background:rgba(20,20,30,.055); color:#22222b}
  body.light .costchip:hover{background:rgba(20,20,30,.1); color:#000}
  body.light .costchip .cc-lab{color:#5a5a6c}
  body.light .ava{box-shadow:0 0 0 1.5px rgba(255,255,255,.95), 0 2px 10px rgba(20,20,40,.2)}
  body.light .ava:hover{box-shadow:0 0 0 1.5px rgba(90,120,220,.7), 0 3px 12px rgba(20,20,40,.26)}
  body.light .ava.on{box-shadow:0 0 0 2px #4b7cf0, 0 4px 12px rgba(75,124,240,.35)}
  body.light .umenu{
    background:rgba(252,252,254,.98); border-color:rgba(20,20,30,.1);
    box-shadow:0 24px 56px rgba(20,20,40,.2), inset 0 1px 0 #fff;
  }
  body.light .ava{background:rgba(20,20,30,.055); color:#17171e}
  /* 蒙层深浅两套都用同一块深色纱：浅色头像上压一层深纱反而更清楚，也和深色模式统一 */
  body.light .um-up{background:rgba(10,10,16,.5)}
  body.light .um-ava{background:rgba(20,20,30,.055); color:#17171e; box-shadow:0 0 0 1px rgba(20,20,30,.1)}
  body.light .um-id b{color:#16161d}
  body.light .um-item{color:#26262f}
  body.light .um-item:hover{background:rgba(20,20,30,.06)}
  body.light .um-item svg{opacity:.68}
  body.light .um-val{color:#111}
  body.light .um-tag{color:#7b7b8e; background:rgba(20,20,30,.06)}
  body.light .um-sw{background:rgba(20,20,30,.2)}
  body.light .um-sw.on{background:#4b7cf0}
  body.light .um-item.danger{color:#d63c3c}
  body.light .um-item.danger:hover{background:rgba(214,60,60,.1)}
  /* 搜索面板 */
  body.light .um-head:hover{background:rgba(20,20,30,.05)}
  body.light .spanel{
    background:rgba(252,252,254,.99); border-color:rgba(20,20,30,.1);
    box-shadow:0 24px 56px rgba(20,20,40,.2), inset 0 1px 0 #fff;
  }
  body.light .sp-ico{color:#8a8a9a}
  body.light .sp-input{color:#1b1b23}
  body.light .sp-input::placeholder{color:#9c9cac}
  body.light .sp-clear{background:rgba(20,20,30,.1); color:#5c5c6c}
  body.light .sp-clear:hover{background:rgba(20,20,30,.18); color:#111}
  body.light .spt{color:#6d6d7e}
  body.light .spt:hover{background:rgba(20,20,30,.06); color:#1b1b23}
  body.light .spt.on{background:rgba(20,20,30,.1); color:#111}
  body.light .sp-item:hover{background:rgba(20,20,30,.055)}
  body.light .sp-th{background:rgba(20,20,30,.07); color:#7a7a8a}
  body.light .sp-idx{background:rgba(20,20,30,.62); color:#fff}
  body.light .sp-play{background:rgba(0,0,0,.45)}
  body.light .sp-name{color:#262630}
  body.light .sp-item.hit .sp-name{color:#000}
  body.light .sp-kind{color:#8a8a9a}
  body.light .sp-empty{color:#8a8a9a}
  body.light .sp-page{border-top-color:rgba(20,20,30,.08)}
  body.light .sp-list::-webkit-scrollbar-thumb{background:rgba(20,20,30,.22); background-clip:padding-box}
  body.light .sp-list::-webkit-scrollbar-thumb:hover{background:rgba(20,20,30,.36); background-clip:padding-box}
  body.light .spp{background:rgba(20,20,30,.07); color:#4a4a58}
  body.light .spp:hover:not(:disabled){background:rgba(20,20,30,.14); color:#111}
  body.light .sp-count{color:#6a6a7a}
  /* 消息中心 + 消息详情 */
  body.light .nbadge{
    --nb-fill:#1d1d26; --nb-line:rgba(255,255,255,.96); --nb-glow:26,26,34;
    color:#f4f4f9;
  }
  body.light .mspanel{
    background:rgba(252,252,254,.99); border-color:rgba(20,20,30,.1);
    box-shadow:0 24px 56px rgba(20,20,40,.2), inset 0 1px 0 #fff;
  }
  body.light .ms-ico{color:#5a6a86}
  body.light .ms-ic{color:#4b556b; background:rgba(20,20,30,.045);
    box-shadow:inset 0 0 0 1px rgba(20,20,30,.09)}
  body.light .ms-item:hover .ms-ic{color:#1b1b23; box-shadow:inset 0 0 0 1px rgba(20,20,30,.16)}
  body.light .ms-title{color:#16161d}
  body.light .ms-x{color:#7a7a8c}
  body.light .ms-x:hover{background:rgba(20,20,30,.08); color:#111}
  body.light .ms-tabs{background:rgba(20,20,30,.06)}
  body.light .mst{color:#6d6d7e}
  body.light .mst:hover{color:#1b1b23}
  body.light .mst.on{background:#fff; color:#111; box-shadow:0 1px 3px rgba(20,20,40,.14)}
  body.light .ms-item:hover{background:rgba(20,20,30,.055)}
  body.light .ms-nm b{color:#1b1b23}
  body.light .ms-desc{color:#6f6f7f}
  body.light .ms-time{color:#9a9aac}
  body.light .ms-empty{color:#8a8a9a}
  body.light .ms-empty b{color:#3a3a48}
  /* 运维解答聊天窗 */
  body.light .msc-ava{color:#4b556b; background:rgba(20,20,30,.045);
    box-shadow:inset 0 0 0 1px rgba(20,20,30,.09)}
  body.light .msc-bub{color:#2a2a36; background:rgba(20,20,30,.05);
    box-shadow:inset 0 0 0 1px rgba(20,20,30,.07)}
  body.light .msc-row.me .msc-bub{color:#fff; background:#1d1d26; box-shadow:none}
  body.light .msc-time{color:#9a9aac}
  body.light .msc-sys{color:#75758a; background:rgba(20,20,30,.045)}
  body.light .msc-empty svg{color:#9aa2b2}
  body.light .msc-empty b{color:#1b1b23}
  body.light .msc-empty span{color:#6f6f7f}
  body.light .msc-bar{border-top-color:rgba(20,20,30,.08)}
  body.light .msc-ib{background:rgba(20,20,30,.06); color:#4a4a58}
  body.light .msc-ib:hover{background:rgba(20,20,30,.14); color:#111}
  body.light .msc-in{background:#fff; border-color:rgba(20,20,30,.16); color:#1b1b23}
  body.light .msc-in::placeholder{color:#9a9aac}
  body.light .msc-in:focus{border-color:rgba(20,20,30,.34)}
  body.light .msc-send{background:#1d1d26; color:#fff}
  body.light .msc-send:hover{background:#2c2c38}
  body.light .msg-panel{
    background:#fff; border-color:rgba(20,20,30,.1);
    box-shadow:0 30px 70px rgba(20,20,40,.26);
  }
  body.light .msg-title{color:#16161d}
  body.light .msg-hd{color:#6d6d7e}
  body.light .msg-hd:hover{background:rgba(20,20,30,.07); color:#111}
  body.light .msg-panel.editing .medit{background:rgba(75,124,240,.14); color:#2f5fd0}
  body.light .msg-h{color:#14141c}
  body.light .msg-date{color:#8a8a9a}
  body.light .msg-rich{color:#2b2b36}
  body.light .msg-rich strong{color:#111}
  body.light .msg-rich a{color:#2f6ae0; border-bottom-color:rgba(47,106,224,.32)}
  body.light .msg-rich a:hover{color:#1f56c4; border-bottom-color:#1f56c4}
  /* 浅色下白底配图会和弹窗底色糊在一起，加一圈极淡的描边 */
  body.light .msg-rich img{box-shadow:0 0 0 1px rgba(20,20,30,.09)}
  body.light .msg-rich[contenteditable="true"]{outline-color:rgba(20,20,30,.24)}
  body.light .msg-rich[contenteditable="true"]:focus{outline-color:rgba(75,124,240,.7)}
  body.light .msg-foot{border-top-color:rgba(20,20,30,.08)}
  body.light .msg-btn{background:rgba(20,20,30,.07); color:#2a2a35}
  body.light .msg-btn:hover{background:rgba(20,20,30,.13)}
  body.light .msg-btn.primary{background:#1b1b21; color:#fff}
  body.light .msg-btn.primary:hover{background:#000}
  body.light .mtool{background:rgba(20,20,30,.05); border-color:rgba(20,20,30,.14); color:#3a3a48}
  body.light .mtool:hover{background:rgba(20,20,30,.11); color:#111}
  body.light .msg-tip{color:#8a8a9a}
  body.light .flswap{
    background:rgba(20,20,30,.05); border-color:rgba(20,20,30,.16); color:#4a4a58;
  }  body.light .flswap:hover:not(:disabled){background:rgba(20,20,30,.11); color:#111}
  body.light .flmenu{
    background:rgba(255,255,255,.97); border-color:rgba(20,20,30,.12);
    box-shadow:0 14px 34px rgba(20,20,40,.18);
  }
  body.light .flmenu .flmi{background:rgba(20,20,30,.06); color:#4a4a58}
  body.light .flmenu .flmi:hover{outline-color:rgba(20,20,30,.5)}
  body.light .tbtn{
    background:rgba(255,255,255,.72) !important;
    border-color:rgba(20,20,30,.13) !important;
    color:#2a2a34 !important;
  }
  body.light .tbtn:hover{background:#fff !important; color:#111}
  body.light .tbtn.primary{
    background:#1b1b21 !important; color:#fff !important; border-color:transparent !important;
    box-shadow:0 6px 18px rgba(20,20,40,.22) !important;
  }
  body.light .tbtn.primary:hover{background:#33333d}
  body.light .chip{
    background:rgba(255,255,255,.72) !important; border-color:rgba(20,20,30,.12) !important; color:#4a4a58 !important;
  }
  body.light button.chip:hover{background:#fff !important; color:#111 !important; border-color:rgba(20,20,30,.24)}
  body.light .hbar .mark{filter:invert(1) drop-shadow(0 1px 6px rgba(20,20,40,.18))}

  /* 节点 */
  body.light .node{
    background:linear-gradient(168deg, rgba(255,255,255,.96), rgba(255,255,255,.88)) !important;
    border-color:rgba(20,20,30,.12) !important;
    box-shadow:0 16px 44px rgba(20,20,40,.14), inset 0 1px 0 rgba(255,255,255,.95) !important;
  }
  body.light .node.video{background:rgba(255,255,255,.92)}
  body.light .node.asset, body.light .node.video{border-color:transparent !important}
  body.light .node.sel{
    border-color:rgba(20,20,30,.55) !important;
    box-shadow:0 0 0 3px rgba(20,20,30,.12), 0 18px 46px rgba(20,20,40,.16) !important;
  }
  body.light .node-head{
    background:linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,0)) !important;
    border-bottom-color:rgba(20,20,30,.08) !important;
  }
  body.light .node-head .t{color:#2a2a34}
  body.light .node-head .idx{background:rgba(20,20,30,.09) !important; color:#33333d}
  body.light .node .x{color:#8a8a98}
  body.light .node .x:hover{background:rgba(220,60,60,.12) !important; color:#c33}
  body.light .node.asset .atag{
    color:rgba(26,26,36,.8); background:none; border:0;
    text-shadow:0 1px 2px rgba(255,255,255,.95), 0 0 8px rgba(255,255,255,.85);
  }
  body.light .node.asset .x{
    background:none; border:0; color:rgba(28,28,40,.52); text-shadow:none;
  }
  body.light .node.asset .x:hover{color:#c33; background:rgba(20,20,30,.07)}
  body.light .node.asset .adl{background:none; border:0; color:rgba(28,28,40,.58); text-shadow:none}
  body.light .node.asset .adl:hover{background:rgba(20,20,30,.08); color:#14141c}
  body.light .node.asset .abody{background:rgba(20,20,30,.05); box-shadow:0 12px 30px rgba(30,32,48,.14)}
  /* 浅色下 body.light .node 的背景是 !important 的，这里必须跟着加 !important 才盖得住 */
  body.light .node.asset.is-aud{
    background:linear-gradient(180deg, rgba(255,255,255,.78), rgba(240,241,247,.86)) !important;
    border-color:rgba(20,20,30,.1) !important;
    border-top-color:rgba(255,255,255,.95) !important;
  }
  body.light .node.asset.is-aud .abody.au{background:rgba(255,255,255,.34); border:0}
  body.light .atime{color:rgba(28,28,40,.6)}
  body.light .apb{background:rgba(20,20,30,.1); color:#20202a}
  body.light .apb:hover{background:rgba(20,20,30,.2)}
  body.light .node.asset .abody.vd{background:#e9eaef}
  body.light .node.asset .abody.vd .apb{background:rgba(255,255,255,.86); border-color:rgba(20,20,30,.1); color:#20202a}

  /* 文本节点 · 白天 */
  body.light .node.text .txi{color:rgba(28,28,40,.42)}
  body.light .node.text .atag{
    color:rgba(26,26,36,.8); background:none; border:0;
    text-shadow:0 1px 2px rgba(255,255,255,.95), 0 0 8px rgba(255,255,255,.85);
  }
  body.light .node.text .x{
    background:none; border:0; color:rgba(28,28,40,.52); text-shadow:none;
  }
  body.light .node.text .x:hover{color:#c33; background:rgba(20,20,30,.07)}
  body.light .node.text .txb{color:rgba(28,28,40,.62)}
  body.light .node.text .txb:hover{color:#111; background:rgba(20,20,30,.07)}
  body.light .node.text .txmode{
    background:rgba(255,255,255,.94); border-color:rgba(20,20,30,.13);
    box-shadow:0 4px 12px rgba(30,32,48,.16);
  }
  body.light .node.text .txmode .txm{color:rgba(28,28,40,.5)}
  body.light .node.text .txmode .txm:hover{color:#14141c}
  body.light .node.text .txmode .txm.on{
    background:rgba(20,20,30,.15); color:#0e0e15;
    box-shadow:inset 0 0 0 1px rgba(20,20,30,.12);
  }
  body.light .node.text.free .txmode{background:rgba(238,244,255,.96); border-color:rgba(46,132,232,.3)}
  body.light .node.text.free .txmode .txm.on{
    background:rgba(46,132,232,.16); color:#12386f;
    box-shadow:inset 0 0 0 1px rgba(46,132,232,.28);
  }
  body.light .node.text .abody.tx{
    background:rgba(255,255,255,.96); border-color:rgba(20,20,30,.12);
    box-shadow:0 12px 30px rgba(30,32,48,.14);
  }
  body.light .node.text .txta{color:#1b1b21; caret-color:#1b1b21}
  body.light .node.text .txta::placeholder{color:rgba(28,28,40,.3)}
  body.light .node.text.editing .abody.tx{
    border-color:rgba(46,132,232,.5);
    box-shadow:0 0 0 1px rgba(46,132,232,.24), 0 12px 30px rgba(30,32,48,.16);
  }

  body.light .txpre .txpre-l{color:rgba(28,28,40,.5)}
  body.light .txpre .txpre-t{
    background:rgba(20,20,30,.05); border-color:rgba(20,20,30,.1); color:rgba(24,24,34,.8);
  }
  body.light .txpre .txpre-t:hover{background:rgba(20,20,30,.1); border-color:rgba(20,20,30,.2)}

  /* 编辑器 / 输入 */
  body.light .ptext, body.light select, body.light .linkbox input, body.light .gal-body input{
    background:#fff !important; border-color:rgba(20,20,30,.13) !important; color:#1b1b21 !important;
  }
  body.light .ptext:empty::before{color:rgba(28,28,40,.34)}
  body.light .ptext:focus, body.light .linkbox input:focus{
    border-color:rgba(20,20,30,.42) !important; box-shadow:0 0 0 3px rgba(20,20,30,.08) !important;
  }
  body.light .mention{
    background:rgba(20,20,30,.09) !important; border-color:rgba(20,20,30,.16) !important; color:#2a2a34 !important;
  }
  /* 滚动条：浅色下用深灰细条，别出现默认那根白底灰块的粗条 */
  @supports not (selector(::-webkit-scrollbar)){
    body.light .ptext{scrollbar-color:rgba(20,20,30,.26) transparent}
  }
  body.light .ptext::-webkit-scrollbar-thumb{background:rgba(20,20,30,.22)}
  body.light .ptext::-webkit-scrollbar-thumb:hover{background:rgba(20,20,30,.36)}
  body.light .ptext::-webkit-scrollbar-thumb:active{background:rgba(20,20,30,.48)}
  body.light .apop img{background:rgba(20,20,30,.05);border-color:rgba(20,20,30,.12)}
  body.light .apop .apop-cap{color:rgba(28,28,40,.55)}
  body.light .expand-btn{background:rgba(20,20,30,.06) !important; color:#5a5a68}
  body.light .expand-btn:hover{background:rgba(20,20,30,.14) !important; color:#111}

  /* 分段控件：浅色下胶囊反过来用深色，白底卡片上才看得见 */
  body.light .modes{background:transparent !important; border-color:transparent !important}
  body.light .modes::before{background:#1b1b21; box-shadow:0 1px 4px rgba(20,20,40,.22)}
  body.light .modes button{color:rgba(28,28,40,.58)}
  body.light .dur-fix i{background:linear-gradient(90deg, rgba(20,20,30,.72), rgba(20,20,30,.34))}
  body.light .modes button:hover{color:#111}
  body.light .modes button.on{background:transparent !important; color:#fff !important; box-shadow:none}

  /* 素材卡 */
  body.light .acard{background:#fff !important; border-color:rgba(20,20,30,.14)}
  body.light .acard:hover{border-color:rgba(20,20,30,.42) !important; background:#fbfbfd}
  body.light .acard.aud{background:rgba(20,20,30,.05) !important; border-color:rgba(20,20,30,.14)}
  body.light .acard .muse{color:#4a4a58}
  body.light .acard .arole{background:rgba(255,255,255,.9) !important; color:#2a2a34}
  body.light .acard .arole.unused{
    background:rgba(255,255,255,.72) !important; color:rgba(26,26,36,.62) !important;
    box-shadow:inset 0 0 0 1px rgba(20,20,30,.26);
    text-shadow:none;
  }
  body.light .acard .adel{background:rgba(255,255,255,.9) !important; color:#c43}
  body.light .arail::-webkit-scrollbar-track{background:rgba(20,20,30,.06) !important}
  body.light .arail::-webkit-scrollbar-thumb{background:rgba(20,20,30,.24) !important}
  body.light .arail::-webkit-scrollbar-thumb:hover{background:rgba(20,20,30,.38) !important}
  body.light .arail::-webkit-scrollbar-thumb:active{background:rgba(20,20,30,.5) !important}
  @supports not (selector(::-webkit-scrollbar)){
    body.light .arail{scrollbar-color:rgba(20,20,30,.26) transparent}
  }
  body.light .linkbox .lbx{background:rgba(20,20,30,.07) !important; color:#5a5a68}

  /* 参数栏 */
  body.light .toolbar{border-top-color:rgba(20,20,30,.08)}
  body.light .dur-auto{
    border-color:rgba(20,20,30,.16) !important; background:rgba(20,20,30,.06) !important; color:#4a4a58 !important;
  }
  body.light .dur-auto.on{background:#1b1b21 !important; color:#fff !important; border-color:transparent}
  body.light .dur-range::-webkit-slider-runnable-track{
    background:linear-gradient(90deg,#1b1b21 0%,#1b1b21 var(--p,20%),
      rgba(20,20,30,.14) var(--p,20%), rgba(20,20,30,.14) 100%) !important;
  }
  body.light .dur-range::-webkit-slider-thumb{
    background:#fff !important; box-shadow:0 1px 4px rgba(0,0,0,.3), 0 0 0 1.5px #1b1b21 !important;
  }
  body.light .dur-val{color:rgba(28,28,40,.6)}
  body.light .send{background:#1b1b21 !important; color:#fff}
  /* 白天：图标按钮（音频开关等）原来是半透明白底+近白图标，浅底上等于隐身 */
  body.light .ctl-ico{
    background:rgba(20,20,30,.06) !important;
    border-color:rgba(20,20,30,.18) !important;
    color:#3a3a48 !important;
  }
  body.light .ctl-ico:hover{
    background:rgba(20,20,30,.13) !important;
    border-color:rgba(20,20,30,.3) !important;
    color:#111 !important;
  }
  body.light .ctl-ico.on{
    background:#1b1b21 !important;
    border-color:transparent !important;
    color:#fff !important;
  }

  /* 白天：参数按钮原本是"半透明白底 + 近白字"，浅底上基本看不见 */
  body.light .ctl{
    background:rgba(20,20,30,.055) !important;
    border-color:rgba(20,20,30,.15) !important;
    color:#2a2a38 !important;
  }
  body.light .ctl:hover{background:rgba(20,20,30,.11) !important; border-color:rgba(20,20,30,.24) !important}
  body.light .ctl-sel.on{background:rgba(20,20,30,.13) !important; border-color:rgba(20,20,30,.3) !important; color:#000 !important}
  body.light .bar-line .ctl.param.on{
    background:rgba(20,20,30,.12) !important; border-color:rgba(20,20,30,.26) !important;
  }
  body.light .bar-line .ctl.param .k{color:rgba(30,30,44,.62) !important}
  body.light .bar-line .ctl.param .v{color:#14141c !important}

  /* 白天：下拉浮层也用浅色毛玻璃 */
  body.light .qmenu{
    background:rgba(250,250,253,.88);
    border-color:rgba(20,20,30,.12);
    box-shadow:0 22px 50px rgba(20,20,30,.22), inset 0 1px 0 rgba(255,255,255,.9);
  }
  body.light .qmenu-t{color:rgba(30,30,44,.55)}
  body.light .qi{color:rgba(26,26,38,.88)}
  body.light .qi:hover{background:rgba(20,20,30,.07); color:#000}
  body.light .qi.on{background:#1b1b21; color:#fff; box-shadow:none}
  body.light .qi em{color:rgba(26,26,38,.42)}
  body.light .qi .sub{color:rgba(26,26,38,.42)}
  body.light .qi.on em, body.light .qi.on .sub{color:rgba(255,255,255,.62)}

  /* 白天：预览框改灰白，和整体 UI 统一；进度字改黑 */
  body.light .vbox{
    background:#f3f4f8 !important; border-color:rgba(20,20,30,.14) !important;
    --pca:rgba(64,116,230,.26); --pcb:rgba(64,116,230,.16);
  }
  body.light .vbox video{background:#eceef3}
  body.light .vbox .vw-body::before{opacity:.5}
  body.light .vbox .vprog{--foamc:rgba(255,255,255,.98); --foamg:rgba(60,110,220,.35)}
  body.light .vbox .vw-foam b{
    background:radial-gradient(circle at 32% 30%, rgba(255,255,255,.98) 0 32%, rgba(52,98,200,.95) 58%, transparent 78%);
    box-shadow:0 0 4px rgba(52,98,200,.45);
  }
  body.light .vbox .vw-body .bub{background:rgba(52,96,200,.45)}
  body.light .vbox .vph.prog{color:#14141c; text-shadow:none}
  body.light .vbox .vph.err{color:#c0392b}
  body.light .vbox-empty{border-color:rgba(20,20,30,.16) !important; color:rgba(28,28,40,.42) !important; background:rgba(20,20,30,.03)}
  body.light .pfloat .vbox{box-shadow:0 16px 44px rgba(20,20,40,.18)}
  body.light .pfloat.sel .vbox{box-shadow:0 0 0 1px rgba(20,20,30,.3), 0 16px 44px rgba(20,20,40,.18)}
  body.light .pfloat.pressing .vbox,
  body.light .pfloat.moving .vbox{box-shadow:0 0 0 1px rgba(20,20,30,.34), 0 12px 30px rgba(20,20,40,.22) !important}
  body.light .pf-head{color:rgba(28,28,40,.45)}
  body.light .pfloat:hover .pf-head{color:rgba(28,28,40,.68)}
  body.light .pfloat .vbox-empty{color:rgba(28,28,40,.34) !important}

  /* 历史面板 */
  body.light .hist{
    background:
      linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,0) 46%),
      linear-gradient(180deg, rgba(255,255,255,.8), rgba(243,244,250,.9)) !important;
    border-color:rgba(20,20,30,.13) !important;
    box-shadow:0 20px 50px rgba(20,20,40,.2), inset 0 1px 0 rgba(255,255,255,.9) !important;
  }
  body.light .hist::-webkit-scrollbar-thumb{background:rgba(20,20,30,.22); background-clip:padding-box}
  body.light .hist::-webkit-scrollbar-thumb:hover{background:rgba(20,20,30,.34); background-clip:padding-box}
  body.light .hist-head{color:rgba(28,28,40,.6)}
  body.light .hit:hover{background:rgba(20,20,30,.05)}
  body.light .hit.on{background:rgba(20,20,30,.09)}
  body.light .hmeta b{color:#1b1b21}
  body.light .hmeta span{color:rgba(28,28,40,.46)}
  body.light .hthumb{background:rgba(20,20,30,.06); border-color:rgba(20,20,30,.12); color:#6a6a78}
  body.light .hdel{background:rgba(220,60,60,.12) !important; color:#c33}

  /* ============ 图片放大按钮 ============
     素材卡 / 生成图片的右下角，鼠标压上去才浮出来（不占画面、不抢角标的位置）。
     双击图片本身也会开同一个看图弹层，按钮只是给「不知道能双击」的人一个入口。 */
  .zbtn{
    position:absolute; right:8px; bottom:8px; z-index:6;
    width:26px; height:26px; padding:0; border-radius:9px; cursor:pointer;
    border:1px solid rgba(255,255,255,.18); background:rgba(12,12,16,.74);
    -webkit-backdrop-filter:blur(10px) saturate(150%); backdrop-filter:blur(10px) saturate(150%);
    color:#e8e8f2; display:grid; place-items:center;
    opacity:0; transform:translateY(3px); pointer-events:none;
    transition:opacity .15s, transform .15s, background .14s;
  }
  .zbtn svg{width:13px; height:13px; display:block}
  .node.asset:hover .zbtn, .node.asset.sel .zbtn,
  .pfloat:hover .zbtn, .pfloat.sel .zbtn{opacity:1; transform:none; pointer-events:auto}
  .zbtn:hover{background:rgba(255,255,255,.2); color:#fff}
  .zbtn:active{transform:scale(.9); color:#fff}
  body.light .zbtn{
    background:rgba(255,255,255,.9); border-color:rgba(20,20,30,.14); color:#22222e;
    box-shadow:0 2px 8px rgba(20,20,40,.16);
  }
  body.light .zbtn:hover{background:#fff; color:#000}

  /* 素材卡的图片是「放大查看」的入口，光标给个提示 */
  .node.asset .abody.im img{cursor:zoom-in}
  .pfloat .vbox img.vimg{cursor:zoom-in}

  /* ============ @ 引用素材列表：滚动条 ============
     以前这里没写 ::-webkit-scrollbar，露出的是系统那条带上下箭头的白粗条，
     和全站其它滚动区域（.ptext / .arail / 消息列表）完全不是一套。
     这里按同一套细胶囊补上：8px 轨道 + 2px 透明边框收窄滑块。 */
  .mlist::-webkit-scrollbar{width:8px; height:8px}
  .mlist::-webkit-scrollbar-track{background:transparent; margin:5px 0}
  .mlist::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.2); border-radius:99px;
    border:2px solid transparent; background-clip:padding-box;
  }
  .mlist::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.34); background-clip:padding-box}
  .mlist::-webkit-scrollbar-thumb:active{background:rgba(255,255,255,.46); background-clip:padding-box}
  .mlist::-webkit-scrollbar-corner{background:transparent}
  @supports not (selector(::-webkit-scrollbar)){
    .mlist{scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.2) transparent}
  }

  /* ============ 放大编辑：提示词前缀 ============
     小窗里「提示词前缀」那一条挂在编辑框上方；放大之后编辑区铺满了，
     把它挪到右上角单独一枝，正文顶部让出一条，不压字。 */
  #bigBody{position:relative}
  #bigBody.on-txpre .ptext{padding-top:56px}
  #bigBody > .txpre{
    position:absolute; top:14px; right:26px; z-index:5;
    margin:0; padding:0; max-width:calc(100% - 52px);
    justify-content:flex-end;
  }

  /* @ 素材列表 */
  body.light .mlist{
    background:rgba(255,255,255,.99) !important; border-color:rgba(20,20,30,.14) !important;
    box-shadow:0 18px 44px rgba(20,20,40,.2), 0 0 0 1px rgba(20,20,30,.04) !important;
  }
  body.light .mi{color:#2a2a34}
  body.light .mi:hover{background:rgba(20,20,30,.06)}
  body.light .mi.on{background:rgba(20,20,30,.1)}
  body.light .mi .muse{background:rgba(20,20,30,.08) !important; color:#3a3a48}
  body.light .mempty{color:rgba(28,28,40,.45)}
  body.light .mlist::-webkit-scrollbar-thumb{
    background:rgba(20,20,30,.2); border:2px solid transparent; background-clip:padding-box;
  }
  body.light .mlist::-webkit-scrollbar-thumb:hover{
    background:rgba(20,20,30,.34); border:2px solid transparent; background-clip:padding-box;
  }
  body.light .mlist::-webkit-scrollbar-thumb:active{
    background:rgba(20,20,30,.46); border:2px solid transparent; background-clip:padding-box;
  }
  body.light .apop{
    background:rgba(255,255,255,.99) !important; border-color:rgba(20,20,30,.14) !important;
    box-shadow:0 18px 44px rgba(20,20,40,.2), 0 0 0 1px rgba(20,20,30,.04) !important;
    color-scheme:light;
  }
  body.light .apop.is-txt .apop-txt{color:#23232d !important}
  body.light .apop.is-txt .apop-txt.empty{color:rgba(28,28,40,.4) !important}
  body.light .apop.is-txt .apop-txt::-webkit-scrollbar-thumb{background:rgba(20,20,30,.18)}
  body.light .apop.is-txt .apop-txt::-webkit-scrollbar-thumb:hover{background:rgba(20,20,30,.3)}

  /* 首页那扇放大窗：底衬要实一点 —— 它底下是首页的广告位，彩色 banner 会透上来 */
  #bigEdit.home .big-panel{background:#131319}
  body.light #bigEdit.home .big-panel{background:rgba(255,255,255,.99) !important}

  /* 弹窗 */
  body.light .modal{background:rgba(226,229,236,.76)}
  body.light .gal-panel, body.light .key-panel, body.light .big-panel{
    background:rgba(255,255,255,.98) !important;
    border-color:rgba(20,20,30,.12) !important;
    box-shadow:0 30px 80px rgba(20,20,40,.24), inset 0 1px 0 rgba(255,255,255,.9) !important;
  }
  body.light .gal-info{background:rgba(247,248,251,.92) !important; border-left-color:rgba(20,20,30,.08)}
  body.light .gal-head{color:#1b1b21}
  body.light .gal-x{color:#8a8a98}
  body.light .gal-x:hover{background:rgba(20,20,30,.08) !important; color:#111}
  body.light .kv dd{color:#22222a}
  body.light .gsec-t{color:rgba(28,28,40,.44)}
  body.light .gprompt{background:#f4f5f8 !important; border-color:rgba(20,20,30,.1) !important; color:#2a2a34}
  body.light .gcopy{border-color:rgba(20,20,30,.16) !important; color:#5a5a68}
  body.light .gcopy:hover{border-color:rgba(20,20,30,.42) !important; color:#111}
  body.light .gal-dl{background:#1b1b21 !important; color:#fff}
  body.light .gal-dl:hover{background:#33333d}
  body.light .gref{background:#f0f1f5 !important; border-color:rgba(20,20,30,.12) !important; color:#7a7a88}
  body.light .gref.aud{
    background:linear-gradient(160deg, rgba(46,110,220,.16), rgba(46,110,220,.05)) !important;
    border-color:rgba(46,110,220,.26) !important; color:#2a4d8f;
  }
  body.light .gref.aud:hover{border-color:rgba(46,110,220,.6) !important}
  body.light .gref .glab{color:#fff; background:linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.6))}
  body.light .gal-empty{color:rgba(28,28,40,.45)}
  body.light .gal-fail{color:#b04a4a}
  body.light .gthumb{background:#e8eaef !important; border-color:rgba(20,20,30,.12)}
  body.light .gthumb.faild{background:#f2f3f7 !important; border-color:rgba(20,20,30,.16)}
  body.light .gthumb .gfail{color:rgba(40,40,56,.5)}
  body.light .gthumb.on{border-color:#1b1b21 !important; box-shadow:0 0 0 2px rgba(20,20,30,.18)}
  body.light .gal-strip{border-top-color:rgba(20,20,30,.08)}
  body.light .gal-stage{background:#f7f8fa}
  /* 左栏本身是深色底，空状态时底部（素材条区域）会露出来 */
  body.light .gal-left{background:#f7f8fa}
  body.light .gal-seg{background:rgba(20,20,30,.06) !important; border-color:rgba(20,20,30,.12) !important;
    box-shadow:0 6px 20px rgba(20,20,40,.12)}
  body.light .gseg-b{color:rgba(28,28,40,.55)}
  body.light .gseg-b:hover{color:#111}
  body.light .gseg-b.on{background:#14141a !important; color:#fff}
  body.light .gal-modes{background:rgba(20,20,30,.06) !important; border-color:rgba(20,20,30,.12) !important;
    box-shadow:0 6px 20px rgba(20,20,40,.12)}
  body.light .gmode-b{color:rgba(28,28,40,.62)}
  body.light .gmode-b:hover{color:#111}
  body.light .gmode-b.on{background:#14141a !important; color:#fff}

  /* 消费记录弹窗 · 浅色 */
  body.light .cost-panel{
    background:rgba(255,255,255,.98) !important; border-color:rgba(20,20,30,.12) !important;
    box-shadow:0 30px 80px rgba(20,20,40,.24), inset 0 1px 0 rgba(255,255,255,.9) !important;
  }
  body.light .cost-title{color:#1b1b21}
  body.light .cost-sum{border-bottom-color:rgba(20,20,30,.09)}
  body.light .cost-sum .cs b{color:#14141a}
  body.light .crow:hover{background:rgba(20,20,30,.05)}
  body.light .cthumb{background:#eef0f4 !important; border-color:rgba(20,20,30,.1); color:#8a8a98}
  body.light .cthumb .cico{color:rgba(20,20,30,.3)}
  body.light .cmeta b{color:#1b1b21}
  body.light .cstat{border-color:rgba(20,20,30,.14); color:#6a6a78}
  body.light .cstat.ok{color:#1a7f52; border-color:rgba(26,127,82,.28); background:rgba(26,127,82,.08)}
  body.light .cstat.bad{color:#b04a4a; border-color:rgba(176,74,74,.26); background:rgba(176,74,74,.07)}
  body.light .cmoney{color:#14141a}
  body.light .cmoney.free{color:rgba(28,28,40,.45)}
  body.light .cost-empty, body.light .cost-tip{color:rgba(28,28,40,.45)}
  body.light .crow.is-new::before{background:linear-gradient(rgba(46,110,220,.9), rgba(46,110,220,0))}
  body.light .crow.just-upd{animation:crowUpdL 1.1s ease-out}
  @keyframes crowUpdL{
    0%{background:rgba(46,110,220,.12)}
    100%{background:transparent}
  }

  /* 白天：连线用深色描边，否则白线画在白底上完全看不见 */
  body.light .link-path{stroke:rgba(20,20,30,.28)}
  body.light .link-path.active{stroke:rgba(40,120,220,.6)}
  body.light .link-path.ok{stroke:rgba(20,20,30,.28)}
  body.light .link-path.bad{stroke:rgba(200,50,50,.6)}
  body.light #tempLink{stroke:rgba(20,20,30,.78)}
  body.light #tempFan .temp-link{stroke:url(#lr); opacity:.9}
  body.light #tempFan circle.temp-hub{fill:#2b6cf6; stroke:rgba(43,108,246,.25); opacity:.95}
  /* 白天：点亮后的淡蓝压深一点，白色药液换成蓝白 */
  body.light .lgrp.on .link-path{stroke:rgba(46,132,232,.85)}
  body.light .lgrp.lit .link-path{stroke:rgba(46,132,232,.9)}
  body.light .lgrp.run .link-path{stroke:rgba(40,120,220,.6)}
  body.light .link-tube{stroke-opacity:.72}  body.light .lfw.b{filter:blur(.85px) drop-shadow(0 0 4px rgba(60,140,240,.5))}
  body.light .lfw.b .lf1, body.light .lfw.b .lf2, body.light .lfw.b .lf3{stroke:#2e84e8}
  body.light .lfw.b .lf4{stroke:#1668d8}
  body.light #scissor{
    color:#1b1b21;
    filter:drop-shadow(0 2px 6px rgba(20,20,40,.22));
  }
  body.light #scissor::before{background:rgba(255,255,255,.92); box-shadow:0 0 0 1px rgba(20,20,30,.12) inset}
  body.light #scissor.armed{
    background:#fff; box-shadow:0 0 0 1px rgba(20,20,30,.16), 0 6px 18px rgba(20,20,40,.22);
  }
  body.light #scissor.armed:hover{background:#1b1b21; color:#fff}
  body.light .kp-title, body.light .big-title{color:#1b1b21}
  body.light .kp-row .hd .nm{color:#1d1d27}
  body.light .kp-row .hd .cur{color:rgba(28,28,40,.62)}
  body.light .kp-row .hd .cur.ok{color:#15803d}
  body.light .kp-row .hd .cur.warn{color:#9a6209}
  body.light .kp-row .hd .cur.bad{color:#b91c1c}
  body.light .kp-row .hd .st{background:rgba(20,20,30,.22)}
  body.light .kp-row .hd .st.on{background:#16a34a}
  body.light .kp-row .hd .st.inherited{background:#d4911f}
  body.light .kp-cur{color:rgba(28,28,40,.6)}
  body.light .kp-cur code{background:rgba(20,20,30,.07) !important; color:#2a2a34}
  body.light .kp-note{color:rgba(28,28,40,.55)}

  /* 首页 */
  /* 注意：不能写 background 简写 + !important——简写会把 background-clip 一起
     重置成 border-box 且带 !important，后面不带 !important 的 clip:text 就压不住它，
     结果整块渐变被当成底色刷出来（标题变成一条深色长条）。所以必须用 background-image。 */
  body.light .hero h1{
    background-image:linear-gradient(180deg,#1b1b21,#5a5a72) !important;
    -webkit-background-clip:text !important; background-clip:text !important;
    color:transparent !important;
  }
  body.light .hero p{color:rgba(28,28,40,.6)}
  body.light .hnew{
    background:linear-gradient(135deg,#ffffff,#eceef3) !important;
    border-color:rgba(20,20,30,.12) !important; color:#1b1b21 !important;
    box-shadow:0 12px 30px rgba(20,20,40,.14), inset 0 1px 0 #fff !important;
  }
  body.light .hnew .htxt b{color:#1b1b21}
  body.light .hnew .htxt em{color:rgba(28,28,40,.55)}
  body.light .hplus{background:#1b1b21 !important; color:#fff}
  body.light .hq{
    background:rgba(255,255,255,.86) !important; border-color:rgba(20,20,30,.1) !important; color:#2a2a34 !important;
  }
  body.light .hq:hover{background:#fff !important; border-color:rgba(20,20,30,.2)}
  body.light .hq em{color:rgba(28,28,40,.48)}
  body.light .pcard{
    background:rgba(255,255,255,.92) !important; border-color:rgba(20,20,30,.1) !important;
    box-shadow:0 8px 24px rgba(20,20,40,.1) !important;
  }
  body.light .pcard:hover{border-color:rgba(20,20,30,.3) !important; box-shadow:0 16px 40px rgba(20,20,40,.16)}
  body.light .pinfo b{color:#1b1b21}
  body.light .pinfo span{color:rgba(28,28,40,.5)}
  body.light .hempty{border-color:rgba(20,20,30,.14) !important; color:rgba(28,28,40,.45)}
  body.light .hsec-head h2{color:#1b1b21}
  body.light .hcnt{background:rgba(20,20,30,.07) !important; color:rgba(28,28,40,.55)}
  body.light .hbar{background:rgba(255,255,255,.86) !important; border-color:rgba(20,20,30,.1) !important}
  body.light #home .brand span{color:#1b1b21}
  body.light #home .brand small{color:rgba(28,28,40,.45)}
  body.light .pmenu>button{background:rgba(255,255,255,.9) !important; color:#3a3a48 !important; border-color:rgba(20,20,30,.14)}
  body.light .pmenu .pm{background:#fff !important; border-color:rgba(20,20,30,.14) !important; box-shadow:0 14px 34px rgba(20,20,40,.2)}
  body.light .pmenu .pm button{color:#2a2a34}
  body.light .pmenu .pm button:hover{background:rgba(20,20,30,.06)}
  body.light .pmenu .pm button.danger{color:#c33}

  /* 首页：生成 / 画布 双模式 · 浅色 */
  body.light .hseg{background:rgba(20,20,30,.055) !important; border-color:rgba(20,20,30,.12) !important}
  body.light .hseg-b{color:rgba(28,28,40,.55)}
  body.light .hseg-b:hover{color:#111}
  body.light .hseg-b.on{background:#14141a !important; color:#fff; box-shadow:0 6px 16px rgba(20,20,40,.22)}
  body.light .hc{
    background:linear-gradient(180deg,#ffffff,#f2f3f7) !important;
    border-color:rgba(20,20,30,.11) !important;
    box-shadow:0 22px 58px rgba(20,20,40,.14), inset 0 1px 0 #fff !important;
  }
  body.light .hc:focus-within{border-color:rgba(20,20,30,.26) !important;
    box-shadow:0 22px 58px rgba(20,20,40,.14), 0 0 0 3px rgba(20,20,30,.05), inset 0 1px 0 #fff !important}
  body.light #hcText{color:#1b1b21}
  body.light #hcText:empty::before{color:rgba(28,28,40,.38)}
  body.light .hc-dur{border-left-color:rgba(20,20,30,.12)}
  body.light .hc-add{background:rgba(255,255,255,.9); border-color:rgba(20,20,30,.24); color:rgba(28,28,40,.62)}
  body.light .hc-add:hover{background:#fff; border-color:rgba(20,20,30,.3); color:#14141a}
  /* 空态那颗虚线方片：.hc-refs.is-empty .hc-add 的权重比 body.light .hc-add 高，得单独再写一条 */
  body.light .hc-refs.is-empty .hc-add{
    background:rgba(20,20,30,.03); border-color:rgba(20,20,30,.22); color:rgba(28,28,40,.55);
  }
  body.light .hc-refs.is-empty .hc-add:hover{
    background:rgba(20,20,30,.07); border-color:rgba(20,20,30,.34); color:#14141a;
  }
  /* 浅色下白边压在白底上等于没有：白边外面再补一圈很淡的描边，照片的边才立得起来 */
  body.light .hc-tile{
    background:#eef0f4;
    box-shadow:0 0 0 2px #fff, 0 0 0 3px rgba(20,20,30,.1), 0 8px 18px rgba(20,20,40,.18);
  }
  body.light .hc-refs:hover .hc-tile,
  body.light .hc-refs.dragging .hc-tile{
    box-shadow:0 0 0 2px #fff, 0 0 0 3px rgba(20,20,30,.14), 0 12px 24px rgba(20,20,40,.22);
  }
  /* 浅色下被拎起来那张：白晕在黑底上才好看，白底上要换成深一点的投影 */
  body.light .hc-tile.drag{
    box-shadow:0 0 0 2px #fff, 0 0 0 3px rgba(20,20,30,.18), 0 22px 40px rgba(20,20,40,.34);
  }
  body.light .hc-refs::before{
    background:linear-gradient(180deg,#ffffff,#f4f5f9);
    border-color:rgba(20,20,30,.12); box-shadow:0 18px 40px rgba(20,20,40,.18);
  }
  body.light .hc-kind{background:rgba(20,20,30,.05); border-color:rgba(20,20,30,.1)}
  body.light .hc-kind button{color:rgba(28,28,40,.55)}
  body.light .hc-kind button:hover{color:#111}
  body.light .hc-kind button.on{background:#14141a; color:#fff}
  body.light .hc .ctl{background:rgba(20,20,30,.05); border-color:rgba(20,20,30,.1); color:rgba(28,28,40,.72)}
  body.light .hc .ctl:hover{background:rgba(20,20,30,.09); color:#111}
  body.light .hc .send{background:#14141a; color:#fff}
  body.light .hc .send:hover{background:#2a2a36}
  body.light .haddots button{background:rgba(20,20,30,.2)}
  body.light .haddots button.on{background:rgba(20,20,30,.75)}
  body.light .had{border-color:rgba(20,20,30,.16); box-shadow:0 18px 40px rgba(20,20,40,.24)}
  /* 浅色底下 .5 的半透明会把两侧卡片冲成一片粉白，抬到 .68 才看得出是同一套配色 */
  body.light .had.pv, body.light .had.nx{opacity:.68}

  /* 提示条 / toast */
  body.light .hint{color:rgba(28,28,40,.55)}
  body.light .toast{
    background:rgba(255,255,255,.98) !important; color:#1b1b21 !important;
    border-color:rgba(20,20,30,.12) !important; box-shadow:0 16px 40px rgba(20,20,40,.2) !important;
  }
  body.light .dropzone{background:rgba(238,240,244,.86)}
  body.light .dropzone .dz{border-color:rgba(20,20,30,.4) !important; background:rgba(255,255,255,.8) !important; color:#2a2a34}

  /* 白天：同样扁平，卡片内不留方框 */
  body.light .node{border-color:transparent !important}
  body.light .node.asset, body.light .node.video{border-color:transparent !important}
  body.light .node.sel{
    border-color:transparent !important;
    box-shadow:0 0 0 1px rgba(20,20,30,.26), 0 0 0 4px rgba(20,20,30,.06), 0 22px 56px rgba(20,20,40,.18) !important;
  }
  body.light .node-head{border-bottom:0 !important; background:transparent !important}
  body.light .node-head .idx{background:transparent !important; color:rgba(28,28,40,.38) !important}
  body.light .modes{background:transparent !important; border:0 !important}
  body.light .modes button{color:rgba(28,28,40,.52) !important}
  body.light .modes button:hover{color:#111 !important; background:transparent !important}
  body.light .modes button.on{background:transparent !important; color:#fff !important; box-shadow:none !important}
  body.light .acard{background:transparent !important; border:0 !important}
  body.light .acard:hover{background:rgba(20,20,30,.06) !important; border:0 !important}
  body.light .acard.aud{background:rgba(20,20,30,.06) !important; border:0 !important}
  body.light .acard.up{background:rgba(20,20,30,.05) !important; border:0 !important; color:rgba(28,28,40,.5) !important}
  body.light .acard.up:hover{background:rgba(20,20,30,.11) !important; color:#111 !important}
  /* 首尾帧空槽：这套浅色规则会把 .acard 的边框清掉，这里显式补回虚线 */
  body.light .acard.flslot.empty{
    border:1px dashed rgba(20,20,30,.24) !important; color:rgba(28,28,40,.42) !important;
    background:transparent !important;
  }
  body.light .acard.flslot.empty:hover{
    border-color:rgba(20,20,30,.42) !important; color:#111 !important; background:rgba(20,20,30,.06) !important;
  }
  /* 文本卡跟音频卡同一档底色；角标沿用上面「浅底深字」，别让白字白底糊掉 */
  body.light .acard.txt{background:rgba(20,20,30,.06) !important; border:0 !important}
  body.light .acard.txt:hover{background:rgba(20,20,30,.1) !important}
  body.light .acard.txt .muse{color:rgba(26,26,36,.82) !important}
  body.light .acard.txt .arole{background:rgba(255,255,255,.92) !important; color:rgba(26,26,36,.8) !important}
  body.light .acard.txt .afree{color:#2a6ad0 !important; text-shadow:none}
  body.light .ptext{background:transparent !important; border:0 !important}
  body.light .ptext:focus{background:transparent !important; border:0 !important; box-shadow:none !important}
  body.light .expand-btn{background:transparent !important; color:rgba(28,28,40,.45) !important}
  body.light .expand-btn:hover{background:rgba(20,20,30,.08) !important; color:#111 !important}
  body.light .toolbar{border-top:0 !important}
  body.light .ctl{background:transparent !important; border:0 !important; color:rgba(28,28,40,.72) !important}
  body.light .ctl:hover{background:rgba(20,20,30,.07) !important; border:0 !important}
  body.light .ctl-sel.on{background:rgba(20,20,30,.1) !important; border:0 !important; color:#111 !important}
  body.light .ctl-ico{background:transparent !important; border:0 !important; color:rgba(28,28,40,.5) !important}
  body.light .ctl-ico:hover{background:rgba(20,20,30,.07) !important; color:#111 !important}
  body.light .ctl-ico.on{background:rgba(20,20,30,.1) !important; border:0 !important; color:#111 !important}
  body.light .dur-auto{background:transparent !important; border:0 !important}
  body.light .dur-auto.on{background:#1b1b21 !important; color:#fff !important}
  body.light .bar-line .ctl.param{background:transparent !important; border:0 !important}
  body.light .bar-line .ctl.param.on{background:rgba(20,20,30,.1) !important; border:0 !important}

  /* 预览窗两侧加号 / 素材节点加号：白底深字 */
  body.light .pf-port,
  body.light .plus{
    background:rgba(255,255,255,.94) !important;
    border-color:rgba(20,20,30,.14) !important;
    color:rgba(28,28,40,.72) !important;
    box-shadow:0 4px 12px rgba(20,20,40,.12);
  }
  body.light .pf-port:hover,
  body.light .plus:hover{background:#1b1b21 !important; color:#fff !important; border-color:transparent !important}
  body.light .pfloat .pf-zone .pf-port{color:rgba(28,28,40,.72) !important}

  /* 空白处双击 / 右键：新建节点菜单（浮在指针处，玻璃质感同全局） */
  .nmenu{
    position:fixed; left:0; top:0; z-index:312; width:186px; padding:6px;
    display:none; border-radius:14px;
    background:rgba(26,26,33,.985);
    -webkit-backdrop-filter:blur(24px) saturate(180%); backdrop-filter:blur(24px) saturate(180%);
    border:1px solid rgba(255,255,255,.13);
    box-shadow:0 20px 50px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.35);
    color-scheme:dark;
  }
  .nmenu.on{display:block; animation:nmenuIn .12s ease-out}
  @keyframes nmenuIn{from{opacity:0; transform:translateY(-5px) scale(.98)} to{opacity:1; transform:none}}
  .nmenu-t{
    padding:4px 8px 6px; font-size:10px; letter-spacing:.5px;
    color:rgba(255,255,255,.34); user-select:none;
  }
  .nmi{
    display:flex; align-items:center; gap:9px; height:30px; padding:0 8px;
    border-radius:8px; cursor:pointer; font-size:12.5px; color:#dcdce6;
    user-select:none; transition:background .12s, color .12s;
  }
  /* .nmi 自己写了 display:flex，会把 UA 的 [hidden]{display:none} 压掉，
     粘贴 / 复制 / 打组这些按状态显隐的行必须补这一条，否则「剪贴板空了还摆着粘贴」 */
  .nmi[hidden]{display:none}
  .nmi:hover{background:rgba(255,255,255,.075)}
  .nmi:active{background:rgba(255,255,255,.12)}
  .nmi svg{width:14px; height:14px; flex:0 0 auto; opacity:.8}
  .nmi:hover svg{opacity:1}
  /* 粘贴项右边的快捷键提示，和右键菜单的 <em> 一个读法 */
  .nmenu .nkey{margin-left:auto; font-style:normal; font-size:10px; color:rgba(255,255,255,.34)}
  .nmenu-sep{height:1px; margin:5px 7px; background:rgba(255,255,255,.09)}
  .nmenu-sep[hidden]{display:none}
  body.light .nmenu .nkey{color:rgba(28,28,40,.42)}
  body.light .nmenu-sep{background:rgba(20,20,30,.1)}
  .nmi .nsoon{
    margin-left:auto; font-size:9.5px; letter-spacing:.2px;
    color:rgba(255,255,255,.4);
  }
  .nmi.soon{color:rgba(255,255,255,.62)}
  .nmi.soon svg{opacity:.5}
  .nmi.soon:hover{color:rgba(255,255,255,.86)}
  body.light .nmenu{
    background:rgba(252,252,254,.99); border-color:rgba(20,20,30,.12); color-scheme:light;
    box-shadow:0 20px 50px rgba(20,20,40,.18), 0 0 0 1px rgba(20,20,30,.05);
  }
  body.light .nmenu-t{color:rgba(28,28,40,.4)}
  body.light .nmi{color:#24242c}
  body.light .nmi:hover{background:rgba(20,20,30,.06)}
  body.light .nmi.soon{color:rgba(28,28,40,.55)}
  body.light .nmi.soon:hover{color:#111}
  body.light .nmi .nsoon{color:rgba(28,28,40,.44)}

  /* ---------------- 资产库（资产 / 人物 / 场景 / 音色 / 文本） ----------------
     面板本身和「生成记录」用同一套玻璃质感：底色压得比画布亮一点，
     外圈 1px 高光 + 大投影，看起来是浮在画布上的一层，而不是又一块卡片。 */
  .as-panel{
    width:min(1180px,96vw); height:min(780px,92vh); display:flex; flex-direction:column;
    background:rgba(23,23,28,.975);
    -webkit-backdrop-filter:blur(42px) saturate(175%); backdrop-filter:blur(42px) saturate(175%);
    border:1px solid rgba(255,255,255,.14); border-radius:16px;
    box-shadow:0 30px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.08);
    overflow:hidden;
  }
  .as-head{
    flex:0 0 auto; display:flex; align-items:center; gap:10px;
    padding:11px 14px; border-bottom:1px solid rgba(255,255,255,.08);
  }
  .as-tabs{display:flex; align-items:center; gap:2px; min-width:0; overflow-x:auto}
  .as-tabs::-webkit-scrollbar{height:0}
  .as-t{
    flex:0 0 auto; height:30px; padding:0 11px; border:0; border-radius:9px;
    background:transparent; color:var(--dim); font-family:inherit; font-size:12.5px;
    cursor:pointer; display:flex; align-items:center; gap:6px;
    transition:background .15s, color .15s;
  }
  .as-t:hover{color:#e6e6ee; background:rgba(255,255,255,.06)}
  .as-t.on{background:rgba(255,255,255,.13); color:#fff; font-weight:600}
  .as-t i{font-style:normal; font-size:10px; color:rgba(255,255,255,.36); min-width:9px; text-align:center}
  .as-t.on i{color:rgba(255,255,255,.72)}
  .as-head .grow{flex:1}
  .as-search{
    flex:0 0 auto; display:flex; align-items:center; gap:7px; height:30px; padding:0 9px;
    border-radius:9px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.1);
    color:rgba(255,255,255,.42); transition:border-color .15s, background .15s;
  }
  .as-search:focus-within{border-color:rgba(255,255,255,.3); background:rgba(255,255,255,.08)}
  .as-search svg{width:13px; height:13px; flex:0 0 auto}
  .as-search input{
    width:132px; border:0; background:transparent; color:var(--text);
    font-family:inherit; font-size:12px; outline:none; padding:0;
  }
  .as-search input::placeholder{color:rgba(255,255,255,.34)}

  .as-body{flex:1; min-height:0; overflow-y:auto; padding:14px 16px 20px}
  .as-body::-webkit-scrollbar{width:8px}
  .as-body::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.2); border-radius:99px;
    border:2px solid transparent; background-clip:padding-box;
  }
  .as-body::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.32); background-clip:padding-box}
  @supports not (selector(::-webkit-scrollbar)){
    .as-body{scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.22) transparent}
  }
  .as-sec-t{
    font-size:11px; color:rgba(255,255,255,.42); letter-spacing:.4px;
    margin:0 0 9px; display:flex; align-items:center; gap:8px;
  }
  .as-sec-t em{font-style:normal; font-size:10px; color:rgba(255,255,255,.26)}
  /* 标题行：左边「全部资产」，右边删除按钮（有选中才出来） */
  .as-sec-h{display:flex; align-items:center; gap:10px; margin:0 0 9px}
  .as-sec-h .as-sec-t{margin:0}
  .as-delsel{
    margin-left:auto; display:inline-flex; align-items:center; gap:5px;
    height:23px; padding:0 9px 0 7px; border-radius:7px;
    border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.055);
    color:rgba(255,148,148,.94); font-size:11px; font-family:inherit; letter-spacing:.2px;
    cursor:pointer; transition:background .15s, border-color .15s, color .15s;
  }
  .as-delsel svg{width:12px; height:12px; flex:none}
  .as-delsel:hover{background:rgba(255,86,86,.18); border-color:rgba(255,110,110,.52); color:#ffe2e2}
  .as-delsel[hidden]{display:none}
  body.light .as-delsel{border-color:rgba(20,20,30,.14); background:rgba(20,20,30,.04); color:#c23a2f}
  body.light .as-delsel:hover{background:rgba(200,60,50,.12); border-color:rgba(200,60,60,.42); color:#8e2118}
  .as-recent{margin-bottom:20px}
  .as-row{display:flex; gap:10px; overflow-x:auto; padding-bottom:5px}
  .as-row::-webkit-scrollbar{height:6px}
  .as-row::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16); border-radius:99px}
  /* 最近使用那一排跟网格同宽（网格列是 148~154 之间浮动，取 148 视觉上就是一回事），
     一眼能看出「同一批资产，只是被拎到最上面」。 */
  .as-row .as-card{flex:0 0 auto; width:148px}
  .as-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(148px,1fr)); gap:12px}

  /* 卡片：上面正方形缩略图、下面名字 + 「11-24 · PNG · 2.4MB」一行元信息 */
  .as-card{
    position:relative; display:flex; flex-direction:column; min-width:0;
    padding:0; border:1px solid rgba(255,255,255,.09); border-radius:12px;
    background:rgba(255,255,255,.035); cursor:pointer; overflow:hidden;
    text-align:left; font-family:inherit;
    transition:border-color .15s, background .15s, transform .15s, box-shadow .15s;
  }
  .as-card:hover{border-color:rgba(255,255,255,.34); background:rgba(255,255,255,.06)}
  .as-card.on{border-color:#fff; box-shadow:0 0 0 2px rgba(255,255,255,.2)}
  .as-th{
    position:relative; width:100%; aspect-ratio:1/1; overflow:hidden;
    background:#141419; display:grid; place-items:center;
  }
  .as-th img{width:100%; height:100%; object-fit:cover; display:block}
  .as-th.aud{background:#2b2c33}
  /* 文本资产：一块深色底 + 前四行正文，和图片/音频卡片同尺寸，网格不乱。
     右边留出勾选框 / ✕ 的位置，正文第一行不会被盖住。 */
  .as-th.tx{padding:10px 26px 10px 11px; place-items:start stretch; background:#191a20}
  .as-th.tx .astx{
    display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden;
    font-size:10.5px; line-height:1.75; color:rgba(236,236,246,.72);
    word-break:break-word; white-space:pre-wrap;
  }
  .as-ico{display:block}
  .as-dur{
    position:absolute; left:6px; top:6px; padding:1px 5px; border-radius:5px;
    background:rgba(0,0,0,.6); color:#f0f0f8; font-size:9.5px; letter-spacing:.3px;
    -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
  }
  .as-meta{padding:8px 9px 9px; display:flex; flex-direction:column; gap:3px; min-width:0}
  .as-nmrow{display:flex; align-items:center; gap:5px; min-width:0}
  .as-nm{
    flex:1; min-width:0;
    font-size:11.5px; color:#ececf4; line-height:1.35;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  /* 卡片右下角那竖着的三个点：编辑 / 删除 / 下载。
     常驻但压得很淡，鼠标进卡片才亮起来 —— 平时不抢名字的位置。
     （卡片本体是 <button>，这里必须是 span，button 里不能套 button） */
  .as-more{
    flex:none; width:17px; height:17px; margin-right:-3px; border-radius:5px;
    display:grid; place-items:center; cursor:pointer; user-select:none;
    color:rgba(255,255,255,.34); background:transparent;
    transition:background .14s, color .14s, opacity .14s;
  }
  .as-more svg{width:13px; height:13px}
  .as-card:hover .as-more, .as-more:focus-visible, .as-more.on{color:rgba(255,255,255,.82)}
  .as-more:hover, .as-more.on{background:rgba(255,255,255,.13); color:#fff}
  .as-sub{
    font-size:9.5px; color:rgba(255,255,255,.36); line-height:1.35;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  /* 勾选角标（选择模式）：平时半透明空框，勾上就填白。
     给一点投影 —— 白色角标落在浅色缩略图上（白底人设图）才分得清。 */
  .as-pick{
    position:absolute; right:6px; top:6px; width:18px; height:18px; border-radius:6px;
    border:1.5px solid rgba(255,255,255,.55); background:rgba(10,10,15,.5);
    display:grid; place-items:center; color:transparent;
    box-shadow:0 1px 5px rgba(0,0,0,.45);
    -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);
    transition:background .14s, border-color .14s, color .14s, box-shadow .14s;
  }
  .as-pick svg{width:11px; height:11px}
  .as-card:hover .as-pick{border-color:#fff}
  .as-card.on .as-pick{background:#fff; border-color:#fff; color:#15151a}
  /* 资产卡角标：平时不占视线，鼠标进卡片才浮出一个空心方框（点一下选中，可多选），
     选中后常显白底对勾。卡片上不再放 ✕ —— 删除统一收进「全部资产」右边那颗按钮。 */
  .as-pickbox{
    position:absolute; right:2px; top:2px; width:26px; height:26px; padding:0;
    display:grid; place-items:center; cursor:pointer;
    border:0; background:none; color:rgba(255,255,255,.94);
    -webkit-tap-highlight-color:transparent;
  }
  .as-pickbox svg{
    width:17px; height:17px; grid-area:1/1;
    filter:drop-shadow(0 1px 3px rgba(0,0,0,.5));
    transition:opacity .12s ease, transform .14s ease;
  }
  .as-pickbox .apx-b rect{fill:rgba(10,10,16,.42)}
  .as-pickbox .apx-b{opacity:0; transform:scale(.78)}
  .as-pickbox .apx-c{opacity:0; transform:scale(.78)}
  .as-card:hover .as-pickbox .apx-b,
  .as-pickbox:focus-visible .apx-b{opacity:1; transform:scale(1)}
  .as-pickbox.on .apx-b{opacity:0; transform:scale(.78)}
  .as-card:hover .as-pickbox.on .apx-b{opacity:0; transform:scale(.78)}
  .as-pickbox.on .apx-c{opacity:1; transform:scale(1)}
  .as-pickbox:focus-visible{outline:2px solid rgba(126,166,255,.9); outline-offset:1px; border-radius:8px}
  /* 触屏没有 hover：直接常显方框，不然没法选 */
  @media (hover:none){ .as-pickbox .apx-b{opacity:1; transform:scale(1)} }
  body.light .as-pickbox{color:rgba(28,28,38,.82)}
  body.light .as-pickbox .apx-b rect{fill:rgba(255,255,255,.82)}
  /* 重复收藏时定位到的那张卡：亮两下，之后还留一圈淡蓝，直到提示收掉 */
  @keyframes asHit{
    0%{box-shadow:0 0 0 2px #7ea6ff, 0 0 0 0 rgba(126,166,255,.55)}
    100%{box-shadow:0 0 0 2px #7ea6ff, 0 0 18px 6px rgba(126,166,255,0)}
  }
  .as-card.hit{
    animation:asHit 1.05s ease-out 2; z-index:2;
    box-shadow:0 0 0 2px #7ea6ff, 0 0 16px rgba(126,166,255,.45);
  }
  body.light .as-card.hit{box-shadow:0 0 0 2px #3f6fe0, 0 0 16px rgba(63,111,224,.3)}
  /* 删除（浏览模式，鼠标进卡片才出现，和生成记录缩略图同一套手感） */
  .as-del{
    position:absolute; right:5px; top:5px; width:18px; height:18px; padding:0;
    border:0; border-radius:6px; display:grid; place-items:center; cursor:pointer;
    background:rgba(12,12,17,.66); color:rgba(255,255,255,.86); font-family:inherit;
    -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
    opacity:0; transform:translateY(-3px) scale(.92); transition:.14s;
  }
  .as-card:hover .as-del, .as-card:focus-within .as-del{opacity:1; transform:none}
  .as-del:hover{background:rgba(255,86,86,.92); color:#fff}
  .as-empty{
    grid-column:1/-1; padding:46px 12px; text-align:center;
    color:rgba(255,255,255,.34); font-size:12px; line-height:2;
  }
  .as-empty b{display:block; color:rgba(255,255,255,.6); font-weight:600; margin-bottom:4px; font-size:12.5px}

  /* 资产卡「⋮」弹出的小菜单：编辑 / 删除 / 下载。和右键菜单同一套质感，只是更窄 */
  .ammenu{
    position:fixed; z-index:130; width:142px; padding:5px; display:none;
    background:rgba(32,32,40,.97); border:1px solid rgba(255,255,255,.14); border-radius:11px;
    box-shadow:0 18px 44px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.08);
    -webkit-backdrop-filter:blur(22px) saturate(175%); backdrop-filter:blur(22px) saturate(175%);
  }
  .ammenu.on{display:block; animation:assPop .13s ease-out}
  .ammenu .ass-opt .tick{display:none}
  .ammenu .ass-opt.del{color:#ff9a9a}
  .ammenu .ass-opt.del:hover{background:rgba(255,86,86,.16); color:#ffbcbc}
  .ammenu .ass-opt.del svg{opacity:.9}

  .as-foot{
    flex:0 0 auto; display:flex; align-items:center; gap:10px;
    padding:11px 16px; border-top:1px solid rgba(255,255,255,.08);
  }
  .as-count{font-size:11.5px; color:rgba(255,255,255,.5)}
  .as-count b{color:#fff; font-weight:600}
  .as-foot .grow{flex:1}
  .as-foot .tbtn{height:30px}
  .tbtn:disabled, .tbtn[disabled]{opacity:.42; cursor:default}
  /* 中日韩字形在字框里天生略偏下（12px 字号实测低 1px），纯文字按钮往上补一格；
     带图标的按钮不补 —— 图标本来就是正中的，补了反而会变高。 */
  .tbtn:not(:has(svg)){padding-bottom:2px}
  /* .tbtn 自带 display:flex，会把 hidden 属性压掉 */
  .tbtn[hidden]{display:none}
  .tbtn.primary:disabled, .tbtn.primary[disabled]{
    background:rgba(255,255,255,.1); color:rgba(255,255,255,.4);
    border-color:rgba(255,255,255,.12); box-shadow:none;
  }

  /* 保存到资产库：名称 / 类型 / 预览 / 描述
     注意底色要**不透明**：这个弹窗现在也会盖在资产库上面打开，
     苹果皮肤把 --node 改成了半透明白，直接用 var(--node) 会透过下面的卡片。 */
  .ass-panel{
    width:min(548px,94vw); max-height:min(88vh,720px); display:flex; flex-direction:column;
    background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,0) 38%), #16161c;
    border:1px solid var(--line-2); border-radius:16px;
    box-shadow:0 30px 80px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.07);
    overflow:hidden;
  }
  .ass-head{display:flex; align-items:center; gap:10px; padding:13px 16px; border-bottom:1px solid var(--line)}
  .ass-title{font-size:13px; font-weight:600; color:var(--text)}
  .ass-head .grow{flex:1}
  .ass-body{padding:15px 16px 4px; overflow-y:auto; display:flex; flex-direction:column; gap:13px}
  .ass-body::-webkit-scrollbar{width:8px}
  .ass-body::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.2); border-radius:99px;
    border:2px solid transparent; background-clip:padding-box;
  }
  .ass-row2{display:grid; grid-template-columns:1fr 168px; gap:12px}
  .ass-f{display:flex; flex-direction:column; gap:6px; min-width:0}
  .ass-lb{font-size:11.5px; color:var(--dim)}
  .ass-lb i{font-style:normal; color:#ff7a7a; margin-left:2px}
  .ass-in{
    position:relative; display:flex; align-items:center;
    background:var(--field); border:1px solid var(--line-2); border-radius:10px;
    transition:border-color .15s, box-shadow .15s;
  }
  .ass-in:focus-within{border-color:rgba(255,255,255,.32); box-shadow:0 0 0 3px rgba(255,255,255,.05)}
  .ass-in input{
    flex:1; min-width:0; height:36px; padding:0 10px; border:0; background:transparent;
    color:var(--text); font-family:inherit; font-size:12.5px; outline:none;
  }
  .ass-in input::placeholder{color:var(--dim-2)}
  .ass-in em{font-style:normal; font-size:10.5px; color:var(--dim-2); padding-right:10px; flex:0 0 auto}
  /* 类型：不用系统 <select> —— Windows 上它弹出来是白底灰条，跟整站的玻璃质感两回事。
     自己画一个：同一个输入框外壳 + 一片毛玻璃列表。 */
  .ass-sel{position:relative}
  .ass-selbtn{
    width:100%; height:36px; padding:0 30px 0 10px; border-radius:10px; cursor:pointer;
    display:flex; align-items:center; gap:6px; text-align:left;
    background:var(--field); border:1px solid var(--line-2); color:var(--text);
    font-family:inherit; font-size:12.5px; outline:none;
    transition:border-color .15s, box-shadow .15s, background .15s;
  }
  .ass-selbtn:hover{border-color:rgba(255,255,255,.28)}
  .ass-selbtn[aria-expanded="true"]{
    border-color:rgba(255,255,255,.38); box-shadow:0 0 0 3px rgba(255,255,255,.05);
  }
  .ass-selbtn > span{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .ass-caret{width:12px; height:12px; flex:none; color:var(--dim); transition:transform .18s ease}
  .ass-selbtn[aria-expanded="true"] .ass-caret{transform:rotate(180deg)}
  .ass-pop{
    position:absolute; left:0; right:0; top:calc(100% + 6px); z-index:8; padding:5px;
    display:none; transform-origin:top center;
    background:rgba(32,32,40,.97); border:1px solid rgba(255,255,255,.14); border-radius:11px;
    box-shadow:0 18px 42px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.08);
    -webkit-backdrop-filter:blur(22px) saturate(175%); backdrop-filter:blur(22px) saturate(175%);
  }
  .ass-pop.on{display:block; animation:assPop .13s ease-out}
  @keyframes assPop{from{opacity:0; transform:translateY(-4px)} to{opacity:1; transform:none}}
  .ass-opt{
    width:100%; display:flex; align-items:center; gap:8px; height:32px; padding:0 9px;
    border:0; border-radius:8px; background:transparent; color:rgba(255,255,255,.76);
    font-family:inherit; font-size:12.5px; text-align:left; cursor:pointer;
    transition:background .12s, color .12s;
  }
  .ass-opt:hover{background:rgba(255,255,255,.09); color:#fff}
  .ass-opt.on{background:rgba(255,255,255,.12); color:#fff; font-weight:600}
  .ass-opt .tick{margin-left:auto; width:13px; height:13px; opacity:0; color:#fff}
  .ass-opt.on .tick{opacity:1}
  .ass-opt svg{width:13px; height:13px; flex:none; opacity:.8}
  .ass-prev{
    display:flex; align-items:center; gap:12px; padding:10px;
    background:rgba(255,255,255,.035); border:1px solid var(--line); border-radius:12px;
  }
  .ass-prev .pv{
    width:96px; height:96px; border-radius:9px; overflow:hidden; flex:0 0 auto;
    background:#141419; display:grid; place-items:center;
  }
  .ass-prev .pv img{width:100%; height:100%; object-fit:contain; display:block}
  .ass-prev .pv.aud{background:rgba(63,124,246,.12)}
  .ass-prev .pinfo{min-width:0; display:flex; flex-direction:column; gap:5px}
  .ass-prev .pinfo b{font-size:12px; font-weight:600; color:var(--text); word-break:break-all}
  .ass-prev .pinfo span{font-size:10.5px; color:var(--dim-2)}
  /* 原生播放器改不了内部结构，但 color-scheme 能让它跟着走深色，
     不然在深色弹窗里就是一块惨白的小条 */
  .ass-prev audio{width:100%; max-width:300px; height:32px; color-scheme:dark; border-radius:8px}
  body.light .ass-prev audio{color-scheme:light}
  .ass-prev .ptx{
    max-height:150px; overflow-y:auto; font-size:11.5px; line-height:1.85;
    color:var(--dim); white-space:pre-wrap; word-break:break-word; user-select:text;
  }
  .ass-prev.txprev{align-items:flex-start; flex-direction:column}
  .ass-note{
    width:100%; min-height:74px; max-height:150px; resize:vertical;
    padding:9px 10px; border-radius:10px; background:var(--field);
    border:1px solid var(--line-2); color:var(--text);
    font-family:inherit; font-size:12px; line-height:1.8; outline:none;
    transition:border-color .15s, box-shadow .15s;
  }
  .ass-note:focus{border-color:rgba(255,255,255,.32); box-shadow:0 0 0 3px rgba(255,255,255,.05)}
  .ass-note::placeholder{color:var(--dim-2)}
  .ass-foot{display:flex; align-items:center; gap:8px; padding:13px 16px; border-top:1px solid var(--line)}
  .ass-foot .grow{flex:1}

  /* 素材右键菜单：左边操作名、右边快捷键，和系统菜单一个读法 */
  .cmenu{
    position:fixed; left:0; top:0; z-index:315; width:204px; padding:6px;
    display:none; border-radius:14px;
    background:rgba(26,26,33,.985);
    -webkit-backdrop-filter:blur(24px) saturate(180%); backdrop-filter:blur(24px) saturate(180%);
    border:1px solid rgba(255,255,255,.13);
    box-shadow:0 20px 50px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.35);
    color-scheme:dark;
  }
  .cmenu.on{display:block; animation:nmenuIn .12s ease-out}
  .cmi{
    display:flex; align-items:center; gap:8px; width:100%; height:33px; padding:0 9px;
    border:0; border-radius:8px; background:transparent; color:#dcdce6;
    font-family:inherit; font-size:12.5px; cursor:pointer; text-align:left;
    transition:background .12s, color .12s;
  }
  .cmi:hover{background:rgba(255,255,255,.075)}
  .cmi:active{background:rgba(255,255,255,.12)}
  .cmi span{flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  .cmi em{font-style:normal; font-size:10.5px; color:rgba(255,255,255,.32); letter-spacing:.2px}
  .cmi:disabled{color:rgba(255,255,255,.26); cursor:default}
  .cmi:disabled em{color:rgba(255,255,255,.16)}
  .cmi:disabled:hover{background:transparent}
  .cmsep{height:1px; margin:5px 7px; background:rgba(255,255,255,.1)}

  /* 亮色主题：面板换成浅底，卡片底色 / 描边 / 元信息全部反相 */
  /* 浅色主题：面板压成浅灰（跟生成记录左栏 #f7f8fa 一个思路），卡片留白，
     这样才有「卡片浮在面板上」的层次；面板也和卡片一样白的话整块糊成一片。 */
  body.light .as-panel{
    background:rgba(243,245,249,.975); border-color:rgba(20,20,30,.14);
    box-shadow:0 30px 90px rgba(30,32,52,.24), inset 0 1px 0 rgba(255,255,255,.9);
  }
  body.light .as-head, body.light .as-foot{border-color:rgba(20,20,30,.09)}
  body.light .as-t{color:rgba(28,28,40,.6)}
  body.light .as-t:hover{color:#1b1b21; background:rgba(20,20,30,.06)}
  body.light .as-t.on{background:#fff; color:#1b1b21; box-shadow:0 1px 4px rgba(20,20,40,.12)}
  body.light .as-t i{color:rgba(28,28,40,.36)}
  body.light .as-t.on i{color:rgba(28,28,40,.56)}
  body.light .as-search{background:#fff; border-color:rgba(20,20,30,.12); color:rgba(28,28,40,.5)}
  body.light .as-search input::placeholder{color:rgba(28,28,40,.4)}
  body.light .as-body::-webkit-scrollbar-thumb{background:rgba(20,20,30,.22); background-clip:padding-box}
  body.light .as-sec-t{color:rgba(28,28,40,.54)}
  body.light .as-sec-t em{color:rgba(28,28,40,.34)}
  /* 浅色底上只靠 1px 描边，卡片会和白底糊在一起 —— 补一层很淡的投影把边界托出来 */
  body.light .as-card{
    background:#fff; border-color:rgba(20,20,30,.14);
    box-shadow:0 1px 3px rgba(20,20,40,.07);
  }
  body.light .as-card:hover{
    border-color:rgba(20,20,30,.28); background:#fff;
    box-shadow:0 6px 18px rgba(20,20,40,.12);
  }
  body.light .as-card.on{border-color:#1b1b21; box-shadow:0 0 0 2px rgba(20,20,30,.12)}
  body.light .as-th{background:#e9ebf1}
  body.light .as-th.aud{background:#e4e7ef}
  body.light .as-th.tx{background:#f2f3f7}
  body.light .as-th.tx .astx{color:rgba(28,28,40,.72)}
  body.light .as-nm{color:#1b1b21}
  body.light .as-sub{color:rgba(28,28,40,.46)}
  body.light .as-pick{border-color:rgba(28,28,40,.34); background:rgba(255,255,255,.86)}
  body.light .as-card:hover .as-pick{border-color:rgba(20,20,30,.6)}
  body.light .as-card.on .as-pick{background:#1b1b21; border-color:#1b1b21; color:#fff}
  body.light .as-del{background:rgba(255,255,255,.9); color:#2a2a36; box-shadow:0 1px 4px rgba(20,20,40,.18)}
  body.light .as-del:hover{background:#e5484d; color:#fff}
  body.light .as-empty{color:rgba(28,28,40,.44)}
  body.light .as-empty b{color:rgba(28,28,40,.7)}
  body.light .as-more{color:rgba(28,28,40,.34)}
  body.light .as-card:hover .as-more, body.light .as-more:focus-visible, body.light .as-more.on{color:rgba(28,28,40,.82)}
  body.light .as-more:hover, body.light .as-more.on{background:rgba(20,20,30,.08); color:#15151a}
  body.light .ammenu{
    background:rgba(255,255,255,.985); border-color:rgba(20,20,30,.12);
    box-shadow:0 18px 44px rgba(30,32,52,.2), inset 0 1px 0 #fff;
  }
  body.light .ammenu .ass-opt{color:rgba(28,28,40,.74)}
  body.light .ammenu .ass-opt:hover{background:rgba(20,20,30,.06); color:#15151a}
  body.light .ammenu .ass-opt.del{color:#d33b3b}
  body.light .ammenu .ass-opt.del:hover{background:rgba(229,72,77,.1); color:#b91c1c}
  body.light .ass-selbtn{background:#fff; border-color:rgba(20,20,30,.18); color:#1b1b21}
  body.light .ass-selbtn:hover{border-color:rgba(20,20,30,.3)}
  body.light .ass-selbtn[aria-expanded="true"]{border-color:rgba(20,20,30,.4); box-shadow:0 0 0 3px rgba(20,20,30,.05)}
  body.light .ass-caret{color:rgba(28,28,40,.5)}
  body.light .ass-pop{
    background:rgba(255,255,255,.985); border-color:rgba(20,20,30,.12);
    box-shadow:0 18px 42px rgba(30,32,52,.18), inset 0 1px 0 #fff;
  }
  body.light .ass-opt{color:rgba(28,28,40,.74)}
  body.light .ass-opt:hover{background:rgba(20,20,30,.06); color:#15151a}
  body.light .ass-opt.on{background:rgba(20,20,30,.08); color:#15151a}
  body.light .as-count{color:rgba(28,28,40,.55)}
  body.light .as-count b{color:#1b1b21}
  body.light .as-row::-webkit-scrollbar-thumb{background:rgba(20,20,30,.18)}
  body.light .ass-panel{background:#fbfbfd; border-color:rgba(20,20,30,.13)}
  body.light .ass-prev{background:rgba(20,20,30,.03); border-color:rgba(20,20,30,.08)}
  body.light .ass-prev .pv{background:#e9ebf1}
  body.light .cmenu{
    background:rgba(252,252,254,.99); border-color:rgba(20,20,30,.12); color-scheme:light;
    box-shadow:0 20px 50px rgba(20,20,40,.18), 0 0 0 1px rgba(20,20,30,.05);
  }
  body.light .cmi{color:#24242c}
  body.light .cmi:hover{background:rgba(20,20,30,.06)}
  body.light .cmi em{color:rgba(28,28,40,.38)}
  body.light .cmi:disabled{color:rgba(28,28,40,.3)}
  body.light .cmi:disabled em{color:rgba(28,28,40,.22)}
  body.light .cmsep{background:rgba(20,20,30,.09)}

  /* 手机上把资产库铺满：五个分组横向可滑，搜索框收窄，卡片两列 */
  @media (max-width:760px){
    .as-panel{width:100%; height:100%; max-height:none}
    .as-head{padding:9px 10px; gap:6px}
    .as-t{height:28px; padding:0 8px; font-size:12px}
    .as-t i{display:none}
    .as-search{height:28px; padding:0 7px}
    .as-search input{width:66px}
    .as-body{padding:11px 11px 16px}
    .as-grid{grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:9px}
    .as-row .as-card{width:104px}
    .as-foot{padding:9px 12px}
    .ass-panel{width:100%; max-height:100%}
    .ass-row2{grid-template-columns:1fr}
    .ass-body{padding:12px 12px 2px}
  }

  /* ============================================================
     添加资金（充值）
     结构照参考图：金额卡片 → 自定义金额 → 付款方式 → 兑换码；
     右上角「订单历史」在同一个弹窗里切换，不跳页、不刷新。
     ============================================================ */
  .tu-panel{
    width:min(760px,96vw); min-height:520px; max-height:min(780px,92vh);
    display:flex; flex-direction:column; overflow:hidden;
    background:rgba(23,23,28,.975); border:1px solid rgba(255,255,255,.14);
    border-radius:16px;
    box-shadow:0 30px 90px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.07);
    -webkit-backdrop-filter:blur(40px) saturate(160%);
    backdrop-filter:blur(40px) saturate(160%);
  }
  .tu-head{display:flex; align-items:center; gap:11px; padding:16px 18px 14px;
    border-bottom:1px solid rgba(255,255,255,.08)}
  .tu-badge{
    width:34px; height:34px; flex:none; border-radius:11px; display:grid; place-items:center;
    background:rgba(96,204,146,.15); color:#6ee7a8; border:1px solid rgba(96,204,146,.2);
  }
  .tu-ht b{display:block; font-size:14px; font-weight:650; color:#f2f2f7; letter-spacing:.2px}
  .tu-ht small{display:block; font-size:11px; color:var(--dim-2); margin-top:2px}
  .tu-head .grow{flex:1}
  .tu-bal{font-size:11.5px; color:var(--dim-2); white-space:nowrap}
  .tu-bal b{color:#f2f2f7; font-variant-numeric:tabular-nums; font-weight:600}
  .tu-hist{
    height:28px; padding:0 10px; border-radius:8px; border:1px solid rgba(255,255,255,.12);
    background:transparent; color:#d6d6e2; font-size:11.5px; font-family:inherit; cursor:pointer;
    transition:.14s; white-space:nowrap;
  }
  .tu-hist:hover{background:rgba(255,255,255,.09); color:#fff}
  .tu-x{
    width:26px; height:26px; border:0; border-radius:7px; background:transparent;
    color:var(--dim-2); font-size:16px; line-height:1; cursor:pointer;
    display:grid; place-items:center; font-family:inherit; flex:none;
  }
  .tu-x:hover{background:rgba(255,95,95,.16); color:#ffb3b3}

  .tu-body{padding:15px 18px 6px; overflow-y:auto; flex:1 1 auto}
  .tu-body::-webkit-scrollbar{width:7px}
  .tu-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16); border-radius:99px}
  .tu-lab{font-size:11.5px; color:var(--dim-2); margin:0 0 9px; letter-spacing:.3px}
  .tu-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:17px}
  .tu-amt{
    appearance:none; text-align:left; padding:11px 13px 9px; border-radius:10px;
    border:1px solid rgba(255,255,255,.09); background:rgba(255,255,255,.03);
    cursor:pointer; font-family:inherit; transition:.14s;
  }
  .tu-amt:hover{border-color:rgba(255,255,255,.22); background:rgba(255,255,255,.06)}
  .tu-amt b{display:block; font-size:16.5px; font-weight:650; color:#f2f2f7;
    letter-spacing:.2px; font-variant-numeric:tabular-nums}
  .tu-amt span{display:block; margin-top:4px; font-size:10.5px; color:var(--dim-2)}
  .tu-amt.on{
    border-color:rgba(120,170,255,.55); background:rgba(90,130,240,.12);
    box-shadow:0 0 0 1px rgba(120,170,255,.25) inset;
  }
  .tu-amt.on b{color:#fff}

  .tu-custom{display:flex; align-items:center; gap:10px; margin-bottom:17px}
  .tu-custom input{
    flex:1 1 auto; min-width:0; height:38px; padding:0 12px; border-radius:9px;
    background:var(--field); border:1px solid var(--line); color:var(--text);
    font-family:inherit; font-size:12.5px; outline:0; transition:.15s;
    font-variant-numeric:tabular-nums;
  }
  .tu-custom input:focus{border-color:rgba(255,255,255,.26); box-shadow:0 0 0 3px rgba(255,255,255,.05)}
  .tu-custom input.bad{border-color:rgba(255,120,120,.6)}
  .tu-due{
    flex:0 0 auto; height:38px; display:flex; align-items:center; gap:7px; padding:0 13px;
    border-radius:9px; border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.04);
    font-size:11.5px; color:var(--dim-2); white-space:nowrap;
  }
  .tu-due b{color:#f4f4f9; font-size:13px; font-variant-numeric:tabular-nums}

  .tu-pay{
    display:flex; align-items:center; gap:9px; width:min(320px,100%);
    padding:10px 13px; border-radius:10px; border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.035); color:#e9e9f2; font-size:12.5px;
    font-family:inherit; cursor:pointer; transition:.14s;
  }
  .tu-pay:hover{border-color:rgba(255,255,255,.22)}
  .tu-pay.on{border-color:rgba(120,170,255,.55); background:rgba(90,130,240,.12)}
  .tu-ali{
    width:19px; height:19px; flex:none; border-radius:5px; background:#1677ff; color:#fff;
    display:grid; place-items:center; font-size:11px; font-weight:700;
  }
  .tu-pay i{
    margin-left:auto; font-style:normal; font-size:10px; color:var(--dim-2);
    border:1px solid rgba(255,255,255,.12); border-radius:6px; padding:1px 6px;
  }
  .tu-hint{font-size:10.5px; color:var(--dim-2); margin:10px 0 0; line-height:1.6}

  .tu-sep{height:1px; background:rgba(255,255,255,.08); margin:16px 0 14px}
  .tu-code-lab{display:flex; align-items:center; gap:7px; font-size:11.5px; color:var(--dim-2); margin-bottom:9px}
  .tu-code-lab svg{width:14px; height:14px; color:#f2c063}
  .tu-code-row{display:flex; gap:9px}
  .tu-code-row input{
    flex:1 1 auto; min-width:0; height:36px; padding:0 11px; border-radius:9px;
    background:var(--field); border:1px solid var(--line); color:var(--text);
    font-family:inherit; font-size:12px; outline:0; transition:.15s;
    text-transform:uppercase; letter-spacing:.4px;
  }
  .tu-code-row input:focus{border-color:rgba(255,255,255,.26)}
  .tu-code-row button{
    flex:0 0 auto; height:36px; padding:0 15px; border-radius:9px;
    border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.07);
    color:#e9e9f2; font-size:12px; font-family:inherit; cursor:pointer; transition:.14s;
  }
  .tu-code-row button:hover{background:rgba(255,255,255,.13); color:#fff}
  .tu-code-row button:disabled{opacity:.45; cursor:default}
  .tu-tip{font-size:11px; color:#ffb3b3; min-height:15px; margin:8px 0 0}
  .tu-tip.ok{color:#7ee2a8}

  .tu-histbody{padding-top:8px}
  .tu-order{
    display:flex; align-items:center; gap:11px; padding:11px 10px; border-radius:10px;
    transition:background .13s;
  }
  .tu-order:hover{background:rgba(255,255,255,.05)}
  .tu-omid{flex:1 1 auto; min-width:0}
  .tu-omid b{display:block; font-size:12.5px; color:#f0f0f5; font-variant-numeric:tabular-nums}
  .tu-omid small{display:block; font-size:10.5px; color:var(--dim-2); margin-top:3px}
  .tu-ostat{font-size:10.5px; padding:2px 8px; border-radius:99px;
    border:1px solid rgba(255,255,255,.14); color:var(--dim-2); white-space:nowrap}
  .tu-ostat.paid{color:#7ee2a8; border-color:rgba(126,226,168,.3); background:rgba(126,226,168,.08)}
  .tu-ostat.pending{color:#f2c063; border-color:rgba(242,192,99,.3); background:rgba(242,192,99,.08)}
  .tu-ostat.failed{color:#ff9d9d; border-color:rgba(255,157,157,.28); background:rgba(255,157,157,.07)}
  .tu-empty{padding:34px 10px; text-align:center; font-size:11.5px; color:var(--dim-2); line-height:1.8}
  .tu-empty b{display:block; color:#d9d9e4; font-size:12.5px; margin-bottom:5px}

  .tu-foot{
    display:flex; align-items:center; gap:9px; padding:12px 18px;
    border-top:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.015);
  }
  .tu-note{font-size:10.5px; color:var(--dim-2)}
  .tu-foot .grow{flex:1}
  .tu-go{
    height:34px; padding:0 17px; border:0; border-radius:9px; background:#f2f2f7;
    color:#111118; font-size:12px; font-weight:600; font-family:inherit;
    cursor:pointer; transition:.14s; font-variant-numeric:tabular-nums;
  }
  .tu-go:hover{background:#fff}
  .tu-go:disabled{opacity:.4; cursor:default}
  .tu-back{
    height:34px; padding:0 14px; border-radius:9px; border:1px solid rgba(255,255,255,.14);
    background:transparent; color:#d6d6e2; font-size:12px; font-family:inherit; cursor:pointer;
  }
  .tu-back:hover{background:rgba(255,255,255,.08)}

  /* 浅色主题 */
  body.light .tu-panel{
    background:rgba(255,255,255,.99); border-color:rgba(20,20,30,.12);
    box-shadow:0 30px 80px rgba(20,20,40,.24), inset 0 1px 0 #fff;
  }
  body.light .tu-head{border-bottom-color:rgba(20,20,30,.08)}
  body.light .tu-ht b, body.light .tu-bal b, body.light .tu-due b{color:#14141a}
  body.light .tu-hist{border-color:rgba(20,20,30,.14); color:#3d3d4c}
  body.light .tu-hist:hover{background:rgba(20,20,30,.06); color:#111}
  body.light .tu-amt{border-color:rgba(20,20,30,.1); background:#fff}
  body.light .tu-amt:hover{border-color:rgba(20,20,30,.24); background:#f7f8fa}
  body.light .tu-amt b{color:#14141a}
  body.light .tu-amt.on{border-color:rgba(36,104,220,.5); background:rgba(36,104,220,.06);
    box-shadow:0 0 0 1px rgba(36,104,220,.18) inset}
  body.light .tu-amt.on b{color:#0f172a}
  body.light .tu-custom input, body.light .tu-code-row input{background:#fff; border-color:rgba(20,20,30,.14); color:#1b1b21}
  body.light .tu-due{background:#f6f7f9; border-color:rgba(20,20,30,.09)}
  body.light .tu-pay{border-color:rgba(20,20,30,.12); background:#fff; color:#1b1b21}
  body.light .tu-pay.on{border-color:rgba(36,104,220,.5); background:rgba(36,104,220,.05)}
  body.light .tu-pay i{border-color:rgba(20,20,30,.14); color:#6a6a78}
  body.light .tu-sep{background:rgba(20,20,30,.09)}
  body.light .tu-code-row button{border-color:rgba(20,20,30,.14); background:#fff; color:#1b1b21}
  body.light .tu-code-row button:hover{background:#f2f3f6}
  body.light .tu-foot{border-top-color:rgba(20,20,30,.08); background:#fbfbfd}
  body.light .tu-go{background:#14141a; color:#fff}
  body.light .tu-go:hover{background:#000}
  body.light .tu-back{border-color:rgba(20,20,30,.14); color:#3d3d4c}
  body.light .tu-back:hover{background:rgba(20,20,30,.05)}
  body.light .tu-order:hover{background:rgba(20,20,30,.045)}
  body.light .tu-omid b{color:#14141a}
  body.light .tu-tip{color:#b04a4a}
  body.light .tu-tip.ok{color:#1a7f52}
  body.light .tu-empty b{color:#1b1b21}
  @media (max-width:560px){
    .tu-grid{grid-template-columns:repeat(2,1fr)}
    .tu-bal{display:none}
    .tu-custom{flex-direction:column; align-items:stretch}
    .tu-due{justify-content:space-between}
  }

  /* ---------- 符号字形的视觉对中 ----------
     用「× ＋ −」这种字符当图标的按钮，字面在字框里天生偏低：
     实测 16px 的 × 低 1.4px、15px 的 ＋ 低 1.3px（约 0.09em），单看就是「没居中」。
     这些按钮的盒子是定高的、内容垂直居中，所以给底部补 0.18em 的 padding
     正好把字面往上提 0.09em，圆形 / 方形框里就落在正中。
     带 svg 图标的按钮一律不补 —— 图形本来就是几何居中的，补了反而变高。 */
  .gal-x, .kp-x, .tu-x, .ms-x, .sp-clear, .msg-hd.x, .hdel,
  .node-head .x, .node.asset .x{ padding-bottom: .18em }
  /* 左下缩放条里那颗 ＋ − ⛶ 字号 15、字形又各不相同，补一点点就够（补多了反而偏高） */
  .zoomer button:not(:has(svg)){ padding-bottom: .09em }

  /* 这几颗原来没做垂直居中（行高 1 直接顶在盒子上沿），先摆正再补 */
  .auth-x, .pava-x, .linkbox .lbx, .netbar .nb-x{
    display: grid; place-items: center; padding-bottom: .18em;
  }


/* === VideoToken Studio Integration Styles === */
#hKeyBtn, #keyBtn, #hSearch, #hBell, #hBell2, #netBanner { display: none !important; }
.vt-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 12px; padding: 6px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; text-decoration: none;
  color: #f3dbe4; background: rgba(245, 147, 179, 0.12);
  border: 1px solid rgba(245, 147, 179, 0.34);
  transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease;
  white-space: nowrap;
}
.vt-back-btn:hover {
  background: rgba(245, 147, 179, 0.22); border-color: rgba(245, 147, 179, 0.62);
  color: #fff; transform: translateY(-1px);
}
body.light .vt-back-btn {
  color: #5a2b3e; background: rgba(196, 86, 128, 0.09); border-color: rgba(196, 86, 128, 0.28);
}
body.light .vt-back-btn:hover {
  background: rgba(196, 86, 128, 0.16); color: #2b101b;
}
.vt-back-compact { margin-left: 10px; padding: 5px 11px; font-size: 12px; }

.vt-bal-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 11px; border-radius: 999px;
  text-decoration: none; font-size: 12.5px; font-variant-numeric: tabular-nums;
  color: #f6e7ee; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.vt-bal-pill:hover { background: rgba(245,147,179,0.16); border-color: rgba(245,147,179,0.45); }
.vt-bal-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade8099; }
body.light .vt-bal-pill { color: #222; background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); }

.vt-lang-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px; min-width: 44px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--ink, #e8e8ee); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background .16s ease, border-color .16s ease;
}
.vt-lang-btn:hover { background: rgba(255,255,255,0.13); border-color: rgba(255,255,255,0.28); }
body.light .vt-lang-btn { color: #222; background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); }

/* Grouped two-level model selector */
.qmenu.vt-group-menu {
  width: min(460px, calc(100vw - 24px));
  max-height: min(480px, calc(100vh - 36px));
  display: flex; flex-direction: column; padding: 10px;
}
.vt-gm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 6px 8px; font-size: 12px; color: var(--muted, #9a9aa6);
}
.vt-gm-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 4px 10px; border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}
body.light .vt-gm-tabs { border-bottom-color: rgba(0,0,0,0.08); }
.vt-gm-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,0.05); color: var(--muted, #b5b5c0);
  border: 1px solid rgba(255,255,255,0.08); cursor: pointer;
  transition: all .15s ease;
}
.vt-gm-tab:hover { color: #fff; background: rgba(255,255,255,0.1); }
.vt-gm-tab.on {
  background: linear-gradient(135deg, rgba(245,147,179,0.28), rgba(196,107,255,0.22));
  border-color: rgba(245,147,179,0.58); color: #fff;
}
body.light .vt-gm-tab { background: rgba(0,0,0,0.04); color: #555; border-color: rgba(0,0,0,0.08); }
body.light .vt-gm-tab.on { background: #26121d; color: #fff; border-color: #26121d; }
.vt-gm-badge {
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 5px;
  background: #f593b3; color: #26121d;
}
.vt-gm-count { font-size: 10.5px; opacity: .7; }
.vt-gm-list {
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; max-height: 310px; padding: 2px 2px 4px;
}
.vt-gm-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 9px 11px; border-radius: 10px;
  border: 1px solid transparent; background: transparent;
  color: inherit; cursor: pointer; transition: background .14s ease, border-color .14s ease;
}
.vt-gm-item:hover { background: rgba(255,255,255,0.07); }
.vt-gm-item.on {
  background: rgba(245,147,179,0.14); border-color: rgba(245,147,179,0.45);
}
body.light .vt-gm-item:hover { background: rgba(0,0,0,0.04); }
body.light .vt-gm-item.on { background: rgba(196,86,128,0.1); border-color: rgba(196,86,128,0.4); }
.vt-gm-main { min-width: 0; flex: 1; }
.vt-gm-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.vt-gm-id { font-size: 11px; opacity: .62; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-gm-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.vt-gm-specs { font-size: 10.5px; opacity: .75; }
.vt-gm-price { font-size: 11.5px; font-weight: 600; color: #f5a6c2; font-variant-numeric: tabular-nums; }
body.light .vt-gm-price { color: #b43e6d; }
.vt-gm-empty { padding: 20px; text-align: center; font-size: 12.5px; opacity: .65; }
.hc-kind.single-mode { display: none !important; }
.vt-user-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; max-width: 220px; padding: 0 11px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #ececf2;
  font-size: 12px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s;
}
.vt-user-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-user-pill:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.26); }
.vt-user-dot { width: 6px; height: 6px; border-radius: 50%; background: #c9a87c; flex: none; }
body.light .vt-user-pill { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.11); color: #1d1d22; }
body.light .vt-user-pill:hover { background: rgba(0,0,0,.08); border-color: rgba(0,0,0,.2); }
@media (max-width: 720px) { .vt-user-pill { display: none; } }
.um-id { min-width: 0; flex: 1; overflow: hidden; }
.um-id b, .um-id small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-out { flex-shrink: 0; margin-left: 6px; }
html[lang="en"] .gd-zh { display: none !important; }
html:not([lang="en"]) .gd-en { display: none !important; }

/* Optimistic instant-preview upload states */
@keyframes vt-up-spin { to { transform: rotate(360deg); } }
.node.asset .abody { position: relative; }
.node.asset .up-pill {
  display: none;
  position: absolute; right: 10px; bottom: 10px; z-index: 6;
  align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(16, 17, 24, 0.78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f4f4f8; font-size: 11px; font-weight: 500;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.node.asset.is-uploading .up-pill { display: inline-flex; }
.node.asset.is-uploading .abody img,
.node.asset.is-uploading .abody video { opacity: 0.88; transition: opacity .18s ease; }
.node.asset .up-pill::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%;
  border: 1.8px solid rgba(255, 255, 255, 0.28);
  border-top-color: #f593b3;
  animation: vt-up-spin .75s linear infinite;
}
.node.asset .up-pill::after { content: '上传中…'; }
.node.asset .up-pill[data-pct]::after { content: '上传 ' attr(data-pct); }
html[lang="en"] .node.asset .up-pill::after { content: 'Uploading…'; }
html[lang="en"] .node.asset .up-pill[data-pct]::after { content: attr(data-pct); }
body.light .node.asset .up-pill {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.12);
  color: #1f2028;
}
body.light .node.asset .up-pill::before {
  border-color: rgba(0, 0, 0, 0.18);
  border-top-color: #c44577;
}
.acard.is-uploading::after,
.hc-tile.is-uploading::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #f593b3;
  animation: vt-up-spin .75s linear infinite;
  pointer-events: none; z-index: 5;
}
.acard.is-uploading[data-pct]::after,
.hc-tile.is-uploading[data-pct]::after {
  content: attr(data-pct);
  width: auto; height: auto; margin: 0;
  transform: translate(-50%, -50%);
  padding: 2px 5px; border-radius: 999px;
  border: 0; animation: none;
  background: rgba(14, 15, 22, 0.84); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.acard.is-uploading img,
.hc-tile.is-uploading img,
.acard.is-uploading video,
.hc-tile.is-uploading video { opacity: 0.68; }

/* Video reference tiles, cards, hover-peek, and asset library previews */
.apop video {
  display: none; width: auto; height: auto; min-width: 180px;
  max-width: min(360px, calc(100vw - 26px)); max-height: min(360px, 60vh);
  border-radius: 9px; background: #0a0a0e; object-fit: contain;
}
.apop.is-vid video { display: block; }
.apop.is-vid img, .apop.is-vid audio, .apop.is-vid .apop-txt { display: none; }
.apop.is-img video, .apop.is-aud video, .apop.is-txt video { display: none; }

.acard.vid { background: #0c0c10; }
.acard.vid video,
.hc-tile video,
.as-th video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-user-drag: none; user-select: none;
}
.hc-tile .hc-vtag,
.acard.vid .ac-vtag {
  position: absolute; right: 3px; bottom: 3px; z-index: 3;
  width: 16px; height: 16px; border-radius: 999px;
  background: rgba(12, 12, 18, 0.72); color: #fff;
  display: grid; place-items: center; font-size: 8px; line-height: 1;
  pointer-events: none; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.ba video, .gmlist .mi video {
  width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex: none;
}
.ass-prev .pv video {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 8px;
}
