:root {
  color-scheme: light;
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --bg-top: #f7f8fb;
  --bg-bottom: #eef2f7;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-border: rgba(15, 23, 42, 0.08);
  --text: #101828;
  --muted: #667085;
  --primary: #0071e3;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0, 113, 227, 0.1), transparent 24%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  overflow-x: hidden;
}

.background {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.6;
}

.background-1 {
  width: 280px;
  height: 280px;
  top: -40px;
  left: -80px;
  background: rgba(86, 177, 255, 0.2);
}

.background-2 {
  width: 360px;
  height: 360px;
  right: -120px;
  top: 80px;
  background: rgba(196, 170, 255, 0.16);
}

.background-3 {
  display: none;
}

.page {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 20px 56px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.hero {
  padding: 40px;
  margin-bottom: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 113, 227, 0.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 18px 0 0;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.desc {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 24px;
}

.composer-panel,
.result-panel {
  padding: 28px;
}

.section-head {
  margin-bottom: 18px;
}

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

.eyebrow {
  margin: 0;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head h2 {
  margin: 6px 0 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

label {
  font-size: 14px;
  font-weight: 600;
  color: #475467;
}

.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-option {
  cursor: pointer;
}

.mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mode-option input:checked + span {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.08);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.06);
}

textarea,
input[type='file'] {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
  min-height: 220px;
  resize: vertical;
  padding: 18px 20px;
  line-height: 1.8;
}

input[type='file'] {
  padding: 14px 16px;
}

textarea::placeholder {
  color: #98a2b3;
}

textarea:focus,
input[type='file']:focus {
  border-color: rgba(0, 113, 227, 0.22);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
  background: #ffffff;
}

.edit-fields {
  display: grid;
  gap: 14px;
}

.edit-fields.hidden {
  display: none;
}

.helper-text {
  margin: 0;
  color: #98a2b3;
  font-size: 13px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
}

button {
  border: none;
  border-radius: 999px;
  padding: 14px 24px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0, 113, 227, 0.24);
}

button:active {
  transform: translateY(0);
}

.status {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--primary);
}

.status.error {
  color: #d92d20;
}

.result {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
  overflow: hidden;
}

.result.empty {
  font-size: 15px;
}

.generated-image {
  width: 100%;
  max-width: 100%;
  max-height: 720px;
  object-fit: contain;
  border-radius: 20px;
  display: block;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

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

  .result {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 14px 40px;
  }

  .hero,
  .composer-panel,
  .result-panel {
    padding: 20px;
  }

  .hero h1 {
    font-size: 34px;
  }

  button {
    width: 100%;
  }
}