chat.less 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. /* 背景图 - 使用image组件实现 */
  2. .bg-image {
  3. position: fixed;
  4. top: 0;
  5. left: 0;
  6. width: 100%;
  7. height: 100%;
  8. z-index: -1;
  9. }
  10. page {
  11. background: linear-gradient(180deg, #E8F4FC 0%, #F5F9FC 100%);
  12. height: 100%;
  13. overflow: hidden;
  14. }
  15. .chat-container {
  16. position: fixed;
  17. top: 0;
  18. left: 0;
  19. right: 0;
  20. bottom: 0;
  21. display: flex;
  22. flex-direction: column;
  23. box-sizing: border-box;
  24. padding-top: 88px;
  25. }
  26. /* 聊天滚动区域 - 固定定位,不随键盘变化 */
  27. .chat-scroll {
  28. position: fixed;
  29. top: 88px;
  30. left: 0;
  31. right: 0;
  32. bottom: 120rpx;
  33. padding-bottom: env(safe-area-inset-bottom);
  34. overflow-y: auto;
  35. }
  36. .message-list {
  37. padding: 24rpx 24rpx;
  38. }
  39. .message-row {
  40. display: flex;
  41. margin-bottom: 32rpx;
  42. align-items: flex-start;
  43. }
  44. .ai-row {
  45. justify-content: flex-start;
  46. }
  47. .user-row {
  48. justify-content: flex-end;
  49. }
  50. /* AI头像 */
  51. .avatar {
  52. width: 80rpx;
  53. height: 80rpx;
  54. border-radius: 50%;
  55. flex-shrink: 0;
  56. display: flex;
  57. align-items: center;
  58. justify-content: center;
  59. overflow: hidden;
  60. }
  61. .ai-avatar {
  62. margin-right: 24rpx;
  63. background: linear-gradient(135deg, #42A5F5 0%, #64B5F6 100%);
  64. border: 4rpx solid #fff;
  65. box-shadow: 0 4rpx 16rpx rgba(66, 165, 245, 0.3);
  66. }
  67. .ai-avatar-image {
  68. width: 100%;
  69. height: 100%;
  70. object-fit: contain;
  71. }
  72. .avatar-fallback {
  73. color: #fff;
  74. font-size: 24rpx;
  75. font-weight: 600;
  76. }
  77. .user-avatar {
  78. margin-left: 24rpx;
  79. background: linear-gradient(135deg, #66BB6A 0%, #81C784 100%);
  80. border: 4rpx solid #fff;
  81. box-shadow: 0 4rpx 16rpx rgba(102, 187, 106, 0.3);
  82. }
  83. .avatar-text {
  84. color: #fff;
  85. font-size: 24rpx;
  86. font-weight: 600;
  87. }
  88. .message-content {
  89. max-width: 75%;
  90. }
  91. /* AI消息气泡 - 白色 */
  92. .bubble {
  93. padding: 20rpx 24rpx;
  94. border-radius: 24rpx;
  95. word-wrap: break-word;
  96. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.08);
  97. }
  98. .ai-bubble {
  99. background-color: #FFFFFF;
  100. }
  101. /* 用户消息气泡 - 微信蓝 */
  102. .user-bubble {
  103. background-color: #0F85FF;
  104. color: #FFFFFF;
  105. }
  106. .message-text {
  107. font-size: 30rpx;
  108. line-height: 44rpx;
  109. color: rgba(19, 20, 21, 1);
  110. }
  111. .user-bubble .message-text {
  112. color: #FFFFFF;
  113. }
  114. /* FAQ卡片单独显示时的样式(不带头像) */
  115. .faq-row {
  116. justify-content: center;
  117. }
  118. .faq-content-full {
  119. max-width: 100%;
  120. width: 100%;
  121. }
  122. /* FAQ卡片 - 参考蓝湖 block_2 */
  123. .faq-card {
  124. background-color: rgba(255, 255, 255, 0.5);
  125. border-radius: 32rpx;
  126. padding: 26rpx 24rpx;
  127. border: 2rpx solid rgba(255, 255, 255, 1);
  128. box-shadow: 0 8rpx 40rpx rgba(118, 167, 206, 0.1);
  129. }
  130. .faq-header {
  131. display: flex;
  132. align-items: center;
  133. margin-bottom: 26rpx;
  134. }
  135. .faq-header-img {
  136. width: 138rpx;
  137. height: 32rpx;
  138. margin-right: 16rpx;
  139. }
  140. .faq-header-icon {
  141. width: 44rpx;
  142. height: 44rpx;
  143. background: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
  144. border-radius: 8rpx;
  145. display: flex;
  146. align-items: center;
  147. justify-content: center;
  148. margin-right: 16rpx;
  149. flex-shrink: 0;
  150. }
  151. .faq-header-icon-text {
  152. color: #fff;
  153. font-size: 22rpx;
  154. font-weight: 700;
  155. }
  156. .faq-title {
  157. font-size: 30rpx;
  158. font-weight: 500;
  159. color: rgba(19, 20, 21, 1);
  160. }
  161. /* FAQ问题列表 */
  162. .faq-list {
  163. display: flex;
  164. flex-direction: column;
  165. }
  166. /* FAQ问题项 - 参考蓝湖 list-items 药丸形状 */
  167. .faq-item {
  168. display: flex;
  169. align-items: center;
  170. padding: 22rpx 24rpx;
  171. background-color: #FFFFFF;
  172. border-radius: 132rpx;
  173. margin-bottom: 16rpx;
  174. }
  175. .faq-item:last-child {
  176. margin-bottom: 0;
  177. }
  178. .faq-item:active {
  179. transform: scale(0.98);
  180. background-color: #F5F9FC;
  181. }
  182. /* 问题图标图片 */
  183. .faq-icon-img {
  184. width: 32rpx;
  185. height: 32rpx;
  186. margin-right: 24rpx;
  187. flex-shrink: 0;
  188. }
  189. /* 问题图标 */
  190. .faq-icon {
  191. width: 32rpx;
  192. height: 32rpx;
  193. background: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
  194. border-radius: 8rpx;
  195. display: flex;
  196. align-items: center;
  197. justify-content: center;
  198. margin-right: 24rpx;
  199. flex-shrink: 0;
  200. }
  201. .faq-icon-text {
  202. color: #fff;
  203. font-size: 18rpx;
  204. font-weight: 700;
  205. }
  206. .faq-text {
  207. flex: 1;
  208. font-size: 28rpx;
  209. color: rgba(19, 20, 21, 1);
  210. font-weight: 400;
  211. white-space: nowrap;
  212. overflow: hidden;
  213. text-overflow: ellipsis;
  214. }
  215. /* 箭头图片 */
  216. .faq-arrow-img {
  217. width: 24rpx;
  218. height: 16rpx;
  219. margin-left: 8rpx;
  220. flex-shrink: 0;
  221. }
  222. .faq-arrow {
  223. font-size: 24rpx;
  224. color: rgba(19, 20, 21, 0.3);
  225. margin-left: 8rpx;
  226. }
  227. /* 用户图片 */
  228. .user-image {
  229. width: 360rpx;
  230. border-radius: 24rpx;
  231. overflow: hidden;
  232. box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.1);
  233. }
  234. .user-image image {
  235. width: 100%;
  236. height: 360rpx;
  237. display: block;
  238. }
  239. /* 输入区域 - 固定在底部,跟随键盘移动 */
  240. .input-area {
  241. position: fixed;
  242. bottom: 0;
  243. left: 0;
  244. right: 0;
  245. padding: 20rpx 24rpx;
  246. padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  247. background: linear-gradient(180deg, rgba(245, 249, 252, 0.9) 0%, rgba(232, 244, 252, 0.95) 100%);
  248. z-index: 100;
  249. }
  250. .input-container {
  251. display: flex;
  252. align-items: center;
  253. }
  254. .input-wrapper {
  255. flex: 1;
  256. display: flex;
  257. align-items: center;
  258. background-color: #FFFFFF;
  259. border-radius: 86rpx;
  260. padding: 0 24rpx;
  261. height: 96rpx;
  262. border: 2rpx solid rgba(255, 255, 255, 1);
  263. box-sizing: border-box;
  264. }
  265. .voice-btn {
  266. width: 48rpx;
  267. height: 48rpx;
  268. display: flex;
  269. align-items: center;
  270. justify-content: center;
  271. margin-right: 12rpx;
  272. }
  273. .voice-icon {
  274. font-size: 32rpx;
  275. color: #666;
  276. }
  277. .voice-icon-img {
  278. width: 48rpx;
  279. height: 48rpx;
  280. margin-right: 12rpx;
  281. }
  282. .chat-input {
  283. flex: 1;
  284. height: 96rpx;
  285. line-height: 96rpx;
  286. font-size: 30rpx;
  287. color: rgba(19, 20, 21, 1);
  288. background: transparent;
  289. }
  290. .placeholder {
  291. color: rgba(19, 20, 21, 0.3);
  292. font-size: 30rpx;
  293. }
  294. /* 发送按钮 */
  295. .send-btn {
  296. width: 120rpx;
  297. height: 96rpx;
  298. display: flex;
  299. align-items: center;
  300. justify-content: center;
  301. background: linear-gradient(135deg, #42A5F5 0%, #2196F3 100%);
  302. border-radius: 86rpx;
  303. margin-left: 12rpx;
  304. }
  305. .send-btn-text {
  306. color: #FFFFFF;
  307. font-size: 30rpx;
  308. font-weight: 500;
  309. }
  310. /* 加载中状态 */
  311. .loading-row {
  312. align-items: center;
  313. }
  314. .loading-bubble {
  315. background-color: #FFFFFF;
  316. border-radius: 24rpx;
  317. padding: 20rpx 36rpx;
  318. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  319. }
  320. .loading-dots {
  321. display: flex;
  322. align-items: center;
  323. gap: 10rpx;
  324. }
  325. .dot {
  326. width: 14rpx;
  327. height: 14rpx;
  328. background: linear-gradient(135deg, #2196F3 0%, #42A5F5 100%);
  329. border-radius: 50%;
  330. animation: bounce 1.4s ease-in-out infinite both;
  331. }
  332. .dot:nth-child(1) {
  333. animation-delay: -0.32s;
  334. }
  335. .dot:nth-child(2) {
  336. animation-delay: -0.16s;
  337. }
  338. @keyframes bounce {
  339. 0%, 80%, 100% {
  340. transform: scale(0.6);
  341. opacity: 0.5;
  342. }
  343. 40% {
  344. transform: scale(1);
  345. opacity: 1;
  346. }
  347. }