:root {
  --bg: #f7f5ef;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --text: #27302f;
  --muted: #687370;
  --muted-soft: #87928e;
  --line: #e6dfd2;
  --sage: #9bb7a4;
  --sage-deep: #5f8470;
  --rose: #d8a6a2;
  --sky: #9db6cd;
  --shadow: 0 20px 48px rgba(78, 70, 52, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 16%, rgba(155, 183, 164, 0.24), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(216, 166, 162, 0.2), transparent 26%),
    linear-gradient(135deg, #f7f5ef 0%, #eef3ef 50%, #f6eeee 100%);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.intro-panel,
.quiz-panel,
.loading-panel,
.result-panel {
  min-height: calc(100vh - 72px);
}

.intro-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.intro-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  gap: 28px;
}

.site-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
}

.site-brand-link img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.site-brand-link:hover {
  color: var(--sage-deep);
}

.brand-block h1 {
  margin: 8px 0 18px;
  font-size: clamp(2.35rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.8;
}

.visitor-copy {
  margin: 16px 0 0;
  color: var(--sage-deep);
  font-size: 0.95rem;
  font-weight: 700;
}

.recover-entry {
  display: grid;
  gap: 10px;
  max-width: 360px;
  margin-top: 18px;
}

.paid-product-note {
  margin: 0;
  border: 1px solid rgba(95, 132, 112, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.78);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.62;
}

.lost-report-link {
  justify-self: start;
  border: 0;
  padding: 0;
  color: rgba(95, 132, 112, 0.72);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.lost-report-link:hover {
  color: var(--sage-deep);
}

.recover-status {
  min-height: 18px;
  margin: 0;
  color: var(--sage-deep);
  font-size: 0.82rem;
  font-weight: 700;
}

.recover-status.is-error {
  color: #b96a62;
}

.wechat-pay-btn {
  display: inline-grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  border: 1px solid rgba(7, 193, 96, 0.28);
  border-radius: 8px;
  padding: 12px 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #07c160, #4f9470);
  box-shadow: 0 16px 32px rgba(7, 193, 96, 0.18);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.wechat-pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(7, 193, 96, 0.24);
}

.wechat-pay-btn:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

.pay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #07c160;
  background: #ffffff;
  font-size: 1.4rem;
  font-weight: 900;
}

.wechat-pay-btn strong,
.wechat-pay-btn small {
  display: block;
}

.wechat-pay-btn strong {
  font-size: 1rem;
}

.wechat-pay-btn small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  line-height: 1.4;
}

.pay-status {
  min-height: 20px;
  margin: 0;
  color: var(--sage-deep);
  font-size: 0.86rem;
  font-weight: 700;
}

.pay-status.is-error {
  color: #b96a62;
}

