* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root{
  --bg-0: #eef2ff;
  --bg-1: #f5f3ff;
  --card: rgba(255,255,255,0.96);
  --ink: #1f2937;
  --muted: #64748b;
  --line: rgba(129, 140, 248, 0.35);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.14);

  --p-1: #4c1d95;
  --p-2: #a855f7;

  /* 分区强调色（更丰富但克制） */
  --a-1: #4f46e5; /* 靛蓝 */
  --a-2: #0f766e; /* 青绿 */
  --a-3: #b45309; /* 琥珀 */
  --a-4: #be185d; /* 玫红 */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(168,85,247,0.20) 0%, rgba(168,85,247,0) 60%),
    radial-gradient(820px 520px at 95% 8%, rgba(79,70,229,0.18) 0%, rgba(79,70,229,0) 62%),
    radial-gradient(circle at top, #f6f5ff 0, #eef2ff 42%, #e8eef7 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.app {
  width: 100%;
  max-width: 860px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.header {
  padding: 20px 20px 16px;
  text-align: center;
  background: linear-gradient(135deg, #1e3a8a, #6d28d9 42%, #a855f7);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.title {
  font-size: 22px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  margin-bottom: 6px;
}

.sub-title {
  font-size: 13px;
  opacity: 0.95;
}

.form-section {
  padding: 18px 20px 8px;
}

.form-box {
  background: #f6f7ff;
  border-radius: 12px;
  padding: 14px 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.55);
}

.form-group-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.person-block {
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(148, 163, 184, 0.55);
}

.person-label {
  font-size: 14px;
  font-weight: 800;
  color: #4c1d95;
  margin-bottom: 8px;
  text-align: center;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.field-row-birthday .birthday-group {
  flex: 1;
  min-width: 0;
}

.birthday-group {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.birthday-group select {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  font-size: 13px;
  background: #fff;
  color: #374151;
  cursor: pointer;
}

.birthday-group select:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.35);
}

.field-label {
  width: 56px;
  font-size: 13px;
  color: #374151;
  font-weight: 700;
}

.field-input {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  font-size: 13px;
  background: #fff;
}

.field-input:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.35);
}

.error-msg {
  min-height: 16px;
  font-size: 12px;
  color: #dc2626;
  margin-top: 2px;
}

.submit-btn {
  margin-top: 14px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #4c1d95, #a855f7);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.result-section {
  padding: 8px 20px 16px;
}

.result-section[hidden] {
  display: none !important;
}

.result-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(245,243,255,0.72));
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(129, 140, 248, 0.40);
  box-shadow: 0 14px 34px rgba(30, 41, 59, 0.09);
}

.result-card.is-unlocked {
  background: linear-gradient(180deg, #ffffff 0%, #f5fbff 70%, #f6f3ff 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 16px 40px rgba(16, 185, 129, 0.12), 0 10px 26px rgba(30, 41, 59, 0.08);
}

.result-title {
  font-size: 17px;
  font-weight: 900;
  color: #4c1d95;
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
}

/* 「匹配度…」单独一行，视觉上复用下面的块标题风格 */
.score-level-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 0 10px;
  padding: 0;
  box-sizing: border-box;
}

.score-panel {
  border: 1px solid rgba(129, 140, 248, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,255,0.92));
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: 0 10px 22px rgba(30, 41, 59, 0.06);
}

.score-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.score-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid rgba(79, 70, 229, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.85) 0, rgba(226,232,255,0.9) 40%, rgba(221,214,254,0.95) 100%);
  color: #4c1d95;
  font-weight: 900;
  position: static;
  transform: none;
  z-index: auto;
}

.score-circle span {
  line-height: 1.1;
}

#scoreValue {
  font-size: 20px;
}

.score-unit {
  font-size: 11px;
  opacity: 0.9;
}

.score-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.score-level {
  /* 复用 .detail-block-title 的视觉样式，只清掉原来 score-level 的胶囊外观 */
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-sizing: border-box;
  margin: 0;
  margin-bottom: 0;
}

.score-summary {
  margin-top: 0;
  font-size: 13px;
  color: #334155;
  line-height: 1.9;
  white-space: pre-line;
  background: linear-gradient(135deg, rgba(238,242,255,0.65) 0%, rgba(245,243,255,0.55) 100%);
  border: 1px solid rgba(129, 140, 248, 0.20);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
}

