:root {
  --bg: #fff7f8;
  --paper: #fffdfc;
  --ink: #39292d;
  --muted: #8b747b;
  --line: rgba(126, 82, 95, 0.14);
  --pink: #ff7eab;
  --pink-strong: #ee5f92;
  --rose: #ffd9e5;
  --peach: #ffe9d9;
  --lilac: #f1ddff;
  --mint: #dff6ee;
  --shadow: 0 20px 60px rgba(126, 82, 95, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #061326;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  position: relative;
  background-color: #061326;
  background-image: url("./assets/bg-night.jpg");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, rgba(2, 10, 26, 0.16), rgba(2, 10, 26, 0.1));
  pointer-events: none;
}

button,
input {
  font: inherit;
}

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

.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  position: relative;
  z-index: 1;
}

.screen {
  display: none;
  min-height: calc(100vh - 40px);
  min-height: calc(100dvh - 40px);
  animation: rise 280ms ease both;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

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

.top-mark,
.watermark,
.result-footer {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-align: center;
}

.top-mark {
  margin: 8px 0 22px;
}

.unlock-panel,
.promise-card,
.question-card,
.loader-card,
.result-card {
  background: rgba(255, 249, 250, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(2, 10, 26, 0.2);
  backdrop-filter: blur(10px);
}

.soft-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: #8e4d62;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 249, 250, 0.94);
}

h1,
h2,
p {
  margin: 0;
}

.home-header h1 {
  margin-top: 16px;
  font-size: 34px;
  line-height: 1.12;
}

.home-header p,
.promise-card p,
.result-note {
  color: var(--muted);
  line-height: 1.7;
}

.home-header h1 {
  color: #fff7fb;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.24);
}

.home-header p {
  color: rgba(255, 255, 255, 0.78);
}

.home-header p {
  margin-top: 12px;
  font-size: 16px;
}

.unlock-title {
  margin: auto 0 18px;
  text-align: center;
  transform: translateY(-40px);
}

.unlock-title h1 {
  color: #fff7fb;
  font-size: 38px;
  line-height: 1.12;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.24);
}

.unlock-title p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 19px;
  font-weight: 700;
}

.unlock-panel {
  margin-top: 18px;
  padding: 40px 20px;
  transform: translateY(-40px);
}

.unlock-panel label {
  display: block;
  margin-bottom: 10px;
  font-size: 19px;
  font-weight: 800;
}

.unlock-panel input {
  width: 100%;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 249, 250, 0.94);
  font-size: 19px;
}

.unlock-panel input::placeholder {
  color: #999999;
}

.unlock-panel input:focus {
  border-color: rgba(238, 95, 146, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 126, 171, 0.12);
}

.error-text {
  min-height: 24px;
  padding-top: 8px;
  color: #d74772;
  font-size: 13px;
}

.primary-btn,
.secondary-btn {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  font-weight: 900;
  cursor: pointer;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, #ff82ad, #ef6398);
  box-shadow: none;
}

.unlock-panel .primary-btn {
  min-height: 68px;
  font-size: 24px;
}

.secondary-btn {
  color: #6f4654;
  border: 1px solid rgba(238, 95, 146, 0.22);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(2, 10, 26, 0.14);
}

.watermark {
  margin-top: auto;
  padding-top: 18px;
}

.home-header {
  padding-top: 18px;
}

.dimension-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.dimension-cloud span {
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: rgba(255, 247, 251, 0.92);
  font-size: 14px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.promise-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding: 20px;
}

.promise-card strong {
  font-size: 18px;
}

.promise-card p {
  margin-top: 8px;
  font-size: 14px;
}

.promise-card span {
  flex: 0 0 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--pink-strong);
  background: #fff0f5;
  font-size: 34px;
}

.sticky-action {
  margin-top: auto;
  margin-bottom: 40px;
  min-height: 68px;
  font-size: 24px;
}

.jump-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1;
}

.jump-text span {
  display: inline-block;
  animation: letter-hop 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.12s);
}

@keyframes letter-hop {
  0%,
  42%,
  100% {
    transform: translateY(0);
  }
  16% {
    transform: translateY(-5px);
  }
}

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

.ghost-btn,
.modal-close {
  border: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.94);
}

.ghost-btn {
  color: #999999;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  font-size: 32px;
  line-height: 1;
}

