:root {
  --bg: #f4ece2;
  --paper: rgba(255, 251, 246, 0.92);
  --paper-strong: #fff9f2;
  --line: rgba(117, 36, 56, 0.14);
  --line-strong: rgba(117, 36, 56, 0.24);
  --text: #2a1c20;
  --muted: #7f6a6f;
  --brand: #7d1d39;
  --brand-deep: #5f1229;
  --gold: #c9a35d;
  --sea: #2e6676;
  --shadow: 0 24px 60px rgba(69, 24, 39, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(201, 163, 93, 0.18), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(46, 102, 118, 0.18), transparent 24%),
    linear-gradient(180deg, #fbf6ef 0%, #f2e7d8 48%, #efe2d3 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(125, 29, 57, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(125, 29, 57, 0.03) 1px, transparent 1px),
    linear-gradient(180deg, rgba(46, 102, 118, 0.04), transparent 28%);
  background-size: 38px 38px, 38px 38px, 100% 100%;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent 92%);
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0;
  height: 180px;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 100%, rgba(46, 102, 118, 0.18), transparent 36%),
    radial-gradient(circle at 80% 100%, rgba(125, 29, 57, 0.16), transparent 30%);
}

h1,
h2,
h3,
.type-name,
.poster-word,
.poster-title {
  font-family: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
}

button {
  font: inherit;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 16px 56px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero,
.test-wrap,
.result-wrap {
  padding: 28px;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 251, 245, 0.96), rgba(248, 240, 230, 0.9)),
    var(--paper);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -40px -36px;
  height: 150px;
  opacity: 0.52;
  background:
    radial-gradient(circle at 8% 100%, rgba(46, 102, 118, 0.18), transparent 18%),
    radial-gradient(circle at 28% 100%, rgba(46, 102, 118, 0.12), transparent 15%),
    repeating-linear-gradient(
      90deg,
      rgba(125, 29, 57, 0.1) 0 56px,
      rgba(255, 255, 255, 0) 56px 64px
    );
  clip-path: polygon(0 100%, 0 46%, 6% 30%, 12% 52%, 18% 34%, 24% 55%, 30% 36%, 36% 57%, 42% 38%, 48% 58%, 54% 36%, 60% 56%, 66% 34%, 72% 54%, 78% 32%, 84% 52%, 90% 34%, 100% 56%, 100% 100%);
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 29, 57, 0.18), rgba(125, 29, 57, 0));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  background: rgba(125, 29, 57, 0.08);
  border: 1px solid rgba(125, 29, 57, 0.12);
}

.hero h1 {
  margin: 18px 0 0;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  max-width: 760px;
  letter-spacing: -0.04em;
}

.hero-sub {
  margin: 18px 0 0;
  max-width: 760px;
  line-height: 1.9;
  color: var(--muted);
  font-size: 15px;
}

.campus-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.campus-strip span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(117, 36, 56, 0.12);
  color: var(--brand-deep);
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.result-grid {
  display: grid;
  gap: 18px;
}

.panel-card,
.question,
.type-box,
.poster-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.97), rgba(255, 247, 239, 0.92)),
    linear-gradient(90deg, rgba(125, 29, 57, 0.02), rgba(46, 102, 118, 0.02));
}

.panel-card,
.type-box {
  padding: 20px;
}

.panel-card h3,
.test-head h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.type-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.type-cloud span,
.tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(125, 29, 57, 0.06);
  color: var(--brand);
  font-size: 13px;
}

.hero-actions,
.result-actions,
.actions-bottom,
.topbar,
.test-head,
.tag-row,
.scene-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 28px;
}

.hero-type-cloud {
  margin-top: 26px;
  max-width: 760px;
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 20px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

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

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn-primary {
  color: #fff9f1;
  background: linear-gradient(135deg, var(--brand), var(--sea));
  box-shadow: 0 18px 40px rgba(64, 32, 48, 0.22);
  font-weight: 700;
}

.btn-secondary {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-weight: 700;
}

.topbar {
  justify-content: space-between;
}

.progress {
  flex: 1;
  min-width: 240px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(125, 29, 57, 0.08);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--brand), var(--sea));
  transition: width 0.22s ease;
}

