:root {
  --bg: #f6efe6;
  --panel: rgba(255, 252, 247, 0.84);
  --panel-strong: rgba(255, 255, 255, 0.7);
  --ink: #16233f;
  --muted: #58647b;
  --line: rgba(22, 35, 63, 0.1);
  --accent: #ea5b2a;
  --accent-strong: #c84317;
  --accent-soft: rgba(234, 91, 42, 0.12);
  --teal: #148b82;
  --blue: #2f6df6;
  --gold: #c78d1d;
  --shadow: 0 24px 70px rgba(22, 35, 63, 0.12);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --ease: 220ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 188, 102, 0.28), transparent 28%),
    radial-gradient(circle at right 18%, rgba(47, 109, 246, 0.18), transparent 22%),
    linear-gradient(160deg, #faf4ea 0%, #f3e8d8 50%, #efe6da 100%);
  overflow-x: hidden;
}

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

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.58;
}

.ambient-a {
  top: 60px;
  right: -50px;
  width: 220px;
  height: 220px;
  background: rgba(234, 91, 42, 0.16);
}

.ambient-b {
  bottom: 120px;
  left: -40px;
  width: 260px;
  height: 260px;
  background: rgba(20, 139, 130, 0.14);
}

.ambient-c {
  bottom: -30px;
  right: 18%;
  width: 180px;
  height: 180px;
  background: rgba(47, 109, 246, 0.14);
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

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

.brand-lockup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.brand-mark {
  font-family: "Baskerville Old Face", "Times New Roman", "Songti SC", serif;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy {
  color: var(--muted);
  font-size: 0.95rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 20px;
}

.panel {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  padding: 28px;
  background: linear-gradient(180deg, var(--panel) 0%, rgba(255, 250, 242, 0.88) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.intro-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Baskerville Old Face", "Times New Roman", "Songti SC", serif;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.2rem);
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(2.1rem, 3vw, 3.1rem);
}

h3 {
  font-size: 1.06rem;
}

.lead,
.placeholder-copy,
.result-summary,
.question-hint,
.helper-text,
.feature-list,
.insight-card p,
.detail-card p,
.detail-list,
.dimension-meta,
.dimension-strength,
.metric-copy,
.panel-title,
.portrait-caption,
.temperament-card p {
  color: var(--muted);
  line-height: 1.72;
}

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

.stat-card,
.insight-card,
.detail-card,
.dimension-card,
.choice-button,
.temperament-card,
.metric-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  border-radius: var(--radius-lg);
}

.stat-card {
  padding: 18px;
}

.stat-value {
  display: block;
  margin-bottom: 6px;
  font-size: 2rem;
  font-weight: 800;
}

.stat-label {
  color: var(--muted);
}

.bullet-panel {
  padding: 20px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(20, 139, 130, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
}

.panel-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 700;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
}

.temperament-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.temperament-chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  font-size: 0.92rem;
  color: var(--ink);
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
}

.button {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
  transition:
    transform var(--ease),
    box-shadow var(--ease),
    background-color var(--ease),
    opacity var(--ease);
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.choice-button:focus-visible {
  outline: 3px solid rgba(47, 109, 246, 0.22);
  outline-offset: 2px;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 14px 30px rgba(200, 67, 23, 0.28);
}

.button.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.stage-panel {
  min-height: 880px;
  overflow: hidden;
}

.stage {
  animation: rise-in 380ms ease both;
}

.stage-hidden,
.is-hidden {
  display: none !important;
}

.placeholder-stage {
  display: grid;
  gap: 24px;
  align-content: start;
  min-height: 100%;
}

.placeholder-copywrap {
  padding: 10px 0;
}

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

.temperament-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
}

.temperament-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -24px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.14;
}

.temperament-card.nt::after {
  background: #2f6df6;
}

.temperament-card.nf::after {
  background: #e45a8a;
}

.temperament-card.sj::after {
  background: #148b82;
}

