/* ============================================================
   layout.css — 应用整体布局：顶栏 / 三栏 / 抽屉 / 状态栏
   ============================================================ */
#app { height: 100vh; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
#topbar {
  height: 50px; flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14px; letter-spacing: .2px; }
.brand-text small { font-size: 10.5px; color: var(--text3); }
.topbar-flow { flex: 1; display: flex; justify-content: center; min-width: 0; }
#flow-name {
  width: 260px; max-width: 32vw; height: 28px; padding: 0 10px;
  text-align: center; font-size: 12.5px;
  border: 1px solid transparent; border-radius: 6px; background: var(--panel2);
  transition: border-color .12s, background .12s;
}
#flow-name:hover, #flow-name:focus { outline: none; border-color: var(--accent); background: #fff; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 3px; }

/* ---------- 主区三栏 ---------- */
#main { flex: 1; display: flex; min-height: 0; }

#palette {
  width: 216px; flex: none;
  display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--border);
  z-index: 20;
}
#inspector {
  width: 292px; flex: none;
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--border);
  z-index: 20;
}
#inspector-body { flex: 1; overflow-y: auto; padding: 10px 12px 20px; }

#editor { flex: 1; position: relative; min-width: 0; display: flex; flex-direction: column; }

/* ---------- 底部抽屉 ---------- */
#drawer {
  height: 208px; flex: none;
  display: flex; flex-direction: column;
  background: var(--panel); border-top: 1px solid var(--border);
  transition: height .18s ease;
}
#drawer.collapsed { height: 33px; }
#drawer.collapsed #drawer-body { display: none; }
#drawer-tabs {
  height: 33px; flex: none; display: flex; align-items: stretch; gap: 2px;
  padding: 0 8px; border-bottom: 1px solid var(--border2); background: var(--panel2);
}
#drawer-tabs .tab {
  padding: 0 12px; font-size: 12px; color: var(--text2);
  border-bottom: 2px solid transparent;
}
#drawer-tabs .tab:hover { color: var(--text); }
#drawer-tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
#drawer-tabs .btn-icon { align-self: center; }
#drawer-body { flex: 1; position: relative; min-height: 0; }
.tab-page { position: absolute; inset: 0; display: none; flex-direction: column; min-height: 0; }
.tab-page.active { display: flex; }
#drawer-body pre {
  flex: 1; margin: 0; padding: 10px 12px; overflow: auto;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
  color: var(--text2); white-space: pre-wrap; word-break: break-all;
}

/* ---------- 状态栏 ---------- */
#statusbar {
  height: 26px; flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 0 12px;
  font-size: 11.5px; color: var(--text2);
  background: var(--panel); border-top: 1px solid var(--border);
}
#statusbar b { color: var(--text); font-weight: 600; }
.status-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

/* ---------- 窄屏提示 ---------- */
@media (max-width: 1080px) {
  #inspector { width: 240px; }
  #palette { width: 190px; }
}
