:root {
  color-scheme: light;
  --paper: #f8f6f2;
  --panel: #fffdfa;
  --ink: #171615;
  --muted: #736d68;
  --line: #ddd6cf;
  --line-strong: #c7b7aa;
  --rose: #b94f68;
  --wine: #66233c;
  --teal: #196b63;
  --sage: #dce7dd;
  --gold: #b9873f;
  --blue: #405d7a;
  --charcoal: #20242b;
  --shadow: 0 22px 54px rgba(41, 32, 28, 0.13);
  --soft-shadow: 0 12px 24px rgba(41, 32, 28, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial,
    sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(32, 36, 43, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(32, 36, 43, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #f8f6f2 0%, #f0e9e2 34%, #dce7dd 68%, #edf3f5 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(221, 214, 207, 0.84);
  background: rgba(255, 253, 250, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--wine), var(--teal));
  font-size: 0.82rem;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.74rem;
}

.top-actions,
.form-actions,
.chat-input,
.panel-heading.horizontal,
.voice-player,
.progress-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  justify-content: flex-end;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(360px, 0.9fr) minmax(380px, 1.1fr);
  grid-template-areas:
    "creator profile scene"
    "creator memory scene"
    "creator pricing scene";
  gap: 16px;
  align-items: start;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.panel {
  border: 1px solid rgba(199, 183, 170, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--soft-shadow);
}

.creator-panel {
  grid-area: creator;
  position: sticky;
  top: 78px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 18px;
}

.profile-panel {
  grid-area: profile;
  padding: 16px;
}

.scene-panel {
  grid-area: scene;
  min-height: calc(100vh - 96px);
  padding: 16px;
}

.memory-panel {
  grid-area: memory;
  padding: 16px;
}

.revenue-panel {
  grid-area: pricing;
  padding: 16px;
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading.horizontal {
  justify-content: space-between;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--wine);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 9px;
  font-size: 1.72rem;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.28;
}

.intro-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.58;
}

.creator-form {
  display: grid;
  gap: 13px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.control-label {
  color: var(--charcoal);
  font-size: 0.81rem;
  font-weight: 850;
}

.field input,
.field textarea,
.field select,
.chat-input input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.field input,
.field select,
.chat-input input {
  min-height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 72px;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.chat-input input:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(25, 107, 99, 0.12);
}

.template-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 15px;
}

.template-card {
  min-height: 74px;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.66);
}

.template-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--rose);
  font-size: 0.74rem;
  font-weight: 900;
}

.template-card strong {
  display: block;
  line-height: 1.34;
}

.template-card.active {
  border-color: rgba(102, 35, 60, 0.42);
  background: linear-gradient(135deg, rgba(185, 79, 104, 0.12), rgba(25, 107, 99, 0.1));
  box-shadow: 0 0 0 3px rgba(185, 79, 104, 0.1);
}

.control-group {
  display: grid;
  gap: 9px;
}

.range-head,
.range-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.range-head strong {
  color: var(--rose);
  font-size: 0.86rem;
}

.range {
  width: 100%;
  accent-color: var(--rose);
}

.range-scale {
  color: var(--muted);
  font-size: 0.76rem;
}

.primary-button,
.ghost-button,
.icon-text-button,
.icon-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 850;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-button {
  flex: 1;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--wine), var(--teal));
  box-shadow: 0 12px 24px rgba(102, 35, 60, 0.18);
}

.primary-button.compact {
  flex: 0 0 auto;
}

.ghost-button,
.icon-text-button {
  padding: 0 13px;
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.icon-button {
  display: grid;
  width: 40px;
  min-width: 40px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.2rem;
}

.primary-button:hover,
.ghost-button:hover,
.icon-text-button:hover,
.icon-button:hover,
.template-card:hover,
.scene-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(168px, 0.68fr) 1fr;
  gap: 14px;
  align-items: stretch;
}

.character-card {
  position: relative;
  min-height: 286px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(32, 36, 43, 0.28);
  border-radius: var(--radius);
  background: var(--charcoal);
}

.character-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 36%, rgba(17, 18, 20, 0.36) 66%, rgba(7, 7, 8, 0.92) 100%),
    linear-gradient(135deg, rgba(185, 135, 63, 0.16), rgba(25, 107, 99, 0.12));
}

.character-card figcaption {
  position: absolute;
  z-index: 2;
  left: 14px;
  right: 14px;
  bottom: 14px;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.36);
}

.character-card span {
  display: block;
  margin-bottom: 5px;
  color: #f3d494;
  font-size: 0.72rem;
  font-weight: 900;
}

.character-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.24rem;
  line-height: 1.16;
}