.detail-row {
  margin-top: 10px;
  font-size: 14px;
  color: #334155;
  border: 1px solid rgba(129, 140, 248, 0.30);
  border-radius: 12px;
  background:
    radial-gradient(900px 260px at 50% 0%, rgba(79,70,229,0.06) 0%, rgba(79,70,229,0) 70%),
    linear-gradient(180deg, #ffffff, #fbfbff);
  padding: 14px;
  box-shadow: 0 10px 26px rgba(30, 41, 59, 0.06);
}

.detail-row h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: #4c1d95;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.detail-block {
  border: 1px solid rgba(129, 140, 248, 0.26);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(251,251,255,0.96));
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 10px 20px rgba(30, 41, 59, 0.05);
}

.detail-block:last-child {
  margin-bottom: 0;
}

.detail-block-title {
  font-size: 14px;
  font-weight: 900;
  color: #4c1d95;
  text-align: center;
  margin-bottom: 10px;
  position: relative;
  padding-bottom: 6px;
}

.detail-block-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 56px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(79,70,229,0.0) 0%, rgba(79,70,229,0.55) 40%, rgba(168,85,247,0.55) 60%, rgba(168,85,247,0.0) 100%);
  transform: translateX(-50%);
}

/* 分块的“强调色”轮换，减少单调感 */
.detail-block:nth-of-type(1) .detail-block-title { color: var(--a-1); }
.detail-block:nth-of-type(1) .detail-block-title::after { background: linear-gradient(90deg, rgba(79,70,229,0) 0%, rgba(79,70,229,0.6) 45%, rgba(79,70,229,0) 100%); }
.detail-block:nth-of-type(2) .detail-block-title { color: var(--a-2); }
.detail-block:nth-of-type(2) .detail-block-title::after { background: linear-gradient(90deg, rgba(15,118,110,0) 0%, rgba(15,118,110,0.55) 45%, rgba(15,118,110,0) 100%); }
.detail-block:nth-of-type(3) .detail-block-title { color: var(--a-3); }
.detail-block:nth-of-type(3) .detail-block-title::after { background: linear-gradient(90deg, rgba(180,83,9,0) 0%, rgba(180,83,9,0.55) 45%, rgba(180,83,9,0) 100%); }
.detail-block:nth-of-type(4) .detail-block-title { color: var(--a-4); }
.detail-block:nth-of-type(4) .detail-block-title::after { background: linear-gradient(90deg, rgba(190,24,93,0) 0%, rgba(190,24,93,0.55) 45%, rgba(190,24,93,0) 100%); }

.detail-item {
  margin-bottom: 9px;
  line-height: 1.75;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-tag {
  display: block;
  font-weight: 800;
  color: #334155;
  background: linear-gradient(135deg, rgba(238,242,255,0.85), rgba(245,243,255,0.78));
  border: 1px solid rgba(129, 140, 248, 0.22);
  border-radius: 8px;
  padding: 4px 8px;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.35;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-text {
  display: block;
  background: linear-gradient(180deg, rgba(248,250,255,0.92), rgba(246,248,255,0.86));
  border: 1px solid rgba(129, 140, 248, 0.18);
  border-radius: 8px;
  padding: 5px 10px;
  min-width: 0;
  text-align: left;
  word-break: break-word;
}

.detail-teaser-tip {
  margin-top: 12px; padding: 12px 14px; background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid rgba(129, 140, 248, 0.3); border-radius: 8px; font-size: 14px; color: #475569;
  display: block;
}

.mode-tip {
  max-width: 620px;
  display: block;
  width: fit-content;
  padding: 8px 12px;
  font-size: 12px;
  color: #4f46e5;
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.10) 0%, rgba(168, 85, 247, 0.10) 100%);
  border: 1px solid rgba(76, 29, 149, 0.18);
  border-radius: 999px;
  text-align: center;
  line-height: 1.4;
  font-weight: 700;
}

.mode-tip-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}

.unlock-wrap {
  padding: 12px 20px 6px;
  display: grid;
  justify-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.06) 0%, rgba(168, 85, 247, 0.06) 100%);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 12px;
}

.unlock-btn {
  box-shadow: 0 8px 24px rgba(76, 29, 149, 0.18);
}

.unlock-btn#unlockFullBtn,
#unlockFullBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.unlock-tip {
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  line-height: 1.5;
  max-width: 560px;
  justify-self: center;
  width: fit-content;
}
.detail-note-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 8px;
}

.detail-note-list li {
  background: #f8faff;
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  color: #475569;
  line-height: 1.75;
  text-align: center;
}
.detail-tag::after {
  content: '';
}

