:root {
  --ink: #17151f;
  --paper: #fffaf2;
  --paper-strong: #fff3dd;
  --pink: #ff4f96;
  --cyan: #24d6db;
  --yellow: #ffd451;
  --mint: #8af2b3;
  --violet: #7e62ff;
  --wine: #b92864;
  --line: rgba(23, 21, 31, 0.14);
  --shadow: 0 24px 70px rgba(30, 20, 45, 0.16);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    "Inter", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui,
    sans-serif;
  background:
    linear-gradient(90deg, rgba(255, 79, 150, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(36, 214, 219, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(var(--max), calc(100% - 32px));
  margin: 16px auto 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.9);
  box-shadow: 0 14px 36px rgba(23, 21, 31, 0.1);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 0.82rem;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand small {
  color: rgba(23, 21, 31, 0.62);
  font-size: 0.75rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topnav a,
.ghost-link {
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.topnav a:hover,
.ghost-link:hover {
  border-color: var(--line);
  background: #fff;
}

.hero,
.panel,
.about-section {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, 0.72fr);
  gap: 34px;
  align-items: center;
  min-height: calc(100vh - 92px);
  padding: 54px 0 38px;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--wine);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 100%;
  margin-bottom: 18px;
  font-size: clamp(4.8rem, 11vw, 8.2rem);
  line-height: 0.9;
}

.hero-lead {
  max-width: 680px;
  margin-bottom: 30px;
  color: rgba(23, 21, 31, 0.76);
  font-size: clamp(1.04rem, 2vw, 1.35rem);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.mode-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mode-card,
.primary-button,
.ghost-button,
.scale-button {
  cursor: pointer;
}

.mode-card {
  min-height: 150px;
  padding: 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  box-shadow: 6px 6px 0 var(--ink);
  text-align: left;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.mode-card:hover,
.mode-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 var(--ink);
}

.mode-card span,
.mode-card strong,
.mode-card small {
  display: block;
}

.mode-card span {
  color: var(--wine);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.mode-card strong {
  margin: 8px 0;
  font-size: 2.05rem;
}

.mode-card small {
  color: rgba(23, 21, 31, 0.66);
  font-size: 0.92rem;
  line-height: 1.55;
}

.mode-card.is-featured {
  background: var(--yellow);
}

.stage-visual {
  position: relative;
  min-height: 540px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 79, 150, 0.34), transparent 28%),
    radial-gradient(circle at 78% 34%, rgba(36, 214, 219, 0.34), transparent 26%),
    linear-gradient(145deg, #23192e, #14121c 62%, #372443);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stage-visual::before,
.stage-visual::after {
  position: absolute;
  content: "";
}

.stage-visual::before {
  inset: 62% -10% -22%;
  border-top: 2px solid rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 212, 81, 0.18), rgba(255, 79, 150, 0.1));
  background-size: 44px 100%;
  transform: perspective(420px) rotateX(54deg);
  transform-origin: top;
}

.stage-visual::after {
  inset: 28px 32px auto;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan));
  box-shadow:
    0 28px 42px rgba(255, 79, 150, 0.24),
    0 70px 64px rgba(36, 214, 219, 0.18);
}

.stage-ring {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
}

.ring-one {
  width: 280px;
  height: 280px;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
}

.ring-two {
  width: 150px;
  height: 150px;
  right: 42px;
  bottom: 118px;
}

.stage-card {
  position: absolute;
  display: grid;
  min-width: 128px;
  min-height: 76px;
  place-items: center;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  font-weight: 950;
  text-align: center;
}

.sticker-a {
  top: 116px;
  left: 42px;
  background: #d7f7ff;
  transform: rotate(-8deg);
}

.sticker-b {
  top: 210px;
  right: 34px;
  background: #ffe2ef;
  transform: rotate(7deg);
}

.sticker-c {
  bottom: 122px;
  left: 56px;
  background: #dfd8ff;
  transform: rotate(5deg);
}

.sticker-d {
  right: 70px;
  bottom: 42px;
  background: #fff0a5;
  transform: rotate(-6deg);
}

.panel {
  margin-bottom: 36px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.is-hidden {
  display: none;
}

.panel-head,
.quiz-actions,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.ghost-button,
.primary-button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  font-weight: 900;
}

.ghost-button {
  padding: 8px 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

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

.primary-button {
  padding: 10px 18px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
}

.progress-shell {
  height: 10px;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan));
  transition: width 180ms ease;
}

.question-card {
  padding: clamp(18px, 3vw, 30px);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
}

.axis-pill {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--wine);
  font-size: 0.82rem;
  font-weight: 950;
}

.question-card h3 {
  margin-bottom: 22px;
  font-size: clamp(1.35rem, 3vw, 2.35rem);
  line-height: 1.28;
}