.eyebrow {
  margin: 0;
  color: var(--sage-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.setup-card,
.question-card,
.chart-card,
.table-card,
.analysis-card {
  border: 1px solid rgba(230, 223, 210, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.setup-card {
  padding: 16px 24px 24px;
}

.field {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.field-hint {
  min-height: 18px;
  color: var(--muted-soft);
  font-size: 0.8rem;
  font-weight: 500;
}

.field-hint.is-error {
  color: #b96a62;
  font-size: 1.2rem;
  font-weight: 800;
}

.quiz-length {
  display: grid;
  gap: 12px;
  margin: 22px 0;
  padding: 0;
  border: 0;
}

.setup-card > .quiz-length:first-child {
  margin-top: 4px;
}

.quiz-length legend {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 800;
}

.length-option {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
}

.length-option:has(input:checked) {
  border-color: var(--sage);
  background: rgba(155, 183, 164, 0.17);
}

.length-option small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.gender-field {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: -4px;
}

.gender-field legend {
  grid-column: 1 / -1;
}

.agreement-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.6;
}

.agreement-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--sage);
}

.agreement-check a {
  color: var(--sage-deep);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-btn {
  width: 100%;
  color: #ffffff;
  background: #5f8470;
  box-shadow: 0 12px 22px rgba(95, 132, 112, 0.24);
}

.secondary-btn,
.ghost-btn {
  color: var(--sage-deep);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.ghost-btn {
  min-height: 36px;
  padding: 0 14px;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.site-footer {
  padding: 8px 0 2px;
  color: var(--muted-soft);
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.6;
}

.site-footer p {
  margin: 0;
}

.quiz-panel,
.loading-panel,
.result-panel {
  padding: 18px 0 34px;
}

.loading-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-card,
.unlock-card {
  width: min(100%, 420px);
  padding: 36px 28px;
  border: 1px solid rgba(230, 223, 210, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-card h2,
.unlock-card h2 {
  margin: 10px 0 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.3;
}

.unlock-copy {
  margin: 14px 0 18px;
  color: var(--muted);
  line-height: 1.75;
}

.countdown-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  margin: 0 0 16px;
  border: 1px solid rgba(216, 166, 162, 0.42);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.7);
}

.countdown-card span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.countdown-card strong {
  color: #b96a62;
  font-size: 1.55rem;
  line-height: 1;
}

.countdown-card small {
  grid-column: 1 / -1;
  color: var(--muted-soft);
  line-height: 1.55;
}

.countdown-card.is-expired {
  border-color: rgba(185, 106, 98, 0.55);
  background: rgba(185, 106, 98, 0.08);
}

.pay-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pay-plan-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 168px;
  border: 1px solid rgba(230, 223, 210, 0.95);
  border-radius: 8px;
  padding: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.74);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pay-plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(7, 193, 96, 0.42);
  box-shadow: 0 18px 34px rgba(78, 70, 52, 0.12);
}

.pay-plan-card:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pay-plan-card.is-featured {
  border-color: rgba(7, 193, 96, 0.48);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(231, 248, 239, 0.72));
}

.plan-name {
  font-size: 1rem;
  font-weight: 900;
}

.pay-plan-card strong {
  color: #0f8f3a;
  font-size: 1.8rem;
  line-height: 1;
}

.pay-plan-card small {
  color: var(--muted);
  line-height: 1.62;
}

.plan-badge {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  color: #ffffff;
  background: #07c160;
  font-size: 0.72rem;
  font-weight: 900;
}

.result-unlock-card {
  width: min(100%, 680px);
  margin: 0 0 18px;
  text-align: left;
}

.paid-check-btn {
  width: 100%;
  margin-top: 12px;
}

.locked-report-wrap {
  position: relative;
}

.locked-report-wrap.is-locked .result-grid,
.locked-report-wrap.is-locked .analysis-card {
  filter: saturate(0.72) blur(3px);
  opacity: 0.62;
  transform: scale(0.996);
  user-select: none;
  pointer-events: none;
}

.is-report-locked .result-hero h2 {
  color: var(--sage-deep);
}

.is-report-locked .result-hero p:last-child {
  max-width: 680px;
}

.report-lock-overlay {
  display: none;
}

.locked-report-wrap.is-locked .report-lock-overlay {
  position: absolute;
  inset: 10% 50% auto;
  display: block;
  width: min(100% - 32px, 360px);
  transform: translateX(-50%);
  border: 1px solid rgba(230, 223, 210, 0.92);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 22px 54px rgba(78, 70, 52, 0.18);
  text-align: center;
}

.report-lock-overlay h3 {
  margin: 8px 0 8px;
  font-size: 1.45rem;
}

.report-lock-overlay p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.loading-spinner {
  display: inline-flex;
  gap: 10px;
  margin-bottom: 18px;
}

.loading-spinner span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--sage);
  animation: loadingPulse 1.15s ease-in-out infinite;
}

.loading-spinner span:nth-child(2) {
  animation-delay: 0.16s;
  background: var(--sky);
}

.loading-spinner span:nth-child(3) {
  animation-delay: 0.32s;
  background: var(--rose);
}

@keyframes loadingPulse {
  0%,
  100% {
    transform: translateY(0) scale(0.9);
    opacity: 0.45;
  }

  50% {
    transform: translateY(-6px) scale(1);
    opacity: 1;
  }
}

.quiz-topbar,
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.quiz-topbar h2,
.result-hero h2,
.chart-card h3,
.table-card h3,
.analysis-card h3 {
  margin: 8px 0 0;
}

.progress-copy {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.progress-track {
  height: 10px;
  margin: 22px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--sky), var(--rose));
  transition: width 0.28s ease;
}

.question-card {
  padding: clamp(20px, 4vw, 34px);
}

.question-text {
  margin: 0 0 24px;
  font-size: clamp(1.18rem, 3vw, 1.7rem);
  line-height: 1.65;
  font-weight: 800;
}

.options-grid {
  display: grid;
  gap: 12px;
}

.option-card {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.option-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--sage-deep);
}

.option-card.is-selected {
  border-color: var(--sage);
  background: rgba(155, 183, 164, 0.16);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.nav-row .secondary-btn,
.nav-row .primary-btn {
  width: auto;
  min-width: 124px;
}

.quiz-bottom {
  display: grid;
  justify-items: center;
  gap: 38px;
  margin-top: 32px;
}

.quiz-restart-actions {
  width: 100%;
  margin-top: 0;
}

.quiz-footer {
  padding: 10px 0 8px;
}

.result-actions {
  justify-content: center;
  margin-top: 24px;
}

.result-actions .secondary-btn {
  min-width: 180px;
}

.result-hero {
  padding: clamp(20px, 4vw, 34px) 0 22px;
}

.result-hero h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
}

.report-completed-time,
.report-bottom-date {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.6;
}

.report-completed-time {
  margin: 10px 0 0;
}

.report-bottom-date {
  color: var(--moss);
}

