:root {
  color-scheme: dark;
  --bg: #070b16;
  --panel: rgba(17, 23, 43, 0.82);
  --panel-solid: #111729;
  --panel-deep: #0c1122;
  --text: #e9edfa;
  --muted: #8b93b8;
  --line: rgba(124, 92, 255, 0.22);
  --line-soft: rgba(124, 92, 255, 0.14);
  --accent: #7c5cff;
  --accent2: #22d3ee;
  --accent-strong: #a78bfa;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --grad: linear-gradient(135deg, #7c5cff 0%, #22d3ee 100%);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.14);
  --shadow: 0 18px 48px rgba(3, 6, 18, 0.55);
  --glow: 0 0 24px rgba(124, 92, 255, 0.35);
  --radius: 14px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(124, 92, 255, 0.14), transparent 60%),
    var(--bg);
  color: var(--text);
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.glow-a {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -80px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.30), transparent 70%);
}

.glow-b {
  width: 520px;
  height: 520px;
  top: 40%;
  left: -180px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.30), transparent 70%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0 16px;
  font-weight: 700;
  background: var(--panel-solid);
  color: var(--text);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1088px, 100%);
  margin: 0 auto;
  padding: 26px 18px 60px;
  display: grid;
  gap: 18px;
}

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-mark {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent2);
  text-transform: uppercase;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.1;
  background: linear-gradient(120deg, #fff 20%, #a78bfa 60%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-name {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

.buy-btn {
  background: var(--grad);
  color: #06070f;
  font-weight: 900;
  box-shadow: var(--glow);
  min-height: 42px;
}

.buy-btn:hover {
  filter: brightness(1.1);
}

.api-pill {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.api-pill.ready {
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--success);
  background: var(--success-soft);
}

.api-pill.warn {
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--warning);
  background: var(--warning-soft);
}

.text-action {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  color: var(--accent-strong);
  padding: 0 14px;
  font-size: 13px;
}

.text-action.danger {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.35);
}

.link-action {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  border-radius: var(--radius);
}

/* ---------- 落地页 Hero ---------- */

.hero {
  text-align: center;
  padding: 44px 10px 10px;
}

.hero-kicker {
  display: inline-block;
  margin-bottom: 16px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.hero h2 {
  margin: 0 0 16px;
  font-size: clamp(32px, 7vw, 52px);
  line-height: 1.16;
  font-weight: 900;
  background: linear-gradient(115deg, #ffffff 25%, #a78bfa 60%, #22d3ee 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin: 0 auto 26px;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-sub strong {
  color: var(--accent2);
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.cta-main {
  min-height: 56px;
  padding: 0 30px;
  font-size: 17px;
  font-weight: 900;
  background: var(--grad);
  color: #06070f;
  box-shadow: var(--glow);
}

.cta-main:hover {
  filter: brightness(1.12);
}

.cta-sub {
  color: var(--accent2);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

/* ---------- 板块标题 ---------- */

.section-title {
  margin: 0 0 6px;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
}

.section-sub {
  margin: 0 0 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 最近生成走马灯 ---------- */

.ticker-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  padding: 14px 16px 10px;
}

.ticker-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--accent2);
  font-size: 13px;
  font-weight: 800;
}

.ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: tickerPulse 1.6s ease-in-out infinite;
}

@keyframes tickerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.ticker {
  height: 122px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
}

.ticker-list {
  display: grid;
  gap: 6px;
  animation: tickerScroll 90s linear infinite;
}

.ticker:hover .ticker-list {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

.ticker-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  padding: 6px 4px;
  font-size: 13px;
  line-height: 1.5;
}

.ticker-user {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.ticker-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ticker-action {
  color: var(--muted);
  white-space: nowrap;
}

.ticker-title {
  color: var(--accent2);
  font-weight: 600;
}

/* ---------- 方法论展示 ---------- */

.method-section {
  padding-top: 8px;
}

.human-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.human-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  padding: 18px 16px 14px;
}

.human-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.human-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 23px;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(3, 6, 18, 0.45);
}

.human-card strong {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

.human-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.hook-ticker {
  height: 48px;
  overflow: hidden;
  border-top: 1px dashed var(--line-soft);
  padding-top: 8px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%);
}

.hook-list {
  display: grid;
  animation: hookScroll 12s linear infinite;
}

.human-card:hover .hook-list {
  animation-play-state: paused;
}

.hook-list span {
  display: flex;
  align-items: center;
  height: 40px;
  color: var(--accent2);
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
}

@keyframes hookScroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

.element-overview {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.10));
  backdrop-filter: blur(10px);
  padding: 16px 18px;
  margin: 14px 0 12px;
}

