/* BODHI Dashboard · css/mpgen.css —— 图/视频生成工坊（#/mpgen）
   组件类（.surface/.btn/.field/.tab-item…）来自 ui.css，这里只放页面私有布局。 */

.mpgen-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) {
  .mpgen-layout { grid-template-columns: 1fr; }
}

/* ── 任务组栏 ─────────────────────────────────────────── */
.mpgen-groups { padding: 10px; position: sticky; top: 0; }
.mpgen-groups-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; padding: 0 4px;
}
.mpgen-groups-title { font-size: 12px; letter-spacing: .08em; color: var(--ink-500, #6b6257); }
.mpgen-group-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer;
  font-size: 13px; line-height: 1.2;
}
.mpgen-group-item:hover { background: rgba(0, 0, 0, .045); }
.dark .mpgen-group-item:hover { background: rgba(255, 255, 255, .06); }
.mpgen-group-item.is-active {
  background: rgba(191, 149, 63, .14);
  font-weight: 600;
}
.mpgen-group-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mpgen-group-count { font-size: 11px; color: var(--ink-400, #99907f); }
.mpgen-group-live {
  font-size: 10px; padding: 0 5px; border-radius: 999px;
  background: rgba(16, 145, 90, .15); color: #0e8a56;
}
.mpgen-group-ops { display: none; gap: 2px; }
.mpgen-group-item:hover .mpgen-group-ops { display: inline-flex; }
.mpgen-group-ops .icon-btn { width: 20px; height: 20px; font-size: 11px; }

/* ── 组合器 ───────────────────────────────────────────── */
.mpgen-composer { padding: 14px 16px; }
.mpgen-kind-tabs { margin-bottom: 12px; }
.mpgen-form-row {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  align-items: flex-end; margin-bottom: 12px;
}
.mpgen-param {
  display: inline-flex; flex-direction: column; gap: 3px;
  font-size: 11px; color: var(--ink-500, #6b6257);
}
.mpgen-dur { width: 72px; }
.mpgen-empty-models {
  padding: 16px; font-size: 13px; color: var(--ink-400, #99907f);
}
.mpgen-gateway-warn {
  padding: 8px 12px; border-radius: 8px; font-size: 12px;
  background: rgba(217, 119, 6, .1); color: #b45309;
}

/* ── 源视频槽 + 编辑操作（编辑/续拍模式专属，与参考素材刻意分开）── */
.mpgen-source {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; margin-bottom: 10px; border-radius: 10px;
  border: 1px dashed rgba(191, 149, 63, .55);
  background: rgba(191, 149, 63, .06);
}
.mpgen-source-chip { border-color: rgba(191, 149, 63, .6); background: rgba(255, 255, 255, .5); }
.dark .mpgen-source-chip { background: rgba(0, 0, 0, .25); }
.mpgen-ops {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px;
}
.mpgen-op-chip {
  border: 1px solid rgba(0, 0, 0, .15); background: none; cursor: pointer;
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  color: var(--ink-500, #6b6257); line-height: 1.4;
}
.dark .mpgen-op-chip { border-color: rgba(255, 255, 255, .16); color: inherit; }
.mpgen-op-chip:hover { border-color: rgba(191, 149, 63, .6); }
.mpgen-op-chip.is-active {
  background: rgba(191, 149, 63, .16); border-color: rgba(191, 149, 63, .7);
  color: #8a6d1d; font-weight: 600;
}

.mpgen-refs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mpgen-label { font-size: 11px; letter-spacing: .08em; color: var(--ink-500, #6b6257); }
.mpgen-refs-hint { font-size: 11px; color: var(--ink-400, #99907f); }
.mpgen-refs-empty {
  font-size: 12px; color: var(--ink-400, #99907f);
  font-style: italic; padding: 4px 0 8px;
}
.mpgen-refs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.mpgen-ref-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px; border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .12);
  font-size: 11px; max-width: 240px;
}
.dark .mpgen-ref-chip { border-color: rgba(255, 255, 255, .14); }
.mpgen-ref-thumb {
  width: 34px; height: 34px; object-fit: cover; border-radius: 5px;
}
.mpgen-ref-icon { font-size: 18px; }
.mpgen-ref-token {
  font-family: ui-monospace, monospace; font-weight: 600;
  color: #8a6d1d; white-space: nowrap;
}
.mpgen-ref-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-500, #6b6257);
}
.mpgen-ref-x {
  border: 0; background: none; cursor: pointer;
  color: var(--ink-400, #99907f); font-size: 11px; padding: 2px;
}
.mpgen-ref-x:hover { color: #b91c1c; }

.mpgen-prompt-wrap { position: relative; }
.mpgen-prompt {
  width: 100%; box-sizing: border-box; resize: vertical;
  padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.55;
  border: 1px solid rgba(0, 0, 0, .15); background: rgba(255, 255, 255, .7);
}
.dark .mpgen-prompt {
  border-color: rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .25);
  color: inherit;
}
.mpgen-mention-menu {
  position: absolute; left: 12px; bottom: calc(100% - 4px);
  z-index: 30; min-width: 200px; max-height: 200px; overflow-y: auto;
  border-radius: 10px; border: 1px solid rgba(0, 0, 0, .12);
  background: #fffdf7; box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
  padding: 4px;
}
.dark .mpgen-mention-menu { background: #221f1a; border-color: rgba(255, 255, 255, .14); }
.mpgen-mention-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 8px; border: 0; background: none; cursor: pointer;
  font-size: 12px; text-align: left; border-radius: 6px;
}
.mpgen-mention-item:hover { background: rgba(191, 149, 63, .14); }
.mpgen-mention-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-400, #99907f);
}

.mpgen-actions {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid rgba(0, 0, 0, .08);
}
.dark .mpgen-actions { border-top-color: rgba(255, 255, 255, .1); }
.mpgen-quote-line { font-size: 12px; color: #0e8a56; }
.mpgen-quote-line.is-bad { color: #b91c1c; }

/* ── 任务卡（左栏文字 + 右栏结果缩略）────────────────── */
.mpgen-task { padding: 12px 14px; }
.mpgen-task.has-result {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px; align-items: start;
}
@media (max-width: 700px) {
  .mpgen-task.has-result { grid-template-columns: 1fr; }
}
.mpgen-task-main { min-width: 0; }
.mpgen-task-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.mpgen-task-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap;
}

/* ── 任务视图切换（单列 / 双列表格）──────────────────── */
.mpgen-tasks-bar {
  display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 8px;
}
.mpgen-tasks-bar .icon-btn.is-active {
  background: rgba(191, 149, 63, .18);
}
.mpgen-tasklist-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start;
}
@media (max-width: 980px) {
  .mpgen-tasklist-cols { grid-template-columns: 1fr; }
}
.mpgen-status {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.mpgen-status-live { background: rgba(2, 132, 199, .12); color: #0369a1; }
.mpgen-status-ok { background: rgba(16, 145, 90, .13); color: #0e8a56; }
.mpgen-status-bad { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.mpgen-status-mute { background: rgba(0, 0, 0, .07); color: var(--ink-500, #6b6257); }
.mpgen-task-spec {
  font-size: 12px; color: var(--ink-500, #6b6257);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mpgen-task-meta { font-size: 11px; color: var(--ink-400, #99907f); white-space: nowrap; }
.mpgen-task-idchip {
  border: 0; background: rgba(0, 0, 0, .05); cursor: copy;
  font-family: ui-monospace, monospace; font-size: 10px;
  color: var(--ink-400, #99907f); padding: 2px 6px; border-radius: 5px;
  white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.dark .mpgen-task-idchip { background: rgba(255, 255, 255, .07); }
.mpgen-task-idchip:hover { color: var(--ink-600, #4c453b); }
.mpgen-task-ops { display: inline-flex; gap: 6px; }
.mpgen-task-prompt {
  margin-top: 6px; font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-wrap;
}
.mpgen-task-progress { margin-top: 6px; font-size: 12px; color: #0369a1; }
.mpgen-task-error {
  margin-top: 6px; font-size: 12px; color: #b91c1c;
  white-space: pre-wrap; word-break: break-all;
}
.mpgen-result {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start;
  justify-content: flex-end; max-width: 208px; align-content: flex-start;
}
@media (max-width: 700px) {
  .mpgen-result { justify-content: flex-start; max-width: none; margin-top: 8px; }
}
/* 缩略图：卡片压矮方便滚动，点开详情 modal 看大图/视频 */
.mpgen-thumb-wrap { position: relative; cursor: zoom-in; }
.mpgen-thumb {
  width: 96px; height: 96px; object-fit: cover; display: block;
  border-radius: 8px; border: 1px solid rgba(0, 0, 0, .1); background: #000;
}
img.mpgen-thumb { background: transparent; }
.mpgen-thumb-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; text-shadow: 0 1px 6px rgba(0, 0, 0, .65);
  pointer-events: none;
}

/* ── 任务详情 modal ───────────────────────────────────── */
.mpgen-modal { width: 760px; padding: 16px 18px; }
.mpgen-modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mpgen-modal-media { display: flex; flex-direction: column; gap: 10px; }
.mpgen-modal-media video {
  width: 100%; border-radius: 10px; background: #000;
}
.mpgen-modal-media img {
  width: 100%; border-radius: 10px; cursor: zoom-in;
}
.mpgen-modal-prompt {
  margin-top: 10px; font-size: 13px; line-height: 1.55; white-space: pre-wrap;
  word-break: break-word;
}
.mpgen-modal .mpgen-task-meta { margin-top: 6px; display: block; white-space: normal; }
.mpgen-modal-ops {
  display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid rgba(0, 0, 0, .08);
}
.dark .mpgen-modal-ops { border-top-color: rgba(255, 255, 255, .1); }

