:root {
  --bg: #fbfaf6;
  --paper: #fffefa;
  --ink: #18212b;
  --muted: #72777e;
  --line: #ded9cf;
  --soft: #eee9df;
  --accent: #9f2f22;
  --green: #2f8b69;
  --green-dark: #206b50;
  --amber: #b6762f;
  --blue: #426d8f;
  --violet: #7b638f;
  --shadow: 0 18px 50px rgba(24, 33, 43, 0.09);
  --font: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background:
    linear-gradient(rgba(24, 33, 43, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 43, 0.07) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  font-family: var(--font);
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100svh;
  margin: 0 auto;
  background: transparent;
}

#app {
  width: min(100%, 480px);
  min-height: 100svh;
  margin: 0 auto;
  background: transparent;
  overflow-x: hidden;
}

.top-rule {
  height: 4px;
  width: 100%;
  background: var(--ink);
}

.screen {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.landing-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 24px 18px;
}

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dot {
  width: 7px;
  height: 7px;
  background: var(--ink);
  border-radius: 999px;
}

.title {
  margin: 0;
  text-align: center;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.22;
  font-weight: 850;
}

.subtitle {
  margin: 14px auto 18px;
  max-width: 360px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.divider {
  width: 64px;
  height: 1px;
  background: var(--line);
  margin: 0 auto 18px;
}

.intro {
  max-width: 380px;
  margin: 0 auto;
  color: rgba(24, 33, 43, 0.82);
  font-size: 14px;
  line-height: 1.75;
}

.intro p {
  margin: 0 0 9px;
}

.intro .strong {
  color: var(--ink);
  font-weight: 750;
}

.dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin: 16px auto 18px;
}

.dimension-card {
  border: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.6);
  padding: 11px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.primary-btn,