.result-hero p:last-child {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.8;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
  gap: 18px;
}

.chart-card,
.table-card,
.analysis-card {
  padding: 20px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.86rem;
}

.score-pill {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffffff;
  font-weight: 800;
}

.analysis-card {
  margin-top: 18px;
}

.analysis-card p {
  color: var(--muted);
  line-height: 1.85;
}

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

.analysis-item {
  border-left: 4px solid var(--sage);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.62);
}

.analysis-item strong {
  display: block;
  margin-bottom: 4px;
}

.analysis-item span {
  display: block;
  color: var(--muted);
  line-height: 1.78;
}

.partner-item {
  border-left-color: var(--rose);
  background: rgba(239, 191, 184, 0.18);
}

.is-hidden {
  display: none;
}

.has-modal {
  overflow: hidden;
}

.pay-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
}

.pay-modal.is-hidden {
  display: none;
}

.pay-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(39, 48, 47, 0.42);
  backdrop-filter: blur(10px);
}

.pay-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  border: 1px solid rgba(230, 223, 210, 0.92);
  border-radius: 8px;
  padding: 24px;
  background: var(--panel);
  box-shadow: 0 26px 70px rgba(39, 48, 47, 0.24);
  text-align: center;
}

.pay-modal-card h2 {
  margin: 8px 0 18px;
  font-size: 1.5rem;
}

.pay-modal-card .paid-check-btn {
  margin-top: 16px;
}

.pay-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.qr-frame {
  display: grid;
  place-items: center;
  width: 280px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.qr-frame img {
  width: min(260px, 92%);
  height: auto;
}

.pay-modal-copy {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.agreement-modal {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: grid;
  place-items: center;
  padding: 22px;
}

.agreement-modal.is-hidden {
  display: none;
}

.agreement-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(39, 48, 47, 0.42);
  backdrop-filter: blur(10px);
}

.agreement-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(82vh, 720px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(230, 223, 210, 0.92);
  border-radius: 8px;
  padding: 26px;
  background: var(--panel);
  box-shadow: 0 26px 70px rgba(39, 48, 47, 0.24);
}

.agreement-modal-card h2 {
  margin: 8px 0 14px;
  color: var(--text);
  font-size: 1.55rem;
}

.agreement-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.agreement-modal-body {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  overflow-y: auto;
  color: var(--muted);
  line-height: 1.78;
}

.agreement-modal-body p {
  margin: 0;
}

.agreement-modal-body a {
  color: var(--sage-deep);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.payment-agreement-note {
  margin: 8px 0 12px;
  color: var(--muted-soft);
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: center;
}

.payment-agreement-note a {
  color: #1f7f48;
  font-weight: 900;
  text-decoration: none;
}

.payment-agreement-note a:hover {
  text-decoration: underline;
}

.compliance-notes {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  border: 1px solid rgba(230, 223, 210, 0.9);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.86);
  font-size: 0.78rem;
  line-height: 1.6;
}

.compliance-notes p {
  margin: 0;
}

.compliance-notes strong {
  color: var(--text);
}

.compliance-notes a {
  color: #1f7f48;
  font-weight: 900;
  text-decoration: none;
}

.compliance-notes a:hover {
  text-decoration: underline;
}

.pay-modal-agreement {
  margin: 10px 0 0;
}

@media (max-width: 780px) {
  .site-brand-link {
    display: none;
  }

  .paid-product-note {
    max-width: none;
    padding: 9px 10px;
    font-size: 0.76rem;
    line-height: 1.58;
  }

  .app-shell {
    width: min(100% - 24px, 640px);
    padding: 18px 0 28px;
  }

  .intro-panel {
    min-height: auto;
    padding-top: 24px;
  }

  .intro-main {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .setup-card {
    padding: 12px 18px 18px;
  }

  .agreement-modal-card {
    width: min(100%, 360px);
    max-height: min(76vh, 560px);
    padding: 18px;
  }

  .agreement-modal-card h2 {
    margin: 6px 0 10px;
    font-size: 1.28rem;
  }

  .agreement-modal-body {
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    line-height: 1.58;
  }

  .quiz-topbar {
    align-items: flex-start;
  }

  .nav-row {
    position: sticky;
    bottom: 10px;
    z-index: 3;
    padding: 10px;
    border: 1px solid rgba(230, 223, 210, 0.82);
    border-radius: 8px;
    background: rgba(247, 245, 239, 0.84);
    backdrop-filter: blur(14px);
  }

  .nav-row .secondary-btn,
  .nav-row .primary-btn {
    flex: 1;
    min-width: 0;
  }

  .result-actions {
    position: static;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

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

  .pay-plan-grid {
    grid-template-columns: 1fr;
  }

  .pay-plan-card {
    min-height: 136px;
  }

  th,
  td {
    padding: 12px 6px;
  }
}