.element-overview-num {
  flex: 0 0 auto;
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.element-overview strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
  color: var(--text);
}

.element-overview p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.element-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.element-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-deep);
  padding: 14px;
  transition: border-color 0.2s, transform 0.15s;
}

.element-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.element-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  font-size: 25px;
  flex: 0 0 auto;
  box-shadow: 0 6px 16px rgba(3, 6, 18, 0.45);
}

.element-card strong {
  display: inline-block;
  margin-right: 8px;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.element-card span:not(.element-icon) {
  color: var(--muted);
  font-size: 12px;
}

.human-card em,
.element-card em {
  display: block;
  font-style: normal;
  color: var(--accent2);
  font-size: 13px;
  line-height: 1.6;
}

.element-card em {
  margin-top: 6px;
}

/* ---------- 助理形象 ---------- */

.assistant-section {
  padding-top: 18px;
}

.assistant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.assistant-card {
  position: relative;
  display: grid;
  gap: 7px;
  justify-items: center;
  margin-top: 54px;
  padding: 0 16px 20px;
  min-height: 0;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.16), var(--panel) 45%);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.assistant-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.assistant-card:hover .assistant-photo {
  transform: translateX(-50%) scale(1.04);
}

.assistant-card.is-active {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.4), var(--glow);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.2), var(--panel) 45%);
}

/* 人物突破边框的舞台 */
.assistant-stage {
  position: relative;
  width: 100%;
  height: 128px;
  margin-bottom: 4px;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: visible;
}

.assistant-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 122px;
  height: 122px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.55), rgba(34, 211, 238, 0.18) 55%, transparent 72%);
  filter: blur(4px);
}

.assistant-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: 96px;
  height: 14px;
  border-radius: 50%;
  background: rgba(3, 6, 18, 0.55);
  filter: blur(6px);
}

.assistant-photo {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  height: 182px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(3, 6, 18, 0.55));
  transition: transform 0.25s ease;
  z-index: 1;
}

.assistant-name {
  font-size: 17px;
  font-weight: 900;
  color: var(--text);
}

.assistant-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent2);
}

.assistant-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
}

.assistant-pick {
  margin-top: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.assistant-card.is-active .assistant-pick {
  background: var(--grad);
  color: #06070f;
  border-color: transparent;
}

.assistant-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-deep);
  text-align: left;
}

.assistant-chip svg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: 0 0 auto;
}

.chip-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: 0 0 auto;
  background-size: 240%;
  background-position: 50% 12%;
  background-repeat: no-repeat;
  background-color: var(--panel-solid);
  border: 1px solid var(--line);
}

.assistant-chip span {
  display: grid;
  gap: 1px;
}

.assistant-chip strong {
  font-size: 13px;
  color: var(--text);
}

.assistant-chip em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

/* ---------- 套餐 ---------- */

.pricing-section {
  padding-top: 8px;
}

.pricing-note {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

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

.plan-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.plan-card {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  background: var(--panel);
  backdrop-filter: blur(10px);
  min-height: 0;
  height: auto;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

button.plan-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.plan-card.is-hot {
  border-color: var(--accent2);
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.20), rgba(34, 211, 238, 0.10));
}

.plan-badge {
  position: absolute;
  top: -11px;
  right: 12px;
  border-radius: 999px;
  background: var(--grad);
  color: #06070f;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 900;
}

.plan-card.is-selected {
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.45), var(--glow);
}

.plan-card.is-selected::after {
  content: "✓ 已选";
  position: absolute;
  top: -11px;
  left: 12px;
  border-radius: 999px;
  background: var(--success);
  color: #04121a;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 900;
}

.plan-card strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}

.plan-origin {
  color: rgba(245, 247, 255, 0.46);
  font-size: 12px;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.plan-price {
  font-size: 30px;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.plan-days {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 面板 ---------- */

.app-stack {
  display: grid;
  gap: 16px;
}

.control-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  padding: 20px;
}

.auth-card {
  width: min(430px, 100%);
  margin: 6px auto 0;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  color: var(--muted);
  font-size: 15px;
}

.auth-tab.is-active {
  border-color: transparent;
  background: var(--grad);
  color: #06070f;
}

.auth-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

#authSubmit {
  width: 100%;
  min-height: 52px;
  background: var(--grad);
  color: #06070f;
  font-size: 16px;
  font-weight: 900;
  box-shadow: var(--glow);
}

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

.panel-head h2 {
  margin-bottom: 4px;
  font-size: 19px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad);
  color: #06070f;
  font-size: 14px;
  font-weight: 900;
}

