:root {
  --bg: #f6f4ef;
  --ink: #1c2430;
  --muted: #687181;
  --line: #ddd8cd;
  --panel: #fffdf8;
  --accent: #287c73;
  --accent-strong: #1f5f58;
  --warm: #c76d3c;
  --purple: #5b3b94;
  --lavender: #ded5ec;
  --shadow: 0 18px 50px rgba(28, 36, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(40, 124, 115, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(199, 109, 60, 0.14), transparent 38%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body.resultMode {
  background: #f1edf7;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.app {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px;
  display: grid;
  align-items: center;
}

body.resultMode .app {
  width: min(100%, 720px);
  padding: 0;
  align-items: stretch;
}

.hero,
.panel {
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(221, 216, 205, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 34px 24px;
}

.brand {
  width: fit-content;
  margin-bottom: 28px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 14px;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

p {
  color: var(--muted);
  line-height: 1.75;
}

.primary,
.ghost,
.option {
  min-height: 48px;
  border-radius: 8px;
  transition: transform 0.16s ease, background 0.16s ease, border 0.16s ease;
}

.primary {
  width: 100%;
  margin-top: 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}

.primary:disabled,
.ghost:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary:hover,
.option:hover,
.ghost:hover {
  transform: translateY(-1px);
}

.panel {
  padding: 22px;
}

.hidden {
  display: none !important;
}

.quizHeader {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--warm);
  font-size: 13px;
  font-weight: 800;
}

.testHint {
  margin: 14px 0 0;
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
}

.quizHint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.meter {
  height: 8px;
  overflow: hidden;
  background: #ebe6dc;
  border-radius: 999px;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.18s ease;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  width: 100%;
  padding: 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
  line-height: 1.55;
}

.option.selected {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.ghost {
  color: var(--accent-strong);
  background: rgba(40, 124, 115, 0.1);
}

.paymentPanel {
  padding: 22px;
}

.fullMeter {
  width: 100% !important;
}

.paymentSummary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid rgba(40, 124, 115, 0.16);
  border-radius: 8px;
  background: #fff;
}

.paymentSummary strong {
  color: var(--purple);
  font-size: 28px;
  line-height: 1;
}

.paymentSummary span {
  color: var(--warm);
  font-size: 20px;
  font-weight: 900;
}

.paymentActions .primary {
  margin-top: 0;
}

.paymentNote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.resultReport {
  position: relative;
  min-height: 100vh;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(49, 36, 72, 0.14);
}

.reportPaper {
  position: relative;
  min-height: 100vh;
  padding: 46px 56px 34px;
  background:
    linear-gradient(rgba(108, 87, 134, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 87, 134, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  background-size: 24px 24px, 24px 24px, auto;
}

.reportPaper::before {
  content: "";
  position: absolute;
  inset: 118px 0 auto 0;
  height: 18px;
  background: linear-gradient(90deg, transparent, rgba(113, 74, 199, 0.15), #7651ca, rgba(113, 74, 199, 0.15), transparent);
  box-shadow: 0 18px 12px rgba(95, 69, 160, 0.16);
}

.reportDecor {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  margin-bottom: 68px;
}

.reportDecor span {
  display: block;
  width: 190px;
  height: 12px;
  background-image: radial-gradient(circle, rgba(91, 59, 148, 0.3) 0 4px, transparent 5px);
  background-size: 22px 12px;
}

.reportHero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: start;
  gap: 24px;
  min-height: 330px;
}

.typeBlock {
  position: relative;
  padding-top: 34px;
}

.watermark {
  position: absolute;
  top: 0;
  left: 0;
  color: rgba(166, 117, 94, 0.18);
  font-size: 54px;
  font-weight: 900;
  letter-spacing: 8px;
  line-height: 1;
}

.reportKicker {
  position: relative;
  margin: 30px 0 14px;
  color: var(--purple);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.2;
}

#typeCode {
  display: inline-block;
  margin: 0;
  color: var(--purple);
  font-size: clamp(76px, 14vw, 108px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.typeTagline {
  margin: 70px 0 0;
  color: var(--purple);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
}

.characterCard {
  position: relative;
  margin: 0;
  align-self: stretch;
  min-height: 350px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff8ee;
}

.characterCard::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(91, 59, 148, 0.12);
  border-radius: 8px;
  pointer-events: none;
  z-index: 1;
}

.characterCard img {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  display: block;
  object-fit: cover;
}

.typeSummary {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  margin: -42px 0 28px;
  color: #5b5365;
  font-size: 17px;
  line-height: 1.8;
}

.scoreGrid {
  display: grid;
  gap: 10px;
  margin: 22px 0 6px;
}

.reportScores {
  position: relative;
  z-index: 2;
  gap: 24px;
  margin-top: 22px;
}

.scoreItem {
  display: grid;
  gap: 6px;
}

.reportScore {
  grid-template-columns: 116px minmax(0, 1fr) 116px;
  align-items: center;
  gap: 18px;
}

.scoreEnd {
  display: grid;
  gap: 2px;
  font-size: 20px;
  line-height: 1.2;
}

.scoreEnd strong {
  font-size: 22px;
  font-weight: 900;
}

.scoreEnd span {
  color: #37323e;
}

.rightEnd {
  text-align: right;
}

.scoreLabel {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.scoreTrack {
  height: 18px;
  border-radius: 999px;
  background: #ebe6dc;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(44, 34, 58, 0.14);
}

.scoreTrack span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.reportAgain {
  position: relative;
  z-index: 2;
  margin-top: 34px;
  background: var(--purple);
}

.eightReport {
  position: relative;
  z-index: 2;
  margin-top: 34px;
}

.sectionHeader {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.sectionHeader .eyebrow {
  margin: 0;
  color: var(--warm);
}

.sectionHeader h3 {
  margin: 0;
  color: var(--purple);
  font-size: 26px;
  line-height: 1.2;
}

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

.functionCard {
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 16px;
  border: 1px solid rgba(91, 59, 148, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 10px 24px rgba(49, 36, 72, 0.08);
}

.functionCard.shadowStack {
  background: rgba(246, 242, 250, 0.9);
}

.functionTopline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #70667b;
  font-size: 12px;
  font-weight: 800;
}

.stackIndex {
  color: var(--warm);
  font-size: 18px;
}

.functionTitle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.functionTitle h4 {
  margin: 0;
  color: #34293f;
  font-size: 19px;
  line-height: 1.25;
}

.functionTitle strong {
  color: var(--purple);
  font-size: 28px;
  line-height: 1;
}

.functionName {
  margin: 0;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.functionCard p:last-child {
  margin: 0;
  color: #5b5365;
  font-size: 14px;
  line-height: 1.7;
}

.lifeReports {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.lifeReportBlock {
  padding: 18px;
  border: 1px solid rgba(40, 124, 115, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 10px 24px rgba(49, 36, 72, 0.08);
}

.loveBlock {
  border-color: rgba(199, 109, 60, 0.2);
}

.careerBlock {
  border-color: rgba(40, 124, 115, 0.22);
}

.lifeReportBlock ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lifeReportBlock li {
  position: relative;
  padding-left: 18px;
  color: #5b5365;
  font-size: 14px;
  line-height: 1.7;
}

.lifeReportBlock li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.loveBlock li::before {
  background: var(--warm);
}

.shareTools {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.shareLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 620px) {
  .reportPaper {
    min-height: 100vh;
    padding: 32px 18px 26px;
  }

  .reportPaper::before {
    top: 94px;
  }

  .reportDecor {
    margin-bottom: 52px;
  }

  .reportDecor span {
    width: 120px;
  }

  .reportHero {
    grid-template-columns: minmax(0, 1fr) 40%;
    gap: 12px;
    min-height: 300px;
  }

  .typeBlock {
    padding-top: 24px;
  }

  .watermark {
    font-size: 42px;
  }

  .reportKicker {
    margin-top: 26px;
    font-size: 23px;
  }

  #typeCode {
    font-size: clamp(66px, 17vw, 82px);
  }

  .typeTagline {
    margin-top: 54px;
    font-size: 24px;
  }

  .characterCard {
    width: 100%;
    min-height: 300px;
    justify-self: stretch;
    margin-top: 0;
  }

  .characterCard img {
    inset: 0;
    width: 100%;
  }

  .typeSummary {
    margin: 8px 0 24px;
    font-size: 15px;
  }

  .reportScore {
    grid-template-columns: 74px minmax(0, 1fr) 74px;
    gap: 10px;
  }

  .scoreEnd {
    font-size: 16px;
  }

  .scoreEnd strong {
    font-size: 18px;
  }

  .scoreTrack {
    height: 16px;
  }

  .functionGrid {
    grid-template-columns: 1fr;
  }

  .lifeReports {
    grid-template-columns: 1fr;
  }

  .shareTools {
    grid-template-columns: 1fr;
  }

  .sectionHeader h3 {
    font-size: 23px;
  }
}

@media (max-width: 380px) {
  .app {
    padding: 14px;
  }

  body.resultMode .app {
    padding: 0;
  }

  .hero,
  .panel {
    padding: 18px;
  }

  h1 {
    font-size: 29px;
  }

  .reportScore {
    grid-template-columns: 64px minmax(0, 1fr) 64px;
  }

  .scoreEnd {
    font-size: 14px;
  }
}
