:root {
  color-scheme: light;
  --ink: #171611;
  --muted: #67645d;
  --line: #ded9ce;
  --soft-line: #ebe7df;
  --paper: #fbfaf7;
  --white: #ffffff;
  --gold: #ae8745;
  --gold-dark: #7c5b27;
  --gold-soft: #f1e7d2;
  --charcoal: #191812;
  --danger: #914136;
  --shadow: 0 20px 52px rgba(39, 33, 23, 0.1);
  --radius-lg: 26px;
  --radius-md: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(174, 135, 69, 0.1), transparent 30rem),
    linear-gradient(180deg, #fdfcf9 0%, #f7f4ed 100%);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

.page-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 20px calc(28px + var(--safe-bottom));
}

.brand-bar {
  padding: 18px 0 8px;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-dark);
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.app {
  min-height: calc(100vh - 150px);
}

.view {
  animation: rise 360ms ease both;
}

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

.intro-view {
  padding: 48px 0 28px;
}

.eyebrow,
.result-kicker {
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 580px;
  margin: 14px 0 15px;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: clamp(42px, 10vw, 66px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

h1 span {
  color: var(--gold-dark);
}

.lead {
  max-width: 520px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 18px;
}

.intro-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.intro-metrics div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  border-right: 1px solid var(--line);
}

.intro-metrics div:last-child {
  border-right: 0;
}

.intro-metrics strong {
  font-family: Georgia, serif;
  font-size: 28px;
  line-height: 1;
}

.intro-metrics span {
  color: var(--muted);
  font-size: 13px;
}

.principle-card {
  position: relative;
  margin-bottom: 24px;
  padding: 22px 22px 18px 52px;
  overflow: hidden;
  border: 1px solid rgba(174, 135, 69, 0.34);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fffdf8, #f4ead6);
}

.principle-card p {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.75;
}

.quote-mark {
  position: absolute;
  top: 4px;
  left: 16px;
  color: rgba(174, 135, 69, 0.35);
  font-family: Georgia, serif;
  font-size: 64px;
  line-height: 1;
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.primary-button {
  width: 100%;
  padding: 14px 24px;
  border: 1px solid var(--charcoal);
  color: #fff;
  background: var(--charcoal);
  box-shadow: 0 12px 30px rgba(25, 24, 18, 0.18);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px) scale(0.995);
}

.primary-button:disabled {
  border-color: #b8b4ac;
  background: #b8b4ac;
  box-shadow: none;
  cursor: not-allowed;
}

.secondary-button {
  padding: 13px 22px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
}

.text-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  color: var(--gold-dark);
  background: transparent;
}

.privacy-note,
.cta-note {
  margin: 12px 0 0;
  color: #858178;
  font-size: 13px;
  text-align: center;
}

.quiz-view {
  padding: 28px 0 22px;
}

.progress-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 14px;
}

.progress-topline > span:first-child {
  color: var(--gold-dark);
  font-weight: 700;
}

.progress-topline b {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 18px;
}

.progress-track {
  height: 5px;
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e1d7;
}

.progress-fill {
  width: 4.16%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dark), #d1b477);
  transition: width 300ms ease;
}

.question-card {
  min-height: 480px;
  padding: 28px 24px 24px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.question-index {
  margin-bottom: 12px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}

.question-card h2 {
  margin-bottom: 10px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(24px, 6vw, 32px);
  line-height: 1.45;
}

.question-hint {
  min-height: 52px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 15px;
}

.options {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  border: 0;
}

.option {
  position: relative;
  display: block;
}

.option input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.option-content {
  display: grid;
  min-height: 64px;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
  transition: border 150ms ease, background 150ms ease, transform 150ms ease;
}

.option-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 14px;
}

.option strong,
.option small {
  display: block;
}

.option strong {
  font-size: 16px;
}

.option small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.option input:checked + .option-content {
  border-color: var(--gold);
  background: var(--gold-soft);
  transform: translateX(3px);
}