.ghost-btn,
.outline-btn {
  min-height: 46px;
  border: 1px solid var(--ink);
  padding: 0 18px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.primary-btn {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  display: block;
  background: var(--ink);
  color: var(--paper);
  font-weight: 780;
}

.outline-btn {
  background: transparent;
  color: var(--ink);
}

.ghost-btn {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.primary-btn:active,
.ghost-btn:active,
.outline-btn:active,
.option-btn:active,
.question-cell:active {
  transform: translateY(1px);
}

.fine-print {
  max-width: 340px;
  margin: 18px auto 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
}

.footer-note {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.quiz-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background:
    linear-gradient(rgba(24, 33, 43, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 43, 0.06) 1px, transparent 1px),
    rgba(251, 250, 246, 0.94);
  background-size: 44px 44px;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px 10px;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
}

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

.question-cell {
  height: 18px;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.76);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 7px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.question-cell.done {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.question-cell.current {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.question-cell.done.current {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #fff;
}

.quiz-body {
  flex: 1;
  padding: 16px 18px 10px;
}

.question-number {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.question-number span {
  color: rgba(24, 33, 43, 0.2);
  font-size: 26px;
  line-height: 1;
  font-weight: 850;
}

.question-number i {
  height: 1px;
  flex: 1;
  background: var(--line);
}

.question-title {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 750;
}

.option-list {
  display: grid;
  gap: 8px;
}

.option-btn {
  width: 100%;
  min-height: 54px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.68);
  color: var(--ink);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.option-btn:hover {
  border-color: rgba(24, 33, 43, 0.55);
}

.option-btn.selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.option-btn.disabled:not(.selected) {
  opacity: 0.45;
}

.option-key {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  font-size: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
  flex: 0 0 auto;
}

.option-text {
  font-size: 13px;
  line-height: 1.48;
}

.quiz-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.prev-btn,
.submit-btn {
  width: 100%;
  max-width: 180px;
  min-height: 38px;
}

.submit-btn {
  margin: 0;
}

.prev-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.quiz-tip {
  padding: 8px 20px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.loading-screen {
  justify-content: center;
  padding: 32px 26px;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 2px solid var(--ink);
  border-top-color: transparent;
  border-radius: 999px;
  margin: 0 auto 34px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.7;
}

.loading-lines {
  display: grid;
  gap: 8px;
  margin-top: 26px;
}

.loading-line {
  height: 4px;
  background: var(--soft);
  overflow: hidden;
}

.loading-line span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.36s ease;
}

.result {
  padding: 18px 16px 36px;
}

.report-card {
  background: rgba(255, 254, 250, 0.78);
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 12px 34px rgba(24, 33, 43, 0.045);
  animation: fadeUp 0.4s ease both;
}

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

.result-hero {
  padding: 24px 20px;
}

.center {
  text-align: center;
}

.label {
  color: var(--muted);
  font-size: 12px;
}

.result-title {
  margin: 8px 0 6px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 850;
}

.result-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.type-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 18px auto 0;
  min-width: 120px;
  height: 38px;
  border: 2px solid var(--accent);
  color: var(--accent);
  transform: rotate(-3deg);
  font-weight: 850;
  letter-spacing: 0.06em;
}

.bar-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.metric {
  display: grid;
  grid-template-columns: 96px 1fr 34px;
  gap: 10px;
  align-items: center;
}

.metric-name {
  text-align: right;
  color: var(--ink);
  font-size: 12px;
}

.metric-bar {
  height: 8px;
  background: var(--soft);
}

.metric-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #74a57f);
}

.metric-value {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.bar-list .metric:nth-child(4n + 1) .metric-fill {
  background: linear-gradient(90deg, #2f8b69, #7fb069);
}

.bar-list .metric:nth-child(4n + 2) .metric-fill {
  background: linear-gradient(90deg, #426d8f, #78a1bb);
}

.bar-list .metric:nth-child(4n + 3) .metric-fill {
  background: linear-gradient(90deg, #b6762f, #df9d53);
}

.bar-list .metric:nth-child(4n + 4) .metric-fill {
  background: linear-gradient(90deg, #7b638f, #b084cc);
}

.quote {
  margin-top: 18px;
  padding: 13px 14px;
  border-left: 2px solid var(--ink);
  background: rgba(236, 233, 223, 0.55);
  color: var(--ink);
  font-style: italic;
  font-weight: 650;
  line-height: 1.7;
}

.section-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-index {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  flex: 0 0 auto;
}

.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.section-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.report-text {
  margin: 0;
  color: rgba(24, 33, 43, 0.84);
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-line;
}

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

.choice-pill {
  border: 1px solid var(--line);
  padding: 13px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.choice-pill.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  font-weight: 800;
}

.warning {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(236, 233, 223, 0.5);
  padding: 12px;
  margin-bottom: 16px;
}

.warning-icon {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.tiny-blocks {
  display: flex;
  gap: 3px;
  margin-top: 5px;
}

.tiny-blocks span {
  width: 12px;
  height: 12px;
  background: var(--accent);
}

.timeline {
  display: grid;
  gap: 15px;
}

.phase {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
}

.phase-num {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.phase h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.phase p {
  margin: 0;
  color: rgba(24, 33, 43, 0.78);
  font-size: 12px;
  line-height: 1.7;
}

.diagnosis-book {
  border: 2px solid var(--ink);
}

.diagnosis-book h2 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
  text-align: center;
  font-size: 17px;
}

.book-item {
  margin-bottom: 14px;
}

.book-item small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.book-item p {
  margin: 0;
  color: rgba(24, 33, 43, 0.86);
  font-size: 14px;
  line-height: 1.7;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.result-actions button {
  min-width: 0;
  padding: 0 8px;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(24, 33, 43, 0.52);
}

.modal.show {
  display: flex;
}

.modal-panel {
  width: min(100%, 360px);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-panel h3 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 17px;
}

.share-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 22px 16px;
  text-align: center;
  margin-bottom: 14px;
}

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

.share-card strong {
  display: block;
  margin: 8px 0;
  font-size: 22px;
}

.share-card p {
  margin: 0;
  color: rgba(24, 33, 43, 0.78);
  font-size: 13px;
  line-height: 1.7;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 20;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -4px);
}

.compact-landing {
  justify-content: flex-start;
  gap: 16px;
  padding: 0 24px 18px;
}

.compact-landing .top-rule {
  margin: 0 -24px;
  width: calc(100% + 48px);
}

.hero-copy {
  padding: 24px 0 0;
}

.hero-copy .eyebrow {
  display: block;
  margin: 0;
  color: var(--muted);
  font: 800 11px/1.2 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.1em;
  text-align: left;
}

.hero-copy h1 {
  max-width: 100%;
  margin: 12px 0 12px;
  color: var(--green);
  font-size: clamp(38px, 8.8vw, 46px);
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 900;
  word-break: keep-all;
  text-wrap: balance;
}

.hero-copy .subtitle {
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  text-align: left;
  font-size: 15px;
  line-height: 1.65;
}

.hero-btn {
  width: 100%;
  max-width: none;
  margin-top: 18px;
  min-height: 50px;
  font-size: 17px;
}

.intro-panel {
  display: grid;
  gap: 0;
  margin-top: 2px;
  border-top: 1px solid var(--line);
}

.intro-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.intro-item span {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(47, 139, 105, 0.12);
  color: var(--green);
  font: 800 11px/1 var(--font);
}

.intro-item strong {
  font-size: 15px;
}

.intro-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.dimension-card {
  border: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.76);
  border-radius: 8px;
  padding: 10px;
}

.dimension-card span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.dimension-card strong {
  display: block;
  font-size: 15px;
}

.dimension-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (min-width: 520px) {
  .compact-landing {
    padding-top: 0;
  }

  .hero-copy h1 {
    font-size: 48px;
  }
}

@media (max-width: 360px) {
  .title {
    font-size: 26px;
  }

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

  .result-actions {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: var(--bg);
  }

  .result-actions,
  .modal,
  .toast {
    display: none !important;
  }

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