:root {
  color-scheme: dark;
  font-family: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #07111f;
  color: #eef4ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(77, 162, 255, 0.18), transparent 32%),
    linear-gradient(180deg, #07111f 0%, #0a1830 100%);
}

body, textarea, button {
  font: inherit;
}

.page-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.hero-card,
.result-card,
.promo-card {
  border: 1px solid rgba(163, 189, 255, 0.18);
  border-radius: 28px;
  background: rgba(9, 19, 38, 0.88);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px);
  /*min-height: 100%;**/
}

.hero-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.result-card,
.promo-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.result-card {
  gap: 0;
}

.promo-card {
  gap: 18px;
}

.eyebrow,
.result-eyebrow,
.field-hint,
.result-meta dt,
.download-link,
.status-message,
#request-id {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow,
.result-eyebrow {
  margin: 0 0 14px;
  color: #83c5ff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.02;
}

h2 {
  font-size: 24px;
}

.hero-copy {
  margin: 18px 0 0;
  line-height: 1.7;
  color: #c8d5ef;
}

.prompt-form {
  margin-top: 28px;
  flex: 1;
}

.field-label {
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 700;
}

.prompt-input {
  width: 100%;
  resize: vertical;
  min-height: 196px;
  padding: 16px 18px;
  border: 1px solid rgba(151, 185, 255, 0.2);
  border-radius: 20px;
  background: rgba(6, 13, 27, 0.88);
  color: #eef4ff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prompt-input:focus {
  border-color: rgba(114, 179, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(88, 159, 255, 0.16);
}

.prompt-input::placeholder {
  color: #7f92b0;
}

.form-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.field-hint {
  margin: 0;
  max-width: 70%;
  color: #9bb0ce;
  font-size: 13px;
  line-height: 1.6;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 148px;
  padding: 14px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #57a7ff, #8869ff);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.submit-button:hover {
  transform: translateY(-1px);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: none;
  animation: spin 0.85s linear infinite;
}

.submit-button.is-loading .button-spinner {
  display: inline-block;
}

.status-panel {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(141, 171, 230, 0.14);
  background: rgba(13, 26, 50, 0.72);
}

.status-panel.is-success {
  border-color: rgba(82, 208, 153, 0.34);
  background: rgba(6, 44, 35, 0.72);
}

.status-panel.is-error {
  border-color: rgba(255, 109, 121, 0.36);
  background: rgba(61, 15, 24, 0.72);
}

.status-title {
  margin: 0 0 10px;
  font-weight: 800;
}

.status-message {
  margin: 0;
  color: #c9d7f0;
  line-height: 1.65;
  word-break: break-word;
}

.result-card.is-empty .download-link {
  visibility: hidden;
}

.result-header,
.promo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.download-link {
  color: #8dc7ff;
  text-decoration: none;
}

.download-link:hover {
  text-decoration: underline;
}

.preview-frame,
.promo-frame {
  margin-top: 22px;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  border: 1px dashed rgba(148, 177, 236, 0.26);
  background: rgba(6, 13, 27, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.preview-frame {
  flex: 1;
}

.promo-frame {
  margin-top: 0;
}

.result-image,
.promo-image {
  width: 100%;
  height: 100%;
  /*object-fit: contain;**/
  display: block;
}

.result-placeholder {
  padding: 28px;
  text-align: center;
  color: #8fa2c0;
  line-height: 1.8;
}

.result-meta {
  margin: 22px 0 0;
  display: grid;
  gap: 18px;
}

.result-meta div {
  padding-top: 18px;
  border-top: 1px solid rgba(141, 171, 230, 0.12);
}

.result-meta dt {
  margin-bottom: 10px;
  color: #8dc7ff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-meta dd {
  margin: 0;
  line-height: 1.7;
  color: #e7efff;
  word-break: break-word;
}

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

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 24px, 680px);
    grid-template-columns: 1fr;
    padding: 24px 0 40px;
    gap: 18px;
  }

  .page-shell {
    align-items: start;
  }

  .hero-card,
  .result-card,
  .promo-card {
    min-height: auto;
  }

  .hero-card,
  .result-card,
  .promo-card {
    padding: 22px;
  }

  .promo-card {
    grid-column: auto;
  }

  .form-footer,
  .result-header,
  .promo-header {
    flex-direction: column;
    align-items: stretch;
  }

  .field-hint {
    max-width: none;
  }

  .submit-button,
  .download-link {
    width: 100%;
    text-align: center;
  }

  .preview-frame,
  .promo-frame {
    border-radius: 20px;
  }

  h2 {
    font-size: 22px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: calc(100% - 16px);
    padding: 16px 0 28px;
    gap: 14px;
  }

  .hero-card,
  .result-card,
  .promo-card {
    padding: 18px;
    border-radius: 20px;
  }

  .prompt-input {
    min-height: 168px;
    padding: 14px 16px;
  }

  .submit-button {
    min-width: 0;
    padding: 13px 18px;
  }

  .status-panel {
    padding: 16px;
  }

  .preview-frame,
  .promo-frame {
    margin-top: 18px;
    border-radius: 18px;
  }

  .result-meta {
    margin-top: 18px;
    gap: 14px;
  }

  .result-meta div {
    padding-top: 14px;
  }

  .hero-copy,
  .status-message,
  .result-meta dd {
    line-height: 1.6;
  }
}
