:root {
  color-scheme: light;
  --ink: #16171a;
  --muted: #686f7a;
  --soft: #f7f7f5;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(24, 28, 35, 0.1);
  --line-strong: rgba(24, 28, 35, 0.16);
  --shadow: 0 24px 80px rgba(38, 43, 52, 0.12);
  --radius: 8px;
  --focus: #2f6df6;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 207, 151, 0.42), transparent 32rem),
    radial-gradient(circle at 82% 14%, rgba(143, 216, 203, 0.36), transparent 30rem),
    radial-gradient(circle at 54% 84%, rgba(198, 187, 255, 0.26), transparent 34rem),
    linear-gradient(180deg, #fbfbfa 0%, #f3f5f8 100%);
}

body {
  min-height: 100%;
  margin: 0;
  padding-bottom: 74px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.54)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.28);
}

.glass-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), transparent 34%);
}

.hero-panel {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 16px;
}

.brand-row {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  color: #393d45;
  font-size: 14px;
  font-weight: 650;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 50%;
  background: #111315;
  color: #fff;
  font-size: 11px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.eyebrow,
.panel-heading p,
.result-heading p {
  margin: 0 0 10px;
  color: #767d87;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  margin: 0;
  white-space: nowrap;
}

h2,
p {
  margin-top: 0;
}

.subtitle {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.72fr) minmax(280px, 0.78fr) minmax(280px, 0.78fr);
  gap: 16px;
  margin-top: 16px;
  align-items: stretch;
}

.control-panel,
.settings-panel,
.result-panel {
  padding: 22px;
}

.control-panel {
  min-height: 554px;
}

.panel-heading {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}

.panel-heading h2,
.result-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.16;
}

.field {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span,
.mode-row span {
  color: #4e5662;
  font-size: 13px;
  font-weight: 680;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

textarea {
  min-height: 116px;
  resize: vertical;
  padding: 14px 15px;
  line-height: 1.55;
}

input {
  min-height: 46px;
  padding: 0 14px;
}

textarea:focus,
input:focus {
  border-color: rgba(47, 109, 246, 0.52);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.1);
}

.upload-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-tile {
  display: grid;
  min-height: 108px;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.upload-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 109, 246, 0.34);
  background: rgba(255, 255, 255, 0.86);
}

.upload-tile input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-label {
  color: #22262d;
  font-size: 15px;
  font-weight: 720;
}

.upload-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.mini-preview {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mini-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(234, 238, 245, 0.7)),
    #eef1f5;
  object-fit: cover;
}

.mini-preview img:not([src]) {
  visibility: hidden;
}

.mini-preview figcaption {
  color: #747b86;
  font-size: 12px;
}

.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.field.compact {
  margin-bottom: 12px;
}

.mode-row,
.option-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin: 2px 0 16px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.mode-row strong {
  font-size: 14px;
}

.option-row {
  cursor: pointer;
}

.option-row input {
  width: 18px;
  min-height: 18px;
  accent-color: #111315;
  box-shadow: none;
}

.primary-button,
.secondary-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 720;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.primary-button {
  border: 1px solid rgba(17, 18, 20, 0.88);
  background: #111315;
  color: #fff;
}

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

.secondary-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.62);
  color: #252a31;
}

.settings-panel .secondary-button {
  margin-top: 10px;
}

.status-line {
  position: relative;
  z-index: 1;
  min-height: 20px;
  margin: 12px 0 0;
  color: #737b86;
  font-size: 13px;
  line-height: 1.42;
}

.status-line.is-error {
  color: #b42318;
}

.status-line.is-ok {
  color: #1f7a4b;
}

.result-panel {
  display: flex;
  min-height: 554px;
  flex-direction: column;
}

.result-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.result-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.cover-preview {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  width: 100%;
  min-height: 360px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(235, 238, 243, 0.78)),
    #eef0f4;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cover-preview span {
  color: #9aa1ab;
  font-size: 28px;
  font-weight: 780;
}

.ratio-three {
  aspect-ratio: 3 / 4;
}

.ratio-nine {
  aspect-ratio: 9 / 16;
}

.cover-preview.is-loading::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  content: "生成中";
  background: rgba(255, 255, 255, 0.68);
  color: #323741;
  font-size: 15px;
  font-weight: 760;
  backdrop-filter: blur(10px);
}

.result-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.progress-dock {
  position: fixed;
  right: 16px;
  bottom: 14px;
  left: 16px;
  z-index: 30;
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 14px 13px;
  border: 1px solid rgba(24, 28, 35, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 50px rgba(31, 36, 43, 0.14);
  backdrop-filter: blur(22px) saturate(1.2);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: #414954;
  font-size: 13px;
  font-weight: 700;
}

.progress-meta strong {
  color: #171a1f;
  font-size: 12px;
}

.progress-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 28, 35, 0.08);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #111315, #6a7482);
  transition: width 420ms ease;
}

.progress-dock.is-active .progress-track::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -36%;
  width: 34%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.56), transparent);
  animation: progress-sheen 1.4s ease-in-out infinite;
}

@keyframes progress-sheen {
  to {
    left: 100%;
  }
}

@media (max-width: 1180px) {
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  }

  .result-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 680px);
    padding-top: 12px;
  }

  .hero-panel {
    min-height: 50px;
    padding: 10px 14px;
  }

  .brand-row {
    font-size: 13px;
  }

  .subtitle {
    font-size: 13px;
  }

  .workspace-grid,
  .upload-grid,
  .preview-strip {
    grid-template-columns: 1fr;
  }

  .control-panel,
  .settings-panel,
  .result-panel {
    padding: 18px;
  }

  .cover-preview {
    min-height: 320px;
  }
}

@media (max-width: 760px) {
  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .hero-copy {
    width: 100%;
    justify-content: space-between;
  }
}
