/* =========================================================
   灭建国宇宙身份鉴定 · 轻量浅色版
   手机优先：白底、深墨字、单一红色强调、少装饰。
   ========================================================= */

:root {
  --bg: #f7f5f0;
  --bg-deep: #f1ede4;
  --panel: #fffdf9;
  --panel-soft: #fbf9f4;
  --ink: #1c1a17;
  --ink-soft: #3d3a34;
  --muted: #6f6a61;
  --muted-dim: #9a9387;
  --line: #e4ded2;
  --line-strong: #d3caba;
  --accent: #b23a2f;
  --accent-dark: #8e2c24;
  --accent-soft: #f8eae7;
  --radius: 14px;
  --shadow: 0 12px 34px rgba(28, 26, 23, 0.06);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 100% 0%, #fffdf9 0%, rgba(255, 253, 249, 0) 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(28, 26, 23, 0.016) 0,
    rgba(28, 26, 23, 0.016) 1px,
    transparent 1px,
    transparent 4px
  );
}

.page-glow,
.page-grid {
  display: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.app {
  width: min(1040px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
}

/* ---------------- Header ---------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand__logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: block;
  border-radius: 9px;
  object-fit: cover;
  background: #d00;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand__title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.header-meta__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.header-meta__code {
  display: none;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-dim);
}

/* ---------------- Placeholders ---------------- */

.placeholder {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  overflow: hidden;
}

.placeholder__tag {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.05em;
  word-break: break-all;
}

.placeholder__hint {
  color: var(--muted-dim);
  font-size: 9px;
}

.placeholder--logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 4px;
  gap: 0;
  border-radius: 10px;
}

.placeholder--logo .placeholder__tag {
  font-size: 7px;
  letter-spacing: 0.04em;
}

.placeholder--logo .placeholder__hint {
  display: none;
}

.placeholder--hero {
  min-height: 140px;
  padding: 12px;
  background:
    linear-gradient(160deg, rgba(178, 58, 47, 0.055), transparent 55%),
    var(--panel);
}

.placeholder--portrait {
  min-height: 104px;
  height: 100%;
}

.placeholder--background {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 1px dashed rgba(211, 202, 186, 0.65);
  border-radius: inherit;
  background: transparent;
  pointer-events: none;
}

.placeholder--background .placeholder__tag {
  position: absolute;
  right: 12px;
  top: 9px;
  opacity: 0.55;
  font-size: 7px;
}

.placeholder--background .placeholder__hint {
  display: none;
}

.placeholder--decoration {
  min-height: 32px;
  margin-bottom: 12px;
  padding: 5px;
}

.placeholder--decoration .placeholder__hint {
  display: none;
}

.placeholder--poster {
  min-height: 40px;
  margin-bottom: 12px;
  padding: 5px;
}

.placeholder--poster .placeholder__hint {
  display: none;
}

/* ---------------- Main ---------------- */

.main {
  flex: 1;
  padding: 20px 0 32px;
  outline: none;
}

.view {
  animation: fade-up 0.32s ease both;
}

/* ---------------- Home ---------------- */

.hero {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero__kicker {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.hero__title {
  margin: 0 0 12px;
  font-size: clamp(40px, 10vw, 64px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero__title-line {
  display: block;
}

.hero__title-line--accent {
  color: var(--accent);
}

.hero__subtitle {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 500;
}

.hero__intro {
  margin: 0 0 18px;
  max-width: 30em;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.stat__value {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat__label {
  font-size: 10px;
  color: var(--muted);
}

.hero__actions,
.result-actions,
.share-actions,
.payment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.hero__actions {
  flex-direction: column;
  align-items: stretch;
}

.hero__note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted-dim);
}

.hero__visual {
  position: relative;
  order: 0;
}

.hero__visual .placeholder {
  min-height: 140px;
}

.seal {
  display: none;
}

.ribbon {
  display: none;
}

.resume-area {
  margin-top: 24px;
}

.resume-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.resume-card__label {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.resume-card__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
}

.resume-card__meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.resume-card .hero__actions {
  flex-direction: row;
  flex-wrap: wrap;
}

.resume-card .btn {
  flex: 1 1 auto;
}

.paid-list {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.paid-list__title {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.paid-list__items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.paid-list__button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 11px;
}

.paid-list__button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.friend-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 13px;
}

.friend-banner strong {
  color: var(--accent-dark);
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--ink);
}

.btn:active {
  transform: scale(0.99);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.btn--danger {
  border-color: #e2b6b0;
  background: transparent;
  color: var(--accent-dark);
}

.btn--danger:hover:not(:disabled) {
  background: var(--accent-soft);
}

.btn--small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 12px;
}

.btn--wide {
  width: 100%;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--line-strong);
}

.link-btn:hover {
  color: var(--accent);
}

/* ---------------- Quiz ---------------- */

.quiz {
  width: min(720px, 100%);
  margin: 0 auto;
}

.quiz__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quiz__group {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.quiz__group-desc {
  display: none;
}

.quiz__counter {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.quiz__counter strong {
  color: var(--ink);
  font-size: 17px;
}

.progress {
  height: 6px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: #e9e3d8;
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.3s ease;
}

.question-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 196px);
  min-height: calc(100dvh - 196px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.question-card::before,
.question-card::after {
  display: none;
}

.question__index {
  display: none;
}

.question__text {
  margin: 0 0 16px;
  font-size: clamp(22px, 5.8vw, 30px);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.options {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  border: 0;
  flex: 1 1 auto;
  grid-auto-rows: minmax(62px, 1fr);
}

.option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 64px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink-soft);
  text-align: left;
  font-size: 16px;
  line-height: 1.55;
  transition:
    border-color 0.16s ease,
    background 0.16s ease;
}

.option:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.option__key {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f1ece3;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}

.option[aria-checked="true"] .option__key {
  background: var(--accent);
  color: #fff;
}

.quiz__nav {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
}

.quiz__nav > .btn--ghost {
  flex: 0 0 auto;
}

.quiz__nav-right {
  display: flex;
  flex: 1;
  gap: 9px;
}

.quiz__nav-right .btn {
  flex: 1;
}

.quiz__nav .btn--primary {
  flex: 1;
}

.quiz__hint {
  display: none;
}

.quiz__error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
}

/* ---------------- Result ---------------- */

.result {
  width: min(900px, 100%);
  margin: 0 auto;
}

.result__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.result__eyebrow {
  margin: 0;
  font-size: 10px;
  color: var(--muted-dim);
}

.stamp {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--accent-soft);
}

.result-card {
  position: relative;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-card__content {
  position: relative;
  z-index: 1;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.result-portrait .placeholder {
  min-height: 112px;
}

.result-info {
  min-width: 0;
}

.role-code {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
}

.hidden-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 0.06em;
  background: var(--accent-soft);
}

.role-name {
  margin: 0;
  font-size: clamp(40px, 12vw, 64px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.role-en {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted-dim);
}

.role-title {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.role-hook {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.role-origin {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  background: var(--panel-soft);
}

.judgment {
  margin: 18px 0 0;
  padding: 13px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--panel-soft);
}

.judgment__label,
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.judgment__label::after,
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.judgment p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.match {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.match__number {
  display: flex;
  align-items: baseline;
  gap: 1px;
  color: var(--accent);
}

.match__number strong {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.match__number span {
  font-size: 13px;
}

.match__body {
  min-width: 0;
}

.match__label {
  margin: 0 0 5px;
  font-size: 11px;
  color: var(--muted);
}

.match__bar {
  height: 5px;
  border-radius: 999px;
  background: #e9e3d8;
  overflow: hidden;
}

.match__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.match__line {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.match__note {
  margin: 4px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: var(--muted-dim);
}

.result-actions {
  margin-top: 16px;
}

.result-actions .btn {
  flex: 1 1 auto;
}

/* ---------------- Unlock ---------------- */

.unlock-card {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #e7cbc6;
  border-radius: 18px;
  background: #fffaf8;
}

.unlock-card__top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unlock-card__title {
  margin: 0;
  font-size: clamp(23px, 5.5vw, 30px);
  font-weight: 800;
  line-height: 1.35;
}

.unlock-card__teaser {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price__value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.price__note {
  font-size: 10px;
  color: var(--muted-dim);
}

.includes {
  display: grid;
  gap: 5px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.includes li {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.includes li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
}

.payment-note {
  margin: 10px 0 0;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted-dim);
}

.payment-note--test {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.payment-status {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-size: 12px;
  color: var(--ink-soft);
}

.payment-status--error {
  border-color: #e7cbc6;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.payment-status--ok {
  border-color: #cfe0cf;
  background: #f2f8f2;
  color: #2f5d33;
}

.missing-config {
  margin: 10px 0 0;
  padding: 9px 11px;
  border: 1px dashed #e2b6b0;
  border-radius: 8px;
  color: var(--accent-dark);
  font-size: 10px;
  line-height: 1.6;
}

/* ---------------- Archive ---------------- */

.archive {
  position: relative;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.archive::before {
  content: "已解锁";
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 3px 8px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 9px;
  background: var(--accent-soft);
}

.archive__label {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.archive__name {
  margin: 0;
  font-size: clamp(40px, 12vw, 70px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.archive__name--long {
  font-size: clamp(32px, 9vw, 56px);
  letter-spacing: -0.02em;
}

.archive__original {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.archive__branch {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
}

.archive__judgment {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.dossier {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
  overflow: hidden;
}

.dossier__item {
  padding: 11px 12px;
  background: var(--panel);
}

.dossier__label {
  margin: 0 0 3px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--muted-dim);
}

.dossier__value {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.archive__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.archive__tags .tag {
  border-color: #e7cbc6;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.relations {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 16px;
}

.relation {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.relation__label {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.relation__name {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.relation__note {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------------- Share ---------------- */

.share {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}

.share__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.share__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.result__foot {
  margin: 22px 0 0;
  text-align: center;
  font-size: 11px;
}

.share__hint {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.poster-preview {
  max-width: 360px;
  margin: 12px auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.poster-preview canvas {
  display: block;
  width: 100%;
  height: auto;
}

.share-actions {
  justify-content: center;
}

.share-actions .btn {
  flex: 1 1 auto;
}

/* ---------------- Return ---------------- */

.return-card {
  width: min(560px, 100%);
  margin: 20px auto;
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.return-card__icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  background: var(--accent-soft);
}

.return-card__title {
  margin: 0;
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 800;
  line-height: 1.3;
}

.return-card__text {
  margin: 8px auto 0;
  max-width: 30em;
  color: var(--muted);
  font-size: 13px;
}

.return-card__order {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted-dim);
  word-break: break-all;
}

.return-card__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.return-card__actions .btn {
  flex: 1 1 auto;
}

.return-spinner {
  width: 24px;
  height: 24px;
  margin: 16px auto 0;
  border: 2px solid #e9e3d8;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ---------------- Overlay ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(28, 26, 23, 0.32);
  animation: fade-in 0.18s ease both;
}

.overlay__panel {
  position: relative;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px 18px;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(28, 26, 23, 0.18);
}

.overlay__close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.overlay__close:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.overlay__title {
  margin: 0 36px 6px 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
}

.overlay__text {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.mock-checkout {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--panel-soft);
}

.mock-checkout__label {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--muted-dim);
  word-break: break-all;
}

.mock-checkout__price {
  margin: 0 0 2px;
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
}

.mock-checkout__note {
  margin: 0 0 12px;
  font-size: 11px;
  color: var(--muted);
}

.mock-checkout form {
  margin: 0;
}

.overlay__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.overlay__actions .btn {
  flex: 1 1 auto;
}

.payment-form-host {
  margin-top: 14px;
}

.payment-form-host form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.payment-form-host input[type="submit"] {
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(92vw, 480px);
  padding: 10px 15px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 12px 34px rgba(28, 26, 23, 0.2);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast--error {
  background: var(--accent-dark);
}

/* ---------------- Footer ---------------- */

.site-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted-dim);
  font-size: 10px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
}

.footer-mark {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
}

.footer-small {
  margin: 0;
  font-size: 9px;
}

.footer-disclaimer {
  margin: 6px 0;
  font-size: 9px;
  line-height: 1.55;
}

.legal-grid {
  display: grid;
  gap: 6px;
}

.legal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.legal summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10px;
  list-style: none;
}

.legal summary::-webkit-details-marker {
  display: none;
}

.legal summary::before {
  content: "+";
  display: inline-block;
  width: 12px;
  color: var(--accent);
  font-family: var(--mono);
}

.legal[open] summary::before {
  content: "−";
}

.legal p {
  margin: 0;
  padding: 0 10px 10px;
  line-height: 1.65;
  color: var(--muted-dim);
}



/* ---------------- Utilities ---------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.loading-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.loading-line::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 2px solid #e9e3d8;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.fatal-card {
  width: min(540px, 100%);
  margin: 30px auto;
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
}

.fatal-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
}

.fatal-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------- Motion ---------------- */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------- Tablet / Desktop ---------------- */

@media (min-width: 720px) {
  .app {
    padding: 0 24px 40px;
  }

  .site-header {
    padding: 18px 0;
  }

  .brand__title {
    font-size: 19px;
  }

  .brand__sub {
    font-size: 9px;
  }

  .header-meta__code {
    display: inline-block;
  }

  .main {
    padding: 40px 0 56px;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    align-items: center;
    gap: 48px;
  }

  .hero__visual {
    order: 0;
  }

  .hero__visual .placeholder {
    min-height: 340px;
  }

  .hero__actions {
    flex-direction: row;
  }

  .hero__actions .btn--primary {
    flex: 0 1 auto;
  }

  .resume-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
  }

  .resume-card .hero__actions {
    flex: 0 0 auto;
  }

  .resume-card .btn {
    flex: 0 0 auto;
  }

  .quiz__group-desc {
    display: block;
    margin: 3px 0 0;
    font-size: 11px;
    color: var(--muted-dim);
  }

  .question-card {
    min-height: 0;
    padding: 26px;
  }

  .options {
    flex: 0 0 auto;
    gap: 11px;
    grid-auto-rows: auto;
  }

  .question__text {
    margin-bottom: 22px;
  }

  .option {
    min-height: 60px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
  }

  .result-card {
    padding: 26px;
  }

  .result-grid {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 26px;
  }

  .result-portrait .placeholder {
    min-height: 270px;
  }

  .unlock-card {
    padding: 22px;
  }

  .unlock-card__top {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .price {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex: 0 0 auto;
  }

  .archive {
    padding: 26px;
  }

  .dossier {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .relations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share {
    padding: 22px;
  }

  .return-card {
    padding: 36px 28px;
  }
}

@media (min-width: 960px) {
  .hero__title {
    font-size: 72px;
  }

  .hero__subtitle {
    font-size: 18px;
  }

  .hero__visual .placeholder {
    min-height: 380px;
  }
}

@media (max-width: 420px) {
  .hero__actions .btn--primary {
    width: 100%;
  }

  .result-actions .btn {
    flex: 1 1 100%;
  }

  .share-actions .btn {
    flex: 1 1 100%;
  }

  .header-meta span:nth-child(2) {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- 首页：用户提供的英雄群像 ---------------- */

.is-home .site-header,
.is-home .site-footer {
  display: none;
}

.is-home .app {
  padding-bottom: 0;
}

.is-home .main {
  display: flex;
  flex-direction: column;
  padding: 16px 0 22px;
}

.view.home-stage {
  animation: none;
}

.home-stage {
  width: min(520px, 100%);
  min-height: calc(100vh - 40px);
  container-type: inline-size;
  margin: 0 auto;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(12px, 2.2vh, 18px);
}

.home-title-wrap {
  text-align: center;
  animation: home-title-in 0.55s ease 0.85s both;
}

.home-kicker {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: clamp(15px, 4.2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.home-title {
  margin: 0;
  font-size: min(64px, 10vw);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  white-space: nowrap;
  word-break: keep-all;
  color: var(--ink);
}

@supports (font-size: 1cqw) {
  .home-title {
    font-size: min(64px, 15cqw);
  }
}

.home-image-wrap {
  position: relative;
  width: 100%;
  border-radius: 20px;
  background: #120b1d;
  box-shadow: 0 22px 60px rgba(28, 26, 23, 0.18);
  overflow: hidden;
  isolation: isolate;
  animation: home-img-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.home-image-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(10, 7, 18, 0.55), rgba(10, 7, 18, 0));
}

.home-image {
  display: block;
  width: 100%;
  height: auto;
}

.home-start {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  width: auto;
  min-height: 52px;
  font-size: 16px;
  animation: home-action-in 0.55s ease 1.2s both;
}

@keyframes home-img-in {
  from {
    opacity: 0;
    transform: scale(1.035);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes home-title-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes home-action-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .home-stage {
    width: min(520px, max(280px, calc((100vh - 190px) * 0.5625)));
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-image-wrap,
  .home-title-wrap,
  .home-start {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-height: 700px) {
  .home-stage {
    width: min(520px, calc((100vh - 118px) * 0.5625));
    gap: 10px;
  }

  .home-kicker {
    margin-bottom: 2px;
  }
}

/* ---------------- 开始前规则弹窗 ---------------- */

.rules-panel {
  max-width: 600px;
  padding: 20px 14px;
}

.rules .rules__dad-line {
  font-size: clamp(10px, 3.7vw, 16px);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.rules-head {
  margin: 0 36px 18px 0;
}

.rules-head__en {
  display: block;
  margin-bottom: 2px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.rules-title {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}

.rules {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
}

.rules p {
  margin: 0;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.rules strong {
  font-weight: 800;
  color: var(--ink);
}

.rules__coin {
  color: var(--accent);
}

.rules__dad {
  color: var(--accent);
}

/* 结果页：抽到概率单行显示 */
.match {
  display: block;
}

.match__label {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.match__value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

/* 5 秒后自动出现的解锁弹窗 */
.unlock-modal__title {
  font-size: clamp(24px, 6.5vw, 30px);
  white-space: nowrap;
}

.unlock-modal__quote {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.unlock-modal__label {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.dad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

.dad-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-align: left;
}

.dad-chip strong {
  font-size: 15px;
  color: var(--ink);
}

.dad-chip span {
  font-size: 10px;
  color: var(--muted-dim);
}

.dad-chip:hover {
  border-color: var(--line-strong);
}

.dad-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dad-chip.is-active strong {
  color: var(--accent-dark);
}

.unlock-modal__price {
  margin: 4px 0 14px;
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
}

/* 角色立绘统一 9:16 */
.result-portrait {
  width: min(160px, 50%);
  margin: 0 auto;
}

.result-portrait .placeholder {
  width: 100%;
  aspect-ratio: 9 / 16;
  min-height: 0;
  height: auto;
}

@media (min-width: 720px) {
  .result-portrait {
    width: 100%;
    margin: 0;
  }

  .result-portrait .placeholder {
    aspect-ratio: 9 / 16;
    min-height: 0;
  }
}

/* 英雄名字旁的升级入口 */
.role-name-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.upgrade-btn {
  position: relative;
  margin-left: auto;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--accent-dark);
  border-radius: 999px;
  background: linear-gradient(135deg, #c14a3a, var(--accent) 55%, var(--accent-dark));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(178, 58, 47, 0.35);
  overflow: hidden;
  animation: upgrade-pulse 2.2s ease-in-out infinite;
}

.upgrade-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: upgrade-shine 2.8s ease-in-out infinite;
  pointer-events: none;
}

.upgrade-btn__icon {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

@keyframes upgrade-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(178, 58, 47, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(178, 58, 47, 0.12);
  }
}

@keyframes upgrade-shine {
  0%, 45% {
    transform: translateX(-120%);
  }
  70%, 100% {
    transform: translateX(120%);
  }
}

/* 付费后的详细档案并入人物卡 */
.paid-details {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.paid-details .dossier {
  margin-top: 0;
}

/* 抽到概率不再使用框 */
.match {
  margin-top: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .upgrade-btn,
  .upgrade-btn::after {
    animation: none !important;
  }
}

/* 规则卡里的付费强调块 */
.dad-offer {
  margin: 18px 0 20px;
  padding: 14px 12px 16px;
  border: 1px solid #e7b6ae;
  border-radius: 14px;
  background:
    radial-gradient(300px 120px at 50% 0%, rgba(178, 58, 47, 0.1), transparent 70%),
    linear-gradient(180deg, #fff8f5, #ffeae4);
  box-shadow: 0 10px 30px rgba(178, 58, 47, 0.08);
  text-align: center;
}

.dad-offer__lead {
  margin: 0 0 3px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.dad-offer__line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  flex-wrap: nowrap;
  margin: 0;
  white-space: nowrap;
  font-size: clamp(15px, 4.6vw, 24px);
  line-height: 1.35;
}

.dad-offer__coin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px 2px 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e46050, #b23a2f);
  color: #fff;
  font-size: 0.72em;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 3px 10px rgba(178, 58, 47, 0.22);
}

.dad-offer__coin::before {
  content: "¥";
  display: inline-grid;
  place-items: center;
  width: 1.25em;
  height: 1.25em;
  border-radius: 50%;
  background: #fff7f4;
  color: var(--accent);
  font-size: 0.85em;
  font-weight: 900;
}

.dad-offer__action {
  font-weight: 700;
  color: var(--ink-soft);
}

.dad-art {
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.6em;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: rotate(-2deg);
  background: linear-gradient(180deg, #d4483a 0%, #8e2c24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(178, 58, 47, 0.14));
}

.dad-art--title {
  font-size: 1.15em;
  transform: rotate(-1deg);
}

@media (prefers-reduced-motion: reduce) {
  .dad-art {
    transform: none;
  }
}

/* 角色立绘图片 */
.portrait-image {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #120b1d;
}

/* 本地测试预览入口 */
.dev-test-btn {
  position: fixed;
  left: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 40;
  padding: 7px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.92);
  color: var(--muted);
  font-size: 11px;
  backdrop-filter: blur(6px);
}

.dev-test-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.demo-panel {
  max-width: 560px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.demo-role {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-align: left;
}

.demo-role:hover {
  border-color: var(--accent);
}

.demo-role strong {
  font-size: 15px;
  color: var(--ink);
}

.demo-role span {
  font-size: 10px;
  color: var(--muted-dim);
}

/* 五维战力与轻量关系 */
.stats-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.stats-head span:last-child {
  color: var(--muted-dim);
}

.radar-chart {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  overflow: visible;
}

.radar-label {
  font-family: var(--sans);
  font-size: 11px;
  fill: var(--muted);
}

.radar-value {
  fill: var(--accent);
  font-weight: 800;
}

.relations-lite {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.relation-lite {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.relation-lite span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--muted-dim);
}

.relation-lite strong {
  font-size: 16px;
  color: var(--ink);
}

/* ===== 升级动画：学生卡旋转变身老爹卡 ===== */
body.is-upgrading {
  overflow: hidden;
}

.upgrade-fx {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.upgrade-fx.is-active {
  opacity: 1;
  pointer-events: auto;
}

.upgrade-fx::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, rgba(56, 41, 17, 0.97), rgba(6, 5, 4, 0.99) 72%);
  backdrop-filter: blur(4px);
}

.upgrade-fx__sparks {
  position: absolute;
  inset: 0;
  display: block;
}

.upgrade-fx__stage {
  position: relative;
  z-index: 2;
  width: min(60vw, 280px);
  aspect-ratio: 9 / 16;
  perspective: 1400px;
  transform: translateY(22vh) scale(0.62);
  opacity: 0;
}

.upgrade-fx.is-active .upgrade-fx__stage {
  opacity: 1;
  animation: upgradeStageIn 0.55s cubic-bezier(0.2, 0.9, 0.25, 1.15) 0.05s both;
}

@keyframes upgradeStageIn {
  0% {
    opacity: 0;
    transform: translateY(22vh) scale(0.62);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.upgrade-fx.is-revealed .upgrade-fx__stage {
  animation: upgradeStagePop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.35) both;
}

@keyframes upgradeStagePop {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  45% {
    transform: scale(1.07);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.upgrade-fx__card {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  border-radius: 18px;
  will-change: transform;
}

.upgrade-fx__face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #17130e;
  border: 2px solid rgba(255, 214, 130, 0.9);
  box-shadow:
    0 0 34px rgba(255, 196, 90, 0.45),
    0 0 80px rgba(255, 160, 50, 0.25),
    inset 0 0 24px rgba(255, 210, 120, 0.15);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.upgrade-fx__face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upgrade-fx__face--back {
  transform: rotateY(180deg);
}

.upgrade-fx__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 165%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0 62%,
    rgba(255, 206, 110, 0.5) 78%,
    rgba(255, 235, 180, 0.8) 84%,
    transparent 92%
  );
  filter: blur(2px);
  opacity: 0.85;
  animation: upgradeRingSpin 1.15s linear infinite;
}

@keyframes upgradeRingSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.upgrade-fx__halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 135%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 90, 0.35), rgba(255, 160, 40, 0.12) 46%, transparent 70%);
  animation: upgradeHaloPulse 1.2s ease-in-out infinite alternate;
}

@keyframes upgradeHaloPulse {
  from {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

.upgrade-fx__flash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d6, rgba(255, 210, 110, 0) 70%);
  opacity: 0;
}

.upgrade-fx.is-revealed .upgrade-fx__flash {
  animation: upgradeFlash 0.7s ease-out both;
}

@keyframes upgradeFlash {
  0% {
    opacity: 0.95;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(42);
  }
}

.upgrade-fx__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10vh;
  z-index: 3;
  margin: 0;
  text-align: center;
  font-size: clamp(18px, 4.2vw, 26px);
  font-weight: 800;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: #ffe1a1;
  text-shadow:
    0 0 16px rgba(255, 190, 80, 0.65),
    0 0 40px rgba(255, 150, 40, 0.35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.upgrade-fx.is-revealed .upgrade-fx__caption {
  opacity: 1;
  transform: translateY(0);
}

.upgrade-fx.is-leaving {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .upgrade-fx {
    display: none;
  }
}

.dev-simulate-btn {
  border-style: dashed;
  color: var(--accent);
}
