@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap");

:root {
  --bg: #f4efe9;
  --panel: #fdfbf7;
  --ink: #1e1b16;
  --muted: #5f5649;
  --accent: #ed6a2c;
  --accent-dark: #b94b1c;
  --accent-soft: #f7d0ba;
  --border: #e0d7cc;
  --shadow: 0 20px 60px rgba(30, 27, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 15%, #fff6e8 0%, transparent 45%),
    radial-gradient(circle at 80% 0%, #ffe5d7 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 32px 32px;
  border-radius: 28px;
  background: linear-gradient(135deg, #fffaf3 0%, #ffe9d9 60%, #fbd3bf 100%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: floatIn 0.8s ease-out;
}

.hero h1 {
  font-family: "Fraunces", "PingFang SC", serif;
  font-size: clamp(32px, 4vw, 48px);
  margin: 8px 0 8px;
}

.hero .lead {
  max-width: 520px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.eyebrow {
  font-size: 14px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin: 0;
  color: var(--accent-dark);
  font-weight: 600;
}

.hero-orb {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, #ffe5d7 45%, #f7a985 100%);
  opacity: 0.9;
  filter: blur(0.4px);
}

.layout {
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(30, 27, 22, 0.08);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}

.field.inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.field.inline select {
  width: 150px;
}

.divider {
  border-top: 1px dashed var(--border);
  margin: 20px 0;
}

.character-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.character-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 12px;
}

.character-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.character-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.character-name {
  flex: 1;
  border: none;
  font-weight: 600;
  font-size: 14px;
  outline: none;
}

.remove {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

button {
  border: none;
  font-family: inherit;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:active {
  transform: scale(0.98);
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(237, 106, 44, 0.25);
}

.secondary {
  background: #f5efe8;
  color: var(--muted);
}

.ghost {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.results-grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.result-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 16px;
  background: #fffaf5;
  animation: fadeUp 0.6s ease;
}

.result-title {
  margin: 0;
  font-size: 18px;
}

.result-subtitle {
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.views {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.single-view {
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 260px;
}

.view {
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
}

.view-label {
  font-size: 12px;
  color: var(--muted);
}

.image-shell {
  flex: 1;
  border-radius: 12px;
  background: repeating-linear-gradient(
      -45deg,
      #f1e6da,
      #f1e6da 10px,
      #f8f2eb 10px,
      #f8f2eb 20px
    );
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.image-shell.loading::after {
  content: "生成中...";
  font-size: 13px;
  color: var(--muted);
  animation: pulse 1.2s ease-in-out infinite;
}

.image-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

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

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-orb {
    width: 120px;
    height: 120px;
  }
}
