/* Agent Workflow UI — P0 流程条，对齐 agent-panel / 星宸暗色 */

.awf-root {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--agent-line, rgba(148, 163, 184, 0.22));
  background: linear-gradient(180deg, rgba(61, 154, 122, 0.08), transparent 70%);
}

.awf-bar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.awf-bar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.awf-bar-title strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--agent-ink, var(--xc-text, #e8eef4));
}

.awf-bar-title span {
  font-size: 11px;
  color: var(--agent-ink3, var(--xc-muted, #94a3b8));
}

.awf-bar-current {
  font-size: 12px;
  font-weight: 600;
  color: #f2e3ad;
  max-width: 100%;
  text-align: right;
}

.awf-track {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.awf-step {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.28);
  color: var(--agent-ink2, #cbd5e1);
  border-radius: 999px;
  padding: 5px 10px 5px 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

html:not(.theme-dark):not(.studio-theme-dark) .awf-step {
  background: rgba(255, 255, 255, 0.75);
  color: #334155;
}

.awf-step:hover {
  border-color: rgba(61, 154, 122, 0.45);
  background: rgba(61, 154, 122, 0.12);
}

.awf-step.is-active {
  border-color: rgba(61, 154, 122, 0.65);
  background: rgba(61, 154, 122, 0.22);
  color: rgba(242,227,173,.25);
}

html:not(.theme-dark):not(.studio-theme-dark) .awf-step.is-active {
  color: #8a6d1f;
}

.awf-step.is-done:not(.is-active) {
  opacity: 0.72;
}

.awf-step-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  background: rgba(242, 227, 173, 0.2);
  color: inherit;
}

.awf-step.is-active .awf-step-idx {
  background: rgba(61, 154, 122, 0.45);
}

.awf-dash {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.28);
}

html:not(.theme-dark):not(.studio-theme-dark) .awf-dash {
  background: rgba(255, 255, 255, 0.65);
}

.awf-dash-summary {
  font-size: 13px;
  line-height: 1.4;
  color: var(--agent-ink, #e2e8f0);
}

.awf-dash-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 11px;
  color: var(--agent-ink3, #94a3b8);
}

.awf-dash-actions-lab {
  font-size: 11px;
  font-weight: 700;
  color: var(--agent-ink3, #94a3b8);
  margin-bottom: 4px;
}

.awf-dash-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.awf-action-chip {
  appearance: none;
  border: 1px solid rgba(242, 227, 173, 0.35);
  background: rgba(242, 227, 173, 0.12);
  color: #f2e3ad;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
}

html:not(.theme-dark):not(.studio-theme-dark) .awf-action-chip {
  color: #8a6d1f;
  background: rgba(242, 227, 173, 0.1);
}

.awf-action-chip:hover {
  background: rgba(242, 227, 173, 0.24);
}

.awf-dash-nodes {
  font-size: 12px;
  color: #f2e3ad;
}

.awf-dash-error {
  font-size: 12px;
  color: #fecaca;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .3);
}

/* P3 消息内下一步 */
.awf-inline-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--agent-line, rgba(148, 163, 184, .3));
}
.awf-inline-lab {
  font-size: 11px;
  font-weight: 700;
  color: var(--agent-ink3, #94a3b8);
  margin-bottom: 6px;
}
.awf-inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 面板内嵌流程条（画布助手无 shell bar 时） */
.agent-panel-workflow-host {
  flex: 0 0 auto;
  max-height: 38vh;
  overflow: auto;
  border-bottom: 1px solid var(--agent-line, rgba(148, 163, 184, .22));
}

/* 快捷按钮阶段归属：弱化非当前阶段视觉中心 */
#studioAgentPanel .agent-quick-chip.awf-tagged[data-workflow-stage="idea"],
#studioAgentPanel .agent-quick-chip.awf-tagged[data-workflow-stage="brief"] {
  box-shadow: inset 0 0 0 1px rgba(61, 154, 122, 0.35);
}

#studioAgentPanel.awf-stage-script .agent-quick-chip.awf-tagged:not([data-workflow-stage="script"]),
#studioAgentPanel.awf-stage-storyboard .agent-quick-chip.awf-tagged:not([data-workflow-stage="storyboard"]):not([data-workflow-stage="nodes"]),
#studioAgentPanel.awf-stage-nodes .agent-quick-chip.awf-tagged:not([data-workflow-stage="nodes"]):not([data-workflow-stage="storyboard"]),
#studioAgentPanel.awf-stage-render .agent-quick-chip.awf-tagged:not([data-workflow-stage="render"]),
#studioAgentPanel.awf-stage-assets .agent-quick-chip.awf-tagged:not([data-workflow-stage="assets"]) {
  opacity: 0.55;
}

/* 宿主：插在助手面板顶部，不挡底部输入 */
#studioWorkflowBar.xc-workflow-host {
  flex: 0 0 auto;
  max-height: 42vh;
  overflow: auto;
  z-index: 2;
}

#studioAgentPanel.agent-deck {
  display: flex;
  flex-direction: column;
}

#studioAgentPanel.agent-deck > #studioAgentPanelRoot {
  flex: 1 1 auto;
  min-height: 0;
}

@media (max-width: 720px) {
  .awf-root {
    padding: 8px 8px 6px;
  }
  .awf-bar-current {
    text-align: left;
    width: 100%;
  }
  .awf-step-lab {
    /* 窄屏仍显示文字，靠横向滚动 */
  }
  #studioWorkflowBar.xc-workflow-host {
    max-height: 34vh;
  }
}


/* 操作 chips 提亮（金色更明确） */
.awf-action-chip {
  background: rgba(242, 227, 173, 0.2) !important;
  color: #f2e3ad !important;
  border-color: rgba(242, 227, 173, 0.5) !important;
}
.awf-action-chip:hover {
  background: rgba(242, 227, 173, 0.38) !important;
  color: #14100a !important;
}
