/* 参照 rensheng（原 2026AI02）：紫红金 + 米色底、祥云标题、双层表单框、粒子氛围 */
:root {
  --red-main: #4c1d95;
  --red-dark: #1e3a8a;
  --gold: #6366f1;
  --gold-light: #a855f7;
  --beige: #eef2ff;
  --beige-dark: #e2e8f0;
  --cream: #f6f7ff;
  --text-dark: #1f2937;
  --text-soft: #6b7280;
  --brand-bg: #312e81;
  --danger: #dc2626;
  --good: #16a34a;
  --radius-lg: 8px;
  --shadow-soft: 0 3px 10px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Serif SC", "SimSun", serif;
  background: var(--cream);
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(201, 162, 39, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 70%, rgba(184, 42, 42, 0.06) 0%, transparent 45%),
    repeating-linear-gradient(
      96deg,
      transparent,
      transparent 40px,
      rgba(201, 162, 39, 0.03) 40px,
      rgba(201, 162, 39, 0.03) 41px
    );
  color: var(--text-dark);
}

.particle-bg {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 0 28px;
}

.app-scaler {
  transform-origin: top center;
  flex-shrink: 0;
}

.app {
  width: 520px;
  max-width: calc(100vw - 24px);
  margin: 0 auto;
  padding: 16px 12px 8px;
}

/* 顶部标题区 */
.app-header {
  text-align: center;
  margin-bottom: 8px;
}

.app-header p {
  margin: 10px 0 0;
  font-size: 13px;
  color: #8a7a62;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--red-main) 0%, var(--red-dark) 100%);
  border: 2px solid var(--gold);
  border-radius: 6px;
  padding: 14px 20px;
  margin-bottom: 16px;
  position: relative;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.title-bar h1 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.cloud {
  display: inline-block;
  width: 32px;
  height: 20px;
  background: var(--gold);
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  box-shadow:
    4px 0 0 var(--gold-light),
    -4px 0 0 var(--gold-light),
    0 3px 0 var(--gold-light);
  vertical-align: middle;
  margin: 0 4px;
}

.cloud-left {
  transform: scaleX(-1);
}

.section-divider {
  height: 2px;
  max-width: 160px;
  margin: 0 auto 20px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold) 20%,
    var(--red-main) 50%,
    var(--gold) 80%,
    transparent
  );
  opacity: 0.85;
  border-radius: 1px;
}

.form-section-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--red-dark);
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-align: center;
  font-family: inherit;
}

/* 双层表单框 */
.form-box {
  background: var(--beige-dark);
  border: 2px solid var(--red-main);
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
  position: relative;
}

.form-inner {
  background: var(--beige);
  border-radius: 0 2px 2px 0;
  padding: 20px 24px;
  border: 1px solid #dcc9a8;
  position: relative;
  margin: 0;
  box-sizing: border-box;
}

.form-row {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.form-row:last-of-type {
  margin-bottom: 0;
}

.form-row-radio .radio-group {
  flex: 1;
  min-width: 200px;
}

.form-row-birthday .birthday-group {
  flex: 1;
  min-width: 200px;
}

.form-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-dark);
  min-width: 56px;
}

.form-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid #dcc9a8;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: var(--cream);
  color: var(--text-dark);
}

.form-input::placeholder {
  color: #8a7a62;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
}

.birthday-group {
  display: flex;
  gap: 8px;
  flex: 1;
}

.birthday-group select {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border-radius: 4px;
  border: 1px solid #dcc9a8;
  background: var(--cream);
  color: var(--text-dark);
  font-size: 14px;
  font-family: inherit;
}

.birthday-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
}

.radio-group {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.radio-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.radio-item input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--red-main);
  border-radius: 50%;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.radio-item input:checked + .radio-custom {
  background: var(--red-main);
  border-color: var(--red-main);
}

.radio-item input:checked + .radio-custom::after {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--gold-light);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* 主按钮：与 02 测算按钮一致（位于 form-box 外） */
.submit-btn.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--red-main) 0%, var(--red-dark) 100%);
  border: 2px solid var(--gold);
  border-radius: 6px;
  padding: 14px 24px;
  cursor: pointer;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.15s, box-shadow 0.15s;
}

