/* ══════════════════════════════════════
   黑暗人格 D 因子测试 · 样式表
   文字颜色统一使用 rgba(180,200,220,.xx) 以兼容 html2canvas PDF 导出
   ══════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
  min-height: 100vh; min-height: 100dvh;
  background: #0a0812;
  color: #cdd8e4;
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', 'PingFang SC', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app { min-height: 100vh; min-height: 100dvh; }

/* ── Screen 切换 ── */
.screen {
  display: none;
  min-height: 100vh; min-height: 100dvh;
  padding: 20px;
  padding-top: calc(env(safe-area-inset-top, 20px) + 20px);
  padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 20px);
}
.screen.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

/* ── 全部测试按钮 ── */
.btn-all-tests{
  position:absolute;top:max(env(safe-area-inset-top,0px),16px);left:16px;
  font-family:'Helvetica Neue',sans-serif;font-size:11px;letter-spacing:1px;
  color:rgba(180,200,220,.7);background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);border-radius:20px;
  padding:8px 14px;text-decoration:none;transition:all .25s;z-index:10;
}
.btn-all-tests:hover{background:rgba(255,255,255,.15);border-color:rgba(255,255,255,.25);color:#fff}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════ 开始页 ══════ */
#start-screen {
  justify-content: center;
  align-items: center;
}
.start-content {
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.logo {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(139,92,246,0.04));
  border: 1px solid rgba(139,92,246,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #8b5cf6;
}
h1 {
  font-size: 22px; font-weight: 700;
  margin-bottom: 6px; letter-spacing: -0.3px;
}
.subtitle {
  font-size: 12px; color: rgba(180,200,220,0.4);
  font-family: 'Helvetica Neue', system-ui;
  letter-spacing: 2px; margin-bottom: 4px;
}
.sub-desc {
  font-size: 13px; color: rgba(180,200,220,0.3);
  margin-bottom: 20px;
}

.warning-card {
  display: flex; gap: 10px;
  padding: 14px;
  background: rgba(139,92,246,0.06);
  border: 1px solid rgba(139,92,246,0.12);
  border-radius: 12px;
  margin-bottom: 20px;
  text-align: left;
}
.warning-icon { font-size: 16px; flex-shrink: 0; opacity: 0.6; }
.warning-text { font-size: 11px; line-height: 1.7; color: rgba(180,200,220,0.45); }

.features {
  display: flex; flex-direction: column;
  gap: 8px; margin-bottom: 20px;
}
.feature {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.025);
  border-radius: 10px;
  font-size: 13px; color: rgba(180,200,220,0.6);
}
.feature-icon { font-size: 15px; color: #8b5cf6; opacity: 0.7; }

.info-card {
  background: rgba(255,255,255,0.025);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 20px;
}
.info-row {
  display: flex; justify-content: space-between;
  padding: 7px 0; font-size: 13px;
}
.info-row:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,0.06); }
.info-label { color: rgba(180,200,220,0.4); }
.info-value { font-weight: 600; }

.btn-start {
  width: 100%; padding: 15px;
  font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: none; border-radius: 14px;
  cursor: pointer; transition: all 0.3s;
}
.btn-start:active { transform: scale(0.98); }

.start-safe {
  font-size: 11px; color: rgba(180,200,220,0.18);
  margin-top: 12px;
}

/* ══════ 测试页 ══════ */
#test-screen {
  padding-top: calc(env(safe-area-inset-top, 0px) + 56px);
}

.progress-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.06);
  z-index: 100;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  transition: width 0.3s ease;
  width: 0%;
}

.test-top-bar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 20px; right: 20px;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 100;
}
.dim-tag {
  font-size: 12px; font-weight: 500;
  letter-spacing: 1px;
  display: none;
}
.progress-text {
  font-size: 12px; color: rgba(180,200,220,0.4);
}
#current-q { color: #8b5cf6; font-weight: 600; }

.question-container {
  flex: 1;
  display: flex; flex-direction: column;
  padding-top: 12px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.question-text {
  font-size: 17px; font-weight: 600;
  line-height: 1.7; margin-bottom: 28px;
  padding: 0 2px;
}
.options {
  display: flex; flex-direction: column;
  gap: 8px;
}
.option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.option:active {
  transform: scale(0.98);
  background: rgba(255,255,255,0.05);
  border-color: rgba(139,92,246,0.3);
}
.option.selected {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.4);
}
.opt-dot {
  width: 16px; height: 16px;
  border: 1.5px solid rgba(180,200,220,0.15);
  border-radius: 50%; flex-shrink: 0;
  transition: all 0.2s;
}
.option.selected .opt-dot {
  border-color: #8b5cf6;
  background: #8b5cf6;
  box-shadow: inset 0 0 0 3px #0a0812;
}
.opt-text { color: rgba(180,200,220,0.7); }
.option.selected .opt-text { color: rgba(180,200,220,0.9); }