.progress-text,
.footnote,
#testHint,
.share-copy,
.route-item p,
.top-match-item p,
.dimension-copy {
  color: var(--muted);
}

.progress-text {
  font-size: 13px;
  min-width: 72px;
  text-align: right;
}

.test-head {
  justify-content: space-between;
  margin: 22px 0 18px;
}

.test-head p {
  margin: 0;
  max-width: 720px;
  line-height: 1.8;
}

.question-list {
  display: grid;
  gap: 16px;
}

.question {
  padding: 18px;
  animation: fadeUp 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 0.03s);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.question-meta {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(46, 102, 118, 0.08);
  color: var(--sea);
  border: 1px solid rgba(46, 102, 118, 0.12);
}

.question-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.8;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.option:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 246, 239, 0.96));
}

.option input {
  margin-top: 4px;
  accent-color: var(--brand);
  flex-shrink: 0;
}

.option-code {
  font-weight: 800;
  color: var(--brand);
  min-width: 22px;
}

.option-copy {
  line-height: 1.8;
}

.actions-bottom {
  justify-content: space-between;
  margin-top: 18px;
}

.scene-actions {
  justify-content: flex-end;
}

.result-top {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}

.poster-box {
  position: relative;
  min-height: 330px;
  padding: 26px;
  overflow: hidden;
  color: #fff9f2;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(135deg, var(--poster-start, #7d1d39), var(--poster-end, #2e6676));
}

.poster-noise {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background:
    linear-gradient(120deg, transparent 0 40%, rgba(255, 255, 255, 0.2) 50%, transparent 60% 100%),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 18%),
    radial-gradient(circle at 78% 74%, rgba(255, 255, 255, 0.14), transparent 22%);
}

.poster-word,
.poster-title,
.poster-note {
  position: relative;
  z-index: 1;
}

.poster-word {
  font-size: clamp(48px, 9vw, 92px);
  line-height: 1;
  letter-spacing: -0.06em;
  margin-top: 28px;
}

.poster-title {
  margin-top: 18px;
  font-size: 26px;
}

.poster-note {
  margin-top: 12px;
  max-width: 320px;
  line-height: 1.9;
  color: rgba(255, 249, 242, 0.88);
}

.type-kicker {
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.type-name {
  margin-top: 10px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
}

.type-subname {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.match-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--brand);
  background: rgba(125, 29, 57, 0.08);
  border: 1px solid rgba(125, 29, 57, 0.14);
  font-weight: 700;
}

.type-desc {
  margin: 18px 0 0;
  line-height: 1.9;
}

.type-rule-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.type-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.type-fact {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.type-fact strong {
  display: block;
  font-size: 14px;
  color: var(--brand);
}

.type-fact p {
  margin: 8px 0 0;
  line-height: 1.8;
  font-size: 14px;
  color: var(--muted);
}

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

.secondary-grid {
  margin-top: 16px;
}

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

.chemistry-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.chemistry-item strong {
  display: block;
  font-size: 14px;
  color: var(--brand);
}

.chemistry-target {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.chemistry-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}

.subsection-title {
  margin-top: 18px;
}

.route-list,
.top-match-list {
  display: grid;
  gap: 12px;
}

.route-item,
.top-match-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.top-match-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.route-item strong,
.top-match-head strong {
  font-size: 15px;
}

.route-item p,
.top-match-item p {
  margin: 8px 0 0;
  line-height: 1.8;
  font-size: 14px;
}

.share-copy {
  margin: 0;
  line-height: 1.9;
}

.result-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .result-top,
  .result-grid,
  .type-facts {
    grid-template-columns: 1fr;
  }
}

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

  .hero,
  .test-wrap,
  .result-wrap {
    padding: 18px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .question-title {
    font-size: 16px;
  }

  .actions-bottom,
  .result-actions,
  .test-head {
    align-items: stretch;
  }

  .result-actions .btn,
  .actions-bottom .btn,
  .test-head .btn,
  .scene-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
