/* 心理测试系统 - 移动端 H5 通用样式 */
:root {
  --primary: #6c5ce7;
  --primary-light: #a29bfe;
  --primary-dark: #5541d6;
  --gold: #f0a500;
  --gold-dark: #d18e00;
  --ink: #2d3436;
  --sub: #7a8287;
  --line: #e8e8ef;
  --bg: #f5f6fb;
  --card: #ffffff;
  --danger: #d64545;
  --shadow: 0 8px 30px rgba(80, 60, 180, 0.08);
  --shadow-lg: 0 16px 40px rgba(80, 60, 180, 0.16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }

/* 顶部渐变头 */
.hero {
  background: linear-gradient(150deg, #6c5ce7 0%, #8b6ff0 55%, #a29bfe 100%);
  color: #fff;
  padding: 46px 24px 70px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,0.09);
}
.hero::before { width: 220px; height: 220px; top: -90px; left: -70px; }
.hero::after { width: 160px; height: 160px; bottom: -60px; right: -40px; }
.hero .glyph { font-size: 40px; margin-bottom: 10px; position: relative; z-index: 1; }
.hero h1 { font-size: 27px; margin: 0 0 10px; font-weight: 700; letter-spacing: 1px; position: relative; z-index: 1; }
.hero p { margin: 0; opacity: 0.92; font-size: 14px; position: relative; z-index: 1; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  margin: -40px 16px 16px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}
.card.flat { margin-top: 16px; box-shadow: none; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.card h3 { font-size: 15px; margin: 20px 0 8px; color: var(--primary-dark); }

/* 按钮 */
.btn {
  display: block; width: 100%; border: none; border-radius: 14px;
  padding: 15px 18px; font-size: 16px; font-weight: 600; cursor: pointer;
  text-align: center; transition: transform .12s, opacity .12s, box-shadow .12s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; box-shadow: 0 8px 20px rgba(108,92,231,.3); }
.btn-gold { background: linear-gradient(135deg, var(--gold), #ffc247); color: #4a3200; box-shadow: 0 8px 20px rgba(240,165,0,.28); }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary-light); }
.btn-ghost { background: #f0effc; color: var(--primary-dark); }
.btn-lg { padding: 17px 20px; font-size: 17px; }
.btn + .btn { margin-top: 12px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { margin-top: 0; }

/* 价格信息 */
.price-line { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.price-line:last-child { border-bottom: none; }
.price-line .pl-left { display: flex; align-items: center; gap: 10px; }
.price-line .pl-tag { font-size: 12px; color: #fff; background: var(--gold); padding: 2px 8px; border-radius: 6px; }
.price-line .pl-tag.blue { background: var(--primary); }
.price-line .pl-name { font-weight: 600; }
.price-line .pl-price { color: var(--gold-dark); font-weight: 700; font-size: 18px; }
.price-line .pl-price small { font-size: 12px; color: var(--sub); font-weight: 400; }
.muted { color: var(--sub); font-size: 13px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* 进度条 */
.quiz-head { padding: 22px 20px 8px; }
.quiz-head .q-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--sub); }
.quiz-head .q-count { font-weight: 700; color: var(--primary); font-size: 15px; }
.progress-track { height: 7px; background: #e7e5f7; border-radius: 10px; margin-top: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 10px; transition: width .35s ease; }
.question-card { margin: 10px 16px; background: #fff; border-radius: 18px; padding: 24px 20px; box-shadow: var(--shadow); min-height: 300px; }
.question-card .q-index { color: var(--primary-light); font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.question-card .q-text { font-size: 18px; font-weight: 600; line-height: 1.7; margin: 12px 0 22px; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 12px; padding: 15px 16px;
  border: 1.5px solid var(--line); border-radius: 13px; cursor: pointer;
  background: #fafaff; transition: all .15s; font-size: 15px;
}
.option:active { transform: scale(.99); }
.option .odot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9c6e6; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.option .odot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); transform: scale(0); transition: transform .15s; }
.option.selected { border-color: var(--primary); background: #f2f0ff; }
.option.selected .odot { border-color: var(--primary); }
.option.selected .odot::after { transform: scale(1); }
.option.auto-next { border-color: var(--primary-light); background: #f6f5ff; }
.quiz-foot { padding: 8px 20px 30px; display: flex; justify-content: space-between; align-items: center; }
.link-btn { background: none; border: none; color: var(--sub); font-size: 13px; cursor: pointer; padding: 8px 4px; }

/* 类型徽标 */
.type-badge { display: inline-flex; align-items: center; gap: 8px; background: #f2f0ff; color: var(--primary-dark); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.type-hero { text-align: center; padding: 26px 20px 20px; border-radius: 18px 18px 0 0; color: #fff; }
.type-hero .th-name { font-size: 32px; font-weight: 800; letter-spacing: 3px; }
.type-hero .th-en { font-size: 12px; opacity: .85; letter-spacing: 2px; margin-top: 4px; text-transform: uppercase; }
.type-hero .th-tag { font-size: 14px; opacity: .95; margin-top: 12px; }

/* 雷达图 */
.radar-box { display: flex; flex-direction: column; align-items: center; }
.radar-box canvas { max-width: 100%; }
.radar-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-top: 10px; font-size: 12px; color: var(--sub); }
.radar-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* 分数条 */
.score-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; }
.score-row .sr-name { width: 68px; color: var(--sub); flex-shrink: 0; }
.score-row .sr-bar { flex: 1; height: 8px; background: #eeedf7; border-radius: 8px; overflow: hidden; }
.score-row .sr-fill { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--primary-light), var(--primary)); transition: width .8s ease; }
.score-row .sr-val { width: 30px; text-align: right; font-weight: 700; color: var(--primary-dark); }

/* 付费遮挡预览 */
.locked-preview { position: relative; border-radius: 14px; overflow: hidden; margin-top: 8px; }
.locked-preview .lp-body { filter: blur(4px); opacity: .55; user-select: none; font-size: 13px; line-height: 2; max-height: 150px; overflow: hidden; color: #888; }
.locked-preview .lp-mask {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.92));
}
.locked-preview .lp-lock { font-size: 30px; }
.locked-preview .lp-tip { font-size: 13px; color: var(--primary-dark); font-weight: 600; margin-top: 4px; }

/* 报告正文 */
.report-body p { margin: 0 0 14px; color: #4a5154; font-size: 14.5px; line-height: 1.9; }
.report-section { background: #fff; border-radius: 16px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.report-section .rs-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--primary-dark); margin-bottom: 10px; font-size: 15px; }
.report-section .rs-title .dot { width: 4px; height: 16px; border-radius: 2px; background: var(--primary); }
.mentor-note { border-left: 3px solid var(--gold); background: #fffbf2; border-radius: 10px; padding: 14px 16px; color: #6b531f; font-size: 14px; line-height: 1.85; white-space: pre-wrap; }
.notice { background: #f2f0ff; border-radius: 12px; padding: 14px 16px; color: var(--primary-dark); font-size: 14px; }
.notice.gold { background: #fff8e8; color: #8a6200; }
.spinner { width: 22px; height: 22px; border: 3px solid #e7e5f7; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(30,30,45,.92); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; z-index: 999; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 86%; text-align: center; }
#toast.show { opacity: 1; }
.footer-note { text-align: center; color: #b0b4bf; font-size: 11px; padding: 20px; }