.footer-note {
  padding: 10px 20px 18px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  background: linear-gradient(to top, #eef2ff, #f3f4f6);
}

.footer-note p {
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.footer-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

/* 支付弹窗 */
.pay-modal {
  display: none;
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 10100;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pay-modal.is-open { display: flex; }
.pay-modal-inner {
  background: #f3f4ff;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 14px 48px rgba(0,0,0,0.22);
}
.pay-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1e3a8a, #a855f7);
  color: #fff;
  font-weight: 700;
}
.pay-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.pay-modal-body { padding: 16px; }
.pay-amount {
  border: 1px solid rgba(148,163,184,.6);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.pay-amount-label { font-size: 13px; color: #6b7280; }
.pay-amount-value { font-size: 22px; font-weight: 900; color: #4c1d95; }
.pay-methods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.pay-method {
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,.9);
  background: #fff;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.pay-method:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); border-color: #a855f7; }
.pay-method-wechat { color: #0f8a3a; }
.pay-tip { font-size: 12px; color: #6b7280; line-height: 1.6; }
.pay-modal-actions {
  display: flex;
  gap: 12px;
  padding: 16px;
  justify-content: flex-end;
  border-top: 1px solid rgba(148,163,184,.45);
  background: rgba(255,255,255,0.5);
}
.pay-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.pay-btn-secondary { border: 1px solid rgba(148,163,184,.9); background: #fff; color: #374151; }
.pay-btn-primary { border: none; background: linear-gradient(135deg, #4c1d95, #a855f7); color: #fff; }
.pay-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

#downloadReportBtn {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.result-card.is-unlocked .detail-block {
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, #ffffff 60%);
}

.result-card.is-unlocked .detail-block-title {
  color: #0f766e;
}

.result-card.is-unlocked .detail-block-title::after {
  background: rgba(16, 185, 129, 0.45);
}

.result-card.is-unlocked .detail-tag {
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.08);
}

.result-card.is-unlocked .detail-text {
  border: 1px solid rgba(16, 185, 129, 0.18);
  background: rgba(245, 255, 252, 0.9);
}

/* 手机/窄屏：男女信息上下排列，避免两列挤爆；生日为左「生日」竖排居中 + 右三行年月日 */
@media (max-width: 720px) {
  .form-section {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .form-group-two {
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 14px;
  }

  .person-block {
    min-width: 0;
  }

  .field-row-birthday {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 10px;
    row-gap: 8px;
    align-items: stretch;
    flex-wrap: nowrap;
  }

  .field-row-birthday .field-label {
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: center;
    justify-self: center;
    width: auto;
    flex-shrink: 0;
    text-align: center;
    line-height: 1.35;
  }

  .field-row-birthday .birthday-group {
    grid-column: 2;
    grid-row: 1 / 4;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    flex: initial;
    min-width: 0;
  }

  .field-row-birthday .birthday-group select {
    width: 100%;
    flex: none;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
}

@media (max-width: 480px) {
  .page-wrap {
    padding: 10px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .header {
    padding: 16px 12px 12px;
  }

  .title {
    font-size: 20px;
  }

  .form-section,
  .result-section {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .score-panel {
    padding: 12px;
    margin-bottom: 14px;
  }

  .score-row {
    display: flex;
    padding: 0;
    position: static;
  }

  .score-circle {
    position: static;
    transform: none;
    margin-right: 10px;
    flex-shrink: 0;
  }

  .score-level-wrap {
    margin: 0 0 10px;
  }

  .score-summary {
    margin-left: 0;
  }
  .pay-modal { padding: 10px; }
  .pay-methods { grid-template-columns: 1fr; }
  .pay-modal-actions { flex-direction: column; }
  .pay-modal-actions .pay-btn { width: 100%; }
}

/* 微信支付二维码弹窗 */
.payqr-box {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10120;
  padding: 16px;
}

.payqr-box.is-open {
  display: flex;
}

.payqr-inner {
  width: 320px;
  max-width: 92vw;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
  overflow: hidden;
}

.payqr-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  background: linear-gradient(135deg, #1e3a8a, #a855f7);
  color: #fff;
  position: relative;
}

.payqr-title {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.payqr-close-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.payqr-body {
  padding: 14px 14px 16px;
  text-align: center;
}

.payqr-qrcode {
  width: 220px;
  height: 220px;
  margin: 0 auto 10px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payqr-tip {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .detail-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .detail-tag {
    text-align: left;
  }
}

