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. console.error('计算MBTI结果失败:', error)
  276. uni.showToast({
  277. title: '计算结果失败',
  278. icon: 'error'
  279. })
  280. }
  281. },
  282. // 重新测试
  283. retakeTest() {
  284. this.currentStep = 'intro'
  285. this.currentQuestion = 1
  286. this.selectedAnswer = null
  287. this.answers = new Array(this.totalQuestions).fill(null)
  288. this.mbtiResult = null
  289. },
  290. // 分享结果
  291. shareResult() {
  292. uni.showActionSheet({
  293. itemList: ['保存图片', '分享给朋友', '复制结果'],
  294. success: (res) => {
  295. switch (res.tapIndex) {
  296. case 0:
  297. this.saveResultImage()
  298. break
  299. case 1:
  300. this.shareToFriend()
  301. break
  302. case 2:
  303. this.copyResult()
  304. break
  305. }
  306. }
  307. })
  308. },
  309. // 保存结果图片
  310. saveResultImage() {
  311. uni.showToast({
  312. title: '功能开发中',
  313. icon: 'none'
  314. })
  315. },
  316. // 分享给朋友
  317. shareToFriend() {
  318. uni.showToast({
  319. title: '功能开发中',
  320. icon: 'none'
  321. })
  322. },
  323. // 复制结果
  324. copyResult() {
  325. const resultText = `我的MBTI人格类型是:${this.mbtiResult.type} - ${this.mbtiResult.name}\n${this.mbtiResult.description}`
  326. uni.setClipboardData({
  327. data: resultText,
  328. success: () => {
  329. uni.showToast({
  330. title: '已复制到剪贴板',
  331. icon: 'success'
  332. })
  333. }
  334. })
  335. }
  336. }
  337. }
  338. </script>
  339. <style lang="scss" scoped>
  340. .mbti-page {
  341. min-height: 100vh;
  342. background: linear-gradient(180deg, #F8F9FA 0%, #FFFFFF 100%);
  343. }
  344. /* 自定义导航栏 */
  345. .custom-nav {
  346. position: relative;
  347. display: flex;
  348. align-items: center;
  349. justify-content: space-between;
  350. height: 88rpx;
  351. padding: 0 30rpx;
  352. background-color: #FFFFFF;
  353. border-bottom: 1rpx solid #F0F0F0;
  354. .nav-left {
  355. width: 80rpx;
  356. .back-icon {
  357. font-size: 40rpx;
  358. color: #333333;
  359. }
  360. }
  361. .nav-title {
  362. position: absolute;
  363. left: 50%;
  364. transform: translateX(-50%);
  365. font-size: 34rpx;
  366. font-weight: 600;
  367. color: #333333;
  368. }
  369. .nav-right {
  370. width: 80rpx;
  371. }
  372. }
  373. /* 介绍页面 */
  374. .intro-section {
  375. padding: 40rpx 30rpx;
  376. }
  377. .intro-header {
  378. text-align: center;
  379. margin-bottom: 60rpx;
  380. .mbti-logo {
  381. font-size: 120rpx;
  382. margin-bottom: 30rpx;
  383. }
  384. .intro-title {
  385. font-size: 48rpx;
  386. font-weight: bold;
  387. color: #333333;
  388. margin-bottom: 15rpx;
  389. }
  390. .intro-subtitle {
  391. font-size: 28rpx;
  392. color: #666666;
  393. line-height: 1.6;
  394. }
  395. }
  396. .intro-content {
  397. .feature-list {
  398. margin-bottom: 50rpx;
  399. .feature-item {
  400. display: flex;
  401. align-items: center;
  402. background-color: #FFFFFF;
  403. border-radius: 20rpx;
  404. padding: 30rpx;
  405. margin-bottom: 20rpx;
  406. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  407. .feature-icon {
  408. font-size: 50rpx;
  409. margin-right: 25rpx;
  410. }
  411. .feature-text {
  412. flex: 1;
  413. .feature-title {
  414. display: block;
  415. font-size: 32rpx;
  416. font-weight: 600;
  417. color: #333333;
  418. margin-bottom: 8rpx;
  419. }
  420. .feature-desc {
  421. font-size: 26rpx;
  422. color: #666666;
  423. }
  424. }
  425. }
  426. }
  427. .test-info {
  428. background-color: #FFFFFF;
  429. border-radius: 20rpx;
  430. padding: 30rpx;
  431. margin-bottom: 40rpx;
  432. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  433. .info-item {
  434. display: flex;
  435. justify-content: space-between;
  436. align-items: center;
  437. margin-bottom: 20rpx;
  438. &:last-child {
  439. margin-bottom: 0;
  440. }
  441. .info-label {
  442. font-size: 28rpx;
  443. color: #666666;
  444. }
  445. .info-value {
  446. font-size: 28rpx;
  447. font-weight: 600;
  448. color: #333333;
  449. }
  450. }
  451. }
  452. .start-btn {
  453. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  454. border-radius: 50rpx;
  455. height: 100rpx;
  456. display: flex;
  457. align-items: center;
  458. justify-content: center;
  459. margin-bottom: 30rpx;
  460. box-shadow: 0 8rpx 20rpx rgba(102, 126, 234, 0.3);
  461. transition: transform 0.2s;
  462. &:active {
  463. transform: scale(0.98);
  464. }
  465. .btn-text {
  466. font-size: 32rpx;
  467. font-weight: 600;
  468. color: #FFFFFF;
  469. }
  470. }
  471. .tips {
  472. text-align: center;
  473. .tips-text {
  474. font-size: 24rpx;
  475. color: #999999;
  476. }
  477. }
  478. }
  479. /* 测试进行页面 */
  480. .testing-section {
  481. padding: 30rpx;
  482. }
  483. .progress-bar {
  484. background-color: #FFFFFF;
  485. border-radius: 15rpx;
  486. padding: 25rpx;
  487. margin-bottom: 30rpx;
  488. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  489. .progress-bg {
  490. height: 12rpx;
  491. background-color: #F0F0F0;
  492. border-radius: 6rpx;
  493. overflow: hidden;
  494. margin-bottom: 15rpx;
  495. .progress-fill {
  496. height: 100%;
  497. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  498. border-radius: 6rpx;
  499. transition: width 0.3s ease;
  500. }
  501. }
  502. .progress-text {
  503. text-align: center;
  504. font-size: 26rpx;
  505. color: #666666;
  506. }
  507. }
  508. .question-card {
  509. background-color: #FFFFFF;
  510. border-radius: 20rpx;
  511. padding: 40rpx;
  512. margin-bottom: 30rpx;
  513. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  514. .question-number {
  515. font-size: 24rpx;
  516. color: #999999;
  517. margin-bottom: 15rpx;
  518. }
  519. .question-text {
  520. font-size: 32rpx;
  521. color: #333333;
  522. line-height: 1.6;
  523. margin-bottom: 40rpx;
  524. font-weight: 500;
  525. }
  526. }
  527. .options-list {
  528. .option-item {
  529. display: flex;
  530. align-items: center;
  531. background-color: #F8F9FA;
  532. border-radius: 15rpx;
  533. padding: 25rpx;
  534. margin-bottom: 15rpx;
  535. transition: all 0.2s;
  536. &.selected {
  537. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  538. color: #FFFFFF;
  539. }
  540. &:last-child {
  541. margin-bottom: 0;
  542. }
  543. .option-marker {
  544. width: 50rpx;
  545. height: 50rpx;
  546. border-radius: 50%;
  547. background-color: rgba(255, 255, 255, 0.2);
  548. display: flex;
  549. align-items: center;
  550. justify-content: center;
  551. margin-right: 20rpx;
  552. font-weight: 600;
  553. }
  554. .option-text {
  555. flex: 1;
  556. font-size: 28rpx;
  557. line-height: 1.5;
  558. }
  559. }
  560. }
  561. .scale-options {
  562. .scale-labels {
  563. display: flex;
  564. justify-content: space-between;
  565. margin-bottom: 30rpx;
  566. .scale-label {
  567. font-size: 24rpx;
  568. color: #666666;
  569. }
  570. }
  571. .scale-buttons {
  572. display: flex;
  573. justify-content: space-between;
  574. .scale-btn {
  575. width: 80rpx;
  576. height: 80rpx;
  577. border-radius: 50%;
  578. background-color: #F0F0F0;
  579. display: flex;
  580. align-items: center;
  581. justify-content: center;
  582. font-size: 28rpx;
  583. font-weight: 600;
  584. color: #666666;
  585. transition: all 0.2s;
  586. &.selected {
  587. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  588. color: #FFFFFF;
  589. }
  590. }
  591. }
  592. }
  593. .action-buttons {
  594. display: flex;
  595. gap: 20rpx;
  596. .btn-secondary,
  597. .btn-primary {
  598. flex: 1;
  599. height: 80rpx;
  600. border-radius: 40rpx;
  601. display: flex;
  602. align-items: center;
  603. justify-content: center;
  604. font-size: 30rpx;
  605. font-weight: 600;
  606. transition: all 0.2s;
  607. &:active {
  608. transform: scale(0.98);
  609. }
  610. }
  611. .btn-secondary {
  612. background-color: #F8F9FA;
  613. color: #666666;
  614. border: 2rpx solid #E9ECEF;
  615. }
  616. .btn-primary {
  617. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  618. color: #FFFFFF;
  619. box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
  620. &.disabled {
  621. background: #CCCCCC;
  622. box-shadow: none;
  623. pointer-events: none;
  624. }
  625. }
  626. }
  627. /* 结果页面 */
  628. .result-section {
  629. padding: 30rpx;
  630. }
  631. .result-header {
  632. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  633. border-radius: 20rpx;
  634. padding: 40rpx;
  635. text-align: center;
  636. color: #FFFFFF;
  637. margin-bottom: 30rpx;
  638. box-shadow: 0 8rpx 20rpx rgba(102, 126, 234, 0.3);
  639. .result-type {
  640. font-size: 60rpx;
  641. font-weight: bold;
  642. margin-bottom: 15rpx;
  643. }
  644. .result-name {
  645. font-size: 36rpx;
  646. font-weight: 600;
  647. margin-bottom: 20rpx;
  648. }
  649. .result-desc {
  650. font-size: 26rpx;
  651. line-height: 1.6;
  652. opacity: 0.9;
  653. }
  654. }
  655. .result-details {
  656. background-color: #FFFFFF;
  657. border-radius: 20rpx;
  658. padding: 30rpx;
  659. margin-bottom: 30rpx;
  660. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.06);
  661. .section-title {
  662. font-size: 32rpx;
  663. font-weight: 600;
  664. color: #333333;
  665. margin-bottom: 25rpx;
  666. }
  667. }
  668. .dimensions {
  669. margin-bottom: 40rpx;
  670. .dimension-item {
  671. margin-bottom: 30rpx;
  672. &:last-child {
  673. margin-bottom: 0;
  674. }
  675. .dim-header {
  676. display: flex;
  677. justify-content: space-between;
  678. align-items: center;
  679. margin-bottom: 10rpx;
  680. .dim-name {
  681. font-size: 28rpx;
  682. color: #333333;
  683. }
  684. .dim-percent {
  685. font-size: 28rpx;
  686. font-weight: 600;
  687. color: #667eea;
  688. }
  689. }
  690. .dim-bar {
  691. height: 12rpx;
  692. background-color: #F0F0F0;
  693. border-radius: 6rpx;
  694. overflow: hidden;
  695. margin-bottom: 10rpx;
  696. .dim-fill {
  697. height: 100%;
  698. border-radius: 6rpx;
  699. transition: width 0.6s ease;
  700. }
  701. }
  702. .dim-desc {
  703. font-size: 24rpx;
  704. color: #666666;
  705. line-height: 1.4;
  706. }
  707. }
  708. }
  709. .traits-section,
  710. .careers-section {
  711. margin-bottom: 40rpx;
  712. .traits-list,
  713. .careers-list {
  714. display: flex;
  715. flex-wrap: wrap;
  716. gap: 10rpx;
  717. .trait-item,
  718. .career-item {
  719. padding: 10rpx 20rpx;
  720. background-color: #F8F9FA;
  721. border-radius: 20rpx;
  722. font-size: 24rpx;
  723. color: #333333;
  724. }
  725. }
  726. }
  727. .love-section {
  728. margin-bottom: 40rpx;
  729. .love-content {
  730. font-size: 28rpx;
  731. color: #333333;
  732. line-height: 1.6;
  733. }
  734. }
  735. .compatibility-section {
  736. .compatibility-types {
  737. display: flex;
  738. flex-wrap: wrap;
  739. gap: 15rpx;
  740. .compat-type {
  741. padding: 15rpx 25rpx;
  742. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  743. color: #FFFFFF;
  744. border-radius: 25rpx;
  745. font-size: 26rpx;
  746. font-weight: 600;
  747. }
  748. }
  749. }
  750. .result-actions {
  751. display: flex;
  752. gap: 20rpx;
  753. .btn-secondary,
  754. .btn-primary {
  755. flex: 1;
  756. height: 80rpx;
  757. border-radius: 40rpx;
  758. display: flex;
  759. align-items: center;
  760. justify-content: center;
  761. font-size: 30rpx;
  762. font-weight: 600;
  763. transition: all 0.2s;
  764. &:active {
  765. transform: scale(0.98);
  766. }
  767. }
  768. .btn-secondary {
  769. background-color: #F8F9FA;
  770. color: #666666;
  771. border: 2rpx solid #E9ECEF;
  772. }
  773. .btn-primary {
  774. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  775. color: #FFFFFF;
  776. box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
  777. }
  778. }
  779. </style>