/* ========== CSS 变量 ========== */
:root {
  --primary: #256378;
  --primary-light: rgba(37, 99, 120, 0.06);
  --primary-dark: #1a2f38;
  --accent: #3a8a7a;
  --bg: linear-gradient(160deg, #f0f4f5 0%, #e8eef2 30%, #f5f0eb 70%, #f2f5f0 100%);
  --white: #ffffff;
  --text: #1a2f38;
  --text-light: #6b8a95;
  --text-muted: #93a8b2;
  --border: rgba(37, 99, 120, 0.12);
  --border-light: rgba(37, 99, 120, 0.08);
  --shadow: 0 4px 40px rgba(37, 99, 120, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --radius: 20px;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --font-serif: "Noto Serif SC", "Source Han Serif CN", Georgia, "Times New Roman", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans CN", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "DM Mono", "SF Mono", "Menlo", monospace;
}

/* ========== 重置 & 基础 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

/* ========== 背景装饰圆 ========== */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.bg-orb--1 {
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37, 99, 120, 0.06) 0%, transparent 70%);
}

.bg-orb--2 {
  bottom: -15%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(160, 120, 80, 0.05) 0%, transparent 70%);
}

.bg-orb--3 {
  top: 40%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(80, 140, 120, 0.04) 0%, transparent 70%);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-appearance: none;
  font-family: inherit;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #2d7a6e);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(37, 99, 120, 0.2);
  letter-spacing: 0.5px;
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(37, 99, 120, 0.15);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:active {
  background: rgba(37, 99, 120, 0.04);
}

/* ========== 测试页：进度区 ========== */
.progress-section {
  padding: 24px 0 0;
  margin-bottom: 28px;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(37, 99, 120, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.5px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.progress-slash {
  color: var(--text-muted);
  font-weight: 400;
}

/* ========== 测试页：题目卡片 ========== */
.question-section {
  padding: 0 0 24px;
}

.question-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 40px 32px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.question-card.animating {
  opacity: 0;
  transform: translateX(-20px);
}

.question-number {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.question-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 32px;
  color: var(--text);
  letter-spacing: -0.3px;
}

.option-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 15px;
  line-height: 1.5;
  color: #2a3f48;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  font-family: var(--font-sans);
  outline: none;
  -webkit-appearance: none;
}

.option-item:active {
  background: rgba(37, 99, 120, 0.04);
}

.option-item.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(37, 99, 120, 0.06), rgba(58, 138, 122, 0.04));
  box-shadow: 0 2px 12px rgba(37, 99, 120, 0.1);
  transform: translateX(4px);
}

.option-text {
  flex: 1;
}

.option-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 120, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.option-item.selected .option-check {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 120, 0.3);
}

/* ========== 测试页：底部导航 ========== */
.nav-buttons {
  display: flex;
  align-items: center;
  padding: 0 0 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

.btn-back {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--text-light);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
  -webkit-appearance: none;
}

.btn-back:active {
  background: rgba(37, 99, 120, 0.08);
}

/* ========== 结果页 ========== */
.result-page {
  padding-top: 32px;
  padding-bottom: 40px;
}

.result-header {
  text-align: center;
  margin-bottom: 28px;
}

.result-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  font-family: var(--font-serif);
}

.result-summary {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.7;
  font-family: var(--font-sans);
}

.result-subtitle {
  font-size: 15px;
  font-style: italic;
  color: var(--text-light);
  line-height: 1.7;
  font-family: var(--font-sans);
  text-align: center;
}

/* 特质标签 */
.section-label {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.trait-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.trait-tag {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(37, 99, 120, 0.1);
  font-family: var(--font-sans);
}

/* 匹配度百分比 */
.match-section {
  margin-bottom: 28px;
}

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

.match-label {
  min-width: 56px;
  font-size: 14px;
  color: var(--text);
  flex-shrink: 0;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.match-track {
  flex: 1;
  height: 8px;
  background: rgba(37, 99, 120, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.match-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.6s ease;
}

.match-value {
  width: 40px;
  font-size: 14px;
  color: var(--text-light);
  text-align: right;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

/* 适合原因 */
.fit-reasons {
  margin-bottom: 28px;
}

.fit-reasons ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fit-reasons li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  font-family: var(--font-sans);
}

.fit-reasons li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

/* 建议区 */
.advice-section {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.advice-section .section-label {
  margin-bottom: 16px;
}

.advice-block {
  margin-bottom: 16px;
}

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

.advice-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding-left: 10px;
  margin-bottom: 8px;
  border-left: 3px solid var(--primary);
  font-family: var(--font-sans);
}

.advice-block-body p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  font-family: var(--font-sans);
  margin-bottom: 12px;
}

.advice-block-body p:last-child {
  margin-bottom: 0;
}

.advice-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  font-family: var(--font-sans);
}

/* 重新测试按钮 */
.restart-section {
  text-align: center;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.restart-section .btn {
  width: 100%;
}

/* ========== 加载态 ========== */
.loading {
  text-align: center;
  padding: 60px 0;
  color: var(--text-light);
  font-size: 15px;
  font-family: var(--font-sans);
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }

  .result-page {
    padding-top: 28px;
    padding-bottom: 40px;
  }

  .question-card {
    padding: 32px 20px;
  }

  .question-text {
    font-size: 18px;
  }

  .option-item {
    padding: 16px 16px;
  }

  .transition-title {
    font-size: 22px;
  }

  .transition-text {
    font-size: 15px;
  }
}

/* ========== 入口落地页 ========== */
.landing-page {
  padding-top: 60px;
  padding-bottom: 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.landing-header {
  text-align: center;
  margin-bottom: 36px;
}

.landing-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.35;
  letter-spacing: -1px;
  margin-bottom: 12px;
  font-family: var(--font-serif);
}

.landing-subtitle {
  font-size: 16px;
  color: var(--text-light);
  font-family: var(--font-sans);
}

.landing-info {
  margin-bottom: 28px;
}

.info-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.info-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.info-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.info-value {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
  font-family: var(--font-sans);
}

.landing-tip {
  text-align: center;
  margin-bottom: 32px;
}

.landing-tip p {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.landing-action {
  text-align: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.landing-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  font-size: 18px;
  text-decoration: none;
}

@media (max-width: 480px) {
  .landing-page {
    padding-top: 48px;
  }

  .landing-title {
    font-size: 28px;
  }
}

/* ========== 模块过渡画面 ========== */
.module-transition {
  text-align: center;
  padding: 60px 24px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.module-transition.visible {
  opacity: 1;
  transform: translateY(0);
}

.transition-icon {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}

.transition-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 16px 0;
}

.transition-text {
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.7;
  margin: 0 0 32px 0;
}

.transition-btn {
  min-width: 200px;
}

/* ========== 结果页：特质分析卡片 ========== */
.trait-analysis {
  margin-bottom: 28px;
}

.trait-group {
  margin-bottom: 20px;
}

.trait-group:last-child {
  margin-bottom: 0;
}

.trait-group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 10px;
  padding-left: 4px;
  font-family: var(--font-sans);
}

.trait-card {
  background: var(--glass-bg);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--border);
}

