:root {
  --pink: #ff6b9d;
  --pink-strong: #ff4d88;
  --navy: #1a1a5e;
  --navy-deep: #111144;
  --cream: #fff5f8;
  --white: #fffdfd;
  --line: rgba(26, 26, 94, 0.14);
  --panel-bg: rgba(255, 255, 255, 0.96);
  --shadow: 0 28px 90px rgba(26, 26, 94, 0.14);
  --shadow-soft: 0 16px 50px rgba(26, 26, 94, 0.08);
  --success: #1d9b6c;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Avenir Next", "Noto Sans TC", "PingFang TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--navy);
  background:
    radial-gradient(circle at top left, rgba(255, 107, 157, 0.22), transparent 26%),
    radial-gradient(circle at 90% 16%, rgba(26, 26, 94, 0.12), transparent 22%),
    linear-gradient(180deg, #fffafc 0%, var(--cream) 50%, #fff7fb 100%);
}

body {
  position: relative;
  overflow-x: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orb-a {
  top: 4rem;
  right: -5rem;
  width: 20rem;
  height: 20rem;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.26) 0%, rgba(255, 107, 157, 0.06) 56%, transparent 76%);
}

.orb-b {
  top: 34rem;
  left: -4rem;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(26, 26, 94, 0.18) 0%, rgba(26, 26, 94, 0.05) 58%, transparent 78%);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero {
  margin-bottom: 1.75rem;
}

.hero-title-row,
.panel,
.prompt-card {
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
}

.hero-title-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem;
  border-radius: 2rem;
}

.hero-copy {
  max-width: 52rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  gap: 1.35rem;
  margin-top: 1.35rem;
  align-items: start;
}

.hero-title-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.8rem 1rem;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: var(--navy-deep);
  text-wrap: balance;
}

.hero-powered {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(26, 26, 94, 0.64);
  white-space: nowrap;
}

.hero-powered a {
  color: var(--pink-strong);
  text-decoration: none;
}

.hero-powered a:hover {
  text-decoration: underline;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: fit-content;
  padding: 0.52rem 0.84rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(26, 26, 94, 0.08);
  color: var(--navy);
}

.chip-live {
  background: rgba(29, 155, 108, 0.14);
  color: var(--success);
}

.chip-mock {
  background: rgba(255, 107, 157, 0.14);
  color: var(--pink-strong);
}

.stack {
  display: grid;
  gap: 1.65rem;
}

.panel,
.prompt-card {
  border-radius: 1.75rem;
}

.panel {
  padding: 1.6rem;
}

.panel-head {
  margin-bottom: 1.3rem;
}

.panel-head-inline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin: 0.35rem 0 0;
  color: rgba(26, 26, 94, 0.68);
  line-height: 1.65;
}

.panel-form {
  display: grid;
  gap: 0.4rem;
}

.hero-form,
.panel-examples {
  min-height: 100%;
}

.flow-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
}

.flow-icon {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: rgba(255, 107, 157, 0.12);
  color: var(--pink-strong);
  font-size: 1rem;
  line-height: 1;
}

.upload-dropzone {
  display: grid;
  gap: 0.7rem;
  min-height: 10.5rem;
  padding: 1rem 1rem 0.9rem;
  border-radius: 1.4rem;
  border: 1.5px dashed rgba(255, 107, 157, 0.4);
  background:
    linear-gradient(135deg, rgba(255, 107, 157, 0.09), rgba(255, 255, 255, 0.86)),
    rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: rgba(255, 107, 157, 0.9);
  box-shadow: 0 14px 32px rgba(255, 107, 157, 0.1);
}

.upload-intro {
  display: grid;
  gap: 0.35rem;
}

.upload-copy {
  margin: 0;
  color: rgba(26, 26, 94, 0.68);
  line-height: 1.55;
}

