:root {
  color-scheme: light;
  --green-950: #102f29;
  --green-900: #173f35;
  --green-800: #235547;
  --green-100: #dce8e2;
  --cream: #f5f0e5;
  --paper: #fffdf8;
  --ink: #202a27;
  --muted: #68736f;
  --line: #d8d5ca;
  --red: #a84634;
  --red-dark: #843325;
  --mustard: #c89a3b;
  --shadow: 0 18px 50px rgb(23 63 53 / 10%);
  --radius: 18px;
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 49.9%, rgb(23 63 53 / 3%) 50%, transparent 50.1%),
    var(--cream);
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  color: white;
  background: var(--green-950);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgb(255 255 255 / 16%);
  color: white;
  background: rgb(23 63 53 / 97%);
  backdrop-filter: blur(12px);
}

.header-inner,
.footer-inner,
.app-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  text-align: left;
  color: inherit;
  background: none;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 70%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.brand-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.12em;
}

.brand-copy span {
  margin-top: 3px;
  color: rgb(255 255 255 / 72%);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.project-label {
  color: rgb(255 255 255 / 72%);
  font-size: 12px;
}

.language-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.language-switch button {
  min-width: 30px;
  padding: 7px 3px;
  border: 0;
  color: rgb(255 255 255 / 60%);
  background: none;
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: white;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--mustard);
  text-underline-offset: 5px;
}

.app-shell {
  min-height: calc(100vh - 228px);
  padding: 54px 0 72px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  line-height: 1.25;
}

h1,
.result-title {
  margin-bottom: 18px;
  color: var(--green-950);
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  gap: 48px;
  align-items: start;
}

.intro-lead {
  max-width: 720px;
  margin-bottom: 28px;
  color: #3f4c48;
  font-size: 17px;
}

.intro-actions,
.result-actions,
.quiz-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--green-900);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

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

.button-primary {
  color: white;
  background: var(--green-900);
}

.button-primary:hover:not(:disabled) {
  background: var(--green-800);
}

.button-secondary {
  color: var(--green-900);
  background: transparent;
}

.button-secondary:hover:not(:disabled) {
  background: var(--green-100);
}

.button-quiet {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.button:disabled {
  border-color: var(--line);
  color: #989c98;
  background: #e8e6df;
  cursor: not-allowed;
}

.intro-panel,
.question-card,
.result-card,
.method-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.intro-panel {
  overflow: hidden;
}

.intro-panel-head {
  padding: 18px 22px;
  color: white;
  background: var(--green-900);
}

.intro-panel-head strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.intro-panel-head span {
  color: rgb(255 255 255 / 72%);
  font-size: 12px;
}

.facts-list {
  margin: 0;
  padding: 8px 22px;
  list-style: none;
}

.facts-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.facts-list li:last-child {
  border-bottom: 0;
}

.fact-number {
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
}

.facts-list strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.facts-list p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.privacy-note,
.resume-note,
.result-notice {
  margin: 24px 0 0;
  padding: 13px 16px;
  border-left: 3px solid var(--mustard);
  color: #4f5b57;
  background: rgb(200 154 59 / 10%);
  font-size: 13px;
}

.resume-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 680px;
}

.resume-note p {
  margin: 0;
}

.text-button {
  padding: 4px;
  border: 0;
  color: var(--red-dark);
  background: none;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.quiz-shell {
  max-width: 880px;
  margin: 0 auto;
}

.quiz-topline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.quiz-count {
  color: var(--green-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}

.dimension-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.progress-track {
  height: 5px;
  margin-bottom: 24px;
  overflow: hidden;
  background: #dad8d0;
}

.progress-fill {
  height: 100%;
  background: var(--red);
  transition: width 220ms ease;
}

.question-card {
  padding: clamp(26px, 5vw, 52px);
}

.question-id {
  margin-bottom: 15px;
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.question-text {
  max-width: 760px;
  margin-bottom: 34px;
  color: var(--green-950);
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(21px, 3vw, 29px);
  font-weight: 600;
}

.scale-legend {
  display: flex;
  justify-content: space-between;
  margin: 0 3px 9px;
  color: var(--muted);
  font-size: 11px;
}

.scale-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.scale-option {
  position: relative;
}

.scale-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.scale-option label {
  min-height: 91px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #53605c;
  background: #faf8f2;
  text-align: center;
  cursor: pointer;
  transition: border 150ms ease, background 150ms ease, transform 150ms ease;
}

.scale-option label:hover {
  border-color: var(--green-800);
  transform: translateY(-1px);
}

.scale-option input:focus-visible + label {
  outline: 3px solid var(--mustard);
  outline-offset: 2px;
}

.scale-option input:checked + label {
  border-color: var(--green-900);
  color: white;
  background: var(--green-900);
  box-shadow: 0 6px 16px rgb(23 63 53 / 18%);
}

.scale-number {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1;
}

.scale-label {
  font-size: 10px;
  line-height: 1.25;
}

.quiz-navigation {
  justify-content: space-between;
  margin-top: 20px;
}

.quiz-navigation-right {
  display: flex;
  gap: 10px;
}

.result-shell {
  max-width: 980px;
  margin: 0 auto;
}

.result-intro {
  margin-bottom: 22px;
}

.result-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  --character-bg: #f2e6e1;
  --character-accent: #a84634;
}

.result-card[data-character-family="fd"] {
  --character-bg: #fff0d8;
  --character-accent: #b97922;
}

.result-card[data-character-family="rb"] {
  --character-bg: #e9efe2;
  --character-accent: #687a54;
}

.result-card[data-character-family="rd"] {
  --character-bg: #e9edf8;
  --character-accent: #6574aa;
}

.result-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--red);
}

