:root {
  --page: #ece9e4;
  --surface: #f7f4f0;
  --paper: #fffdfa;
  --ink: #24211e;
  --muted: #706b64;
  --line: #ddd7d0;
  --red: #d5193d;
  --red-dark: #b81434;
  --red-soft: #fff0f3;
  --teal: #18736d;
  --teal-soft: #eaf7f5;
  --amber: #a96917;
  --amber-soft: #fff6e7;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(37, 31, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 3px solid rgba(213, 25, 61, 0.26);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.progress-track {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 50%;
  width: min(100%, 480px);
  height: 3px;
  transform: translateX(-50%);
  background: transparent;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 90ms linear;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(221, 215, 208, 0.9);
  background: rgba(247, 244, 240, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  display: inline-flex;
  min-width: 48px;
  height: 31px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: var(--radius);
  background: var(--red);
  color: var(--paper);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-copy {
  font-size: 13px;
  font-weight: 900;
}

.icon-button,
.back-button {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
}

.icon-button svg,
.back-button svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.screen {
  display: none;
  min-height: calc(100vh - 58px);
}

.screen.active {
  display: block;
  animation: screen-in 260ms ease both;
}

.landing-hero {
  padding: 42px 18px 30px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.hero-label,
.section-label,
.section-kicker,
.question-counter {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-hero h1 {
  margin: 17px 0 0;
  font-size: clamp(34px, 9.2vw, 43px);
  line-height: 1.19;
  letter-spacing: 0;
}

.landing-hero h1 span {
  color: var(--red);
}

.landing-hero > p {
  margin: 18px 0 0;
  color: #56514b;
  font-size: 15px;
  line-height: 1.84;
}

.hero-metrics,
.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-metrics {
  grid-template-columns: repeat(4, 1fr);
}

.hero-metrics > div,
.result-metric {
  min-width: 0;
  padding: 16px 8px;
  text-align: center;
}

.hero-metrics > div + div,
.result-metric + .result-metric {
  border-left: 1px solid var(--line);
}

.hero-metrics strong,
.result-metric strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.hero-metrics span,
.result-metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.primary-button,
.sticky-primary {
  border: 1px solid var(--red);
  border-radius: var(--radius);
  background: var(--red);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  min-height: 52px;
  padding: 10px 16px;
  font-size: 15px;
}

.test-disclaimer {
  margin-top: 12px !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  line-height: 1.55 !important;
  text-align: center;
}

.landing-disclaimer {
  margin: 28px 18px 0 !important;
}

.landing-section {
  padding: 32px 18px 0;
}

#screenLanding {
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
}

.landing-section h2 {
  margin: 9px 0 0;
  font-size: 25px;
  line-height: 1.36;
  letter-spacing: 0;
}

.feature-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

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

.feature-item > span {
  padding-top: 2px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.feature-item strong {
  display: block;
  font-size: 15px;
  line-height: 1.5;
}

.feature-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.68;
}

.quiz-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 12px;
}

.back-button {
  flex: 0 0 38px;
}

.quiz-progress-copy {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.quiz-progress-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-progress-copy strong {
  flex: 0 0 auto;
  margin-left: 12px;
  font-size: 13px;
}

.question-progress {
  height: 3px;
  margin: 0 18px;
  border-radius: 3px;
  background: #ded9d3;
  overflow: hidden;
}

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

.question-wrap {
  padding: 36px 18px 52px;
}

.question-wrap h2 {
  margin: 13px 0 0;
  font-size: 27px;
  line-height: 1.43;
  letter-spacing: 0;
}

.question-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.68;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.option-button {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.option-button:hover {
  border-color: #b9b2aa;
  transform: translateY(-1px);
}

.option-button.selected {
  border-color: var(--red);
  background: var(--red-soft);
}

.option-button.safety-option.selected {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.option-letter {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #eeeae5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.option-button.selected .option-letter {
  background: var(--red);
  color: #ffffff;
}

.option-button.safety-option.selected .option-letter {
  background: var(--amber);
}

.option-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.58;
}

.multi-submit {
  width: 100%;
  margin-top: 16px;
}

.result-screen {
  padding-bottom: 106px;
}

.result-hero {
  padding: 38px 18px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.result-kicker {
  margin: 0;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.result-hero h1 {
  margin: 13px 0 0;
  font-size: clamp(30px, 8.6vw, 39px);
  line-height: 1.25;
  letter-spacing: 0;
}

.result-hero h1 span {
  color: var(--red);
}

.result-copy {
  margin: 17px 0 0;
  color: #514c46;
  font-size: 15px;
  line-height: 1.84;
}

.result-copy strong {
  color: var(--ink);
}

.result-metric strong.red {
  color: var(--red);
}

.result-metric strong.teal {
  color: var(--teal);
}

.result-metric strong.amber {
  color: var(--amber);
}

.section {
  padding: 28px 18px 0;
}

.section.first {
  padding-top: 22px;
}

.section h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.37;
  letter-spacing: 0;
}

.section-kicker {
  margin: 0 0 7px;
}

.section-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.verdict {
  position: relative;
  margin-top: 17px;
  padding: 25px 22px 23px;
  border: 1px solid #edd3d7;
  border-radius: var(--radius);
  background: #fff4f5;
  color: var(--ink);
  overflow: hidden;
}

.verdict::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--red);
  content: "";
}

.verdict p {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.72;
}

.verdict-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #ecd5d9;
  color: #725b60;
  font-size: 13px;
  line-height: 1.7;
}

.dimension-list,
.card-list,
.plan-list,
.phrase-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.dimension-card,
.feedback-card,
.plan-card,
.phrase-card {
  padding: 17px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.dimension-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dimension-head strong {
  font-size: 14px;
}

.dimension-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.dimension-track {
  height: 7px;
  margin-top: 12px;
  border-radius: 7px;
  background: #e7e2dc;
  overflow: hidden;
}

.dimension-fill {
  width: 0;
  height: 100%;
  border-radius: 7px;
  background: var(--teal);
}

.dimension-fill.low {
  background: var(--red);
}

.dimension-fill.mid {
  background: var(--amber);
}

.dimension-copy {
  margin: 11px 0 0;
  color: #5e5953;
  font-size: 12px;
  line-height: 1.68;
}

.feedback-card {
  border-left: 4px solid var(--teal);
}

.feedback-card.priority {
  border-left-color: var(--red);
  background: #fffafb;
}

.feedback-card > span,
.plan-card > span,
.phrase-card > span {
  display: block;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.feedback-card.good > span {
  color: var(--teal);
}

.feedback-card strong,
.plan-card strong {
  display: block;
  margin-top: 7px;
  font-size: 16px;
  line-height: 1.5;
}

.feedback-card p,
.plan-card p,
.phrase-card p {
  margin: 8px 0 0;
  color: #5e5953;
  font-size: 13px;
  line-height: 1.72;
}

.feedback-card .micro {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ece7e1;
  color: var(--muted);
}

.severity {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
}

.severity.red {
  background: var(--red-soft);
  color: var(--red);
}

.severity.orange {
  background: var(--amber-soft);
  color: var(--amber);
}

.severity.yellow {
  background: #f4f0e9;
  color: #7a6b58;
}

.script-line {
  margin-top: 12px !important;
  padding: 11px 12px;
  border-radius: 6px;
  background: #f1eeea;
  color: var(--ink) !important;
  font-weight: 800;
}

.phrase-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.phrase-card > div {
  min-width: 0;
}

.phrase-card > span {
  grid-column: 1 / -1;
}

.copy-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.copy-button svg {
  width: 15px;
  height: 15px;
}

.safety-panel {
  margin-top: 18px;
  padding: 21px 19px;
  border: 1px solid #e8bfc8;
  border-radius: var(--radius);
  background: var(--red-soft);
}

.safety-panel strong {
  display: block;
  color: #781f34;
  font-size: 18px;
  line-height: 1.5;
}

.safety-panel p,
.safety-panel li {
  color: #6b3441;
  font-size: 13px;
  line-height: 1.72;
}

.safety-panel ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

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

.phase-card {
  min-width: 0;
  padding: 17px 15px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
}

.phase-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.phase-card strong {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
}

.phase-card p {
  margin: 8px 0 0;
  color: #5e5953;
  font-size: 12px;
  line-height: 1.68;
}

.stage-panel {
  margin-top: 18px;
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px solid #cfe3df;
  background: var(--teal-soft);
}

.stage-panel strong {
  display: block;
  color: #155e59;
  font-size: 18px;
}

.stage-panel p {
  margin: 9px 0 0;
  color: #37635f;
  font-size: 13px;
  line-height: 1.72;
}

.stage-panel .script-line {
  background: rgba(255, 255, 255, 0.66);
  color: #284d49 !important;
}

.share-note {
  margin-top: 18px;
  padding: 19px 18px;
  border: 1px solid #c9e4df;
  border-radius: var(--radius);
  background: var(--teal-soft);
  color: #155e59;
}

.share-note span {
  display: block;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.share-note strong {
  display: block;
  margin-top: 9px;
  font-size: 17px;
  line-height: 1.58;
}

.share-note p {
  margin: 9px 0 0;
  color: #37635f;
  font-size: 13px;
  line-height: 1.7;
}

.landing-actions,
.sticky-actions {
  position: fixed;
  z-index: 45;
  bottom: 0;
  left: 50%;
  display: flex;
  width: min(100%, 480px);
  gap: 10px;
  padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(221, 215, 208, 0.96);
  background: rgba(247, 244, 240, 0.96);
  backdrop-filter: blur(16px);
}

.landing-primary,
.landing-secondary,
.sticky-secondary,
.sticky-primary {
  min-height: 48px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.landing-primary,
.landing-secondary {
  flex: 1;
}

.landing-primary {
  border: 1px solid var(--red);
  background: var(--red);
  color: #ffffff;
}

.landing-secondary {
  border: 1px solid var(--line);
  background: var(--paper);
}

.landing-secondary.is-empty {
  color: var(--muted);
}

.sticky-secondary {
  flex: 0 0 106px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.sticky-primary {
  flex: 1;
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: 92px;
  left: 50%;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgba(21, 94, 89, 0.96);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  body {
    padding: 28px 0;
  }

  .app-shell {
    border-radius: 14px;
  }

  .progress-track,
  .landing-actions,
  .sticky-actions {
    border-radius: 0 0 12px 12px;
  }
}

@media (max-width: 360px) {
  .hero-metrics,
  .result-metrics {
    grid-template-columns: 1fr;
  }

  .hero-metrics > div,
  .result-metric {
    display: grid;
    grid-template-columns: 84px 1fr;
    align-items: center;
    text-align: left;
  }

  .hero-metrics > div + div,
  .result-metric + .result-metric {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .hero-metrics span,
  .result-metric span {
    margin-top: 0;
  }

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