.design-workspace {
  width: 100%;
  height: calc(100vh - 84px);
  min-height: 680px;
  background: var(--paper);
}

.design-workspace[hidden] { display: none; }

.design-workspace iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper);
}

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 255px minmax(580px, 1fr) 1px; }
  .module-tab { min-width: 145px; padding-inline: 12px; }
  .runtime-badge { overflow: hidden; width: 1px; padding: 0; }
}

@media (max-width: 780px) {
  .design-workspace { height: calc(100vh - 142px); min-height: 620px; }
}

/* ===== 唯一 AI 通道入口（顶栏弹层） ===== */
.topbar .module-tabs{flex-shrink:1}
@media(min-width:1081px){.topbar{padding-left:22px;padding-right:22px}}
.runtime-badge#runtimeBadge{position:relative;display:block;flex:0 0 auto;min-width:0;padding:0;border:0;background:transparent;box-shadow:none;overflow:visible}
.ai-channel-button{height:38px;max-width:390px;display:flex;align-items:center;gap:7px;padding:0 12px;border:1px solid #d9dad5;border-radius:11px;background:#fff;color:#171a22;box-shadow:0 3px 12px rgba(20,28,45,.06);cursor:pointer}
.ai-channel-button:hover,.ai-channel-button[aria-expanded="true"]{border-color:#aeb8cf;background:#fbfcff}
.ai-channel-button b{font-size:11px;white-space:nowrap}
.ai-channel-button small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#606672;font-size:10px;font-weight:650}
.ai-channel-button .ai-channel-text-summary{color:#888d96}
.ai-channel-dot{width:7px;height:7px;flex:0 0 auto;border-radius:50%;background:#5c9a70;box-shadow:0 0 0 3px rgba(92,154,112,.12)}
.ai-channel-chevron{color:#777d87;font-size:13px}
.ai-channel-panel{position:absolute;z-index:80;top:46px;right:0;width:min(430px,calc(100vw - 28px));padding:16px;border:1px solid #d9dad5;border-radius:14px;background:#fff;box-shadow:0 18px 48px rgba(18,25,39,.18);text-align:left}
.ai-channel-panel[hidden]{display:none}
.ai-channel-panel header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:14px}
.ai-channel-panel header div{display:flex;flex-direction:column;gap:3px}
.ai-channel-panel header b{font-size:14px;color:#171a22}
.ai-channel-panel header small{font-size:10px;color:#7a808a}
.ai-channel-panel header button{width:28px;height:28px;border:0;border-radius:8px;background:#f1f2ef;color:#656b75;font-size:18px;cursor:pointer}
.ai-channel-field{display:grid;grid-template-columns:84px minmax(0,1fr);gap:6px 10px;padding:12px 0;border-top:1px solid #ecece8}
.ai-channel-field>span{display:flex;flex-direction:column;gap:2px}
.ai-channel-field>span b{font-size:12px;color:#222630}
.ai-channel-field>span small{font-size:9px;line-height:1.35;color:#858b94}
.ai-channel-field select{height:36px;min-width:0;width:100%;padding:0 9px;border:1px solid #d9dad5;border-radius:9px;background:#fbfbf9;color:#1d2028;font-size:12px;font-weight:700}
.ai-channel-field em{grid-column:2;font-style:normal;font-size:10px;font-weight:700;color:#626873}
.ai-channel-field em.usage-warn{color:#c06a1d}
.ai-channel-usage-row{grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:10px}
.ai-channel-usage-row em{grid-column:auto}
.ai-channel-usage-row button{padding:4px 8px;border:1px solid #d9dad5;border-radius:7px;background:#f7f7f4;color:#4f5662;font-size:9px;font-weight:750;cursor:pointer}
.ai-channel-usage-row button:hover{border-color:#aeb8cf;background:#fff}
.ai-channel-panel>p{margin:4px 0 0;padding:9px 10px;border-radius:8px;background:#f7f3e9;color:#716342;font-size:10px;line-height:1.45}
@media(max-width:1450px){.ai-channel-button{max-width:235px}.ai-channel-text-summary{display:none}}
@media(max-width:1180px){.runtime-badge#runtimeBadge{width:auto;padding:0;overflow:visible}.ai-channel-button{max-width:132px}.ai-channel-button small{display:none}}
@media(max-width:860px){.ai-channel-button{width:42px;padding:0;justify-content:center}.ai-channel-button b,.ai-channel-chevron{display:none}}

@media(min-width:1081px){
  .topbar{grid-template-columns:250px minmax(520px,1fr) 230px;padding:0!important}
  .brand-lockup{gap:11px;padding:13px 16px}.brand-lockup img{width:126px}.brand-lockup small{padding-left:10px}
  .module-tabs{justify-content:flex-start}.module-tab{min-width:130px;padding:0 13px}
  .runtime-badge#runtimeBadge{display:flex;width:230px;padding:0 12px;justify-content:flex-end;overflow:visible}
  .ai-channel-button{width:100%;max-width:218px}
}
@media(min-width:1440px){
  .topbar{grid-template-columns:270px minmax(560px,1fr) 280px}
  .brand-lockup img{width:138px}.module-tab{min-width:140px}
  .runtime-badge#runtimeBadge{width:280px;padding-right:18px}.ai-channel-button{max-width:262px}
}
