.task-hero-intro {
  margin: 14px 0 0;
  max-width: 840px;
  color: var(--muted);
  font-size: 17px;
}

.task-center-shell {
  display: grid;
  gap: 20px;
}

.task-columns {
  display: grid;
  gap: 20px;
}

.task-column {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.task-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.task-column-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.task-count {
  min-width: 36px;
  height: 30px;
  border-radius: 999px;
  background: #edf1ff;
  color: #3554b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.task-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.task-stat-pill em {
  font-style: normal;
}

.task-stat-processing {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.14);
}

.task-stat-done {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
}

.task-stat-fail {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
}

.task-grid-image {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.task-image-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #e7ebf3;
  background: #f8fafc;
  aspect-ratio: 1 / 1;
}

.task-image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.task-generating-stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f7f9ff, #eef3ff);
  position: relative;
  overflow: hidden;
}

.task-generating-stage::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 180deg, rgba(61, 109, 242, 0), rgba(61, 109, 242, 0.25), rgba(61, 109, 242, 0));
  animation: taskRotate 2.2s linear infinite;
}

.task-generating-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid rgba(61, 109, 242, 0.15);
  border-top-color: #3d6df2;
  position: relative;
  z-index: 1;
  animation: taskSpin 1s linear infinite;
}

.task-generating-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3d6df2;
  position: absolute;
  bottom: 24%;
  opacity: 0.35;
  z-index: 1;
  animation: taskDotPulse 1.2s ease-in-out infinite;
}

.task-generating-dot-1 {
  left: calc(50% - 16px);
  animation-delay: 0s;
}

.task-generating-dot-2 {
  left: calc(50% - 4px);
  animation-delay: 0.2s;
}

.task-generating-dot-3 {
  left: calc(50% + 8px);
  animation-delay: 0.4s;
}

@keyframes taskSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes taskRotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes taskDotPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  50% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

.task-image-card.is-clickable {
  cursor: zoom-in;
}

.task-card-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(10, 14, 25, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.task-image-card:hover .task-card-delete,
.task-image-card:focus-within .task-card-delete {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.task-card-delete:hover {
  background: rgba(185, 28, 28, 0.92);
}

.task-image-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.task-image-badge {
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1;
  background: rgba(12, 18, 30, 0.56);
  color: #fff;
}

.task-image-status {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(30, 64, 175, 0.88);
  color: #fff;
}

.task-image-card.status-done .task-image-status {
  background: rgba(5, 150, 105, 0.9);
}

.task-image-card.status-fail .task-image-status {
  background: rgba(220, 38, 38, 0.9);
}

.task-image-card.status-fail {
  background: #fff;
}

.task-image-card.status-fail img {
  display: none;
}

.task-image-overlay {
  position: absolute;
  inset: auto 8px 8px 8px;
  display: grid;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.task-image-card.status-done:hover .task-image-overlay,
.task-image-card.status-done:focus-within .task-image-overlay {
  opacity: 1;
  transform: translateY(0);
}

.task-download-btn {
  height: 34px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(90deg, #5a5cf0, #6b4cff);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.task-image-link {
  background: rgba(10, 14, 25, 0.7);
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-image-fail {
  position: absolute;
  inset: 36px 24px 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: #9f1239;
  background: transparent;
  border-radius: 0;
  padding: 0;
  word-break: break-word;
}

.task-image-pending {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  line-height: 1.3;
  color: #1e3a8a;
  background: rgba(238, 242, 255, 0.95);
  border-radius: 8px;
  padding: 6px 8px;
}

.task-empty-card {
  grid-column: 1 / -1;
  border: 1px dashed #d7dfef;
  border-radius: 14px;
  background: #f9fbff;
  color: #60708f;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}

.task-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.task-page-btn {
  border: 1px solid #d8deec;
  background: #fff;
  color: #2f3d57;
  border-radius: 999px;
  min-width: 94px;
  height: 38px;
  cursor: pointer;
  font-weight: 600;
}

.task-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.task-page-text {
  color: #67758f;
  font-size: 14px;
}

.task-network-tip {
  margin: 0;
  text-align: center;
  color: #b45309;
  font-size: 13px;
}

.task-preview-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 14, 25, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.task-preview-mask.is-open {
  display: flex;
}

.task-preview-dialog {
  max-width: 1000px;
  width: 100%;
  position: relative;
}

.task-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) 320px;
  gap: 20px;
  align-items: stretch;
}

.task-preview-media img {
  width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 14px;
  background: #111827;
}

.task-preview-side {
  min-width: 0;
  background: #1f2430;
  color: #eef2ff;
  border-radius: 14px;
  padding: 22px 20px;
  display: grid;
  align-content: start;
  gap: 18px;
  max-height: 85vh;
  overflow: auto;
}

.task-preview-section {
  display: grid;
  gap: 10px;
}

.task-preview-section h3 {
  margin: 0;
  font-size: 14px;
  color: #f8fafc;
}

.task-preview-prompt {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #dbe4ff;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-preview-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-preview-reference-item {
  width: 56px;
  height: 56px;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.task-preview-reference-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.task-preview-reference-empty {
  margin: 0;
  font-size: 13px;
  color: #9aa6c3;
}

.task-preview-download {
  min-height: 48px;
  border-radius: 12px;
  background: linear-gradient(90deg, #5a5cf0, #6b4cff);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.task-preview-close {
  position: absolute;
  top: -42px;
  right: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}

@media (max-width: 1200px) {
  .task-grid-image {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .task-grid-image {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .task-grid-image {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-column {
    padding: 14px;
    border-radius: 20px;
  }

  .task-column-head h2 {
    font-size: 20px;
  }

  .task-preview-layout {
    grid-template-columns: 1fr;
  }

  .task-preview-media img,
  .task-preview-side {
    max-height: none;
  }
}

@media (max-width: 480px) {
  .task-grid-image {
    grid-template-columns: 1fr;
  }

  .task-preview-mask {
    padding: 14px;
  }

  .task-preview-side {
    padding: 16px;
  }
}