/* ---------- 表单 ---------- */

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-group,
.segmented-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field-group label,
.field-label {
  color: #c6cce8;
  font-size: 14px;
  font-weight: 700;
}

.required label::after {
  content: " *";
  color: var(--warning);
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: var(--radius);
  background: var(--panel-deep);
  color: var(--text);
  padding: 10px 14px;
  outline: none;
  font-size: 16px;
}

textarea {
  min-height: 0;
  resize: vertical;
  font-size: 14px;
}

input::placeholder,
textarea::placeholder {
  color: #5b6285;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

select option {
  background: var(--panel-solid);
  color: var(--text);
}

.theme-field {
  margin-bottom: 18px;
}

.theme-input {
  min-height: 152px;
  border-radius: 18px;
  padding: 18px 22px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.45;
  resize: vertical;
}

.theme-input::placeholder {
  font-size: 18px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.segmented-control label {
  position: relative;
}

.segmented-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: var(--radius);
  background: var(--panel-deep);
  color: var(--muted);
  font-size: 14px;
}

.segmented-control input:checked + span {
  border-color: transparent;
  background: var(--grad);
  color: #06070f;
  font-weight: 800;
}

.segmented-control input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}

/* ---------- 发布平台选择（带logo） ---------- */

.field-tip {
  margin-left: 8px;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}

.platform-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.platform-control label,
.element-control label {
  position: relative;
}

.platform-control input,
.element-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.platform-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: var(--radius);
  background: var(--panel-deep);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s, transform 0.1s;
}

.platform-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.platform-control input:checked + .platform-chip {
  border-color: var(--accent2);
  color: var(--text);
  background: rgba(34, 211, 238, 0.10);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.35), 0 0 18px rgba(34, 211, 238, 0.25);
}

.pf {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  font-style: normal;
  flex: 0 0 auto;
}

.pf-dy {
  background: #010101;
  color: #fff;
  text-shadow: 1.5px 0 0 #fe2c55, -1.5px 0 0 #25f4ee;
  font-size: 16px;
}

.pf-xhs {
  background: #ff2442;
  color: #fff;
}

.pf-sph {
  background: linear-gradient(135deg, #fa9d3b, #f7721e);
  color: #fff;
}

.pf-ks {
  background: linear-gradient(135deg, #ff7e29, #ff4906);
  color: #fff;
}

/* ---------- 爆款元素选择 ---------- */

.element-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.element-control span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: 999px;
  background: var(--panel-deep);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s, transform 0.1s;
}

.element-control span:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.element-control input:checked + span {
  border-color: transparent;
  background: var(--grad);
  color: #06070f;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.45);
}

.actions {
  margin: 4px 0 4px;
}

.cost-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

button[type="submit"] {
  width: 100%;
  min-height: 56px;
  background: var(--grad);
  color: #06070f;
  font-size: 18px;
  font-weight: 900;
  box-shadow: var(--glow);
}

button[type="submit"]:hover {
  filter: brightness(1.1);
}

/* ---------- 人设 ---------- */

.persona-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.persona-chip {
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  background: var(--panel-deep);
  text-align: left;
}

.persona-chip strong {
  color: var(--text);
  font-size: 15px;
}

.persona-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.persona-chip.is-active {
  border-color: var(--accent2);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.3);
}

.persona-chip.is-active strong {
  color: var(--accent2);
}

.persona-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.persona-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.persona-summary span {
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: #c6cce8;
  padding: 5px 10px;
  font-size: 13px;
}

.persona-editor {
  border-color: var(--accent);
}

.persona-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

#personaSaveBtn {
  flex: 1;
}

/* ---------- 结果 ---------- */

.result-panel {
  min-height: 200px;
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
}

.empty-state p {
  max-width: 400px;
  margin: 0;
  line-height: 1.7;
  font-size: 14px;
}

.result-content {
  display: grid;
  gap: 16px;
}

.result-toolbar,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.result-toolbar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--accent-soft);
}

.result-toolbar h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.result-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.copy-all {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 14px;
  white-space: nowrap;
}

.result-section {
  scroll-margin-top: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel-solid);
}

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

.section-head h2 {
  margin: 0;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-ico {
  font-size: 21px;
}

.sec-grad {
  font-style: normal;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 1px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mini-copy {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  padding: 1px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
  color: var(--accent2);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
  flex: 0 0 auto;
}

.mini-copy:hover {
  border-color: var(--accent2);
}

.title-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.title-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  color: #d4d9ef;
  line-height: 1.55;
  font-size: 14px;
}

.title-list li span {
  flex: 1;
}

.section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.copy-section {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-deep);
  color: var(--accent-strong);
  padding: 5px 12px;
  font-size: 13px;
}

