/* ============ 新式24型人格测评 · BitM极简新潮风 ============ */

:root {
  --primary: #7c6ff0;
  --primary-2: #5b8def;
  --text: #2f3542;
  --text-light: #747d8c;
  --text-faint: #a4b0be;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --radius-card: 16px;
  --radius-btn: 12px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
  --danger: #e05656;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -10%, #ece9fb 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 110%, #e3eefc 0%, transparent 55%);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 56px;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ============ 视图切换 ============ */

.view {
  display: none;
  min-height: 100vh;
  animation: viewFade 0.4s ease;
}

.view.active {
  display: flex;
  flex-direction: column;
}

@keyframes viewFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* ============ 通用组件 ============ */

.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 14px 32px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124, 111, 240, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(124, 111, 240, 0.45);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: #fff;
  color: var(--text-light);
  border: 1px solid #e3e6ee;
}

.btn-ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-lg {
  width: 100%;
  height: 56px;
  font-size: 18px;
}

.btn-sm {
  padding: 10px 24px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
  height: 52px;
}

/* ============ 全局合规文案 ============ */

.global-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-faint);
  background: rgba(245, 246, 250, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0 16px;
  text-align: center;
  z-index: 50;
}

/* ============ 首页 ============ */

#view-home {
  position: relative;
  overflow: hidden;
}

/* 四角极淡几何装饰（素材规范：透明度8%） */
#view-home::before {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1.5px solid rgba(124, 111, 240, 0.08);
  top: -60px;
  right: -70px;
}

#view-home::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1.5px solid rgba(91, 141, 239, 0.08);
  bottom: 30px;
  left: -50px;
}

.home-inner {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 16px;
  min-height: calc(100vh - 56px);
  padding-top: 40px;
}

.brand-badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-card);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--primary);
  font-weight: 600;
}

.home-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(120deg, #7c6ff0, #5b8def, #6fb3a8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-slogan {
  font-size: 16px;
  color: var(--text-light);
}

.home-intro {
  width: 100%;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.7;
}

.intro-time {
  margin-top: 6px;
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}

.paid-badge {
  font-size: 14px;
  color: #2e9e6b;
  background: #e9f8f0;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
}

/* ============ 答题页 ============ */

#view-quiz {
  background: #ffffff;
}

.quiz-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 14px 20px 10px;
  border-bottom: 1px solid #f1f1f6;
}

.quiz-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-progress {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #eeeef5;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.35s ease;
}

.quiz-progress-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  min-width: 40px;
  text-align: right;
}

.quiz-index {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 1px;
}

.quiz-inner {
  padding-top: 32px;
}

.quiz-question {
  font-size: 16px;
  line-height: 1.8;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
  min-height: 58px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-option {
  width: 100%;
  height: 56px;
  border-radius: var(--radius-btn);
  border: 1.5px solid #eef0f5;
  background: #fafafc;
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  text-align: left;
  transition: all 0.18s ease;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.quiz-option:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(124, 111, 240, 0.08) 0%, rgba(91, 141, 239, 0.08) 100%);
  box-shadow: 0 4px 14px rgba(124, 111, 240, 0.12);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f3f1fe 0%, #eef3fe 100%);
  color: var(--primary);
  font-weight: 600;
}

.quiz-option .option-letter {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f0f1f6;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.quiz-option.selected .option-letter {
  background: var(--primary);
  color: #fff;
}

.quiz-nav {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.quiz-nav .btn {
  flex: 1;
  height: 52px;
}

.quiz-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--danger);
  min-height: 20px;
}

/* ============ 计算页 ============ */

#view-loading {
  background: #ffffff;
}

.loading-inner {
  justify-content: center;
  align-items: center;
  gap: 22px;
}

.spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 5px solid #e8eaf1;
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse 1.6s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.loading-sub {
  font-size: 14px;
  color: var(--text-faint);
}

/* ============ 报告页 ============ */

.report-inner {
  gap: 16px;
}

