/* 梦兽视频工厂 · 分镜画布右侧抽屉（样式）
 *
 * 布局取舍：抽屉是 fixed 覆盖在右侧，同时给 #messages-view 加 padding-right 让出宽度 ——
 * 这样聊天内容不会被抽屉压住（能一边看板子一边读对话），而不是盖上去靠关掉才看得见。
 * 窄屏（<900px）改成全宽覆盖，不再留白。
 */
:root {
  --mg-canvas-w: 520px;
}

#mg-canvas-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--mg-canvas-w);
  max-width: 86vw;
  display: flex;
  flex-direction: column;
  background: #0c0e13;
  border-left: 1px solid #2a3140;
  box-shadow: -18px 0 40px rgba(0, 0, 0, .45);
  transform: translateX(102%);
  transition: transform .2s ease;
  z-index: 60;
  color: #e8ecf4;
  font: 13px/1.5 -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
}

body.mg-c-open #mg-canvas-drawer {
  transform: translateX(0);
}

/* 让位：只给消息区让宽度，侧栏/输入框不动 */
body.mg-c-open #messages-view {
  padding-right: var(--mg-canvas-w);
  transition: padding-right .2s ease;
}

body.mg-c-narrow #messages-view {
  padding-right: 0;
}

body.mg-c-narrow #mg-canvas-drawer {
  width: 100vw;
  max-width: 100vw;
}

body.mg-c-dragging #mg-canvas-drawer {
  transition: none;
  user-select: none;
}

body.mg-c-dragging iframe {
  pointer-events: none;
}

.mgc-grip {
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 2;
}

.mgc-grip:hover {
  background: rgba(233, 180, 90, .28);
}

.mgc-hd {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a3140;
  flex: 0 0 auto;
  background: #141821;
}

.mgc-title {
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
}

.mgc-sub {
  color: #66718a;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mgc-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.mgc-btn {
  border: 1px solid #2a3140;
  background: transparent;
  color: #9aa6bb;
  border-radius: 7px;
  width: 26px;
  height: 24px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.mgc-btn:hover {
  color: #e8ecf4;
  border-color: #3a4356;
}

.mgc-body {
  flex: 1 1 auto;
  min-height: 0;
  background: #0c0e13;
}

.mgc-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── 手机（窄屏）：全屏覆盖。手机没有「拖宽」概念，但要有够大的点击区和安全区 ── */
@media (max-width: 900px) {
  body.mg-c-narrow #mg-canvas-drawer {
    width: 100vw;
    max-width: 100vw;
    border-left: 0;
    /* 刘海屏 / 手势条：别把内容裁掉 */
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* 抽屉全屏时背景别跟着滚（手指一划跑到后面去了） */
  body.mg-c-narrow.mg-c-open {
    overflow: hidden;
  }

  body.mg-c-narrow .mgc-grip {
    display: none;
  }

  body.mg-c-narrow .mgc-hd {
    padding: 12px 14px;
  }

  body.mg-c-narrow .mgc-sub {
    display: none;
  }

  /* 拇指点击区 ≥44x38 */
  body.mg-c-narrow .mgc-btn {
    width: 44px;
    height: 38px;
    font-size: 16px;
    border-radius: 9px;
  }
}
