:root {
  color-scheme: light;
  --paper: #fffdf7;
  --soft: #eef5f0;
  --ink: #201f1b;
  --muted: #706f66;
  --line: #d8ddd2;
  --accent: #bf4f35;
  --accent-dark: #7c3224;
  --green: #23675d;
  --dark: #171916;
  --surface: rgba(255, 253, 247, 0.9);
  font-family: "Arial Unicode MS", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    linear-gradient(180deg, #eff6ef 0%, var(--paper) 42%, #f7f1e7 100%);
  color: var(--ink);
}

h1,
p {
  margin: 0;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 58px) clamp(16px, 4vw, 42px) 52px;
}

.hero {
  max-width: 680px;
  margin-bottom: clamp(28px, 5vw, 46px);
}

h1 {
  color: var(--dark);
  font-size: clamp(38px, 5.4vw, 66px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.studio {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(420px, 1fr);
  gap: clamp(28px, 5vw, 66px);
  align-items: start;
}

.workspace {
  padding-top: 2px;
}

.field {
  display: block;
}

.field + .field {
  margin-top: 15px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 14px;
  font-weight: 850;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  padding: 13px 14px;
  outline: none;
  box-shadow: 0 12px 30px rgba(23, 25, 22, 0.04);
}

textarea {
  min-height: 108px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(178, 95, 53, 0.13);
}

.primary-button {
  width: 100%;
  min-height: 54px;
  margin-top: 18px;
  border: 0;
  border-radius: 8px;
  background: var(--dark);
  color: #fffaf1;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: #211915;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.examples {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.field-note,
.examples-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.field-note {
  margin-top: 8px;
}

.examples-note {
  margin-bottom: 12px;
}

.example-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.example-button {
  border: 1px solid #d7d5c8;
  background: #fff7e8;
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 9px 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.example-button:hover {
  background: #f3ead8;
  transform: translateY(-1px);
}

.case-button {
  background: #eef5f0;
  color: var(--green);
}

.case-button:hover {
  background: #e2eee7;
}

.preview-panel {
  position: relative;
  min-width: 0;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 36px;
  margin-bottom: 14px;
}

.status-text {
  color: var(--green);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.5;
}

.resume-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  padding: 7px 12px;
  cursor: pointer;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2vw, 18px);
  align-items: end;
}

.result-grid.is-empty {
  min-height: clamp(190px, 34vw, 390px);
  grid-template-columns: 1fr;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(238, 245, 240, 0.72));
}

.result-grid.is-loading {
  border-style: solid;
  border-color: rgba(35, 103, 93, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(238, 245, 240, 0.92));
  box-shadow: inset 0 0 0 1px rgba(35, 103, 93, 0.08), 0 18px 48px rgba(35, 103, 93, 0.08);
}

.result-grid.is-error {
  border-color: rgba(191, 79, 53, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 249, 243, 0.84), rgba(255, 241, 232, 0.92));
}

.empty-state {
  color: var(--muted);
  font-size: 15px;
  font-weight: 850;
}

.loading-state,
.notice-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(320px, 86%);
  text-align: center;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(35, 103, 93, 0.16);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.state-title {
  color: var(--dark);
  font-size: 18px;
  font-weight: 900;
}

.state-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.notice-state .state-title {
  color: var(--accent-dark);
}

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

.result-item {
  margin: 0;
  transform: translateY(var(--lift, 0));
}

.result-item:nth-child(2) {
  --lift: -22px;
}

.result-item:nth-child(3) {
  --lift: 12px;
}

.result-item button {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(225, 214, 198, 0.95);
  border-radius: 8px;
  background: #fffaf1;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(23, 25, 22, 0.13);
}

.result-item button {
  cursor: zoom-in;
}

.result-item img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.result-item a {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.result-placeholder {
  display: grid;
  place-items: center;
  gap: 10px;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px dashed rgba(35, 103, 93, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 18px 48px rgba(35, 103, 93, 0.08);
}

.mini-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(35, 103, 93, 0.16);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.preview {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(12, 15, 13, 0.86);
}

.preview[hidden] {
  display: none;
}

.preview img {
  max-width: min(94vw, 620px);
  max-height: 88vh;
  border-radius: 8px;
}

.preview-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 30;
  width: min(440px, calc(100vw - 28px));
  transform: translateX(-50%);
  padding: 15px 18px;
  border: 1px solid rgba(191, 79, 53, 0.28);
  border-radius: 8px;
  background: #fffaf1;
  color: var(--ink);
  box-shadow: 0 18px 55px rgba(23, 25, 22, 0.18);
}

.toast[hidden] {
  display: none;
}

.toast-title {
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 900;
}

.toast-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .studio {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero {
    margin-bottom: 28px;
  }

  .workspace {
    max-width: 560px;
  }

  .result-grid {
    gap: 10px;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 28px 14px 44px;
  }

  h1 {
    font-size: clamp(36px, 11vw, 52px);
  }

  textarea {
    min-height: 104px;
  }

  .result-grid:not(.is-empty) {
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 76vw);
    grid-template-columns: none;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
  }

  .result-item {
    transform: none;
    scroll-snap-align: start;
  }
}