.report-header {
  position: relative;
  overflow: hidden;
  padding: 28px;
  text-align: center;
  color: #333344;
  aspect-ratio: 9 / 4;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* 免费版：海报低模糊 */
.report-header.free-locked {
  filter: blur(1.2px) saturate(0.92);
}

.report-header-deco {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.deco-1 {
  width: 220px;
  height: 220px;
  top: -80px;
  right: -60px;
}

.deco-2 {
  width: 150px;
  height: 150px;
  bottom: -60px;
  left: -40px;
}

/* 极淡弧线点缀 */
.report-header::after {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.04);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.report-header-content {
  position: relative;
  z-index: 1;
}

.report-tag {
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(51, 51, 68, 0.55);
  margin-bottom: 14px;
  font-weight: 400;
}

.report-name {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 10px;
  color: #333344;
}

.report-code {
  font-size: 15px;
  letter-spacing: 6px;
  color: rgba(51, 51, 68, 0.6);
  margin-bottom: 14px;
  font-weight: 600;
}

.report-slogan {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(51, 51, 68, 0.75);
}

.report-module {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.module-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 模块标题左侧细短渐变竖线（颜色随当前人格主色，JS动态设置；浅色系加深保证可见） */
.module-bar {
  display: inline-block;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  margin-right: 10px;
  filter: saturate(1.5) brightness(0.85);
}

.module-text {
  font-size: 15px;
  line-height: 1.9;
  color: #4a5161;
}

/* 锁定模块 */
.locked-module .locked-body {
  filter: blur(7px);
  user-select: none;
  pointer-events: none;
  max-height: 150px;
  overflow: hidden;
}

.locked-module.unlocked .locked-body {
  filter: none;
  user-select: auto;
  pointer-events: auto;
  max-height: none;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}

.lock-overlay p {
  font-size: 14px;
  color: var(--text-light);
}

.lock-icon {
  font-size: 26px;
}

.locked-module.unlocked .lock-overlay {
  display: none;
}

.scene-row,
.summary-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  line-height: 1.8;
}

.scene-tag,
.summary-label {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: #f0eefe;
  border-radius: 6px;
  padding: 2px 10px;
  height: fit-content;
  margin-top: 4px;
}

.summary-label {
  min-width: 64px;
  text-align: center;
}

.report-actions,
.card-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.report-actions .btn,
.card-actions .btn {
  flex: 1;
  height: 52px;
}

/* ============ 名片页 ============ */

.card-inner {
  align-items: center;
  gap: 18px;
  padding-top: 32px;
}

.card-stage {
  width: 100%;
  max-width: 420px;
}

.card-stage canvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
  display: block;
}

.card-hint {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}

.card-actions {
  width: 100%;
  max-width: 420px;
}

/* ============ 密钥弹窗 ============ */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(30, 32, 48, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
  animation: viewFade 0.25s ease;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  /* 软键盘弹出导致可视区变矮时：模态框可滚动、不被裁切 */
  margin: auto;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 32px 26px 24px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 26px;
  color: var(--text-faint);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-title {
  font-size: 20px;
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-input {
  width: 100%;
  height: 54px;
  border-radius: var(--radius-btn);
  border: 1.5px solid #e3e6ee;
  text-align: center;
  font-size: 22px;
  letter-spacing: 8px;
  font-weight: 700;
  outline: none;
  transition: border 0.15s;
  font-family: inherit;
}

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

.modal-input.shake {
  animation: shake 0.4s ease;
  border-color: var(--danger);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.modal-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 20px;
  margin-top: 8px;
}

.modal-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ============ PC端适配（1024px以上） ============ */

@media (min-width: 1024px) {
  .view-inner {
    padding-top: 36px;
  }

  .home-title {
    font-size: 42px;
  }

  .quiz-topbar {
    padding: 18px 20px 12px;
  }

  .quiz-question {
    font-size: 18px;
    margin-bottom: 32px;
  }

  .quiz-option {
    height: 60px;
    font-size: 17px;
    width: 480px;
    align-self: center;
  }

  .quiz-options {
    align-items: center;
  }

  .quiz-nav {
    width: 480px;
    align-self: center;
  }

  .report-name {
    font-size: 38px;
  }

  .report-module {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
  }

  .report-module:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
  }

  .btn:hover {
    cursor: pointer;
  }
}

/* ============ 超小屏（320px）兜底 ============ */

@media (max-width: 360px) {
  .home-title {
    font-size: 28px;
  }

  .quiz-question {
    font-size: 15px;
  }

  .report-name {
    font-size: 27px;
  }
}
