/* BJS 面板 Z0 层 - 左下角，基于原 manual-bjs-panel */
#bjs-main-panel {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: min(80vw, 1200px);
  max-width: 1200px;
  height: 700px;                    /* 展开时的高度 */
  z-index: 2;
  background: rgba(20, 20, 40, 0.94);
  border: 2px solid #ffcc33;
  border-radius: 12px;
  color: #fff5cc;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  resize: both;                     /* 展开时允许自由拉伸 */
  transition: height 0.2s ease;     /* 折叠动画（可选） */
}

#bjs-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  height: 40px;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid #ffcc33;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

#bjs-toggle-panel-btn {
  background: none;
  border: none;
  color: #ffcc33;
  font-size: 18px;
  cursor: pointer;
}

#bjs-code-input {
  margin: 10px;
  padding: 10px;
  background: #0a0a1a;
  border: 1px solid #ffcc33;
  color: #9eff9e;
  font-family: 'Fira Code', monospace;
  font-size: 24px;
  flex: 1;
  resize: none;
  box-sizing: border-box;
}

#bjs-button-bar {
  display: flex;
  gap: 12px;
  padding: 0 10px 10px 10px;
}

#bjs-button-bar button {
  padding: 8px 20px;
  border: none;
  color: white;
  font-weight: bold;
  cursor: pointer;
  border-radius: 8px;
  font-size: 14px;
}

#bjs-exec-btn         { left: 0;    width: 160px; background: #2c8c2c; }
#bjs-clear-code-btn   { left: 200px; width: 140px; background: #dc2626; }
#bjs-undo-btn         { left: 380px; width: 100px; background: #f0ad4e; }

#bjs-log-output {
  margin: 0 10px 10px 10px;
  height: 150px;
  background: #0a0a1a;
  border: 1px solid #ffcc33;
  color: #ffaaaa;
  font-family: monospace;
  font-size: 14px;
  overflow-y: auto;
  padding: 8px;
  white-space: pre-wrap;
}

/* ========== 折叠状态（完全由 CSS 控制） ========== */
#bjs-main-panel.collapsed {
  height: 40px !important;          /* 强制覆盖内联样式 */
  resize: none !important;          /* 折叠时禁止拉伸 */
  transition: height 0.2s ease;     /* 动画 */
}

#bjs-main-panel.collapsed #bjs-code-input,
#bjs-main-panel.collapsed #bjs-button-bar,
#bjs-main-panel.collapsed #bjs-log-output {
  display: none !important;
}