.progress-block {
  flex: 1;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.progress-meta strong {
  font-size: 13px;
}

.progress-track {
  height: 9px;
  border-radius: 999px;
  overflow: visible;
}

.progress-track.segmented {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  background: transparent;
}

.progress-segment {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.progress-segment-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb1c9, #ee6097);
  transition: width 240ms ease;
}

.question-card {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 20px;
  padding: 24px 22px;
  min-height: 448px;
}

.question-kicker {
  color: var(--pink-strong);
  font-size: 18px;
  font-weight: 900;
}

.question-card h2 {
  margin-top: 18px;
  font-size: 28px;
  line-height: 1.36;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  padding-bottom: 40px;
}

.answer-btn {
  min-height: 92px;
  border: 0;
  border-radius: 22px;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.answer-btn span,
.answer-btn small {
  display: block;
}

.answer-btn span {
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.answer-btn small {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.answer-btn.yes {
  background: #ef476f;
  box-shadow:
    inset 0 -6px 0 rgba(176, 42, 76, 0.28),
    0 8px 18px rgba(239, 71, 111, 0.16);
}

.answer-btn.no {
  background: #2f80ed;
  box-shadow:
    inset 0 -6px 0 rgba(24, 83, 168, 0.28),
    0 8px 18px rgba(47, 128, 237, 0.16);
}

.answer-btn:active {
  transform: translateY(2px);
}

.answer-btn.yes:active {
  box-shadow:
    inset 0 -2px 0 rgba(176, 42, 76, 0.24),
    0 4px 12px rgba(239, 71, 111, 0.12);
}

.answer-btn.no:active {
  box-shadow:
    inset 0 -2px 0 rgba(24, 83, 168, 0.24),
    0 4px 12px rgba(47, 128, 237, 0.12);
}

.loader-card {
  margin: auto 0;
  padding: 34px 24px;
  text-align: center;
}

.loader-heart {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: var(--pink-strong);
  background: #fff0f5;
  font-size: 46px;
  animation: pulse 960ms ease-in-out infinite;
}

@keyframes pulse {
  50% {
    transform: scale(1.08);
  }
}

.loader-card h2 {
  font-size: 22px;
}

.loader-card p {
  margin-top: 10px;
  color: var(--muted);
}

.result-card {
  margin-top: 20px;
  padding: 22px 18px 16px;
  border: 1px solid #fff;
  border-radius: 24px;
}

.result-card h1 {
  margin-top: 0;
  font-size: 23px;
  text-align: center;
}

.result-summary {
  display: grid;
  grid-template-columns: minmax(112px, 0.4fr) minmax(0, 0.6fr);
  gap: 12px;
  align-items: stretch;
  margin-top: 16px;
}

.score-card {
  min-width: 0;
  padding: 17px 10px 15px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--pink-strong);
  background: #fae8ee;
  backdrop-filter: blur(10px);
}

.score-inner {
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.score-card span {
  font-size: 52px;
  font-weight: 950;
  line-height: 0.9;
}

.score-card small {
  margin-left: 2px;
  font-size: 15px;
  font-weight: 900;
}

#levelText {
  margin-top: 7px;
  color: #6d4653;
  font-size: 15px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.chart-head {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 15px 13px;
  border-radius: 18px;
  background: #fae8ee;
  backdrop-filter: blur(10px);
}

.chart-head strong,
.chart-head span,
.chart-head small {
  display: block;
}

.chart-head strong {
  color: var(--pink-strong);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
}

.chart-head span {
  color: #6f4d58;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.chart-head small {
  color: #9a858b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.bar-chart {
  display: grid;
  gap: 12px;
  margin-top: 52px;
}

.bar-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.bar-label {
  color: #6c4a53;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.bar-bg {
  height: 12px;
  border-radius: 999px;
  background: #ffd7e5;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(238, 95, 146, 0.08);
}

.bar-value {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--pink-strong);
  transition: width 500ms ease;
}

.bar-score {
  color: var(--pink-strong);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(57, 41, 45, 0.48);
}

.result-actions {
  display: grid;
  gap: 22px;
  margin-top: auto;
  padding-top: 22px;
  padding-bottom: 100px;
}

.result-actions .primary-btn,
.result-actions .secondary-btn {
  min-height: 68px;
  border-radius: 17px;
}

.result-actions .secondary-btn {
  font-weight: 400;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  padding: 18px;
  background: rgba(0, 0, 0, 0.7);
}

.image-modal.active {
  display: grid;
  place-items: center;
}

.modal-panel {
  width: min(100%, 420px);
  max-height: 92vh;
  overflow: auto;
  padding: 14px;
  border-radius: 24px;
  background: #fffdfc;
  position: relative;
}

.modal-panel p {
  padding: 4px 44px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.modal-panel img {
  display: block;
  width: 100%;
  border-radius: 18px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 24px;
}

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

  .unlock-title h1,
  .home-header h1 {
    font-size: 30px;
  }

  .question-card h2 {
    font-size: 25px;
  }

  .bar-row {
    grid-template-columns: 76px minmax(0, 1fr) 42px;
  }

  .result-summary {
    grid-template-columns: minmax(102px, 0.38fr) minmax(0, 0.62fr);
    gap: 10px;
  }

  .score-card span {
    font-size: 46px;
  }

  .chart-head span {
    font-size: 12px;
  }
}
