:root {
  color-scheme: light;
  --bg: #f3efe4;
  --ink: #171717;
  --muted: #6d665c;
  --line: #24211c;
  --paper: #fffaf0;
  --paper-2: #e7f0e3;
  --accent: #e53e2f;
  --green: #0e6b62;
  --gold: #f2c94c;
  --blue: #315f9b;
  --shadow: 8px 8px 0 #171717;
  --radius: 8px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 23, 0.05) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 12px max(16px, calc((100vw - 1160px) / 2));
  border-bottom: 2px solid var(--line);
  background: rgba(255, 250, 240, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  padding: 7px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 950;
}

nav {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.section {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.hero {
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: end;
}

.hero-copy {
  min-height: 390px;
  padding: 34px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(14, 107, 98, 0.17), transparent 42%),
    radial-gradient(circle at 90% 18%, rgba(229, 62, 47, 0.18), transparent 24%),
    linear-gradient(135deg, var(--paper), #f8df9a);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.badge,
.eyebrow {
  width: fit-content;
  margin: 0 0 14px;
  padding: 5px 8px;
  border: 2px solid var(--line);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(52px, 8vw, 108px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
}

h3 {
  margin-bottom: 8px;
}

.lead,
.section-head p,
.panel p {
  color: var(--muted);
  line-height: 1.75;
}

.lead {
  max-width: 780px;
  margin-bottom: 24px;
  font-size: 18px;
}

.hero-actions,
.actions,
.pager {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button,
button {
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  transition:
    transform 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.button:hover,
button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
}

button:focus-visible,
a:focus-visible,
.option:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.secondary {
  background: #fff;
  color: var(--ink);
}

.compact {
  min-height: 40px;
  padding: 0 12px;
}

.poster {
  min-height: 310px;
  padding: 22px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf7;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: rotate(2deg);
}

.poster span,
.poster strong,
.poster small {
  display: block;
  font-weight: 950;
}

.poster span {
  font-size: 64px;
}

.poster strong {
  color: var(--green);
  font-size: 34px;
  line-height: 1;
}

.poster small {
  color: var(--muted);
}

.section-head {
  max-width: 760px;
  margin-bottom: 20px;
}

.model-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.panel,
.model-card,
.type-card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.model-card {
  min-height: 230px;
  padding: 20px;
}

.model-code {
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--gold);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 950;
}

.model-card ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.axis {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.axis span {
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fffdf7;
  font-size: 13px;
  font-weight: 900;
}

.axis span:last-child {
  background: var(--paper-2);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.workbench.has-result {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
}

.quiz-panel,
.result-panel {
  padding: 24px;
}

.result-panel {
  position: sticky;
  top: 78px;
  overflow: hidden;
  padding: 0;
}

.result-panel[hidden] {
  display: none;
}

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

.progress {
  min-width: 78px;
  padding: 10px;
  border: 2px solid var(--line);
  background: var(--paper-2);
  text-align: center;
  font-weight: 950;
}

.progress-bar {
  height: 12px;
  margin-bottom: 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fffdf7;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--green);
  transition: width 220ms var(--ease);
}

.questions {
  display: grid;
  gap: 14px;
}

.question {
  min-height: 390px;
  padding: 22px;
  border: 2px solid var(--line);
  background: #fffdf7;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.question legend {
  padding: 0;
  margin-bottom: 20px;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.16;
}

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

.option {
  position: relative;
  min-height: 72px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #f7f0df;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.option span {
  position: relative;
  z-index: 1;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.option:has(input:checked) {
  background: var(--green);
  color: #fff;
  box-shadow: 4px 4px 0 var(--line);
}

.actions {
  margin-top: 20px;
}

.pager {
  margin-top: 16px;
  justify-content: space-between;
}

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

button:disabled:hover {
  transform: none;
  box-shadow: none;
}

.result-hero {
  min-height: 260px;
  padding: 24px;
  border-bottom: 2px solid var(--line);
  background: var(--paper-2);
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 18px;
  align-items: center;
}

.avatar {
  min-height: 260px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, #fffdf7, #f8df9a);
  display: grid;
  place-items: center;
  padding: 10px;
  font-size: 84px;
  font-weight: 950;
}

.ld-avatar {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
}

.ld-card-art {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
}

.score-ring {
  width: 126px;
  height: 126px;
  border: 12px solid var(--line);
  border-radius: 50%;
  background:
    conic-gradient(var(--accent) calc(var(--score) * 1%), #fffdf7 0);
  display: grid;
  place-items: center;
  text-align: center;
}

.score-ring span {
  font-size: 40px;
  line-height: 1;
  font-weight: 950;
}

.score-ring small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.result-copy {
  padding: 24px;
}

.type-pill {
  width: fit-content;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--gold);
  font-weight: 950;
}

#result-quote {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.result-diagnosis {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.result-diagnosis article {
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fffdf7;
}

.result-diagnosis strong,
.result-diagnosis span {
  display: block;
}

.result-diagnosis strong {
  margin-bottom: 4px;
  color: var(--green);
  font-size: 13px;
  font-weight: 950;
}

.result-diagnosis span {
  color: var(--muted);
  line-height: 1.55;
}

.bars {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 850;
}

.bar-track {
  height: 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fffdf7;
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  background: var(--green);
}

.share-box {
  margin-top: 18px;
  padding: 14px;
  border: 2px dashed var(--line);
  background: #fffdf7;
}

.share-box p {
  margin-bottom: 12px;
  color: var(--ink);
  font-weight: 850;
}

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

.type-card {
  padding: 18px;
  cursor: pointer;
  transition:
    transform 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.type-card:hover,
.type-card.is-active {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 var(--line);
}

.type-card.is-active {
  background: var(--paper-2);
}

.type-avatar {
  height: 260px;
  margin-bottom: 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf7;
  display: grid;
  place-items: center;
  padding: 8px;
  font-size: 70px;
  font-weight: 950;
  overflow: hidden;
}

.type-avatar .ld-avatar {
  max-width: 150px;
}

.type-avatar .ld-card-art {
  max-width: 100%;
  height: 100%;
}

.type-card h3 {
  margin-bottom: 4px;
  font-size: 26px;
  line-height: 1;
}

.type-code {
  color: var(--green);
  font-size: 22px;
  font-weight: 950;
}

.type-card blockquote {
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.55;
}

.type-detail {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  line-height: 1.65;
}

.type-card.is-active .type-detail {
  display: block;
}

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

.faq-grid .panel {
  padding: 20px;
}

@media (max-width: 960px) {
  .hero,
  .workbench,
  .model-grid,
  .atlas-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .poster {
    min-height: auto;
    transform: none;
    flex-direction: row;
    align-items: center;
  }

  .result-panel {
    position: static;
  }
}

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

  nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .section {
    width: min(100% - 20px, 1160px);
    padding: 16px 0;
  }

  .hero-copy,
  .quiz-panel,
  .result-copy,
  .model-card,
  .type-card {
    padding: 18px;
  }

  .hero {
    min-height: auto;
  }

  .poster {
    display: none;
  }

  .quiz-head,
  .actions,
  .pager {
    flex-direction: column;
  }

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

  button,
  .button {
    width: 100%;
  }

  .question {
    min-height: calc(100svh - 280px);
    padding: 18px;
  }

  .option {
    min-height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
