:root {
  --bg: #efe7da;
  --bg-deep: #e1d1bc;
  --paper: rgba(255, 251, 245, 0.9);
  --paper-strong: #fffaf4;
  --ink: #1c1a17;
  --muted: #6b645b;
  --line: rgba(28, 26, 23, 0.1);
  --line-strong: rgba(28, 26, 23, 0.18);
  --accent: #bc5f34;
  --accent-deep: #8d3917;
  --accent-soft: rgba(188, 95, 52, 0.12);
  --olive: #2f584e;
  --shadow: 0 28px 80px rgba(81, 53, 31, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(188, 95, 52, 0.16), transparent 26rem),
    radial-gradient(circle at 85% 15%, rgba(47, 88, 78, 0.11), transparent 28rem),
    linear-gradient(180deg, #f7f0e6 0%, var(--bg) 100%);
}

.shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.brand-block {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Songti SC", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.lead {
  margin: 14px 0 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.status {
  flex-shrink: 0;
  min-height: 52px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  color: var(--muted);
  backdrop-filter: blur(18px);
}

.layout {
  display: grid;
  grid-template-columns: minmax(400px, 470px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.controls {
  position: sticky;
  top: 20px;
  padding: 22px;
}

.results {
  padding: 24px;
  min-height: 72vh;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field > span,
.results-head p,
.hint,
.field-note,
.section-copy,
.size-meta,
.image-preview p {
  color: var(--muted);
}

.field-note,
.size-meta,
.image-preview p,
.section-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.field-wide {
  grid-column: 1 / -1;
}

.grid {
  display: grid;
  gap: 16px;
}

.shared-grid {
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(120px, 1fr));
  margin: 18px 0 20px;
}

.param-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

input,
select,
textarea,
button,
.upload {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  color: var(--ink);
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
  border-color: rgba(188, 95, 52, 0.4);
  box-shadow: 0 0 0 4px rgba(188, 95, 52, 0.1);
}

textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}

button {
  cursor: pointer;
}

button[type="submit"] {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
  font-weight: 700;
  letter-spacing: 0.01em;
}

button[type="submit"]:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

button[disabled] {
  cursor: wait;
  opacity: 0.7;
}

.ghost-button {
  width: auto;
  padding: 11px 14px;
  border-color: var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented input {
  display: none;
}

.segmented label {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-weight: 600;
  cursor: pointer;
}

.segmented input:checked + label {
  border-color: rgba(188, 95, 52, 0.35);
  background: linear-gradient(180deg, rgba(188, 95, 52, 0.18), rgba(188, 95, 52, 0.08));
  color: var(--accent-deep);
}

.mode-hero {
  padding: 18px;
  border: 1px solid rgba(188, 95, 52, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(188, 95, 52, 0.18), transparent 12rem),
    linear-gradient(180deg, rgba(255, 250, 244, 0.96), rgba(249, 240, 230, 0.92));
}

.mode-kicker,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mode-description {
  margin: 10px 0 0;
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.6;
}

.workflow-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.workflow-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(188, 95, 52, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  color: var(--ink);
}

.mode-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.44);
}

.mode-panel > * + * {
  margin-top: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.section-head h3 {
  font-size: 1.42rem;
}

.size-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
}

.size-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.size-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.size-meta {
  margin-top: 12px;
}

.upload {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
}

.upload-tall {
  min-height: 124px;
  border-style: dashed;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 239, 229, 0.84));
}

.upload input {
  display: none;
}

.image-preview {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
}

.image-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 16px;
  background: linear-gradient(180deg, #ece3d6, #e3d5c3);
}

.image-preview-secondary img {
  max-height: 220px;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.results-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  width: auto;
  padding: 10px 14px;
  border-radius: 999px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.filter-chip.is-active {
  border-color: rgba(188, 95, 52, 0.35);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 1.9rem;
  line-height: 1;
}

.spotlight-card {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(188, 95, 52, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(188, 95, 52, 0.14), transparent 12rem),
    rgba(255, 251, 245, 0.82);
}

.spotlight-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.spotlight-state {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
}

.spotlight-copy {
  margin: 14px 0 0;
  color: var(--ink);
  line-height: 1.65;
}

.spotlight-meta,
.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spotlight-meta {
  margin-top: 16px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.empty-state {
  display: grid;
  place-items: start;
  gap: 8px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.38);
}

.empty-state p {
  margin: 0;
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.6;
}

.jobs {
  display: grid;
  gap: 18px;
}

.job-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.job-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.job-heading {
  display: grid;
  gap: 4px;
}

.job-subtitle,
.job-prompt {
  margin: 0;
}

.job-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.job-prompt {
  margin-top: 12px;
  color: var(--ink);
  line-height: 1.6;
}

.job-card[data-state="done"] .job-state {
  color: #24593f;
}

.job-card[data-state="error"] .job-state,
.job-error {
  color: #a03121;
}

.job-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.job-images a {
  display: block;
}

.job-images img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 18px;
  background: linear-gradient(180deg, #ece3d6, #e3d5c3);
}

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

  .controls {
    position: static;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 20px 14px 36px;
  }

  .topbar,
  .stats-grid,
  .shared-grid,
  .media-grid,
  .param-grid,
  .size-fields,
  .section-head,
  .results-head,
  .spotlight-head,
  .job-meta {
    grid-template-columns: 1fr;
    display: grid;
  }

  .status {
    width: 100%;
  }

  .results-filters {
    width: 100%;
  }

  .size-actions {
    margin-top: 12px;
  }
}
