index.wxss 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. /* 容器样式 */
  2. .container {
  3. position: relative;
  4. min-height: 100vh;
  5. background-color: #f5f5f5;
  6. overflow: hidden; /* 防止内容溢出 */
  7. }
  8. /* 聊天容器 */
  9. .chat-container {
  10. padding: 20rpx 30rpx;
  11. box-sizing: border-box;
  12. background-color: #f8f8f8;
  13. background-image: url('data:image/png;base64,');
  14. background-size: 300rpx;
  15. background-blend-mode: overlay;
  16. background-opacity: 0.05;
  17. -webkit-overflow-scrolling: touch; /* 增强iOS滚动体验 */
  18. }
  19. .chat-list {
  20. padding-bottom: 30rpx;
  21. }
  22. /* 消息项 */
  23. .message-item {
  24. display: flex;
  25. margin-bottom: 30rpx;
  26. position: relative;
  27. }
  28. .message-ai {
  29. justify-content: flex-start;
  30. }
  31. .message-user {
  32. justify-content: flex-end;
  33. }
  34. /* 头像 */
  35. .avatar-container {
  36. width: 90rpx;
  37. height: 90rpx;
  38. flex-shrink: 0;
  39. }
  40. .avatar {
  41. width: 90rpx;
  42. height: 90rpx;
  43. border-radius: 50%;
  44. background-color: #e0e0e0;
  45. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  46. object-fit: cover;
  47. }
  48. /* 消息内容 */
  49. .message-content {
  50. max-width: 70%;
  51. margin: 0 20rpx;
  52. display: flex;
  53. flex-direction: column;
  54. }
  55. .user-content {
  56. align-items: flex-end;
  57. }
  58. .message-bubble {
  59. padding: 24rpx;
  60. border-radius: 24rpx;
  61. position: relative;
  62. margin-bottom: 10rpx;
  63. word-wrap: break-word;
  64. min-width: 80rpx;
  65. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
  66. transition: all 0.3s ease;
  67. max-width: 100%;
  68. }
  69. .ai-bubble {
  70. background-color: #e8f5e9;
  71. border-top-left-radius: 4rpx;
  72. }
  73. .user-bubble {
  74. background-color: #e3f2fd;
  75. border-top-right-radius: 4rpx;
  76. }
  77. .message-text {
  78. font-size: 28rpx;
  79. color: #333;
  80. line-height: 1.5;
  81. word-break: break-all;
  82. }
  83. .message-time {
  84. font-size: 22rpx;
  85. color: #999;
  86. }
  87. /* 输入区域 */
  88. .input-container {
  89. position: fixed;
  90. bottom: 0;
  91. left: 0;
  92. right: 0;
  93. background-color: #fff;
  94. padding: 20rpx 30rpx;
  95. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
  96. display: flex;
  97. flex-direction: column;
  98. z-index: 10;
  99. }
  100. .input-wrapper {
  101. display: flex;
  102. align-items: flex-end;
  103. }
  104. .message-input {
  105. flex: 1;
  106. min-height: 70rpx;
  107. max-height: 120rpx;
  108. border-radius: 35rpx;
  109. background-color: #f5f5f5;
  110. padding: 15rpx 30rpx;
  111. font-size: 28rpx;
  112. color: #333;
  113. border: 1rpx solid #e0e0e0;
  114. line-height: 1.4;
  115. }
  116. .send-button {
  117. margin-left: 16rpx;
  118. width: 76rpx;
  119. height: 76rpx;
  120. border-radius: 50%;
  121. background-color: transparent;
  122. background-image: none;
  123. display: flex;
  124. align-items: center;
  125. justify-content: center;
  126. transition: all 0.2s ease;
  127. position: relative;
  128. align-self: center;
  129. }
  130. .send-button.disabled {
  131. background-color: transparent;
  132. background-image: none;
  133. opacity: 1;
  134. }
  135. .button-hover {
  136. transform: scale(0.95);
  137. }
  138. @keyframes pulse {
  139. 0% { transform: scale(1);
  140. }
  141. 50% { transform: scale(0.95);
  142. }
  143. 100% { transform: scale(1);
  144. }
  145. }
  146. .send-button:active:not(.disabled) {
  147. animation: pulse 0.3s ease-in-out;
  148. }
  149. /* 删除或注释掉之前的样式 */
  150. .send-icon {
  151. display: none;
  152. }
  153. .send-icon:before {
  154. display: none;
  155. }
  156. .send-icon-text {
  157. display: none;
  158. }
  159. /* 推荐问题区域 */
  160. .suggested-questions {
  161. display: flex;
  162. white-space: nowrap;
  163. margin-bottom: 15rpx;
  164. padding: 5rpx 0;
  165. }
  166. .question-chip {
  167. display: inline-block;
  168. padding: 12rpx 20rpx;
  169. margin-right: 15rpx;
  170. background-color: #e8f5e9;
  171. color: #4CAF50;
  172. font-size: 24rpx;
  173. border-radius: 30rpx;
  174. border: 1rpx solid #a5d6a7;
  175. }
  176. /* AI正在输入的样式 */
  177. .message-bubble.ai-bubble.typing {
  178. background-color: #f0f0f0;
  179. }
  180. .typing-indicator {
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. height: 40rpx;
  185. padding: 0 20rpx;
  186. }
  187. .typing-dot {
  188. width: 10rpx;
  189. height: 10rpx;
  190. margin: 0 5rpx;
  191. background-color: #4CAF50;
  192. border-radius: 50%;
  193. opacity: 0.5;
  194. animation: typingAnimation 1.4s infinite both;
  195. }
  196. .typing-dot:nth-child(2) {
  197. animation-delay: 0.2s;
  198. }
  199. .typing-dot:nth-child(3) {
  200. animation-delay: 0.4s;
  201. }
  202. @keyframes typingAnimation {
  203. 0% { opacity: 0.3; transform: translateY(0);
  204. }
  205. 50% { opacity: 1; transform: translateY(-5rpx);
  206. }
  207. 100% { opacity: 0.3; transform: translateY(0);
  208. }
  209. }
  210. /* 关键词高亮 */
  211. .message-text.highlight {
  212. color: #2E7D32;
  213. font-weight: 500;
  214. }
  215. /* 欢迎消息特殊样式 */
  216. .welcome {
  217. background-color: #e3f2fd !important;
  218. border-left: none !important;
  219. border-radius: 24rpx !important;
  220. }
  221. /* 日期分割线样式 */
  222. .date-separator {
  223. display: flex;
  224. align-items: center;
  225. justify-content: center;
  226. margin: 20rpx 0;
  227. }
  228. .date-separator text {
  229. background-color: rgba(0, 0, 0, 0.1);
  230. color: #666;
  231. font-size: 24rpx;
  232. padding: 4rpx 20rpx;
  233. border-radius: 20rpx;
  234. }
  235. /* 纸飞机图标 */
  236. .plane-svg {
  237. display: none;
  238. }
  239. .send-icon-image {
  240. width: 76rpx;
  241. height: 76rpx;
  242. }
  243. .material-icon {
  244. font-family: 'Material Icons';
  245. font-weight: normal;
  246. font-style: normal;
  247. font-size: 48rpx;
  248. line-height: 1;
  249. letter-spacing: normal;
  250. text-transform: none;
  251. display: inline-block;
  252. white-space: nowrap;
  253. word-wrap: normal;
  254. direction: ltr;
  255. -webkit-font-smoothing: antialiased;
  256. color: white;
  257. }
  258. /* 删除不需要的导航栏样式 */
  259. .custom-navbar {
  260. display: none;
  261. }
  262. .navbar-bg, .navbar-content, .navbar-left, .navbar-title, .navbar-right, .back-icon, .arrow-left {
  263. display: none;
  264. }