/* ---------- 协作群（参考空间 + 群 + 右侧资源面板） ---------- */
#roomsView.page-view.active{padding:0;display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}
.rooms-shell{display:grid;grid-template-columns:240px minmax(0,1fr) 260px;grid-template-rows:minmax(0,1fr);flex:1 1 0;min-height:0;background:var(--panel)}
.rooms-list-pane,.rooms-chat-pane,.rooms-member-pane{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.rooms-list-pane{background:var(--bg-soft);border-right:1px solid var(--line);padding:12px 10px}
.rooms-member-pane{border-left:1px solid var(--line);overflow:auto}
.rooms-space-chip{display:flex;align-items:center;gap:8px;padding:6px 10px;margin-bottom:10px;border:1px solid var(--line);border-radius:999px;background:var(--panel);font-size:12px}
.rooms-space-chip span{flex:none;color:var(--muted);white-space:nowrap}
.rooms-space-chip b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rooms-pane-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 6px 8px;color:var(--muted);font-size:12px}
.rooms-pane-head b{font-weight:600;color:var(--muted)}
.rooms-pane-head em{font-style:normal;margin-left:4px}
.rooms-icon-btn{width:24px;height:24px;display:inline-grid;place-items:center;border:0;border-radius:6px;background:transparent;color:var(--muted);cursor:pointer;font-size:15px;line-height:1}
.rooms-icon-btn:hover{background:var(--line);color:var(--text)}
.room-list{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:2px}
.room-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:8px 10px;border:0;border-radius:8px;background:transparent;color:inherit;cursor:pointer;font:inherit;font-size:13px}
.room-item:hover{background:var(--line)}
.room-item.active{background:var(--panel);box-shadow:0 1px 2px rgba(15,23,42,.08);font-weight:600}
.room-item i{font-style:normal;color:#f08c3a;flex:none}
.room-item span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-item small{color:var(--muted);font-size:11px;font-weight:400}

.rooms-chat-pane{position:relative}
.rooms-chat-head{display:flex;align-items:center;padding:14px 22px;border-bottom:1px solid var(--line)}
.rooms-chat-head b{display:block;font-size:15px}
.rooms-chat-head span{display:block;margin-top:2px;color:var(--muted);font-size:12px}
.room-log{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:12px;padding:20px max(22px,calc((100% - 760px) / 2))}
.room-hero{margin:auto;text-align:center;color:var(--muted)}
.room-hero h2{margin:0 0 8px;font-size:26px;font-weight:600;color:var(--text)}
.room-hero p{margin:0;font-size:13px}
.room-message{max-width:min(600px,86%);padding:10px 14px;border-radius:14px;background:var(--bg-soft)}
.room-message header{font-size:11px;font-weight:600;color:var(--muted);margin-bottom:4px}
.room-message p{margin:0;white-space:pre-wrap;line-height:1.6}
.room-message.mine{align-self:flex-end;background:rgba(83,109,254,.1)}
.room-card{align-self:stretch;max-width:none;background:var(--panel);border:1px solid var(--line);border-left:3px solid #536dfe}
.room-card.failed{border-left-color:var(--red)}
.room-card b{display:block;margin-bottom:4px}
.room-card small{display:block;margin-top:6px;color:var(--muted)}
.room-card button{margin-top:8px}
.room-card-error{color:var(--red);margin-top:6px}
.room-empty{padding:20px 10px;color:var(--muted);text-align:center;font-size:12px}
.room-empty b{display:block;color:var(--text);margin-bottom:4px}

.room-composer{padding:10px max(22px,calc((100% - 760px) / 2)) 18px}
.room-composer-scope{display:inline-flex;align-items:center;gap:6px;margin-bottom:6px;padding:2px 8px;border-radius:6px;background:var(--bg-soft);color:var(--muted);font-size:12px}
.room-composer-scope b{font-weight:500;color:var(--text)}
.room-composer-scope i{font-style:normal;color:#536dfe}
.room-composer-box{position:relative;border:1px solid var(--line);border-radius:16px;background:var(--panel);box-shadow:0 4px 16px rgba(15,23,42,.06)}
.room-composer-box:focus-within{border-color:rgba(83,109,254,.5)}
.room-composer-box textarea{display:block;width:100%;box-sizing:border-box;border:0;outline:0;padding:12px 14px 4px;background:transparent;color:var(--text);resize:none;font:inherit;line-height:1.55}
.room-composer-bar{display:flex;align-items:center;gap:6px;padding:6px 8px 8px}
.room-chip{display:inline-flex;align-items:center;gap:4px;padding:0 4px 0 10px;height:28px;border:1px solid var(--line);border-radius:999px;background:var(--panel);font-size:12px;color:var(--muted);max-width:200px}
.room-chip select{border:0;outline:0;background:transparent;color:var(--text);font:inherit;font-size:12px;max-width:140px;cursor:pointer}
.room-chip.on{border-color:rgba(83,109,254,.45);background:rgba(83,109,254,.06)}
.room-composer-spacer{flex:1}
.room-send{width:30px;height:30px;border:0;border-radius:50%;background:#98a2b3;color:#fff;font-size:16px;cursor:pointer}
.room-send.ready{background:#1f2937}

.room-resources{padding:14px 16px}
.room-res-group{padding:12px 0;border-bottom:1px solid var(--line)}
.room-res-group:last-child{border-bottom:0}
.room-res-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:13px;font-weight:600}
.room-res-head em{font-style:normal;min-width:20px;padding:0 6px;border-radius:999px;background:var(--bg-soft);color:var(--muted);font-size:11px;text-align:center;font-weight:500}
.room-res-item{display:flex;align-items:center;gap:10px;width:100%;padding:6px 4px;border:0;border-radius:8px;background:transparent;color:inherit;text-align:left;font:inherit;cursor:pointer}
.room-res-item:hover{background:var(--bg-soft)}
.room-res-item.picked{background:rgba(83,109,254,.08)}
.room-res-item.static{cursor:default}
.room-res-item.static:hover{background:transparent}
.room-res-icon{flex:none;width:28px;height:28px;display:grid;place-items:center;border-radius:8px;background:var(--bg-soft);font-size:12px;font-weight:700;color:#536dfe}
.room-res-icon.role{background:linear-gradient(135deg,#8b7bff,#5b8cff);color:#fff}
.room-res-icon.sop{background:rgba(34,197,94,.12);color:#16a34a}
.room-res-icon.repo{background:rgba(236,72,153,.1);color:#db2777}
.room-res-text{min-width:0;flex:1}
.room-res-text b{display:block;font-size:12.5px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-res-text small{display:block;color:var(--muted);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-res-more{color:var(--muted);font-size:11px;padding:4px}
.room-member-tag{margin-left:6px;padding:0 6px;border-radius:4px;background:var(--bg-soft);color:var(--muted);font-size:10.5px}

/* ---------- AI 编排助手：占据画布右侧属性栏 ---------- */
.ai-orchestrator-trigger{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 12px;margin-right:6px;border:1px solid rgba(83,109,254,.35);border-radius:8px;background:linear-gradient(135deg,rgba(83,109,254,.1),rgba(124,92,252,.1));color:#4057e3;font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.ai-orchestrator-trigger i,.ai-orchestrator-head i{font-style:normal;color:#7c5cfc}
.flow-workbench.ai-open>#properties{display:none}
.ai-orchestrator{display:flex;flex-direction:column;min-height:0;background:var(--panel);border:1px solid var(--line);border-radius:15px;overflow:hidden}
.ai-orchestrator[hidden]{display:none}
.ai-orchestrator-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line)}
.ai-orchestrator-head b{display:flex;align-items:center;gap:6px;font-size:14px;color:#4057e3}
.ai-orchestrator-log{flex:1;min-height:0;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:8px}
.ai-orchestrator-intro{margin-top:18%}
.ai-orchestrator-intro h3{margin:0 0 10px;font-size:19px;font-weight:600}
.ai-orchestrator-intro h3 em{font-style:normal;background:linear-gradient(90deg,#4f7bff,#7c5cfc);-webkit-background-clip:text;background-clip:text;color:transparent}
.ai-orchestrator-intro p{margin:0 0 22px;color:var(--muted);font-size:12.5px;line-height:1.6}
.ai-orchestrator-suggest-head{display:flex;gap:8px;margin-bottom:8px;color:var(--muted);font-size:12px}
.ai-orchestrator-suggest-head button{border:0;background:transparent;color:#4f7bff;cursor:pointer;font:inherit;font-size:12px;padding:0}
.ai-orchestrator-suggest{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.ai-orchestrator-suggest button{border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:999px;padding:5px 12px;cursor:pointer;font:inherit;font-size:12px;text-align:left}
.ai-orchestrator-suggest button::after{content:" →";color:var(--muted)}
.ai-orchestrator-suggest button:hover{border-color:#4f7bff;color:#4057e3}
.ai-orchestrator-log>p{margin:0;padding:8px 10px;border-radius:10px;background:var(--bg-soft);line-height:1.55;font-size:12.5px;white-space:pre-wrap}
.ai-orchestrator-log>p.mine{align-self:flex-end;max-width:88%;background:rgba(83,109,254,.1)}
.ai-orchestrator-log>p.error{color:var(--red)}
.ai-orchestrator-log>p.step{background:transparent;padding:2px 4px;color:var(--muted);font-size:12px}
.ai-orchestrator-log>p.step::before{content:"✓ ";color:#7c5cfc}
.ai-build-status{margin:0 14px;padding:8px 10px;border-radius:10px;background:rgba(124,92,252,.1);color:#5b43d6;font-size:12px;line-height:1.45}
.ai-orchestrator-form{padding:10px 14px 12px}
.ai-orchestrator-box{position:relative;border:1px solid rgba(83,109,254,.45);border-radius:12px;background:var(--panel)}
.ai-orchestrator-box textarea{display:block;width:100%;box-sizing:border-box;border:0;outline:0;padding:10px 12px 34px;background:transparent;color:var(--text);resize:none;font:inherit;font-size:13px}
.ai-orchestrator-send{position:absolute;right:8px;bottom:8px;width:28px;height:28px;border:0;border-radius:8px;background:#4f7bff;color:#fff;cursor:pointer;font-size:15px}
.ai-orchestrator-send:disabled{opacity:.5;cursor:default}
.ai-orchestrator-form small{display:block;margin-top:6px;color:var(--muted);font-size:11px}
.canvas-ai-entry{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:3;display:flex;flex-direction:column;align-items:center;gap:8px;padding:18px 22px;border:1.5px dashed rgba(83,109,254,.5);border-radius:12px;background:var(--panel);color:var(--text);font:inherit;font-size:13px;font-weight:500;cursor:pointer;box-shadow:0 6px 20px rgba(15,23,42,.06)}
.canvas-ai-entry i{font-style:normal;font-size:20px;color:#4f7bff}
.canvas-ai-entry:hover{border-color:#4f7bff}
.canvas-ai-entry[hidden]{display:none}
.canvas.ai-building::after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 0 2px rgba(124,92,252,.35);border-radius:inherit;animation:aiPulse 1.4s ease-in-out infinite}
.flow-node.ai-just-built{animation:aiNodeIn .45s ease;border-color:#7c5cfc;box-shadow:0 0 0 4px rgba(124,92,252,.18)}
.edges path.edge.ai-just-wired{stroke:#7c5cfc;stroke-dasharray:7 5;animation:aiWire .7s linear}
@keyframes aiNodeIn{from{opacity:0;transform:translateY(10px) scale(.94)}to{opacity:1;transform:none}}
@keyframes aiWire{from{stroke-dashoffset:48}to{stroke-dashoffset:0}}
@keyframes aiPulse{0%,100%{opacity:.35}50%{opacity:1}}
@media (max-width:1100px){
  .rooms-shell{grid-template-columns:200px minmax(0,1fr)}
  .rooms-member-pane{display:none}
}

/* ---------- 群聊：运行进度 / 审批 / 决定 ---------- */
.room-card-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.room-card-actions .button{margin:0}
.room-card-note{display:block;margin-top:6px;color:var(--muted);font-size:12px}
.room-run{margin-top:8px;padding:8px 10px;border-radius:10px;background:var(--bg-soft)}
.room-run-head{display:flex;justify-content:space-between;gap:8px;font-size:12px}
.room-run-head span{color:var(--muted)}
.room-run-track{height:5px;margin:6px 0 4px;border-radius:999px;background:var(--line);overflow:hidden}
.room-run-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#4f7bff,#7c5cfc);transition:width .6s ease}
.room-run.running .room-run-track i,.room-run.waiting .room-run-track i{background-size:200% 100%;background-image:linear-gradient(90deg,#4f7bff,#7c5cfc,#4f7bff);animation:roomFlow 1.6s linear infinite}
.room-run.succeeded .room-run-track i{background:#22c55e}
.room-run.failed .room-run-track i{background:var(--red)}
.room-run small{color:var(--muted);font-size:11.5px}
@keyframes roomFlow{from{background-position:0 0}to{background-position:-200% 0}}
.room-progress{display:flex;gap:10px;align-items:flex-start;max-width:min(640px,92%);animation:roomIn .3s ease}
.room-avatar{flex:none;width:28px;height:28px;display:grid;place-items:center;border-radius:8px;background:linear-gradient(135deg,#8b7bff,#5b8cff);color:#fff;font-size:12px;font-weight:700}
.room-avatar.sop{background:rgba(34,197,94,.12);color:#16a34a;font-size:9px;letter-spacing:.2px}
.room-progress header{display:flex;gap:8px;align-items:baseline;font-size:12px}
.room-progress header span{color:var(--muted);font-size:11px}
.room-progress p{margin:3px 0 0;line-height:1.55;white-space:pre-wrap}
.room-progress p i{font-style:normal;display:inline-block;width:16px;color:#7c5cfc;font-weight:700}
.room-progress.succeeded p i{color:#16a34a}
.room-progress.failed p i,.room-progress.failed p{color:var(--red)}
.room-progress.final p{font-weight:600}
.room-progress details{margin-top:4px;font-size:12px;color:var(--muted)}
.room-progress details p{padding:6px 8px;border-radius:8px;background:var(--bg-soft);color:var(--text)}
.room-approval{border-left-color:#f59e0b;background:linear-gradient(0deg,var(--panel),var(--panel)),rgba(245,158,11,.06)}
.room-approval:not(.resolved){box-shadow:0 0 0 3px rgba(245,158,11,.12)}
.room-approval.resolved{border-left-color:var(--green);opacity:.75}
.room-decision{align-self:center;padding:3px 10px;border-radius:999px;background:var(--bg-soft);color:var(--muted);font-size:12px}
.room-decision b{color:var(--text);font-weight:600}
.room-picks{display:inline-flex;flex-wrap:wrap;gap:4px}
.room-pick{display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 8px;border:1px solid rgba(34,197,94,.4);border-radius:999px;background:rgba(34,197,94,.08);color:#15803d;font:inherit;font-size:11.5px;cursor:pointer}
.room-pick i{font-style:normal;opacity:.6}
@keyframes roomIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* ---------- AI 编排：流式构建效果 ---------- */
.ai-ghost-node{position:absolute;width:228px;height:92px;box-sizing:border-box;padding:14px 16px;border:1.5px dashed rgba(124,92,252,.55);border-radius:14px;background:linear-gradient(110deg,rgba(124,92,252,.06) 8%,rgba(79,123,255,.16) 18%,rgba(124,92,252,.06) 33%);background-size:200% 100%;animation:aiShimmer 1.3s linear infinite;z-index:19;pointer-events:none}
.ai-ghost-node i{display:block;height:10px;margin-bottom:8px;border-radius:6px;background:rgba(124,92,252,.18)}
.ai-ghost-node i:first-child{width:60%}
.ai-ghost-node i:nth-child(2){width:40%}
.ai-ghost-node span{position:absolute;left:16px;bottom:10px;font-size:11.5px;color:#6d4df2}
@keyframes aiShimmer{to{background-position:-200% 0}}
.canvas.ai-relayout .flow-node{transition:left .6s cubic-bezier(.2,.8,.2,1),top .6s cubic-bezier(.2,.8,.2,1)}
.canvas.ai-relayout .edges{opacity:0;transition:opacity .15s}
.canvas.ai-done::before{content:"";position:absolute;inset:0;z-index:30;pointer-events:none;background:linear-gradient(100deg,transparent 30%,rgba(124,92,252,.14) 50%,transparent 70%);background-size:250% 100%;animation:aiSweep 1.4s ease-out forwards}
@keyframes aiSweep{from{background-position:120% 0}to{background-position:-120% 0}}
.ai-live-thought{padding:8px 10px;border-radius:10px;border:1px solid rgba(124,92,252,.25);background:rgba(124,92,252,.05);font-size:12px;line-height:1.55}
.ai-live-thought b{display:flex;align-items:center;gap:6px;margin-bottom:4px;color:#6d4df2;font-weight:600}
.ai-live-thought b i{width:7px;height:7px;border-radius:50%;background:#7c5cfc}
.ai-live-thought.live b i{animation:aiPulse 1s ease-in-out infinite}
.ai-live-thought:not(.live){opacity:.65}
.ai-live-thought:not(.live) b::after{content:"（已完成）";color:var(--muted);font-weight:400}
.ai-live-thought span{display:block;color:var(--muted);white-space:pre-wrap;max-height:84px;overflow:hidden}
.ai-orchestrator-log>p.step.tool::before{content:"⌕ ";color:#4f7bff}
.ai-orchestrator-log>p.warn{background:rgba(245,158,11,.1);color:#b45309}

/* @ 提及弹层、空群引导 */
.room-mention{position:absolute;left:8px;right:8px;bottom:calc(100% + 6px);z-index:30;max-height:300px;overflow:auto;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--panel);box-shadow:0 12px 32px rgba(15,23,42,.16)}
.room-mention-title{padding:6px 8px 8px;font-size:12px;font-weight:600;color:var(--text)}
.room-mention-group{padding:6px 8px 4px;font-size:11px;color:var(--muted)}
.room-mention-item{display:flex;align-items:center;gap:10px;width:100%;padding:6px 8px;border:0;border-radius:8px;background:transparent;color:var(--text);text-align:left;cursor:pointer;font:inherit}
.room-mention-item:hover,.room-mention-item.active{background:rgba(83,109,254,.08)}
.room-mention-item b{display:block;font-size:13px;font-weight:500}
.room-mention-item small{display:block;margin-top:1px;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:420px}
.room-mention-empty{padding:10px 8px;font-size:12px;color:var(--muted)}
.room-link{padding:0;border:0;background:none;color:#536dfe;font:inherit;cursor:pointer}
.room-link:hover{text-decoration:underline}
.room-at{padding:0 2px;border-radius:4px;color:#536dfe;font-weight:500}
.room-at.me{background:rgba(245,158,11,.16);color:#b45309}
.room-guide{margin:auto;max-width:560px;padding:8px 4px;color:var(--text)}
.room-guide h2{margin:0 0 6px;font-size:24px;font-weight:600;text-align:center}
.room-guide-lead{margin:0 0 18px;text-align:center;color:var(--muted);font-size:13px}
.room-guide ol{margin:0;padding:0;list-style:none;counter-reset:guide;display:grid;gap:10px}
.room-guide li{counter-increment:guide;display:grid;grid-template-columns:28px 72px 1fr;align-items:baseline;gap:6px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--panel);font-size:13px;line-height:1.55}
.room-guide li::before{content:counter(guide);display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:rgba(83,109,254,.12);color:#536dfe;font-size:12px;font-weight:600}
.room-guide li span{color:var(--muted)}
.room-guide code{padding:0 4px;border-radius:4px;background:var(--bg-soft);color:#536dfe;font-size:12px}
.room-guide-example{margin-top:12px;padding:8px 12px;border-radius:10px;background:var(--bg-soft)}
.room-guide-example small{color:var(--muted);font-size:11px}
.room-guide-example pre{margin:4px 0 0;font:inherit;font-size:13px;white-space:pre-wrap}
.room-guide-actions{display:flex;justify-content:center;gap:8px;margin-top:14px}