/* ══════ 结果页 ══════ */
#result-screen { padding-bottom: 40px; }
.result-content {
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

/* D因子总览 */
.result-header {
  text-align: center;
  margin-bottom: 24px;
  padding-top: 16px;
}
.result-icon {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(139,92,246,0.04));
  border: 1px solid rgba(139,92,246,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #8b5cf6;
}
.result-header h1 {
  font-size: 15px; margin-bottom: 8px;
  color: rgba(180,200,220,0.4); font-weight: 400;
  letter-spacing: 1px;
}
.d-score {
  font-size: 60px; font-weight: 700;
  line-height: 1; margin-bottom: 8px;
  font-family: 'Helvetica Neue', system-ui;
}
.d-label {
  font-size: 18px; font-weight: 600;
  margin-bottom: 12px;
}
.d-summary {
  font-size: 13px; line-height: 1.8;
  color: rgba(180,200,220,0.4);
  padding: 0 8px;
}

/* 雷达图 */
.radar-section {
  text-align: center;
  margin-bottom: 24px;
  padding: 16px 0;
  overflow: visible;
  margin-left: -10px;
  margin-right: -10px;
}
.radar-legend {
  display: flex; justify-content: center;
  gap: 20px; margin-bottom: 12px;
}
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: rgba(180,200,220,0.4);
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.legend-dot.score { background: rgba(139,92,246,0.6); }
.legend-dot.norm { background: rgba(16,185,129,0.3); border: 1px dashed rgba(16,185,129,0.5); }

#radar-canvas { display: block; margin: 0 auto; }

/* 免费维度条 */
.free-dims-section {
  background: rgba(255,255,255,0.025);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.section-label {
  font-size: 12px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(139,92,246,0.5);
  margin-bottom: 16px;
}

.dim-row { margin-bottom: 18px; }
.dim-row:last-child { margin-bottom: 0; }
.dim-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.dim-name { font-size: 13px; font-weight: 600; }
.dim-score { font-size: 13px; font-weight: 600; color: rgba(180,200,220,0.7); margin-left: auto; }
.dim-pct { font-size: 10px; color: rgba(180,200,220,0.4); }
.dim-bar {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: visible;
}
.dim-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
  opacity: 0.7;
}
.dim-norm {
  position: absolute; top: -3px;
  width: 2px; height: 12px;
  background: rgba(99,102,241,0.4);
  border-radius: 1px;
}
.dim-desc {
  font-size: 11px; color: rgba(180,200,220,0.4);
  margin-top: 5px; line-height: 1.5;
}

/* 免费分析 */
.free-analysis {
  background: rgba(255,255,255,0.025);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.free-analysis p {
  font-size: 13px; line-height: 1.9;
  color: rgba(180,200,220,0.5);
}

/* ══════ 付费墙 ══════ */
.paywall-card {
  text-align: center;
  padding: 28px 20px;
  background: linear-gradient(180deg, rgba(139,92,246,0.06) 0%, rgba(139,92,246,0.02) 100%);
  border: 1px solid rgba(139,92,246,0.12);
  border-radius: 20px;
  margin-bottom: 24px;
}
.paywall-lock { font-size: 28px; margin-bottom: 12px; }
.paywall-title {
  font-size: 17px; font-weight: 700;
  margin-bottom: 10px; color: #cdd8e4;
}
.paywall-desc {
  max-width: 300px;
  margin: 0 auto 16px;
  font-size: 12px;
  line-height: 1.9;
  color: rgba(180,200,220,0.45);
}
.paywall-proof {
  max-width: 320px;
  margin: 0 auto 18px;
  text-align: left;
}
.paywall-proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.18);
  color: #c4b5fd;
  font-size: 11px;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.paywall-proof-grid { display: grid; gap: 10px; }
.paywall-proof-card {
  padding: 14px 14px 13px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(139,92,246,0.12);
}
.paywall-proof-kicker {
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(180,200,220,0.35);
  margin-bottom: 7px;
}
.paywall-proof-title {
  font-size: 14px;
  font-weight: 600;
  color: #e9d5ff;
  margin-bottom: 6px;
}
.paywall-proof-text {
  font-size: 12px;
  line-height: 1.8;
  color: rgba(180,200,220,0.58);
}
.paywall-proof-locked {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.7;
  color: rgba(180,200,220,0.28);
  filter: blur(2.6px);
  user-select: none;
}
.paywall-list { margin-bottom: 20px; text-align: left; }
.paywall-item {
  font-size: 12px; color: rgba(180,200,220,0.5);
  line-height: 2.2; padding-left: 18px; position: relative;
}
.paywall-item::before {
  content: '✦'; position: absolute; left: 0;
  color: rgba(139,92,246,0.5); font-size: 10px;
}
.paywall-price {
  font-family: 'Helvetica Neue', system-ui;
  font-size: 32px; font-weight: 700;
  color: #8b5cf6; margin-bottom: 4px;
}
.paywall-price-sub {
  font-size: 12px;
  color: rgba(180,200,220,0.34);
  margin-bottom: 16px;
  letter-spacing: 0.6px;
}
.btn-pay {
  display: inline-block;
  font-size: 14px; font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: none;
  padding: 14px 48px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(139,92,246,0.3);
}
.btn-pay:active { transform: scale(0.98); }
.paywall-safe {
  font-size: 10px; color: rgba(180,200,220,0.18);
  margin-top: 12px;
}
.paywall-count {
  font-size: 11px; color: rgba(180,200,220,0.2);
  margin-top: 8px;
}
.paywall-count strong { color: rgba(139,92,246,0.5); }

/* ══════ 付费内容 ══════ */
.paid-section {
  margin-bottom: 24px;
}
.section-label-paid {
  font-size: 13px; font-weight: 600;
  letter-spacing: 1px;
  color: rgba(139,92,246,0.6);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(139,92,246,0.1);
}

/* 深度维度解读 */
.paid-dim-section {
  background: rgba(255,255,255,0.025);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.paid-dim-hd {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.paid-dim-icon { font-size: 10px; }
.paid-dim-name { font-size: 14px; font-weight: 600; }
.paid-dim-en { font-size: 11px; color: rgba(180,200,220,0.4); font-style: italic; }
.paid-dim-val { font-size: 14px; font-weight: 700; margin-left: auto; }
.paid-dim-meta {
  display: flex; gap: 12px;
  font-size: 11px; color: rgba(180,200,220,0.4);
  margin-bottom: 10px;
}
.paid-dim-diff.high { color: #f97316; }
.paid-dim-diff.low { color: #4ade80; }
.paid-dim-insight {
  font-size: 12.5px; line-height: 2;
  color: rgba(180,200,220,0.5);
}

/* D因子报告 & 人际关系 */
.paid-report {
  background: rgba(255,255,255,0.025);
  border-radius: 14px;
  padding: 18px;
  font-size: 13px; line-height: 2;
  color: rgba(180,200,220,0.5);
}
.paid-report p { margin-bottom: 10px; }
.paid-report p:last-child { margin-bottom: 0; }

/* 组合分析 */
.combo-card {
  background: rgba(255,255,255,0.025);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  border-left: 3px solid #8b5cf6;
}
.combo-title {
  font-size: 14px; font-weight: 600;
  margin-bottom: 8px; color: #cdd8e4;
}
.combo-detail {
  font-size: 12.5px; line-height: 2;
  color: rgba(180,200,220,0.5);
}

/* 风险预警 */
.risk-item {
  padding: 10px 14px;
  background: rgba(255,255,255,0.025);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 12.5px; line-height: 1.8;
  color: rgba(180,200,220,0.55);
}

/* 底部操作 */
.r-tip {
  font-size: 10px; letter-spacing: 1px;
  color: rgba(180,200,220,0.15);
  text-align: center; margin-bottom: 14px;
  line-height: 2;
}
.r-actions {
  display: flex; flex-direction: column;
  gap: 8px; margin-bottom: 16px;
}
.btn-share, .btn-copy-result, .btn-retry {
  display: block; width: 100%;
  font-size: 13px; letter-spacing: 1px;
  padding: 13px;
  border-radius: 10px;
  cursor: pointer; transition: all 0.2s;
  text-align: center;
}
.btn-share {
  color: rgba(180,200,220,0.7);
  background: transparent;
  border: 1px solid rgba(139,92,246,0.25);
}
.btn-share:hover { border-color: rgba(139,92,246,0.5); }
.btn-retry {
  color: rgba(180,200,220,0.3);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
}
.btn-share:active, .btn-copy-result:active, .btn-retry:active {
  transform: scale(0.98);
}

.back-link {
  display: block; text-align: center;
  font-size: 12px; color: rgba(180,200,220,0.4);
  text-decoration: none; padding: 8px;
}

/* ══════ 分享海报弹窗 ══════ */
.poster-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(6px);
  z-index: 9998; display: none; flex-direction: column;
  align-items: center; justify-content: center; padding: 20px;
}
.poster-overlay.show { display: flex; }
.poster-canvas-wrap {
  max-width: 340px; width: 100%; margin: 0 auto 16px;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  flex-shrink: 1; min-height: 0;
}
.poster-canvas-wrap img {
  display: block; width: 100%; max-height: 100%; height: auto;
  object-fit: contain;
}
.poster-hint {
  font-size: 12px; color: rgba(180,200,220,0.45);
  text-align: center; margin-bottom: 12px;
}
.btn-poster-close {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(180,200,220,0.5); font-size: 14px; padding: 10px 36px;
  border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.btn-poster-close:hover {
  background: rgba(255,255,255,0.12); color: rgba(180,200,220,0.7);
}

/* ══════ 支付弹窗 ══════ */
.pay-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.pay-modal-overlay.show { display: flex; }
.pay-modal {
  width: 320px; max-width: 90vw;
  background: linear-gradient(180deg, #16122a 0%, #0d0a16 100%);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 18px;
  padding: 28px 22px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.pay-modal-close {
  position: absolute; top: 12px; right: 14px;
  font-size: 16px; color: rgba(180,200,220,0.25);
  background: none; border: none; cursor: pointer;
  padding: 4px;
}
.pay-modal-title {
  font-size: 16px; font-weight: 600;
  letter-spacing: 1px; color: #cdd8e4;
  margin-bottom: 16px;
}
.pay-modal-amount {
  font-size: 24px; font-weight: 700;
  color: #8b5cf6; margin-bottom: 4px;
}
.pay-modal-hint {
  font-size: 11px; color: rgba(180,200,220,0.2);
  margin-bottom: 16px;
}
.pay-methods {
  display: flex; flex-direction: column;
  gap: 8px; margin-top: 8px; margin-bottom: 14px;
}
.btn-pay-method {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; width: 100%; padding: 13px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; cursor: pointer;
  transition: all 0.2s;
  font-size: 14px; letter-spacing: 0.5px;
}
.btn-pay-method:active { transform: scale(0.98); }
.pay-icon-img { width: 20px; height: 20px; flex-shrink: 0; }
.btn-alipay {
  background: rgba(0,160,233,0.1);
  color: #00a0e9;
  border-color: rgba(0,160,233,0.25);
}
.btn-alipay:hover {
  background: rgba(0,160,233,0.2);
  border-color: rgba(0,160,233,0.45);
}

.pay-state-icon { font-size: 32px; margin: 8px 0 10px; }
.pay-state-text { font-size: 14px; color: rgba(180,200,220,0.65); margin-bottom: 4px; }
.pay-state-sub { font-size: 11px; color: rgba(180,200,220,0.25); margin-bottom: 16px; }

.btn-check-pay {
  display: block; width: 100%;
  font-size: 13px; font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border: none; padding: 12px;
  border-radius: 10px;
  cursor: pointer; margin-bottom: 8px;
  box-shadow: 0 4px 16px rgba(139,92,246,0.25);
}
.btn-check-pay:active { transform: scale(0.98); }
.btn-repay {
  display: block; width: 100%;
  font-size: 12px; color: rgba(180,200,220,0.4);
  background: none; border: none;
  padding: 8px; cursor: pointer;
}

.pay-qr-hint { font-size: 12px; color: rgba(180,200,220,0.4); margin-bottom: 12px; }
.pay-qr-wrap {
  display: flex; justify-content: center;
  margin-bottom: 10px;
  animation: qrPulse 2.5s ease infinite;
}
.pay-qr-wrap img, .pay-qr-wrap canvas { width: 156px !important; height: 156px !important; }
.pay-qr-amount {
  font-size: 18px; font-weight: 700;
  color: #8b5cf6; margin-bottom: 4px;
}
.pay-qr-status {
  font-size: 11px; color: rgba(180,200,220,0.2);
  margin-bottom: 14px;
}
@keyframes qrPulse {
  0%,100% { box-shadow: 0 0 0 rgba(139,92,246,0); }
  50% { box-shadow: 0 0 20px rgba(139,92,246,0.12); }
}

/* ── fade-up 动画 ── */
.fu {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fu.show { opacity: 1; transform: translateY(0); }

/* 解锁动画 */
@keyframes unlockPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}
.unlock-anim { animation: unlockPulse 0.5s ease; }

/* ── 响应式 ── */
@media (max-width: 360px) {
  html { font-size: 14px; }
  .d-score { font-size: 48px; }
  .paywall-price { font-size: 26px; }
}