.choice-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.choice-side {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.choice-side span {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 950;
}

.choice-side p {
  margin-bottom: 0;
  color: rgba(23, 21, 31, 0.78);
  line-height: 1.7;
}

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

.scale-button {
  min-height: 54px;
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  font-size: 0.92rem;
  font-weight: 900;
}

.scale-button:hover,
.scale-button:focus-visible,
.scale-button.is-selected {
  border-color: var(--ink);
  background: var(--yellow);
}

.quiz-actions {
  margin-top: 18px;
}

.quiz-actions span {
  color: rgba(23, 21, 31, 0.6);
  font-weight: 900;
}

.result-panel {
  background:
    linear-gradient(135deg, rgba(255, 79, 150, 0.1), transparent 32%),
    rgba(255, 255, 255, 0.82);
}

.result-hero {
  margin-bottom: 24px;
}

.result-hero h2 {
  margin-bottom: 4px;
  font-size: clamp(4rem, 13vw, 9rem);
  line-height: 0.86;
}

.result-title {
  margin-bottom: 8px;
  color: var(--wine);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 950;
}

.confidence-text {
  max-width: 820px;
  color: rgba(23, 21, 31, 0.72);
  line-height: 1.7;
}

.result-grid,
.result-notes {
  display: grid;
  gap: 14px;
}

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

.result-notes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.result-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.result-card h3 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.result-card p,
.result-card li {
  color: rgba(23, 21, 31, 0.74);
  line-height: 1.72;
}

.result-card ul {
  margin: 0;
  padding-left: 20px;
}

.dimension-list {
  display: grid;
  gap: 14px;
}

.dimension-meta,
.dimension-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  font-size: 0.8rem;
}

.dimension-meta span:last-child,
.dimension-score span:last-child {
  text-align: right;
}

.dimension-meta strong {
  color: var(--wine);
}

.dimension-track {
  position: relative;
  height: 12px;
  margin: 7px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4eef6;
  overflow: hidden;
}

.dimension-left {
  display: block;
  width: var(--left);
  height: 100%;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
}

.dimension-mid {
  position: absolute;
  top: -2px;
  left: calc(50% - 1px);
  width: 2px;
  height: 16px;
  background: rgba(23, 21, 31, 0.32);
}

.dimension-score {
  color: rgba(23, 21, 31, 0.62);
  font-weight: 900;
}

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

.character-chip {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.character-chip strong,
.character-chip span {
  display: block;
}

.character-chip strong {
  margin-bottom: 5px;
}

.character-chip span {
  color: rgba(23, 21, 31, 0.68);
  font-size: 0.92rem;
  line-height: 1.55;
}

.character-list.compact .character-chip span {
  display: none;
}

.disclaimer {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed rgba(23, 21, 31, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.78);
  color: rgba(23, 21, 31, 0.72);
  line-height: 1.65;
}

.disclaimer strong {
  flex: 0 0 auto;
  color: var(--wine);
}

.result-actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.5fr);
  gap: 24px;
  margin-bottom: 72px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 243, 221, 0.72);
}

.about-copy h2 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.about-copy p {
  color: rgba(23, 21, 31, 0.72);
  line-height: 1.8;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.about-tags span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 900;
}

@media (max-width: 880px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    justify-content: flex-start;
  }

  .hero,
  .about-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 40px;
  }

  .stage-visual {
    min-height: 430px;
  }

  .result-grid,
  .result-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar,
  .hero,
  .panel,
  .about-section {
    width: min(100% - 24px, var(--max));
  }

  .brand small {
    white-space: normal;
  }

  h1 {
    font-size: clamp(3.4rem, 18vw, 4.6rem);
  }

  .mode-actions,
  .choice-pair,
  .scale-row {
    grid-template-columns: 1fr;
  }

  .stage-visual {
    min-height: 360px;
  }

  .stage-card {
    min-width: 104px;
    min-height: 62px;
    font-size: 0.82rem;
  }

  .sticker-a {
    top: 80px;
    left: 24px;
  }

  .sticker-b {
    top: 156px;
    right: 22px;
  }

  .sticker-c {
    bottom: 94px;
    left: 26px;
  }

  .sticker-d {
    right: 28px;
    bottom: 26px;
  }

  .panel {
    padding: 16px;
  }

  .panel-head,
  .quiz-actions,
  .result-actions,
  .disclaimer {
    align-items: stretch;
    flex-direction: column;
  }

  .question-card {
    padding: 16px;
  }

  .dimension-meta,
  .dimension-score {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    font-size: 0.72rem;
  }

  .dimension-meta span:last-child,
  .dimension-score span:last-child {
    text-align: right;
  }
}
