/* UI UX patch 2026-06-09 */

/* 1 创意：按钮不要占满宽 */
.btn-start-creative {
  display: inline-block;
  width: auto;
  min-width: 120px;
  max-width: 200px;
  padding: 8px 18px;
  font-size: 0.8125rem;
}

.idea-source-panel .btn-start-creative {
  margin-top: 4px;
}

.creative-preview-wrap {
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  overflow: hidden;
}

.creative-preview-wrap #creativeContent.creative-preview {
  width: 100%;
  box-sizing: border-box;
  min-height: 8rem;
  max-height: none;
  resize: none;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 0.88rem;
  line-height: 1.55;
}

.creative-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: rgba(8, 14, 28, 0.55);
}

.creative-preview-actions.hidden {
  display: none !important;
}

body.drama-premium #page-params .params-page-actions {
  flex-shrink: 0;
  margin-top: 0;
}

body.drama-premium #page-idea .creative-preview-wrap {
  flex-shrink: 0;
  margin-top: 8px;
}

body.drama-premium #page-idea .idea-content-heading:not(.hidden) {
  flex-shrink: 0;
  margin: 8px 0 4px;
}

body.drama-premium #page-idea .idea-confirm-actions,
body.drama-premium #page-outline .outline-page-actions {
  flex-shrink: 0;
  margin-top: 0;
}

#ownScriptPreview.own-script-preview {
  width: 100%;
  box-sizing: border-box;
  min-height: 8rem;
  max-height: none;
  resize: none;
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.55;
}

/* 4 各页 viewport 内边距与成片参数一致 */
body.drama-premium .drama-page-viewport {
  box-sizing: border-box;
  padding: 0 2px 4px;
}

body.drama-premium .drama-page-viewport-media,
body.drama-premium .drama-page-viewport-download {
  padding: 0 2px 4px;
}

body.drama-premium .idea-source-wrap {
  padding: 0;
}

body.drama-premium .idea-source-panel .form-group:last-child,
body.drama-premium .idea-source-panel .btn-row {
  margin-bottom: 0;
}

/* 5 分镜：外框可滚动，显示全部镜头 */
body.drama-premium #page-storyboard .drama-page-viewport {
  overflow-y: auto !important;
  scrollbar-width: thin;
}

body.drama-premium #page-storyboard .drama-page-viewport::-webkit-scrollbar {
  width: 6px;
}

body.drama-premium .storyboard-panel {
  overflow: visible !important;
  height: auto !important;
  display: block !important;
  min-height: min-content;
}

body.drama-premium .storyboard-table-wrap {
  overflow: visible !important;
  max-height: none !important;
  flex: none !important;
}

body.drama-premium .storyboard-table tbody tr {
  vertical-align: top;
}

body.drama-premium .storyboard-cell-scroll {
  max-height: none;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 6 帮助弹窗 */
.drama-help-card {
  max-width: 520px;
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
}

.drama-help-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  padding: 4px 2px 12px;
}

.drama-help-section {
  margin: 0 0 14px;
}

.drama-help-section h3 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--drama-ink, #e8e8ec);
}

.drama-help-section p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--drama-muted, #a1a1aa);
}

/* 7 项目修复按钮 */
.btn-project-repair {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(251, 191, 36, 0.18);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-project-repair:hover {
  color: #fff;
  background: rgba(251, 191, 36, 0.28);
}

.btn-project-repair:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 3 岗位 chip：弱化易误解的状态角标 */
.agent-crew-chip-badge {
  font-size: 0.62rem;
  opacity: 0.92;
}

.agent-crew-chip.is-done_step .agent-crew-chip-badge,
.agent-crew-chip.is-idle .agent-crew-chip-badge,
.agent-crew-chip.is-coordinating .agent-crew-chip-badge,
.agent-crew-chip.is-offline .agent-crew-chip-badge,
.agent-crew-chip.is-standby .agent-crew-chip-badge,
.agent-crew-chip.is-lead .agent-crew-chip-badge {
  display: none;
}

.agent-dock-composer {
  padding: 0 2px;
}

.agent-dock-composer-row {
  gap: 6px;
  align-items: flex-end;
}

body.drama-premium .agent-dock-input,
body.drama-premium .agent-dock-input.form-control {
  min-height: 72px !important;
  max-height: 128px !important;
  height: auto !important;
  overflow-y: auto !important;
  padding: 10px 12px !important;
  line-height: 1.45 !important;
}