.result-copy {
  padding: clamp(28px, 5vw, 52px);
}

.result-code {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 4px 8px;
  border: 1px solid var(--red);
  color: var(--red-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.result-title {
  margin-bottom: 4px;
  font-size: clamp(29px, 4vw, 40px);
}

.result-label {
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.type-axes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 18px;
}

.type-axes span {
  min-width: 0;
  padding: 8px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #faf8f2;
  font-size: 10px;
  text-align: center;
}

.type-axes strong {
  display: block;
  color: var(--green-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.risk-level {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 13px;
}

.risk-level strong {
  color: var(--muted);
  font-weight: 600;
}

.risk-level span {
  padding: 2px 8px;
  border: 1px solid rgb(168 70 52 / 35%);
  color: var(--red-dark);
  background: rgb(168 70 52 / 7%);
  font-weight: 750;
}

.risk-summary {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.risk-summary strong {
  color: var(--green-950);
}

.result-summary {
  color: #40504b;
  font-size: 15px;
}

.result-quote {
  margin: 20px 0 0;
  padding: 0 0 0 15px;
  border-left: 3px solid var(--mustard);
  color: var(--green-950);
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 15px;
}

.action-box {
  margin-top: 24px;
  padding: 17px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #faf7ef;
}

.action-box strong {
  display: block;
  margin-bottom: 5px;
  color: var(--red-dark);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.action-box p {
  margin: 0;
  font-size: 14px;
}

.result-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.result-character {
  position: relative;
  min-height: 328px;
  display: grid;
  margin: 0;
  overflow: hidden;
  place-items: center;
  border-bottom: 1px solid rgb(16 47 41 / 12%);
  background:
    radial-gradient(circle at 50% 54%, rgb(255 255 255 / 68%) 0 29%, transparent 30%),
    var(--character-bg);
}

.result-character::after {
  content: "";
  position: absolute;
  right: 25px;
  bottom: 22px;
  left: 25px;
  height: 1px;
  background: color-mix(in srgb, var(--character-accent) 45%, transparent);
}

.result-character img {
  position: relative;
  z-index: 1;
  width: min(100%, 350px);
  height: 328px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgb(16 47 41 / 10%));
}

.score-panel {
  flex: 1;
  padding: clamp(28px, 4vw, 44px);
  color: white;
  background: var(--green-900);
}

.score-panel h2 {
  margin-bottom: 24px;
  font-size: 16px;
}

.score-row {
  margin-bottom: 20px;
}

.score-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.score-name {
  font-size: 12px;
}

.score-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.score-track {
  height: 7px;
  overflow: hidden;
  background: rgb(255 255 255 / 18%);
}

.score-fill {
  height: 100%;
  background: var(--mustard);
}

.score-help {
  margin: 22px 0 0;
  color: rgb(255 255 255 / 65%);
  font-size: 11px;
}

.result-actions {
  margin-top: 22px;
}

.method-card {
  margin-top: 28px;
  padding: 24px 28px;
  box-shadow: none;
}

.method-card summary {
  color: var(--green-950);
  font-weight: 750;
  cursor: pointer;
}

.method-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.research-card {
  margin-top: 12px;
}

.research-card ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 15px 0 0;
  padding-left: 18px;
}

.research-card a {
  color: var(--green-800);
  font-size: 12px;
  text-underline-offset: 3px;
}

.share-dialog {
  width: min(860px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 90px rgb(0 0 0 / 28%);
}

.share-dialog::backdrop {
  background: rgb(10 28 24 / 68%);
  backdrop-filter: blur(5px);
}

.share-dialog-close {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.share-dialog-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.share-qr-column {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px;
  color: white;
  background: var(--green-900);
}

.share-qr-frame {
  padding: 13px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 30px rgb(0 0 0 / 15%);
}

.share-qr-image {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

.share-url {
  margin-top: 18px;
  overflow-wrap: anywhere;
  color: rgb(255 255 255 / 64%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  line-height: 1.45;
}

.share-dialog-copy {
  padding: 54px 44px 42px;
}

.share-dialog-copy h2 {
  margin-bottom: 15px;
  color: var(--green-950);
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 30px;
}

.share-dialog-copy > p:not(.eyebrow) {
  color: #46534f;
  font-size: 14px;
}

.share-privacy {
  margin: 20px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--mustard);
  background: rgb(200 154 59 / 10%);
}

.share-privacy strong {
  color: var(--green-950);
  font-size: 13px;
}

.wechat-tip {
  margin: 22px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.wechat-tip strong {
  color: var(--red-dark);
  font-size: 13px;
}

.wechat-tip p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.share-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}

.share-dialog-actions .button {
  min-height: 42px;
  padding: 9px 14px;
  font-size: 13px;
}

.site-footer {
  border-top: 1px solid rgb(255 255 255 / 12%);
  color: rgb(255 255 255 / 78%);
  background: var(--green-950);
}

.footer-inner {
  min-height: 160px;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 40px;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 28px;
}

.footer-inner strong {
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.08em;
}

.footer-inner p {
  margin: 5px 0 0;
  font-size: 12px;
}

.footer-disclaimer {
  max-width: 590px;
  color: rgb(255 255 255 / 58%);
}

.status-message {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100% - 40px));
  padding: 11px 15px;
  border-radius: 4px;
  color: white;
  background: var(--green-950);
  box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.status-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .header-inner,
  .footer-inner,
  .app-shell {
    width: min(100% - 28px, 1120px);
  }

  .header-inner {
    min-height: 62px;
  }

  .project-label,
  .brand-copy span {
    display: none;
  }

  .intro-grid,
  .result-card,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .intro-grid {
    gap: 30px;
  }

  .app-shell {
    min-height: calc(100vh - 190px);
    padding: 35px 0 50px;
  }

  .footer-inner {
    min-height: 190px;
    gap: 4px;
  }

  .question-card {
    padding: 24px 18px;
  }

  .scale-legend {
    display: none;
  }

  .scale-options {
    grid-template-columns: 1fr;
  }

  .scale-option label {
    min-height: 48px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
    padding: 9px 14px;
    text-align: left;
  }

  .scale-number {
    width: 26px;
    font-size: 19px;
  }

  .scale-label {
    font-size: 12px;
  }

  .quiz-navigation {
    align-items: stretch;
  }

  .quiz-navigation-right {
    flex: 1;
    justify-content: flex-end;
  }

  .quiz-navigation .button {
    padding-inline: 14px;
  }

  .result-card::before {
    width: 100%;
    height: 5px;
  }

  .result-character {
    min-height: 300px;
  }

  .result-character img {
    width: min(100%, 330px);
    height: 300px;
  }

  .result-actions .button {
    flex: 1 1 42%;
  }

  .type-axes,
  .research-card ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-dialog {
    width: min(100% - 20px, 520px);
    max-height: calc(100vh - 20px);
  }

  .share-dialog-grid {
    grid-template-columns: 1fr;
  }

  .share-qr-column {
    min-height: auto;
    padding: 52px 52px 28px;
  }

  .share-url {
    display: none;
  }

  .share-dialog-copy {
    padding: 30px 24px 28px;
  }

  .share-dialog-copy h2 {
    font-size: 25px;
  }

  .share-dialog-actions .button {
    flex: 1 1 100%;
  }

  .resume-note {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .header-actions {
    gap: 6px;
  }

  .intro-actions .button,
  .result-actions .button {
    width: 100%;
  }
}

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

@media print {
  .site-header,
  .site-footer,
  .result-actions,
  .method-card,
  .share-dialog,
  .status-message {
    display: none !important;
  }

  body {
    background: white;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .result-card {
    border: 1px solid #777;
    box-shadow: none;
  }

  .score-panel {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