.temperament-card.sp::after {
  background: #ea5b2a;
}

.temperament-tag {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(22, 35, 63, 0.08);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.temperament-types {
  display: block;
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 600;
}

.quiz-head {
  display: grid;
  gap: 24px;
}

.question-head h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.progress-panel {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 35, 63, 0.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal) 0%, var(--blue) 100%);
  transition: width 260ms ease;
}

.meta-chip-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.meta-chip {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.meta-chip span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.meta-chip strong {
  display: block;
  font-size: 1rem;
}

.choice-list {
  display: grid;
  gap: 14px;
  margin: 28px 0 14px;
}

.choice-button {
  width: 100%;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition:
    transform var(--ease),
    border-color var(--ease),
    background-color var(--ease),
    box-shadow var(--ease);
}

.choice-button:hover {
  transform: translateY(-1px);
  border-color: rgba(234, 91, 42, 0.28);
}

.choice-button.is-selected {
  border-color: rgba(234, 91, 42, 0.32);
  background:
    linear-gradient(135deg, rgba(234, 91, 42, 0.12), rgba(47, 109, 246, 0.08)),
    rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 32px rgba(22, 35, 63, 0.1);
}

.choice-index {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 700;
}

.choice-copy {
  font-weight: 600;
  text-align: left;
}

.choice-weight {
  color: var(--muted);
  font-size: 0.92rem;
}

.legend-row,
.nav-row,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.legend-row {
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-row {
  margin-top: 28px;
}

.result-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: stretch;
  margin-bottom: 20px;
}

.result-copy,
.portrait-frame {
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.58));
}

.type-line {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.type-meta {
  display: grid;
  gap: 8px;
}

.type-group,
.type-archetype {
  margin: 0;
}

.type-group {
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.type-archetype {
  color: var(--muted);
}

.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 76px;
  padding: 10px 22px;
  border-radius: 999px;
  color: #fff;
  font-family: "Baskerville Old Face", "Times New Roman", "Songti SC", serif;
  font-size: clamp(2rem, 3vw, 2.9rem);
  letter-spacing: 0.16em;
  background: linear-gradient(135deg, #13213d 0%, #2f6df6 100%);
  box-shadow: 0 18px 34px rgba(47, 109, 246, 0.24);
}

.result-summary {
  margin: 0 0 18px;
  font-size: 1rem;
}

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

.keyword-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(22, 35, 63, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.portrait-frame {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portrait-visual {
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
}

.portrait-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

.portrait-caption {
  margin: 0;
  font-size: 0.94rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card {
  padding: 20px;
}

.metric-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-value {
  display: block;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.metric-copy {
  margin: 0;
}

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

.insight-card,
.detail-card {
  padding: 20px;
}

.insight-card h3,
.detail-card h3,
.dimension-card h3 {
  margin-bottom: 10px;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
}

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

.dimension-card {
  padding: 20px;
}

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

.dimension-pair {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dimension-strength {
  font-weight: 700;
  color: var(--ink);
}

.dimension-rail {
  position: relative;
  height: 14px;
  margin: 14px 0 12px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(20, 139, 130, 0.2), rgba(47, 109, 246, 0.24));
}

.dimension-indicator {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(234, 91, 42, 0.22);
  transform: translate(-50%, -50%);
}

.dimension-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dimension-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 100%);
    padding-top: 16px;
  }

  .panel {
    padding: 22px;
    border-radius: 24px;
  }

  .temperament-grid,
  .insight-grid,
  .detail-grid,
  .metric-grid,
  .meta-chip-row {
    grid-template-columns: 1fr;
  }

  .choice-button {
    grid-template-columns: auto 1fr;
  }

  .choice-weight {
    grid-column: 1 / -1;
    padding-left: 54px;
  }

  .legend-row,
  .nav-row,
  .result-actions,
  .topbar,
  .type-line {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}
