:root {
  --bg-0: #06070b;
  --bg-1: #0d1020;
  --bg-2: #111735;
  --text: #edf1ff;
  --muted: #a6b1d8;
  --line: rgba(255, 255, 255, 0.14);
  --brand: #8ca4ff;
  --brand-strong: #5e7fff;
  --accent: #9e86ff;
  --danger: #ff6f9d;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

body[data-theme="guofeng"] {
  --bg-0: #120f0d;
  --bg-1: #1b1512;
  --bg-2: #2a211c;
  --text: #f7efe2;
  --muted: #d6c4ae;
  --line: rgba(235, 208, 176, 0.24);
  --brand: #d2a36f;
  --brand-strong: #be8450;
  --accent: #b8754b;
  --shadow: 0 24px 48px rgba(7, 4, 2, 0.5);
}

body {
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(140, 164, 255, 0.14), transparent 45%),
    radial-gradient(circle at 90% 70%, rgba(158, 134, 255, 0.12), transparent 38%),
    linear-gradient(150deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
  min-height: 100vh;
  overflow: hidden;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.splash-screen,
.onboarding-screen,
.creator-screen,
.changelog-screen {
  padding: clamp(20px, 2vw, 32px);
}

.splash-content {
  position: relative;
  min-height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  z-index: 2;
}

.brand-title {
  font-size: clamp(60px, 12vw, 190px);
  font-weight: 700;
  letter-spacing: 0.22em;
  position: relative;
  text-indent: 0.22em;
}

.brand-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.4);
  filter: blur(2px);
  transform: translate(0.02em, 0.06em);
}

.brand-subtitle {
  margin-top: 14px;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-size: clamp(12px, 1.5vw, 16px);
}

.onboarding-screen {
  display: grid;
  place-items: center;
}

.glass-panel {
  width: min(720px, 92vw);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 38px);
}

.step {
  display: none;
}

.step.is-active {
  display: grid;
  gap: 14px;
}

.step h2 {
  font-size: clamp(24px, 4vw, 34px);
}

.step p {
  color: var(--muted);
}

.text-input,
.text-area,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 12, 20, 0.55);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.text-area {
  resize: vertical;
  min-height: 110px;
}

.text-input:focus,
.text-area:focus,
select:focus {
  border-color: rgba(140, 164, 255, 0.9);
  transform: translateY(-1px);
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: rgba(140, 164, 255, 0.2);
  border-color: rgba(140, 164, 255, 0.48);
  color: #fff;
}

body[data-theme="guofeng"] .btn-primary {
  background: rgba(190, 132, 80, 0.24);
  border-color: rgba(210, 163, 111, 0.58);
  color: #fff3e6;
}

.btn-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.btn-ghost.danger {
  border-color: rgba(255, 111, 157, 0.45);
  color: #ffd3e2;
}

.choice-row,
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.creator-screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.changelog-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.changelog-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 12, 20, 0.5);
  padding: 18px;
  line-height: 1.8;
}

.changelog-content h3 {
  margin: 6px 0 10px;
  font-size: 24px;
}

.changelog-content h4 {
  margin: 18px 0 8px;
  color: #dbe3ff;
}

.changelog-content ul {
  list-style: disc;
  padding-left: 18px;
}

.changelog-content li {
  color: var(--muted);
  margin-bottom: 6px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 12px 16px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.creator-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  min-height: 0;
}

.panel {
  border: 1px solid var(--line);
  background: rgba(10, 12, 20, 0.46);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel h3 {
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.span-2 {
  grid-column: span 2;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.role-card {
  border-radius: 16px;
  border: 1px solid rgba(140, 164, 255, 0.34);
  background:
    radial-gradient(circle at 70% 0%, rgba(140, 164, 255, 0.2), transparent 40%),
    rgba(12, 17, 34, 0.86);
  padding: 16px;
  display: grid;
  gap: 10px;
  align-content: start;
}

body[data-theme="guofeng"] .role-card {
  border: 1px solid rgba(210, 163, 111, 0.45);
  background:
    radial-gradient(circle at 70% 0%, rgba(210, 163, 111, 0.2), transparent 40%),
    rgba(37, 27, 22, 0.9);
}

.collection-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.btn-mini {
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.collection-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.role-card-mini {
  gap: 8px;
}

.role-card-mini h4 {
  font-size: 21px;
}

.role-card-mini .action-row {
  margin-top: 4px;
}

.draft-panel {
  display: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.draft-panel.is-open {
  display: grid;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.role-card h4 {
  font-size: 26px;
}

.chip {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  color: #d5ddff;
  font-size: 13px;
}

.muted,
.desc,
.status-text {
  color: var(--muted);
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(430px, 95vw);
  height: 100vh;
  border-left: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.92);
  backdrop-filter: blur(14px);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  padding: 18px;
  overflow-y: auto;
  z-index: 20;
}

.settings-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.drawer-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.drawer-section h4 {
  margin-bottom: 4px;
}

.drawer-section label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.action-row.compact .btn,
.file-btn {
  font-size: 13px;
  padding: 8px 10px;
}

.file-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

  .collection-hero-head {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}