/* 创作台 v5（方案 B · 卡片分区）：参数栏按 ① 模型 ② 输入 ③ 输出设置 三张卡片分组，底部价格 + 生成整栏横贯；
   结果区大图旁带「本次任务」信息栏，网格视图是带状态角标的画廊。配色沿用 base.css 变量。 */
.compose {
  gap: 12px;
  padding: 18px 18px 0 20px;
  background: var(--surface-sunken);
}

/* ---------- 吸底：价格块 + 生成按钮横贯整栏，合规说明一行 ---------- */
.compose-footer {
  display: grid;
  min-width: 0;
  align-items: center;
  gap: 8px 14px;
  margin: 0 -18px 0 -20px;
  padding: 12px 18px 12px 20px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.compose-footer .generate {
  min-width: 190px;
}

.compose-footer .compliance-strip {
  grid-column: 1 / -1;
}

/* ---------- 结果区：大图 + 任务信息栏 ---------- */
.stage {
  place-items: stretch;
}

.stage > .empty-result {
  place-self: center;
}

.stage-card {
  width: 100%;
  min-height: 100%;
  grid-template-columns: minmax(0, 1fr) 296px;
  grid-template-rows: minmax(0, 1fr);
}

.stage-canvas {
  display: grid;
  min-height: 0;
  padding: 20px;
  background: repeating-conic-gradient(var(--surface-sunken) 0 25%, var(--surface) 0 50%) 0 0 / 22px 22px;
  place-items: center;
}

.stage-canvas .stage-frame {
  width: 100%;
  max-width: 640px;
  margin: 0;
  box-shadow: 0 20px 50px rgba(27, 29, 34, 0.16);
}

.stage-side {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 12px;
  padding: 16px;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--surface-raised);
}

.stage-side h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
}

.stage-kv {
  display: grid;
  margin: 0;
  gap: 6px 10px;
  grid-template-columns: 44px minmax(0, 1fr);
  font-size: 12px;
}

.stage-kv dt {
  color: var(--muted);
}

.stage-kv dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.stage-kv dd .status-pill {
  vertical-align: middle;
}

.stage-prompt {
  max-height: 128px;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted-strong);
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.6;
}

.stage-prompt:empty {
  display: none;
}

.stage-acts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stage-acts a,
.stage-acts button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--accent-text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stage-acts a:hover,
.stage-acts button:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.stage-acts .primary {
  grid-column: 1 / -1;
  min-height: 38px;
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.stage-acts .primary:hover {
  background: var(--accent-hover);
}

.stage-acts button:disabled {
  opacity: 0.5;
}

/* ---------- 网格视图：画廊，状态直接标在图上 ---------- */
.stage-grid {
  gap: 14px;
  padding: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.tile {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.tile:hover {
  border-color: var(--line-strong);
}

.tile[data-selected="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.tile-frame {
  position: relative;
  display: grid;
  overflow: hidden;
  border-radius: 10px;
  background: var(--canvas-bg);
  aspect-ratio: 1;
  place-items: center;
}

.tile-frame[data-ratio="16:9"] {
  aspect-ratio: 16 / 9;
}

.tile-frame[data-ratio="9:16"] {
  aspect-ratio: 9 / 16;
}

.tile-frame[data-kind="audio"] {
  aspect-ratio: 2.4;
}

.tile-frame img,
.tile-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-frame .status-pill {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.tile-frame[data-busy="true"] {
  background:
    linear-gradient(100deg, var(--canvas-bg) 35%, rgba(255, 255, 255, 0.8) 50%, var(--canvas-bg) 65%) 0 0 /
    220% 100%;
  animation: shimmer 1.6s linear infinite;
}

.tile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.tile-meta b {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
