chat.less 6.6 KB

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