/* 图片工作台专属样式 */
.img-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 38%);
  gap: 26px;
}

.img-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.img-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.prompt-ops {
  display: flex;
  gap: 6px;
}

.prompt-field {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.prompt-field .prompt-box {
  flex: 1;
  min-height: 200px;
}

.mode-tabs {
  display: flex;
  gap: 8px;
}

.mode-tab {
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(var(--ink), 0.04);
  color: var(--text-2);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.mode-tab:hover { border-color: var(--purple-line); color: var(--purple-deep); }

.mode-tab.active {
  background: linear-gradient(100deg, #6a58e8, #8272f2);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(106, 88, 232, 0.26);
}

/* 生图类型：单选框一行（普通生图 / 故事板 / 过人脸） */
.ct-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.03);
}

.ct-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2, #b9b9b9);
  cursor: pointer;
  user-select: none;
}

.ct-item input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #8b74f8;
  cursor: pointer;
}

.ct-item:hover { color: var(--text, #ededed); }
.ct-item:has(input:checked) { color: var(--text, #ededed); font-weight: 600; }

/* 生成前缀：多行输入，跟提示词框一样按深色写 */
.ct-prefix {
  width: 100%;
  min-height: 78px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  background: #101012;
  color: var(--text, #ededed);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}

.ct-prefix::placeholder { color: var(--hint, #6d6d6d); }

/* .field 自己的 display 会盖掉 [hidden]，这里显式声明 */
.field[hidden] { display: none !important; }

/* 参考图空态沿用 styles.css 的 .gallery.is-empty 规则 */
.img-side .gallery { flex: 1; min-height: 0; }

/* ---------------- 生成结果 ---------------- */
.img-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.img-result-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #0a0a0b;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.img-result-card.is-completed { border-color: rgba(139, 116, 248, 0.34); }
.img-result-card.is-failed { border-color: rgba(255, 106, 106, 0.3); }

.irc-media {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #101012;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.irc-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.irc-media a { display: block; width: 100%; height: 100%; }

/* 一次多张：卡片里 2 列小图，点任意一张看原图 */
.irc-media.is-multi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  align-items: stretch;
}
.irc-media.is-multi a { width: 100%; height: auto; aspect-ratio: 3 / 4; overflow: hidden; }
.irc-media.is-multi img { object-fit: cover; }

.irc-dlrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.irc-dl-item {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-2, #b9b9b9);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}
.irc-dl-item:hover { color: #fff; background: rgba(106, 88, 232, 0.72); border-color: transparent; }

.irc-ph {
  font-size: 12px;
  color: var(--hint, #6d6d6d);
  padding: 10px;
  text-align: center;
}

.irc-meta { padding: 10px 11px 12px; min-width: 0; }

.irc-name {
  font-size: 13px;
  color: var(--text, #ededed);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.irc-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--sub, #8b8b8b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.irc-state { margin-top: 5px; font-size: 11px; color: var(--text-2, #b9b9b9); }

.img-result-card.is-failed .irc-state { color: #ff8f8f; }

.irc-dl {
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  color: #fff;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

.irc-dl:hover { background: rgba(106, 88, 232, 0.72); border-color: transparent; }

/* 下拉里「上游不可用」的项：置灰 + 不可点 */
.select-menu .option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.select-menu .option.is-disabled .opt-sub { color: #ff8f8f; }

@media (max-width: 1180px) {
  .img-layout { grid-template-columns: minmax(0, 1fr); }
  .img-result-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}

/* 任务名称 / 积分 / 生成按钮：放右栏底部，与左侧提示词框底栏齐平（对齐视频工作台方案甲，2026-11-18） */
.img-side .foot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.img-side .foot-row .flabel {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
}

.img-side .foot-row .text-input {
  flex: 1 1 120px;
  min-width: 96px;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  font-size: 12.5px;
}

.img-side .foot-row .name-counter {
  flex: 0 0 auto;
  font-size: 11px;
}

.img-side .foot-row .total {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
}

.img-side .foot-row .total b {
  font-size: 16px;
}

.img-side .foot-row .btn-primary {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  white-space: nowrap;
}

/* 窄一点时把「积分」两个字收掉，只留数字 */
@media (max-width: 1320px) {
  .img-side .foot-row .total .unit {
    display: none;
  }
}

/* 手机（<=760）：一行挤不下就自动换行，任务名称在上、积分和按钮在下 */
@media (max-width: 760px) {
  .img-side .foot-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .img-side .foot-row .total {
    margin-left: auto;
  }
  .img-side .foot-row .btn-primary {
    height: 38px;
  }
}

/* 单栏布局（<=1180）时这行会占满整行，给输入框更多空间 */
@media (max-width: 1180px) {
  .img-side .foot-row {
    margin-top: 4px;
  }
  .img-side .foot-row .text-input {
    flex: 1 1 auto;
  }
}

/* 结果卡片底部操作按钮（复用 / 下载 / 删除），对齐视频工作台作品卡片 */
.img-result-card .vd-actions {
  gap: 6px;
  margin: 0 11px 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.img-result-card .vd-btn {
  min-height: 30px;
  padding: 0 4px;
  gap: 4px;
  font-size: 11px;
  border-radius: 7px;
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-2, #b9b9b9);
}

.img-result-card .vd-btn svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.img-result-card .vd-btn.vd-del {
  color: #FF7B72;
}

.img-result-card .vd-btn.vd-del svg {
  stroke: #FF7B72;
}

.img-result-card .vd-btn:hover {
  background: rgba(139, 116, 248, 0.14);
  border-color: rgba(139, 116, 248, 0.42);
  color: #cbbfff;
}

.img-result-card .vd-btn.vd-del:hover {
  background: rgba(255, 91, 91, 0.12);
  border-color: rgba(255, 91, 91, 0.42);
  color: #ff8f8f;
}

/* 结果卡片缩略图可点击（打开详情弹窗） */
.irc-media { cursor: pointer; }

/* 图片详情弹窗：图片缩小并居中，按原比例自适应（参考红框约 30% 宽） */
.img-detail-imgs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
  align-items: center;
}

.img-detail-img {
  width: auto;
  max-width: 480px;
  max-height: 60vh;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--d-line, rgba(255, 255, 255, 0.1));
  background: #101012;
}
