mbti.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  1. <template>
  2. <view class="mbti-page">
  3. <!-- 自定义顶部导航栏 -->
  4. <view class="custom-nav">
  5. <view class="nav-left" @click="goBack">
  6. <text class="back-icon">←</text>
  7. </view>
  8. <view class="nav-title">MBTI人格测试</view>
  9. <view class="nav-right"></view>
  10. </view>
  11. <!-- 测试说明页面 -->
  12. <view v-if="currentStep === 'intro'" class="intro-section">
  13. <view class="intro-header">
  14. <view class="mbti-logo">🧩</view>
  15. <view class="intro-title">MBTI人格类型测试</view>
  16. <view class="intro-subtitle">发现真实的自己,了解你的人格类型</view>
  17. </view>
  18. <view class="intro-content">
  19. <view class="feature-list">
  20. <view class="feature-item">
  21. <view class="feature-icon">🎯</view>
  22. <view class="feature-text">
  23. <text class="feature-title">科学准确</text>
  24. <text class="feature-desc">基于心理学理论的专业测评</text>
  25. </view>
  26. </view>
  27. <view class="feature-item">
  28. <view class="feature-icon">⏱️</view>
  29. <view class="feature-text">
  30. <text class="feature-title">快速便捷</text>
  31. <text class="feature-desc">仅需5-10分钟完成测试</text>
  32. </view>
  33. </view>
  34. <view class="feature-item">
  35. <view class="feature-icon">📊</view>
  36. <view class="feature-text">
  37. <text class="feature-title">详细报告</text>
  38. <text class="feature-desc">获得专业的人格分析报告</text>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="test-info">
  43. <view class="info-item">
  44. <text class="info-label">测试题数:</text>
  45. <text class="info-value">{{ totalQuestions }}道题</text>
  46. </view>
  47. <view class="info-item">
  48. <text class="info-label">测试时间:</text>
  49. <text class="info-value">约5-10分钟</text>
  50. </view>
  51. <view class="info-item">
  52. <text class="info-label">测试人数:</text>
  53. <text class="info-value">已有{{ testCount }}人测试</text>
  54. </view>
  55. </view>
  56. <view class="start-btn" @click="startTest">
  57. <text class="btn-text">开始测试</text>
  58. </view>
  59. <view class="tips">
  60. <text class="tips-text">💡 请根据真实想法作答,无标准答案</text>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 测试进行页面 -->
  65. <view v-if="currentStep === 'testing'" class="testing-section">
  66. <!-- 进度条 -->
  67. <view class="progress-bar">
  68. <view class="progress-bg">
  69. <view class="progress-fill" :style="{width: progressPercent + '%'}"></view>
  70. </view>
  71. <view class="progress-text">{{ currentQuestion }}/{{ totalQuestions }}</view>
  72. </view>
  73. <!-- 题目内容 -->
  74. <view class="question-card">
  75. <view class="question-number">第{{ currentQuestion }}题</view>
  76. <view class="question-text">{{ currentQuestionData.question }}</view>
  77. <!-- 选择题选项 -->
  78. <view v-if="currentQuestionData.type === 'choice'" class="options-list">
  79. <view
  80. v-for="(option, index) in currentQuestionData.options"
  81. :key="index"
  82. class="option-item"
  83. :class="{'selected': selectedAnswer === index}"
  84. @click="selectAnswer(index)"
  85. >
  86. <view class="option-marker">{{ String.fromCharCode(65 + index) }}</view>
  87. <view class="option-text">{{ option.text }}</view>
  88. </view>
  89. </view>
  90. <!-- 量表题选项 -->
  91. <view v-if="currentQuestionData.type === 'scale'" class="scale-options">
  92. <view class="scale-labels">
  93. <text class="scale-label">非常不同意</text>
  94. <text class="scale-label">非常同意</text>
  95. </view>
  96. <view class="scale-buttons">
  97. <view
  98. v-for="(score, index) in [1,2,3,4,5]"
  99. :key="index"
  100. class="scale-btn"
  101. :class="{'selected': selectedAnswer === score}"
  102. @click="selectAnswer(score)"
  103. >
  104. {{ score }}
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. <!-- 操作按钮 -->
  110. <view class="action-buttons">
  111. <view class="btn-secondary" @click="previousQuestion" v-if="currentQuestion > 1">
  112. 上一题
  113. </view>
  114. <view class="btn-primary" @click="nextQuestion" :class="{'disabled': selectedAnswer === null}">
  115. {{ currentQuestion === totalQuestions ? '完成测试' : '下一题' }}
  116. </view>
  117. </view>
  118. </view>
  119. <!-- 结果页面 -->
  120. <view v-if="currentStep === 'result'" class="result-section">
  121. <view class="result-header">
  122. <view class="result-type">{{ mbtiResult.type }}</view>
  123. <view class="result-name">{{ mbtiResult.name }}</view>
  124. <view class="result-desc">{{ mbtiResult.description }}</view>
  125. </view>
  126. <view class="result-details">
  127. <!-- 四个维度分析 -->
  128. <view class="dimensions">
  129. <view class="dimension-item" v-for="(dim, index) in mbtiResult.dimensions" :key="index">
  130. <view class="dim-header">
  131. <text class="dim-name">{{ dim.name }}</text>
  132. <text class="dim-percent">{{ dim.percent }}%</text>
  133. </view>
  134. <view class="dim-bar">
  135. <view class="dim-fill" :style="{width: dim.percent + '%', background: dim.color}"></view>
  136. </view>
  137. <view class="dim-desc">{{ dim.description }}</view>
  138. </view>
  139. </view>
  140. <!-- 性格特点 -->
  141. <view class="traits-section">
  142. <view class="section-title">💎 性格特点</view>
  143. <view class="traits-list">
  144. <text class="trait-item" v-for="(trait, index) in mbtiResult.traits" :key="index">
  145. {{ trait }}
  146. </text>
  147. </view>
  148. </view>
  149. <!-- 适合职业 -->
  150. <view class="careers-section">
  151. <view class="section-title">💼 适合职业</view>
  152. <view class="careers-list">
  153. <text class="career-item" v-for="(career, index) in mbtiResult.careers" :key="index">
  154. {{ career }}
  155. </text>
  156. </view>
  157. </view>
  158. <!-- 恋爱风格 -->
  159. <view class="love-section">
  160. <view class="section-title">💕 恋爱风格</view>
  161. <view class="love-content">{{ mbtiResult.loveStyle }}</view>
  162. </view>
  163. <!-- 匹配类型 -->
  164. <view class="compatibility-section">
  165. <view class="section-title">🔗 最佳配对</view>
  166. <view class="compatibility-types">
  167. <text class="compat-type" v-for="(type, index) in mbtiResult.compatibility" :key="index">
  168. {{ type }}
  169. </text>
  170. </view>
  171. </view>
  172. </view>
  173. <view class="result-actions">
  174. <view class="btn-secondary" @click="retakeTest">重新测试</view>
  175. <view class="btn-primary" @click="shareResult">分享结果</view>
  176. </view>
  177. </view>
  178. </view>
  179. </template>
  180. <script>
  181. import { MBTI_QUESTIONS, MBTI_TYPES, calculateMBTI } from '@/utils/mbti.js'
  182. export default {
  183. data() {
  184. return {
  185. currentStep: 'intro', // intro, testing, result
  186. currentQuestion: 1,
  187. totalQuestions: 0,
  188. selectedAnswer: null,
  189. answers: [],
  190. testCount: 15678,
  191. mbtiResult: null
  192. }
  193. },
  194. computed: {
  195. progressPercent() {
  196. return Math.round((this.currentQuestion / this.totalQuestions) * 100)
  197. },
  198. currentQuestionData() {
  199. return MBTI_QUESTIONS[this.currentQuestion - 1] || {}
  200. }
  201. },
  202. onLoad() {
  203. this.initData()
  204. },
  205. methods: {
  206. // 初始化数据
  207. initData() {
  208. this.totalQuestions = MBTI_QUESTIONS.length
  209. this.answers = new Array(this.totalQuestions).fill(null)
  210. },
  211. // 返回上一页
  212. goBack() {
  213. if (this.currentStep === 'testing' && this.currentQuestion > 1) {
  214. // 测试中显示确认弹窗
  215. uni.showModal({
  216. title: '提示',
  217. content: '测试还未完成,确定要退出吗?',
  218. success: (res) => {
  219. if (res.confirm) {
  220. uni.navigateBack()
  221. }
  222. }
  223. })
  224. } else {
  225. uni.navigateBack()
  226. }
  227. },
  228. // 开始测试
  229. startTest() {
  230. this.currentStep = 'testing'
  231. this.currentQuestion = 1
  232. this.selectedAnswer = this.answers[0]
  233. },
  234. // 选择答案
  235. selectAnswer(answer) {
  236. this.selectedAnswer = answer
  237. this.answers[this.currentQuestion - 1] = answer
  238. },
  239. // 下一题
  240. nextQuestion() {
  241. if (this.selectedAnswer === null) {
  242. uni.showToast({
  243. title: '请选择一个选项',
  244. icon: 'none'
  245. })
  246. return
  247. }
  248. // 保存当前答案
  249. this.answers[this.currentQuestion - 1] = this.selectedAnswer
  250. if (this.currentQuestion === this.totalQuestions) {
  251. // 完成测试,计算结果
  252. this.calculateResult()
  253. } else {
  254. // 下一题
  255. this.currentQuestion++
  256. this.selectedAnswer = this.answers[this.currentQuestion - 1]
  257. }
  258. },
  259. // 上一题
  260. previousQuestion() {
  261. if (this.currentQuestion > 1) {
  262. this.currentQuestion--
  263. this.selectedAnswer = this.answers[this.currentQuestion - 1]
  264. }
  265. },
  266. // 计算测试结果
  267. calculateResult() {
  268. try {
  269. const mbtiType = calculateMBTI(this.answers)
  270. this.mbtiResult = MBTI_TYPES[mbtiType]
  271. this.currentStep = 'result'
  272. // 统计测试完成
  273. this.testCount++
  274. } catch (error) {
  275. uni.showToast({
  276. title: '计算结果失败',
  277. icon: 'error'
  278. })
  279. }
  280. },
  281. // 重新测试
  282. retakeTest() {
  283. this.currentStep = 'intro'
  284. this.currentQuestion = 1
  285. this.selectedAnswer = null
  286. this.answers = new Array(this.totalQuestions).fill(null)
  287. this.mbtiResult = null
  288. },
  289. // 分享结果
  290. shareResult() {
  291. uni.showActionSheet({
  292. itemList: ['保存图片', '分享给朋友', '复制结果'],
  293. success: (res) => {
  294. switch (res.tapIndex) {
  295. case 0:
  296. this.saveResultImage()
  297. break
  298. case 1:
  299. this.shareToFriend()
  300. break
  301. case 2:
  302. this.copyResult()
  303. break
  304. }
  305. }
  306. })
  307. },
  308. // 保存结果图片
  309. saveResultImage() {
  310. uni.showToast({
  311. title: '功能开发中',
  312. icon: 'none'
  313. })
  314. },
  315. // 分享给朋友
  316. shareToFriend() {
  317. uni.showToast({
  318. title: '功能开发中',
  319. icon: 'none'
  320. })
  321. },
  322. // 复制结果
  323. copyResult() {
  324. const resultText = `我的MBTI人格类型是:${this.mbtiResult.type} - ${this.mbtiResult.name}\n${this.mbtiResult.description}`
  325. uni.setClipboardData({
  326. data: resultText,
  327. success: () => {
  328. uni.showToast({
  329. title: '已复制到剪贴板',
  330. icon: 'success'
  331. })
  332. }
  333. })
  334. }
  335. }
  336. }
  337. </script>
  338. <style lang="scss" scoped>
  339. .mbti-page {
  340. min-height: 100vh;
  341. background: linear-gradient(180deg, #F8F9FA 0%, #FFFFFF 100%);
  342. }
  343. /* 自定义导航栏 */
  344. .custom-nav {
  345. position: relative;
  346. display: flex;
  347. align-items: center;
  348. justify-content: space-between;
  349. height: 88rpx;
  350. padding: 0 30rpx;
  351. background-color: #FFFFFF;
  352. border-bottom: 1rpx solid #F0F0F0;
  353. .nav-left {
  354. width: 80rpx;
  355. .back-icon {
  356. font-size: 40rpx;
  357. color: #333333;
  358. }
  359. }
  360. .nav-title {
  361. position: absolute;
  362. left: 50%;
  363. transform: translateX(-50%);
  364. font-size: 34rpx;
  365. font-weight: 600;
  366. color: #333333;
  367. }
  368. .nav-right {
  369. width: 80rpx;
  370. }
  371. }
  372. /* 介绍页面 */
  373. .intro-section {
  374. padding: 40rpx 30rpx;
  375. }
  376. .intro-header {
  377. text-align: center;
  378. margin-bottom: 60rpx;
  379. .mbti-logo {
  380. font-size: 120rpx;
  381. margin-bottom: 30rpx;
  382. }
  383. .intro-title {
  384. font-size: 48rpx;
  385. font-weight: bold;
  386. color: #333333;
  387. margin-bottom: 15rpx;
  388. }
  389. .intro-subtitle {
  390. font-size: 28rpx;
  391. color: #666666;
  392. line-height: 1.6;
  393. }
  394. }
  395. .intro-content {
  396. .feature-list {
  397. margin-bottom: 50rpx;
  398. .feature-item {
  399. display: flex;
  400. align-items: center;
  401. background-color: #FFFFFF;
  402. border-radius: 20rpx;
  403. padding: 30rpx;
  404. margin-bottom: 20rpx;
  405. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  406. .feature-icon {
  407. font-size: 50rpx;
  408. margin-right: 25rpx;
  409. }
  410. .feature-text {
  411. flex: 1;
  412. .feature-title {
  413. display: block;
  414. font-size: 32rpx;
  415. font-weight: 600;
  416. color: #333333;
  417. margin-bottom: 8rpx;
  418. }
  419. .feature-desc {
  420. font-size: 26rpx;
  421. color: #666666;
  422. }
  423. }
  424. }
  425. }
  426. .test-info {
  427. background-color: #FFFFFF;
  428. border-radius: 20rpx;
  429. padding: 30rpx;
  430. margin-bottom: 40rpx;
  431. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  432. .info-item {
  433. display: flex;
  434. justify-content: space-between;
  435. align-items: center;
  436. margin-bottom: 20rpx;
  437. &:last-child {
  438. margin-bottom: 0;
  439. }
  440. .info-label {
  441. font-size: 28rpx;
  442. color: #666666;
  443. }
  444. .info-value {
  445. font-size: 28rpx;
  446. font-weight: 600;
  447. color: #333333;
  448. }
  449. }
  450. }
  451. .start-btn {
  452. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  453. border-radius: 50rpx;
  454. height: 100rpx;
  455. display: flex;
  456. align-items: center;
  457. justify-content: center;
  458. margin-bottom: 30rpx;
  459. box-shadow: 0 8rpx 20rpx rgba(102, 126, 234, 0.3);
  460. transition: transform 0.2s;
  461. &:active {
  462. transform: scale(0.98);
  463. }
  464. .btn-text {
  465. font-size: 32rpx;
  466. font-weight: 600;
  467. color: #FFFFFF;
  468. }
  469. }
  470. .tips {
  471. text-align: center;
  472. .tips-text {
  473. font-size: 24rpx;
  474. color: #999999;
  475. }
  476. }
  477. }
  478. /* 测试进行页面 */
  479. .testing-section {
  480. padding: 30rpx;
  481. }
  482. .progress-bar {
  483. background-color: #FFFFFF;
  484. border-radius: 15rpx;
  485. padding: 25rpx;
  486. margin-bottom: 30rpx;
  487. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  488. .progress-bg {
  489. height: 12rpx;
  490. background-color: #F0F0F0;
  491. border-radius: 6rpx;
  492. overflow: hidden;
  493. margin-bottom: 15rpx;
  494. .progress-fill {
  495. height: 100%;
  496. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  497. border-radius: 6rpx;
  498. transition: width 0.3s ease;
  499. }
  500. }
  501. .progress-text {
  502. text-align: center;
  503. font-size: 26rpx;
  504. color: #666666;
  505. }
  506. }
  507. .question-card {
  508. background-color: #FFFFFF;
  509. border-radius: 20rpx;
  510. padding: 40rpx;
  511. margin-bottom: 30rpx;
  512. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  513. .question-number {
  514. font-size: 24rpx;
  515. color: #999999;
  516. margin-bottom: 15rpx;
  517. }
  518. .question-text {
  519. font-size: 32rpx;
  520. color: #333333;
  521. line-height: 1.6;
  522. margin-bottom: 40rpx;
  523. font-weight: 500;
  524. }
  525. }
  526. .options-list {
  527. .option-item {
  528. display: flex;
  529. align-items: center;
  530. background-color: #F8F9FA;
  531. border-radius: 15rpx;
  532. padding: 25rpx;
  533. margin-bottom: 15rpx;
  534. transition: all 0.2s;
  535. &.selected {
  536. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  537. color: #FFFFFF;
  538. }
  539. &:last-child {
  540. margin-bottom: 0;
  541. }
  542. .option-marker {
  543. width: 50rpx;
  544. height: 50rpx;
  545. border-radius: 50%;
  546. background-color: rgba(255, 255, 255, 0.2);
  547. display: flex;
  548. align-items: center;
  549. justify-content: center;
  550. margin-right: 20rpx;
  551. font-weight: 600;
  552. }
  553. .option-text {
  554. flex: 1;
  555. font-size: 28rpx;
  556. line-height: 1.5;
  557. }
  558. }
  559. }
  560. .scale-options {
  561. .scale-labels {
  562. display: flex;
  563. justify-content: space-between;
  564. margin-bottom: 30rpx;
  565. .scale-label {
  566. font-size: 24rpx;
  567. color: #666666;
  568. }
  569. }
  570. .scale-buttons {
  571. display: flex;
  572. justify-content: space-between;
  573. .scale-btn {
  574. width: 80rpx;
  575. height: 80rpx;
  576. border-radius: 50%;
  577. background-color: #F0F0F0;
  578. display: flex;
  579. align-items: center;
  580. justify-content: center;
  581. font-size: 28rpx;
  582. font-weight: 600;
  583. color: #666666;
  584. transition: all 0.2s;
  585. &.selected {
  586. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  587. color: #FFFFFF;
  588. }
  589. }
  590. }
  591. }
  592. .action-buttons {
  593. display: flex;
  594. gap: 20rpx;
  595. .btn-secondary,
  596. .btn-primary {
  597. flex: 1;
  598. height: 80rpx;
  599. border-radius: 40rpx;
  600. display: flex;
  601. align-items: center;
  602. justify-content: center;
  603. font-size: 30rpx;
  604. font-weight: 600;
  605. transition: all 0.2s;
  606. &:active {
  607. transform: scale(0.98);
  608. }
  609. }
  610. .btn-secondary {
  611. background-color: #F8F9FA;
  612. color: #666666;
  613. border: 2rpx solid #E9ECEF;
  614. }
  615. .btn-primary {
  616. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  617. color: #FFFFFF;
  618. box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
  619. &.disabled {
  620. background: #CCCCCC;
  621. box-shadow: none;
  622. pointer-events: none;
  623. }
  624. }
  625. }
  626. /* 结果页面 */
  627. .result-section {
  628. padding: 30rpx;
  629. }
  630. .result-header {
  631. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  632. border-radius: 20rpx;
  633. padding: 40rpx;
  634. text-align: center;
  635. color: #FFFFFF;
  636. margin-bottom: 30rpx;
  637. box-shadow: 0 8rpx 20rpx rgba(102, 126, 234, 0.3);
  638. .result-type {
  639. font-size: 60rpx;
  640. font-weight: bold;
  641. margin-bottom: 15rpx;
  642. }
  643. .result-name {
  644. font-size: 36rpx;
  645. font-weight: 600;
  646. margin-bottom: 20rpx;
  647. }
  648. .result-desc {
  649. font-size: 26rpx;
  650. line-height: 1.6;
  651. opacity: 0.9;
  652. }
  653. }
  654. .result-details {
  655. background-color: #FFFFFF;
  656. border-radius: 20rpx;
  657. padding: 30rpx;
  658. margin-bottom: 30rpx;
  659. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  660. .section-title {
  661. font-size: 32rpx;
  662. font-weight: 600;
  663. color: #333333;
  664. margin-bottom: 25rpx;
  665. }
  666. }
  667. .dimensions {
  668. margin-bottom: 40rpx;
  669. .dimension-item {
  670. margin-bottom: 30rpx;
  671. &:last-child {
  672. margin-bottom: 0;
  673. }
  674. .dim-header {
  675. display: flex;
  676. justify-content: space-between;
  677. align-items: center;
  678. margin-bottom: 10rpx;
  679. .dim-name {
  680. font-size: 28rpx;
  681. color: #333333;
  682. }
  683. .dim-percent {
  684. font-size: 28rpx;
  685. font-weight: 600;
  686. color: #667eea;
  687. }
  688. }
  689. .dim-bar {
  690. height: 12rpx;
  691. background-color: #F0F0F0;
  692. border-radius: 6rpx;
  693. overflow: hidden;
  694. margin-bottom: 10rpx;
  695. .dim-fill {
  696. height: 100%;
  697. border-radius: 6rpx;
  698. transition: width 0.6s ease;
  699. }
  700. }
  701. .dim-desc {
  702. font-size: 24rpx;
  703. color: #666666;
  704. line-height: 1.4;
  705. }
  706. }
  707. }
  708. .traits-section,
  709. .careers-section {
  710. margin-bottom: 40rpx;
  711. .traits-list,
  712. .careers-list {
  713. display: flex;
  714. flex-wrap: wrap;
  715. gap: 10rpx;
  716. .trait-item,
  717. .career-item {
  718. padding: 10rpx 20rpx;
  719. background-color: #F8F9FA;
  720. border-radius: 20rpx;
  721. font-size: 24rpx;
  722. color: #333333;
  723. }
  724. }
  725. }
  726. .love-section {
  727. margin-bottom: 40rpx;
  728. .love-content {
  729. font-size: 28rpx;
  730. color: #333333;
  731. line-height: 1.6;
  732. }
  733. }
  734. .compatibility-section {
  735. .compatibility-types {
  736. display: flex;
  737. flex-wrap: wrap;
  738. gap: 15rpx;
  739. .compat-type {
  740. padding: 15rpx 25rpx;
  741. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  742. color: #FFFFFF;
  743. border-radius: 25rpx;
  744. font-size: 26rpx;
  745. font-weight: 600;
  746. }
  747. }
  748. }
  749. .result-actions {
  750. display: flex;
  751. gap: 20rpx;
  752. .btn-secondary,
  753. .btn-primary {
  754. flex: 1;
  755. height: 80rpx;
  756. border-radius: 40rpx;
  757. display: flex;
  758. align-items: center;
  759. justify-content: center;
  760. font-size: 30rpx;
  761. font-weight: 600;
  762. transition: all 0.2s;
  763. &:active {
  764. transform: scale(0.98);
  765. }
  766. }
  767. .btn-secondary {
  768. background-color: #F8F9FA;
  769. color: #666666;
  770. border: 2rpx solid #E9ECEF;
  771. }
  772. .btn-primary {
  773. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  774. color: #FFFFFF;
  775. box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
  776. }
  777. }
  778. </style>