/* ===========================================================================
   X-Canvas 鎵╁睍鏍峰紡
   鈥斺€?鍦ㄤ繚鐣欏師鍨嬭瑙夌殑鍓嶆彁涓嬶紝琛ヤ笂鐪熷疄鍔熻兘鎵€闇€鐨勬帶浠?
   =========================================================================== */

/* 閫変腑鍗＄墖鐨勮繛绾挎祦鍏夎壊锛堟繁娴呬富棰橀€氱敤锛?*/
:root { --flow-color: #4aa8ff; }


/* ---------- 绔彛 / 閿氱偣锛堢伆鑹?+ 鍔犲彿锛屽弬鑰冧富娴佺敾甯冿級 ---------- */
.port {
  position: absolute;
  width: 22px; height: 22px;
  margin-top: -11px;              /* 璁?top 鐧惧垎姣斾唬琛ㄧ鍙ｄ腑蹇?*/
  border-radius: 50%;
  background-color: color-mix(in srgb, var(--card-solid) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 28%, transparent);
  color: color-mix(in srgb, var(--text) 55%, transparent);
  z-index: 6;
  cursor: crosshair;
  opacity: .7;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease),
              opacity .14s var(--ease), border-color .14s var(--ease),
              color .14s var(--ease);
}
.port.in { left: -11px; }
.port.out { right: -11px; }

/* 鍔犲彿锛氫袱鏉＄粏妯珫锛岄鑹茶窡闅?currentColor */
.port::before,
.port::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  background: currentColor;
  border-radius: 2px;
  transform: translate(-50%, -50%);
}
.port::before { width: 9px; height: 1.5px; }
.port::after { width: 1.5px; height: 9px; }

.node:hover .port,
.node.selected .port { opacity: 1; }

.port:hover {
  opacity: 1;
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 40%, transparent);
  transform: scale(1.12);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--text) 8%, transparent),
              0 4px 12px rgba(0,0,0,.2);
}

/* 蹇呭～绔彛锛氬父椹荤粏鐜紙淇濇寔浣庡姣旓紝涓嶅啀鐢ㄧ被鍨嬭壊锛?*/
.port.required { border-color: color-mix(in srgb, var(--text) 34%, transparent); }
.port.required.missing { border-color: var(--danger); animation: portPulse 1.2s ease-in-out infinite; }
@keyframes portPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* 澶氬€肩鍙ｏ細鍙充笂瑙掍竴涓皬鍦嗙偣鎻愮ず銆屽彲浠ヨ繛澶氭潯銆?*/
.port.multi {
  background-image: radial-gradient(circle at 100% 0%, currentColor 0 2px, transparent 2.5px);
}

/* 鎷栨嫿杩炵嚎鏃剁殑钀界偣鎻愮ず */
.port.dimmed { opacity: .18; }
/**
 * 澶氬彛鑺傜偣閲屾湰娆¤繍琛屾病鍛戒腑鐨勫彛锛圕omfyUI 鐨勫浘鐗?瑙嗛浜岄€変竴锛夈€?
 * 缃伆 + 鏀剁獎鍛戒腑锛氭棦鐒惰繖娆′笉浼氭湁鏁版嵁锛屽氨涓嶈鍐嶄粠瀹冩媺绾?鈥斺€?
 * 鐢ㄦ埛浼氭嫋鍑轰竴鏉°€岃繛涓婁簡浣嗘案杩滄槸绌哄彛銆嶇殑绾匡紝鎺掓煡璧锋潵姣棤澶寸华銆?
 */
.port.idle {
  opacity: .25;
  border-style: dashed;
  pointer-events: none;
}
.port.droppable {
  opacity: 1;
  transform: scale(1.12);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--text) 10%, transparent);
}
.port.drop-target {
  opacity: 1;
  color: var(--text);
  transform: scale(1.3);
  border-color: var(--flow-color);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--flow-color) 30%, transparent);
}
.node.drop-host > .node-head { background: color-mix(in srgb, var(--strong) 6%, transparent); }

/* ---------- 杩炵嚎锛堝父鎬佺粺涓€鐏拌壊锛岄€変腑鎵嶇偣浜級 ----------
   鍙傝€冧富娴佹棤闄愮敾甯冿細娌℃湁棰滆壊鏃剁敾甯冩渶骞插噣锛岃妭鐐规湰韬墠鏄富瑙掋€?
   甯告€?1.6px 鐨勪綆瀵规瘮鐏扮嚎锛宧over 鐣ュ井鎻愪寒锛岄€変腑鍗＄墖鍚庢墠杩涘叆钃濊壊娴佸厜銆?*/
.link {
  stroke: color-mix(in srgb, var(--text) 30%, transparent);
  stroke-width: 1.6;
  fill: none;
  opacity: .5;
  pointer-events: none;
  transition: opacity .15s, stroke-width .15s, stroke .15s, filter .15s;
}
.link.hot {
  stroke: color-mix(in srgb, var(--text) 46%, transparent);
  opacity: 1;
  stroke-width: 2;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--text) 18%, transparent));
}
.link.temp {
  stroke: color-mix(in srgb, var(--text) 40%, transparent);
  stroke-dasharray: 6 6;
  opacity: .9;
  stroke-width: 1.8;
}

/* ---------- 杩炵嚎娴佸厜 ----------
   閫変腑鏌愬紶鍗＄墖锛堟垨婧愯妭鐐规鍦ㄨ繍琛岋級鏃讹紝涓庡畠鐩歌繛鐨勭嚎鍙樻垚钃濊壊搴?+ 涓€娈?
   楂橀€熺Щ鍔ㄧ殑浜厜銆傚簳涓庢祦鍏夊垎鎴愪袱鏉?path锛?
     .link       杩炵画鐨勮摑鑹插簳绾匡紝淇濊瘉銆岃繖鏉＄嚎鏄椿鐨勩€嶅缁堝彲瑙侊紱
     .link-flow  鍙湁浜厜锛岀敤 stroke-dashoffset 鍦ㄥ簳绾夸笂婊戝姩銆?
   杩欐牱姣斿崟绾妸涓€鏉＄嚎鍋氭垚铏氱嚎鏇村儚鍙傝€冨浘閲岀殑銆屾祦鍏夈€嶃€?*/
.links {
  --flow-speed: 1.15s;
}
.link.flow {
  stroke: var(--flow-color);
  opacity: var(--flow-alpha, .92);
  stroke-width: 2;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--flow-color) 55%, transparent));
}
.link-flow {
  /* 鑰佺増娴佸厜鏄€屾暣鏉＄嚎閾烘弧鐭櫄绾裤€嶏紱鏂扮増淇濈暀涓€鏉¤繛缁摑搴曪紝
     浜厜鍙彇涓€娈点€傞棿璺濇寜妗ｄ綅鍙橀噺鏀惧ぇ 10 鍊嶏紝鍥涙。鎵嬫劅浠嶇劧鍖哄垎寰楀紑銆?*/
  --flow-gap-long: calc(var(--flow-gap, 16px) * 10);
  stroke: #eaf8ff;
  stroke-width: 2.4;
  fill: none;
  opacity: var(--flow-alpha, .95);
  pointer-events: none;
  stroke-linecap: round;
  stroke-dasharray: var(--flow-dash, 16px) var(--flow-gap-long);
  animation: linkFlow var(--flow-speed, 1.15s) linear infinite;
  filter: drop-shadow(0 0 4px var(--flow-color));
}
@keyframes linkFlow {
  from { stroke-dashoffset: calc(var(--flow-dash, 16px) + var(--flow-gap-long)); }
  to   { stroke-dashoffset: 0; }
}

/* 寮烘。銆屽弻娈点€嶏細CSS 娌℃硶鎸夊彉閲忛噸澶?N 娆★紝鍙兘鎶婁袱娈靛啓鍏ㄣ€?*/
.links[data-flow-count="2"] .link-flow {
  stroke-dasharray: var(--flow-dash, 16px) var(--flow-gap-long)
                   var(--flow-dash, 16px) var(--flow-gap-long);
  animation-name: linkFlow2;
}
@keyframes linkFlow2 {
  from { stroke-dashoffset: calc((var(--flow-dash, 16px) + var(--flow-gap-long)) * 2); }
  to   { stroke-dashoffset: 0; }
}

/* 鎷栧姩涓細娴佸厜瑕佸仠銆傝妭鐐规鍦ㄨ鎷栵紝绾挎潯鍑犱綍姣忓抚閮藉湪鍙橈紝
   杩樿鍐嶅彔涓€灞?dashoffset 鍔ㄧ敾 = 涓ゅ鍔ㄧ敾鎶㈠悓涓€鏉?path锛岃瑙変笂鏄姈鐨勩€?*/
.links.is-dragging .link-flow { animation: none; }

/* 瑙嗗彛澶栫殑杩炵嚎涓嶈窇鍔ㄧ敾锛圝S 浼氳烦杩囦笉鍙鐨勪袱绔級銆?*/
.links[data-flow="off"] .link-flow { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .link-flow { animation: none; opacity: .55; }
}

/* ================================================================
   鐢诲竷鍩虹浜や簰琛ュ厖
   ================================================================ */

/* ---------- 绌烘牸骞崇Щ ---------- */
body.space-pan .board { cursor: grab !important; }
body.space-pan .board.dragging { cursor: grabbing !important; }

/* ---------- 鍚搁檮鍙傝€冪嚎 ---------- */
.snap-guide {
  position: absolute;
  pointer-events: none;
  z-index: 40;
  background: #ff3d8b;
  border-radius: 2px;
}
.snap-guide.v { width: 100%; height: 1px; top: 0; }
.snap-guide.h { height: 100%; width: 1px; left: 0; }

/* ---------- 鍛戒护闈㈡澘 ---------- */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.42); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; padding-top: 14vh;
}
.cmdk-overlay.show { display: flex; }
.cmdk-modal {
  width: min(620px, 92vw); max-height: 62vh;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 24px 64px rgba(0,0,0,.3);
  backdrop-filter: blur(16px);
  display: flex; flex-direction: column; overflow: hidden;
}
.cmdk-input {
  height: 52px; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 16px; font-weight: 700;
  padding: 0 20px; border-bottom: 1px solid var(--line);
  font-family: inherit;
}
.cmdk-list { overflow-y: auto; padding: 8px; }
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 11px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--text);
}
.cmdk-item .k {
  margin-left: auto; font-size: 10px; color: var(--faint);
  background: var(--soft); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; font-weight: 800;
}
.cmdk-item.active { background: var(--soft-2); }
.cmdk-item .sub { font-size: 10px; color: var(--faint); font-weight: 600; }
.cmdk-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- 渚ф爮娴眰闈㈡澘锛坮ailpanel.js锛?----------
   渚ф爮涓変釜鍏ュ彛锛堬紜 / 妯℃澘 / 璁剧疆锛夊叡鐢ㄨ繖涓€涓鍣紝鍐呭鍚勮嚜 build()銆?
   z-index 45锛氶珮浜庝晶鏍忥紙40锛夛紝杩滀綆浜?cmdk(700) / 閰嶇疆(500) / 鍙抽敭鑿滃崟(200)銆?*/
.rail-panel {
  position: fixed; z-index: 45; display: none;
  min-width: 260px; max-width: min(620px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 32px));
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 16px 44px var(--shadow);
  backdrop-filter: blur(16px);
  flex-direction: column; overflow: hidden;
}
.rail-panel.show { display: flex; }

.rail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.rail-head h3 { margin: 0; font-size: 12px; font-weight: 800; color: var(--text); }
.rail-search {
  height: 32px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--card-solid); color: var(--text);
  padding: 0 10px; font-size: 12px; font-family: inherit; outline: none;
}
.rail-search:focus { border-color: var(--strong); }
.rail-body { overflow-y: auto; padding: 6px; flex: 1; }

/* 鑿滃崟琛岋細宸﹀浘鏍?+ 涓棿鏂囧瓧 + 鍙充晶璇存槑 */
.rail-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--text);
}
.rail-row:hover { background: var(--soft-2); }
.rail-row[aria-disabled="true"] { opacity: .45; cursor: default; }
.rail-row[aria-disabled="true"]:hover { background: none; }
.rail-row svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--faint); }
.rail-row .sub { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--faint); }
.rail-sep { height: 1px; background: var(--line-2); margin: 5px 10px; }

/* ---------- 杩炵嚎娴佸厜妗ｄ綅锛堣缃彍鍗曪級 ---------- */
.flow-row { padding: 7px 10px; }
.flow-row-head { display: flex; align-items: center; font-size: 12px; font-weight: 700; color: var(--text); }
.flow-toggle {
  margin-left: auto; width: 30px; height: 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--soft);
  position: relative; cursor: pointer; transition: background .18s var(--ease);
  display: flex; align-items: center;
}
.flow-toggle svg { width: 10px; height: 10px; position: absolute; left: 3px; color: var(--faint); transition: all .18s var(--ease); }
.flow-toggle.on { background: var(--strong); border-color: var(--strong); }
.flow-toggle.on svg { left: 17px; color: var(--strong-text); }
.flow-chips { display: flex; gap: 5px; margin-top: 8px; transition: opacity .18s var(--ease); }
.flow-chip {
  flex: 1; text-align: center; padding: 5px 0; border-radius: 7px; cursor: pointer;
  background: var(--soft); border: 1px solid var(--line-2);
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  transition: all .14s var(--ease);
}
.flow-chip:hover { color: var(--text); }
.flow-chip.active { background: var(--strong); border-color: var(--strong); color: var(--strong-text); }

/* 璁剧疆鑿滃崟鐨勫ご閮細鐜板湪鏄湡瀹炴湰鍦版暟鎹紝浠ュ悗鏀捐处鍙峰悕 + 浼氬憳绛夌骇 */
.rail-me { padding: 12px 14px 10px; }
.rail-me-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rail-me-name { font-size: 13px; font-weight: 800; color: var(--text); }
.rail-me-badge {
  margin-left: auto; font-size: 9px; font-weight: 800; color: var(--muted);
  background: var(--soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
.rail-me-sub { font-size: 10px; font-weight: 600; color: var(--faint); line-height: 1.6; }
/* 瀛樺偍鍗犵敤鍗＄墖锛氭暟鎹潵鑷?api.storageStats()锛屼笉鏄及绠椾篃涓嶆槸閰嶉 */
.rail-me-card {
  margin-top: 9px; padding: 8px 10px; border-radius: 9px;
  background: var(--soft); border: 1px solid var(--line-2);
}
.rail-me-card-top { display: flex; align-items: baseline; gap: 6px; font-size: 10px; font-weight: 700; color: var(--muted); }
.rail-me-card-top b { margin-left: auto; font-size: 12px; color: var(--text); }
.rail-me-path {
  margin-top: 3px; font-size: 9px; font-weight: 600; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left;
}

/* ---------- 妯℃澘闈㈡澘锛氬満鏅璁?/ 宸ヤ綔娴?---------- */
.rail-tabs {
  display: flex; gap: 2px; padding: 8px 10px 0; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.rail-tab {
  flex: 1; height: 30px; border: 0; border-radius: 8px 8px 0 0; cursor: pointer;
  background: transparent; color: var(--faint);
  font-size: 12px; font-weight: 800; transition: all .14s var(--ease);
}
.rail-tab:hover { color: var(--text); background: var(--soft-2); }
.rail-tab.active { color: var(--text); background: var(--soft); }
.rail-tabs { align-items: center; }
.rail-expand {
  width: 30px; height: 30px; flex-shrink: 0; margin-left: 3px; margin-bottom: 3px;
  border: 0; border-radius: 8px; background: transparent; color: var(--faint);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.rail-expand:hover { color: var(--text); background: var(--soft-2); }
.rail-expand svg { width: 14px; height: 14px; }
.rail-panel.rail-expanded {
  left: 50% !important; top: 50% !important; transform: translate(-50%, -50%);
  width: min(1000px, calc(100vw - 64px)) !important;
  max-width: min(1000px, calc(100vw - 64px)) !important;
  max-height: min(760px, calc(100vh - 64px)) !important;
  border-radius: 18px; z-index: 760;
}
.rail-panel.rail-expanded .rail-tabs { padding-top: 10px; }
.rail-panel.rail-expanded .preset-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.preset-body { display: flex; flex-direction: column; min-height: 0; overflow: hidden; flex: 1; }
.preset-body .rail-search { margin: 10px 10px 0; }
.preset-chips { display: flex; gap: 5px; padding: 9px 10px 4px; flex-wrap: wrap; flex-shrink: 0; }
.preset-chip {
  height: 24px; padding: 0 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card-solid); color: var(--muted);
  font-size: 10px; font-weight: 800; transition: all .14s var(--ease);
}
.preset-chip:hover { border-color: var(--strong); color: var(--text); }
.preset-chip.active { background: var(--strong); color: var(--strong-text); border-color: var(--strong); }

/* 鍗＄墖缃戞牸锛? 鍒?鈥斺€?涓庡弬鑰冧竴鑷达紝涔熻兘鍦?620px 闈㈡澘閲屾斁涓嬭€屼笉鎸ゆ垚 2 鍒?*/
.preset-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 8px 10px 12px; overflow-y: auto; min-height: 0;
  max-height: calc(560px - 154px);
}
.rail-panel.rail-expanded .preset-grid { max-height: calc(100vh - 210px); }
.preset-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preset-card {
  display: flex; flex-direction: column; gap: 5px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden;
  background: var(--card-solid); cursor: pointer; text-align: left;
  transition: all .14s var(--ease);
}
.preset-card:hover { border-color: var(--strong); transform: translateY(-1px); }
.preset-cover { position: relative; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
/* 鍗犱綅闃舵鐨勮瘑鍒潬瀹冿紱灏嗘潵鎹㈡垚鐪熷浘灏遍€€鍒拌儗鏅?*/
.preset-cover-icon { width: 26px; height: 26px; opacity: .34; color: #fff; }
.preset-card-meta { padding: 0 6px 6px; }
.preset-card-name {
  font-size: 10px; font-weight: 800; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.preset-card-tags { display: flex; gap: 3px; margin-top: 3px; }
.preset-tag {
  font-size: 8px; font-weight: 700; color: var(--faint);
  background: var(--soft); border-radius: 4px; padding: 0 4px; line-height: 15px;
}
/* 銆孨 姝ャ€嶈鏄剧溂涓€妗ｏ細瀹冩剰鍛崇潃**澶氭璁¤垂**锛岀偣涔嬪墠蹇呴』鐪嬪嚭鏉ャ€?*/
.preset-tag.is-multi { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }

/* ---------- 鎴戠殑妯℃澘 ---------- */
.my-tpl-view { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.my-tpl-bar { display: flex; align-items: center; gap: 6px; padding: 10px 10px 0; flex-shrink: 0; }
.my-tpl-bar .rail-search { flex: 1; min-width: 0; margin: 0; }
.my-tpl-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.my-tpl-icon {
  width: 30px; height: 32px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.my-tpl-icon:hover { color: var(--text); background: var(--soft-2); }
.my-tpl-icon.is-active { color: var(--text); background: var(--soft); }
.my-tpl-icon.is-danger:hover { color: var(--danger); background: var(--danger-bg); }
.my-tpl-icon:disabled { opacity: .35; cursor: default; background: transparent; }
.my-tpl-icon svg { width: 14px; height: 14px; }
.my-tpl-selectbar { display: flex; align-items: center; gap: 4px; padding: 7px 10px 0; flex-shrink: 0; }
.my-tpl-selectbar[hidden] { display: none; }
.my-tpl-text {
  height: 26px; padding: 0 7px; border: 0; background: transparent; border-radius: 7px;
  color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.my-tpl-text:hover { color: var(--text); background: var(--soft-2); }
.my-tpl-count { margin-left: auto; color: var(--faint); font-size: 10px; font-weight: 600; }
.my-tpl-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 9px 10px 12px; overflow-y: auto; min-height: 0; align-content: start;
  max-height: calc(560px - 152px);
}
.rail-panel.rail-expanded .my-tpl-grid {
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  max-height: calc(100vh - 210px);
}
.my-tpl-card { position: relative; }
.my-tpl-card.is-selected {
  border-color: var(--strong);
  box-shadow: 0 0 0 1px var(--strong), 0 6px 18px var(--shadow);
}
.my-tpl-check {
  display: none; position: absolute; right: 6px; top: 6px; z-index: 2;
  width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.6);
  background: rgba(0,0,0,.38); color: #fff; align-items: center; justify-content: center;
}
.my-tpl-grid.is-selecting .my-tpl-check { display: flex; }
.my-tpl-card.is-selected .my-tpl-check { background: var(--strong); border-color: var(--strong); color: var(--strong-text); }
.my-tpl-check svg { width: 11px; height: 11px; }
.my-tpl-card .preset-cover { background: var(--soft); }
.my-tpl-empty {
  grid-column: 1 / -1; min-height: 180px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 28px 12px;
  text-align: center; color: var(--faint); font-size: 11px; font-weight: 600;
}
.rail-empty { padding: 22px 12px; text-align: center; color: var(--faint); font-size: 11px; font-weight: 600; }

/* ---------- 绌虹姸鎬侀噷鐨勫満鏅崱 ----------
   鍜屾ā鏉块潰鏉跨敤鍚屼竴濂楀崱鐗囨牱寮忥細绌虹姸鎬佹槸銆屾柊鐢ㄦ埛绗竴娆＄湅鍒般€嶏紝妯℃澘闈㈡澘鏄?
   銆岃€佺敤鎴峰洖鏉ユ壘銆嶏紝涓ゅ鍗＄墖闀垮緱涓嶄竴鏍蜂細璁╃敤鎴蜂互涓烘槸涓ゆ牱涓滆タ銆?*/
.empty-preset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px; margin: 4px 0 14px;
}
.empty-preset-grid .preset-card { width: 100%; }
.empty-preset-grid .preset-cover { aspect-ratio: 4 / 3; }

/* ---------- 蹇嵎閿潰鏉?----------
   鍐呭涓嶆墜鍐欙細鐩存帴鏉ヨ嚜 CMD_ITEMS + bindKeys 閲岀粦鐨勯偅浜涳紝
   鎵€浠ユ案杩滀笉浼氬拰鐪熷疄蹇嵎閿涓嶄笂锛堣繖鏄埢鎰忕殑 鈥斺€?鎵嬫妱涓€浠藉繀鐒舵紓绉伙級銆?*/
.shortcuts-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.42); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.shortcuts-overlay.show { display: flex; }
.shortcuts-modal {
  width: min(680px, 92vw); max-height: 72vh;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 24px 64px rgba(0,0,0,.3);
  backdrop-filter: blur(16px);
  display: flex; flex-direction: column; overflow: hidden;
}
.shortcuts-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.shortcuts-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text); }
.shortcuts-body {
  overflow-y: auto; padding: 6px 18px 14px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 26px;
}
.shortcuts-group h4 {
  margin: 14px 0 6px; font-size: 10px; font-weight: 800;
  color: var(--faint); text-transform: uppercase; letter-spacing: .06em;
}
.shortcuts-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 5px 0; font-size: 12px; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--line-2);
}
.shortcuts-keys { display: flex; gap: 3px; flex: none; }
.shortcuts-modal kbd {
  font-family: inherit; font-size: 10px; font-weight: 800;
  background: var(--soft); border: 1px solid var(--line); color: var(--text-2);
  border-radius: 5px; padding: 2px 6px; white-space: nowrap;
}
.shortcuts-foot {
  margin: 0; padding: 12px 18px; border-top: 1px solid var(--line);
  font-size: 11px; font-weight: 600; color: var(--faint); line-height: 1.7;
}
.shortcuts-foot kbd {
  font-family: inherit; font-size: 10px; font-weight: 800;
  background: var(--soft); border: 1px solid var(--line); color: var(--text-2);
  border-radius: 5px; padding: 1px 5px;
}

/* ---------- 鐢诲竷鍐呮悳绱?---------- */
.find-overlay {
  position: absolute; top: 78px; left: 50%; transform: translateX(-50%);
  z-index: 30; width: 420px; max-width: 92vw;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 16px 44px var(--shadow);
  backdrop-filter: blur(16px); padding: 10px;
  display: none; gap: 8px; align-items: center;
}
.find-overlay.show { display: flex; }
.find-overlay input {
  flex: 1; height: 32px; border: none; background: transparent;
  color: var(--text); font-size: 13px; font-weight: 700; outline: none;
}
.find-overlay .count { font-size: 11px; font-weight: 800; color: var(--faint); }

/* 缁撴灉涓嬫媺瑕佽劚绂?flex 娴侊紝缁濆瀹氫綅鍦ㄨ緭鍏ユ涓嬮潰 */
.find-results {
  position: absolute; top: calc(100% + 6px); left: 8px; right: 8px;
  max-height: 300px; overflow-y: auto; display: none;
  padding: 5px; border-radius: 13px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 16px 40px var(--shadow);
}
.find-results.show { display: block; }
.find-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 10px; cursor: pointer;
}
.find-item:hover, .find-item.active { background: var(--soft-1); }
.find-item i { width: 14px; height: 14px; color: var(--faint); flex-shrink: 0; }
.find-item .t {
  font-size: 12px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.find-item .sub {
  margin-left: auto; font-size: 10px; color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%;
}

/* ---------- 鑺傜偣楂樹寒锛堟悳绱㈠懡涓級 ---------- */
.node.found { box-shadow: 0 0 0 3px color-mix(in srgb, var(--strong) 40%, transparent); }
.node.found > .node-head { background: color-mix(in srgb, var(--strong) 8%, transparent); }
.node.search-dim { opacity: .28; }

/* ---------- 鑺傜偣棰滆壊鏍囩 ---------- */
.node-tag-stripe {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: var(--radius-node) 0 0 var(--radius-node);
  z-index: 7; pointer-events: none;
}
.tag-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line); cursor: pointer; flex-shrink: 0;
  transition: transform .12s var(--ease);
}
.tag-dot:hover { transform: scale(1.2); }
.tag-dot.active { border-color: var(--strong); }

/* ---------- 澶氶€夋诞鍔ㄥ伐鍏锋潯 ---------- */
.multi-toolbar {
  position: absolute; z-index: 45;
  display: none; align-items: center; gap: 4px;
  padding: 6px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 12px 36px var(--shadow); backdrop-filter: blur(16px);
}
.multi-toolbar.show { display: flex; }
.multi-toolbar .sep { width: 1px; height: 16px; background: var(--line); margin: 0 2px; }
.multi-toolbar { max-width: calc(100vw - 160px); gap: 2px; }
.tb-action {
  height: 30px; padding: 0 10px; border: 0; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--text); font: inherit;
  font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.tb-action:hover { background: var(--soft); }
.tb-action svg { width: 14px; height: 14px; flex-shrink: 0; }
.multi-more {
  position: fixed; z-index: 230; min-width: 176px; padding: 6px;
  border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 16px 44px var(--shadow); backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 1px;
}
.multi-more-item {
  height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text); font: inherit; font-size: 11px; font-weight: 650;
  display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left;
}
.multi-more-item:hover { background: var(--soft); }
.multi-more-item.is-danger { color: var(--danger); }
.multi-more-item svg { width: 14px; height: 14px; color: var(--faint); flex-shrink: 0; }
.multi-more-item.is-danger svg { color: currentColor; }
.multi-more-tags {
  display: flex; gap: 6px; align-items: center; padding: 6px 8px 4px;
  border-top: 1px solid var(--line); margin-top: 4px;
}

/* ---------- 鍒嗙粍 / 閫夋 / 鎴愮粍宸ュ叿鏉?---------- */
.group-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; --inv: 1; }
.selection-frame {
  position: absolute; border: calc(1.2px * var(--inv, 1)) dashed #6366f1;
  border-radius: calc(10px * var(--inv, 1)); pointer-events: none;
  background: color-mix(in srgb, #6366f1 4%, transparent); box-sizing: border-box;
}
.selection-handle {
  position: absolute; width: calc(7px * var(--inv, 1)); height: calc(7px * var(--inv, 1));
  border-radius: 50%; background: #6366f1; transform: translate(-50%, -50%);
}
.selection-handle.nw { left: 0; top: 0; }
.selection-handle.ne { left: 100%; top: 0; }
.selection-handle.se { left: 100%; top: 100%; }
.selection-handle.sw { left: 0; top: 100%; }
.selection-anchor, .group-anchor {
  width: calc(22px * var(--inv, 1)); height: calc(22px * var(--inv, 1));
  border-radius: 50%; border: calc(1px * var(--inv, 1)) solid rgba(255,255,255,.28);
  background: #6366f1; color: #fff; cursor: crosshair; padding: 0;
  display: flex; align-items: center; justify-content: center; pointer-events: auto;
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
}
.selection-anchor {
  position: absolute; right: 0; top: 50%; transform: translate(50%, -50%);
  pointer-events: auto;
}
.selection-anchor svg, .group-anchor svg {
  width: calc(12px * var(--inv, 1)); height: calc(12px * var(--inv, 1));
  stroke-width: 2.4;
}
.group-frame {
  position: absolute; box-sizing: border-box; pointer-events: auto;
  border: calc(1.4px * var(--inv, 1)) solid color-mix(in srgb, var(--group-color, #6366f1) 34%, transparent);
  border-radius: calc(12px * var(--inv, 1)); background: transparent;
}
.group-frame.selected {
  border-color: var(--group-color, #6366f1);
  background: color-mix(in srgb, var(--group-color, #6366f1) 5%, transparent);
}
.group-name {
  position: absolute; left: 0; top: calc(-24px * var(--inv, 1));
  width: calc(192px * var(--inv, 1)); height: calc(22px * var(--inv, 1));
  padding: 0; border: 0; outline: none; background: transparent;
  color: var(--group-color, #6366f1); font: inherit;
  font-size: calc(12px * var(--inv, 1)); font-weight: 800;
  line-height: calc(22px * var(--inv, 1)); pointer-events: auto;
}
.group-name[readonly] { cursor: text; }
.group-name:not([readonly]) {
  background: var(--panel); border: calc(1px * var(--inv, 1)) solid var(--group-color, #6366f1);
  border-radius: calc(5px * var(--inv, 1)); padding: 0 calc(6px * var(--inv, 1));
  color: var(--text);
}
.group-handle {
  display: none; position: absolute; z-index: 2;
  width: calc(8px * var(--inv, 1)); height: calc(8px * var(--inv, 1));
  border-radius: 50%; background: var(--card-solid);
  border: calc(1.5px * var(--inv, 1)) solid var(--group-color, #6366f1);
  transform: translate(-50%, -50%);
}
.group-frame.selected .group-handle { display: block; }
.group-handle[data-handle="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.group-handle[data-handle="n"] { left: 50%; top: 0; cursor: ns-resize; }
.group-handle[data-handle="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.group-handle[data-handle="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.group-handle[data-handle="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.group-handle[data-handle="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.group-handle[data-handle="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.group-handle[data-handle="w"] { left: 0; top: 50%; cursor: ew-resize; }
.group-anchor {
  /**
   * 组轮廓右侧同时有「东侧缩放点」和「引出锚点」，两者都在 right:50%。
   * 锚点默认中心正好压在缩放点上，而缩放点 z-index:2，结果点击总是被
   * 缩放点接走 —— 看起来就是「打组后右侧锚点拖不出去」。
   * 把锚点往外挪 12px 并抬高层级，两个操作都能命中。
   */
  position: absolute; right: calc(-12px * var(--inv, 1)); top: 50%;
  transform: translate(50%, -50%); z-index: 3;
}
.group-toolbar {
  position: absolute; z-index: 45; display: none; align-items: center; gap: 2px;
  padding: 5px; border-radius: 14px; background: var(--panel);
  border: 1px solid var(--line); box-shadow: 0 12px 36px var(--shadow);
  backdrop-filter: blur(16px); visibility: hidden;
}
.group-toolbar.show { display: flex; visibility: visible; }
.group-tool {
  height: 30px; padding: 0 10px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text); font: inherit;
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center;
  gap: 6px; cursor: pointer; white-space: nowrap;
}
.group-tool:hover { background: var(--soft); }
.group-tool svg { width: 14px; height: 14px; flex-shrink: 0; }
.group-tool .group-caret { width: 11px; height: 11px; color: var(--faint); }
.group-color-btn { padding: 0 7px; }
.group-color-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--line-2); display: block; box-sizing: border-box;
}
.group-pop {
  position: fixed; z-index: 232; padding: 8px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 16px 44px var(--shadow); backdrop-filter: blur(16px);
}
.group-swatches { display: grid; grid-template-columns: repeat(5, 16px); gap: 7px; }
.group-swatch {
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); padding: 0;
}
.group-swatch.is-none { background: transparent !important; border-color: var(--line-2); }
.group-swatch.active { outline: 2px solid var(--text); outline-offset: 2px; }
.group-arrange { display: flex; flex-direction: column; gap: 2px; min-width: 132px; }
.group-arrange-item {
  height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text); font: inherit; font-size: 11px; font-weight: 650;
  display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left;
}
.group-arrange-item:hover { background: var(--soft); }
.group-arrange-item svg { width: 14px; height: 14px; color: var(--faint); }
body.group-linking { cursor: crosshair; }

/* ---------- Frame 鍒嗙粍 ---------- */
.frame {
  position: absolute; z-index: 1;
  border: 2px dashed var(--line-2);
  border-radius: 18px;
  background: color-mix(in srgb, var(--soft) 40%, transparent);
  pointer-events: none;
}
.frame.selected { border-color: var(--strong); background: color-mix(in srgb, var(--strong) 5%, transparent); pointer-events: auto; }
.frame-title {
  position: absolute; top: -11px; left: 14px;
  padding: 2px 10px; border-radius: 999px;
  background: var(--card-solid); border: 1px solid var(--line);
  font-size: 11px; font-weight: 800; color: var(--muted);
  pointer-events: auto; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.frame.selected .frame-title { color: var(--text); border-color: var(--strong); }
.frame-title input {
  border: none; background: transparent; outline: none;
  color: inherit; font: inherit; width: 120px;
}

/* ---------- 闃熷垪闈㈡澘 ---------- */
.queue-panel {
  position: absolute; left: 80px; top: 78px; z-index: 28;
  width: 300px; max-height: calc(100vh - 180px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 16px 44px var(--shadow);
  backdrop-filter: blur(16px);
  display: none; flex-direction: column; overflow: hidden;
}
.queue-panel.open { display: flex; }
.queue-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 600;
  /* 琛岄珮鏄惧紡缁欏畾锛氬浘鏍囪涓庢枃瀛楄鍩虹嚎鎵嶅寰楅綈 */
  min-height: 34px;
}
.queue-row:last-child { border-bottom: none; }
.queue-row.is-error { color: var(--danger); }

/**
 * 鐘舵€佸窘鏍囥€?
 *
 * 鍘熸潵杩欓噷鏄?20px 鍦嗗舰閲屽 '鈻? / '鉁? / '!' / '脳' 杩欎簺**瀛楃**锛?
 * 瀛楃鐨勮瑙夊ぇ灏忓畬鍏ㄤ笉涓€鑷达紙'鈻? 鎾戞弧銆?!' 鍙崰涓棿涓€鏉★級锛?
 * 娣峰湪涓€鍒楅噷澶у皬鍙傚樊 鈥斺€?杩欐槸闃熷垪闈㈡澘鐪嬬潃涔辩殑鏍规簮銆?
 * 鐜板湪缁熶竴鎹㈡垚 lucide 鍥炬爣锛氬悓涓€濂?24 缃戞牸鐢荤殑锛岀缉鍒板悓涓€灏哄澶╃劧瀵归綈銆?
 */
.queue-row .pos {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--soft); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
/* 鍥炬爣涓庡簭鍙疯蛋鍚勮嚜鐨勬帓鐗堬細鍥炬爣鐨勫熀绾跨敱 SVG 鐩掓ā鍨嬪喅瀹氾紝
   鍜屾枃瀛楃殑 line-height 涓嶆槸涓€鍥炰簨锛屽垎寮€瀹氭墠涓嶄細浜掔浉鎷夋壇銆?*/
.queue-row .pos svg { width: 12px; height: 12px; stroke-width: 2.5; }
.queue-row .pos.is-index { font-size: 11px; font-weight: 700; line-height: 1; }
.queue-row.running .pos { background: var(--strong); color: var(--strong-text); }
.queue-row .pos.st-done { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.queue-row .pos.st-error { background: var(--danger-bg); color: var(--danger); }
.queue-row .pos.st-canceled { color: var(--muted); }

.queue-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/**
 * 鑰楁椂鍗曠嫭涓€鍒椼€?
 *
 * 鍘熸潵瀹冨拰鑺傜偣鍚嶆嫾鍦ㄥ悓涓€娈垫枃瀛楅噷锛堛€孉PI鐢熸垚 路 47 绉掋€嶏級锛?
 * 鍙冲榻愪竴涓暟瀛楀弽鑰屾洿鏁撮綈锛屼篃鏇村鏄撴í鍚戞瘮杈冨摢娆℃參銆?
 */
.queue-row .dur {
  font-size: 11px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}

.queue-subtitle {
  padding: 12px 12px 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}

/**
 * 琛屽熬鎿嶄綔鎸夐挳銆?
 *
 * 涔嬪墠澶嶇敤 .canvas-nav-btn 鈥斺€?閭ｆ槸宸︿晶瀵艰埅鏍忥紙56px 瀹介偅涓€鏉★級鐨勫昂瀵革紝
 * 鎷垮埌 300px 瀹界殑闃熷垪闈㈡澘閲屽氨鏄惧緱鍙堝ぇ鍙堟尋锛岃€屼笖 hover 鍙嶉涔熸槸瀵艰埅鏍忛偅濂椼€?
 * 闃熷垪鑷繁涓€濂?24px 鏂归挳锛屽拰琛岄珮 34px 姝ｅソ榻愬钩銆?
 */
.queue-act {
  width: 24px; height: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 7px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.queue-act svg { width: 14px; height: 14px; }
.queue-act:hover { background: var(--soft); color: var(--text); }

/**
 * 鎶藉眽/闈㈡澘澶撮儴鐨勬寜閽粺涓€鎴?26px 鏂瑰舰銆?
 *
 * .prop-close 鏄?28px 鐨?*鍦嗗舰**锛堣妭鐐瑰睘鎬ч潰鏉垮湪鐢級锛?queue-act 鏄?24px 鏂瑰舰锛?
 * 涓よ€呭苟鎺掑氨鏄竴澶т竴灏?鈥斺€?闃熷垪闈㈡澘鍜岃祫浜у簱澶撮儴閮芥牻鍦ㄨ繖涓婇潰銆?
 * 瑕嗙洊鍙綔鐢ㄥ湪 .prop-head 鍐呴儴锛屼笉鍔?.prop-close 鏈韩銆?
 */
.prop-head .prop-close,
.prop-head .queue-act {
  width: 26px; height: 26px; border-radius: 8px;
}
.prop-head .prop-close svg,
.prop-head .queue-act svg { width: 14px; height: 14px; }
.prop-head { padding: 12px 14px; }

/** 鍗遍櫓鎿嶄綔锛堟壒閲忓垹闄わ級甯告€佸氨璇ョ湅寰楀嚭鏉ワ紝涓嶈兘鍜屾櫘閫氭寜閽竴涓鑹?*/
.queue-act.danger:not(:disabled) { color: var(--danger); }

/**
 * 闃熷垪闈㈡澘閭ｆ帓鎸夐挳璺熼殢 .prop-head 鐨勭粺涓€瑙勬牸锛堣涓嬫柟 .prop-head 瑙勫垯锛夛紝
 * 涓嶅啀鍗曠嫭瑕嗙洊涓€浠?鈥斺€?涓ゅ鍚勫啓涓€閬嶏紝灏哄涓€鏃︽敼鍔ㄥ氨浼氬彧鏀瑰埌涓€澶勩€?
 */
.queue-panel .prop-head .prop-close,
.queue-panel .prop-head .queue-act { flex-shrink: 0; }

/* ---------- 鑺傜偣鐘舵€佹潯锛堣繍琛?閿欒锛?---------- */
.node-state {
  display: flex; flex-direction: column; gap: 5px;
  margin-bottom: 9px; padding: 7px 9px;
  border-radius: 11px; font-size: 10px; font-weight: 800;
}
.node-state.running { background: color-mix(in srgb, var(--strong) 8%, transparent); }
.node-state.error { background: var(--danger-bg); color: var(--danger); }
.node-state.ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.node-state.queued {
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  color: var(--muted);
}
/* 鑺傜偣杈规鐨勫洓鎬佸弽棣堬細涓嶇敤绛夌姸鎬佹潯涔熻兘涓€鐪肩湅鍑?*/
.node.state-queued { border-color: color-mix(in srgb, var(--muted) 40%, var(--panel)); }
.node.state-ok { border-color: color-mix(in srgb, var(--success) 45%, var(--panel)); }
.node.state-error { border-color: color-mix(in srgb, var(--danger) 55%, var(--panel)); }
.node.state-error { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.node-state .row { display: flex; align-items: center; gap: 6px; }
.node-state .msg { font-weight: 700; opacity: .9; line-height: 1.5; }
.node-state .acts { display: flex; gap: 5px; margin-top: 3px; }

/* ---------- 鑺傜偣鐘舵€佹潯 ----------
 * 瀹冧綇鍦?.node 閲屼絾**涓嶅湪 .node-body 閲?*锛? * body 鏄€岀鍚嶅彉浜嗘墠閲嶅缓銆嶇殑缂撳瓨鍖猴紝閲嶅缓浼?innerHTML=''锛? * 鎶婄敤鎴锋鍦ㄨ緭鍏ョ殑鍐呭鍜岀劍鐐逛竴璧锋瘉鎺夈€傝€岃繍琛岀姸鎬佹瘡绉掗兘鍦ㄥ彉锛? * 鎵€浠ョ姸鎬佹潯蹇呴』鏈夎嚜宸辩殑 DOM銆佺嫭绔嬫洿鏂般€? */
.node-status-slot {
  display: flex; flex-direction: column; gap: 5px;
  margin: 0 12px 9px; padding: 7px 9px;
  border-radius: 11px; font-size: 10px; font-weight: 800;
}
.node-status-slot .row { display: flex; align-items: center; gap: 6px; }
.node-status-slot .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-status-slot .pct { opacity: .7; font-variant-numeric: tabular-nums; }
.node-status-slot .msg { font-weight: 700; opacity: .9; line-height: 1.5; }
.node-status-slot .acts { display: flex; gap: 5px; margin-top: 3px; }
.node-status-slot .node-progress { margin: 0; }

.node-status-slot.running { background: color-mix(in srgb, var(--strong) 8%, transparent); }
.node-status-slot.queued { background: color-mix(in srgb, var(--muted) 10%, transparent); color: var(--muted); }
.node-status-slot.error { background: var(--danger-bg); color: var(--danger); }
.node-status-slot.ok { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.node-status-slot.missing { background: var(--danger-bg); color: var(--danger); }

/* ---------- 鑺傜偣鍐呰繘搴︽潯 ---------- */
.node-progress { margin-bottom: 9px; }
.node-progress .bar {
  height: 4px; border-radius: 2px; background: var(--soft-2); overflow: hidden;
}
.node-progress .fill {
  height: 100%; border-radius: 2px; background: var(--strong);
  transition: width .25s var(--ease);
}
.node-progress .fill.indeterminate { width: 34% !important; animation: slide 1.1s ease-in-out infinite; }
.node-progress .cap {
  display: flex; justify-content: space-between;
  font-size: 9px; font-weight: 800; color: var(--faint); margin-top: 4px;
}

/* ---------- 杈撳叆鎺掑簭鏉★紙棣栧抚/灏惧抚锛?---------- */
.port-strip { margin-bottom: 9px; }
.port-strip .head {
  display: flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 800; color: var(--faint);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 5px;
}
.port-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.port-chip {
  position: relative; width: 34px; height: 34px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--soft);
  cursor: grab; flex-shrink: 0;
}
.port-chip img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.port-chip.dragging { opacity: .35; }
.port-chip.over { border-color: var(--strong); transform: scale(1.12); }
.port-chip .n {
  position: absolute; left: 2px; top: 1px;
  font-size: 9px; font-weight: 900; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.port-chip .x {
  position: absolute; right: 1px; top: 1px;
  width: 13px; height: 13px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; opacity: 0; transition: opacity .12s;
}
.port-chip:hover .x { opacity: 1; }
.port-chip .x:hover { color: var(--danger); }

/* ---------- 鏃ュ織鎶藉眽 ---------- */
.log-drawer {
  position: absolute; right: 16px; bottom: 16px; z-index: 27;
  width: 460px; max-width: 92vw; max-height: 46vh;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 16px 44px var(--shadow);
  backdrop-filter: blur(16px);
  display: none; flex-direction: column; overflow: hidden;
}
.log-drawer.open { display: flex; }
.log-body {
  padding: 12px 14px; overflow: auto; flex: 1;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px; line-height: 1.65; white-space: pre-wrap;
  word-break: break-word; color: var(--muted);
}
.log-body .err { color: var(--danger); font-weight: 700; }

/* ---------- 鎵归噺缁撴灉缃戞牸 ---------- */
.batch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 5px; margin-top: 8px;
}
.batch-cell {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: var(--soft); cursor: pointer;
}
.batch-cell img { width: 100%; height: 100%; object-fit: cover; }
.batch-cell .tag {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2px 4px; background: linear-gradient(transparent, rgba(0,0,0,.78));
  color: #fff; font-size: 8px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.batch-cell.failed { display: flex; align-items: center; justify-content: center; background: var(--danger-bg); }
.batch-cell.pending { background: var(--soft-2); }
.boot-overlay {
  position: fixed; inset: 0; z-index: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--page); color: var(--muted);
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  transition: opacity .3s var(--ease);
}
.boot-overlay.hide { opacity: 0; pointer-events: none; }
.boot-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--strong);
  animation: spin .8s linear infinite;
}

/* ---------- 閫氱敤鎸夐挳 ---------- */
.btn {
  height: 32px; padding: 0 14px; border-radius: var(--radius-btn);
  border: 1px solid var(--line); background: var(--card-solid); color: var(--text);
  font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; transition: all .16s var(--ease); white-space: nowrap;
}
.btn:hover { background: var(--soft-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--strong); color: var(--strong-text); border-color: var(--strong); }
.btn.primary:hover { opacity: .88; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--soft-2); color: var(--text); }
.btn.danger { color: var(--danger); border-color: var(--line); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 13px; height: 13px; }
.btn.block { width: 100%; }

/* ---------- Toast ---------- */
.toast-host {
  /* 鎸埌鍙充笅瑙掋€傚師鏉ュ湪 top:16px / z-index:800锛屼細鐩存帴鐩栦綇 z-index:30 鐨?     椤堕儴宸ュ叿鏍?鈥斺€?杩炵画鍑犳潯 toast 鏃跺舰鎴愪竴鏉＄偣鍑绘嫤鎴甫锛屽伐鍏锋爮瀹屽叏鐐逛笉鍔ㄣ€?*/
  position: fixed; right: 16px; bottom: 16px;
  z-index: 800; display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
  max-height: 60vh; overflow: hidden;
}
.toast {
  pointer-events: auto;
  min-width: 200px; max-width: 460px;
  padding: 10px 16px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 12px 36px var(--shadow); backdrop-filter: blur(16px);
  font-size: 12px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
  animation: fadeIn .22s var(--ease);
}
.toast .tx { line-height: 1.5; }
/* 鎾ら攢涔嬬被鐨勬搷浣滄寜閽?*/
.toast-action {
  margin-left: 6px; padding: 3px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--soft);
  font-size: 11px; font-weight: 800; color: var(--text);
  cursor: pointer; flex-shrink: 0; transition: background .12s;
}
.toast-action:hover { background: var(--soft-2); }
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }
.toast.error { border-color: var(--danger); color: var(--danger); background: var(--card-solid); }
.toast.success { border-color: var(--success); color: var(--success); background: var(--card-solid); }
.toast.warning { border-color: var(--warning); color: var(--warning); background: var(--card-solid); }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: all .22s var(--ease); }

/* ---------- 杩涘害鏉?---------- */
.progress-track {
  height: 5px; border-radius: 3px; background: var(--soft-2);
  overflow: hidden; margin-top: 8px;
}
.progress-fill {
  height: 100%; border-radius: 3px; background: var(--strong);
  width: 0%; transition: width .25s var(--ease);
}
.progress-fill.indeterminate {
  width: 34% !important; animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide { 0% { margin-left: -34%; } 100% { margin-left: 100%; } }
.progress-note {
  margin-top: 5px; font-size: 10px; font-weight: 700; color: var(--faint);
  display: flex; justify-content: space-between; gap: 6px;
}

/* ---------- 鑺傜偣杩愯鎬?----------
   涓夌鍔ㄧ敾鍏ㄩ儴鏄函 CSS锛屽彧鎸傚湪 .running / .state-queued 涓婏細
     铚傚发   鈥斺€?body 涓婄紦鎱㈡í鍚戞祦鍔ㄧ殑鍏竟褰㈠簳绾癸紝璇存槑銆岃繖鍙版満鍣ㄥ湪骞叉椿銆?
     鍦嗙幆   鈥斺€?鍗＄墖澶栧湀寰嬪姩锛屼笉鍗犲崱鐗囧唴閮ㄧ┖闂达紝涓嶄細鐩栦綇缁撴灉鍥?
     鍦嗙偣   鈥斺€?鍙充笂瑙掔姸鎬佽兌鍥婇噷鐨勫懠鍚哥偣锛堝師鏈夛級
   涓轰粈涔堜笉鐢?JS 椹卞姩锛?00 涓妭鐐规椂姣忎釜鑺傜偣鎸備竴涓?rAF锛?
   鍏夋槸绌鸿浆鐨勫畾鏃跺櫒灏辫兘鎶婂抚鐜囨嫋鍨紱鑰?CSS 鍔ㄧ敾鐢卞悎鎴愬櫒澶勭悊锛?
   鑺傜偣琚鍙ｈ鍓紙.culled锛夊悗娴忚鍣ㄨ嚜鍔ㄨ烦杩囦笉鍙閮ㄥ垎鐨勭粯鍒躲€?*/

/* 铚傚发锛氬叚杈瑰舰鐢?repeating-conic 鎷间笉鍑烘潵锛岃繖閲岀敤涓夊眰 repeating-linear-gradient
   浜ゅ彔鎴愮綉鏍肩嚎锛屾瘮 SVG data-URI 杞伙紝涔熶笉浼氬洜涓鸿浆涔夐棶棰樺湪鏌愪簺娴忚鍣ㄩ噷鏁存潯瑙勫垯澶辨晥銆?
   z-index:-1 璁╁畠寰呭湪鍐呭涔嬩笅锛涢厤鍚堜笅闈?.node-body 鐨?isolation锛屼笉浼氭笚鍒板崱鐗囧闈€?*/
.node.running .node-body::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    repeating-linear-gradient(60deg, color-mix(in srgb, var(--strong) 16%, transparent) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(-60deg, color-mix(in srgb, var(--strong) 16%, transparent) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--strong) 12%, transparent) 0 1px, transparent 1px 15.6px);
  background-size: 200% 100%;
  animation: hexflow 5.5s linear infinite;
  pointer-events: none;
  opacity: .5;
  border-radius: 0 0 var(--radius-node) var(--radius-node);
}
@keyframes hexflow { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 26px 0, -26px 0, 0 0; } }

/* 鎵厜锛氬彔鍦ㄨ渹宸箣涓婏紝鍘嬩綆涓嶉€忔槑搴︼紝鍙綋銆屽湪鍔ㄣ€嶇殑鎻愮ず鑰屼笉鏄瑙変富浣?*/
.node.running .node-body::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(120,180,255,.10) 50%, transparent 70%);
  background-size: 220% 100%; animation: shimmer 1.2s linear infinite;
  pointer-events: none; border-radius: 0 0 var(--radius-node) var(--radius-node);
}
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }

/* 鍦嗙幆寰嬪姩锛氫袱鍦堜笉鍚屽懆鏈熺殑澶栨墿锛屽懆鏈熼敊寮€鎵嶄笉浼氱湅璧锋潵鍍忔暣浣撻棯涓€涓?*/
.node.running { outline: 2px solid var(--strong); outline-offset: 2px; }
.node.running::after {
  content: ""; position: absolute; inset: -3px; z-index: 7;
  border: 1.5px solid var(--strong); border-radius: var(--radius-node);
  animation: ring 2.1s var(--ease) infinite;
  pointer-events: none;
}
@keyframes ring {
  0%   { opacity: .55; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.035); }
  100% { opacity: 0;   transform: scale(1.035); }
}

/* 鎺掗槦锛氶潤鎬佽櫄绾挎弿杈广€傛帓闃熸槸銆岃繕娌¤疆鍒版垜銆嶏紝涓嶈鍜岃繍琛屼腑涓€鏍烽棯 */
.node.state-queued::after {
  content: ""; position: absolute; inset: -3px; z-index: 7;
  border: 1.5px dashed color-mix(in srgb, var(--muted) 60%, transparent);
  border-radius: var(--radius-node); pointer-events: none;
}

.node.node-error { outline: 2px solid var(--danger); outline-offset: 2px; }
.node { position: absolute; }
/* isolation 寤虹珛灞傚彔涓婁笅鏂囷紝璁?.node-body::before 鐨?z-index:-1 琚叧鍦ㄨ繖涓崱鐗囬噷锛?
   涓嶄細椤虹潃鐖剁骇涓€璺笚鍒扮敾甯冨簳灞傚幓锛堟病鏈?isolation 鏃惰礋 z-index 浼氭紡鍒?body 涔嬩笅锛夈€?*/
.node .node-body { position: relative; isolation: isolate; }

.node-status {
  position: absolute; top: 8px; right: 34px; z-index: 8;
  display: none; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--strong); color: var(--strong-text);
  font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.node.running .node-status { display: flex; }
.node-status .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* 鍓嶅涵鏁忔劅鐨勭敤鎴凤細淇濈暀闈欐€佹弿杈癸紝鍘绘帀鎵€鏈夊惊鐜姩鐢汇€?
   杩欑被鍔ㄧ敾娌℃湁浼犺揪鏂囧瓧涔嬪鐨勬柊淇℃伅锛屽幓鎺変笉鎹熷け鍙強鎬с€?*/
@media (prefers-reduced-motion: reduce) {
  .node.running .node-body::before,
  .node.running .node-body::after,
  .node.running::after,
  .node-status .dot { animation: none; }
  .node.running .node-body::before { opacity: .28; }
  .node.running::after { opacity: .5; }
}

/* ---------- 濯掍綋鍗＄墖锛堝浘鐗?/ 瑙嗛 / 闊抽锛夛細涓€寮犲共鍑€鐨勫崱 ---------- */
/*
  鍗＄墖閲?*鍙湁濯掍綋鏈韩**銆傛浛鎹€佸垹闄ゃ€佷笅杞借繖浜涙寜閽叏鍦ㄤ笂鏂规偓娴伐鍏锋潯閲岋紝
  鎻愮ず璇嶅拰鍙傛暟鍦ㄤ笅鏂归潰鏉块噷 鈥斺€?鍗″唴涓嶇暀浠讳綍甯搁┗鎺т欢銆?

  涓轰粈涔堝繀椤绘槸 16:9 鑰屼笉鏄浐瀹氬儚绱犻珮搴︼細鍙傝€冩渚嬬殑绌哄崱鏄?16:9锛?
  鑰岃妭鐐归珮搴﹂粯璁ゆ槸鑷€傚簲鐨勶紙`h: 0`锛夈€傚啓姝婚珮搴﹀氨寰楀湪鎹㈠浘鐗囨椂鍚屾
  patch 鑺傜偣楂樺害锛岄偅浼氳鑺傜偣灏哄璺熺潃濯掍綋鍙樺寲 鈥斺€?鑺傜偣灏哄鏄繛绾跨鐐广€?
  灏忓湴鍥?fit銆佹閫夌殑杈撳叆锛屼竴璺姈涓€璺噸鎺掋€傜敤 aspect-ratio 鍒?
  楂樺害瀹屽叏鐢?CSS 绠楋紝JS 涓€涓瓧鑺傞兘涓嶇敤纰般€?
*/

/*
  澶存爮濉屾垚 0 楂橈紝鑰屼笉鏄?display:none銆?
  `.node-status`锛堣繍琛屼腑/鎴愬姛/澶辫触鐨勮兌鍥婏級鏄?`.node-head` 鐨勫瓙鍏冪礌锛?
  涓€鏃?display:none 瀹冭窡鐫€娑堝け 鈥斺€?閭ｆ槸鍞竴涓€澶勫憡璇夌敤鎴枫€屾鍦ㄧ敓鎴愩€嶇殑鍦版柟銆?
  鍙棌鏍囬鍜屽垹闄ゆ寜閽€佷繚鐣?status锛屽鎺夌殑鏄偅鏉?40px 鐨勭┖鏍忋€?
*/
.is-media .node-head,
.is-text-card .node-head { height: 0; min-height: 0; padding: 0; border: none; cursor: default; }
/* 鏂囨湰鍗′粛鏄?flex 瀹瑰櫒锛屽彧鍐?height:0 鍘嬩笉浣忓熀纭€鏍峰紡鐨?flex-basis:40px */
.is-text-card .node-head { display: none; }
.is-media .node-title, .is-media .node-head .close-btn, .is-media .node-head .props-btn,
.is-text-card .node-title, .is-text-card .node-head .close-btn, .is-text-card .node-head .props-btn { display: none; }
/*
  鍦嗚蹇呴』鍜屽崱鐗?*鍚屼竴涓€?*銆?
  涔嬪墠 `.media-stage` 鍐欐 10px 鑰?`.node` 鏄?22px锛屼簬鏄浘鐗囩殑鍥涜姣斿崱鐗囧渾瑙掑皬涓€鍦堬細
  鍗＄墖鐨勫簳鑹蹭粠鍥涗釜瑙掍笂闇插嚭鏉ワ紝鑰?`.node.selected` 鐨?outline锛?2px锛?
  鍙堟濂藉帇鍦ㄥ浘鐗囧渾瑙掍箣澶?鈥斺€?鐢ㄦ埛鎴浘閲岄偅鏉°€屾弿杈逛笉閫傞厤銆嶅氨鏄繖涔堟潵鐨勶細
  鎻忚竟鍜屽浘鏄袱涓笉鍚岀殑鍦嗭紝鍚勮嚜鎻忓悇鑷殑銆?
  鐢ㄥ悓涓€涓彉閲忎箣鍚庯紝鏀逛富棰樺渾瑙掓椂涓よ竟涓€璧峰彉锛屼笉浼氬啀婕傘€?
*/
.is-media .node-body { padding: 0; }
.is-media .media-stage,
.is-media .media-empty,
.is-media .media-stage .media-fill { border-radius: var(--radius-node); }
/*
  鍏滃簳锛氶珮搴﹂攣姝讳簡锛屽氨涓嶈鍑虹幇浠讳綍婊氬姩鏉°€?
  鍗充娇鏈夎€佹暟鎹畫鐣欍€佹垨鑰呭皢鏉ユ煇涓垎鏀張鍐欎笂浜?height锛?
  杩欎竴鏉′篃淇濊瘉銆屽浘姘歌繙鍏ㄦ樉銆嶈€屼笉鏄€屽浘琚杩涗竴涓兘婊氱殑鐩掑瓙銆嶃€?
*/
.is-media .node-body { overflow: hidden; }
.is-media .media-fill { max-height: none; }

/* 鍗＄墖涓婃部涔嬩笂鐨勬爣棰樿锛氬浘鏍?+ 鏍囬 鈥︹€?灏哄路姣斾緥 */
.node-cap {
  position: absolute; bottom: 100%; left: 0; margin-bottom: 7px;
  display: flex; align-items: center; gap: 6px;
  max-width: 100%; pointer-events: none; white-space: nowrap;
  font-size: 11px; color: var(--muted);
}
.node-cap-icon { display: inline-flex; opacity: .75; }
.node-cap-icon svg { width: 12px; height: 12px; }
.node-cap-title { overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.node-cap-meta { margin-left: auto; padding-left: 10px; opacity: .8; font-variant-numeric: tabular-nums; }

/* 涓婃柟鐨勬偓娴伐鍏锋潯銆俬over / 閫変腑鎵嶅嚭鐜般€?*/
.node-float {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%) scale(var(--panel-scale, 1));
  transform-origin: bottom center;
  display: flex; align-items: center; gap: 2px;
  margin-bottom: 26px; padding: 3px;
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: 0 8px 24px var(--shadow);
  opacity: 0; pointer-events: none; z-index: 9;
  transition: opacity .14s var(--ease);
}
/*
  鏄惧舰鏉′欢鏄?*閫変腑 / 闈㈡澘鎵撳紑**锛屼笉鏄?hover銆?

  鐢ㄦ埛鎵规敞锛氥€屼笂鏂圭殑鍔熻兘鏉℃槸鐐瑰嚮鍗＄墖鎵嶆樉绀猴紝涓嶆槸榧犳爣鎮仠鏄剧ず銆嶃€?
  杩欎笉鍙槸鏃舵満闂锛氬伐鍏锋潯涓婃槸鍒犻櫎銆佷笅杞姐€佹斁澶с€佽挋鐗?鈥斺€?鍏ㄦ槸
  **浼氭敼鍙樻暟鎹垨绂诲紑褰撳墠瑙嗗浘**鐨勫姩浣溿€傞紶鏍囨壂杩囩敾甯冩椂閫愪釜寮瑰嚭瀹冧滑锛?
  绛変簬鍦ㄦ瘡寮犲崱涓婃柟鎽嗕竴鎺掗殢鏃跺彲鑳借鐐圭殑鎸夐挳锛涜€屽畠浠湰鏉ョ殑璇鏄?
  銆屾垜宸茬粡閫変腑杩欏紶鍗★紝姝ｅ湪瀵瑰畠鍋氫簨銆嶃€?

  hover 鍙暀缁?*浣庡嵄涓斿繀瑕?*鐨勯偅涓€涓叆鍙ｏ細鍗＄墖鍐呯殑
  銆岋紜娣诲姞璧勪骇 / 猬嗘浛鎹€嶁€斺€?閭ｄ釜鏄繖寮犲崱鍞竴鐨勪笂浼犳柟寮忥紝
  涓嶆寚鍑烘潵鐢ㄦ埛灏辨病娉曟妸鍥炬斁涓婂幓銆?
*/
.node.selected .node-float,
.node.panel-open .node-float { opacity: 1; pointer-events: auto; }
body.node-multi-select .node.selected .node-float { display: none !important; }
.node-float-btn {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; transition: background .12s var(--ease), color .12s;
}
.node-float-btn svg { width: 13px; height: 13px; }
.node-float-btn:hover { background: var(--soft); color: var(--text); }
.node-float-btn[data-act='del']:hover { color: var(--danger); background: var(--danger-bg); }

/* 鏂囨湰鍗★細鍜屽浘鐗囧崱鍚屽锛屾鏂囧共鍑€锛屾牸寮忔寜閽叏閮ㄦ诞鍦ㄥ崱鐗囦笂鏂?*/
.node.is-text-card .node-body { padding: 14px; background: transparent; }
.node.is-text-card .text-pre {
  width: 100%; min-height: 148px; max-height: none; padding: 0;
  /* 姝ｆ枃灏辨槸鍗＄墖鏈韩鐨勪竴閮ㄥ垎锛氫笉瑕佸啀濂椾竴灞傚簳鑹?杈规/鍦嗚 */
  background: transparent; border: 0; border-radius: 0;
  overflow: visible; font-family: inherit;
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 13px; line-height: 1.6; color: var(--text);
  outline: none; cursor: text;
}
.node.is-text-card .text-pre.is-editing {
  cursor: text; box-shadow: none; border-radius: 0; padding: 0; margin: 0;
}
.node.is-text-card .resize-handle { display: none; }
.node.is-text-card .text-pre .text-empty { color: var(--faint); }
.node.is-text-card .text-pre h1,
.node.is-text-card .text-pre h2,
.node.is-text-card .text-pre h3 { margin: .45em 0 .25em; line-height: 1.25; }
.node.is-text-card .text-pre h1 { font-size: 22px; }
.node.is-text-card .text-pre h2 { font-size: 18px; }
.node.is-text-card .text-pre h3 { font-size: 15px; }
.node.is-text-card .text-pre p { margin: .35em 0; }
.node.is-text-card .text-pre ul,
.node.is-text-card .text-pre ol { margin: .4em 0; padding-left: 1.4em; }
.node.is-text-card .text-pre hr { border: none; border-top: 1px solid var(--line); margin: .8em 0; }
.node.is-text-card .node-float { gap: 0; border-radius: 14px; }
.text-float-btn {
  width: 22px; height: 24px; border-radius: 7px;
  font-size: 10px; font-weight: 800; letter-spacing: -.03em;
}
.text-float-btn svg { width: 12px; height: 12px; }
.media-empty {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-solid); color: var(--faint);
  cursor: default; border-radius: 10px;
  transition: color .15s var(--ease), background .15s;
}
.media-empty:hover { color: var(--muted); background: var(--soft); }
.media-empty.over { color: var(--strong); background: var(--soft); }
.media-empty svg { width: 34px; height: 34px; }

/*
  鏈夊浘鏃?*楂樺害璺熺潃鍥剧墖鐨勭湡瀹炴瘮渚?*锛坄height: auto`锛夛紝
  绔栧浘灏辨槸绔栫殑鍗＄墖 鈥斺€?杩欐槸鍙傝€冩渚嬪浘 5/鍥?6 鐨勫舰鎬併€?
*/
.media-stage { position: relative; border-radius: 10px; overflow: hidden; background: var(--card-solid); }
.media-fill { display: block; width: 100%; height: auto; }
/* 閲嶇粯閬僵鍥撅細褰╄壊绗旇抗鐩存帴鍙犲湪鍘熷浘涓婏紝pointer-events 鐣欑粰鍗＄墖鏈韩銆?*/
.media-mask-preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: fill; opacity: .55; pointer-events: none;
  border-radius: inherit; z-index: 1;
}
.media-stage video.media-fill { background: #000; }
.media-stage.is-audio { padding: 10px; }
.media-audio { width: 100%; }
.media-gone { padding: 24px; text-align: center; font-size: 11px; color: var(--faint); }

/*
  瑕嗙洊灞傛寜閽細hover 鏃舵墠鍑虹幇锛岄€変腑鏃朵篃鐣欑潃锛堥€変腑鎰忓懗鐫€鐢ㄦ埛宸茬粡鍦ㄥ鐞嗚繖寮犲崱锛夈€?
  杩欓噷鍜屼笂鏂瑰伐鍏锋潯鐨勫尯鍒槸**鍔ㄤ綔椋庨櫓**锛氫笂浼?鏇挎崲閮芥槸銆屽線杩欏紶鍗￠噷鏀句笢瑗裤€嶏紝
  涓嶆敼鍙樺埆鐨勫崱鐗囷紱鑰屽垹闄ゆ槸浼氭尝鍙婂埆澶勭殑銆?
*/
.media-add, .media-replace {
  position: absolute; top: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--card-solid) 88%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line); color: var(--text);
  font-size: 10.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  opacity: 0; transition: opacity .14s var(--ease);
}
.media-add { left: 50%; transform: translateX(-50%); }
.media-replace { right: 8px; }
.media-add svg, .media-replace svg { width: 12px; height: 12px; }
.media-stage:hover .media-add,
.media-stage:hover .media-replace,
.media-empty:hover .media-add,
.node:hover .media-add,
.node:hover .media-replace,
.node.selected .media-add,
.node.selected .media-replace { opacity: 1; }

/*
  鍗＄墖鍏夋爣鏄?default 鑰屼笉鏄?zoom-in / pointer銆?
  鐐瑰浘鐗囧凡缁忎笉鍐嶆斁澶ч瑙堜簡锛堥偅鏄笂鏂瑰伐鍏锋潯閲岀殑銆屾斁澶ч瑙堛€嶆寜閽級锛?
  鐣欑潃 zoom-in 浼氭妸鐢ㄦ埛寮曞悜涓€涓凡缁忔敼鎺夌殑鍔ㄤ綔銆?
*/
.media-stage, .media-empty { cursor: default; }

/* 澶氬紶鍥炬椂鍘嬪湪鍙充笅瑙掔殑璁℃暟瑙掓爣 */
/* ---------- 澶氬浘锛氭姌鍙犳椂闇茶竟瑙掞紝灞曞紑鏃跺乏鍙冲钩閾?---------- */
.media-stage.has-stack {
  padding: 0 10px 10px 0;
  background: transparent;
  overflow: visible;
}
.media-stage.has-stack .media-fill {
  position: relative; z-index: 4;
  border-radius: var(--radius-node);
}
.media-stack-back {
  position: absolute; inset: 0;
  border-radius: var(--radius-node);
  background: var(--card-solid);
  border: 1px solid var(--line);
}
.media-expand {
  position: absolute; right: 14px; bottom: 14px; z-index: 8;
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--card-solid) 90%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line); color: var(--text);
  font: inherit; font-size: 10.5px; font-weight: 750; cursor: pointer;
}
.media-expand svg { width: 12px; height: 12px; }
.media-expand:hover { background: var(--soft-2); }

.media-stage.is-expanded {
  padding: 0; background: transparent; overflow: visible;
}
.media-expanded {
  display: flex; align-items: flex-start; gap: 8px;
}
.media-exp-item {
  position: relative; flex: 1 1 0; min-width: 0;
  border-radius: var(--radius-node);
  overflow: hidden;
  background: var(--card-solid);
}
.media-exp-img { display: block; width: 100%; height: auto; }
.media-exp-actions {
  position: absolute; z-index: 5;
  display: flex; align-items: center; gap: 4px;
}
.media-exp-actions.top { top: 8px; right: 8px; }
.media-exp-actions.bottom { bottom: 8px; right: 8px; }
.media-exp-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #15161a 84%, transparent);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  font: inherit; font-size: 10.5px; font-weight: 750;
  cursor: pointer; white-space: nowrap;
}
.media-exp-btn svg { width: 12px; height: 12px; }
.media-exp-btn:hover { background: rgba(38,40,47,.96); border-color: rgba(255,255,255,.32); }
.media-exp-btn.danger:hover { color: #fecaca; border-color: rgba(248,113,113,.55); background: rgba(90,22,22,.9); }
.media-exp-btn.to-node:hover { color: #bfdbfe; border-color: rgba(96,165,250,.55); }

.media-more {
  position: absolute; right: 8px; bottom: 8px;
  padding: 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--card-solid) 88%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line); color: var(--text);
  font-size: 10.5px; font-weight: 750; font-family: inherit; cursor: pointer;
}

/* 搴曞浘 / 鍙傝€?鍒囨崲锛堜粠鍗＄墖涓婄殑甯搁┗灏忔寜閽惉鍒颁簡灞炴€ч潰鏉匡級 */
.media-role-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; }
.media-role-name { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 閲嶇粯鎬侊細閬僵鐢诲湪鍥句笂锛屽伐鍏锋潯鍦ㄥ崱涓婏紝杈撳叆妗嗗湪鍗′笅 ---------- */
/*
  杩欎笁灞傞兘鎸傚湪**鑺傜偣澹?*涓婅€屼笉鏄?.node-body 閲岋細
  body 鏄€岀鍚嶅彉浜嗗氨閲嶅缓銆嶇殑缂撳瓨鍖猴紝鎹釜妯″瀷銆佷紶寮犳柊鍥鹃兘浼氭妸瀹冩竻鎺夛紝
  鑰岀敤鎴锋秱浜嗕竴鍗婄殑閬僵涓嶈兘璺熺潃涓€璧锋病銆傚３閲岀殑鍏冪礌鏈夌嫭绔嬬殑鐢熷懡鍛ㄦ湡
  锛堝拰涓嬫柟闈㈡澘 .node-panel 鍚屼竴涓亾鐞嗭級銆?
*/
.node-body.drafting {
  position: relative;
  border-radius: var(--radius-node);
  overflow: hidden;
}
/*
  涓ゅ眰锛氫笅闈㈤偅灞傚彧瀛樼櫧鑹查伄缃╃瑪鐢伙紙鎺ユ敹鎸囬拡浜嬩欢锛夛紝涓婇潰閭ｅ眰鐢汇€屽簳鍥?+ 绾㈢僵銆嶃€?
  鍚堟垚涓€灞傜殑璇濓紝姣忔閲嶇粯閮借 clearRect + 閲嶇敾搴曞浘锛岄偅涓€鐬棿灏辨妸鍒氭秱鐨勯伄缃╂摝浜?
  鈥斺€?鐥囩姸鏄€岀敾甯冨湪銆佷篃鑳芥嫋锛屼絾娑傚畬浠€涔堥兘娌℃湁銆嶏紝鏋侀毦瀹氫綅銆?
*/
.draft-mask {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  cursor: crosshair; touch-action: none; z-index: 7;
  border-radius: var(--radius-node);
}
.draft-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 8;
  border-radius: var(--radius-node);
}

/* 宸ュ叿鏉℃诞鍦ㄥ崱鐗?*澶栭潰**锛堜笂娌夸箣涓婏級锛屽拰鏍囬琛屻€佸伐鍏锋潯鍏辩敤閭ｅ潡鍦?*/
.node-maskbar {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%) scale(var(--panel-scale, 1));
  transform-origin: bottom center;
  display: flex; align-items: center; gap: 4px;
  margin-bottom: 28px; padding: 5px;
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 8px 24px var(--shadow);
  z-index: 10; opacity: 1; pointer-events: auto;
}
.node-maskbar .maskbar-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; transition: background .12s var(--ease), color .12s;
}
.node-maskbar .maskbar-btn svg { width: 17px; height: 17px; }
.node-maskbar .maskbar-btn:hover { background: var(--soft); color: var(--text); }
.node-maskbar .maskbar-btn.on { background: var(--strong); color: var(--strong-text); }
.node-maskbar .mask-size { width: 128px; accent-color: var(--strong); cursor: pointer; }

/* 棰滆壊鎸夐挳 + 浜旇壊鐩橈紙宸ュ叿鏉″湪鍗＄墖澶栵紝鑹茬洏鍚戜笅寮瑰嚭锛屼笉鎸＄敾甯冿級 */
.maskbar-color-wrap { position: relative; display: inline-flex; }
.node-maskbar .maskbar-color { position: relative; }
.mask-color-dot {
  width: 17px; height: 17px; border-radius: 50%;
  background: #ff3b5c; border: 2px solid var(--card-solid);
  box-shadow: 0 0 0 1px var(--line);
}
.mask-palette {
  position: absolute; top: calc(100% + 9px); left: 50%;
  transform: translateX(-50%);
  display: none; align-items: center; gap: 6px;
  padding: 7px 9px;
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: 0 10px 28px var(--shadow);
  z-index: 12;
}
.mask-palette.open { display: flex; }
.mask-color {
  width: 19px; height: 19px; padding: 0; border-radius: 50%;
  background: var(--dot); border: 2px solid var(--card-solid);
  box-shadow: 0 0 0 1px var(--line); cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .12s;
}
.mask-color:hover { transform: scale(1.12); }
.mask-color.on { box-shadow: 0 0 0 2px var(--strong); transform: scale(1.12); }

/* 涓嬫柟杈撳叆妗?*/
.redraw-foot {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) scale(var(--panel-scale, 1));
  transform-origin: top center;
  margin-top: 12px; width: min(560px, 92vw);
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 13px 14px 12px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 18px 48px var(--shadow); z-index: 40;
}
/*
  閲嶇粯杈撳叆妗?*娌℃湁**闀滃儚灞傘€?
  `.np-text` 鍏ㄥ眬鏄?`color: transparent`锛堥鑹茬敱 .np-hl 鐢伙級锛?
  鐓ф惉鍒拌繖閲屽氨鏄€岃緭鍏ヤ簡浣嗕竴涓瓧閮界湅涓嶈銆嶁€斺€旂敤鎴锋埅鍥鹃噷閭ｄ釜鐏板潡灏辨槸鍏夋爣銆?
  杩欓噷鎶婇鑹插拰 placeholder 閮芥樉寮忚繕鍥炴潵銆?
*/
.redraw-foot .np-text {
  min-height: 86px; font-size: 13px; line-height: 1.55;
  padding: 11px 12px; border-radius: 12px; resize: vertical;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}
.redraw-foot .np-text::placeholder { color: var(--muted); }
.redraw-foot-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.redraw-hint { font-size: 11px; color: var(--muted); }
.redraw-go {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--strong); border: none; color: var(--strong-text);
  font-size: 12.5px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.redraw-go svg { width: 16px; height: 16px; }
.node-busy { font-size: 10.5px; color: var(--muted); }

.node-body.image-editing {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-node);
}
.edit-stage {
  position: absolute; inset: 0; z-index: 4;
  overflow: hidden; border-radius: var(--radius-node);
  touch-action: none;
}
.edit-preview-base, .edit-annot, .edit-lamps, .edit-select, .edit-temp {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.edit-annot, .edit-lamps, .edit-select, .edit-temp { pointer-events: none; }
.edit-preview-base { cursor: default; }
.edit-lamp-del {
  position: absolute; z-index: 22;
  transform: translate(-100%, -50%);
  padding: 4px 9px;
  border: 1px solid rgba(255, 76, 92, .9);
  border-radius: 7px;
  background: rgba(38, 18, 22, .94);
  color: #ff6474;
  font: 700 11px/1.2 Inter, "Microsoft YaHei", sans-serif;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.edit-lamp-del:hover { background: rgba(92, 24, 32, .98); color: #ff8a96; }
.edit-text-input {
  position: absolute; z-index: 20;
  min-width: 140px; max-width: 80%;
  padding: 6px 9px;
  transform: translateY(-50%);
  background: color-mix(in srgb, var(--card-solid) 92%, transparent);
  border: 1px solid var(--strong);
  border-radius: 8px;
  font-family: inherit; font-weight: 700;
  outline: none; box-shadow: 0 6px 20px var(--shadow);
  pointer-events: auto;
}
.edit-busy {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--card-solid) 72%, transparent);
  color: var(--text); font-size: 12px; font-weight: 700;
  backdrop-filter: blur(3px);
}

.node-editbar {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%) scale(var(--panel-scale, 1));
  transform-origin: bottom center;
  display: flex; align-items: center; gap: 2px;
  margin-bottom: 30px; padding: 5px;
  max-width: calc(100vw - 32px);
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 12px 34px var(--shadow);
  z-index: 50; pointer-events: auto;
}
.editbar-btn {
  flex: none; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 50%;
  color: var(--muted); cursor: pointer;
  transition: background .12s var(--ease), color .12s, opacity .12s;
}
.editbar-btn svg { width: 17px; height: 17px; }
.editbar-btn:hover { background: var(--soft); color: var(--text); }
.editbar-btn.on { background: var(--strong); color: var(--strong-text); }
.editbar-btn:disabled { opacity: .28; cursor: default; }
.editbar-btn:disabled:hover { background: transparent; color: var(--muted); }
.editbar-btn.editbar-save { background: var(--strong); color: var(--strong-text); }
.editbar-save svg { width: 18px; height: 18px; }
.editbar-sep {
  flex: none; width: 1px; height: 20px;
  margin: 0 3px; background: var(--line);
}
.edit-color-wrap {
  position: relative; flex: none; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  background: conic-gradient(#ff4d4d, #ffd84d, #62e36b, #4dc8ff, #7a6bff, #ff4dc4, #ff4d4d);
}
.edit-color-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--card-solid);
  box-shadow: 0 0 0 1px var(--line);
  pointer-events: none;
}
.edit-color-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.edit-size-wrap {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 0 6px;
}
.edit-size-wrap[hidden] { display: none; }
.edit-size-range { width: 104px; accent-color: var(--strong); cursor: pointer; }
.edit-size-val {
  width: 25px; font-size: 10px; text-align: right;
  color: var(--muted); font-variant-numeric: tabular-nums;
}

.node-lamppanel {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(var(--lamp-lift, 0px)) scale(var(--panel-scale, 1));
  transform-origin: top center;
  margin-top: 12px; width: min(560px, 94vw);
  max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 14px 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 18px 48px var(--shadow);
  z-index: 42; pointer-events: auto;
}
.node-lamppanel[hidden] { display: none; }
.edit-lamp-head {
  display: flex; align-items: center; gap: 10px;
}
.edit-lamp-title { font-size: 12px; font-weight: 800; color: var(--text); }
.edit-lamp-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.edit-lamp-cancel, .edit-lamp-apply {
  padding: 5px 12px; border-radius: 999px;
  font-family: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.edit-lamp-cancel {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.edit-lamp-cancel:hover { background: var(--soft); color: var(--text); }
.edit-lamp-apply {
  border: none; background: var(--strong); color: var(--strong-text);
}
.edit-lamp-apply:disabled { opacity: .35; cursor: default; }
.edit-lamp-hint {
  margin-top: 3px; font-size: 10.5px; color: var(--faint);
}
.edit-lamp-rows {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px; margin-top: 8px;
}
@media (max-width: 560px) {
  .edit-lamp-rows { grid-template-columns: minmax(0, 1fr); }
}
.edit-lamp-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 42px;
  align-items: center; gap: 9px;
}
.edit-lamp-name { font-size: 11px; color: var(--muted); white-space: nowrap; }
.edit-lamp-range {
  width: 100%; accent-color: #e8b45d; cursor: pointer;
}
.edit-lamp-val {
  text-align: right; font-size: 10.5px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.edit-lamp-seg {
  display: flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: 999px; background: var(--soft);
}
.edit-lamp-seg-btn {
  flex: 1; padding: 4px 8px; border: none; border-radius: 999px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 10.5px; cursor: pointer;
}
.edit-lamp-seg-btn:hover { color: var(--text); }
.edit-lamp-seg-btn.on {
  background: var(--card-solid); color: var(--text);
  box-shadow: 0 1px 4px var(--shadow); font-weight: 700;
}
.edit-lamp-color {
  width: 42px; height: 24px; padding: 0;
  border: 1px solid var(--line); border-radius: 7px;
  background: transparent; cursor: pointer;
}

.node-editfoot {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) scale(var(--panel-scale, 1));
  transform-origin: top center;
  margin-top: 12px; width: min(760px, 94vw);
  padding: 12px 14px 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 18px 48px var(--shadow);
  z-index: 40; pointer-events: auto;
}
.node-editfoot[hidden] { display: none; }
.edit-foot-head {
  display: flex; align-items: center; gap: 10px;
}
.edit-foot-title { font-size: 12px; font-weight: 800; color: var(--text); }
.edit-foot-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: 999px; background: var(--soft);
}
.edit-tab {
  padding: 4px 10px; border: none; border-radius: 999px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 11px; cursor: pointer;
}
.edit-tab.on { background: var(--card-solid); color: var(--text); box-shadow: 0 1px 4px var(--shadow); }
.edit-reset {
  margin-left: auto; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 11px; cursor: pointer;
}
.edit-reset:hover { background: var(--soft); color: var(--text); }
.edit-adj-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 22px; margin-top: 10px;
  max-height: 180px; overflow: auto;
}
.edit-adj-grid[hidden] { display: none; }
.edit-adj-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) 32px;
  align-items: center; gap: 8px;
  color: var(--muted); font-size: 11px;
}
.edit-adj-name { white-space: nowrap; }
.edit-adj-range { width: 100%; accent-color: var(--strong); cursor: pointer; }
.edit-adj-val {
  text-align: right; color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- 瑁佸壀 / 瀹牸鍒囧垎 ---------- */
/*
  鐢诲竷鐢?*鍘熷浘鍍忕礌灏哄**锛岀缉鏀惧彧鍙戠敓鍦?CSS 鍛堢幇灞傘€?
  鍜岃挋鐗堢紪杈戝櫒鍚屼竴鏉＄悊鐢憋細鎺ュ彛瑕佺殑鏄師鍥惧潗鏍囷紝涓嶆槸灞忓箷涓婄殑缂╃暐鍥惧潗鏍囥€?
*/
.crop-editor { display: flex; flex-direction: column; gap: 10px; }
.crop-stage {
  background: var(--soft); border-radius: 12px; padding: 10px;
  display: flex; align-items: center; justify-content: center;
  /* 瀹瑰櫒楂樺害璺熺潃鍥剧墖璧帮紝涓嶇粰鍥哄畾鍊?鈥斺€?绔栧浘鍜屾í鍥惧樊濂藉嚑鍊?*/
  position: relative;
}
.crop-canvas {
  max-width: 100%; max-height: 52vh;
  /* width:auto 鑰屼笉鏄?100%锛氬惁鍒欑珫鍥句細琚拺鎴愪竴鏁村睆瀹姐€佸彧鑳界湅鍒颁腑闂翠竴鏉?*/
  height: auto; display: block;
  border-radius: 6px; cursor: crosshair; user-select: none;
  touch-action: none;
}
.crop-info { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.crop-grids { display: flex; flex-wrap: wrap; gap: 5px; }
.crop-grids .btn.active { border-color: var(--strong); color: var(--strong); background: var(--soft); }
/* 姣斾緥/瀹牸鎸夐挳鍜屻€屾柊鑺傜偣瑁佸垏銆嶅悓涓€琛岋細寮€鍏抽潬鍙筹紝鍒尋鍒版寜閽腑闂?*/
.crop-preset-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.crop-ratios { display: flex; flex-wrap: wrap; gap: 5px; }
.crop-ratios .btn.active { border-color: var(--strong); color: var(--strong); background: var(--soft); }
.crop-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.crop-toggle:hover { color: var(--text); }
.crop-toggle input { width: 14px; height: 14px; margin: 0; accent-color: var(--strong); cursor: pointer; }
/* 瀹牸瑁佸壀鐨勪袱涓嚭鍙ｏ細浠呰鍒?/ 鍒涘缓鍒嗛暅鏍煎瓙 */
.crop-mode { margin-left: auto; display: inline-flex; gap: 4px; }
.crop-mode-btn {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-solid);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.crop-mode-btn:hover { color: var(--text); border-color: var(--muted); }
.crop-mode-btn.active {
  border-color: var(--strong);
  color: var(--strong);
  background: var(--soft);
  font-weight: 700;
}
/*
  鑷畾涔夊鏍硷細鐩栧湪瑁佸垏鍥句笂鏂圭殑 10脳10 鏍煎瓙鐩樸€?
  鎷栧姩鑼冨洿鐢ㄣ€屾繁鑹插疄蹇冩牸銆嶈〃绀猴紝鍜屾埅鍥鹃噷鐨勪氦浜掍竴鑷达紱纭鍚庢墠鏀瑰垎鍓叉柟寮忋€?
*/
.crop-picker {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.42); border-radius: 12px;
}
.crop-picker[hidden] { display: none; }
.crop-picker-panel {
  width: min(300px, 92%); padding: 14px 14px 12px;
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.crop-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.crop-picker-title { font-size: 13px; font-weight: 600; }
.crop-picker-close {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 16px; line-height: 1; color: var(--muted);
}
.crop-picker-close:hover { background: var(--soft-2); color: var(--text); }
.crop-picker-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px;
  width: 100%; user-select: none; touch-action: none;
}
.crop-cell {
  aspect-ratio: 1; padding: 0; border-radius: 3px;
  background: var(--soft-2); cursor: crosshair;
}
.crop-cell:hover { background: var(--line-2); }
.crop-cell.on { background: var(--strong); }
.crop-picker-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.crop-picker-label { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.crop-picker-foot .btn { margin-left: auto; }

/* ---------- 鑺傜偣鍐呭皬宸ュ叿鏉?---------- */
.node-tools {
  display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px;
}
.node-hint {
  margin-top: 6px; font-size: 10px; line-height: 1.5; color: var(--faint); font-weight: 600;
}
.node-hint.warn { color: var(--warning); }
.node-hint.err { color: var(--danger); }
.node-hint.ok { color: var(--success); }

/* ---------- 缁撴灉缃戞牸 ---------- */
.result-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 6px; margin-top: 8px;
}
.result-item {
  position: relative; width: 100%; aspect-ratio: 1;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--soft);
  cursor: zoom-in;
}
.result-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/**
 * 缁撴灉鏍肩幇鍦ㄤ篃鏄礌鏉愭嫋鎷芥簮锛堟嫋鍒扮敾甯冪┖鐧藉鏂板缓鍗＄墖銆佹嫋鍒板凡鏈夊崱鐗囪拷鍔狅級銆?
 *
 * 鍏夋爣淇濇寔 zoom-in锛氬崟鍑诲紑澶у浘浠嶇劧鏄繖涓牸瀛愭渶涓昏鐨勪簨锛?
 * 鎹㈡垚 grab 鍙嶈€屼細璁╀汉浠ヤ负銆岀偣涓嶅紑銆嶁€斺€?鎯虫嫋鐨勪汉鎸変綇鎷栬蛋灏辫锛?
 * 涓嶉渶瑕侀澶栫殑瑙嗚閭€璇枫€?
 * 鍙湁鐪熺殑鎷栬捣鏉ヤ簡鎵嶆崲鎴愭姄鍙栧厜鏍囥€?
 */
.result-item[draggable='true']:active { cursor: grabbing; }
.result-item.dragging { opacity: .4; }
.video-wrap[draggable='true']:active { cursor: grabbing; }
.video-wrap.dragging { opacity: .4; }
/* 濯掍綋鍗曠嫭涓€灞傦細鍔犺浇澶辫触鍙浛鎹㈣繖涓€灞傦紝鎿嶄綔鏉′笌涓诲浘鏍囪蹇呴』鐣欑潃 */
.result-item .result-media { position: absolute; inset: 0; }
.result-item .result-media video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 瑙嗛涓婁紶鍗＄墖锛?8px 鐨勬柟鏍奸噷濉炲畬鏁存挱鏀炬帶浠朵細鎸ゆ垚涓€鍥紝
   鎵€浠ョ缉鐣ュ浘缁欐弧锛屾帶浠朵氦缁欑偣鍑诲悗鐨勫ぇ棰勮銆?*/
.result-item .media-thumb[data-kind='video'] { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-item:has(.media-thumb[data-kind='video']) { cursor: pointer; }
.result-item:has(.media-thumb[data-kind='video'])::after {
  content: '▶';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.7);
  pointer-events: none;
}
/* 闊抽娌℃湁鐢婚潰锛屽崰涓€涓柟褰㈢缉鐣ュ浘绾睘娴垂绌洪棿 鈥斺€?鏀规垚鏁磋鐨勬挱鏀炬潯 */
.result-item:has(.media-thumb[data-kind='audio']) {
  aspect-ratio: auto; cursor: default;
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
}
.result-item .media-thumb[data-kind='audio'] { width: 100%; height: 32px; }
.result-item:has(.media-thumb[data-kind='audio']) .idx { position: static; }
.result-item .rm {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); opacity: 0; transition: opacity .14s; cursor: pointer;
}
.result-item:hover .rm { opacity: 1; }
.result-item .rm:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.result-item .idx {
  position: absolute; left: 3px; bottom: 3px;
  padding: 1px 5px; border-radius: 5px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 9px; font-weight: 800;
}

/* ---------- 闈炲浘鐗囩粨鏋滐紙.pptx / .pdf / .zip 绛夛級---------- */
/* 杩欎簺鏂囦欢涓嶈兘褰撳浘鐗囨覆鏌擄紝鐢ㄥ浘鏍?+ 鏂囦欢鍚?+ 涓嬭浇鍏ュ彛琛ㄨ揪 */
.result-item.is-file {
  aspect-ratio: 4 / 3;
  cursor: default;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 8px;
}
.result-item .file-badge {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--strong); flex: none;
}
.result-item .file-badge svg { width: 17px; height: 17px; }
.result-item .file-badge:hover { background: var(--hover); border-color: var(--strong); }
.result-item .file-name {
  font-size: 9.5px; color: var(--muted); text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-height: 1.35; word-break: break-all;
}
/* 搴忓彿鍦ㄦ枃浠舵牸瀛愰噷鏀瑰埌鍙充笂瑙掞紝鍏嶅緱鍜屾枃浠跺悕鎶㈠簳閮?*/
.result-item.is-file .idx { left: auto; right: 3px; bottom: 3px; }

/* ---------- 缁撴灉缁勶細涓诲浘鏍囪涓庨€愰」鎿嶄綔 ---------- */
/* 涓诲浘锛氫笅娓革紙鍥剧敓鍥撅級涓庤繛绾跨缉鐣ュ浘鍙栫殑灏辨槸杩欎竴寮狅紝蹇呴』涓€鐪肩湅鍑烘槸鍝紶 */
.result-item.is-primary {
  border-color: var(--strong);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--strong) 35%, transparent);
}
.result-item .primary-badge {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--strong); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.result-item .primary-badge svg { width: 11px; height: 11px; }

/* 鎿嶄綔鏉″湪 hover 鏃舵诞鍑猴紝涓嶅崰甯冨眬銆佷篃涓嶉伄鎸＄缉鐣ュ浘 */
.result-item .result-actions {
  position: absolute; inset: auto 0 0 0;
  display: flex; gap: 2px; justify-content: center;
  padding: 3px 2px;
  background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
  opacity: 0; transition: opacity .14s;
}
.result-item:hover .result-actions,
.result-item:focus-within .result-actions { opacity: 1; }
.result-item .result-actions button {
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer; transition: background .12s;
}
.result-item .result-actions button:hover { background: #fff; }
.result-item .result-actions button svg { width: 11px; height: 11px; }
.result-item .result-actions button.off { opacity: .3; cursor: not-allowed; }
.result-item .result-actions button:last-child:hover {
  color: var(--danger); border-color: var(--danger); background: var(--danger-bg);
}
.video-wrap {
  width: 100%; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #000; margin-top: 8px;
}
.video-wrap video { width: 100%; display: block; max-height: 260px; }

/* ---------- 涓婁紶鍖?---------- */
.dropzone {
  width: 100%; padding: 16px 12px; border-radius: 12px;
  border: 1.5px dashed var(--line-2); background: var(--card-solid);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--faint); font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all .18s var(--ease); text-align: center;
}
.dropzone:hover, .dropzone.over { border-color: var(--strong); color: var(--strong); background: var(--soft); }
.dropzone svg { width: 22px; height: 22px; opacity: .6; }

/* ---------- 鎻愮ず璇嶅簱閫夋嫨鍣?---------- */
.picker-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,.42); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.picker-overlay.show { display: flex; }
.picker-modal {
  width: 100%; max-width: 720px; max-height: 82vh;
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 24px 64px rgba(0,0,0,.28);
  display: flex; flex-direction: column; overflow: hidden;
}
.picker-head { padding: 18px 22px 12px; display: flex; flex-direction: column; gap: 10px; }
.picker-head-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picker-head h3 { font-size: 16px; font-weight: 800; }
.picker-search {
  height: 38px; border: 1px solid var(--line-2); border-radius: var(--radius-input);
  background: var(--card-solid); color: var(--text); padding: 0 12px; font-size: 13px; outline: none;
}
.picker-search:focus { border-color: var(--strong); }
.picker-list { flex: 1; overflow-y: auto; padding: 0 22px 8px; display: flex; flex-direction: column; gap: 8px; }
.picker-item {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; transition: all .14s var(--ease);
}
.picker-item:hover { border-color: var(--strong); background: var(--soft); }
.picker-item .t { font-size: 12px; font-weight: 800; margin-bottom: 3px; }
.picker-item .b {
  font-size: 11px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.picker-item .src { font-size: 9px; color: var(--faint); font-weight: 700; margin-top: 5px; }
.picker-foot { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
/* 搴曢儴鐨勩€屽叡 N 鏉°€嶈繖绫荤粺璁℃枃瀛椼€備箣鍓嶅彧鏈?class 娌℃牱寮忥紝闈犲唴鑱旂‖鎾戯紝瀛楀彿姣旀鏂囪繕灏忎竴妗ｃ€?*/
.picker-foot .hint-text { font-size: 11px; font-weight: 600; color: var(--faint); }
.picker-empty { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 鍥剧墖鏌ョ湅鍣?---------- */
.viewer-overlay {
  position: fixed; inset: 0; z-index: 700;
  background: rgba(0,0,0,.88); display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 12px;
}
.viewer-overlay.show { display: flex; }
.viewer-overlay img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 8px; }
.viewer-bar { display: flex; gap: 8px; align-items: center; }
.viewer-bar .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.viewer-bar .btn:hover { background: rgba(255,255,255,.22); }
.viewer-cap { color: rgba(255,255,255,.7); font-size: 11px; font-weight: 700; }

/* ---------- 娓犻亾缂栬緫寮圭獥 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 620;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.show { display: flex; }
.modal {
  width: 100%; max-width: 620px; max-height: 86vh;
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 24px 64px rgba(0,0,0,.3);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { padding: 20px 24px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-head p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 0 24px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label { font-size: 10px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  height: 38px; border: 1px solid var(--line-2); border-radius: var(--radius-input);
  background: var(--card-solid); color: var(--text); padding: 0 12px; font-size: 13px; outline: none; width: 100%;
}
.field textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.55; font-family: inherit; }
.field input:not([type="checkbox"]):focus, .field select:focus, .field textarea:focus { border-color: var(--strong); }
.field .help { font-size: 10px; color: var(--faint); line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 妯″瀷鑳藉姏鏍囪 ---------- */
.caps { display: inline-flex; gap: 3px; }
.cap-tag {
  padding: 1px 6px; border-radius: 4px; font-size: 9px; font-weight: 800;
  background: var(--soft); color: var(--muted); border: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .04em;
}
.cap-tag.image { color: #2563eb; border-color: #bfdbfe; background: #eff6ff; }
.cap-tag.video { color: #7c3aed; border-color: #ddd6fe; background: #f5f3ff; }
.cap-tag.text  { color: #059669; border-color: #a7f3d0; background: #ecfdf5; }
.cap-tag.audio { color: #d97706; border-color: #fde68a; background: #fffbeb; }
.theme-dark .cap-tag.image { background: #172554; border-color: #1e3a8a; color: #93c5fd; }
.theme-dark .cap-tag.video { background: #2e1065; border-color: #4c1d95; color: #c4b5fd; }
.theme-dark .cap-tag.text  { background: #022c22; border-color: #065f46; color: #6ee7b7; }
.theme-dark .cap-tag.audio { background: #451a03; border-color: #78350f; color: #fcd34d; }

/* ---------- 閰嶇疆椤碉細鐘舵€佺伅 ---------- */
.status-line {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.status-line .led { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.status-line.online .led { background: var(--success); box-shadow: 0 0 0 3px rgba(5,150,105,.18); }
.status-line.offline .led { background: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

/* ---------- 鐢诲竷鍒楄〃琛屽唴閲嶅懡鍚?---------- */
.canvas-title-input {
  width: 100%; border: 1px solid var(--strong); border-radius: 8px;
  background: var(--card-solid); color: var(--text);
  font-size: 13px; font-weight: 750; padding: 5px 8px; outline: none;
}

/* ---------- 鑺傜偣涓嬫柟鐨勭敓鎴愰潰鏉?---------- */
/*
  瀹氫綅鐨勪笁涓叧閿紙鍙傝€?basketikun/infinite-canvas 鐨勫仛娉曪級锛?

  鈶?`top: 100%` + `left: 50%` 鈥斺€?閿氬湪鑺傜偣**姝ｄ笅鏂瑰眳涓?*銆?
  鈶?`scale(1/鐢诲竷缂╂斁)` 鈥斺€?闈㈡澘璺熺潃鑺傜偣璧帮紝浣?*灞忓箷涓婂ぇ灏忔亽瀹?*銆?
     涓嶈繖涔堝仛鐨勮瘽锛岀敾甯冩斁澶у埌 200% 鏃堕潰鏉夸篃璺熺潃鏀惧ぇ涓€鍊嶏紝
     鑰岀敤鎴锋槸鍦?100% 鐨勫睆骞曚笂鎿嶄綔瀹?鈥斺€?鎺т欢浼氬ぇ鍒板彉褰紱缂╁皬鍒?30% 鏃?
     闈㈡澘灏忓埌鐐逛笉涓€傜敤 fixed 瀹氫綅涔熻兘鎭掑畾锛屼絾閭ｆ牱姣忓抚閮借鎶婅妭鐐圭殑涓栫晫
     鍧愭爣鎹㈢畻鎴愯鍙ｅ潗鏍囷紝杩樺緱鑷繁澶勭悊杈圭紭缈昏浆锛涘弽鍚戠缉鏀捐繖浜涘叏鍏嶄簡銆?
  鈶?`transform-origin: top center` 鈥斺€?缂╂斁閿氬湪闈㈡澘**椤惰竟涓偣**銆?
     杩欐槸"璐村湪鑺傜偣涓嬫柟"鑳芥垚绔嬬殑鍓嶆彁锛氶敋鍦?center 鐨勮瘽锛岃妭鐐瑰線宸︽嫋锛?
     闈㈡澘浼氱浉瀵硅妭鐐瑰線鍙虫紓銆?

  鈿狅笍 浠ｄ环锛氳妭鐐硅创鐫€瑙嗗彛杈圭紭鏃堕潰鏉夸細婧㈠嚭瑙嗗彛銆俵eft 鐢?max/min 澶逛竴娆★紝
  浣嗛偅鍙В鍐虫按骞虫柟鍚戯紱鍨傜洿鏂瑰悜浜ょ粰鐢诲竷鑷韩鐨勬粴鍔紙闈㈡澘鐭紝涓嶅€煎緱鍐嶇畻锛夈€?
*/
.node-panel {
  position: absolute; top: 100%; left: 50%;
  /* 瀹藉害鐢?renderer 鎸夈€屽崱鐗囧 脳 1.5銆嶅啓杩涙潵锛堣 node-panel.js panelWidth锛夈€?
     杩欐潯 width 鍙槸鍏滃簳锛孞S 涓€瀹氬厛鍐欍€?*/
  width: 520px; margin-top: 10px;
  transform-origin: top center;
  transform: translateX(-50%) scale(var(--panel-scale, 1));
  z-index: 40;
  /* 闈㈡澘姣斿崱鐗囧锛岃妭鐐圭獎鐨勬椂鍊欎袱渚т細闇插嚭鏉?鈥斺€?涓嶈 */
  pointer-events: auto;
}
.node-panel[hidden] { display: none; }
/*
  鏁村潡闈㈡澘鐨勮鎰熺収鍙傝€冩渚嬶細
    鈹屸攢鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹?
    鈹?[鉁砞[+]                      [鉀禲     鈹? 椤舵帓锛氬甫搴曡壊鐨勬柟鍧楋紝涓嶆槸閫忔槑灏忓浘鏍?
    鈹? 鎻忚堪浠讳綍浣犳兂瑕佺敓鎴愮殑鍐呭             鈹? 杈撳叆鍖猴細鎾戞弧锛屽崰鎹潰鏉跨殑澶у崐楂樺害
    鈹?[鉁?GPT Image鈥︹寗][涓瓑(鎺ㄨ崘)路鑷姩鈱刔  鈻?[鈫慮 鈹? 搴曟帓锛氫袱棰?*澶?*鑳跺泭 + 鎴愭湰 + 鍦嗗舰鍙戦€?
    鈹斺攢鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹?
  涔嬪墠閭ｄ竴鐗堢殑闂鏄簳鎺掑張灏忓張鎸わ細鑳跺泭 11px 瀛楀彿銆?px 鍐呰竟璺濄€佸渾瑙掓媺婊★紝
  涓や釜鍔犺捣鏉ヨ繕涓嶅埌闈㈡澘瀹藉害鐨勫洓鍒嗕箣涓€锛屽彸杈圭┖鍑轰竴澶х墖 鈥斺€?
  瑙嗚涓婂儚鏄€屾帶浠舵帀鍒颁簡杈逛笂銆嶏紝鑰屽弬鑰冩渚嬮噷瀹冧滑鏄繖涓€琛岀殑涓昏銆?
*/
.node-panel-inner {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px 15px;
  box-shadow: 0 18px 48px var(--shadow);
  display: flex; flex-direction: column; gap: 13px;
}
/* 闈㈡澘閲岀殑杈撳叆妗嗕笉鑳借Е鍙戠敾甯冪殑妗嗛€?/ 鎷栨嫿 */
.node-panel textarea, .node-panel select, .node-panel input {
  pointer-events: auto;
}

/* ---- 椤舵帓锛歔鉁╙ [锛媇 路路路路路 [鉀禲 */
.np-top { display: flex; align-items: center; gap: 6px; }
.np-spacer { flex: 1; }
.np-audio-mode {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--soft);
}
.np-audio-mode-btn {
  height: 26px; padding: 0 10px; border: none; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; color: var(--muted); font-size: 11px; font-weight: 700;
  cursor: pointer; transition: background .12s var(--ease), color .12s;
}
.np-audio-mode-btn svg { width: 12px; height: 12px; }
.np-audio-mode-btn:hover { color: var(--text); }
.np-audio-mode-btn.active { background: var(--strong); color: var(--strong-text); }
/*
  椤舵帓鎸夐挳瑕佹湁**鑷繁鐨勫簳**锛屼笉鏄€忔槑鐨勫皬鍥炬爣銆?
  鍙傝€冩渚嬮噷瀹冧滑鏄袱鍧楁繁鑹叉柟鍧?鈥斺€?鍥犱负杩欎竴鎺掍笉鏄楗帮紝
  銆岀敓鎴愭ā寮?/ 鍔犲弬鑰?/ 灞曞紑銆嶆槸涓変釜鑳界偣鐨勬搷浣滐紝
  閫忔槑鍥炬爣鍦ㄨ繖涓昂瀵镐笅浼氳褰撴垚瑁呴グ鑰屼笉鏄寜閽€?
*/
.np-icon-btn {
  width: 30px; height: 30px; padding: 0; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); border: 1px solid var(--line);
  color: var(--muted); cursor: pointer; flex: none;
  transition: background .14s var(--ease), color .14s, border-color .14s;
}
.np-icon-btn svg { width: 15px; height: 15px; }
.np-icon-btn:hover { color: var(--text); border-color: var(--strong); }

/* ---- 銆屼粠鐢诲竷閫夊弬鑰冦€嶇殑鐘舵€?*/
.np-icon-btn.active {
  background: var(--strong); border-color: var(--strong); color: var(--strong-text);
}
.np-pick-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: 10px;
  background: var(--soft); border: 1px dashed var(--line);
  color: var(--text); font-size: 12.5px; font-weight: 650;
}
.np-pick-text { flex: 1; min-width: 0; }
.np-pick-x {
  flex: none; width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--muted); cursor: pointer;
}
.np-pick-x:hover { background: var(--soft-2, var(--soft)); color: var(--text); }
.np-pick-x svg { width: 13px; height: 13px; }

/*
  鍊欓€夊崱鐗囬珮浜€?
  鐢?outline 鑰屼笉鏄?box-shadow锛歜ox-shadow 浼氳 .node 鐨勮竟妗嗗渾瑙掑悆鎺変竴灞傦紝
  鑰?outline 鐢诲湪鐩掑瓙涔嬪锛屼笉浼氳鍗＄墖鑷繁鐨勫簳鑹插帇浣忋€?
*/
.node.pickable, .node.quote-pickable {
  outline: 2px solid var(--strong);
  outline-offset: 3px;
  cursor: copy;
}
.node.picking-ref { cursor: default; }

/* ---- 鎻愮ず璇嶏細鎾戞弧锛屾棤杈规锛堟暣涓潰鏉垮氨鏄緭鍏ュ尯锛?*/
/*
  鈿狅笍 `.np-text` 鍜?`.np-hl` 鐨?*姣忎竴椤圭洅妯″瀷/鎺掔増灞炴€ч兘蹇呴』涓€鑷?*锛?
  瀛椾綋銆佸瓧鍙枫€佽楂樸€佸唴杈硅窛銆佹崲琛岃鍒欍€佽竟妗嗐€?
  涓ゅ眰闈犲儚绱犲榻愶紝鎵€浠ュ樊 1px 鐨?letter-spacing 灏变細璁╄姱鐗囧簳鑹茬洊鍦ㄩ敊鐨勫瓧涓娿€?
  鍐欐垚鍚屼竴缁勫彉閲忥紝閬垮厤浠ュ悗鍙敼涓€澶勩€?
*/
.np-prompt { position: relative; }
.np-prompt .np-text,
.np-prompt .np-hl,
.np-prompt .np-ph {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0;
  padding: 2px;
  border: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  margin: 0;
}
.np-text {
  position: relative; z-index: 1;
  display: block; width: 100%; min-height: 120px; max-height: 320px;
  overflow-y: auto; resize: none; outline: none;
  background: transparent;
  /* 鏂囧瓧**閫忔槑**锛氶鑹茬敱涓婇潰閭ｅ眰闀滃儚鎻愪緵锛岃姱鐗囨墠鑳界敾鍦ㄥ瓧搴曚笅銆?
     鍏夋爣鑹插繀椤绘樉寮忕粰鍥炴潵锛屽惁鍒欒緭鍏ユ椂鐪嬩笉瑙佽嚜宸辨墦鍦ㄥ摢銆?*/
  color: transparent;
  caret-color: var(--text);
}
/* 鍘熺敓 placeholder 蹇呴』褰诲簳鍏虫帀锛氭垜浠嚜宸辩敤 .np-ph 鐢伙紙涓轰簡鍜岄暅鍍忛€愬儚绱犲榻愶級銆?
   鍙瀹冭繕鏈夐鑹诧紝杈撳叆鍐呭鍚庡氨浼氬拰姝ｆ枃鍙犲湪涓€璧?鈥斺€?鐢ㄦ埛鐪嬪埌涓ゅ眰瀛椼€?*/
.np-text::placeholder { color: transparent; }
.np-text::selection { background: color-mix(in srgb, var(--strong) 28%, transparent); }
/* 闀滃儚灞傦細鍙敾锛屼笉鍙氦浜掞紱鑺墖鑷繁闄ゅ */
.np-hl {
  position: absolute; inset: 0; z-index: 2;
  overflow: hidden; pointer-events: none;
  color: var(--text);
}
/* 鍘熺敓 placeholder 鍦?color:transparent 鐨?textarea 涓婁緷鐒舵寜鑷繁鐨勯鑹叉樉绀猴紝
   浣嗙┖鎬侀暅鍍忛噷娌℃湁浠讳綍瀛楋紝鎵€浠ュ啀鍔犱竴灞傜粰銆岃仛鐒﹀墠銆嶄竴涓竴鑷寸殑鐏般€?*/
.np-ph {
  position: absolute; inset: 0; z-index: 0;
  color: var(--faint); pointer-events: none;
}
.np-text:focus + .np-hl + .np-ph,
.np-text:not(:placeholder-shown) + .np-hl + .np-ph { opacity: 0; }

/* 鎻愮ず璇嶉噷鐨?@ 寮曠敤鑺墖 */
.np-ref-chip {
  pointer-events: auto;
  display: inline;
  padding: 1px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--success) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 45%, transparent);
  color: var(--success);
  font-weight: 650;
  cursor: zoom-in;
  transition: transform .14s var(--ease), background .14s var(--ease);
}
.np-ref-chip:hover { transform: scale(1.12); background: color-mix(in srgb, var(--success) 26%, transparent); }

/* ---- 銆岋紜銆嶄笂浼犲弬鑰冨浘锛氭湰鍦颁笂浼?/ 璧勪骇搴?*/
.np-add-wrap { position: relative; flex: none; }
.np-add-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 8;
  display: none; flex-direction: column; min-width: 160px;
  padding: 5px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 14px 38px var(--shadow);
}
.np-add-menu.open { display: flex; }
.np-add-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text);
  font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
  white-space: nowrap;
}
.np-add-item:hover { background: var(--soft); }
.np-add-ic { display: inline-flex; width: 16px; justify-content: center; color: var(--muted); }
.np-add-ic svg { width: 14px; height: 14px; }

/* 璧勪骇搴撻€夋嫨寮瑰眰 */
.np-asset-overlay {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .42); backdrop-filter: blur(2px);
}
.np-asset-modal {
  width: min(720px, 92vw); max-height: min(560px, 84vh);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 28px 80px var(--shadow);
  overflow: hidden;
}
.np-asset-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.np-asset-title { flex: 1; font-size: 13px; font-weight: 750; }
.np-asset-x {
  width: 26px; height: 26px; border-radius: 7px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
}
.np-asset-x:hover { background: var(--soft); color: var(--text); }
.np-asset-x svg { width: 14px; height: 14px; }
.np-asset-body { flex: 1; min-height: 0; overflow-y: auto; }
/*
  鐎戝竷娴侊細澶氬垪 + 姣忓紶鍥炬寜鑷韩姣斾緥鍏ㄦ樉锛堜笉瑁佸垏鎴愭鏂瑰舰锛夈€?
  涔嬪墠鐢?grid + `img { aspect-ratio: 1; object-fit: cover }`锛?
  鍦ㄥ脊灞傝繖绉嶉珮搴﹀彈闄愮殑瀹瑰櫒閲岃鍘嬫垚浜嗘í鏉?鈥斺€?鐢ㄦ埛鐪嬪埌鐨勬槸
  銆屽浘鍏ㄦ姌鍙犺捣鏉ャ€佺偣涓嶅埌銆嶏紝鑰岃繖姝ｆ槸涓嶈瑁佸垏鐨勭礌鏉愬簱銆?
*/
.np-asset-grid {
  columns: 4 150px;
  column-gap: 10px;
  padding: 14px;
}
.np-asset-cell {
  display: block; width: 100%; margin: 0 0 10px;
  break-inside: avoid; page-break-inside: avoid;
  padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--soft); color: var(--text); cursor: pointer;
}
.np-asset-cell:hover { border-color: var(--strong); }
.np-asset-cell img { width: 100%; height: auto; display: block; }
.np-asset-name {
  display: block; padding: 5px 7px 7px; font-size: 10.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.np-asset-empty {
  padding: 40px 10px; text-align: center;
  color: var(--muted); font-size: 12px;
  break-inside: avoid;
}

/* ---- 鍙傝€冪缉鐣ュ浘鏉★紙鍦ㄩ潰鏉块《鎺掗噷锛屼笉鍦ㄥ崱鐗囬噷锛?*/
/*
  鈿狅笍 杩欓噷**涓嶈兘**鍐?overflow: hidden锛堝師鍥炬埅鍥炬爣鐨勫氨鏄€屾偓鍋滄病鏀惧ぇ銆嶏級銆?
  缂╃暐鍥鹃潬 `transform: scale()` 鏀惧ぇ锛岃€?overflow:hidden 浼氭妸鏀惧ぇ鐨勯儴鍒?
  **瑁佹帀** 鈥斺€?浜庢槸鏀惧ぇ杩欐潯 CSS 涓€鐩寸敓鏁堛€佺敤鎴峰嵈瀹屽叏鐪嬩笉鍒版晥鏋溿€?
  杩欑被銆屼唬鐮佹病閿欍€佺幇璞℃濂界浉鍙嶃€嶇殑鍧戯紝鍙湁鐪熺殑鎮仠涓€娆℃墠浼氬彂鐜般€?
  鐢?flex-wrap 浠ｆ浛瑁佸壀锛氱缉鐣ュ浘澶氫簡鎹㈣锛岃€屼笉鏄鍒囨帀銆?
*/
.np-refs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.np-ref {
  position: relative; flex: none;
  width: 34px; height: 34px; padding: 0;
  border-radius: 8px; overflow: visible; cursor: pointer;
  border: 1px solid var(--line); background: var(--soft);
  transition: transform .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.np-ref img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; display: block; }
.np-ref:hover {
  transform: scale(1.22);
  border-color: var(--strong);
  box-shadow: 0 6px 20px var(--shadow);
  z-index: 3;
}
.np-ref.empty { background: var(--soft-2, var(--soft)); }
.np-ref-i {
  position: absolute; right: -3px; bottom: -3px;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 999px; background: var(--strong); color: var(--strong-text);
  font-size: 9px; font-weight: 800; line-height: 14px; text-align: center;
  pointer-events: none;
}

/* ---- 鎵?@ 鏃剁殑鍊欓€夛紙鎵规敞鈶★級 */
.np-ac {
  position: absolute; left: 0; top: 100%; z-index: 6;
  margin-top: 4px; display: none;
}
.np-ac.open { display: block; }
.np-ac-list {
  min-width: 100%; max-width: 340px; max-height: 230px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px;
  box-shadow: 0 14px 38px var(--shadow);
}
.np-ac-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 7px; border-radius: 7px; cursor: pointer;
  color: var(--text);
}
.np-ac-row:hover, .np-ac-row.on { background: var(--soft); }
.np-ac-img { width: 26px; height: 26px; border-radius: 5px; object-fit: cover; flex: none; }
.np-ac-ic { display: inline-flex; width: 26px; justify-content: center; color: var(--muted); flex: none; }
.np-ac-ic svg { width: 14px; height: 14px; }
.np-ac-name { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-ac-tag { flex: none; font-size: 9.5px; color: var(--strong); font-weight: 800; }

/* ---- 鎮仠 @ 鑺墖鏃剁殑澶ч瑙堬紙鎵规敞鈶?/ 鍙傝€冨浘 5锛?*/
.np-chip-preview {
  position: fixed; z-index: 60; display: none;
  flex-direction: column; gap: 4px; max-width: 280px;
  padding: 6px; border-radius: 10px;
  background: var(--card-solid); border: 1px solid var(--line);
  box-shadow: 0 16px 44px var(--shadow);
  pointer-events: none;
}
.np-chip-preview.on { display: flex; }
.np-chip-preview img { width: 100%; max-height: 220px; object-fit: contain; border-radius: 6px; display: block; }
.np-chip-preview-cap {
  font-size: 10.5px; color: var(--muted); font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/*
  搴曟帓锛?*涓嶈鍒嗗壊绾?*锛堢敤鎴锋壒娉ㄢ憽锛夈€?
  涔嬪墠閭ｆ潯 `border-top` 鏄寜銆岃〃鍗曞垎缁勩€嶇殑鎬濊矾鍔犵殑 鈥斺€?
  鎶婅緭鍏ュ尯鍜屽弬鏁板尯鍒嗘垚涓ゅ潡銆備絾鍙傝€冩渚嬮噷鏁翠釜闈㈡澘鏄竴涓緭鍏ュ尯锛?
  鍙傛暟鏄畠鐨?*闄勫睘**锛屼竴鏉℃í绾垮弽鑰屾妸銆屼竴涓笢瑗裤€嶅垏鎴愪簡銆屼袱涓笢瑗裤€嶏紱
  鑰岄潰鏉垮搴︽湰鏉ュ氨鍙湁 420px锛屾í绾夸竴鐢伙紝鍓╀笅鐨勮灏辨樉寰楁洿鎸ゃ€?
  闈犻棿璺濆垎缁勫氨澶熶簡锛坓ap: 12px锛夈€?
*/
.np-foot {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
/* 鍙崇粍锛堟垚鏈?+ 鍙戦€侊級锛氬敮涓€鐨?`margin-left:auto`锛岃 node-panel.js 閲岀殑璇存槑 */
.np-foot-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }

/*
  鑳跺泭瑙﹀彂鍣ㄣ€傚弬鑰冩渚嬮噷鏄?*鍦嗚鐭╁舰**鑰屼笉鏄嵂涓革紝涓旀槑鏄炬洿澶?鈥斺€?
  鑽父褰㈢姸鍦ㄤ袱涓苟鎺掓椂璇昏捣鏉ュ儚銆屼袱棰楃硸銆嶏紝鑰屼笉鏄袱涓帶浠躲€?
*/

/*
  鈿狅笍 涓婇檺蹇呴』鍐欏湪 **wrap** 涓婏紝涓嶈兘鍐欏湪 chip 涓娿€?
  `.np-chip { max-width: 46% }` 鐨勭櫨鍒嗘瘮鏄浉瀵?wrap 鐨勫搴︼紝
  鑰?wrap 鐨勫搴﹀張鏄敱 chip 鐨勫唴瀹规拺鍑烘潵鐨?鈥斺€?浜掔浉渚濊禆锛屾祻瑙堝櫒鍙兘瑙ｆ瀽鎴?
  銆屼笉纭畾銆嶅啀閫€鍖栥€傜粨鏋滃疄娴嬶細wrap 89px 鑰?chip 鍙湁 40px锛?
  澶氬嚭鏉ョ殑 49px 鍏ㄦ槸绌虹櫧锛屼簬鏄袱涓兌鍥婁箣闂磋杩欐潯绌虹櫧鎾戝紑 57px 鈥斺€?
  姝ｆ槸鐢ㄦ埛鎴浘閲屻€屽簳鎺掔┖涓€澶х墖銆嶇殑鏍峰瓙銆?
  wrap 涓婄殑鐧惧垎姣斿垯鐩稿 `.np-foot` 鐨勫唴瀹圭洅锛屾槸纭畾鐨勩€?
*/
.np-pop-wrap {
  position: relative; display: flex;
  flex: 0 1 auto; min-width: 0; max-width: 44%;
}
.np-chip {
  display: inline-flex; align-items: center; gap: 7px;
  min-width: 0; max-width: 100%;
  padding: 7px 11px; border-radius: 10px;
  background: var(--soft); border: 1px solid var(--line);
  color: var(--text); font-size: 12.5px; font-weight: 650;
  font-family: inherit; cursor: pointer; text-align: left;
  transition: background .14s var(--ease), color .14s, border-color .14s;
}
.np-chip:hover, .np-pop-wrap.open .np-chip { border-color: var(--strong); background: var(--soft-2, var(--soft)); }
/* 妯″瀷鑳跺泭宸︿晶閭ｄ釜灏忓浘鏍囷紙sparkles锛夛紝鍙傝€冩渚嬮噷涔熸湁 */
.np-chip-glyph { display: inline-flex; flex: none; opacity: .75; }
.np-chip-glyph svg { width: 13px; height: 13px; }
.np-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-caret { display: inline-flex; flex: none; opacity: .7; }
.np-caret svg { width: 13px; height: 13px; transition: transform .15s var(--ease); }

/* 鍚戜笂寮圭殑娴眰銆俠ottom:100% 鑰屼笉鏄?top:100% 鈥斺€?闈㈡澘鏈韩宸茬粡鍦ㄥ崱鐗囦笅鏂癸紝
   鍐嶅線涓嬪脊浼氭帀鍑鸿鍙ｏ紝鑰屽弬鑰冩渚嬬殑鍙傛暟/妯″瀷娴眰閮芥槸鏈濆崱鐗囨柟鍚戝脊鐨勩€?*/
.np-pop {
  position: absolute; bottom: calc(100% + 8px); left: 0;
  min-width: 100%; width: max-content; max-width: 420px;
  max-height: 46vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px;
  box-shadow: 0 14px 38px var(--shadow);
  display: none; z-index: 3;
}
/*
  ⚠️ `wide` **必须给死宽度**。

  基础规则是 `width: max-content`，而参数浮层里装的是 grid 等分列 ——
  max-content 会按「最短能排下」算，于是整块面板收缩到 min-width: 300px，
  比例格子被压到 30 多像素，字号和间距全部失去设计稿的比例。
  这里写死 460px：去掉 14px 内边距后内容 432px，7 个比例格子约 58px，
  与设计稿（60px 格 / 61px 高）一致。

  `--param-pop-scale`：整块面板的**等比缩放**。
  它只是生成卡里的一个功能面板，按 100% 摆在 520px 宽的节点面板里会显得喧宾夺主，
  所以统一缩到 0.82 —— 相当于把设计稿那张图整体缩小，比例一分不动。
  想再小/再大只改这一个数，不用逐个调字号和间距。
  `max-height` 按缩放后的视觉高度折算（76vh × 0.82 ≈ 62vh）。
*/
.np-pop.wide {
  width: 460px; min-width: 460px; max-width: min(460px, calc(100vw - 24px));
  max-height: min(76vh, 780px);
  padding: 14px;
  border-radius: 14px;
  transform: scale(var(--param-pop-scale, .82));
  transform-origin: bottom left;
}
.np-pop.open { display: block; }

/*
  鍙傛暟娴眰閲岀殑**鍒嗙粍**锛氬皬鏍囬 + 涓€鎺掓。浣嶃€?
  鍒绘剰涓嶇粰姣忕粍鍔犺竟妗嗘垨搴曡壊 鈥斺€?娴眰宸茬粡鏈夎嚜宸辩殑杈规锛屽啀濂椾竴灞傛浼氬彉鎴?
  銆屾閲岀殑妗嗐€嶏紝鍙傝€冩渚嬪浘 7 灏辨槸绾潬灏忔爣棰樺拰鐣欑櫧鍒嗙粍鐨勩€?
*/
.field-groups { display: flex; flex-direction: column; gap: 20px; }
.field-group { display: flex; flex-direction: column; gap: 9px; }
.field-group-cap {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 650; color: var(--muted);
  letter-spacing: .02em;
}
/* 标题前的细线图标，和设计稿一致：14px、低对比、不抢控件的注意力 */
.field-ic { display: inline-flex; flex: none; opacity: .72; }
.field-ic svg { width: 14px; height: 14px; }
/* chip 琛屽湪娴眰閲屽厑璁告崲琛岋細妗ｄ綅澶氱殑缁勶紙姣斾緥 9 椤广€佹竻鏅板害 5 椤癸級涓€琛屾斁涓嶄笅 */
.field-groups .chip-row, .field-groups .seg-row { flex-wrap: wrap; }

/* 妯″瀷鍒楄〃锛氭瘡琛?妯″瀷鍚?+ 娓犻亾锛屽彸渚у崟浠?*/
.np-model-list { display: flex; flex-direction: column; gap: 1px; }
.np-model-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline; column-gap: 10px;
  padding: 7px 9px; border-radius: 9px; cursor: pointer;
  color: var(--text); transition: background .12s var(--ease);
}
.np-model-row:hover { background: var(--soft); }
.np-model-row.active { background: var(--soft); box-shadow: inset 0 0 0 1px var(--strong); }
.np-model-name { font-size: 12.5px; font-weight: 750; }
.np-model-sub {
  grid-column: 1; font-size: 10.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.np-model-price {
  grid-row: 1 / span 2; grid-column: 2; align-self: center;
  font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.np-empty { padding: 8px; font-size: 11.5px; color: var(--muted); }

/* 妯″瀷鍒嗙粍锛氭湰鍦?ComfyUI 濮嬬粓鍦ㄤ笂锛孉PI 鍦ㄤ笅 */
.np-model-picker { display: flex; flex-direction: column; min-width: 340px; }
.np-model-search {
  position: sticky; top: -8px; z-index: 3;
  height: 30px; margin-bottom: 5px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--text);
  font: inherit; font-size: 11.5px; outline: none;
}
.np-model-search:focus { border-color: var(--strong); }
.np-model-group {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 9px 4px;
  font-size: 10px; color: var(--muted);
}
.np-model-group:not(:first-of-type) {
  margin-top: 4px; border-top: 1px solid var(--line);
}
.np-model-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.np-model-dot.is-comfyui { background: #34d399; box-shadow: 0 0 0 3px rgb(52 211 153 / .12); }
.np-model-dot.is-api { background: #60a5fa; box-shadow: 0 0 0 3px rgb(96 165 250 / .12); }
.np-model-group-note { margin-left: auto; font-weight: 600; color: var(--faint); }
.np-model-row.is-comfyui { box-shadow: inset 2px 0 0 rgb(52 211 153 / .45); }
.np-model-row.is-api { box-shadow: inset 2px 0 0 rgb(96 165 250 / .35); }
.np-model-name { display: flex; align-items: center; gap: 5px; min-width: 0; }
.np-model-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-model-src {
  flex: none; padding: 0 4px; border-radius: 4px;
  font-size: 8px; font-weight: 800; line-height: 14px;
  border: 1px solid transparent;
}
.np-model-src.is-comfyui {
  color: #6ee7b7; border-color: rgb(52 211 153 / .3); background: rgb(52 211 153 / .1);
}
.np-model-src.is-api {
  color: #93c5fd; border-color: rgb(96 165 250 / .3); background: rgb(96 165 250 / .1);
}
.np-model-more {
  margin: 7px 4px 2px; padding: 7px 9px;
  border: 1px dashed var(--line-2); border-radius: 9px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.np-model-more:hover { color: var(--text); border-color: var(--strong); background: var(--soft); }
.np-model-more:disabled { opacity: .55; cursor: default; }
.np-model-more-hint { padding: 7px 9px 2px; font-size: 10.5px; color: var(--faint); }

/* 鎴愭湰 */
.np-cost {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
  flex: none;
}
.np-cost svg { width: 13px; height: 13px; }

/*
  鍙戦€侊細鍦嗗舰瀹炲績銆?
  `margin-left: auto` 鐜板湪鍙瓨鍦ㄤ簬 `.np-foot-right` 涓€澶?鈥斺€?
  涔嬪墠鎴愭湰鍜屽彂閫侀敭鍚勮嚜鎸備簡涓€涓紝鑰?flex 閲屼竴涓鍣ㄥ彧鑳芥湁涓€涓?auto 鍚冩帀鍓╀綑绌洪棿锛?
  浜庢槸涓や釜骞冲垎锛岃兌鍥婅鎸ゅ埌鏈€宸︺€佷腑闂寸┖鍑轰竴澶х墖銆?
*/
.np-send {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--strong); border: none; color: var(--strong-text);
  cursor: pointer;
  transition: opacity .14s var(--ease), transform .14s var(--ease);
}
.np-send svg { width: 17px; height: 17px; }
.np-send:hover:not(:disabled) { transform: scale(1.06); }
.np-send:disabled { opacity: .35; cursor: default; }

/* 闈㈡澘瑙﹀彂鎸夐挳锛堚殹锛夛細璐村湪鍗＄墖鍙充笂瑙掞紝鐐瑰紑/鏀惰捣涓嬫柟闈㈡澘 */
.node-gen-btn {
  position: absolute; right: 6px; top: 6px; z-index: 6;
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-solid); border: 1px solid var(--line);
  color: var(--muted); cursor: pointer;
  opacity: 0; transition: opacity .15s var(--ease), color .15s;
}
.node-gen-btn svg { width: 14px; height: 14px; }
/* 鍙湪 hover / 閫変腑 / 闈㈡澘鎵撳紑鏃堕湶鍑烘潵 鈥斺€?甯搁┗浼氬湪姣忓紶鍗＄墖鍙充笂瑙掑涓€涓櫔鐐?*/
.node:hover .node-gen-btn,
.node.selected .node-gen-btn,
.node-gen-btn.active { opacity: 1; }
.node-gen-btn:hover { color: var(--text); }
.node-gen-btn.active { color: var(--strong); border-color: var(--strong); }
.node-gen-btn[hidden] { display: none; }

/* ---------- 鐢熸垚璁板綍鎶藉眽 ---------- */
.jobs-drawer {
  position: absolute; right: 16px; top: 70px; width: 340px; max-height: calc(100vh - 160px);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: 0 16px 44px var(--shadow); backdrop-filter: blur(16px);
  z-index: 26; display: none; flex-direction: column; overflow: hidden;
}
/* flex 瀛愰」榛樿 min-width:auto锛屽唴瀹硅繃瀹芥椂浼氭妸鐖跺鍣ㄦ拺寮€鑰屼笉鏄嚜宸辨粴鍔ㄣ€?
   璧勪骇搴撶殑缃戞牸灏辨槸杩欎箞琚《鍑哄彲瑙嗗尯鐨勩€?*/
.jobs-drawer > * { min-width: 0; }
.jobs-drawer.open { display: flex; }

/*
  鐢诲竷鍔╂墜鎮诞鐞冿紙鍙充笅瑙掞級銆?

  涓轰粈涔堟槸 fixed锛氬畠瑕佷竴鐩村湪锛屼笉璇ヨ窡鐫€鐢诲竷骞崇Щ鎴栫缉鏀?鈥斺€?
  鐢ㄦ埛婊氬埌鐢诲竷鍙︿竴澶翠篃鎯宠兘鐩存帴鎼彞璇濄€?

  浣嶇疆閬垮紑浜嗕袱鏍凤細鍙充笅瑙掔姸鎬佹爮锛?statusbar锛岄珮绾?30px锛屾墍浠?bottom 缁?46锛?
  鍜屽彸渚ф娊灞夛紙drawer 瀹?420px + right 16px 鈮?436px锛屾墍浠ョ悆鍥哄畾鍦?24px 涓嶄細杩涙娊灞夊尯锛夈€?
  鎶藉眽鎵撳紑鏃舵暣浣撹棌璧锋潵锛岃鍒欏湪涓嬮潰銆?
*/
.agent-fab {
  position: fixed; right: 24px; bottom: 46px; z-index: 27;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-solid); border: 1px solid var(--line); color: var(--muted);
  box-shadow: 0 8px 24px var(--shadow);
  cursor: pointer; transition: color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.agent-fab:hover { color: var(--text); background: var(--soft-2); transform: translateY(-1px); }
.agent-fab svg { width: 20px; height: 20px; }
/* 閿洏鍙揪锛歍ab 杩囨潵鏃惰鏈夊彲瑙佺劍鐐瑰湀锛屽惁鍒欓敭鐩樼敤鎴蜂笉鐭ラ亾鍋滃湪鍝?*/
.agent-fab:focus-visible { outline: 2px solid var(--strong); outline-offset: 2px; }

/*
  鎶藉眽寮€鐫€灏辫棌鐞冦€?
  鐢?:has() 鐩潃鎶藉眽鑷繁鐨?class锛岃€屼笉鏄潬 JS 浜嬩欢鍚屾 鈥斺€?
  鎶藉眽鐨勫叧闂叆鍙ｆ湁濂藉嚑澶勶紝閮芥槸鐩存帴 classList.remove('open')锛?
  娌℃湁涓€涓粺涓€鐨?close 浜嬩欢锛屼簨浠跺悓姝ュ繀鐒舵紡涓€澶勶紝
  婕忎簡鐞冨氨鍘嬪湪鎶藉眽杈逛笂锛氭尅鍐呭锛岃€屼笖鐐瑰畠绛変簬銆屽叧鎺夊垰鎵撳紑鐨勬娊灞夈€嶃€?
*/
body:has(#agentDrawer.open) .agent-fab { display: none; }

#agentDrawer {
  top: 90px; right: 20px; bottom: 16px;
  width: min(520px, calc(100vw - 40px));
  height: auto; max-height: none;
  display: flex;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(22px) scale(.992);
  transform-origin: 100% 18%;
  box-shadow: 0 28px 90px rgba(0,0,0,.46);
  transition:
    opacity .26s cubic-bezier(.22,.61,.36,1),
    transform .38s cubic-bezier(.2,.86,.28,1),
    visibility 0s linear .38s;
  will-change: opacity, transform;
}
#agentDrawer.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: none;
  transition:
    opacity .26s cubic-bezier(.22,.61,.36,1),
    transform .38s cubic-bezier(.2,.86,.28,1),
    visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  #agentDrawer, #agentDrawer.open { transition-duration: .01ms; transform: none; }
}

.agent-drawer-head { padding: 15px 18px 12px; align-items: flex-start; }
.agent-head-main { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.agent-head-icon {
  width: 34px; height: 34px; min-width: 34px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--strong); background: var(--soft-2); border: 1px solid var(--line);
}
.agent-head-icon svg { width: 17px; height: 17px; }
.agent-head-copy { min-width: 0; }
.agent-head-title-row { display: flex; align-items: center; gap: 7px; }
.agent-head-sub { margin-top: 3px; padding: 0; font-size: 10.5px; line-height: 1.5; }
.agent-head-actions { display: flex; gap: 4px; flex: none; }
.agent-pill {
  max-width: 180px; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--soft);
  color: var(--muted); font-size: 9.5px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#agentDrawer .agent-chat {
  flex: 1; min-height: 120px; max-height: none;
  margin: 0; padding: 6px 18px 10px;
  border: 0; border-radius: 0; background: transparent;
}
#agentDrawer .agent-note-box { padding: 0 18px 6px; }
#agentDrawer .agent-note-box:empty { display: none; }
#agentDrawer .agent-drawer-body {
  flex: none; max-height: 62%; overflow-y: auto;
  padding: 10px 18px 16px; gap: 7px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, var(--soft) 120%);
}

.agent-capabilities {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--soft); overflow: hidden;
}
.agent-cap-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; cursor: pointer; list-style: none;
  font-size: 11px; font-weight: 800; color: var(--text); user-select: none;
}
.agent-cap-summary::-webkit-details-marker { display: none; }
.agent-cap-summary > span:first-child { display: flex; align-items: center; gap: 6px; }
.agent-cap-summary svg { width: 13px; height: 13px; color: var(--strong); }
.agent-cap-summary-hint { color: var(--faint); font-size: 9.5px; font-weight: 600; }
.agent-cap-body {
  display: flex; flex-direction: column; gap: 9px;
  max-height: 220px; overflow-y: auto;
  padding: 0 10px 10px;
}
.agent-cap-block { display: flex; flex-direction: column; gap: 5px; }
.agent-cap-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--faint);
}
.agent-cap-head > span:last-child { font-weight: 600; letter-spacing: 0; text-transform: none; }
.agent-skill-grid, .agent-app-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
}
.agent-skill, .agent-app {
  min-width: 0; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card-solid); color: var(--muted);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.agent-skill { padding: 7px 8px; display: flex; flex-direction: column; gap: 2px; }
.agent-skill-top { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; color: var(--text); }
.agent-skill-top svg { width: 12px; height: 12px; }
.agent-skill-state {
  margin-left: auto; font-size: 8.5px; font-weight: 800;
  color: var(--faint); text-transform: uppercase;
}
.agent-skill-hint { font-size: 9px; line-height: 1.4; color: var(--muted); }
.agent-skill:hover, .agent-app:hover { border-color: var(--line-2); background: var(--soft-2); }
.agent-skill.active { border-color: var(--strong); background: var(--soft-2); }
.agent-skill.active .agent-skill-state { color: var(--strong); }
.agent-app { padding: 7px 8px; display: flex; align-items: flex-start; gap: 7px; }
.agent-app-ic {
  width: 22px; height: 22px; min-width: 22px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--strong); background: var(--soft-2);
}
.agent-app-ic svg { width: 12px; height: 12px; }
.agent-app-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.agent-app-copy b { font-size: 10.5px; color: var(--text); }
.agent-app-copy small { font-size: 9px; line-height: 1.4; color: var(--muted); }

.agent-runbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agent-mode-switch {
  display: inline-flex; gap: 2px; padding: 2px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--soft);
}
.agent-mode-btn {
  height: 24px; padding: 0 10px; border-radius: 999px;
  color: var(--muted); background: transparent; font-size: 10px; font-weight: 700;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.agent-mode-btn:hover { color: var(--text); }
.agent-mode-btn.active { background: var(--strong); color: var(--strong-text); }
.agent-usage { font-size: 9.5px; color: var(--faint); text-align: right; }
.agent-permission-hint { margin-top: -3px; font-size: 9.5px; line-height: 1.45; color: var(--muted); }

.agent-compose-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.agent-tool-btn {
  height: 27px; padding: 0 9px; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: var(--card-solid);
  color: var(--muted); font-size: 10px; font-weight: 700;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.agent-tool-btn:hover { color: var(--text); background: var(--soft-2); }
.agent-tool-btn svg { width: 12px; height: 12px; }
.agent-tool-btn[aria-pressed="true"] {
  color: var(--strong); border-color: var(--strong); background: var(--soft-2);
}
.agent-mode-hint { flex: 1; min-width: 130px; font-size: 9.5px; line-height: 1.4; }
.agent-img-params { margin: 0; }
.agent-img-params > summary { cursor: pointer; user-select: none; font-size: 10px; }

.agent-compose {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 7px 8px 7px 11px;
  border: 1px solid var(--line-2); border-radius: 15px;
  background: var(--card-solid);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.agent-compose:focus-within { border-color: var(--strong); }
.agent-input {
  flex: 1; width: 100%; min-height: 44px; max-height: 150px;
  padding: 3px 0; border: 0; background: transparent;
  font-size: 12.5px; line-height: 1.55; resize: none;
}
.agent-input:focus { outline: none; }
.agent-generate-btn {
  height: 38px; min-width: 88px; padding: 0 13px;
  border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px; font-weight: 800;
}
.agent-generate-btn svg { width: 14px; height: 14px; }
.agent-generate-btn.is-stop {
  color: #fff;
  background: color-mix(in srgb, #d9534f 82%, var(--strong));
  border-color: color-mix(in srgb, #d9534f 72%, var(--line-2));
}
.agent-generate-btn.is-stop:hover { background: #d9534f; }
.agent-footnote { font-size: 9.5px; line-height: 1.5; }

/* ---------- 鐢诲竷鍔╂墜锛氳交閲忚緭鍏ュ尯 ---------- */
.agent-drawer-head { padding: 14px 16px 12px; align-items: center; }
.agent-head-icon {
  width: 30px; height: 30px; min-width: 30px; border-radius: 9px;
}
.agent-head-icon svg { width: 15px; height: 15px; }
.agent-head-title-row { gap: 6px; }
.agent-head-sub {
  max-width: 400px; margin-top: 2px; padding: 0;
  font-size: 9.5px; line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#agentDrawer .agent-chat { padding: 8px 16px 10px; }
#agentDrawer .agent-note-box { padding: 0 16px 6px; }
#agentDrawer .agent-drawer-body {
  flex: none; max-height: none; overflow: visible;
  padding: 0 16px 14px; gap: 8px;
  border-top: 0; background: transparent;
}

.agent-composer {
  position: relative;
  padding: 10px 10px 9px;
  border: 1px solid var(--line-2); border-radius: 18px;
  background: var(--card-solid);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 10px 28px rgba(0,0,0,.16);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.agent-composer:focus-within {
  border-color: color-mix(in srgb, var(--strong) 55%, var(--line-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 0 3px color-mix(in srgb, var(--strong) 9%, transparent);
}
.agent-compose-mini { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; min-width: 0; }
.agent-mini-spacer { flex: 1; }
.agent-mini-btn {
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: transparent;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.agent-mini-btn:hover { color: var(--text); background: var(--soft-2); }
.agent-mini-btn svg { width: 14px; height: 14px; }
.agent-add-wrap { position: relative; flex: none; }
.agent-add-menu {
  position: absolute; left: 0; bottom: calc(100% + 7px); z-index: 70;
  display: none; flex-direction: column; min-width: 166px;
  padding: 5px; border-radius: 11px;
  background: var(--card-solid); border: 1px solid var(--line-2);
  box-shadow: 0 16px 42px rgba(0,0,0,.48);
}
.agent-add-menu.open { display: flex; }
.agent-add-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: 8px;
  color: var(--text); font-size: 11px; font-weight: 650; text-align: left;
}
.agent-add-item:hover { background: var(--soft-2); }
.agent-add-ic {
  width: 22px; height: 22px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--strong); background: var(--soft);
}
.agent-add-ic svg { width: 13px; height: 13px; }

.agent-pick-bar {
  display: none; align-items: center; gap: 8px;
  padding: 12px 13px; border-radius: 12px;
  border: 1px dashed var(--line-2); background: var(--soft);
  color: var(--text); font-size: 12.5px; font-weight: 650;
  animation: agentPopIn .18s var(--ease);
}
.agent-drawer.is-quoting .agent-pick-bar { display: flex; }
.agent-drawer.is-quoting .agent-composer { display: none; }
.agent-pick-bar > svg { width: 15px; height: 15px; color: var(--strong); flex: none; }
.agent-pick-x {
  width: 24px; height: 24px; margin-left: auto; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.agent-pick-x:hover { color: var(--text); background: var(--soft-2); }
.agent-pick-x svg { width: 13px; height: 13px; }

.agent-ref-ac {
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 80;
  width: min(400px, calc(100% - 20px)); max-height: 300px; overflow-y: auto;
  display: none; flex-direction: column; gap: 2px;
  padding: 5px; border-radius: 13px;
  background: var(--card-solid); border: 1px solid var(--line-2);
  box-shadow: 0 20px 56px rgba(0,0,0,.52);
  transform: translateX(-50%);
}
.agent-ref-ac.open { display: flex; }
.agent-slash-ac { width: min(380px, calc(100% - 20px)); }
.agent-slash-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: 9px; cursor: pointer;
  color: var(--text);
}
.agent-slash-row:hover, .agent-slash-row.on { background: var(--soft-2); }
.agent-slash-ic {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--strong); background: var(--soft);
}
.agent-slash-ic svg { width: 14px; height: 14px; }
.agent-slash-main { flex: 1; min-width: 0; }
.agent-slash-name { font-size: 11.5px; font-weight: 800; }
.agent-slash-hint { color: var(--muted); font-size: 9.5px; line-height: 1.45; margin-top: 2px; }
.agent-slash-cmd {
  flex: none; color: var(--faint); font-size: 9px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.agent-ref-ac-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px; border-radius: 8px; cursor: pointer;
  color: var(--text); font-size: 11px;
}
.agent-ref-ac-row:hover, .agent-ref-ac-row.on { background: var(--soft-2); }
.agent-ref-ac-img {
  width: 30px; height: 30px; min-width: 30px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); background: var(--soft);
}
.agent-ref-ac-ic {
  width: 30px; height: 30px; min-width: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--strong);
}
.agent-ref-ac-ic svg { width: 14px; height: 14px; }
.agent-ref-ac-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 650;
}
.agent-ref-ac-tag {
  flex: none; padding: 1px 5px; border-radius: 5px;
  background: var(--soft); color: var(--faint);
  font-size: 8.5px; font-weight: 700;
}

.agent-asset-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px; max-height: min(56vh, 460px); overflow-y: auto; padding: 2px;
}
.agent-asset-cell {
  min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--card-solid); color: var(--muted); text-align: left;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.agent-asset-cell:hover { border-color: var(--line-2); background: var(--soft-2); }
.agent-asset-cell.on { border-color: var(--strong); background: var(--soft-2); }
.agent-asset-cell img {
  width: 100%; height: 104px; object-fit: cover; display: block;
  border-radius: 7px; background: var(--soft);
}
.agent-asset-cell span {
  display: block; margin-top: 5px; padding: 0 2px 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 9.5px; font-weight: 600;
}
.agent-asset-empty {
  grid-column: 1 / -1; padding: 34px 12px; text-align: center;
  color: var(--muted); font-size: 11px;
}
.agent-input {
  min-height: 54px; max-height: 180px;
  padding: 2px 2px 4px; border: 0; border-radius: 0;
  font-size: 13px; line-height: 1.6; background: transparent;
}
.agent-composer.is-expanded .agent-input { min-height: 150px; }
.agent-mini-btn[aria-pressed="true"] { color: var(--strong); background: var(--soft-2); }
.agent-prompt { position: relative; min-width: 0; }
.agent-skill-chip {
  display: flex; align-items: center; gap: 7px;
  width: fit-content; max-width: 100%;
  margin: 0 0 7px; padding: 5px 7px 5px 8px;
  border: 1px solid color-mix(in srgb, var(--strong) 42%, var(--line-2));
  border-radius: 9px;
  background: color-mix(in srgb, var(--strong) 12%, var(--soft));
  color: var(--text);
}
.agent-skill-chip[hidden] { display: none; }
.agent-skill-chip-ic { display: flex; color: var(--strong); }
.agent-skill-chip-ic svg { width: 13px; height: 13px; }
.agent-skill-chip-name { font-size: 10.5px; font-weight: 800; }
.agent-skill-chip-x {
  width: 18px; height: 18px; border: 0; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--faint); cursor: pointer;
}
.agent-skill-chip-x:hover { color: var(--text); background: var(--soft-2); }
.agent-skill-chip-x svg { width: 11px; height: 11px; }
.agent-input { position: relative; z-index: 1; }
.agent-input-hl {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none; overflow: hidden;
  padding: 2px 2px 4px;
  font-family: inherit; font-size: 13px; line-height: 1.6; letter-spacing: 0;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word;
  color: transparent;
}
.agent-input-chip {
  pointer-events: auto; cursor: pointer;
  border-radius: 5px;
  background: color-mix(in srgb, var(--success) 22%, transparent);
  color: transparent;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.agent-input-chip:hover { background: color-mix(in srgb, var(--success) 34%, transparent); }
.agent-compose-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 7px;
}
.agent-compose-tools { display: flex; align-items: center; gap: 2px; min-width: 0; flex-wrap: nowrap; }
.agent-interaction-switch {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  height: 28px; padding: 2px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--soft);
}
.agent-interaction-btn {
  height: 22px; padding: 0 7px; border-radius: 7px;
  color: var(--muted); background: transparent;
  font-size: 10px; font-weight: 800; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.agent-interaction-btn:hover { color: var(--text); background: var(--soft-2); }
.agent-interaction-btn.active { color: var(--strong-text); background: var(--strong); }
#agentDrawer[data-interaction-mode="modeling"] #agentImgParams,
#agentDrawer[data-interaction-mode="chat"] #agentImgParams { opacity: .45; }
#agentDrawer[data-interaction-mode="modeling"] #agentImgParams > summary,
#agentDrawer[data-interaction-mode="chat"] #agentImgParams > summary { cursor: not-allowed; }
.agent-menu { position: static; flex: none; }
.agent-menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  height: 28px; padding: 0 8px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: 10.5px; font-weight: 700; white-space: nowrap;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.agent-menu > summary::-webkit-details-marker { display: none; }
.agent-menu > summary:hover { color: var(--text); background: var(--soft-2); }
.agent-menu[open] > summary { color: var(--text); background: var(--soft-2); }
.agent-menu > summary svg { width: 13px; height: 13px; flex: none; }
.agent-menu-badge { font-size: 9px; font-weight: 700; color: var(--faint); }
.agent-pop {
  position: absolute; left: 50%; bottom: calc(100% + 9px); z-index: 60;
  width: min(420px, calc(100% - 20px));
  max-width: calc(100vw - 64px);
  max-height: min(460px, calc(100vh - 300px)); overflow-y: auto;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-2); border-radius: 16px;
  background: color-mix(in srgb, var(--card-solid) 94%, var(--strong) 6%);
  box-shadow: 0 24px 64px rgba(0,0,0,.56), inset 0 1px 0 rgba(255,255,255,.04);
  animation: agentPopCenter .18s var(--ease);
}
@keyframes agentPopCenter {
  from { opacity: 0; transform: translate(-50%, 6px) scale(.985); }
  to { opacity: 1; transform: translateX(-50%); }
}
.agent-pop-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 1px 1px 2px;
}
.agent-pop-head b { color: var(--text); font-size: 11px; }
.agent-pop-head span { color: var(--faint); font-size: 9px; font-weight: 600; }
.agent-pop-skills, .agent-pop-params { width: min(420px, calc(100% - 20px)); }
.agent-pop-perm { width: min(340px, calc(100% - 20px)); }
.agent-skill-grid, .agent-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agent-skill { padding: 8px; }
.agent-app { padding: 8px; }
.agent-app-copy small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.agent-mode-switch { display: flex; width: 100%; border-radius: 10px; }
.agent-mode-btn { flex: 1; height: 28px; font-size: 10.5px; }
.agent-permission-hint { margin: 0; font-size: 10px; line-height: 1.5; }
.agent-usage { font-size: 9.5px; color: var(--faint); text-align: left; }

.agent-img-mode {
  width: 100%; height: 32px; padding: 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--soft);
  color: var(--text); font-size: 10.5px; font-weight: 700; text-align: left;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.agent-img-mode:hover { border-color: var(--line-2); background: var(--soft-2); }
.agent-img-mode[aria-pressed="true"] { color: var(--strong); border-color: var(--strong); }
.agent-img-params .agent-params-grid { padding: 0; gap: 7px; }
.agent-mode-hint { font-size: 9.5px; line-height: 1.45; }
.agent-generate-btn {
  width: 36px; height: 36px; min-width: 36px; padding: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--strong); color: var(--strong-text);
  box-shadow: 0 4px 14px rgba(0,0,0,.24);
  transition: transform .15s var(--ease), opacity .15s var(--ease);
}
.agent-generate-btn:hover { transform: translateY(-1px); opacity: .92; }
.agent-generate-btn:active { transform: none; }
.agent-generate-btn svg { width: 15px; height: 15px; }
.agent-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- 瀵硅瘽绾跨▼ ---------- */
.agent-drawer-head { position: relative; }
.agent-thread-btn {
  max-width: 340px; min-width: 0; height: 24px; padding: 0 5px 0 0;
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text); font-size: 12px; font-weight: 800; text-align: left;
  background: transparent; border-radius: 7px;
}
.agent-thread-btn:hover { background: var(--soft-2); }
.agent-thread-btn span {
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.agent-thread-btn svg { width: 12px; height: 12px; color: var(--faint); flex: none; }
.agent-thread-menu {
  position: absolute; top: calc(100% - 5px); left: 14px; z-index: 90;
  display: none; width: min(340px, calc(100% - 28px));
  max-height: min(52vh, 420px); overflow-y: auto;
  padding: 5px; border-radius: 13px;
  border: 1px solid var(--line-2); background: var(--card-solid);
  box-shadow: 0 22px 60px rgba(0,0,0,.55);
}
.agent-thread-menu.open { display: flex; flex-direction: column; gap: 2px; }
.agent-thread-row { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.agent-thread-row:hover { background: var(--soft); }
.agent-thread-main {
  flex: 1; min-width: 0; padding: 8px; border-radius: 8px;
  display: flex; flex-direction: column; gap: 2px; text-align: left;
}
.agent-thread-main.active { background: var(--soft-2); }
.agent-thread-name {
  color: var(--text); font-size: 11px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.agent-thread-state { color: var(--faint); font-size: 9px; font-weight: 650; }
.agent-thread-act {
  width: 25px; height: 25px; flex: none; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; color: var(--faint);
}
.agent-thread-act:hover { color: var(--text); background: var(--soft-2); }
.agent-thread-act svg { width: 12px; height: 12px; }
.agent-thread-empty { padding: 14px; text-align: center; color: var(--faint); font-size: 10px; }

/* ---------- 鎬濊€?/ 宸ュ叿姝ラ ---------- */
.agent-steps { display: flex; flex-direction: column; gap: 4px; width: 100%; margin-bottom: 5px; }
.agent-thought {
  border: 1px solid var(--line); border-radius: 9px;
  background: color-mix(in srgb, var(--soft) 70%, transparent);
}
.agent-thought > summary {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; cursor: pointer; list-style: none;
  color: var(--muted); font-size: 10px; font-weight: 700;
}
.agent-thought > summary::-webkit-details-marker { display: none; }
.agent-thought[open] > summary .agent-step-caret { transform: rotate(90deg); }
.agent-thought-text {
  padding: 0 9px 8px; color: var(--muted);
  font-size: 10px; line-height: 1.65; white-space: pre-wrap;
}
.agent-step {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  padding: 5px 7px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--soft);
  color: var(--muted); font-size: 10px;
}
.agent-step-ic {
  width: 14px; height: 14px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--strong);
}
.agent-step-ic svg { width: 13px; height: 13px; }
.agent-step-label { color: var(--text); font-weight: 700; flex: none; }
.agent-step-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-step-ms { margin-left: auto; color: var(--faint); font-size: 9px; flex: none; }
.agent-step-caret { width: 11px; height: 11px !important; transition: transform .15s var(--ease); }
.agent-turn-meta { margin-top: 4px; color: var(--faint); font-size: 9px; }
.agent-legacy-tools { width: 100%; margin-bottom: 4px; }
.agent-legacy-tools > summary { cursor: pointer; color: var(--faint); font-size: 9.5px; }
.agent-streaming { border-style: dashed; }

/* ---------- 纭 / 婢勬竻 / 鎭㈠鍗＄墖 ---------- */
.agent-confirm-card, .agent-question-card, .agent-recovery-card {
  padding: 10px; border-radius: 13px;
  border: 1px solid var(--line-2); background: var(--card-solid);
  box-shadow: 0 12px 36px rgba(0,0,0,.25);
  display: flex; flex-direction: column; gap: 8px;
}
.agent-card-kicker {
  display: flex; align-items: center; gap: 5px;
  color: var(--faint); font-size: 9px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
}
.agent-confirm-title { color: var(--text); font-size: 11.5px; font-weight: 750; line-height: 1.5; }
.agent-confirm-preview { display: flex; flex-direction: column; gap: 5px; }
.agent-confirm-node {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 5px 7px; align-items: center;
  padding: 7px; border-radius: 9px; background: var(--soft);
}
.agent-confirm-node-ic {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--strong); background: var(--soft-2);
}
.agent-confirm-node-ic svg { width: 12px; height: 12px; }
.agent-confirm-node-name { color: var(--text); font-size: 10.5px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-confirm-node-meta { color: var(--faint); font-size: 9px; }
.agent-confirm-prompt {
  grid-column: 2 / -1; color: var(--muted); font-size: 9.5px; line-height: 1.55;
  white-space: pre-wrap; max-height: 90px; overflow-y: auto;
}
.agent-confirm-meta { color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.agent-detail-summary {
  padding: 6px 8px; border-radius: 8px;
  background: var(--soft); color: var(--text);
  font-size: 9.5px; font-weight: 700; line-height: 1.5;
}
.agent-detail-categories { display: flex; flex-direction: column; gap: 4px; }
.agent-detail-category {
  display: grid; grid-template-columns: 8px 54px minmax(0, 1fr);
  gap: 6px; align-items: center;
  color: var(--muted); font-size: 9.5px; line-height: 1.45;
}
.agent-detail-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--faint); display: inline-block;
}
.agent-detail-dot.covered { background: #4ade80; }
.agent-detail-dot.missing { background: #f59e0b; }
.agent-detail-dot.unknown { background: var(--faint); }
.agent-detail-category-name { color: var(--text); font-weight: 700; white-space: nowrap; }
.agent-detail-category-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-detail-choices {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--soft);
}
.agent-detail-choice-title { color: var(--text); font-size: 9.5px; font-weight: 750; }
.agent-detail-choice { display: flex; flex-direction: column; gap: 4px; }
.agent-detail-choice-label { color: var(--text); font-size: 10px; font-weight: 700; }
.agent-detail-choice-reason { color: var(--faint); font-size: 9px; line-height: 1.4; }
.agent-detail-choice-options { display: flex; flex-wrap: wrap; gap: 5px; }
.agent-ruby-code {
  margin: 2px 0 0;
  padding: 8px;
  max-height: 180px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--soft);
  color: var(--text);
  font: 9.5px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.agent-confirm-card.is-resolving { display: none !important; }
#agentPendingBox {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  max-height: 52%;
  overflow: hidden;
}
#agentPendingBox > .agent-confirm-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
}
#agentPendingBox .agent-confirm-preview {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
#agentPendingBox .agent-confirm-actions { flex-wrap: wrap; }
.agent-step-code {
  margin: 4px 0 2px 22px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--soft);
  overflow: hidden;
}
.agent-step-code > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  cursor: pointer;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  list-style: none;
}
.agent-step-code > summary::-webkit-details-marker { display: none; }
.agent-step-code[open] > summary .agent-step-caret { transform: rotate(90deg); }
.agent-step-code > summary .agent-step-caret { margin-left: auto; }
.agent-code-copy {
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--card-solid);
  color: var(--text);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.agent-code-copy:hover { border-color: var(--strong); }
.agent-step-code-pre {
  margin: 0;
  padding: 8px;
  max-height: 280px;
  overflow: auto;
  border-top: 1px solid var(--line-2);
  color: var(--text);
  font: 9.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.agent-confirm-actions, .agent-question-actions, .agent-recovery-actions {
  display: flex; justify-content: flex-end; gap: 6px;
}
.agent-question-intro { color: var(--muted); font-size: 10px; line-height: 1.6; }
.agent-question-counter { color: var(--faint); font-size: 9px; font-weight: 700; }
.agent-question-title { color: var(--text); font-size: 11.5px; font-weight: 750; line-height: 1.5; }
.agent-question-desc { color: var(--muted); font-size: 10px; line-height: 1.55; }
.agent-question-options { display: flex; flex-direction: column; gap: 5px; }
.agent-question-option {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 8px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--soft);
}
.agent-question-option:hover { border-color: var(--line-2); background: var(--soft-2); }
.agent-question-option input { margin-top: 2px; flex: none; }
.agent-question-option-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agent-question-option-copy b { color: var(--text); font-size: 10.5px; }
.agent-question-option-copy small { color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.agent-question-custom {
  width: 100%; min-height: 48px; resize: vertical;
  padding: 8px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--card-solid);
  color: var(--text); font-size: 10.5px; line-height: 1.5; outline: none;
}
.agent-question-custom:focus { border-color: var(--strong); }
.agent-recovery-text { color: var(--muted); font-size: 10px; line-height: 1.55; }
.agent-recovery-actions { justify-content: flex-start; }

.agent-empty {
  min-height: 220px; padding: 34px 8px 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; text-align: center;
}
.agent-empty-ic {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--strong); background: var(--soft-2); border: 1px solid var(--line);
}
.agent-empty-ic svg { width: 18px; height: 18px; }
.agent-empty > small { color: var(--faint); font-size: 10px; font-weight: 700; }
.agent-empty > b { color: var(--text); font-size: 18px; letter-spacing: -.01em; }
.agent-empty > p {
  max-width: 330px; color: var(--muted); font-size: 11px; line-height: 1.65;
}
.agent-empty-apps {
  width: min(100%, 400px); margin-top: 12px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.agent-empty-app {
  min-width: 0; padding: 10px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card-solid); color: var(--muted);
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.agent-empty-app:hover { border-color: var(--line-2); background: var(--soft-2); transform: translateY(-1px); }
.agent-empty-app-top { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 10.5px; font-weight: 800; }
.agent-empty-app-top svg { width: 12px; height: 12px; color: var(--strong); }
.agent-empty-app small { display: block; margin-top: 5px; color: var(--muted); font-size: 9.5px; line-height: 1.45; }

.agent-quote-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: min(52vh, 420px); overflow-y: auto; padding-right: 2px;
}
.agent-quote-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card-solid); cursor: pointer;
}
.agent-quote-row:hover { border-color: var(--line-2); background: var(--soft); }
.agent-quote-row input { margin-top: 2px; flex: none; }
.agent-quote-ic {
  width: 24px; height: 24px; min-width: 24px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--strong); background: var(--soft-2);
}
.agent-quote-ic svg { width: 13px; height: 13px; }
.agent-quote-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.agent-quote-copy b { font-size: 11px; color: var(--text); }
.agent-quote-copy small {
  font-size: 10px; line-height: 1.45; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.jobs-list { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.job-row {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card-solid); display: flex; flex-direction: column; gap: 5px;
}
.job-row .jt { font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.job-row .jm { font-size: 10px; color: var(--muted); }
.job-row .badge { padding: 1px 6px; border-radius: 4px; font-size: 9px; font-weight: 800; }
.job-row .badge.done { background: rgba(5,150,105,.14); color: var(--success); }
.job-row .badge.error { background: var(--danger-bg); color: var(--danger); }
.job-row .badge.running { background: rgba(37,99,235,.14); color: #2563eb; }
.job-row .badge.canceled { background: var(--soft); color: var(--muted); }
.job-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- 鑺傜偣鐗堟湰鍘嗗彶锛?-6锛?---------- */
.ver-section { margin-top: 6px; }
.ver-head { display: flex; align-items: center; font-size: 11px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.ver-head > span:first-child { flex: 1; }
.ver-list { display: flex; flex-direction: column; gap: 5px; }
.ver-empty { font-size: 10px; color: var(--faint); line-height: 1.6; font-weight: 600; padding: 4px 0; }
.ver-item {
  display: flex; align-items: center; gap: 7px; padding: 6px;
  background: var(--soft); border: 1px solid var(--line-2); border-radius: 9px;
}
.ver-thumbs { display: flex; gap: 3px; flex-shrink: 0; }
.ver-thumb { width: 34px; height: 34px; border-radius: 6px; overflow: hidden; background: var(--card-solid); }
.ver-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.ver-when { flex: 1; font-size: 10px; color: var(--muted); font-weight: 600; }
.ver-sig {
  font-size: 9px; color: var(--faint); font-weight: 700; font-family: ui-monospace, monospace;
  max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0;
}
.ver-cur { font-size: 9px; font-weight: 800; color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); padding: 2px 6px; border-radius: 5px; }

/* ---------- 寰呭彇鍥烇紙5-5 浠诲姟鍙栧洖涓績锛?---------- */
.job-recover {
  border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--line));
  background: color-mix(in srgb, var(--warning) 8%, transparent);
  border-radius: var(--radius-card); padding: 9px 10px; margin-bottom: 6px;
  display: flex; flex-direction: column; gap: 7px;
}
.job-recover-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; color: var(--warning);
}
.job-recover-head svg { width: 13px; height: 13px; flex-shrink: 0; }
.job-recover-note { font-size: 10px; line-height: 1.6; color: var(--muted); font-weight: 600; }
.job-recover-row { background: var(--card-solid); margin: 0; }
.job-recover-acts { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.job-orphan-note {
  font-size: 10px; color: var(--faint); font-weight: 600;
  padding: 5px 8px; margin-bottom: 5px; line-height: 1.6;
}

/* ================================================================ 浠诲姟鍘嗗彶 */
.jobs-backdrop {
  position: fixed; inset: 0; z-index: 759;
  background: rgba(0, 0, 0, .42); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; transition: opacity .18s var(--ease), visibility .18s;
}
.jobs-backdrop.open { opacity: 1; visibility: visible; }

.jobs-drawer.jobs-hub {
  left: 80px; right: auto; top: 50%; transform: translateY(-50%);
  width: 300px; max-height: calc(100vh - 180px); border-radius: 18px; z-index: 760;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
}
.jobs-drawer.jobs-hub.is-expanded {
  left: 50%; right: auto; top: 50%; transform: translate(-50%, -50%);
  width: min(1080px, calc(100vw - 80px));
  height: min(720px, calc(100vh - 80px));
  max-height: none; border-radius: 16px;
}
.jobs-head {
  height: 52px; flex-shrink: 0; display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 14px; border-bottom: 1px solid var(--line);
}
.jobs-panel-title {
  flex: 1; min-width: 0; font-size: 13px; font-weight: 800; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jobs-back-btn { display: none; }
.jobs-hub.is-detail:not(.is-expanded) .jobs-back-btn { display: flex; margin-right: -2px; }
.jobs-hub.is-detail:not(.is-expanded) #jobsMultiBtn,
.jobs-hub.is-detail:not(.is-expanded) .jobs-view-mode { display: none; }
.jobs-hub.is-detail:not(.is-expanded) #jobsSelectTools { display: none !important; }
.jobs-head-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.jobs-icon-btn {
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: color .15s, background .15s;
}
.jobs-icon-btn:hover { color: var(--text); background: var(--soft); }
.jobs-icon-btn.is-active { color: var(--text); background: var(--soft); }
.jobs-icon-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.jobs-icon-btn.jobs-danger:hover { color: var(--danger); background: var(--danger-bg); }
.jobs-icon-btn svg { width: 15px; height: 15px; }
.jobs-icon-btn[hidden] { display: none !important; }
.jobs-select-tools { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.jobs-select-tools[hidden] { display: none !important; }
.jobs-text-btn {
  height: 26px; padding: 0 7px; border: 0; background: transparent; border-radius: 7px;
  color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.jobs-text-btn:hover { color: var(--text); background: var(--soft); }
.jobs-body { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.jobs-list-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.jobs-detail-pane { display: none; flex-direction: column; min-height: 0; flex: 1; overflow-y: auto; }
.jobs-hub.is-detail:not(.is-expanded) .jobs-list-pane { display: none; }
.jobs-hub.is-detail:not(.is-expanded) .jobs-detail-pane { display: flex; max-height: calc(100vh - 232px); }
.jobs-hub.is-expanded .jobs-body {
  display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(320px, .84fr);
  flex: 1; min-height: 0;
}
.jobs-hub.is-expanded .jobs-list-pane { display: flex; min-width: 0; min-height: 0; }
.jobs-hub.is-expanded .jobs-list { max-height: none; }
.jobs-hub.is-expanded .jobs-detail-pane {
  display: flex; max-height: none; border-left: 1px solid var(--line);
  min-width: 0; overflow-y: auto;
}

.jobs-search { position: relative; margin: 10px 12px 8px; flex-shrink: 0; }
.jobs-search > svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; color: var(--faint); pointer-events: none;
}
.jobs-search input {
  width: 100%; height: 35px; padding: 0 10px 0 30px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--soft); color: var(--text);
  font: inherit; font-size: 11px; outline: none;
}
.jobs-search input:focus { border-color: var(--line-2); background: var(--card-solid); }
.jobs-search input::placeholder { color: var(--faint); }
.jobs-search input::-webkit-search-cancel-button { display: none; }

.jobs-filters {
  display: flex; align-items: center; gap: 16px; flex-shrink: 0;
  padding: 0 14px 9px; border-bottom: 1px solid var(--line);
}
.jobs-filter {
  border: 0; background: transparent; padding: 0; color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; position: relative;
}
.jobs-filter:hover { color: var(--text); }
.jobs-filter.is-active { color: var(--text); }
.jobs-filter.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 2px;
  background: var(--text); border-radius: 2px;
}

.jobs-hub .jobs-list {
  flex: 1; min-height: 0; max-height: calc(100vh - 340px);
  padding: 6px 8px 10px; gap: 3px; scrollbar-width: thin;
}
.jobs-item {
  width: 100%; min-width: 0; display: flex; align-items: center; gap: 9px;
  padding: 8px; border: 1px solid transparent; border-radius: 11px;
  background: transparent; color: var(--text); text-align: left; font: inherit;
  cursor: pointer; transition: background .14s, border-color .14s;
}
.jobs-item:hover { background: var(--soft); border-color: var(--line); }
.jobs-item.is-active { background: color-mix(in srgb, var(--text) 7%, transparent); border-color: var(--line-2); }
.jobs-check {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--line-2); color: var(--strong-text);
  display: none; align-items: center; justify-content: center; background: transparent;
}
.jobs-hub.is-selecting .jobs-check { display: flex; }
.jobs-check.is-checked { border-color: var(--strong); background: var(--strong); }
.jobs-check svg { width: 11px; height: 11px; }
.jobs-thumb {
  width: 40px; height: 40px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
  background: var(--soft); color: var(--faint); position: relative;
  display: flex; align-items: center; justify-content: center;
}
.jobs-thumb img, .jobs-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.jobs-thumb > svg { width: 16px; height: 16px; }
.jobs-thumb-count {
  position: absolute; right: 2px; bottom: 2px; min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 7px; background: rgba(0, 0, 0, .65); color: #fff;
  font-size: 8px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.jobs-item-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.jobs-item-title {
  font-size: 12px; font-weight: 700; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jobs-item-sub {
  font-size: 10px; color: var(--muted); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jobs-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.jobs-item-time { font-size: 9.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.jobs-status { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.jobs-status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.jobs-status.is-done { color: var(--success); }
.jobs-status.is-error { color: var(--danger); }
.jobs-status.is-running { color: #3b82f6; }
.jobs-status.is-queued { color: var(--warning); }
.jobs-status.is-canceled { color: var(--faint); }

.jobs-hub .jobs-list.is-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px; padding: 10px 12px; align-content: start;
}
.jobs-list.is-grid .jobs-item {
  position: relative; flex-direction: column; align-items: stretch; gap: 7px;
  padding: 7px; background: var(--card-solid); border-color: var(--line);
}
.jobs-list.is-grid .jobs-thumb { width: 100%; height: auto; aspect-ratio: 1.45; }
.jobs-list.is-grid .jobs-check {
  position: absolute; left: 12px; top: 12px; z-index: 2; background: var(--panel);
}
.jobs-list.is-grid .jobs-item-side {
  flex-direction: row; align-items: center; justify-content: space-between; width: 100%;
}

.jobs-detail-empty {
  flex: 1; min-height: 180px; display: flex; align-items: center; justify-content: center;
  padding: 30px; color: var(--faint); font-size: 12px; text-align: center;
}
.jobs-detail { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 12px; min-height: 100%; }
.jobs-detail-close {
  position: absolute; right: 20px; top: 20px; z-index: 3;
  width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.jobs-detail-close:hover { background: rgba(0, 0, 0, .72); }
.jobs-detail-close svg { width: 13px; height: 13px; }
.jobs-detail-media {
  min-height: 170px; height: clamp(170px, 25vh, 250px); border-radius: 12px;
  background: #080808; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.jobs-detail-media img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.jobs-detail-media video { max-width: 100%; max-height: 100%; display: block; }
.jobs-detail-media audio { width: calc(100% - 24px); }
.jobs-detail-noimg {
  color: #666; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; font-size: 10px;
}
.jobs-detail-noimg svg { width: 20px; height: 20px; }
.jobs-detail-count {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 9px; font-weight: 700;
}
.jobs-meta { display: flex; flex-direction: column; }
.jobs-meta-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 5px 0; font-size: 11px; }
.jobs-meta-label {
  width: 76px; flex-shrink: 0; display: flex; align-items: center; gap: 6px;
  color: var(--faint); line-height: 1.55;
}
.jobs-meta-label svg { width: 12px; height: 12px; flex-shrink: 0; }
.jobs-meta-value {
  flex: 1; min-width: 0; color: var(--text); font-weight: 600; line-height: 1.55;
  word-break: break-all; font-variant-numeric: tabular-nums;
}
.jobs-copy {
  width: 20px; height: 20px; margin-top: -2px; border: 0; border-radius: 5px;
  background: transparent; color: var(--faint); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.jobs-copy:hover { color: var(--text); background: var(--soft); }
.jobs-copy svg { width: 11px; height: 11px; }
.jobs-detail-error {
  padding: 8px 10px; border-radius: 9px; background: var(--danger-bg); color: var(--danger);
  font-size: 10px; font-weight: 600; line-height: 1.55; word-break: break-word;
}
.jobs-locate {
  height: 34px; width: 100%; border: 1px solid var(--line); border-radius: 9px;
  background: var(--soft); color: var(--text); font: inherit; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
}
.jobs-locate:hover:not(:disabled) { border-color: var(--line-2); background: var(--card-solid); }
.jobs-locate:disabled { color: var(--faint); cursor: default; opacity: .6; }
.jobs-locate svg { width: 13px; height: 13px; }
.jobs-steps { border-top: 1px solid var(--line); margin-top: 2px; padding-top: 10px; }
.jobs-steps-title { font-size: 10px; font-weight: 700; color: var(--faint); margin-bottom: 9px; }
.jobs-step-row { display: flex; align-items: flex-start; gap: 8px; }
.jobs-step-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  margin-top: 5px; flex-shrink: 0;
}
.jobs-step-dot.is-done { color: var(--success); }
.jobs-step-dot.is-error { color: var(--danger); }
.jobs-step-dot.is-running { color: #3b82f6; }
.jobs-step-dot.is-queued { color: var(--warning); }
.jobs-step-dot.is-canceled { color: var(--faint); }
.jobs-step-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jobs-step-name { font-size: 11px; font-weight: 700; line-height: 1.4; color: var(--text); }
.jobs-step-sub { font-size: 9.5px; color: var(--faint); }
.jobs-step-side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-size: 9.5px; color: var(--muted); flex-shrink: 0;
}
.jobs-step-time { color: var(--faint); font-variant-numeric: tabular-nums; }
.jobs-hub .job-recover { margin: 0 0 4px; }
.jobs-hub .job-empty { padding: 26px 12px; }

@media (max-width: 760px) {
  .jobs-drawer.jobs-hub { left: 74px; width: calc(100vw - 90px); }
  .jobs-drawer.jobs-hub.is-expanded { width: calc(100vw - 24px); height: calc(100vh - 24px); }
  .jobs-hub.is-expanded .jobs-body { grid-template-columns: 1fr; }
  .jobs-hub.is-expanded .jobs-detail-pane { display: none; }
  .jobs-hub.is-expanded.is-detail .jobs-list-pane { display: none; }
  .jobs-hub.is-expanded.is-detail .jobs-detail-pane { display: flex; border-left: 0; }
  .jobs-hub.is-expanded.is-detail #jobsBackBtn { display: flex; }
  .jobs-hub.is-expanded.is-detail #jobsMultiBtn,
  .jobs-hub.is-expanded.is-detail .jobs-view-mode { display: none; }
}

/* ================================================================
   鐢诲竷鍐呯缉锛氳祫浜у簱鎵撳紑鏃舵妸鐢诲竷寰€宸﹁
   ================================================================

   /**
    * 鍞竴鐨勩€岄潰鏉垮崰浣嶃€嶅紑鍏炽€?
    *
    * --canvas-right 鏄?*鐢诲竷鍙充晶琚崰鎺夌殑瀹藉害**锛屾墍鏈夐渶瑕佽窡鐫€鐢诲竷璧扮殑娴眰
    * 閮戒粠杩欎竴涓彉閲忔帹瀵硷紝涓嶅悇鑷‖缂栫爜 鈥斺€?鍚﹀垯鏀归潰鏉垮搴︽椂瑕佹敼浜斿锛?
    * 婕忎竴澶勫氨浼氬嚭鐜般€岄潰鏉跨洊浣忎簡鐢诲竷浣嗙敾甯冭繕鎸夋弧瀹界畻鍧愭爣銆嶇殑閿欎綅銆?
    *
    * 涔嬫墍浠ヨ兘璁╃敾甯冪湡鐨勩€岃鍑恒€嶇┖闂磋€屼笉鏄闈㈡澘鐩栦綇锛?
    * screenToWorld / zoomAt / fitBounds 鍏ㄩ儴浠?board.getBoundingClientRect()
    * 涓哄熀鍑嗭紝#board 涓€鍙樼獎锛屽潗鏍囨崲绠楄嚜鍔ㄨ窡鐫€鍙橈紝JS 涓€琛岄兘涓嶇敤鏀广€?
    */
   .shell {
     --canvas-right: 0px;
     --ease-panel: .25s var(--ease);
   }
   body.assets-open .shell { --canvas-right: 376px; }

/**
   * 蹇呴』鏄惧紡鍐?right锛屼笉鑳藉彧闈?inset:0銆?
   *
   * base.css 鐨?.board 鏄?`inset: 0`锛岀畝鍐欎細灞曞紑鎴?top/right/bottom/left: 0锛?
   * 浜庢槸 `right` 琚?*鍚屼竴涓畝鍐?*閲岀殑澹版槑鍐冲畾浜?鈥斺€?鍙橀噺閭ｆ潯铏界劧鍐欏湪鍚庨潰锛?
   * 瀹為檯鐢熸晥涓庡惁鍙栧喅浜庝袱鏉¤鍒欑殑灞傚彔椤哄簭锛屽緢鑴嗐€?
   * 鏄惧紡鍐欎竴閬嶅氨娌℃湁杩欎釜姝т箟浜嗐€?
   */
  #board {
    right: var(--canvas-right);
    transition: right var(--ease-panel);
  }
   /**
    * 搴曢儴鎻愮ず鏉℃寜**鐢诲竷**灞呬腑锛岃€屼笉鏄寜瑙嗗彛灞呬腑銆?
    *
    * 瑙嗗彛灞呬腑鐨勮瘽锛岀敾甯冭鍘嬬缉鍚庡畠浼氬線鍙冲亸銆佹渶鍚庝竴鍗婅惤鍦ㄩ潰鏉垮簳涓?鈥斺€?
    * 鑰岃繖琛屽瓧姝ｅソ鏄敤鎴峰蹇嵎閿殑鍦版柟锛岃閬帀绛変簬娌℃湁銆?
    */
   #hint {
     left: calc(50% - var(--canvas-right) / 2);
     transition: left var(--ease-panel);
   }

   /**
    * 璧勪骇搴撹嚜韬€?
    *
    * 鍏ㄩ儴鐢?#assetsPanel 鍓嶇紑瑕嗙洊锛?*涓嶅姩 .jobs-drawer** 鈥斺€?
    * 閭ｄ釜绫昏姹囨姤 PPT 鎶藉眽銆佺敓鎴愯褰曟娊灞夈€佺敾甯冨姪鎵嬩笁涓潰鏉垮叡鐢紝
    * 鏀瑰畠鐨勫畾浣嶄細杩炲甫鎶婂彟澶栦笁涓篃鎸蛋銆?
    *
* 瀹藉害 320 = 涓夊垪 脳 96px銆?80 澶浜嗭細鎶藉眽鍙宠竟涓€鏉?480px锛?
   * 鍦?1584px 鐨勭獥鍙ｄ笂鍚冩帀涓夋垚鐢婚潰锛岃€岄噷闈㈣鐨勫唴瀹瑰彧鏈変笁鍒楃缉鐣ュ浘銆?
   * top 淇濇寔 70px 閬垮紑椤堕儴宸ュ叿鏍忥紙宸ュ叿鏍?z-index 30 > 鏈潰鏉?26锛?
   * 鐪熼噸鍙犵殑璇濊鐩栦綇鐨勬槸宸ュ叿鏍忥級锛宐ottom 鎾戝埌鐢诲竷搴曢儴銆?
   *
   * 鏀瑰搴︽椂涓夊蹇呴』涓€璧锋敼锛屽惁鍒欑敾甯冭浣嶅拰鍔╂墜閿欎綅閮戒細璺熺潃閿欙細
   *   杩欓噷 320 / --canvas-right 336锛?20+right16锛? agentDrawer right 352
   */
   .assets-panel {
     width: 360px;
     top: 90px; bottom: 16px;
     max-height: none;
   }
/**
 * 鐢诲竷鍔╂墜寰€宸﹁寮€锛屼袱涓潰鏉挎墠鑳藉悓鏃剁敤銆?
 *
 * 涔嬪墠鎵撳紑鐢诲竷鍔╂墜浼氱洿鎺ユ妸璧勪骇搴撳叧鎺夛紙agentdrawer.js 閲?remove('open')锛夛紝
 * 浜庢槸銆岀敤鍔╂墜鏃跺氨娌℃硶鐢ㄨ祫浜у簱閲岀殑璧勬簮銆嶁€斺€?鑰岃繖鎭版伆鏄渶闇€瑕佷袱鑰呭悓鏃跺湪鐨勫満鍚堬細
 * 璁╁姪鎵嬬収鐫€绱犳潗搴撻噷鐨勫浘缁х画鐢熸垚銆?
 *
 * 鏁板€兼帹瀵硷紙鍒啓姝诲氨瀹屼簨锛岀獥鍙ｄ竴鍙樺氨閿欎綅锛夛細
 *   璧勪骇搴?= right 16 + 瀹?320 鈫?鍗?绐楀彛-336 ~ 绐楀彛-16锛堢獥鍙?1584 鏃?1248~1568锛?
 *   鍔╂墜鍙宠竟缂樿鍋滃湪 1248 - 16(闂撮殭) = 1232
 *   CSS 鐨?right 瀹氫綅鐨勬槸**鍙?*杈圭紭 鈫?right = 绐楀彛瀹?- 1232 = 352px
 *
 * 鍔╂墜瀹藉害鐢?index.html 涓婄殑鍐呰仈 width:420px锛屾湰瑙勫垯涓嶈纰帮細
 * 鍐呰仈鏍峰紡鍘嬭繃浠讳綍閫夋嫨鍣紝杩欓噷鍐?width 鏄笉鐢熸晥鐨勶紙鍐欒繃浜嗭紝鐧藉啓锛夈€?
 */
body.assets-open #agentDrawer {
  right: 392px;
  width: min(520px, calc(100vw - 424px));
}

/* ---------- 璧勪骇搴撻潰鏉?---------- */

/**
 * 鐎戝竷娴併€?
 *
 * 涔嬪墠鏄?auto-fill + aspect-ratio:1 + object-fit:cover 鈥斺€?姣忓紶鍥鹃兘琚鎴?
 * 鍚屾牱澶у皬鐨勬鏂瑰舰锛屾í鍥惧彧鍓╀腑闂翠竴鏉★紝绔栧浘琚垏鎺変袱澶淬€傚垪琛ㄧ湅鐫€寰堟暣榻愶紝
 * 浣?*璁や笉鍑哄浘**锛氶€夌礌鏉愰潬鐨勫氨鏄竴鐪艰鍑哄唴瀹癸紝瑁佹病浜嗙瓑浜庢病鏈夈€?
 *
 * 鏀规垚鏍煎瓙楂樺害璺熺潃鍥剧墖鍘熷姣斾緥璧帮紝瀹屾暣鏄剧ず涓嶈鍒囥€?
 *
 * 涓轰粈涔堜笉鐢?CSS `columns`锛堝啓璧锋潵鏈€鐪佷簨锛夛細瀹冩槸銆屽厛鐏屾弧绗竴鍒楀啀鐏岀浜屽垪銆嶏紝
 * 绱犳潗鎸夋椂闂村€掑簭鎺掞紝鐢ㄦ埛浠庝笂寰€涓嬭锛岀涓€鍒楀嵈鏄法鏃堕棿鐨?鈥斺€?椤哄簭鏁翠釜鍙嶈繃鏉ャ€?
 * grid + JS 绠?span 鑳戒繚鎸併€屽厛妯悗绔栥€嶇殑姝ｅ父闃呰椤哄簭銆?
 *
 * 涓轰粈涔堢敤 grid-auto-rows: 0 + row-gap 鎾戦棿璺濓紝鑰屼笉鏄暀涓€鏉℃渶灏忚楂橈細
 * 鏍奸珮 = (span-1) 脳 rowGap锛屾墍浠ラ噺鍖栨闀垮氨鏄?rowGap(6px)銆?
 * 涓€鏃﹁楂樼暀浜?2px锛堟闀垮彉 8px锛夛紝6:1 鐨勬í鍥剧洰鏍囬珮搴︽墠 16px锛?
 * 璇樊灏卞崰鍒?60%锛堝疄娴?26px 瀵规湡鏈?16px锛夆€斺€?鐭浘鍏ㄦ槸绌虹櫧銆?
 *
 * 浠ｄ环鏄牸楂樺畬鍏ㄤ緷璧?JS 绠?span銆傛墍浠ヤ笅闈㈢粰浜嗕竴涓?CSS 鍏滃簳鍊硷紝
 * JS 娌¤窇璧锋潵鏃惰嚦灏戞樉绀烘垚涓€鏉″浐瀹氶珮搴︾殑鏍煎瓙锛岃€屼笉鏄暣鍧楃┖鐧姐€?
 */
.asset-grid {
  display: grid;
  /** 鍥哄畾涓夊垪锛屼笉鍐?auto-fill锛歛uto-fill 鐨勫垪鏁颁細闅忛潰鏉垮搴︽诞鍔?*/
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 0;
  column-gap: 6px; row-gap: 6px;
  padding: 10px;
  align-content: start;
  /**
   * 婊氬姩瀹瑰櫒閲屽繀椤荤粰纭畾鐨勫搴︺€?
   *
   * 鐖剁骇 .jobs-drawer 鏄?flex 鍒楀竷灞€锛宎sset-grid 鎷跨殑鏄?flex:1 鐨?*楂樺害**銆?
   * 娌℃湁 width 绾︽潫鏃讹紝1fr 鐨勫彲鐢ㄥ搴︾畻涓嶅嚭鏉ワ紝鏍煎瓙瀹藉害閫€鍖栨垚 0 鈥斺€?
   * 鏍煎瓙鏈夈€佸垪鏁板锛屽氨鏄粈涔堥兘鐪嬩笉瑙併€?
   */
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-y: auto;
  flex: 1;
}
/** 绌虹姸鎬佷笉鑳藉崰鐎戝竷娴佺殑涓€鏍?*/
.asset-grid > .job-empty { grid-column: 1 / -1; }

.asset-item {
  position: relative; border-radius: 10px;
  border: 1px solid var(--line); background: var(--soft); cursor: pointer;
  /** JS 娌¤窇鏃剁殑鍏滃簳楂樺害锛?30-1)脳6 = 174px銆俰nline style 浼氳鐩栧畠 */
  grid-row-end: span 30;
  /**
   * 鍒绘剰**涓?*鍐?overflow:hidden銆?
   *
   * 涔嬪墠瑁佸垏鏄负浜嗚鍥剧墖鑷繁璐寸潃鍦嗚銆傜幇鍦ㄥ渾瑙掍氦缁欏浘鐗囪嚜宸憋紙涓嬮潰閭ｆ潯锛夛紝
   * 鎹㈡潵鐨勬槸宸ュ叿鏉″彲浠ユ孩鍑烘牸瀛?鈥斺€?6:1 鐨勬墎鍥炬牸瀛愬彧鏈?18px 楂橈紝
   * 宸ュ叿鏉?24px锛岃鎺夌殑璇濄€屾樉绀轰笉鍏ㄣ€嶏紱涓嶈鐨勮瘽瀹冨彧鏄線涓婃帰鍑?6px锛?
   * 鑷冲皯鍥涗釜鎸夐挳鍏ㄩ兘鐐瑰緱鍒般€?
   */
  transition: border-color .14s var(--ease);
}
/**
 * 鎮仠鍙嶉鍙仛涓や欢浜嬶細鎻忚竟鍙樹寒 + 鍥剧墖鎻愪寒涓€鐐广€?
 *
 * 涔嬪墠杩欓噷杩樻湁 transform: scale(1.1)锛屽湪鐎戝竷娴侀噷鏄釜鏄庣‘鐨勯敊璇細
 * 鏍煎瓙楂樺害鏈潵灏变笉涓€锛堝疄娴?18 ~ 576px锛夛紝鏀惧ぇ 10% 鎰忓懗鐫€涓€涓?564px 鐨?
 * 绔栧浘寰€涓婂闀?28px锛岀洿鎺ュ帇浣忎笂闈㈤偅寮犲崱鐨勬暣鏉″伐鍏锋潯 鈥斺€?浜庢槸
 * 銆屾湁浜涘浘鐨勬寜閽樉绀轰笉鍏ㄣ€嶃€傝€屼笖鏍煎瓙涓€鍙樺ぇ锛屽厜鏍囦笅鐨勫厓绱犲氨鍦?
 * 鑷繁鍜岄偦灞呬箣闂存潵鍥炶烦锛宧over 鍙嶅寮€鍏筹紝宸ュ叿鏉°€岄棯涓€涓嬪氨娌°€嶃€?
 *
 * 鏀惧ぇ鎹笉鍥炲畾浣嶈兘鍔涳細宸ュ叿鏉′粠搴曢儴婊戝嚭鏈韩灏辨槸寰堝己鐨勪俊鍙枫€?
 */
.asset-item:hover { border-color: var(--strong); z-index: 2; }
.asset-item:hover > img, .asset-item:hover > video { filter: brightness(1.08); }
/**
 * contain 鑰岄潪 cover 鈥斺€?杩欏氨鏄€屽叏鏄俱€嶉偅涓や釜瀛椼€?
 *
 * span 鏄寜 API 杩斿洖鐨?width/height 绠楀嚭鏉ョ殑锛屾瘮渚嬫湰鏉ュ氨瀵癸紱
 * 鐪熷嚭鐜板亸宸紙鑰佺礌鏉愭病璁板昂瀵搞€佹瘮渚嬬畻閿欙級鏃跺畞鍙暀涓€鍦堢櫧杈癸紝
 * 涔熶笉鑳芥妸鍥捐鎺夛細瑁佹帀鐨勯偅閮ㄥ垎鐢ㄦ埛姘歌繙鐪嬩笉鍒颁簡銆?
 *
 * 鍦嗚鎸傚湪鍥剧墖鑷繁韬笂锛堝灞備笉瑁佸垏锛岃涓婇潰鐨?overflow 璇存槑锛夈€?
 */
.asset-item > img, .asset-item > video {
  width: 100%; height: 100%; object-fit: contain; display: block;
  border-radius: 9px;
}

.asset-drag-layer {
  position: absolute; inset: 0; z-index: 1;
  border-radius: 9px; cursor: grab;
}
.asset-item.dragging .asset-drag-layer { cursor: grabbing; }

/* 鎷栨嫿涓細鍗婇€忔槑 + 鎶撳彇鍏夋爣锛屾槑纭憡璇夌敤鎴枫€屾鍦ㄦ嫋璧般€?*/
.asset-item.dragging { opacity: .4; cursor: grabbing; }

/**
 * 鎷栨嫿骞界伒銆?
 *
 * 涔嬪墠鏄?setDragImage(cell, 40, 40)锛岀洿鎺ユ嬁缂╃暐鍥炬牸瀛愬綋骞界伒锛?
 * 缁撴灉娴忚鍣ㄧ粰鍑轰竴寮犲法澶х殑鍥剧墖铏氬奖锛氭棦鎸¤绾匡紝鍙堜笉杞诲阀銆?
 * 鎸¤绾跨殑浠ｄ环姣斻€屼笉澶熷ソ鐪嬨€嶄弗閲嶅緱澶?鈥斺€?鍏夋爣搴曚笅鏄粈涔堝畬鍏ㄧ湅涓嶈锛?
 * 浜庢槸姣忔閮借惤鍦ㄧ┖鐧藉锛屾嫋鎷藉彧鍓┿€屾柊寤哄崱鐗囥€嶄竴绉嶇粨鏋溿€?
 *
 * 鐜板湪涓撻棬閫犱竴涓?72px 鐨勫皬鍥撅紝鍍忎粠璧勬簮绠＄悊鍣ㄥ線妗岄潰鎷栭偅鏍枫€?
 *
 * `z-index` 蹇呴』鏄?90锛屼笉鑳芥槸 -1銆?
 * -1 浼氭妸骞界伒鐢╁埌椤甸潰鑳屾櫙灞?*涔嬩笅**锛氬畠浜庢槸涓嶈缁樺埗锛?
 * Chrome 缁?setDragImage 鎴埌涓€寮犵┖蹇収锛屽嵈**涓嶆姤浠讳綍閿?*锛?
 * 鐩存帴閫€鍥為粯璁ゅ菇鐏?鈥斺€?鑰岄粯璁ゅ菇鐏靛 <img> 灏辨槸鎸夊師濮嬪儚绱犲昂瀵哥敾鍑烘潵鐨勫ぇ鍥撅紝
 * 涔熷氨鏄€屾敼瀹屼箣鍚庤繕鏄法澶ц櫄褰便€嶈繖涓幇璞°€?
 *
 * 鏀惧湪宸︿笅瑙掕€屼笉鏄窡鐫€鍏夋爣锛屾槸鍥犱负骞界伒鏄嫋鎷?*寮€濮嬪墠**鎴殑涓€寮犻潤鎬佸揩鐓э紝
 * 涓嶄細璺熺潃榧犳爣璧帮紱鎽嗗湪浼氳鎷栧姩璺緞鎵繃鐨勪綅缃彧浼氫竴鐩寸鐪笺€?
 * z-index 90 鏄埢鎰忎綆浜?dropOverlay(100)锛氭嫋鎷芥椂鐢诲竷琚帇鏆楋紝
 * 骞界伒璺熺潃涓€璧锋殫涓嬪幓锛屼笉浼氭垚涓烘暣鍧楃敾闈㈤噷鏈€浜殑涓滆タ銆?
 */
.drag-ghost {
  position: fixed; left: 14px; bottom: 14px; z-index: 90;
  width: 72px; height: 72px; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  pointer-events: none;
}
.drag-ghost img, .drag-ghost video { width: 100%; height: 100%; object-fit: cover; display: block; }

/**
 * 鎷栨嫿鎮仠鍦ㄨ妭鐐逛笂銆?
 *
 * 鑺傜偣 zone 涓€鐩翠細缁?.node 鍔?.over锛屼絾鏍峰紡琛ㄩ噷**鏍规湰娌℃湁 .node.over 杩欐潯瑙勫垯**
 * 鈥斺€?鐬勫噯鍗＄墖鏃朵竴鐐瑰弽棣堥兘娌℃湁銆傜敤鎴锋病娉曞垽鏂€屾澗鎵嬫槸鍔犺繘杩欏紶鍗＄墖銆?
 * 杩樻槸銆屽湪鏃佽竟鏂板缓涓€寮犮€嶏紝浜庢槸瀹佸彲寰€绌虹櫧澶勪涪锛屾嫋鎷藉氨鍙墿鏂板缓涓€绉嶇粨鏋溿€?
 *
 * 绌烘€佺殑 .dropzone 鍙樹釜鑹蹭笉绠楀弽棣堬細閭ｅ彧鏄崱鐗囧唴閮ㄤ竴灏忓潡鍖哄煙锛?
 * 鑰岃妭鐐?zone 鐨勫懡涓寖鍥存槸鏁村紶鍗★紝涓よ€呰瑙変笂瀵逛笉涓娿€?
 */
.node.over {
  outline: 2px dashed var(--strong);
  outline-offset: 3px;
}
.node.over::after {
  content: '\677e\624b\52a0\8fdb\8fd9\5f20\5361\7247';
  position: absolute; left: 50%; top: 8px; z-index: 6;
  transform: translateX(-50%);
  padding: 4px 10px; border-radius: 999px;
  background: var(--strong); color: var(--strong-text);
  font-size: 10.5px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  pointer-events: none;
}

/**
 * 鎮仠璇︽儏娴眰銆?
 *
 * 瀹夸富鏄?body 鏈熬鐨?#assetPeek锛堜笉鍦ㄩ潰鏉块噷锛夆€斺€?
 * 鏀鹃潰鏉垮唴閮ㄤ細琚?.jobs-drawer 鐨?overflow:hidden 瑁佹帀锛?
 * 鑰屽畠鏈潵灏辫婧㈠嚭鍒扮敾甯冮偅涓€渚с€?
 *
 * 鍥哄畾瀹氫綅 + JS 瀹氫綅锛屼笉璺熺潃闈㈡澘婊氬姩璧帮細闈㈡澘涓€鍔ㄥ氨閲嶇畻澶绻侊紝
 * 鑰屼笖鐢ㄦ埛鎮仠鏃堕潰鏉挎湰鏉ュ氨涓嶈婊氥€?
 */
.asset-peek {
  position: fixed; z-index: 45;
  padding: 8px 10px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 12px 32px var(--shadow); backdrop-filter: blur(16px);
  font-size: 10px; font-weight: 600; color: var(--muted);
  pointer-events: none;
  opacity: 0; transition: opacity .12s var(--ease);
  max-width: 220px;
}
.asset-peek.on { opacity: 1; }
.asset-peek .pk-t { color: var(--text); font-weight: 800; margin-bottom: 3px; }
.asset-peek .pk-r { display: flex; gap: 6px; align-items: baseline; }
.asset-peek .pk-k { color: var(--faint); flex-shrink: 0; }
.asset-peek .pk-v { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/**
 * 缂╃暐鍥句笂鐨勬搷浣滄潯锛堟敹钘?/ 涓嬭浇 / 鍒犻櫎 / 娣诲姞鍒扮敾甯冿級銆?
 *
 * 涔嬪墠杩欏洓涓挳鍚勮嚜甯︿竴鏁翠覆鍐呰仈鏍峰紡锛坧osition/灏哄/鍦嗚/棰滆壊鍏ㄥ啓涓€閬嶏級锛?
 * 鍜屾爣棰樻爮閭ｆ帓鎸夐挳鏄袱濂楀昂瀵镐綋绯?鈥斺€?鍚屼竴涓潰鏉块噷涓ょ鎸夐挳瑙勬牸锛?
 * 鐪嬬潃灏辨槸銆屼笉鍗忚皟銆嶇殑涓昏鏉ユ簮銆傜幇鍦ㄧ粺涓€鍒拌繖涓€澶勩€?
 */
.asset-act {
  position: relative; width: 18px; height: 18px; flex: none;
  border-radius: 6px;
  background: rgba(20, 20, 24, .72);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(6px);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .14s var(--ease), background .14s var(--ease), transform .14s var(--ease);
}
.asset-act svg { width: 11px; height: 11px; }
.asset-act:hover { background: rgba(20, 20, 24, .92); transform: scale(1.12); }
.asset-act.danger:hover { background: var(--danger); }
.asset-act:disabled { opacity: .5; cursor: wait; }
/** 宸叉敹钘忕殑鏄熻甯镐寒 鈥斺€?鍚﹀垯鏀惰棌瀹屼竴灞忔槦鍏ㄦ槸鏆楃殑锛岀瓑浜庢病鏀惰棌 */
.asset-act[data-on] { color: #fbbf24; }

/**
 * 宸ュ叿鏉★細浠庢牸瀛愬簳閮ㄥ線涓婃粦鍑恒€?
 *
 * 闈㈡澘鏀跺埌 320px 鍚庢瘡鏍煎彧鏈?96px 瀹斤紝鑰屽洓涓挳涓€琛岃 4脳18+3脳2 = 78px 鈥斺€?
 * 鍐嶅姞涓€涓乏涓婅甯搁┗鐨勫嬀閫夋灏辨斁涓嶄笅浜嗐€傛墍浠ュ垎涓ゅ眰锛?
 *   鍕鹃€夋甯搁┗宸︿笂锛堥€夋病閫変腑蹇呴』涓€鐩寸湅寰楄锛屼笉鑳借棌杩?hover 閲岋級
 *   鍥涗釜鎿嶄綔閽斁杩涘伐鍏锋潯锛宧over 鎵嶄粠搴曢儴婊戝嚭鏉?
 *
 * 鐢?translateY(100%) 鑰屼笉鏄?opacity锛氭牸瀛愭槸 overflow:hidden 鐨勶紝
 * 銆岃棌鍦ㄦ牸瀛愬闈㈠啀婊戣繘鏉ャ€嶆墠鏄湡鐨勬诞鍑猴紝鍏夋贰鍏ョ殑璇濆儚鍥剧墖鑷繁鍙樹簡銆?
 * 宸ュ叿鏉″悓鏃?pointer-events:none锛屼笉鍗犵偣鍑伙紝榧犳爣涓嶅姩瀹冭嚜宸卞氨娑堝け銆?
 *
 * 宸茬煡鐨勫彇鑸嶏細宸ュ叿鏉￠珮 24px锛岄亣涓婂楂樻瘮瓒呰繃 4:1 鐨勬墎鍥撅紙鏍奸珮涓嶈冻 24px锛?
 * 浼氱洊婊℃暣鏍笺€傛牸瀛愬彧鏈変竴鏉＄紳閭ｄ箞澶ф椂锛屼换浣曡创杈瑰伐鍏锋潯閮芥斁涓嶄笅锛?
 * 鑰屼负瀹冨崟鐙璁′竴濂椾氦浜掍笉鍊煎緱 鈥斺€?杩欑被鍥惧湪绱犳潗搴撻噷鏈潵灏卞皯瑙侊紝
 * 鑰屼笖鎮仠璇︽儏娴眰锛堥潰鏉垮渚ч偅涓級鐓ф牱缁欏緱鍑哄叏閮ㄤ俊鎭€?
 */
.asset-tools {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; gap: 2px; align-items: center; justify-content: center;
  padding: 3px 2px;
  background: linear-gradient(transparent, rgba(12, 12, 16, .82) 40%);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform .16s var(--ease), opacity .16s var(--ease);
}
.asset-item:hover .asset-tools { transform: translateY(0); opacity: 1; pointer-events: auto; }
/* 宸ュ叿鏉￠噷鐨勬寜閽笉鍐嶅悇鑷欢杩熸樉闅?鈥斺€?鏁存潯涓€璧疯繘鍑猴紝閬垮厤閫愪釜闂?*/
.asset-tools .asset-act { opacity: 1; }

/** 鍕鹃€夋甯搁┗宸︿笂銆傚畠鍜屾搷浣滈挳鍏辩敤 .asset-act锛堝悓涓€濂楀昂瀵?鎮仠/杈规锛夛紝
    杩欓噷鍙ˉ浣嶇疆鍜屻€屼笉鍙?hover 鎺у埗銆嶇殑鏄鹃殣銆?*/
.asset-act.asset-pick { position: absolute; top: 4px; left: 4px; z-index: 4; opacity: .9; }
.asset-act.asset-pick:hover { opacity: 1; }
.asset-act.asset-pick.on { background: var(--strong); border-color: var(--strong); }

/**
 * 灏哄瑙掓爣銆?
 *
 * 涔嬪墠璐村湪搴曢儴锛岀幇鍦ㄥ伐鍏锋潯涔熶粠搴曢儴鏉?鈥斺€?涓や釜閮藉崰搴曢儴浼氫簰鐩稿帇浣忥紝
 * 鑰屼笖 hover 鏃跺伐鍏锋潯涓€婊戝嚭鏉ュ氨鎶婂昂瀵哥洊鎺変簡銆傛墍浠ヨ鏍囨敼鍒板彸涓婏紝
 * 閭ｉ噷鍙湁宸ュ叿鏉′笉浼氭潵锛堝畠浠庝笅寰€涓婏級銆?
 */
.asset-item .meta {
  position: absolute; top: 4px; right: 4px; padding: 2px 4px;
  border-radius: 5px;
  background: rgba(12, 12, 16, .62);
  color: #fff; font-size: 8.5px; font-weight: 700;
  opacity: 0; transition: opacity .14s;
  pointer-events: none;
}
.asset-item:hover .meta { opacity: 1; }

/* 鏀惰棌绛涢€夋寜閽殑閫変腑鎬侊細璺熷叾瀹冪瓫閫夋帶浠朵竴鑷达紝涓嶈兘鍙潬鍥炬爣鑷繁瑙ｉ噴 */
#assetFavOnlyBtn.active { color: var(--strong); border-color: var(--strong); }

/* ---------- 鎶樺彔寮忛珮绾у弬鏁?---------- */
.adv-toggle {
  margin-top: 8px; font-size: 10px; font-weight: 800; color: var(--faint);
  cursor: pointer; user-select: none; display: flex; align-items: center; gap: 4px;
  text-transform: uppercase; letter-spacing: .06em;
}
.adv-toggle:hover { color: var(--text); }
  /* 绠ご鐨勭ǔ瀹氬灞傦細lucide 浼氭妸閲岄潰鐨?<i> 鎹㈡垚 <svg>锛?
     鎵€浠ユ棆杞繀椤诲彂鐢熷湪杩欎釜 span 涓婏紝鑰屼笉鏄噷闈㈢殑鍥炬爣鍏冪礌銆?*/
  .adv-caret {
    display: inline-flex; align-items: center; justify-content: center;
    width: 11px; height: 11px; transition: transform .15s var(--ease);
  }
  .adv-caret svg, .adv-caret i { width: 11px; height: 11px; }
  .adv-panel { display: none; margin-top: 8px; flex-direction: column; gap: 8px; }
.adv-panel.open { display: flex; }

/* ---------- 灏哄閫夋嫨锛氶璁炬寜閽粍 ---------- */
.chip-row { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  height: 26px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--card-solid); color: var(--muted);
  font-size: 10px; font-weight: 800; cursor: pointer; transition: all .14s var(--ease);
}
.chip:hover { border-color: var(--strong); color: var(--text); }
.chip.active { background: var(--strong); color: var(--strong-text); border-color: var(--strong); }

/* ================================================================
   澹版槑寮忓瓧娈靛紩鎿庯紙web/js/nodes/fields.js锛夌殑鎺т欢鏍峰紡
   鎽樿琛岄粯璁ゆ姌鍙狅紝灞曞紑鎵嶅崰鍦版柟 鈥斺€?500 鑺傜偣鐨勭敾甯冩斁涓嶄笅灞曞紑鎬併€?
   ================================================================ */
.field-panel { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }

.field-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; padding: 5px 8px; border-radius: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card-solid);
  color: var(--muted); font-size: 10px; font-weight: 800; transition: all .14s var(--ease);
}
.field-summary:hover { border-color: var(--strong); color: var(--text); }
.field-sum-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-caret { width: 12px; height: 12px; flex: none; opacity: .5; }

.field-body { display: flex; flex-direction: column; gap: 19px; padding: 6px 2px 2px; }
.field-body .setting-row { gap: 8px; margin-bottom: 0; }
/* 参数行的标签：小、低对比、不抢控件；不要 base 里那套大写+宽字距 */
.field-body .setting-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 650;
  color: var(--muted);
  letter-spacing: .02em;
  text-transform: none;
}
/*
  「自定义档位」的出口（清晰度那种厂商档位表可能落后的地方）。
  它是一颗**文字按钮**，不是又一颗胶囊：胶囊会和上面的分段控件抢注意力，
  读起来像「还有一个档位」。这里刻意降到 faint、无边框，悬停才提亮。
*/
.control-stack { display: flex; flex-direction: column; gap: 7px; }
.field-body .chip.custom-toggle,
.field-groups .chip.custom-toggle {
  align-self: flex-start;
  height: 20px; padding: 0;
  border: 0; background: transparent;
  color: var(--faint); font-size: 10.5px; font-weight: 600;
  letter-spacing: .02em;
}
.field-body .chip.custom-toggle:hover,
.field-groups .chip.custom-toggle:hover { color: var(--text); border: 0; background: transparent; }
.field-body .chip.custom-toggle.active,
.field-groups .chip.custom-toggle.active { color: var(--text); border: 0; background: transparent; }

/* ---------- 鍒嗘鎺т欢锛氭瘮 chip 绱у噾锛岃璧锋潵鏄€屼竴涓帶浠剁殑鍑犵妗ｄ綅銆?---------- */
/*
  分段控件：一条轨道 + 一个滑块。

  以前是「几个各自变白的按钮」，三组参数叠在一起就是三块白补丁；
  而且 `.active` 用的是 --strong（深色主题下是纯白），一眼看过去
  整块面板最亮的地方是某个档位，而不是标题。现在：

    · 轨道只比卡片深一点点，选中块用 --text 的 10% 做低对比填充
    · 选中块是**同一个元素**平移过去（--seg-i），不是每段自己亮
    · 段与段等宽（grid 等分），不会因为文字长短参差

  --seg-n / --seg-i 由 fields.js 里 paintSegThumb 写进来。
*/
.seg-row {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.seg-thumb {
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px - (var(--seg-n, 1) - 1) * 4px) / var(--seg-n, 1));
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--text) 26%, transparent);
  background: color-mix(in srgb, var(--text) 12%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent);
  transform: translateX(calc(var(--seg-i, 0) * (100% + 4px)));
  transition: transform .18s var(--ease);
  pointer-events: none;
}
.seg {
  position: relative; z-index: 1;
  height: 36px; min-width: 0;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: color .14s var(--ease);
}
.seg:hover { color: var(--text); }
.seg.active { color: var(--text); font-weight: 700; }
/* 场景面板自己有一套渐变选中态，不要再叠一层滑块 */
.scene-panel-fields .seg-thumb,
.node-panel.is-panorama .seg-thumb { display: none; }

/* ---------- 妗ｄ綅闄勬敞锛堜粯璐?/ 鎸夋璁¤垂锛?----------
   鎸傚湪妗ｄ綅鎸夐挳閲岃€屼笉鏄爣棰樹笂锛氬杩涙爣棰樹細璁╄繖涓€妗ｇ湅璧锋潵鏇撮暱锛?
   鑰屽畠鍙槸鏇磋吹銆佷笉鏄洿澶嶆潅銆?*/
.opt-note {
  font-size: 8px; font-weight: 700; letter-spacing: .02em;
  opacity: .72; line-height: 1; white-space: nowrap; pointer-events: none;
}
.seg.has-note {
  height: auto; min-height: 30px; padding: 3px 5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  /* 鏁板瓧浠嶆槸涓讳綋锛屽瓧閲嶅帇鍥炲幓涓€鐐癸紝鍏嶅緱鍜岄檮娉ㄦ姠 */
  font-size: 11px;
}
.chip.has-note {
  display: flex; align-items: center; gap: 4px;
}
/* 閫変腑鎬佷笅闄勬敞瑕佷粛鐒跺彲璇伙細--strong-text 鏄櫧瀛楋紝鍘嬪埌 .72 杩樿兘鐪嬫竻锛?
   鍐嶅帇灏辩硦浜?鈥斺€?杩欒濡傛灉鏄负浜嗐€屾贰闆呫€嶈€岀壓鐗插彲璇绘€э紝閭ｄ笉濡備笉鍋氳繖涓檮娉ㄣ€?*/
.seg.active .opt-note, .chip.active .opt-note { opacity: .8; }

/* ---------- 寮€鍏?---------- */
.switch {
  width: 34px; height: 19px; padding: 2px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--card-solid);
  display: inline-flex; align-items: center; transition: all .16s var(--ease);
}
.switch.on { background: var(--strong); border-color: var(--strong); }
.switch-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--muted); transition: transform .16s var(--ease), background .16s var(--ease);
}
.switch.on .switch-dot { transform: translateX(15px); background: var(--strong-text); }

/* ---------- 婊戝潡 ---------- */
/*
  数值控件：分页滑杆 + 数字框 + 发丝刻度。

  刻度是这一版的关键：只有数字时，10 个数字像 10 个漂浮的标签；
  加上每秒一根 3px 细线之后，那一行变成了尺子 —— 滑杆、滑块、刻度
  共用同一条基准线，位置一眼可读。线只分三层（普通 / 5 秒长线 / 当前值），
  高度和亮度不同，颜色种类不变，所以 10 根并排也不会显得吵。
*/
.range-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: start;
  min-width: 0;
}
.range-slider { min-width: 0; }
.range-track {
  position: relative;
  height: 18px;
  margin-top: 6px;          /* 与右侧 30px 数字框垂直居中 */
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.range-track::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 7px;
  height: 4px; border-radius: 2px;
  background: var(--line);
}
/*
  键盘焦点只落在**滑块**上，不给整条轨道画框。

  之前是 `.range-track:focus-visible { outline: … }`，结果鼠标点一下滑杆
  （程序化 focus 也被判定成 focus-visible）轨道外面就多出一条边线 ——
  设计稿里没有它，看起来像整个控件被选中。现在只在键盘进入时
  给拇指加一圈极淡的光环，既有可见焦点，又不改变布局。
*/
.range-track:focus { outline: none; }
.range-track:focus-visible .range-thumb {
  box-shadow:
    0 0 0 3px var(--card-solid),
    0 0 0 5px color-mix(in srgb, var(--text) 20%, transparent);
}
.range-fill {
  position: absolute; left: 0; top: 7px;
  width: 0; height: 4px; border-radius: 2px;
  background: color-mix(in srgb, var(--text) 52%, transparent);
  pointer-events: none;
}
.range-thumb {
  position: absolute; top: 2px; left: 0;
  width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--card-solid);
  pointer-events: none;
}
.range-num {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  width: 44px; height: 30px; padding: 0 6px; flex: none;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card-solid);
}
/*
  ⚠️ 选择器要写到 `.range-field .range-num input[type=number]` 这一级：
  base.css 里有一条 `input:not([type=checkbox]):not([type=radio])` 的全局规则
  （判定权 0,2,1），只写 `.range-num input`（0,1,1）会被它盖掉 ——
  数字框会长出边框、圆角和 10px 内边距，看起来像一个独立的胶囊。

  宽度由 JS 按位数写成 `nch`，配合居中对齐，让「5s」「16s」永远整体居中：
  固定 28px 宽再右对齐的话，一位数会被推到右边，左边空一大块 ——
  那正是「数字看起来没居中」的来源。
*/
.range-field .range-num input[type="number"] {
  width: 1ch; min-width: 0; min-height: 0; height: 18px;
  border: 0; padding: 0;
  background: transparent; color: var(--text);
  font: inherit; font-size: 11.5px; font-weight: 700;
  text-align: center; outline: none; line-height: 1;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}
.range-num input::-webkit-outer-spin-button,
.range-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.range-unit {
  font-style: normal; font-size: 9.5px; font-weight: 650;
  line-height: 1;
  color: var(--muted);
}
.range-ticks {
  position: relative;
  height: 25px;
  margin-top: 6px;
}
.range-tick {
  position: absolute; top: 0;
  width: 1px; height: 3px;
  background: color-mix(in srgb, var(--text) 14%, transparent);
  transform: translateX(-.5px);
}
.range-tick.major { height: 5px; background: color-mix(in srgb, var(--text) 30%, transparent); }
.range-tick.active { height: 6px; background: var(--text); }
.range-lbl {
  position: absolute; top: 9px;
  color: var(--faint); font-size: 9.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  transform: translateX(-50%);
}
.range-lbl.active { color: var(--text); font-weight: 750; }

/* ---------- 鍥惧舰鍖栨瘮渚嬫柟妗?----------
   鎸夌湡瀹炲楂樻瘮鐢诲皬鐭╁舰锛氫汉鐪间笉鐢ㄨ鏂囧瓧灏辫兘璁ゅ嚭銆岀珫鏋勫浘銆嶃€?
   shape 鐢?aspect-ratio锛屼笉闇€瑕?JS 娴嬮噺銆?*/
/*
  比例网格：**等大格子**。

  以前每个格子的外框按真实宽高比撑开，于是 1:1 是方墩、21:9 是细条，
  整排底端参差。现在外框统一高度、统一宽度（grid 等分），
  只有里面的小图形按比例变化 —— 既能「看图选比例」，又整齐。
  「自定义」是这一排的最后一格，不再单独掉到下一行。
*/
.ratio-grid {
  display: grid;
  grid-template-columns: repeat(var(--ratio-cols, 7), minmax(0, 1fr));
  gap: 5px;
}
.ratio-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  height: 61px; padding: 0 2px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card-solid);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.ratio-box:hover { border-color: var(--line-2); color: var(--text); }
.ratio-box.active {
  border-color: color-mix(in srgb, var(--text) 26%, transparent);
  background: color-mix(in srgb, var(--text) 9%, transparent);
  color: var(--text);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent);
}
/* 鎵€鏈夋柟妗嗘寜鍚屼竴銆岄潰绉€嶇缉鏀撅紝鍚﹀垯 1:1 浼氭瘮 21:9 鐨勭粏鏉￠噸寰楀 */
.ratio-shape {
  display: block;
  border: 1.5px solid currentColor; border-radius: 2px;
  opacity: .75;
}
.ratio-box.active .ratio-shape { opacity: 1; }
.ratio-shape.is-custom {
  width: 18px !important; height: 18px !important;
  border-style: dashed; opacity: .6;
  position: relative;
}
.ratio-shape.is-custom::before,
.ratio-shape.is-custom::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 8px; height: 1px; margin: -.5px 0 0 -4px;
  background: currentColor;
}
.ratio-shape.is-custom::after { transform: rotate(90deg); }
.ratio-cap { font-size: 10px; font-weight: 650; white-space: nowrap; }

/* 自定义尺寸：原地展开，占满整行；卡片跟着长高，不压缩上面的行 */
.ratio-dims {
  grid-column: 1 / -1;
  margin-top: 1px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}
.ratio-dims-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 10px; font-weight: 650;
}
.ratio-dims-range { font-variant-numeric: tabular-nums; }
.ratio-dims-row { display: flex; align-items: center; gap: 8px; }
.ratio-input,
.ratio-dims .ratio-input[type="number"] {
  width: 78px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card-solid); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 650;
  font-variant-numeric: tabular-nums;
  outline: none;
  appearance: textfield;
}
.ratio-input::-webkit-outer-spin-button,
.ratio-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ratio-input:focus { border-color: color-mix(in srgb, var(--text) 34%, transparent); }
.ratio-times { color: var(--faint); font-size: 12px; }
.ratio-lock {
  margin-left: auto;
  height: 30px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 11px; font-weight: 650;
  cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.ratio-lock:hover { color: var(--text); border-color: var(--line); }
.ratio-lock.on {
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
  background: color-mix(in srgb, var(--text) 9%, transparent);
}

/* ---------- 绌虹姸鎬?---------- */
.empty-state {
  padding: 26px 14px; text-align: center;
  color: var(--faint); font-size: 11px; font-weight: 700; line-height: 1.7;
}
.empty-state svg { width: 26px; height: 26px; opacity: .45; margin-bottom: 6px; }

/* ---------- 鐘舵€佹爮 ---------- */
.statusbar {
  position: absolute; left: 80px; bottom: 16px; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 8px 24px var(--shadow); backdrop-filter: blur(16px);
  font-size: 10px; font-weight: 700; color: var(--muted);
}
.statusbar .sep { width: 1px; height: 11px; background: var(--line); }
.statusbar b { color: var(--text); font-weight: 800; }

/* 杩愯鐘舵€佺嫭绔嬫垚涓€涓Ы浣嶏細涔嬪墠瀹冨拰淇濆瓨鐘舵€佹姠鍚屼竴涓妭鐐癸紝
   銆屽凡淇濆瓨銆嶄細琚€? 涓繍琛屼腑銆嶈鐩栵紝鍙嶄箣浜︾劧 */
.statusbar .status-slot {
  color: var(--strong); font-weight: 800;
  white-space: nowrap;
}
.statusbar #stSave { white-space: nowrap; }
.statusbar #stSave[style*="cursor: pointer"] { text-decoration: underline dotted; }

/* ---------- 婊氬姩鏉★紙瑕嗙洊鍘熷瀷鐨?5px锛屽獟浣撳尯闇€瑕佹洿鍙偣锛?---------- */
.prop-body::-webkit-scrollbar, .llm-chat::-webkit-scrollbar,
.modal-body::-webkit-scrollbar, .picker-list::-webkit-scrollbar,
.jobs-list::-webkit-scrollbar { width: 7px; }
/* ---------- 鍚姩澶辫触鍏滃簳 ---------- */
.boot-error {
  max-width: 560px; margin: 48px auto; padding: 24px 28px;
  background: var(--card-solid); border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  border-radius: 16px; box-shadow: 0 16px 44px var(--shadow);
}
.boot-error h3 { margin: 0 0 8px; font-size: 15px; color: var(--danger); }
.boot-error p { margin: 0 0 14px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.boot-error pre {
  margin: 0 0 16px; padding: 10px 12px; max-height: 180px; overflow: auto;
  background: var(--soft); border-radius: 10px;
  font-size: 11px; color: var(--text); white-space: pre-wrap; word-break: break-all;
}
.boot-error-actions { display: flex; gap: 8px; }
.boot-error-actions .btn { height: 30px; padding: 0 16px; }

/* ---------- 绌虹敾甯冨紩瀵?---------- */
/* 鏀惧湪宸︿笂瑙掕€屼笉鏄睆骞曚腑蹇冿細
   灞呬腑鐨勫崱鐗?520px 瀹戒細閬綇鐢诲竷涓ぎ閭ｅ潡鍖猴紝鑰岄偅閲屾濂芥槸鑺傜偣鍜屾嫋绾胯惤鐐规渶甯哥敤鐨勪綅缃€?   pointer-events:none 鍙兘淇濇姢鍗＄墖涔嬪鐨勫尯鍩燂紝鍗＄墖鑷韩浠嶄細閬綇瀹冭鐩栫殑閭ｅ潡銆?*/
.empty-guide {
  position: absolute; left: 72px; top: 72px; z-index: 6;
  max-width: 380px;
  pointer-events: none;
}
.empty-guide-card {
  pointer-events: auto;
  padding: 20px 22px; text-align: left;
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: 0 24px 64px var(--shadow);
}
.empty-guide-card h2 { margin: 0 0 8px; font-size: 17px; color: var(--text); }
.empty-guide-card p { margin: 0 0 20px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.empty-guide-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.empty-guide-actions .btn { height: 32px; padding: 0 16px; }
.empty-guide-actions .btn.primary { border-color: var(--strong); color: var(--strong); }
.empty-guide-tips {
  margin: 0; padding: 16px 0 0; list-style: none;
  border-top: 1px solid var(--line);
  text-align: left;
}
.empty-guide-tips li {
  font-size: 11px; color: var(--faint); line-height: 1.9;
}
.empty-guide-tips b { color: var(--muted); }

/* ---------- 鑺傜偣鐘舵€侊細璀﹀憡 ---------- */
/* 杩愯鎴愬姛浣嗘湁鍙傛暟鏈敓鏁堬紝涓嶈兘鐢ㄧ豢鑹层€屽畬鎴愩€嶇洊杩囧幓 */
.node.state-warn .node-status-slot .msg,
.node-status-slot.state-warn .msg { color: var(--warning); }
.node.state-warn .node-status { border-color: var(--warning); }
.node-status-slot.warn .txt { color: var(--warning); }

/* ---------------- 鎵归噺鍙傛暟闈㈡澘 ---------------- */
.batch-target {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 8px;
  margin-bottom: 10px;
  background: var(--strong);
  border-radius: 6px;
}
.batch-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 14px 8px;
  text-align: center;
  line-height: 1.7;
}
/* 鍙栧€间笉涓€鑷寸殑鎻愮ず锛氱揣璐村畠涓婇潰閭ｄ釜瀛楁锛屼綅缃浐瀹氫笉璺冲姩 */
.batch-mixed {
  font-size: 11px;
  color: var(--warning);
  margin: -6px 0 8px;
  padding-left: 2px;
}

/* ---------------- 鐢诲竷鍗＄墖鍙充笂瑙掓寜閽粍 ----------------
   鍒犻櫎鍦?right:8銆侀噸鍛藉悕鍦?right:40锛坆ase.css 閲屽凡鏈夛級锛?   杩欓噷琛ヤ笂銆屽鍒躲€嶄笌銆屽鍑恒€嶁€斺€?澶嶅埗鎸夐挳姝ゅ墠瀹屽叏娌℃湁鏍峰紡锛?   涔熷氨鏄閭ｄ釜鎸夐挳浠庢潵娌¤姝ｇ‘瀹氫綅杩囥€?*/
.canvas-card-copy {
  position: absolute;
  right: 72px;
  top: 8px;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--card-solid);
  border: 1px solid var(--line);
  opacity: 0;
  transition: all .14s var(--ease);
  z-index: 2;
}
.canvas-item:hover .canvas-card-copy { opacity: 1; }
.canvas-card-copy:hover { color: var(--text); background: var(--soft-2); }
.canvas-card-copy svg { width: 14px; height: 14px; }

.canvas-card-export {
  position: absolute;
  right: 104px;
  top: 8px;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--card-solid);
  border: 1px solid var(--line);
  opacity: 0;
  transition: all .14s var(--ease);
  z-index: 2;
}
.canvas-item:hover .canvas-card-export { opacity: 1; }
.canvas-card-export:hover { color: var(--text); background: var(--soft-2); }
.canvas-card-export svg { width: 14px; height: 14px; }

/* ---------------- Civitai 妯″瀷淇℃伅鍗?---------------- */
.civitai-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.civitai-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}
.civitai-ckpt {
  font-family: var(--mono, monospace);
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
}
.civitai-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.civitai-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.civitai-name:hover { text-decoration: underline; }
.civitai-meta,
.civitai-stats,
.civitai-words,
.civitai-rec {
  font-size: 11px;
  color: var(--muted);
}
.civitai-rec { color: var(--text); }
/* 杩炰笉涓婁笌銆屾煡涓嶅埌銆嶈涓€鐪煎彲杈細杩欐槸涓ょ瀹屽叏涓嶅悓鐨勫師鍥?*/
.civitai-warn {
  font-size: 11px;
  color: var(--warning);
  line-height: 1.6;
}

/* ---- 钂欑増缂栬緫鍣?---- */
.mask-editor { display: flex; flex-direction: column; gap: 10px; }
.mask-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mask-label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.mask-label.grow { margin-left: auto; }
.mask-size { width: 160px; }
/* stage 閲屼笁灞傜紶鍦ㄥ悓涓€浣嶇疆锛氬簳鍥?/ 绾㈢僵 / 鐢诲竷 */
.mask-stage { position: relative; display: inline-block; line-height: 0;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  max-width: 100%; background: repeating-conic-gradient(#2a2a2a 0 25%, #333 0 50%) 0 0/16px 16px; }
.mask-stage > img, .mask-stage > canvas {
  display: block; max-width: 100%; height: auto; }
/* 鐢诲竷鍦ㄦ渶涓婂眰锛屾墠鑳芥帴鍒版墜鍐欎簨浠?*/
.mask-stage > canvas.mask-canvas { position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: crosshair; touch-action: none; }
.mask-stage > canvas.mask-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mask-status { font-size: 12px; color: var(--text-dim); min-height: 1.2em; }
.mask-note { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.btn.mini.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.mask-chip { display: flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 11px; color: var(--text-dim); }

/* ---- 鍥剧墖鑺傜偣锛氬簳鍥?/ 鍙傝€冩爣娉?---- */
/* 鏍囨敞蹇呴』姣斿簭鍙锋洿鐪兼墠锛屽惁鍒欏鍥炬椂闅句互鎵竴鐪肩湅鍑哄摢寮犺鍑哄浘 */
.img-role {
  position: absolute; left: 3px; bottom: 3px;
  font-size: 9px; line-height: 1.4; padding: 0 4px;
  border-radius: 4px; cursor: pointer;
  background: rgba(16, 185, 129, .92); color: #04140d; font-weight: 800;
  border: none; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
/* 鍙傝€冨浘锛氬急鍖栬壊锛屼笌搴曞浘褰㈡垚瀵规瘮 */
.img-role.is-ref { background: rgba(120, 120, 140, .82); color: #e9e9f2; }
.img-role:hover { filter: brightness(1.15); }

/* ---- 缁撴灉鏍兼潵婧愯鏍囷紙閫愬紶 1:1锛?---- */
/* 蹇呴』涓?.idx 鍒嗗乏鍙筹細鍙充笅瑙掑凡缁忔湁 鈽?涓诲浘鍜屾搷浣滄潯 */
.src-badge {
  position: absolute; right: 3px; bottom: 3px;
  font-size: 9px; line-height: 1.4; padding: 0 4px;
  border-radius: 4px; font-weight: 800;
  background: rgba(99, 102, 241, .92); color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* ================================================================
   姹囨姤 PPT 鎶藉眽
   ----------------------------------------------------------------
   棰勮鍖烘槸銆屾墍瑙佸嵆鎵€寰椼€嶇殑涓€閮ㄥ垎锛屾墍浠ヨ繖閲岀殑鏍峰紡鍙奖鍝?chrome
   锛堣竟妗嗐€侀棿璺濄€佹粴鍔級锛?*缁濅笉纰?.deck-page 鍐呴儴**鈥斺€?   閭ｄ簺鍧愭爣蹇呴』涓庡鍑?PPTX 鏃堕€愮偣涓€鑷淬€?   ================================================================ */
.deck-drawer { max-height: calc(100vh - 96px); }

/* ---------- 绗竴姝ワ細闇€姹?+ 妯″瀷 + 閫夊浘 ---------- */
.deck-setup {
  padding: 10px 14px 14px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.deck-setup[hidden] { display: none; }
.deck-brief {
  width: 100%; resize: vertical; min-height: 62px;
  font-family: inherit; line-height: 1.5;
}
.deck-picked {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 6px; margin-bottom: 8px;
}
.deck-pick {
  position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: var(--soft);
}
.deck-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-pick.is-bad { outline: 1px dashed var(--danger); }
/* 搴忓彿瀵瑰簲鎻愮ず璇嶉噷鐨勩€岀 N 寮犲浘銆嶏紝妯″瀷鏄寜杩欎釜缂栧彿鍥炵瓟鐨?*/
.deck-pick-no {
  position: absolute; left: 3px; bottom: 3px;
  padding: 0 4px; border-radius: 4px;
  background: rgba(0,0,0,.62); color: #fff;
  font-size: 9px; font-weight: 800;
}
.deck-pick-x {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,.9);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .14s;
}
.deck-pick:hover .deck-pick-x { opacity: 1; }
.deck-pick-x svg { width: 10px; height: 10px; }
.deck-pick-x:hover { color: var(--danger); border-color: var(--danger); }
.deck-pick-actions { display: flex; gap: 6px; }
.deck-pick-actions .btn { flex: 1; justify-content: center; }
.deck-pick-actions .btn svg { width: 13px; height: 13px; }
/* 鐢诲竷涓婄‘瀹炴湁閫変腑鍥剧墖鏃舵墠鎻愮ず锛岄伩鍏嶇敤鎴风偣浜嗘墠鐭ラ亾鏄┖鐨?*/
.deck-pick-actions .btn.has-pick { border-color: var(--strong); color: var(--strong); }
.deck-generate { width: 100%; justify-content: center; padding: 9px; }
.deck-generate svg { width: 14px; height: 14px; }

.deck-busy {
  font-size: 11px; color: var(--muted);
  text-align: center; padding: 2px 0;
}
.deck-busy[hidden] { display: none; }
.deck-generate.is-busy { opacity: .6; cursor: progress; }

/* ---------- 绗簩姝ワ細棰勮 + 瀵硅瘽 ---------- */
.deck-work { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.deck-work[hidden] { display: none; }
.deck-pages-wrap {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; padding: 10px 0 10px 0;
  background: var(--soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.deck-pages {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 0 12px;
}
.deck-status {
  font-size: 10.5px; color: var(--muted);
  padding: 5px 14px; border-bottom: 1px solid var(--line);
}
.deck-status.is-warn { color: var(--danger); }
.deck-talk { padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 7px; }
.deck-chat {
  max-height: 168px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 7px;
}
.deck-msg {
  font-size: 11.5px; line-height: 1.55;
  padding: 7px 9px; border-radius: 9px;
  background: var(--card-solid); border: 1px solid var(--line);
  align-self: stretch;
}
.deck-msg.is-user { background: var(--strong); color: #fff; border-color: transparent; }
.deck-reasons {
  margin: 5px 0 0; padding-left: 15px;
  font-size: 10.5px; color: var(--muted); line-height: 1.5;
}
.deck-msg.is-user .deck-reasons { color: rgba(255,255,255,.85); }
.deck-reasons.is-warn { color: var(--danger); }
.deck-reasons.is-muted { opacity: .75; }

/* ---------- 妯″瀷閫夋嫨鍣?----------
   娓犻亾閲岄厤濂界殑瀵硅瘽妯″瀷瀹炴祴鏈夊嚑鐧句釜锛屽師鐢?<select> 鏃㈡悳涓嶄簡
   涔熺湅涓嶅嚭鍝釜鑳借鍥撅紝鎵€浠ョ敤銆岃緭鍏ユ + 鍊欓€夊垪琛ㄣ€嶃€?*/
.deck-model-list {
  margin-top: 4px; max-height: 216px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); box-shadow: 0 8px 24px var(--shadow);
}
.deck-model-list[hidden] { display: none; }
.deck-model {
  padding: 6px 9px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  border-bottom: 1px solid var(--line);
}
.deck-model:last-child { border-bottom: none; }
.deck-model:hover { background: var(--hover); }
.deck-model.is-picked { background: color-mix(in srgb, var(--strong) 14%, transparent); }
.deck-model-name {
  font-size: 11.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.deck-model-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.deck-model-tag {
  font-size: 9px; padding: 0 5px; border-radius: 4px;
  background: var(--soft); color: var(--muted); border: 1px solid var(--line);
}
/* 鍙鍥惧崟鐙爣鍑烘潵锛歅PT 閫夐敊妯″瀷鐨勪唬浠锋槸銆屼粯浜嗛挶浣嗘病鐪嬪浘銆?*/
.deck-model-tag.is-vision {
  background: color-mix(in srgb, var(--strong) 18%, transparent);
  color: var(--strong); border-color: transparent; font-weight: 700;
}
.deck-model-empty {
  padding: 9px 10px; font-size: 11px; color: var(--muted); line-height: 1.5;
}

/* ---------- 澶х翰锛堢洿鎺ユ墜鏀癸紝涓嶇粡杩?AI锛?--------- */
.deck-outline {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.deck-outline[open] { background: var(--soft); }
.deck-outline-sum {
  padding: 7px 14px; cursor: pointer; user-select: none;
  font-size: 11.5px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.deck-outline-sum svg { width: 13px; height: 13px; color: var(--muted); }
.deck-outline-sum span { margin-left: auto; font-weight: 600; color: var(--muted); }
.deck-outline-list {
  max-height: 260px; overflow-y: auto;
  padding: 4px 10px 8px;
  display: flex; flex-direction: column; gap: 7px;
}
.deck-outline-row {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 8px;
  display: flex; flex-direction: column; gap: 5px;
}
.deck-outline-head { display: flex; align-items: center; gap: 5px; }
.deck-outline-no {
  width: 18px; height: 18px; border-radius: 5px; flex: none;
  background: var(--strong); color: #fff;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.deck-outline-layout {
  flex: 1; min-width: 0;
  font-size: 11px; padding: 2px 4px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--card-solid); color: var(--text);
}
.deck-outline-move, .deck-outline-del {
  width: 20px; height: 20px; flex: none; border-radius: 5px;
  border: 1px solid var(--line); background: var(--card-solid);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.deck-outline-move svg, .deck-outline-del svg { width: 12px; height: 12px; }
.deck-outline-move:hover, .deck-outline-del:hover {
  color: var(--strong); border-color: var(--strong);
}
.deck-outline-del:hover { color: var(--danger); border-color: var(--danger); }
/* 鍙墿涓€椤垫椂鍒犳寜閽疆鐏帮紝鑰屼笉鏄偣浜嗘墠鍛婅瘔鐢ㄦ埛涓嶈兘鍒?*/
.deck-outline-del:disabled { opacity: .35; cursor: not-allowed; }
.deck-outline-input, .deck-outline-bullets {
  width: 100%; font-size: 11.5px; line-height: 1.5;
  padding: 4px 6px; border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card-solid); color: var(--text);
  font-family: inherit; resize: vertical;
}
.deck-outline-input:focus, .deck-outline-bullets:focus {
  outline: none; border-color: var(--strong);
}
.deck-outline-input.is-quiet { font-size: 10.5px; color: var(--muted); }
.deck-outline-foot {
  padding: 6px 12px 9px;
  display: flex; align-items: center; gap: 8px;
}
.deck-outline-foot .btn svg { width: 12px; height: 12px; }

/* ================================================================
   鍔╂墜闄勪欢锛堝洖褰㈤拡 / 鎷栨嫿 / 绮樿创锛?   ----------------------------------------------------------------
   鐩爣鏄€屽儚璞嗗寘涓€鏍锋妸鍥句涪杩涘璇濇銆嶏紝鎵€浠ヤ笁涓叆鍙ｇ殑瑙嗚鍙嶉
   蹇呴』涓€鑷达細寰呭彂闄勪欢銆佹皵娉″洖鏄俱€佹嫋鎷介珮浜€?   ================================================================ */

/* 鍥炲舰閽堟寜閽細鍜屽叾浠栨寜閽悓楂橈紝鍙槸娌℃湁鏂囧瓧 */
.btn.icon-only {
  width: 30px; padding: 0; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.btn.icon-only svg { width: 15px; height: 15px; }
.btn.icon-only:disabled { opacity: .5; cursor: progress; }

/* 寰呭彂閫侀檮浠舵潯 */
.agent-attach-strip {
  display: flex; flex-wrap: nowrap; gap: 4px; min-width: 0;
  max-width: 300px; overflow-x: auto; scrollbar-width: none;
  padding: 0;
}
.agent-attach-strip::-webkit-scrollbar { display: none; }
.agent-attach-strip[hidden] { display: none; }
.agent-attach {
  position: relative; flex: none;
  width: 34px; height: 34px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: var(--soft);
  cursor: pointer;
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.agent-attach:hover { border-color: var(--strong); transform: scale(1.08); }
.agent-attach img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agent-attach.is-bad { outline: 1px dashed var(--danger); }
.agent-attach-file {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.agent-attach-file svg { width: 18px; height: 18px; }
/* 鏂囦欢鍚嶅帇鍦ㄥ簳閮細鍥剧墖闈犵缉鐣ュ浘璁わ紝鏂囦欢鍙兘闈犲悕瀛楄 */
.agent-attach-name { display: none; }
.agent-attach-no {
  position: absolute; left: 2px; bottom: 2px;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 999px; background: var(--strong); color: var(--strong-text);
  font-size: 8.5px; font-weight: 800; line-height: 14px; text-align: center;
  pointer-events: none;
}
.agent-attach-x {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,.92);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .14s;
}
.agent-attach:hover .agent-attach-x { opacity: 1; }
.agent-attach-x svg { width: 10px; height: 10px; }
.agent-attach-x:hover { color: var(--danger); border-color: var(--danger); }

/* 鎷栨嫿鎮仠锛氭暣鍧楅潰鏉挎弿杈癸紝涓嶅彧鏄緭鍏ユ 鈥斺€?   鐢ㄦ埛鏄線闈㈡澘閲屼涪鐨勶紝鍏夐珮浜緭鍏ユ浼氳浜轰互涓哄彧鎺ュ彈閭ｉ噷 */
#agentDrawer.is-dropping {
  outline: 2px dashed var(--strong);
  outline-offset: -3px;
}
#agentDrawer.is-dropping::after {
  content: '\677e\624b\5c31\52a0\8fdb\6765';
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  padding: 8px 16px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--strong);
  color: var(--strong); font-size: 12px; font-weight: 700;
  pointer-events: none; z-index: 5;
  box-shadow: 0 8px 24px var(--shadow);
}
#agentDrawer.is-dropping > * { opacity: .35; }

/* 姘旀场閲岀殑闄勪欢锛氶潪鍥剧墖瑕佽兘鐪嬪嚭鏄枃浠讹紝涓旀湁鍚嶅瓧 */
.llm-bubble-cell .agent-attach-file { height: 62px; }
.llm-bubble-cell .agent-attach-name {
  position: static; display: block;
  background: none; color: var(--muted);
  font-size: 9px; padding: 2px 2px 0;
  white-space: normal; word-break: break-all;
  text-align: center;
}
.llm-bubble-bad {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--danger);
  background: var(--danger-bg);
}

/* ---------- 鏂囩鍒囨崲锛堝浠界鐞嗭級---------- */
.deck-switch {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 800; color: var(--text);
  padding: 2px 4px; border-radius: 6px;
  max-width: 260px; min-width: 0;
}
.deck-switch:hover { background: var(--hover); }
.deck-switch span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.deck-switch svg { width: 13px; height: 13px; color: var(--muted); flex: none; }
.deck-switch-list {
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  max-height: 300px; overflow-y: auto;
  padding: 5px 8px 7px;
  display: flex; flex-direction: column; gap: 3px;
}
.deck-switch-list[hidden] { display: none; }
.deck-switch-row {
  display: flex; align-items: center; gap: 3px;
  border-radius: 8px; padding: 1px 2px 1px 0;
}
.deck-switch-row:hover { background: var(--hover); }
/* 褰撳墠杩欎竴浠借涓€鐪肩湅鍑猴紝涓嶇劧鐢ㄦ埛鍦ㄤ袱浠戒箣闂村垏浜嗗嵈涓嶇煡閬撹嚜宸卞湪鍝?*/
.deck-switch-row.is-cur { background: color-mix(in srgb, var(--strong) 14%, transparent); }
.deck-switch-main {
  flex: 1; min-width: 0; cursor: pointer;
  padding: 5px 7px;
  display: flex; flex-direction: column; gap: 1px;
}
.deck-switch-name {
  font-size: 11.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.deck-switch-meta { font-size: 9.5px; color: var(--muted); }
.deck-switch-input {
  width: 100%; font-size: 11.5px; padding: 2px 4px;
  border: 1px solid var(--strong); border-radius: 5px;
  background: var(--panel); color: var(--text); font-family: inherit;
}
.deck-switch-input:focus { outline: none; }
.deck-switch-act {
  width: 22px; height: 22px; flex: none; border-radius: 5px;
  border: 1px solid transparent; background: none;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.deck-switch-act svg { width: 12px; height: 12px; }
.deck-switch-act:hover { color: var(--strong); border-color: var(--line); }
.deck-switch-act.is-danger:hover { color: var(--danger); border-color: var(--danger); }
.deck-switch-empty { padding: 8px 9px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.deck-switch-all {
  margin-top: 3px; padding: 5px;
  font-size: 10.5px; color: var(--strong);
  background: none; border: 1px dashed var(--line); border-radius: 7px;
  cursor: pointer; font-family: inherit;
}
.deck-switch-all:hover { border-color: var(--strong); }

/* ---------- 瀵煎嚭鍓嶄綋妫€ ---------- */
.deck-check {
  padding: 6px 14px 8px;
  border-bottom: 1px solid var(--line);
  max-height: 220px; overflow-y: auto;
  background: var(--soft);
}
.deck-check[hidden] { display: none; }
.deck-check-busy { font-size: 11px; color: var(--muted); padding: 6px 0; }
.deck-check-sum { padding: 6px 8px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.deck-check-sum.is-ok { border-color: color-mix(in srgb, var(--strong) 45%, transparent); }
.deck-check-sum.is-warn { border-color: color-mix(in srgb, #d99a20 55%, transparent); }
.deck-check-sum.is-error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.deck-check-head { font-size: 11.5px; font-weight: 700; color: var(--text); }
.deck-check-sum.is-error .deck-check-head { color: var(--danger); }
.deck-check-sub { font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.deck-check-note {
  margin-top: 5px; padding: 5px 7px; border-radius: 7px;
  font-size: 10.5px; line-height: 1.5;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.deck-check-note.is-warn { color: #b8791a; border-color: color-mix(in srgb, #d99a20 40%, transparent); }
.deck-check-page { margin-top: 6px; }
.deck-check-page-head {
  font-size: 10.5px; font-weight: 700; color: var(--text);
  padding: 3px 2px; border-bottom: 1px solid var(--line); margin-bottom: 3px;
}
.deck-check-item {
  padding: 5px 7px; margin-bottom: 3px; border-radius: 7px;
  background: var(--panel); border-left: 3px solid var(--line);
}
.deck-check-item.is-error { border-left-color: var(--danger); }
.deck-check-item.is-warn { border-left-color: #d99a20; }
.deck-check-item.is-info { border-left-color: var(--strong); }
.deck-check-item-title { font-size: 11px; font-weight: 600; color: var(--text); }
.deck-check-item-detail { font-size: 10.5px; color: var(--muted); line-height: 1.5; margin-top: 1px; }
.deck-check-item-fix { font-size: 10.5px; color: var(--strong); margin-top: 2px; line-height: 1.5; }
.deck-check-fidelity { margin-top: 7px; }
.deck-check-fidelity summary {
  font-size: 10.5px; color: var(--muted); cursor: pointer; padding: 3px 2px;
  user-select: none;
}
.deck-check-fidelity summary:hover { color: var(--text); }

/* ================================================================
   鑺傜偣杩愯/鎺掗槦鐨?*灞呬腑瑕嗙洊灞?*
   ----------------------------------------------------------------
   涔嬪墠鐘舵€佹潯鏄彃鍦?body 涔嬪墠鐨勬櫘閫氬潡锛岃繍琛屾椂浼氫粠鍗＄墖涓婃部銆屾尋銆嶅嚭涓€鏉?
   妯潯锛屾妸鏍囬鍜屽浘寰€涓嬫帹 鈥斺€?鐢ㄦ埛鐪嬪埌鐨勬槸涓€鏉¤帿鍚嶅叾濡欑殑杩涘害鏉￠暱鍦ㄥ崱鐗囧闈€?

   鐜板湪 running / queued 鏀规垚閾烘弧鍗＄墖鐨勫眳涓鐩栧眰锛堣浆鍦?+ 鏂囨 + 杩涘害锛夛紝
   鍗＄墖鏈韩鐨勫竷灞€涓€涓儚绱犻兘涓嶅姩銆俹k / warn / error / missing 浠嶆槸
   涓婇潰閭ｆ潯杞婚噺鐘舵€佹潯锛堝畠浠渶瑕佸父椹伙紝涓斿甫鎸夐挳锛夈€?
   ================================================================ */
.node-status-slot.running,
.node-status-slot.queued {
  position: absolute; inset: 0;
  margin: 0; padding: 16px;
  border-radius: var(--radius-node);
  display: flex; align-items: center; justify-content: center;
  z-index: 12; text-align: center;
  background: color-mix(in srgb, var(--panel) 66%, transparent);
  backdrop-filter: blur(3px);
}
.node-status-slot.queued { color: var(--muted); }
.node-status-slot .ov {
  width: 100%; max-width: 220px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.node-status-slot .ov .row { width: 100%; justify-content: center; }
.node-status-slot .ov .node-progress { width: 100%; margin: 0; }
.node-status-slot .spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--strong) 22%, transparent);
  border-top-color: var(--strong);
  animation: stat-spin .8s linear infinite;
}
@keyframes stat-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .node-status-slot .spinner { animation: none; }
}

/* ================================================================
   鍒嗛暅鏍煎瓙锛氫竴寮犲崱閲岃 cols脳rows 涓牸瀛?
   ================================================================ */
.node-storyboard .node-body {
  border-radius: var(--radius-node);
  overflow: hidden;
}
.sb-grid {
  display: grid;
  gap: 1px;
  width: 100%;
  background: var(--line);
  border-radius: var(--radius-node);
  overflow: hidden;
}
.sb-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--card-solid);
  color: var(--faint);
}
.sb-cell.is-empty svg { width: 18px; height: 18px; opacity: .55; }
.sb-cell.is-uploadable { cursor: pointer; }
.sb-cell.is-uploadable:hover { background: var(--soft); color: var(--muted); }
.sb-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sb-gone { font-size: 10px; color: var(--faint); }

.sb-tools {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%) scale(var(--panel-scale, 1));
  transform-origin: top center;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, #000 62%, transparent);
  box-shadow: 0 3px 10px rgb(0 0 0 / .35);
  z-index: 2;
}
.sb-cell-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.sb-cell-btn svg { width: 12px; height: 12px; }
.sb-cell-btn:hover { background: rgb(255 255 255 / .18); }
.sb-cell-btn.danger:hover { background: var(--danger); }

.sb-float {
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
}
.sb-chip {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sb-tool {
  height: 24px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  white-space: nowrap;
}
.sb-tool svg { width: 12px; height: 12px; }
.sb-tool:hover { background: var(--soft); color: var(--text); }
.sb-tool.danger:hover { background: var(--danger-bg); color: var(--danger); }

.sb-collapsed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 10px;
  color: var(--muted);
  font-size: 11px;
}
.sb-collapsed svg { width: 14px; height: 14px; }



/* ---------- outpaint ---------- */
.op-overlay {
  position: fixed; inset: 0; z-index: 780;
  display: flex; flex-direction: column;
  background: rgba(8, 9, 12, .95);
  color: #fff;
  font-family: inherit;
  animation: op-in .16s ease-out;
}
@keyframes op-in { from { opacity: 0; } to { opacity: 1; } }
.op-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 16px; padding: 18px 24px 0;
}
.op-heading { display: flex; align-items: baseline; gap: 10px; }
.op-heading b { font-size: 16px; letter-spacing: .02em; }
.op-heading span { font-size: 11px; color: rgba(255,255,255,.5); }
.op-ratios {
  display: flex; align-items: center; gap: 3px;
  min-width: 0; max-width: 100%; padding: 3px;
  border-radius: 999px; background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.06);
  overflow-x: auto; scrollbar-width: none;
}
.op-ratios::-webkit-scrollbar { display: none; }
.op-ratio {
  height: 26px; flex: none; padding: 0 9px;
  border: 0; border-radius: 999px; background: transparent;
  color: rgba(255,255,255,.68); font: inherit; font-size: 10.5px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.op-ratio:hover { background: rgba(255,255,255,.09); color: #fff; }
.op-ratio.active { background: #fff; color: #111; }
.op-readout { display: flex; align-items: center; gap: 8px; }
.op-size, .op-zoom, .op-ratio-badge {
  padding: 4px 9px; border-radius: 999px;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.82);
  font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.op-ratio-badge { color: rgba(255,255,255,.92); font-weight: 700; }
.op-zoom:empty { display: none; }
.op-stage {
  position: relative; flex: 1; min-height: 0;
  margin: 8px 20px 0; overflow: hidden;
}
.op-image {
  position: absolute; display: block; border-radius: 6px;
  box-shadow: 0 18px 60px rgb(0 0 0 / .55);
  pointer-events: none; user-select: none;
}
.op-frame {
  position: absolute; box-sizing: border-box;
  border: 1.5px dashed rgba(255,255,255,.94);
  box-shadow: 0 0 0 9999px rgb(0 0 0 / .42);
  cursor: move; touch-action: none;
}
.op-frame::after {
  content: ''; position: absolute; inset: -1.5px;
  border: 1px solid rgba(0,0,0,.35); border-radius: 1px;
  pointer-events: none;
}
.op-tag {
  position: absolute; z-index: 3; top: -30px; left: 50%;
  transform: translateX(-50%);
  padding: 4px 9px; border-radius: 999px;
  background: rgba(20,21,25,.92); color: rgba(255,255,255,.72);
  font-size: 10px; white-space: nowrap; pointer-events: none;
}
.op-handle {
  position: absolute; width: 11px; height: 11px; box-sizing: border-box;
  background: #fff; border: 1.5px solid rgba(0,0,0,.45); border-radius: 3px;
  box-shadow: 0 2px 8px rgb(0 0 0 / .35);
  touch-action: none;
}
.op-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.op-handle.n  { left: 50%; top: -6px; margin-left: -5.5px; cursor: ns-resize; }
.op-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.op-handle.e  { right: -6px; top: 50%; margin-top: -5.5px; cursor: ew-resize; }
.op-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.op-handle.s  { left: 50%; bottom: -6px; margin-left: -5.5px; cursor: ns-resize; }
.op-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.op-handle.w  { left: -6px; top: 50%; margin-top: -5.5px; cursor: ew-resize; }
.op-bar {
  width: min(620px, calc(100% - 40px));
  margin: 10px auto 22px;
  padding: 8px 10px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(34,35,41,.94);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  box-shadow: 0 14px 40px rgb(0 0 0 / .45);
}
.op-bar-spacer { flex: 1; }
.op-close {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: transparent; color: rgba(255,255,255,.8);
  cursor: pointer;
}
.op-close:hover { background: rgba(255,255,255,.1); color: #fff; }
.op-close:disabled { opacity: .4; cursor: default; }
.op-close svg { width: 17px; height: 17px; }
.op-model-wrap {
  position: relative; display: flex; align-items: center;
  min-width: 0; max-width: 340px;
}
.op-model-btn {
  min-width: 0; max-width: 100%; height: 34px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 12px; border: 1px solid transparent; border-radius: 999px;
  background: rgba(255,255,255,.07); color: rgba(255,255,255,.9);
  font: inherit; font-size: 12px; cursor: pointer; outline: none;
}
.op-model-btn:hover { background: rgba(255,255,255,.11); }
.op-model-btn:focus { border-color: rgba(255,255,255,.28); }
.op-model-btn:disabled { cursor: default; opacity: .65; }
.op-model-current {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.op-model-caret {
  flex: none; display: inline-flex; color: rgba(255,255,255,.55);
}
.op-model-caret svg { width: 13px; height: 13px; }
.op-model-pop {
  position: absolute; left: 50%; bottom: calc(100% + 10px);
  z-index: 30; width: min(420px, calc(100vw - 32px));
  max-height: min(52vh, 420px); padding: 8px;
  display: none; flex-direction: column;
  background: rgba(28,29,34,.98);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgb(0 0 0 / .55);
  transform: translateX(-50%);
}
.op-model-pop.open { display: flex; }
.op-model-search {
  flex: none; height: 32px; margin-bottom: 6px; padding: 0 10px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 9px;
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.92);
  font: inherit; font-size: 11.5px; outline: none;
}
.op-model-search:focus { border-color: rgba(255,255,255,.3); }
.op-model-pop .np-model-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1px 2px;
}
.op-model-pop .np-model-row { color: rgba(255,255,255,.9); }
.op-model-pop .np-model-row:hover { background: rgba(255,255,255,.08); }
.op-model-pop .np-model-row.active {
  background: rgba(255,255,255,.11);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.34);
}
.op-model-pop .np-model-sub { color: rgba(255,255,255,.5); }
.op-model-pop .np-model-group { color: rgba(255,255,255,.55); }
.op-model-pop .np-model-group:not(:first-of-type) { border-top-color: rgba(255,255,255,.1); }
.op-model-pop .np-empty { color: rgba(255,255,255,.5); }
.op-model-tag {
  flex: none; padding: 0 4px; border-radius: 4px;
  font-size: 8px; font-weight: 800; line-height: 14px;
  color: #bfdbfe; border: 1px solid rgb(96 165 250 / .3);
  background: rgb(96 165 250 / .12);
}
.op-run {
  height: 34px; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 16px;
  border: none; border-radius: 999px;
  background: #fff; color: #111;
  font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.op-run:hover:not(:disabled) { transform: translateY(-1px); }
.op-run:disabled { opacity: .45; cursor: default; }
.op-run.busy { opacity: .7; }
.op-run svg { width: 14px; height: 14px; }
@media (max-width: 620px) {
  .op-top { padding: 14px 14px 0; }
  .op-heading span { display: none; }
  .op-stage { margin: 6px 10px 0; }
  .op-bar { width: calc(100% - 20px); margin-bottom: 12px; gap: 6px; }
  .op-model-wrap { max-width: 180px; }
  .op-run { padding: 0 12px; }
}

/* ---------- canvas board menus ---------- */
.context-menu.ctx-board { min-width: 216px; }
.context-menu.ctx-board-dbl { min-width: 238px; }
.ctx-section {
  padding: 9px 12px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--faint);
  user-select: none;
}
.ctx-section:first-child { padding-top: 4px; }
.ctx-item.ctx-parent { padding-right: 10px; }
.ctx-subwrap { position: relative; }
.context-menu .ctx-chevron {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--faint);
}
.ctx-submenu {
  position: absolute;
  left: calc(100% - 4px);
  top: -6px;
  z-index: 2;
  display: none;
  min-width: 224px;
  padding: 6px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 16px 44px var(--shadow);
  backdrop-filter: blur(16px);
}
.context-menu.ctx-flip-sub .ctx-submenu {
  left: auto;
  right: calc(100% - 4px);
}
.ctx-subwrap.open > .ctx-submenu { display: block; }
.ctx-subwrap.open > .ctx-item { background: var(--soft-2); }
.ctx-submenu .ctx-item { padding: 9px 12px; }


/* settings rail refresh */
.settings-panel {
  max-height: min(640px, calc(100dvh - 32px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.settings-panel::-webkit-scrollbar { width: 8px; }
.settings-panel::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.rail-settings-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--strong) 12%, transparent), transparent 58%),
    var(--panel);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.rail-settings-head-text { min-width: 0; }
.rail-settings-kicker {
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--faint);
  line-height: 1.2;
}
.rail-settings-head h3 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -.01em;
  color: var(--text);
}
.rail-settings-close {
  width: 30px;
  height: 30px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.rail-settings-close:hover { background: var(--soft-2); color: var(--text); transform: rotate(4deg); }
.rail-settings-close:focus-visible { outline: 2px solid var(--strong); outline-offset: 2px; }
.rail-settings-close svg { width: 14px; height: 14px; }
.settings-panel .rail-me {
  position: relative;
  margin: 12px 12px 2px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background:
    radial-gradient(110% 160% at 100% 0%, color-mix(in srgb, var(--strong) 14%, transparent), transparent 55%),
    var(--soft);
}
.settings-panel .rail-me::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -46px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--strong) 7%, transparent);
  pointer-events: none;
}
.settings-panel .rail-me-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.rail-me-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--strong) 28%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--strong) 12%, var(--card-solid));
  color: var(--strong);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
}
.rail-me-avatar svg { width: 16px; height: 16px; }
.rail-me-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.settings-panel .rail-me-name { font-size: 14px; letter-spacing: -.01em; }
.settings-panel .rail-me-badge {
  margin-left: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 8.5px;
  letter-spacing: .04em;
  color: var(--strong);
  background: color-mix(in srgb, var(--strong) 10%, transparent);
  border-color: color-mix(in srgb, var(--strong) 24%, var(--line));
}
.settings-panel .rail-me-sub {
  position: relative;
  z-index: 1;
  padding-left: 44px;
  font-size: 10px;
  color: var(--muted);
}
.settings-panel .rail-me-card {
  position: relative;
  z-index: 1;
  margin-top: 11px;
  padding: 9px 10px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--card-solid) 72%, transparent);
  border: 1px solid var(--line-2);
}
.settings-panel .rail-me-path { color: var(--muted); }
.rail-section-label {
  padding: 14px 18px 5px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .1em;
  color: var(--faint);
  text-transform: uppercase;
  user-select: none;
}
.settings-panel .rail-row {
  gap: 10px;
  margin: 1px 8px;
  padding: 9px 10px;
  border-radius: 10px;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.settings-panel .rail-row:hover {
  background: var(--soft-2);
  transform: translateX(1px);
}
.settings-panel .rail-row > svg,
.settings-panel .rail-row > i {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.settings-panel .rail-row:hover > svg,
.settings-panel .rail-row:hover > i { color: var(--text); }
.settings-panel .rail-row > span:not(.sub) { font-size: 12px; font-weight: 700; }
.settings-panel .rail-row .sub {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--faint);
}
.settings-panel .flow-row {
  margin: 8px;
  padding: 11px 10px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: color-mix(in srgb, var(--soft) 78%, transparent);
}
.settings-panel .flow-row-head { font-size: 11.5px; }
.settings-panel .flow-chips { gap: 4px; margin-top: 9px; }
.settings-panel .flow-chip { padding: 6px 0; border-radius: 8px; }
.settings-panel .theme-chip {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.settings-panel .theme-chip:hover { background: var(--soft-2); color: var(--text); }
.settings-panel .theme-chip.active {
  background: var(--card-solid);
  border-color: var(--line);
  color: var(--text);
  box-shadow: 0 1px 2px var(--shadow);
}
.settings-panel .rail-sep { display: none; }

/* system config refresh */
.config-overlay {
  background: color-mix(in srgb, #000 52%, transparent);
  backdrop-filter: blur(10px) saturate(1.08);
}
.config-modal {
  width: min(960px, calc(100vw - 48px));
  max-height: min(88dvh, 860px);
  border-radius: 24px;
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .12);
  animation: config-enter .18s var(--ease) both;
}
@keyframes config-enter {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.config-head {
  position: relative;
  padding: 22px 26px 0;
  background:
    radial-gradient(90% 130% at 0% 0%, color-mix(in srgb, var(--strong) 10%, transparent), transparent 55%),
    var(--card-solid);
}
.config-head-top { gap: 16px; align-items: flex-start; }
.config-head h2 { font-size: 23px; letter-spacing: -.02em; }
.config-head > p { max-width: 560px; color: var(--muted); }
.config-import-export { margin-top: 2px; }
.config-ie-btn {
  height: 32px;
  padding: 0 13px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--card-solid) 80%, transparent);
  color: var(--muted);
}
.config-ie-btn:hover { color: var(--text); border-color: var(--line-strong); }
.config-tabs {
  gap: 6px;
  margin-top: 18px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.config-tabs::-webkit-scrollbar { display: none; }
.config-tab-btn {
  position: relative;
  flex: none;
  height: 38px;
  margin-right: 0;
  padding: 0 11px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.config-tab-btn:hover { color: var(--text); background: var(--soft); }
.config-tab-btn.active {
  color: var(--text);
  background: color-mix(in srgb, var(--soft) 76%, transparent);
  border-color: var(--line-2);
}
.config-tab-btn.active::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--strong);
}
.config-body {
  padding: 22px 26px 26px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.config-body::-webkit-scrollbar { width: 9px; }
.config-body::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.config-section-title { font-size: 13.5px; }
.config-channel-list { gap: 9px; }
.config-channel-card {
  padding: 14px 15px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--card-solid) 88%, transparent);
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease);
}
.config-channel-card:hover {
  border-color: var(--line-strong);
  background: var(--card-solid);
  transform: translateY(-1px);
}
.config-channel-name { font-size: 13.5px; }
.config-channel-meta { line-height: 1.5; }
.config-footer {
  padding: 13px 26px calc(13px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-solid) 92%, transparent);
}
.config-footer button {
  height: 36px;
  padding: 0 18px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
}
@media (prefers-reduced-motion: reduce) {
  .config-modal { animation: none; }
  .config-channel-card:hover,
  .settings-panel .rail-row:hover { transform: none; }
}
.config-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.config-section-desc { margin-bottom: 0; max-width: 560px; min-width: 0; }
.config-section-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.config-add-btn { white-space: nowrap; }
.config-tabs {
  margin: 16px 26px 0;
  padding: 5px;
  gap: 4px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: color-mix(in srgb, var(--soft) 78%, transparent);
  overflow-x: auto;
}
.config-tab-btn {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
}
.config-tab-btn:hover { background: color-mix(in srgb, var(--card-solid) 45%, transparent); }
.config-tab-btn.active {
  background: var(--card-solid);
  border: 0;
  color: var(--text);
  box-shadow: 0 1px 3px var(--shadow), inset 0 0 0 1px var(--line-2);
}
.config-tab-btn.active::after { display: none; }
.config-body { padding-top: 20px; }
@media (max-width: 820px) {
  .config-tabs { margin: 14px 18px 0; }
}
@media (max-width: 560px) {
  .config-tabs { margin: 12px 18px 0; padding: 5px; border-bottom: 1px solid var(--line-2); }
  .config-tab-btn { border: 0; background: transparent; }
  .config-tab-btn.active { border: 0; background: var(--card-solid); }
}
.deck-drawer {
  width: min(560px, calc(100vw - 24px)) !important;
  top: 72px;
  right: 16px;
  max-height: calc(100dvh - 88px);
  border-radius: 22px;
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
}
.deck-drawer > .prop-head {
  padding: 12px 14px;
  background:
    radial-gradient(100% 140% at 0% 0%, color-mix(in srgb, var(--strong) 10%, transparent), transparent 58%),
    var(--panel);
  border-bottom: 1px solid var(--line);
}
.deck-switch {
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: color-mix(in srgb, var(--soft) 70%, transparent);
  font-size: 12.5px;
}
.deck-switch:hover { background: var(--soft-2); }
.deck-drawer .prop-head .canvas-nav-btn,
.deck-drawer .prop-head .prop-close {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}
.deck-setup {
  padding: 14px 14px 16px;
  gap: 11px;
  background: var(--panel);
}
.deck-hero {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background:
    radial-gradient(90% 150% at 100% 0%, color-mix(in srgb, var(--strong) 16%, transparent), transparent 56%),
    linear-gradient(135deg, color-mix(in srgb, var(--soft) 86%, transparent), var(--card-solid));
}
.deck-hero::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -60px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--strong) 12%, transparent);
  pointer-events: none;
}
.deck-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.deck-hero-icon {
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--strong) 24%, var(--line));
  background: color-mix(in srgb, var(--strong) 12%, var(--card-solid));
  color: var(--strong);
}
.deck-hero-icon svg { width: 19px; height: 19px; }
.deck-hero-copy { min-width: 0; flex: 1; }
.deck-hero-copy h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.01em;
  color: var(--text);
}
.deck-hero-copy p {
  margin: 4px 0 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}
.deck-hero-badge {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--strong) 28%, var(--line));
  background: color-mix(in srgb, var(--strong) 10%, transparent);
  color: var(--strong);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .06em;
}
.deck-hero-steps {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--faint);
}
.deck-hero-steps span { display: inline-flex; align-items: center; gap: 4px; }
.deck-hero-steps b {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--soft-2);
  color: var(--muted);
  font-size: 9px;
}
.deck-hero-steps span.is-on { color: var(--text); }
.deck-hero-steps span.is-on b { background: var(--strong); color: var(--strong-text); }
.deck-hero-steps i { flex: 1; height: 1px; background: var(--line-2); }
.deck-card {
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card-solid) 88%, transparent);
}
.deck-card-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 9px;
}
.deck-step-no {
  flex: none;
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
}
.deck-card-head b {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
}
.deck-card-head small {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--faint);
  line-height: 1.45;
}
.deck-brief {
  min-height: 82px;
  padding: 11px 12px;
  border-radius: 11px;
  border-color: var(--line-2);
  background: var(--panel);
  font-size: 12px;
  line-height: 1.6;
}
.deck-brief:focus { border-color: var(--strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--strong) 10%, transparent); }
.deck-brief-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.deck-brief-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.deck-brief-chip {
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--soft);
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.deck-brief-chip:hover { background: var(--soft-2); color: var(--text); border-color: var(--line-strong); }
.deck-count { flex: none; font-size: 9.5px; color: var(--faint); padding-bottom: 4px; }
.deck-model-field { position: relative; }
.deck-model-field > svg,
.deck-model-field > i {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
.deck-model-field .llm-input { padding-left: 31px; height: 36px; border-radius: 10px; }
#deckModelHint { margin-top: 6px; font-size: 10px; line-height: 1.5; }
.deck-picked { gap: 7px; margin-bottom: 9px; }
.deck-picked:empty { display: none; }
.deck-pick {
  border-radius: 10px;
  border-color: var(--line-2);
  box-shadow: 0 1px 3px var(--shadow);
}
.deck-pick-actions { gap: 7px; }
.deck-pick-actions .btn {
  height: 32px;
  border-radius: 9px;
  font-size: 11px;
  background: var(--soft);
}
.deck-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--strong) 7%, transparent), transparent 60%),
    var(--card-solid);
}
.deck-action-copy { min-width: 0; flex: 1; }
.deck-action-copy b { display: block; font-size: 11.5px; color: var(--text); }
.deck-action-copy span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--faint); line-height: 1.45; }
.deck-generate {
  width: auto;
  flex: none;
  height: 38px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 12px;
}
.deck-generate svg { width: 14px; height: 14px; }
.deck-busy { padding: 4px 0 0; }
.deck-work { background: var(--panel); }
.deck-pages-wrap {
  padding: 14px 0;
  background:
    radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--strong) 5%, transparent), transparent 70%),
    var(--soft);
  border-top: 0;
}
.deck-pages { gap: 14px; }
.deck-status { padding: 7px 16px; background: var(--panel); }
.deck-outline { border-top-color: var(--line-2); }
.deck-outline-sum { padding: 9px 16px; font-size: 11px; }
.deck-outline-list { padding: 6px 12px 9px; gap: 8px; }
.deck-outline-row { border-radius: 11px; padding: 8px 9px; }
.deck-talk { padding: 9px 16px 14px; background: var(--panel); }
.deck-chat { max-height: 150px; }
.deck-msg { border-radius: 11px; font-size: 11px; }
@media (max-width: 720px) {
  .deck-drawer {
    top: calc(8px + var(--safe-top));
    right: calc(8px + var(--safe-right));
    left: calc(8px + var(--safe-left));
    width: auto !important;
    max-height: calc(100dvh - 16px - var(--safe-top) - var(--safe-bottom));
    border-radius: 19px;
  }
  .deck-setup { padding: 12px; }
  .deck-action { align-items: stretch; flex-direction: column; }
  .deck-generate { width: 100%; }
}
.preset-scene { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.preset-list-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.preset-list-view[hidden], .preset-detail-host[hidden] { display: none; }
.preset-detail-host { min-height: 0; flex: 1; overflow-y: auto; }
.preset-card {
  border-radius: 14px;
  border-color: var(--line-2);
  background: var(--card-solid);
  box-shadow: 0 1px 2px var(--shadow);
}
.preset-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--shadow);
}
.preset-cover { aspect-ratio: 16 / 11; overflow: hidden; }
.preset-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, .34));
  pointer-events: none;
}
.preset-cover-icon {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  opacity: .55;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25));
}
.preset-cover-hint {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .46);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .14s var(--ease), transform .14s var(--ease);
  backdrop-filter: blur(6px);
}
.preset-card:hover .preset-cover-hint { opacity: 1; transform: translateY(0); }
.preset-card-meta { padding: 7px 8px 8px; }
.preset-card-name { font-size: 11.5px; letter-spacing: -.01em; }
.preset-card-tags { margin-top: 4px; }
.preset-tag { line-height: 16px; padding: 0 5px; }
.rail-panel.rail-expanded .preset-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  padding: 12px 16px 18px;
}
.rail-panel:not(.rail-expanded) .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.preset-detail { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 14px; }
.preset-detail-top { display: flex; align-items: center; gap: 8px; }
.preset-back {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card-solid);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.preset-back:hover { color: var(--text); border-color: var(--line-strong); }
.preset-back svg { width: 13px; height: 13px; }
.preset-detail-cat {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--faint);
  letter-spacing: .04em;
}
.preset-detail-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 116px;
  padding: 14px;
  overflow: hidden;
  border-radius: 16px;
  color: #fff;
}
.preset-detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, .48));
  pointer-events: none;
}
.preset-detail-icon {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  flex: none;
  opacity: .82;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .3));
}
.preset-detail-copy { position: relative; z-index: 1; min-width: 0; }
.preset-detail-name { font-size: 17px; font-weight: 850; letter-spacing: -.02em; }
.preset-detail-desc { margin-top: 3px; font-size: 10.5px; line-height: 1.55; color: rgba(255, 255, 255, .78); }
.preset-detail-badges { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.preset-detail-badge {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .2);
  color: rgba(255, 255, 255, .86);
  font-size: 8.5px;
  font-weight: 800;
}
.preset-detail-badge.is-multi { background: rgba(217, 154, 32, .28); border-color: rgba(217, 154, 32, .45); color: #ffe2a3; }
.preset-detail-fields {
  padding: 11px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--card-solid);
}
.preset-detail-section-title {
  margin-bottom: 9px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  color: var(--faint);
}
.preset-detail-fields .field-groups { gap: 10px; }
.preset-detail-fields .field-group { gap: 5px; }
.preset-detail-fields .field-group-cap { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.preset-detail-fields .chip,
.preset-detail-fields .seg {
  min-height: 30px;
  border-radius: 8px;
  font-size: 11px;
}
.preset-detail-note { font-size: 11px; color: var(--muted); line-height: 1.55; }
.preset-detail-action {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--strong) 6%, transparent), transparent 60%),
    var(--card-solid);
  box-shadow: 0 -8px 24px color-mix(in srgb, var(--shadow) 55%, transparent);
}
.preset-detail-action-note { flex: 1; min-width: 0; font-size: 9.5px; color: var(--faint); line-height: 1.45; }
.preset-detail-create { flex: none; height: 34px; padding: 0 13px; border-radius: 9px; font-size: 11.5px; }
.preset-detail-create svg { width: 13px; height: 13px; }
@media (max-width: 720px) {
  .rail-panel:not(.rail-expanded) .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preset-detail-action { align-items: stretch; flex-direction: column; }
  .preset-detail-create { width: 100%; justify-content: center; }
}
body:has(.deck-drawer.open) #agentFab {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
}
.preset-detail-host { overflow: hidden; display: flex; flex-direction: column; }
.preset-detail { min-height: 0; height: 100%; overflow: hidden; }
.preset-detail-fields { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.preset-detail-action { position: relative; flex: none; }
.preset-detail-host { min-height: 0 !important; }
.preset-detail { min-height: 0 !important; max-height: 100%; }
.preset-detail-fields { min-height: 0 !important; }
.preset-shell { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.deck-picked:has(> .node-hint) { display: block; }
.deck-picked > .node-hint { margin: 0; padding: 9px 10px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--soft); }
.node-panel.is-scene-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.scene-panel {
  width: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 19px;
  background:
    radial-gradient(120% 150% at 0% 0%, color-mix(in srgb, var(--scene-a, var(--strong)) 26%, transparent), transparent 55%),
    linear-gradient(160deg, color-mix(in srgb, var(--panel) 96%, var(--scene-b, #222)) 0%, var(--panel) 48%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(20px);
}
.scene-panel-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 16px 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}
.scene-panel-mark {
  width: 38px;
  height: 38px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: linear-gradient(135deg, var(--scene-a, #555), var(--scene-b, #222));
  color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--scene-a, #555) 35%, transparent);
}
.scene-panel-mark svg { width: 19px; height: 19px; }
.scene-panel-heading { min-width: 0; }
.scene-panel-kicker {
  font-size: 8.5px;
  font-weight: 850;
  letter-spacing: .14em;
  color: var(--faint);
  text-transform: uppercase;
}
.scene-panel-heading h3 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scene-panel-spacer { flex: 1; }
.scene-panel-category {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--scene-a, var(--strong)) 32%, var(--line));
  background: color-mix(in srgb, var(--scene-a, var(--strong)) 10%, transparent);
  color: color-mix(in srgb, var(--scene-a, var(--strong)) 70%, var(--text));
  font-size: 9px;
  font-weight: 800;
}
.scene-panel-body { padding: 13px 14px 4px; }
.scene-panel-fields {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line-2) 88%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--card-solid) 74%, transparent);
}
.scene-panel-fields .field-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
.scene-panel-fields .field-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.scene-panel-fields .field-group:has(.seg-row),
.scene-panel-fields .field-group:has(.chip-row) { grid-column: span 2; }
.scene-panel-fields .field-group-cap {
  font-size: 10px;
  font-weight: 750;
  color: var(--muted);
  letter-spacing: .01em;
}
.scene-panel-fields .seg-row,
.scene-panel-fields .chip-row { gap: 3px; }
.scene-panel-fields .seg {
  height: 32px;
  border-radius: 8px;
  font-size: 11px;
  background: color-mix(in srgb, var(--soft) 58%, transparent);
}
.scene-panel-fields .seg.active {
  background: linear-gradient(135deg, var(--scene-a, var(--strong)), var(--scene-b, var(--strong)));
  color: #fff;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--scene-a, #555) 28%, transparent);
}
.scene-panel-fields .chip {
  height: 30px;
  border-radius: 8px;
  font-size: 11px;
}
.scene-panel-fields .chip.active {
  background: var(--strong);
  color: var(--strong-text);
}
.scene-panel-fields .switch { width: 38px; height: 21px; }
.scene-panel-prompt {
  margin-top: 10px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card-solid) 64%, transparent);
  overflow: hidden;
}
.scene-panel-prompt summary {
  padding: 9px 11px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.scene-panel-prompt summary:hover { color: var(--text); }
.scene-prompt {
  display: block;
  width: calc(100% - 20px);
  min-height: 70px;
  margin: 0 10px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  line-height: 1.55;
  outline: none;
}
.scene-prompt:focus { border-color: var(--strong); }
.scene-panel-prompt .preset-reapply {
  margin: 8px 10px 10px;
  height: 28px;
  font-size: 10.5px;
}
.scene-panel-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px 14px;
}
.scene-panel-foot .np-pop-wrap { flex: none; }
.scene-panel-foot .np-cost { font-size: 10px; }
.scene-generate {
  height: 38px;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--scene-a, var(--strong)), var(--scene-b, var(--strong)));
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--scene-a, #555) 30%, transparent);
  transition: transform .14s var(--ease), opacity .14s var(--ease);
}
.scene-generate:hover:not(:disabled) { transform: translateY(-1px); }
.scene-generate:disabled { opacity: .45; cursor: default; }
.scene-generate svg { width: 14px; height: 14px; }
@media (max-width: 720px) {
  .scene-panel-fields .field-groups { grid-template-columns: 1fr; }
  .scene-panel-fields .field-group:has(.seg-row),
  .scene-panel-fields .field-group:has(.chip-row) { grid-column: auto; }
  .scene-panel-foot { align-items: stretch; flex-wrap: wrap; }
  .scene-generate { width: 100%; justify-content: center; }
}
.config-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  margin-top: 14px;
  padding: 7px 6px 8px;
  background: var(--card-solid);
}
.config-body { padding-top: 24px; }
.deck-drawer {
  top: 90px;
  max-height: calc(100dvh - 106px);
}
.deck-drawer .prop-head .canvas-nav-btn,
.deck-drawer .prop-head .prop-close {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}
.deck-drawer .prop-head .canvas-nav-btn svg,
.deck-drawer .prop-head .prop-close svg {
  width: 13px;
  height: 13px;
}
.deck-drawer .prop-head > div[style] { gap: 4px !important; }
@media (max-width: 720px) {
  .config-tabs { top: 0; }
  .deck-drawer { top: calc(8px + var(--safe-top)); max-height: calc(100dvh - 16px); }
}
.scene-card {
  position: relative;
  overflow: hidden;
  margin: 10px 10px 12px;
  padding: 14px;
  border-radius: 16px;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}
.scene-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -52px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  pointer-events: none;
}
.scene-card-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; }
.scene-card-mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .18);
}
.scene-card-mark svg { width: 16px; height: 16px; }
.scene-card-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.scene-card-kicker { font-size: 8px; font-weight: 850; letter-spacing: .14em; color: rgba(255, 255, 255, .62); }
.scene-card-name { font-size: 14px; font-weight: 850; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-card-chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 11px; }
.scene-card-chip {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .86);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.scene-card-prompt {
  position: relative;
  z-index: 1;
  margin-top: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 9.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .68);
}
.scene-panel {
  max-height: min(40dvh, 360px);
  display: flex;
  flex-direction: column;
}
.scene-panel-head,
.scene-panel-foot { flex: none; }
.scene-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.scene-panel-body::-webkit-scrollbar { width: 8px; }
.scene-panel-body::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.node.selected,
.node.panel-open { z-index: 45; }
.config-tabs {
  position: relative;
  top: auto;
  z-index: 1;
  flex: none;
}
.config-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.scene-panel-fields .field-groups {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px 10px;
}
.scene-panel-fields .field-group:has(.seg-row),
.scene-panel-fields .field-group:has(.chip-row) { grid-column: auto; }
.scene-panel-fields .field-group-cap { font-size: 9.5px; }
.scene-panel-fields .seg { height: 28px; font-size: 10.5px; }
.scene-panel-fields .chip { height: 28px; font-size: 10.5px; }
@media (max-width: 760px) {
  .scene-panel-fields .field-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.scene-panel-tip {
  margin: 0 14px 10px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--scene-a, var(--strong)) 22%, var(--line-2));
  border-radius: 10px;
  background: color-mix(in srgb, var(--scene-a, var(--strong)) 7%, transparent);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.scene-panel { overflow: visible; }
.scene-panel-head { border-radius: 19px 19px 0 0; }
.scene-panel-foot { position: relative; z-index: 6; }
.scene-panel .np-pop { z-index: 30; }
.studio-reset {
  height: 26px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--faint);
  font: inherit;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}
.studio-reset:hover { color: var(--text); background: var(--soft); }
.studio-main {
  display: flex;
  gap: 12px;
  padding: 12px 14px 4px;
  min-height: 0;
}
.studio-preview {
  position: relative;
  width: 172px;
  flex: none;
  align-self: stretch;
  overflow: hidden;
  padding: 12px;
  border-radius: 14px;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}
.studio-preview::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -38px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .06);
}
.studio-preview-kicker {
  position: relative;
  z-index: 1;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .14em;
  color: rgba(255, 255, 255, .62);
}
.studio-preview-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 26px;
  height: 26px;
  margin-top: 12px;
  opacity: .85;
}
.studio-preview-name {
  position: relative;
  z-index: 1;
  margin: 7px 0 0;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -.02em;
}
.studio-preview-desc {
  position: relative;
  z-index: 1;
  margin: 4px 0 0;
  font-size: 9.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .72);
}
.studio-preview-chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}
.studio-preview-chip {
  max-width: 100%;
  padding: 2px 6px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(0, 0, 0, .18);
  color: rgba(255, 255, 255, .8);
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-controls {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.studio-section { min-width: 0; }
.studio-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.studio-section-head span { font-size: 10px; font-weight: 850; color: var(--text); }
.studio-section-head small { font-size: 9px; color: var(--faint); }
.studio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.studio-field {
  min-width: 0;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line-2) 86%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--soft) 48%, transparent);
}
.studio-field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 10px;
  font-weight: 750;
}
.studio-field-ic { color: color-mix(in srgb, var(--scene-a, var(--strong)) 72%, var(--text)); }
.studio-field-ic svg { width: 12px; height: 12px; }
.studio-field-hint {
  min-height: 21px;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.35;
}
.studio-options { display: flex; gap: 3px; }
.studio-option {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--card-solid);
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.studio-option:hover { color: var(--text); border-color: var(--line-strong); }
.studio-option.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--scene-a, var(--strong)), var(--scene-b, var(--strong)));
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--scene-a, #555) 24%, transparent);
}
.studio-option-ic { display: inline-flex; opacity: .8; }
.studio-option-ic svg { width: 11px; height: 11px; }
.studio-option-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-option-check { display: none; }
.studio-switch-row {
  width: 100%;
  height: 31px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--card-solid);
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.studio-switch-copy { flex: 1; text-align: left; }
.studio-switch {
  width: 24px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background .15s var(--ease);
}
.studio-switch i { width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); }
.studio-switch.on { background: var(--scene-a, var(--strong)); }
.studio-switch.on i { transform: translateX(10px); }
.studio-select {
  position: relative;
  height: 31px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--card-solid);
}
.studio-select select {
  width: 100%;
  height: 100%;
  padding: 0 23px 0 7px;
  border: 0;
  outline: none;
  appearance: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}
.studio-select-ic { position: absolute; right: 6px; pointer-events: none; color: var(--faint); }
.studio-select-ic svg { width: 11px; height: 11px; }
.studio-empty { padding: 14px; color: var(--faint); font-size: 10px; }
.studio-prompt {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: color-mix(in srgb, var(--soft) 40%, transparent);
  overflow: hidden;
}
.studio-prompt summary {
  padding: 7px 9px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.studio-prompt summary:hover { color: var(--text); }
.studio-prompt .scene-prompt { width: calc(100% - 16px); margin: 0 8px; min-height: 60px; font-size: 10px; }
.studio-prompt .preset-reapply { margin: 7px 8px 8px; height: 26px; font-size: 10px; }
.scene-panel-foot {
  padding-top: 9px;
  border-top: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}
.scene-panel-foot .np-chip { height: 34px; font-size: 10.5px; }
.scene-generate { height: 38px; padding: 0 16px; }
@media (max-width: 760px) {
  .studio-main { flex-direction: column; }
  .studio-preview { width: auto; }
  .studio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.studio-field { padding: 7px; }
.studio-field-label { margin-bottom: 5px; }
.studio-option { height: 28px; padding: 0 3px; font-size: 9.5px; }
.studio-option-ic { display: none; }
.studio-switch-row { height: 28px; }
.studio-select { height: 28px; }
.studio-section-head { margin-bottom: 6px; }
.studio-main { padding-top: 10px; }
.studio-main { padding: 8px 12px 2px; }
.studio-field { padding: 6px; }
.studio-field-label { margin-bottom: 3px; }
.studio-grid { gap: 7px; }
.studio-section-head { margin-bottom: 4px; }
.studio-option,
.studio-switch-row,
.studio-select { height: 26px; }
.studio-preview-guide {
  position: relative;
  z-index: 1;
  margin-top: 9px;
  padding: 6px 7px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .18);
  font-size: 8.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .78);
}
.studio-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-items: flex-start;
  scrollbar-gutter: stable;
}
.studio-main::-webkit-scrollbar { width: 7px; }
.studio-main::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
.studio-preview {
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 210px;
}
.scene-panel { max-height: min(64dvh, 720px, var(--scene-max, 640px)); }
.node-panel.panel-up {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 10px;
  transform-origin: bottom center;
}
.studio-inputs {
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--line-2) 86%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--soft) 38%, transparent);
}
.studio-inputs-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 7px;
}
.studio-inputs-head span { font-size: 10px; font-weight: 800; color: var(--text); }
.studio-inputs-head small { font-size: 8.5px; color: var(--faint); }
.studio-input-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 1px;
}
.studio-input-slot {
  position: relative;
  width: 94px;
  height: 74px;
  flex: none;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--card-solid);
  cursor: pointer;
}
.studio-input-slot:hover { border-color: var(--scene-a, var(--strong)); }
.studio-input-slot.required:not(.has) { border-color: color-mix(in srgb, var(--danger, #d66) 60%, var(--line-strong)); }
.studio-input-thumb {
  position: absolute;
  inset: 4px 4px 24px;
  width: calc(100% - 8px);
  height: 46px;
  object-fit: cover;
  border-radius: 7px;
}
.studio-input-plus {
  position: absolute;
  inset: 4px 4px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}
.studio-input-plus svg { width: 18px; height: 18px; }
.studio-input-label {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studio-input-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  cursor: pointer;
}
.studio-input-x svg { width: 10px; height: 10px; }
@media (max-width: 760px) {
  .studio-preview { position: relative; top: auto; min-height: 0; }
}
.studio-option { padding: 0 2px; gap: 2px; font-size: 8.5px; }
.studio-option-text { font-size: 8.5px; }
.studio-prompt { margin-bottom: 8px; }
.studio-input-slot { height: 62px; }
.studio-input-thumb { inset: 4px 4px 20px; height: 35px; }
.studio-input-plus { inset: 4px 4px 20px; }
.studio-input-label { bottom: 3px; line-height: 14px; }
.studio-grid { gap: 4px; }
.studio-prompt { margin-bottom: 3px; }
.studio-field { padding: 5px; }
.studio-field-label { margin-bottom: 2px; }
.studio-option,
.studio-switch-row,
.studio-select { height: 25px; }
.studio-prompt summary { padding: 5px 8px; }
.studio-section-head { margin-bottom: 3px; }
.studio-main { padding: 6px 12px 2px; }
.studio-tool-btn {
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
  border: 1px solid color-mix(in srgb, var(--scene-a, var(--strong)) 34%, var(--line-2));
  border-radius: 8px;
  background: color-mix(in srgb, var(--scene-a, var(--strong)) 10%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.studio-tool-btn:hover { border-color: var(--scene-a, var(--strong)); }
.studio-tool-btn svg { width: 13px; height: 13px; }
.scene-panel-sub {
  margin: 3px 0 0;
  max-width: 360px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scene-panel { max-height: min(72dvh, 720px, var(--scene-max, 680px)); }
.studio-main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 10px 14px 8px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 58%, transparent) transparent;
}
.studio-main::-webkit-scrollbar { width: 9px; }
.studio-main::-webkit-scrollbar-track { background: transparent; }
.studio-main::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 58%, transparent);
  background-clip: padding-box;
}
.studio-controls { gap: 10px; }
.studio-section-head { margin-bottom: 6px; }
.studio-section-head span { font-size: 11px; }
.studio-section-head small { font-size: 9.5px; }
.studio-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.studio-grid > .studio-field:only-child { grid-column: 1 / -1; }
.studio-field {
  padding: 9px 10px;
  border-radius: 12px;
}
.studio-field-label { margin-bottom: 5px; font-size: 10.5px; }
.studio-field-hint { min-height: 0; margin-bottom: 5px; font-size: 9px; }
.studio-option,
.studio-switch-row,
.studio-select { height: 31px; }
.studio-option { padding: 0 5px; gap: 3px; font-size: 9.5px; }
.studio-option-text { font-size: 9.5px; }
.studio-switch-row { font-size: 9.5px; padding: 0 8px; }
.studio-select select { font-size: 10px; padding: 0 24px 0 8px; }
.studio-more {
  border: 1px solid color-mix(in srgb, var(--line-2) 80%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--soft) 32%, transparent);
  overflow: hidden;
}
.studio-more summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.studio-more summary::-webkit-details-marker { display: none; }
.studio-more summary small { margin-left: auto; color: var(--faint); font-size: 9px; font-weight: 600; }
.studio-more summary i { color: var(--faint); transition: transform .16s var(--ease); }
.studio-more summary i svg { width: 13px; height: 13px; }
.studio-more[open] summary i { transform: rotate(180deg); }
.studio-more-body { display: flex; flex-direction: column; gap: 9px; padding: 0 9px 9px; }
.studio-more-group { display: flex; flex-direction: column; gap: 5px; }
.studio-more-title { color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .06em; }
.studio-more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.studio-more .studio-field { padding: 7px 8px; background: color-mix(in srgb, var(--card-solid) 68%, transparent); }
.studio-more .studio-field-label { font-size: 9.5px; }
.studio-more .studio-option,
.studio-more .studio-switch-row,
.studio-more .studio-select { height: 27px; }
.studio-more .studio-option { font-size: 9px; }
.studio-more .studio-select select { font-size: 9.5px; }
.studio-prompt { margin: 0; }
.studio-inputs { padding: 7px 8px; }
.studio-input-slot { width: 84px; }
@media (max-width: 760px) {
  .studio-grid,
  .studio-more-grid { grid-template-columns: 1fr; }
}
.preset-grid {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 58%, transparent) transparent;
}
.preset-grid::-webkit-scrollbar { width: 8px; }
.preset-grid::-webkit-scrollbar-track { background: transparent; }
.preset-grid::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 58%, transparent);
  background-clip: padding-box;
}
.studio-field-label { font-size: 11px; }
.studio-option { font-size: 10px; }
.studio-option-text { font-size: 10px; }
.studio-switch-row { font-size: 10px; }
.studio-select select { font-size: 10.5px; }
.studio-input-label { font-size: 9px; }
@keyframes studio-reveal {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
.studio-more[open] .studio-more-body,
.studio-prompt[open] .scene-prompt,
.studio-prompt[open] .preset-reapply { animation: studio-reveal .18s var(--ease) both; }
.studio-more summary:hover { color: var(--text); background: color-mix(in srgb, var(--text) 4%, transparent); }
.studio-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, .85fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
}
.studio-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.studio-rows { display: flex; flex-direction: column; gap: 7px; }
.studio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--line-2) 86%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--soft) 48%, transparent);
}
.studio-row-label {
  width: 106px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 750;
}
.studio-row-label > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-row-control { flex: 1; min-width: 0; }
.studio-row-control .studio-options { width: 100%; }
.studio-row-control .studio-switch-row { width: auto; min-width: 118px; margin-left: auto; }
.studio-row-control .studio-select { width: 100%; }
.studio-guide {
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--scene-a, var(--strong)) 26%, var(--line-2));
  border-radius: 12px;
  background:
    radial-gradient(100% 140% at 0% 0%, color-mix(in srgb, var(--scene-a, var(--strong)) 16%, transparent), transparent 70%),
    color-mix(in srgb, var(--soft) 42%, transparent);
}
.studio-guide-title { color: var(--text); font-size: 10px; font-weight: 800; }
.studio-guide-blurb { margin: 5px 0 8px; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.studio-guide-fact {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  color: var(--faint);
  font-size: 9px;
}
.studio-guide-fact b { color: var(--text); font-size: 9.5px; font-weight: 750; }
.studio-guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.45;
}
.studio-guide-tip svg { width: 11px; height: 11px; margin-top: 1px; flex: none; color: var(--scene-a, var(--strong)); }
.studio-col-right .studio-more-grid { grid-template-columns: 1fr; }
.studio-col-right .studio-more .studio-field { padding: 7px 8px; }
.studio-col-right .studio-prompt { margin: 0; }
@media (max-width: 900px) {
  .studio-main { grid-template-columns: 1fr; }
}
.studio-quick { margin: 0 0 8px; }
.studio-quick-title { margin-bottom: 5px; color: var(--faint); font-size: 8.5px; font-weight: 800; letter-spacing: .06em; }
.studio-quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.studio-quick-btn {
  min-height: 27px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--scene-a, var(--strong)) 28%, var(--line-2));
  border-radius: 8px;
  background: color-mix(in srgb, var(--scene-a, var(--strong)) 9%, transparent);
  color: var(--muted);
  font: inherit;
  font-size: 8.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.studio-quick-btn:hover { color: var(--text); border-color: var(--scene-a, var(--strong)); }
.preset-grid {
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 9px;
  padding: 9px 10px 14px;
}
.preset-group-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 2px 1px;
  padding-bottom: 5px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 56%, transparent);
  color: var(--text);
  font-size: 10.5px;
  font-weight: 800;
}
.preset-group-title small { margin-left: auto; color: var(--faint); font-size: 8.5px; font-weight: 600; }
.preset-card.is-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
}
.preset-card.is-row .preset-cover {
  width: 64px;
  height: 64px;
  aspect-ratio: auto;
  border-radius: 9px;
}
.preset-card.is-row .preset-cover-icon { width: 24px; height: 24px; opacity: .45; }
.preset-card.is-row .preset-cover-hint { display: none; }
.preset-card.is-row .preset-card-meta { padding: 0; min-width: 0; }
.preset-card.is-row .preset-card-name { font-size: 11.5px; }
.preset-card-desc {
  margin-top: 2px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preset-card.is-row .preset-card-tags { margin-top: 5px; }
.rail-panel:not(.rail-expanded) .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rail-panel.rail-expanded .preset-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.studio-guide-roles { display: flex; flex-direction: column; gap: 4px; margin: 2px 0 8px; }
.studio-guide-role {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 9px;
}
.studio-guide-role svg { width: 11px; height: 11px; flex: none; }
.studio-guide-role small { margin-left: auto; font-size: 8.5px; color: var(--faint); }
.studio-guide-role.ok { color: var(--muted); }
.studio-guide-role.ok svg { color: #5fbf8f; }
.studio-guide-role.miss small { color: color-mix(in srgb, var(--danger, #d66) 82%, var(--text)); }
.rail-panel.rail-expanded .preset-grid { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
@supports (grid-template-columns: subgrid) {
  .rail-panel.rail-expanded .preset-card.is-row { grid-template-columns: 54px minmax(0, 1fr); gap: 7px; padding: 6px; }
  .rail-panel.rail-expanded .preset-card.is-row .preset-cover { width: 54px; height: 54px; }
}
.preset-card.is-row { min-height: 76px; }
.preset-card.is-row .preset-cover-icon { width: 22px; height: 22px; opacity: .78; }
.preset-card-desc { display: block; }
.preset-grid {
  scrollbar-gutter: stable;
  padding-right: 13px;
}
.preset-grid::-webkit-scrollbar { width: 10px; }
.preset-grid::-webkit-scrollbar-track {
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 7%, transparent);
}
.preset-grid::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 42%, transparent);
  background-clip: padding-box;
}
.studio-main::-webkit-scrollbar-track {
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.empty-guide-card { position: relative; }
.empty-guide-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.empty-guide-close:hover { color: var(--text); border-color: var(--strong); }
.empty-guide-close { } /* 鍏煎鏃х被鍚嶏紝瀹為檯鎸夐挳鐢?data-empty-guide-dismiss */
/* ---------- 鐢诲竷鍔╂墜锛氭偓娴亰澶╃獥 + 鍒嗛〉 ---------- */
@media (min-width: 761px) {
  body:has(#agentDrawer.open) .agent-fab {
    display: flex;
    color: var(--text);
    background: var(--soft-2);
  }
  #agentDrawer {
    top: auto;
    right: 20px;
    bottom: 108px;
    width: min(540px, calc(100vw - 48px));
    height: min(720px, calc(100dvh - 132px));
    max-height: calc(100dvh - 132px);
    border: 1px solid var(--line);
    border-radius: 20px;
    transform: translateY(16px) scale(.975);
    transform-origin: 100% 100%;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
  }
  #agentDrawer.open { transform: none; }
}
.agent-tabs {
  flex: none;
  display: flex;
  gap: 4px;
  padding: 0 14px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.agent-tab {
  min-width: 0;
  height: 30px;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--faint);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.agent-tab svg { width: 13px; height: 13px; }
.agent-tab:hover { color: var(--text); background: var(--soft); }
.agent-tab.active { color: var(--text); background: var(--soft-2); border-color: var(--line-2); }
.agent-subview {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 16px;
  flex-direction: column;
  gap: 10px;
}
#agentDrawer:not([data-agent-tab="chat"]) > #agentChat,
#agentDrawer:not([data-agent-tab="chat"]) > #agentTraceBox,
#agentDrawer:not([data-agent-tab="chat"]) > #agentPendingBox,
#agentDrawer:not([data-agent-tab="chat"]) > .agent-drawer-body { display: none; }
#agentDrawer[data-agent-tab="history"] > #agentHistoryView,
#agentDrawer[data-agent-tab="logs"] > #agentLogView,
#agentDrawer[data-agent-tab="connect"] > #agentConnectView { display: flex; }
.agent-subhead { display: flex; align-items: center; gap: 8px; }
.agent-subhead b { color: var(--text); font-size: 12px; }
.agent-subhead span { color: var(--faint); font-size: 9.5px; }
.agent-subhead .agent-mini-spacer { flex: 1; }
.agent-sub-btn {
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font: inherit;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}
.agent-sub-btn:hover { color: var(--text); border-color: var(--strong); }
.agent-sub-btn svg { width: 12px; height: 12px; }
.agent-history-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: color-mix(in srgb, var(--soft) 45%, transparent);
}
.agent-history-main { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.agent-history-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.agent-history-main small { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; }
.agent-history-row.current { border-color: var(--strong); }
.agent-history-row .agent-thread-act { flex: none; }
.agent-log-toolbar { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.agent-log-filter { height: 25px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--faint); font: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
.agent-log-filter.active { color: var(--text); background: var(--soft-2); border-color: var(--line-strong); }
.agent-log-row { padding: 8px 9px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.agent-log-row:last-child { border-bottom: 0; }
.agent-log-top { display: flex; align-items: baseline; gap: 6px; }
.agent-log-top b { color: var(--text); font-size: 10px; }
.agent-log-top time { margin-left: auto; color: var(--faint); font-size: 8.5px; font-variant-numeric: tabular-nums; }
.agent-log-text { margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.45; word-break: break-word; }
.agent-log-row.error .agent-log-top b { color: #ef8b8b; }
.agent-log-row.warn .agent-log-top b { color: #d9b16a; }
.agent-log-raw { max-height: 220px; overflow: auto; padding: 9px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--deep, #111); color: var(--muted); font-size: 9px; line-height: 1.5; white-space: pre-wrap; }
.agent-connect-card { padding: 11px 12px; border: 1px solid var(--line-2); border-radius: 11px; background: color-mix(in srgb, var(--soft) 42%, transparent); }
.agent-connect-row { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 10px; color: var(--faint); }
.agent-connect-row b { margin-left: auto; color: var(--text); font-weight: 700; text-align: right; word-break: break-all; }
.agent-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #5fbf8f; display: inline-block; margin-right: 4px; }
.agent-msg-tools { display: flex; justify-content: flex-end; gap: 4px; margin-top: 5px; opacity: 0; transition: opacity .12s var(--ease); }
.llm-bubble:hover .agent-msg-tools, .agent-msg-tools:focus-within { opacity: 1; }
.agent-msg-copy { width: 22px; height: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 6px; background: var(--soft); color: var(--muted); cursor: pointer; }
.agent-msg-copy:hover { color: var(--text); border-color: var(--strong); }
.agent-msg-copy svg { width: 11px; height: 11px; }
.llm-bubble-text, #agentDrawer .agent-chat { user-select: text; }
#agentDrawer { height: min(680px, calc(100dvh - 150px)); max-height: calc(100dvh - 150px); }
/* 鎭㈠鍘熸墦寮€閫昏緫锛氬彸渚ф娊灞夛紝鎮诞鐞冩墦寮€鍚庨殣钘忥紱鍙繚鐣欏唴閮ㄥ姛鑳戒紭鍖栥€?*/
@media (min-width: 761px) {
  body:has(#agentDrawer.open) .agent-fab { display: none; }
  #agentDrawer {
    top: 90px;
    right: 20px;
    bottom: 16px;
    width: min(520px, calc(100vw - 40px));
    height: auto;
    max-height: none;
    border-radius: 14px;
    transform: translateX(22px) scale(.992);
    transform-origin: 100% 18%;
  }
  #agentDrawer.open { transform: none; }
}

/* ---------- 鐢诲竷鍔╂墜锛氭嫋鍔ㄨ皟鏁村搴︼紙榛樿浠嶄负 520锛?---------- */
@media (min-width: 761px) {
  #agentDrawer { width: min(var(--agent-w, 520px), calc(100vw - 40px)); }
  body.assets-open #agentDrawer { width: min(var(--agent-w, 520px), calc(100vw - 424px)); }
}
.agent-resize {
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 8px;
  z-index: 9;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
.agent-resize::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  width: 2px;
  height: 34px;
  margin-top: -17px;
  border-radius: 999px;
  background: var(--line-strong, var(--line));
  opacity: .32;
  transition: opacity .12s var(--ease), background .12s var(--ease), height .12s var(--ease);
}
.agent-resize:hover::before,
.agent-resize:focus-visible::before,
.agent-resize.is-dragging::before {
  height: 56px;
  margin-top: -28px;
  opacity: .9;
  background: var(--strong);
}
body.agent-resizing { cursor: col-resize; user-select: none; }
body.agent-resizing * { cursor: col-resize !important; }
@media (max-width: 760px) {
  .agent-resize { display: none; }
  body.assets-open #agentDrawer { width: auto; }
}
/* ---------- 鐢诲竷鍔╂墜锛氭爣绛炬潯涓庢秷鎭鍒舵寜閽綅缃?---------- */
.agent-tabs {
  width: calc(100% - 32px);
  margin: 0 16px 10px;
  padding: 3px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--soft) 72%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.agent-tab {
  height: 30px;
  border-radius: 9px;
  font-size: 10.5px;
  letter-spacing: .01em;
  gap: 6px;
}
.agent-tab svg { width: 14px; height: 14px; opacity: .78; }
.agent-tab:hover { background: color-mix(in srgb, var(--soft-2) 72%, transparent); }
.agent-tab.active {
  background: var(--card-solid, var(--soft-2));
  border-color: var(--line-2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
}
.agent-tab.active svg { color: var(--strong); opacity: 1; }

.agent-msg-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.agent-msg-wrap.user { align-items: flex-end; }
.agent-msg-wrap.assistant { align-items: flex-start; }
.agent-msg-wrap > .llm-bubble { max-width: 85%; }
.agent-msg-wrap .agent-msg-tools {
  margin-top: 5px;
  opacity: .55;
  pointer-events: auto;
}
.agent-msg-wrap:hover .agent-msg-tools,
.agent-msg-wrap:focus-within .agent-msg-tools {
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 760px) {
  .agent-tabs { width: calc(100% - 24px); margin: 0 12px 9px; }
}
/* ---------- 鐢诲竷鍔╂墜锛氬彲鎶樺彔鎵ц鏃堕棿绾?---------- */
.agent-timeline {
  width: 100%;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--soft) 62%, transparent);
  overflow: hidden;
}
.agent-timeline > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 10px;
}
.agent-timeline > summary::-webkit-details-marker { display: none; }
.agent-timeline-title { color: var(--text); font-weight: 700; }
.agent-timeline-meta { color: var(--faint); font-size: 9.5px; }
.agent-timeline > summary .agent-step-caret { margin-left: auto; }
.agent-timeline[open] > summary .agent-step-caret { transform: rotate(90deg); }
.agent-timeline-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 7px 7px;
}
.agent-timeline-body .agent-thought { background: var(--soft); }.agent-confirm-actions { flex-wrap: wrap; }`n.agent-question-actions { flex-wrap: wrap; }`n
/* 寤烘ā纭鍗¤繃闀挎椂鍙粴鍔ㄦ楠ゅ尯锛屾寜閽缁堝彲鐐?*/
.agent-confirm-card {
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 620px);
}
.agent-confirm-preview {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.agent-confirm-actions {
  flex: none;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  background: var(--soft);
}
/* ---------- 鐜颁唬浣忓畢寤烘ā杩囩▼ ---------- */
#agentDrawer[data-agent-tab="villa"] > #agentVillaView { display: flex; }
#agentTabs [data-agent-tab="villa"][hidden],
#agentVillaMode[hidden],
#agentVillaView[hidden] { display: none !important; }
.villa-stage-list { display: flex; flex-direction: column; gap: 6px; }
.villa-stage {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 9px; border: 1px solid var(--line-2); border-radius: 10px;
  background: color-mix(in srgb, var(--soft) 55%, transparent);
}
.villa-stage-no {
  width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; background: var(--soft-2); color: var(--muted); font-size: 9px; font-weight: 700;
}
.villa-stage-main { min-width: 0; flex: 1; }
.villa-stage-main b { display: block; color: var(--text); font-size: 10.5px; }
.villa-stage-main small { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; }
.villa-stage-status { color: var(--faint); font-size: 9px; flex: none; }
.villa-stage.done .villa-stage-status { color: #6fbf98; }
.villa-stage.failed .villa-stage-status { color: #e08a8a; }
.villa-stage.current { border-color: var(--strong); }
.villa-stage-shot { width: 100%; max-height: 130px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-2); }
.villa-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-villa-mode-btn {
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.agent-villa-mode-btn:hover { color: var(--text); background: var(--soft); }
.agent-villa-mode-btn.active { color: var(--strong); background: var(--soft-2); }
.agent-villa-mode-btn svg { width: 13px; height: 13px; }
/* Download dialog */
.download-panel { display: flex; flex-direction: column; gap: 14px; }
.download-loading { padding: 28px 0; text-align: center; color: var(--muted); font-size: 12px; }
.download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.download-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-solid); }
.download-card-head { display: flex; align-items: flex-start; gap: 10px; }
.download-card-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--soft-2); color: var(--strong); }
.download-card-icon svg { width: 17px; height: 17px; }
.download-card-heading { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.download-card-heading b { font-size: 13px; line-height: 1.35; }
.download-badge { width: fit-content; padding: 2px 6px; border-radius: 999px; background: var(--soft-2); color: var(--muted); font-size: 9.5px; font-weight: 700; }
.download-desc { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.download-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 10.5px; }
.download-sha-label { margin-top: 2px; color: var(--faint); font-size: 9.5px; font-weight: 700; }
.download-sha { display: block; max-width: 100%; padding: 7px 8px; border-radius: 7px; background: var(--soft); color: var(--muted); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.download-btn { justify-content: center; margin-top: 2px; text-decoration: none; }
.download-notes { color: var(--muted); font-size: 10px; line-height: 1.55; }
.download-unavailable { padding: 10px; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 11px; }
.download-footnote { color: var(--faint); font-size: 10px; line-height: 1.6; }
.download-error { padding: 18px 0; color: var(--danger, #c0392b); font-size: 12px; }
@media (max-width: 680px) {
  .download-grid { grid-template-columns: 1fr; }
}

/* 纭/闂鍗★細闄愬埗鏈€澶ч珮搴︼紝鍐呭鍦ㄥ崱鍐呮粴鍔紝搴曢儴鎸夐挳濮嬬粓鍙 */
.agent-question-card {
  max-height: min(70vh, 600px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.agent-question-card .agent-question-intro {
  max-height: 28vh;
  overflow-y: auto;
  padding-right: 2px;
}
.agent-question-card .agent-question-options {
  max-height: 34vh;
  overflow-y: auto;
  padding-right: 2px;
}
.agent-question-card .agent-question-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  flex: none;
  padding-top: 7px;
  padding-bottom: 2px;
  background: var(--card-solid);
}
.agent-question-card .agent-question-custom {
  flex: none;
  max-height: 96px;
  overflow-y: auto;
}

.gate-bulk-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.gate-bulk-btn:hover { border-color: var(--strong); }
.gate-bulk-btn.danger { color: var(--danger); }
.gate-bulk-btn.ghost { color: var(--muted); }
.gate-bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  font-size: 12px;
  color: var(--muted);
}
#gateProjectBulkCount { margin-right: auto; }
.canvas-item.selected { outline: 2px solid var(--strong); outline-offset: 2px; }
.canvas-item.selecting .canvas-card-edit,
.canvas-item.selecting .canvas-card-export,
.canvas-item.selecting .canvas-card-copy,
.canvas-item.selecting .canvas-delete { display: none; }
.canvas-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(12, 12, 16, .76);
  color: #fff;
  cursor: pointer;
}
.canvas-select.on { background: var(--strong); border-color: var(--strong); }

/* ================================================================
   设置工作台 v2：左侧导航 + 内容区 + 内嵌详情
   ================================================================ */
.config-overlay {
  background: color-mix(in srgb, #000 58%, transparent);
  backdrop-filter: blur(14px) saturate(1.05);
}
.config-modal {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  width: min(1000px, calc(100vw - 32px));
  height: min(88dvh, 900px);
  max-height: min(88dvh, 900px);
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--card-solid);
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  box-shadow: 0 32px 96px rgba(0, 0, 0, .42), 0 2px 8px rgba(0, 0, 0, .16);
  animation: config-enter .24s var(--ease) both;
}
@keyframes config-enter {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.config-nav {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 18px 12px 12px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(90% 70% at 0% 0%, color-mix(in srgb, var(--strong) 8%, transparent), transparent 70%),
    color-mix(in srgb, var(--soft) 62%, var(--card-solid));
}
.config-nav-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px 14px;
}
.config-nav-head h2 { font-size: 20px; font-weight: 780; letter-spacing: -.02em; }
.config-nav-head p { margin-top: 3px; font-size: 11px; color: var(--muted); }
.config-nav-close,
.config-detail-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.config-nav-close:hover,
.config-detail-back:hover {
  color: var(--text);
  background: var(--soft-2);
  border-color: var(--line-2);
}
.config-nav-close svg,
.config-detail-back svg { width: 15px; height: 15px; }
.config-nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin: 0 4px 12px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-solid) 68%, transparent);
  color: var(--faint);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.config-nav-search:focus-within {
  border-color: var(--strong);
  background: var(--card-solid);
}
.config-nav-search svg { width: 14px; height: 14px; flex: none; }
.config-nav-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.config-nav-search input::placeholder { color: var(--faint); }
.config-nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.config-nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.config-nav-group-label {
  padding: 0 10px 5px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}
.config-modal .config-nav .config-tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 680;
  text-align: left;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.config-modal .config-nav .config-tab-btn svg { width: 15px; height: 15px; flex: none; opacity: .82; }
.config-modal .config-nav .config-tab-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--card-solid) 62%, transparent);
}
.config-modal .config-nav .config-tab-btn.active {
  color: var(--text);
  background: var(--card-solid);
  border-color: var(--line-2);
  box-shadow: 0 1px 4px var(--shadow);
}
.config-modal .config-nav .config-tab-btn.active::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--strong);
}
.config-modal .config-nav .config-tab-btn.active::after { display: none; }
.config-nav-foot {
  flex: none;
  display: grid;
  gap: 6px;
  padding: 12px 4px 2px;
  border-top: 1px solid var(--line);
}
.config-nav-foot .config-ie-btn {
  width: 100%;
  height: 32px;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 10px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.config-nav-foot .config-ie-btn svg { width: 14px; height: 14px; }
.config-nav-foot .config-ie-btn:hover { color: var(--text); background: var(--soft-2); }
.config-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 100% 0%, color-mix(in srgb, var(--strong) 5%, transparent), transparent 65%),
    var(--card-solid);
}
.config-main-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 32px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.config-main-head-copy { min-width: 0; }
.config-breadcrumb {
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
}
.config-main-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -.025em;
}
.config-main-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.config-main-head .config-nav-close { margin-top: 1px; }
.config-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 32px 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.config-tab-content { animation: config-tab-in .18s var(--ease) both; }
.config-tab-content:not(.active) { display: none; }
@keyframes config-tab-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.config-footer {
  flex: none;
  display: flex;
  justify-content: flex-end;
  padding: 11px 32px calc(11px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-solid) 94%, transparent);
}
.config-footer .btn {
  height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 12px;
}
.config-section-head { margin-bottom: 14px; }
.config-section-title { font-size: 13px; font-weight: 760; }
.config-section-desc { max-width: 640px; }
.config-channel-list { display: flex; flex-direction: column; gap: 6px; }
.config-channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: color-mix(in srgb, var(--soft) 44%, transparent);
  transition: background .14s var(--ease), border-color .14s var(--ease), transform .14s var(--ease);
}
.config-channel-card:hover {
  background: color-mix(in srgb, var(--soft) 74%, transparent);
  border-color: var(--line-2);
  transform: none;
}
.config-channel-info { flex: 1 1 auto; min-width: 0; }
.config-channel-name { font-size: 13px; font-weight: 740; }
.config-channel-meta { font-size: 11px; color: var(--muted); }
.config-channel-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: .2;
  transition: opacity .14s var(--ease);
}
.config-channel-card:hover .config-channel-actions,
.config-channel-card:focus-within .config-channel-actions { opacity: 1; }
.config-channel-actions .btn.sm {
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11px;
}
.config-detail {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--card-solid);
  opacity: 0;
  visibility: hidden;
  transform: translateX(18px);
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .22s var(--ease), visibility .22s;
  box-shadow: -18px 0 48px rgba(0, 0, 0, .12);
}
.config-detail.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}
.config-detail-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 28px 14px;
  border-bottom: 1px solid var(--line);
}
.config-detail-copy { flex: 1 1 auto; min-width: 0; }
.config-detail-copy h3 { font-size: 18px; font-weight: 760; letter-spacing: -.02em; }
.config-detail-copy p { margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.config-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 28px 22px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.config-detail-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 28px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line);
}
.config-detail-foot .btn { height: 34px; padding: 0 16px; border-radius: 9px; font-size: 12px; }
.config-modal [hidden] { display: none !important; }

@media (max-width: 820px) {
  .config-modal {
    grid-template-columns: 1fr;
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }
  .config-nav {
    flex: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 8px 10px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .config-nav-head { padding: 0; }
  .config-nav-head p { display: none; }
  .config-nav-search { margin: 0; height: 32px; }
  .config-nav-scroll {
    grid-column: 1 / -1;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 2px;
  }
  .config-nav-group { display: contents; }
  .config-nav-group-label { display: none; }
  .config-modal .config-nav .config-tab-btn { width: auto; flex: none; height: 30px; padding: 0 10px; }
  .config-modal .config-nav .config-tab-btn.active::before {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 2px;
    width: auto;
    height: 2px;
  }
  .config-nav-foot { display: none; }
  .config-main-head { padding: 18px 20px 13px; }
  .config-main-head .config-nav-close { display: none; }
  .config-body { padding: 18px 20px 22px; }
  .config-footer { padding: 10px 20px calc(10px + var(--safe-bottom)); }
  .config-detail-head { padding: 16px 20px 12px; }
  .config-detail-body { padding: 16px 20px 20px; }
  .config-detail-foot { padding: 10px 20px calc(10px + var(--safe-bottom)); }
  .config-channel-actions { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .config-modal,
  .config-tab-content,
  .config-detail { animation: none; transition: none; }
  .config-channel-card:hover { transform: none; }
}

/* ================================================================
   设置 V3：行式分组、原生折叠、渠道模型表
   ================================================================ */
.config-v3-section {
  padding: 0 0 18px;
  margin: 0 0 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}
.config-v3-section:last-of-type { border-bottom: 0; }
.config-v3-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.config-v3-section-copy { min-width: 0; flex: 1 1 auto; }
.config-v3-title {
  margin: 0;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -.01em;
}
.config-v3-desc {
  margin: 4px 0 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.config-v3-rows { border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent); }
.config-v3-row {
  display: grid;
  grid-template-columns: minmax(140px, 210px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 46px;
  padding: 8px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
}
.config-v3-row:last-child { border-bottom: 0; }
.config-v3-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.config-v3-label > span { font-size: 12.5px; font-weight: 680; color: var(--text); }
.config-v3-label > small { font-size: 10.5px; line-height: 1.45; color: var(--faint); }
.config-v3-control {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}
.config-v3-control > input,
.config-v3-control > select { width: 100%; max-width: 340px; }
.config-v3-control > .setting-input { height: 32px; }
.config-v3-control > textarea { width: 100%; }
.config-saved {
  margin-left: auto;
  align-self: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--success);
  opacity: 0;
  transition: opacity .16s var(--ease);
  white-space: nowrap;
}
.config-saved.on { opacity: 1; }
.config-saved.err { color: var(--danger); }
.config-model-card {
  padding: 2px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--soft) 36%, transparent);
}
.config-model-card .config-v3-rows { border-top: 0; }
.config-model-card .config-v3-row { min-height: 44px; }

.config-disclosure {
  margin-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}
.config-disclosure-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 2px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
}
.config-disclosure-summary::-webkit-details-marker { display: none; }
.config-disclosure-summary::marker { content: ''; }
.config-disclosure-hint {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
}
.config-disclosure-caret {
  margin-left: auto;
  display: inline-flex;
  color: var(--faint);
  transition: transform .16s var(--ease);
}
.config-disclosure-caret svg { width: 14px; height: 14px; }
.config-disclosure[open] .config-disclosure-caret { transform: rotate(180deg); }
.config-disclosure-body { padding: 2px 2px 10px; }
.config-disclosure + .config-disclosure { margin-top: 0; }

.config-detail-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.config-summary-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
.config-summary-chip {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.config-summary-chip.mono { font-family: ui-monospace, Consolas, monospace; font-weight: 600; }
.config-summary-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.config-unsaved {
  color: var(--warning, #f59e0b);
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  transition: opacity .15s var(--ease);
  white-space: nowrap;
}
.config-unsaved.on { opacity: 1; }

.config-model-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.config-model-toolbar .setting-input { height: 32px; }
.config-model-toolbar input.setting-input { flex: 1 1 220px; min-width: 160px; }
.config-model-toolbar select.setting-input { flex: 0 0 120px; }
.config-model-bulk {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.config-model-count { margin-left: auto; color: var(--faint); font-size: 10.5px; font-weight: 700; }
.config-model-table {
  max-height: 430px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-solid);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.config-model-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) minmax(180px, 1.35fr) 46px 30px;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 6px 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  font-size: 11.5px;
}
.config-model-row:first-child { border-top: 0; }
.config-model-row.head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 32px;
  background: color-mix(in srgb, var(--soft) 78%, var(--card-solid));
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.config-model-row > input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--strong); }
.config-model-name { min-width: 0; }
.config-model-name > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 680;
}
.config-model-name > small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-size: 9.5px;
  margin-top: 1px;
}
.config-model-caps { display: flex; flex-wrap: wrap; gap: 4px; }
.config-cap-chip {
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  background: transparent;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}
.config-cap-chip:hover { color: var(--text); border-color: var(--line-strong); }
.config-cap-chip.on {
  color: var(--strong-text);
  background: var(--strong);
  border-color: var(--strong);
}
.config-model-source { color: var(--faint); font-size: 9.5px; font-weight: 700; }
.config-model-untagged { color: var(--faint); font-size: 9.5px; }
.config-model-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 11.5px; }
.config-model-row .btn.sm { width: 26px; height: 26px; padding: 0; border-radius: 7px; opacity: .55; }
.config-model-row:hover .btn.sm { opacity: 1; }

.config-prompt-actions { gap: 5px; }
.config-prompt-actions .btn.primary { height: 30px; padding: 0 12px; border-radius: 8px; }
.config-prompt-card { padding: 12px 14px; }

@media (max-width: 820px) {
  .config-v3-row { grid-template-columns: 1fr; gap: 6px; align-items: stretch; }
  .config-v3-control { justify-content: flex-start; }
  .config-v3-control > input,
  .config-v3-control > select { max-width: none; }
  .config-summary-actions { width: 100%; margin-left: 0; }
  .config-unsaved { width: 100%; }
  .config-model-row {
    grid-template-columns: 24px minmax(0, 1fr) 30px;
    grid-template-areas:
      "check name del"
      ". caps caps"
      ". source source";
    row-gap: 4px;
  }
  .config-model-row > input[type="checkbox"] { grid-area: check; }
  .config-model-name { grid-area: name; }
  .config-model-caps { grid-area: caps; }
  .config-model-source { grid-area: source; }
  .config-model-row > .btn { grid-area: del; }
  .config-model-row.head { display: none; }
  .config-model-table { max-height: 52vh; }
  .config-model-count { width: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .config-saved, .config-unsaved, .config-disclosure-caret { transition: none; }
}

/* ================================================================
   渠道详情视觉打样：限宽、元信息、行式表单、按钮分级
   ================================================================ */
.config-detail-body {
  width: 100%;
  max-width: 875px;
  padding-left: 63px;
  padding-right: 28px;
}
.config-detail-summary {
  align-items: flex-start;
  margin-bottom: 20px;
}
.config-detail-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.config-detail-meta {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.config-detail-url {
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
}
.config-summary-actions {
  margin-left: auto;
  align-self: center;
  gap: 2px;
}
.config-summary-actions .btn {
  height: 26px;
  padding: 0 7px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  box-shadow: none;
}
.config-summary-actions .btn:hover {
  color: var(--text);
  background: var(--soft);
}
.config-summary-actions .btn svg { width: 13px; height: 13px; opacity: .8; }
.config-unsaved { align-self: center; }

.config-v3-section {
  padding-bottom: 0;
  margin-bottom: 28px;
  border-bottom: 0;
}
.config-v3-section + .config-v3-section {
  padding-top: 26px;
  border-top: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
}
.config-v3-section-head { margin-bottom: 12px; }
.config-v3-title { font-size: 14px; font-weight: 650; letter-spacing: -.012em; }
.config-v3-desc { margin-top: 5px; font-size: 11px; }
.config-v3-rows { border-top: 0; }
.config-v3-row {
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-areas:
    "label control"
    ". hint";
  align-items: center;
  gap: 2px 20px;
  min-height: 52px;
  padding: 4px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 48%, transparent);
}
.config-v3-label {
  grid-area: label;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  align-self: center;
}
.config-v3-label > span { font-size: 12.5px; font-weight: 560; }
.config-v3-control { grid-area: control; justify-content: flex-start; align-items: center; }
.config-v3-hint {
  grid-area: hint;
  max-width: 520px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.4;
}
.config-v3-control > .setting-input,
.config-v3-control > select.setting-input,
.config-v3-control > input:not([type="checkbox"]):not([type="radio"]),
.config-v3-control > select {
  width: 100%;
  max-width: 520px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background-color: color-mix(in srgb, var(--soft) 62%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  outline: none;
}
.config-v3-control > input:focus,
.config-v3-control > select:focus {
  border-color: var(--strong);
}
.config-v3-control > input::placeholder { color: var(--faint); }
.config-model-card .config-v3-row { min-height: 52px; }

.config-model-toolbar,
.config-model-bulk,
.config-model-table {
  max-width: 680px;
}
.config-model-toolbar > .btn {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}
.config-model-toolbar > .btn:hover {
  background: var(--soft);
  border-color: var(--line-strong);
}
.config-model-toolbar .setting-input {
  height: 40px;
  border-radius: 10px;
  font-size: 12.5px;
}
.config-model-bulk .btn {
  height: 26px;
  padding: 0 7px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  box-shadow: none;
}
.config-model-bulk .btn:hover { color: var(--text); background: var(--soft); }
.config-model-bulk .btn.danger { color: var(--danger); }
.config-model-bulk .btn.danger:disabled {
  color: var(--faint);
  opacity: .45;
  background: transparent;
}
.config-model-count { font-size: 10px; }

.config-detail-foot .btn { height: 40px; padding: 0 18px; border-radius: 10px; font-size: 12.5px; }
.config-detail-foot .btn:not(.primary) {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.config-detail-foot .btn:not(.primary):hover {
  color: var(--text);
  background: var(--soft);
}
.config-detail-foot .btn.primary { min-width: 64px; }
.config-detail-foot {
  padding-right: max(28px, calc((100% - 875px) + 28px));
}
.config-detail-body::-webkit-scrollbar { width: 9px; }
.config-detail-body::-webkit-scrollbar-track { background: transparent; }
.config-detail-body::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--line-strong) 52%, transparent);
  border-radius: 999px;
}
.config-detail-body::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--line-strong) 78%, transparent);
}

/* 模型表轻微降噪：能力选中态、行内删除图标 */
.config-detail .config-cap-chip.on {
  background: var(--soft-2);
  border-color: var(--line-2);
  color: var(--text);
  font-weight: 750;
}
.config-detail .config-model-row .btn.sm {
  opacity: .18;
  color: var(--faint);
}
.config-detail .config-model-row:hover .btn.sm { opacity: .8; }
.config-detail .config-model-row .btn.sm:hover { opacity: 1; color: var(--danger); }

@media (max-width: 820px) {
  .config-detail-body { max-width: none; padding-left: 20px; padding-right: 20px; }
  .config-v3-row { grid-template-columns: 1fr; grid-template-areas: "label" "control" "hint"; gap: 4px; }
  .config-v3-control { justify-content: flex-start; }
  .config-v3-control > input,
  .config-v3-control > select { max-width: none; }
  .config-detail-summary { flex-direction: column; gap: 8px; }
  .config-summary-actions { margin-left: 0; }
}

/* 渠道详情基本连接：标签在上、输入框在下的标准表单 */
.config-v3-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 24px;
  max-width: 680px;
}
.config-v3-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.config-v3-field.full { grid-column: 1 / -1; }
.config-v3-field-label {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 620;
  letter-spacing: .005em;
}
.config-v3-field-control { display: flex; min-width: 0; }
.config-v3-field-control > .setting-input,
.config-v3-field-control > select.setting-input,
.config-v3-field-control > input:not([type="checkbox"]):not([type="radio"]),
.config-v3-field-control > select {
  width: 100%;
  max-width: none;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background-color: color-mix(in srgb, var(--soft) 62%, transparent);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  outline: none;
}
.config-v3-field-control > input:focus,
.config-v3-field-control > select:focus { border-color: var(--strong); }
.config-v3-field-control > input::placeholder { color: var(--faint); }
.config-v3-field-hint {
  margin-top: -4px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.4;
}
@media (max-width: 820px) {
  .config-v3-fields { grid-template-columns: 1fr; max-width: none; gap: 18px; }
  .config-v3-field.full { grid-column: auto; }
}

/* ================================================================
   渠道列表 V3：hairline 卡片 + 列对齐
   ================================================================ */
.config-channel-list { gap: 10px; }
.config-channel-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--line-strong) 42%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--soft-2) 48%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.config-channel-row:hover {
  background: color-mix(in srgb, var(--soft-2) 68%, transparent);
  border-color: color-mix(in srgb, var(--line-strong) 68%, transparent);
  transform: none;
}
.config-channel-row .config-channel-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 12%, transparent);
}
.config-channel-row .config-channel-dot.ok { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 14%, transparent); }
.config-channel-row .config-channel-dot.err { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.config-channel-row .config-channel-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.config-channel-row .config-channel-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.config-channel-row .config-channel-name { font-size: 13.5px; font-weight: 720; letter-spacing: -.01em; }
.config-channel-row .config-channel-protocol {
  flex: none;
  height: 19px;
  padding: 0 7px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--card-solid) 55%, transparent);
  font-size: 9.5px;
  font-weight: 650;
  line-height: 17px;
  white-space: nowrap;
}
.config-channel-row .config-channel-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
}
.config-channel-row .config-channel-key { margin-left: 8px; color: var(--success); font-family: var(--font); font-size: 10px; font-weight: 650; }
.config-channel-row .config-channel-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.config-channel-row .config-channel-count { color: var(--faint); font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.config-channel-row .config-channel-caps { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.config-channel-row .config-channel-state { font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.config-channel-row .config-channel-state.ok { color: var(--success); }
.config-channel-row .config-channel-state.err { color: var(--danger); }
.config-channel-row .config-channel-state.idle { color: var(--faint); }
.config-channel-row .config-channel-time { color: var(--faint); font-size: 10px; white-space: nowrap; }
.config-channel-row .config-channel-actions {
  align-self: center;
  opacity: .55;
  transition: opacity .15s var(--ease);
}
.config-channel-row:hover .config-channel-actions,
.config-channel-row:focus-within .config-channel-actions { opacity: 1; }
.config-channel-row .config-channel-actions .btn.sm { width: 28px; height: 28px; padding: 0; border-radius: 8px; }

@media (max-width: 820px) {
  .config-channel-row { grid-template-columns: 10px minmax(0, 1fr); }
  .config-channel-row .config-channel-actions { grid-column: 2; justify-content: flex-start; opacity: 1; margin-top: 2px; }
}