.option input:checked + .option-content .option-number {
  border-color: var(--gold-dark);
  color: white;
  background: var(--gold-dark);
}

.option input:focus-visible + .option-content {
  outline: 3px solid rgba(174, 135, 69, 0.28);
  outline-offset: 2px;
}

.quiz-actions {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 12px;
  margin-top: 18px;
}

.result-view {
  padding: 35px 0 28px;
}

.score-lockup {
  display: grid;
  grid-template-columns: 132px 1fr;
  align-items: center;
  gap: 22px;
  margin: 18px 0 24px;
}

.score-ring {
  display: grid;
  width: 132px;
  height: 132px;
  place-content: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 55%, transparent 57%),
    conic-gradient(from -25deg, var(--gold), #e5d3ae, var(--gold));
  text-align: center;
}

.score-ring strong,
.score-ring span {
  display: block;
}

.score-ring strong {
  font-family: Georgia, serif;
  font-size: 48px;
  line-height: 0.95;
}

.score-ring span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.stage-number {
  margin-bottom: 2px;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.score-lockup h2 {
  margin-bottom: 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.22;
}

.stage-summary {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.result-panel {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid var(--soft-line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 38px rgba(39, 33, 23, 0.07);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading span,
.panel-label,
.belief-card > span,
.critical-notice > span {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.panel-heading h3,
.diagnosis-panel h3,
.critical-notice h3 {
  margin: 3px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  line-height: 1.4;
}

.scale-note {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #f3f1ec;
  font-size: 12px;
}

.radar-wrap {
  width: 100%;
  aspect-ratio: 1.22 / 1;
  margin: 10px 0 4px;
}

#radarCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dimension-scores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 18px;
  padding-top: 16px;
  border-top: 1px solid var(--soft-line);
}

.dimension-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
}

.dimension-row span {
  color: var(--muted);
  font-size: 13px;
}

.dimension-row strong {
  font-family: Georgia, serif;
  font-size: 16px;
}

.dimension-bar {
  grid-column: 1 / -1;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9e5dc;
}

.dimension-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.diagnosis-panel {
  border-left: 4px solid var(--gold);
}

.diagnosis-panel p,
.critical-notice p {
  margin: 10px 0 0;
  color: var(--muted);
}

.critical-notice {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid rgba(145, 65, 54, 0.28);
  border-radius: var(--radius-lg);
  background: #fff7f4;
}

.critical-notice > span {
  color: var(--danger);
}

.belief-card {
  margin: 16px 0 22px;
  padding: 24px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(174, 135, 69, 0.18), transparent 45%),
    var(--charcoal);
}

.belief-card > span {
  color: #d9bd83;
}

.belief-card p {
  margin: 8px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.65;
}

.cta-button {
  min-height: 58px;
  background: linear-gradient(135deg, #8d682e, #ba9656);
  border-color: #8d682e;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 18px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  color: #8a867e;
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 20;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border-radius: 999px;
  color: white;
  background: rgba(25, 24, 18, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

@media (min-width: 760px) {
  .page-shell {
    padding-inline: 34px;
  }

  .intro-view {
    padding-top: 70px;
  }

  .question-card {
    padding: 34px 36px 30px;
  }

  .result-panel,
  .critical-notice,
  .belief-card {
    padding: 28px;
  }
}

@media (max-width: 460px) {
  .page-shell {
    padding-inline: 16px;
  }

  .intro-view {
    padding-top: 36px;
  }

  .question-card {
    min-height: 520px;
    padding: 24px 18px 20px;
    border-radius: 22px;
  }

  .score-lockup {
    grid-template-columns: 112px 1fr;
    gap: 16px;
  }

  .score-ring {
    width: 112px;
    height: 112px;
  }

  .score-ring strong {
    font-size: 42px;
  }

  .dimension-scores {
    grid-template-columns: 1fr;
  }

  footer {
    display: grid;
  }
}

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