/* M13：工具台 · 公共任务队列样式（从 tools_scene.css 原样搬过来的「任务卡那一组」）。
 *
 * 为什么单独一份：6 个工具都要任务列表，样式复制 6 份必然跑偏。
 * 类名沿用 `ts-task*`（搬过来时一个字没改），所以主图换场景的观感与 M12 完全一致。
 * ⚠️ tools_scene.css 里还有「画板 / 上传区 / 选项区」等别的东西在用（买家秀两个页面也引它），
 *    所以那份文件不能删、不能改名，只是把本文件里的这组规则搬走了。
 */

.ts-tasks-wrap {
  margin-top: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 20px 20px;
  background: #fff;
}

.ts-tasks-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e5e7eb;
}

.ts-tasks-title {
  font-weight: 600;
  color: #111827;
}

.ts-session {
  flex: 1;
  font-size: 12px;
  color: #6b7280;
}

.ts-clear {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.ts-clear:disabled {
  color: #cbd5e1;
  border-color: #eef1f5;
  cursor: not-allowed;
}

.ts-task-empty {
  margin-top: 12px;
  font-size: 13px;
  color: #9ca3af;
}

.ts-tasks {
  /* C63：一行 4 个（老板：「列队可以不用占满一个横屏，可以一排放四个，高度高一些」） */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
  align-items: start;
}

.ts-task {
  border: 1px solid #e5e7eb;
  border-left: 4px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  /* C63：卡片高一些 + 纵向撑满，卡窄了内容也不会挤成一团 */
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.ts-task.is-queued {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.ts-task.is-running {
  border-left-color: var(--brand-strong, #5BC85A);
  background: #f8fbff;
}

.ts-task.is-done {
  border-left-color: #16a34a;
}

.ts-task.is-failed {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.ts-task-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ts-task-no {
  font-weight: 700;
  color: #6b7280;
  font-size: 13px;
}

.ts-task-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.ts-task-title {
  font-size: 13px;
  color: #374151;
  flex: 1;
  /* C63：窄卡里标题省略，不要撑破卡片 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-task-state {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.ts-task-body {
  flex: 1 1 auto;
  margin-top: 10px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.7;
}

/* 任务卡里的结果网格：比整页的 .tc-result-grid 小一号，一屏能放下多张卡 */
.ts-task-grid {
  display: grid;
  /* C63：卡窄了（4 列）→ 单元格门槛下调，图不变形 */
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.ts-task-grid .tc-img-box {
  min-height: 110px;
}

.ts-task-grid .tc-img-box img {
  max-height: none;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* C63：窄屏降级（4 列在小屏会挤爆） */
@media (max-width: 1440px) {
  .ts-tasks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .ts-tasks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .ts-tasks {
    grid-template-columns: 1fr;
  }
}

.ts-task-err {
  color: #b91c1c;
  font-weight: 600;
}

.ts-task-refund {
  color: #047857;
  margin-top: 2px;
}

.ts-tasks-note {
  margin-top: 14px;
  font-size: 12px;
  color: #9ca3af;
}