.submit-btn.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(76, 29, 149, 0.35);
}

.submit-btn.primary-btn:active {
  transform: translateY(0);
}

.btn-text {
  margin: 0 10px;
}

/* 底部说明 */
.footer-note {
  margin-top: 18px;
  background: var(--beige-dark);
  border: 2px solid var(--red-main);
  border-radius: 6px;
  padding: 5px;
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.06);
}

.footer-note-inner {
  background: var(--beige);
  border-radius: 4px;
  padding: 14px 14px 16px;
  border: 1px solid #dcc9a8;
  text-align: center;
}

.footer-line {
  display: block;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold) 15%,
    var(--red-main) 50%,
    var(--gold) 85%,
    transparent
  );
  margin: 0 auto 12px;
  max-width: 120px;
  opacity: 0.9;
}

.footer-note .footer-line:last-of-type {
  margin-top: 12px;
  margin-bottom: 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--red-dark);
  letter-spacing: 0.06em;
  line-height: 1.65;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 0 1px rgba(201, 162, 39, 0.25);
}

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

/* ——— 弹窗：浅色卡 + 紫金边 ——— */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  z-index: 1000;
  padding: 16px;
  backdrop-filter: none;
}

.dialog-backdrop.hidden {
  display: none;
  pointer-events: none;
}

/* 支付层须盖在报告弹窗（.dialog-backdrop 默认 1000）之上 */
#pay-backdrop.dialog-backdrop {
  z-index: 1200;
}

#payqr-backdrop.dialog-backdrop {
  z-index: 1210;
}

.dialog {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--beige-dark);
  border: 2px solid var(--red-main);
  border-radius: 8px;
  padding: 5px;
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, 0.2),
    0 12px 40px rgba(15, 23, 42, 0.25);
  color: var(--text-dark);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px 40px 8px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.95), rgba(226, 232, 240, 0.5));
}

.dialog-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--red-dark);
}

.icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  border: 1px solid #dcc9a8;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
  color: var(--text-dark);
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--red-main);
  color: #fff;
  border-color: var(--red-main);
}

.dialog-body {
  padding: 14px 14px 12px;
  background: var(--beige);
  border: 1px solid #dcc9a8;
  border-radius: 4px;
  margin: 8px;
}

.dialog-greeting {
  margin: 0 0 6px;
  font-size: 15px;
  color: #334155;
  text-align: center;
  font-family: inherit;
}

.dialog-score {
  margin: 0 0 10px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: linear-gradient(120deg, var(--red-dark), var(--red-main), var(--gold-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}

.dialog-summary {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.7;
}

.dialog-section {
  margin-top: 12px;
  padding: 12px 12px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(201, 162, 39, 0.4);
  box-shadow: 0 2px 8px rgba(76, 29, 149, 0.06);
}

.dialog-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--red-main);
  font-weight: 800;
  text-align: center;
}

.dialog-keywords {
  margin: 0;
  font-size: 16px;
  color: var(--gold-light);
  text-align: center;
  font-weight: 700;
}

.dialog-tips {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.75;
}

.dialog-tips li + li {
  margin-top: 4px;
}

.fortune-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fortune-grid-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(201, 162, 39, 0.35);
}

.fortune-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.fortune-label {
  font-size: 12px;
  color: var(--text-soft);
}

.fortune-value {
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 600;
}

.fortune-good {
  color: var(--good);
}

.fortune-bad {
  color: #dc2626;
}

.fortune-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fortune-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-label {
  width: 56px;
  font-size: 13px;
  color: var(--text-soft);
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: rgba(201, 162, 39, 0.22);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-light), var(--red-main));
  transition: width 0.5s ease;
}

.bar-score {
  width: 36px;
  font-size: 13px;
  color: var(--red-main);
  text-align: right;
  font-weight: 700;
}

.dialog-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px 14px;
}

.dialog-footer-jinri {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.dialog-mode-tip {
  margin: 0;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-soft);
  text-align: center;
}

.dialog-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.jinri-unlock-btn {
  min-width: 200px;
}

/* 未解锁：遮挡趋势条、建议与多维参考 */
.jinri-locked-sections.is-locked {
  position: relative;
  max-height: 200px;
  overflow: hidden;
}