.trait-card--positive {
  border-left-color: var(--accent);
}

.trait-card--challenge {
  border-left-color: #c78c4e;
}

.trait-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.trait-card-dim {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.trait-card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-sans);
}

.trait-card-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  font-family: var(--font-sans);
}

/* ========== 结果页：人物小传 ========== */
.portrait-section {
  margin-bottom: 28px;
}

.portrait-body {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.portrait-body.collapsed {
  max-height: 280px;
}

.portrait-body.collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.95));
  pointer-events: none;
}

.portrait-text p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 14px;
  font-family: var(--font-sans);
  text-indent: 2em;
}

.portrait-text p:last-child {
  margin-bottom: 0;
}

.portrait-expand {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px;
  margin-top: 8px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  outline: none;
}

.portrait-expand:active {
  background: var(--primary-light);
}

/* ========== 结果页：分享按钮 ========== */
.share-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 24px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  outline: none;
}

.share-btn:active {
  background: var(--primary-light);
}

/* ========== 结果页：引流卡片 ========== */
.cta-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 28px 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  text-align: center;
}

.cta-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.cta-qrcode {
  width: 160px;
  height: 160px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.cta-text {
  font-size: 14px;
  color: var(--text-light);
  font-family: var(--font-sans);
}

/* ========== 结果页：Paywall 截断区域 ========== */
.paywall-fade {
  height: 80px;
  background: linear-gradient(to bottom, transparent, #f0f4f5);
  margin-top: -80px;
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.paywall-gate {
  position: relative;
  margin-bottom: 28px;
}

.paywall-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 32px 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  text-align: center;
}

.paywall-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
  font-family: var(--font-serif);
}

.paywall-subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
  font-family: var(--font-sans);
  line-height: 1.6;
}

.paywall-qrcode {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.paywall-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-family: var(--font-sans);
  line-height: 1.6;
}

.unlock-input-group {
  display: flex;
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
}

.unlock-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  font-family: var(--font-mono);
  letter-spacing: 2px;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
}

.unlock-input:focus {
  border-color: var(--primary);
}

.unlock-input::placeholder {
  letter-spacing: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.unlock-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--primary), #2d7a6e);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  -webkit-appearance: none;
}

.unlock-btn:active {
  transform: translateY(1px);
}

.unlock-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.unlock-error {
  display: none;
  margin-top: 12px;
  font-size: 13px;
  color: #c0392b;
  font-family: var(--font-sans);
}

.unlock-error.visible {
  display: block;
}

.locked-content {
  display: none;
}

/* ========== 模块二结果页次要匹配度 ========== */
.match-section--secondary {
  margin-top: 8px;
  opacity: 0.75;
}

.match-section--secondary .section-label {
  font-size: 15px;
}

/* ========== 弹窗 Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-box {
  transform: translateY(0);
}

.modal-dev-message {
  text-align: left;
  margin-bottom: 24px;
}

.modal-dev-message p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  font-family: var(--font-sans);
  margin-bottom: 8px;
}

.modal-dev-message p:last-child {
  margin-bottom: 0;
}

.modal-follow-guide {
  margin-bottom: 20px;
}

.modal-qrcode {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.modal-qrcode-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-family: var(--font-sans);
}

.modal-copy-btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--primary-light);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  outline: none;
}

.modal-copy-btn:active {
  background: rgba(37, 99, 120, 0.1);
}

.modal-close-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #2d7a6e);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  outline: none;
}

.modal-close-btn:active {
  transform: translateY(1px);
}

.paywall-expand-btn {
  min-width: 160px;
}
