:root {
  color-scheme: light;
  --bg: #eceff2;
  --panel: #ffffff;
  --text: #17191f;
  --muted: #6c7280;
  --line: #dde1e7;
  --accent: #111318;
  --accent-soft: #f3f0ea;
  --blue: #2f6fed;
  --danger: #b91c1c;
  --soft: #eef2f5;
  --gold: #b99a61;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(17, 19, 24, 0.06), transparent 34%),
    linear-gradient(315deg, rgba(185, 154, 97, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 410px 1fr;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.controls {
  padding: 22px;
  overflow: auto;
  max-height: 100vh;
}

.brand,
.toolbar,
.task-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.brand-logo {
  width: 86px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px;
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand p,
.toolbar p,
.task-card footer p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.brand span {
  display: inline-flex;
  height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0 0 18px;
}

.workflow-strip span {
  display: grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafafa;
  color: #383d46;
  font-size: 12px;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
  font-size: 13px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 154, 97, 0.16);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}

.preview-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.notice {
  padding: 12px;
  border: 1px solid #e7d8b7;
  background: #fffaf0;
  color: #715623;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  margin: 10px 0 14px;
}

.upload-helper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fbfbfb, #f4f5f7);
  margin: 10px 0 14px;
}

.upload-helper strong {
  display: block;
  font-size: 14px;
}

.upload-helper p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.upload-helper a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

button {
  height: 42px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  padding: 0 14px;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, #111318, #323640);
  box-shadow: 0 10px 24px rgba(17, 19, 24, 0.16);
}

.secondary {
  width: 100%;
  margin-top: 10px;
  color: #fff;
  background: #30343b;
}

.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}

.workspace {
  padding: 26px;
  overflow: auto;
  max-height: 100vh;
}

.toolbar {
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid rgba(221, 225, 231, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
}

.toolbar h2 {
  font-size: 24px;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 18px;
}

.task-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(221, 225, 231, 0.92);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(17, 19, 24, 0.07);
}

.task-card header {
  height: 56px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfbfc);
}

.task-card h3 {
  font-size: 15px;
}

.task-card header span {
  min-width: 76px;
  text-align: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  background: var(--soft);
  color: var(--muted);
}

.task-card header span.running,
.task-card header span.creating {
  color: #7c4f03;
  background: #fff3cf;
}

.task-card header span.succeeded {
  color: #275a35;
  background: #e3f3e7;
}

.task-card header span.failed {
  color: var(--danger);
  background: #fee2e2;
}

.refine-box {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  background: #f8f7f4;
}

.refine-box textarea {
  min-height: 74px;
  max-height: 150px;
  font-size: 13px;
}

.refine-actions {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
  margin-top: 8px;
}

.refine-actions button {
  height: 34px;
  font-size: 13px;
  padding: 0 10px;
}

.refine-btn {
  color: #fff;
  background: linear-gradient(135deg, #111318, #383d46);
}

.clear-memory-btn {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.refine-box details {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.refine-box summary {
  cursor: pointer;
  user-select: none;
}

.refine-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.5;
}

.refine-box li {
  margin: 3px 0;
}

.refine-box .empty {
  color: #9aa1ad;
}

.task-card img,
.placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: block;
  object-fit: cover;
  background: #f7f8fa;
}

.placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
}

.task-card footer {
  padding: 12px 14px 14px;
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .app {
    grid-template-columns: 1fr;
  }

  .controls,
  .workspace {
    max-height: none;
  }

  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .task-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

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

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