.upload-label {
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

.upload-note {
  color: rgba(26, 26, 94, 0.64);
  line-height: 1.6;
  text-align: center;
}

.upload-preview {
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 1.4rem;
  border: 1px solid rgba(26, 26, 94, 0.08);
  background: rgba(255, 255, 255, 0.8);
  display: grid;
  gap: 0.7rem;
  min-height: 12rem;
  padding: 0.8rem;
  contain: content;
}

.upload-preview-toolbar {
  display: flex;
  justify-content: flex-end;
}

.upload-remove-button {
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
}

.upload-preview img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 24rem;
  object-fit: contain;
  object-position: center;
}

.panel-examples {
  display: grid;
  gap: 0.85rem;
  contain: content;
  padding: 0.25rem 0 0;
}

.example-head h2 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.example-head p {
  margin: 0.35rem 0 0;
  color: rgba(26, 26, 94, 0.68);
  line-height: 1.65;
}

.example-grid {
  display: grid;
  gap: 0.8rem;
}

.example-card {
  margin: 0;
}

.example-caption {
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: rgba(26, 26, 94, 0.78);
}

.example-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.example-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.8);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.control-field {
  display: grid;
  gap: 0.45rem;
}

.control-field span {
  font-size: 0.9rem;
  font-weight: 800;
}

.control-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.88rem 1rem;
  font: inherit;
  color: inherit;
  background: rgba(255, 255, 255, 0.92);
}

.control-field select:focus {
  outline: none;
  border-color: rgba(255, 107, 157, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.14);
}

.actions {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button {
  padding: 1rem 1.2rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink-strong), var(--navy));
  box-shadow: var(--shadow);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled,
.ghost-button.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  color: var(--navy);
  text-decoration: none;
  background: rgba(26, 26, 94, 0.08);
}

.status,
.error {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.status {
  color: rgba(26, 26, 94, 0.72);
}

.error {
  min-height: 1.3rem;
  color: #d6456b;
}

.preview-card,
.prompt-card {
  border: 1px solid rgba(26, 26, 94, 0.08);
}

.preview-card {
  display: grid;
  place-items: center;
  min-height: 24rem;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 1.5rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 245, 248, 0.92)),
    rgba(255, 255, 255, 0.9);
  contain: content;
}

.preview-card.empty {
  border-style: dashed;
}

.empty-state {
  padding: 2rem;
  text-align: center;
}

.empty-title {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  font-weight: 800;
}

.empty-copy {
  margin: 0;
  line-height: 1.7;
  color: rgba(26, 26, 94, 0.66);
}

.result-image {
  display: block;
  width: min(100%, 720px);
  max-height: 24rem;
  height: auto;
  object-fit: contain;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.meta-grid-hero {
  width: 100%;
  margin: 0.15rem 0 0;
}

.meta-card {
  min-width: 0;
  padding: 0.75rem 0.8rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(26, 26, 94, 0.06);
}

.meta-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26, 26, 94, 0.52);
}

.meta-card strong {
  display: block;
  min-width: 0;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.prompt-card {
  padding: 1.15rem;
  border-radius: 1.4rem;
  contain: content;
}

.prompt-preview {
  margin: 0;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(26, 26, 94, 0.06);
  color: var(--navy-deep);
  font: 0.86rem/1.7 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.is-hidden {
  display: none !important;
}

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

  .preview-card {
    min-height: 20rem;
  }

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

@media (max-width: 640px) {
  .shell {
    width: min(100% - 1rem, 1320px);
    padding-top: 1rem;
  }

  .hero-title-row,
  .panel,
  .prompt-card {
    border-radius: 1.35rem;
  }

  .hero-title-row {
    flex-direction: column;
    padding: 1.35rem;
  }

  .example-pair {
    grid-template-columns: 1fr 1fr;
  }

  .meta-grid,
  .meta-grid-hero {
    grid-template-columns: 1fr;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .upload-dropzone {
    min-height: 9rem;
  }

  .hero-title-inline,
  .flow-title {
    align-items: flex-start;
  }
}