.jinri-locked-sections.is-locked::after {
  content: "解锁后可查看完整内容：四维趋势条、今日小建议与多维参考，并支持下载 PDF";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--red-dark);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.92) 35%,
    #fff 100%
  );
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35);
}

/* 弹窗内主色按钮（非表单提交） */
.dialog .primary-btn:not(.submit-btn) {
  appearance: none;
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, var(--red-main) 0%, var(--red-dark) 100%);
  box-shadow: 0 3px 10px rgba(76, 29, 149, 0.25);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.dialog .primary-btn:not(.submit-btn):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(76, 29, 149, 0.35);
}

.pay-desc {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
}

.pay-actions {
  display: grid;
  gap: 10px;
}

.pay-btn {
  appearance: none;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.4);
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}

.pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.wechat-btn {
  background: linear-gradient(120deg, #bbf7d0, #4ade80, #22c55e);
  border-color: rgba(34, 197, 94, 0.45);
}

.pay-btn-direct {
  color: #fff;
  background: linear-gradient(135deg, #4c1d95, #7c3aed);
  border-color: rgba(124, 58, 237, 0.55);
}

.ghost-btn {
  appearance: none;
  border: 1px solid var(--red-main);
  background: var(--cream);
  color: var(--red-dark);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.ghost-btn:hover {
  background: var(--beige);
}

.qrcode-box {
  width: 100%;
  max-width: 320px;
  min-height: 0;
  height: auto;
  margin: 0 auto;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #dcc9a8;
  box-shadow: 0 4px 16px rgba(76, 29, 149, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pay-qr-inner-wrap {
  display: inline-block;
  padding: 14px;
  background: #fff;
  border-radius: 6px;
  line-height: 0;
  box-sizing: border-box;
}

.qrcode-box canvas,
.qrcode-box img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.payqr-tip {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
}

.payqr-qr-actions {
  width: 100%;
  max-width: 280px;
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.payqr-qr-actions .payqr-save-qr,
.payqr-qr-actions .payqr-recognize-pay {
  margin-top: 0;
  max-width: none;
}

.payqr-recognize-pay {
  display: block;
  width: 100%;
  appearance: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  border: 1px solid rgba(21, 128, 61, 0.65);
  background: linear-gradient(180deg, #22c55e, #15803d);
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.25);
}

.payqr-recognize-pay.hidden {
  display: none;
}

.payqr-recognize-pay:active {
  transform: translateY(1px);
}

.payqr-save-qr {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 12px auto 0;
  appearance: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.payqr-save-qr.hidden {
  display: none;
}

.payqr-save-qr:active {
  transform: translateY(1px);
}

/* 从原生付款码页返回：仅验证，不展示 H5 内嵌二维码区域 */
#payqr-backdrop.payqr-verify-only .payqr-dialog .dialog-body {
  padding-top: 8px;
}

#payqr-backdrop.payqr-verify-only .payqr-tip {
  margin-top: 0;
}

.tip-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.45);
  pointer-events: auto;
}

.tip-backdrop.hidden {
  display: none;
  pointer-events: none;
}

.tip-modal {
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  border: 2px solid var(--red-main);
  background: var(--beige-dark);
  padding: 5px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.2);
}

.tip-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 36px 6px;
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.98), rgba(226, 232, 240, 0.6));
  border-bottom: 1px solid rgba(196, 181, 253, 0.5);
}

.tip-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--red-main);
  text-align: center;
}

.tip-close {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  border: 1px solid #dcc9a8;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  color: var(--text-dark);
  cursor: pointer;
}

.tip-message {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.55;
  text-align: center;
  padding: 14px 14px 10px;
  background: var(--beige);
  margin: 8px;
  border-radius: 4px;
  border: 1px solid #dcc9a8;
}

.tip-footer {
  display: flex;
  justify-content: center;
  padding: 0 8px 12px;
}

.tip-ok {
  appearance: none;
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, var(--red-main) 0%, var(--red-dark) 100%);
}

@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-label {
    min-width: auto;
    padding-top: 0;
  }

  .form-input {
    min-width: 100%;
  }

  .birthday-group {
    flex-direction: column;
  }
}