.copy-section.danger {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.35);
}

.section-tag {
  flex: 0 0 auto;
  border-radius: 10px;
  padding: 5px 8px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 12px;
  font-weight: 700;
}

.insight-grid,
.titles-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.insight-card,
.title-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel-deep);
}

.insight-card strong,
.title-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--accent2);
  font-size: 14px;
}

.insight-card p,
.title-card p,
.script-card p,
.assumption-list,
.quality-list {
  margin: 0;
  color: #d4d9ef;
  line-height: 1.65;
}

.topic-list {
  display: grid;
  gap: 10px;
}

.topic-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-deep);
}

.topic-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;
}

.topic-title > span {
  flex: 1;
}

.topic-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.topic-card dl div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
}

.topic-card dt {
  color: var(--accent2);
  font-size: 13px;
  font-weight: 700;
}

.topic-card dd {
  margin: 0;
  color: #d4d9ef;
  line-height: 1.55;
}

.script-card {
  display: grid;
  gap: 12px;
}

.script-card h3 {
  margin: 0 0 4px;
  color: var(--accent2);
  font-size: 15px;
}

.script-card ol,
.script-card ul,
.quality-list,
.assumption-list,
.loading-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.65;
}

.error-notice {
  border-color: rgba(251, 113, 133, 0.35);
  background: var(--danger-soft);
}

.error-text {
  color: var(--danger);
  font-weight: 700;
  line-height: 1.6;
}

.loading-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--accent-soft);
}

.loading-panel h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.loading-list li {
  color: var(--muted);
}

.loading-list li.is-current {
  color: var(--accent2);
  font-weight: 800;
}

/* ---------- 历史记录 ---------- */

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-deep);
}

.history-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.history-item summary::-webkit-details-marker {
  display: none;
}

.history-item summary::before {
  content: "▸";
  color: var(--accent2);
  font-size: 13px;
}

.history-item[open] summary::before {
  content: "▾";
}

.history-theme {
  flex: 1 1 200px;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
}

.history-meta {
  color: var(--muted);
  font-size: 12px;
}

.history-actions {
  display: flex;
  gap: 6px;
}

.history-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

/* ---------- 充值弹窗 ---------- */

.pay-dialog {
  width: min(480px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  background: var(--panel-solid);
  color: var(--text);
}

.pay-dialog::backdrop {
  background: rgba(3, 5, 12, 0.7);
  backdrop-filter: blur(4px);
}

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

.pay-head h2 {
  margin: 0;
  font-size: 20px;
}

.pay-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.redeem-box {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel-deep);
  padding: 10px 12px;
  margin: 12px 0 4px;
}

.redeem-box summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.redeem-box[open] summary {
  margin-bottom: 10px;
}

.redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}

#redeemBtn {
  background: var(--grad);
  color: #06070f;
}

.pay-msg {
  margin: 10px 0 0;
  color: var(--success);
  font-size: 14px;
  line-height: 1.6;
}

.pay-msg.is-error {
  color: var(--danger);
}

/* ---------- 提示条 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 100;
  max-width: calc(100vw - 40px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(17, 23, 43, 0.96);
  color: var(--text);
  padding: 12px 18px;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  box-shadow: var(--glow);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 后台管理 ---------- */

.code-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.code-toolbar select {
  width: auto;
  min-width: 170px;
}

#codeCreateBtn,
#configSaveBtn,
#alipaySaveBtn {
  background: var(--grad);
  color: #06070f;
}

.new-codes {
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.new-codes p {
  margin: 0;
  width: 100%;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.new-codes code,
.admin-table code {
  border-radius: 8px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

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

.table-empty {
  color: var(--muted);
  white-space: normal;
}

.tag-fresh {
  color: var(--success);
  background: var(--success-soft);
  border-radius: 10px;
  padding: 3px 8px;
  font-size: 12px;
}

.tag-used {
  color: var(--muted);
  background: rgba(139, 147, 184, 0.14);
  border-radius: 10px;
  padding: 3px 8px;
  font-size: 12px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  .shell {
    padding: 16px 12px 48px;
  }

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

  .user-area {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 20px;
  }

  .control-panel,
  .result-panel {
    padding: 16px 14px;
  }

  .form-row,
  .insight-grid,
  .titles-grid,
  .assistant-grid,
  .human-grid,
  .element-grid {
    grid-template-columns: 1fr;
  }

  .plan-grid,
  .plan-grid-3 {
    grid-template-columns: 1fr;
  }

  .segmented-control,
  .platform-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-toolbar,
  .section-head {
    flex-wrap: wrap;
  }

  .assistant-chip {
    width: 100%;
  }
}