.character-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.84rem;
  line-height: 1.5;
}

.profile-summary {
  display: grid;
  align-content: start;
  gap: 12px;
}

.profile-url {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(25, 107, 99, 0.08);
}

.profile-url span,
.profile-box span,
.memory-card span,
.benefit-row span {
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-url strong {
  color: var(--teal);
  font-size: 0.88rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.profile-stats div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.profile-stats dt {
  color: var(--muted);
  font-size: 0.7rem;
}

.profile-stats dd {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-block {
  display: grid;
  gap: 7px;
}

.progress-head {
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-head strong {
  color: var(--wine);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 36, 43, 0.12);
}

.progress-track span {
  display: block;
  width: 43%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--teal));
  transition: width 220ms ease;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.profile-box {
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.profile-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--rose);
  font-weight: 900;
}

.profile-box p {
  margin: 0;
  color: #302b27;
  font-size: 0.9rem;
  line-height: 1.58;
}

.live-dot,
.rarity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--teal);
  border: 1px solid rgba(25, 107, 99, 0.3);
  background: rgba(25, 107, 99, 0.1);
  font-size: 0.72rem;
  font-weight: 900;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.scene-card {
  min-height: 116px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
}

.scene-card.active {
  border-color: rgba(102, 35, 60, 0.48);
  background: linear-gradient(135deg, rgba(185, 79, 104, 0.13), rgba(185, 135, 63, 0.11));
}

.scene-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 900;
}

.scene-card strong {
  display: block;
  margin-bottom: 6px;
  line-height: 1.3;
}

.scene-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.chat-surface {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(32, 36, 43, 0.04);
}

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

.chat-head span {
  color: var(--muted);
  font-size: 0.78rem;
}

.chat-log {
  display: grid;
  gap: 10px;
}

.message {
  display: grid;
  gap: 5px;
  max-width: 82%;
  padding: 11px 12px;
  border-radius: var(--radius);
  line-height: 1.55;
}

.message span {
  font-size: 0.72rem;
  font-weight: 900;
}

.message.hero {
  justify-self: start;
  border: 1px solid rgba(25, 107, 99, 0.24);
  background: rgba(25, 107, 99, 0.1);
}

.message.oc {
  justify-self: end;
  border: 1px solid rgba(185, 79, 104, 0.24);
  background: rgba(185, 79, 104, 0.1);
}

.message p {
  margin: 0;
}

.chat-input {
  align-items: stretch;
}

.memory-card {
  display: grid;
  gap: 9px;
  min-height: 148px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(185, 135, 63, 0.36);
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(32, 36, 43, 0.94), rgba(102, 35, 60, 0.86)),
    url("assets/limited-card.png") center / cover;
  box-shadow: var(--shadow);
}

.memory-card span {
  color: #f3d494;
  font-weight: 900;
}

.memory-card strong {
  font-size: 1.16rem;
  line-height: 1.25;
}

.memory-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.62;
}

.voice-player {
  gap: 12px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.play-button {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--wine);
}

.voice-main {
  flex: 1;
  min-width: 0;
}

.voice-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.8rem;
}

.voice-meta strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waveform {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  align-items: center;
  gap: 3px;
  height: 34px;
}

.waveform span {
  display: block;
  height: var(--bar-height);
  min-height: 5px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--gold), var(--rose));
}

.voice-copy {
  margin: 0;
  color: #302b27;
  line-height: 1.62;
}

.benefit-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.benefit-row {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.benefit-row strong {
  font-size: 0.93rem;
}

.benefit-row span {
  line-height: 1.45;
}

.benefit-row.unlocked strong::after {
  content: "  MVP 核心";
  color: var(--teal);
  font-size: 0.72rem;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
    grid-template-areas:
      "creator profile"
      "creator scene"
      "creator memory"
      "creator pricing";
  }

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

@media (max-width: 860px) {
  .topbar {
    align-items: center;
    padding: 10px 12px;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "creator"
      "profile"
      "scene"
      "memory"
      "pricing";
    gap: 12px;
    padding: 12px;
  }

  .creator-panel {
    position: static;
    max-height: none;
  }

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

  .character-card {
    min-height: 380px;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 1.4rem;
  }

  .brand small,
  .top-actions .ghost-button,
  .top-actions .icon-button {
    display: none;
  }

  .field-row,
  .profile-stats,
  .scene-grid {
    grid-template-columns: 1fr;
  }

  .character-card {
    min-height: 340px;
  }

  .message {
    max-width: 92%;
  }

  .chat-input {
    display: grid;
  }

  .primary-button.compact {
    width: 100%;
  }
}
