index.ttss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. /* 页面容器 - 符合抖音小程序视觉规范 */
  2. .container {
  3. min-height: 100vh;
  4. height: 100vh;
  5. background: #f8f9fa;
  6. box-sizing: border-box;
  7. display: flex;
  8. flex-direction: column;
  9. overflow: hidden;
  10. padding-bottom: 100rpx;
  11. }
  12. /* 顶部导航栏 */
  13. .nav-bar {
  14. height: 88rpx;
  15. background: #ffffff;
  16. border-bottom: 1rpx solid #e8e8e8;
  17. display: flex;
  18. align-items: center;
  19. justify-content: space-between;
  20. padding: 0 32rpx;
  21. flex-shrink: 0;
  22. }
  23. .nav-left {
  24. display: flex;
  25. align-items: center;
  26. }
  27. .nav-logo {
  28. width: 48rpx;
  29. height: 48rpx;
  30. border-radius: 8rpx;
  31. margin-right: 16rpx;
  32. }
  33. .nav-title {
  34. font-size: 32rpx;
  35. font-weight: 600;
  36. color: #1a1a1a;
  37. line-height: 1.2;
  38. }
  39. .nav-right {
  40. display: flex;
  41. align-items: center;
  42. }
  43. .nav-icon {
  44. font-size: 36rpx;
  45. color: #666666;
  46. padding: 8rpx;
  47. }
  48. /* 聊天消息区域 - 完全重写的滚动解决方案 */
  49. .chat-container {
  50. flex: 1;
  51. min-height: 0;
  52. background: #f8f9fa;
  53. padding: 24rpx 40rpx 40rpx 40rpx;
  54. overflow-y: auto;
  55. box-sizing: border-box;
  56. height: auto;
  57. -webkit-overflow-scrolling: touch; /* 添加iOS滚动惯性 */
  58. position: relative;
  59. }
  60. /* 消息项通用样式 */
  61. .message-item {
  62. display: flex;
  63. width: 100%;
  64. box-sizing: border-box;
  65. padding: 0;
  66. margin-bottom: 32rpx;
  67. animation: fadeIn 0.3s ease-out;
  68. }
  69. .message-left {
  70. justify-content: flex-start;
  71. }
  72. .message-right {
  73. justify-content: flex-end;
  74. padding-right: 0;
  75. }
  76. .message-center {
  77. justify-content: center;
  78. }
  79. /* 头像样式 - 彻底解决显示不全和边框遮挡问题 */
  80. .avatar {
  81. width: 60rpx; /* 稍微减小宽度,为边框留出更多空间 */
  82. height: 60rpx; /* 稍微减小高度,保持比例 */
  83. border-radius: 50%;
  84. background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  85. display: flex;
  86. align-items: center;
  87. justify-content: center;
  88. font-size: 30rpx; /* 相应调整字体大小 */
  89. color: #ffffff;
  90. flex-shrink: 0;
  91. margin: 0;
  92. z-index: 1; /* 避免头像压到固定输入区上层 */
  93. position: relative;
  94. overflow: hidden; /* 确保头像内容在容器内完整显示 */
  95. line-height: 60rpx; /* 让头像文字垂直居中完整显示 */
  96. min-width: 60rpx; /* 固定最小宽度 */
  97. min-height: 60rpx; /* 固定最小高度 */
  98. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1); /* 添加阴影增强可见性 */
  99. }
  100. .user-avatar {
  101. background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
  102. order: 2;
  103. }
  104. .message-left .avatar {
  105. margin-right: 12rpx;
  106. }
  107. .message-right .avatar {
  108. margin-left: 12rpx;
  109. }
  110. /* 消息内容区域 */
  111. .message-content {
  112. max-width: 440rpx;
  113. background: #ffffff;
  114. border-radius: 16rpx;
  115. padding: 20rpx 24rpx;
  116. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
  117. position: relative;
  118. }
  119. .message-right .message-content {
  120. background: #4facfe;
  121. }
  122. .message-right .message-content::before {
  123. content: '';
  124. position: absolute;
  125. right: -8rpx;
  126. top: 20rpx;
  127. width: 0;
  128. height: 0;
  129. border-left: 8rpx solid #4facfe;
  130. border-top: 8rpx solid transparent;
  131. border-bottom: 8rpx solid transparent;
  132. }
  133. .message-left .message-content::before {
  134. content: '';
  135. position: absolute;
  136. left: -8rpx;
  137. top: 20rpx;
  138. width: 0;
  139. height: 0;
  140. border-right: 8rpx solid #ffffff;
  141. border-top: 8rpx solid transparent;
  142. border-bottom: 8rpx solid transparent;
  143. }
  144. /* 消息文本 */
  145. .message-text {
  146. font-size: 28rpx;
  147. color: #1a1a1a;
  148. line-height: 1.5;
  149. word-break: break-word;
  150. /* 与输入框保持完全一致的字体渲染 */
  151. -webkit-font-smoothing: antialiased;
  152. -moz-osx-font-smoothing: grayscale;
  153. }
  154. .message-right .message-text {
  155. color: #ffffff;
  156. }
  157. /* 消息时间 */
  158. .message-time {
  159. font-size: 20rpx;
  160. color: #999999;
  161. margin-top: 8rpx;
  162. display: block;
  163. }
  164. .message-right .message-time {
  165. color: rgba(255, 255, 255, 0.8);
  166. text-align: right;
  167. }
  168. /* 提示消息 */
  169. .tip-content {
  170. background: rgba(255, 255, 255, 0.8);
  171. border-radius: 20rpx;
  172. padding: 12rpx 24rpx;
  173. backdrop-filter: blur(10rpx);
  174. }
  175. .tip-text {
  176. font-size: 24rpx;
  177. color: #666666;
  178. font-style: italic;
  179. }
  180. /* 底部区域:输入区 + 版权信息 */
  181. .bottom-section {
  182. flex-shrink: 0;
  183. background: #ffffff;
  184. border-top: 1rpx solid #e8e8e8;
  185. }
  186. /* 输入区域 */
  187. .input-container {
  188. background: #ffffff;
  189. padding: 20rpx 32rpx;
  190. position: relative;
  191. box-shadow: 0 -2rpx 12rpx rgba(0, 0, 0, 0.06);
  192. }
  193. .input-wrapper {
  194. background: #f8f9fa;
  195. border-radius: 24rpx;
  196. border: 1rpx solid #e8e8e8;
  197. position: relative;
  198. padding: 0;
  199. }
  200. .message-input {
  201. width: 100%;
  202. min-height: 120rpx;
  203. max-height: 200rpx;
  204. background: transparent;
  205. border: none;
  206. font-size: 28rpx; /* 与消息记录完全一致 */
  207. color: #1a1a1a; /* 与助手消息文本颜色完全一致 */
  208. line-height: 1.6; /* 优化行高 */
  209. padding: 16rpx 120rpx 40rpx 16rpx;
  210. resize: none;
  211. box-sizing: border-box;
  212. font-weight: 400; /* 确保字体权重一致 */
  213. /* 针对 textarea 原生组件的特殊优化 */
  214. -webkit-font-smoothing: antialiased;
  215. -moz-osx-font-smoothing: grayscale;
  216. }
  217. .message-input::placeholder {
  218. color: #999999;
  219. font-size: 28rpx;
  220. }
  221. /* 输入框内部元素 */
  222. .char-count-inside {
  223. position: absolute;
  224. bottom: 8rpx;
  225. right: 100rpx;
  226. font-size: 20rpx;
  227. color: #999999;
  228. z-index: 10;
  229. }
  230. .input-actions {
  231. position: absolute;
  232. bottom: 8rpx;
  233. right: 16rpx;
  234. display: flex;
  235. align-items: center;
  236. flex-shrink: 0;
  237. }
  238. .send-btn {
  239. width: 60rpx;
  240. height: 60rpx;
  241. border-radius: 50%;
  242. background: #e8e8e8;
  243. border: none;
  244. display: flex;
  245. align-items: center;
  246. justify-content: center;
  247. transition: all 0.3s ease;
  248. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  249. }
  250. .send-btn.active {
  251. background: #4facfe;
  252. box-shadow: 0 2rpx 12rpx rgba(79, 172, 254, 0.4);
  253. }
  254. .send-btn::after {
  255. border: none;
  256. }
  257. .send-icon {
  258. font-size: 28rpx;
  259. color: #ffffff;
  260. transform: rotate(225deg);
  261. display: block;
  262. }
  263. .send-btn:not(.active) .send-icon {
  264. color: #999999;
  265. }
  266. .send-btn:not(.active) {
  267. background: #e8e8e8;
  268. }
  269. .send-btn:active {
  270. transform: scale(0.95);
  271. }
  272. /* 加载状态 */
  273. .loading-container {
  274. position: fixed;
  275. top: 0;
  276. left: 0;
  277. right: 0;
  278. bottom: 0;
  279. background: rgba(0, 0, 0, 0.4);
  280. display: flex;
  281. align-items: center;
  282. justify-content: center;
  283. z-index: 1000;
  284. }
  285. .loading-content {
  286. background: #ffffff;
  287. border-radius: 16rpx;
  288. padding: 32rpx;
  289. display: flex;
  290. align-items: center;
  291. flex-direction: column;
  292. }
  293. .loading-dots {
  294. display: flex;
  295. gap: 8rpx;
  296. margin-bottom: 16rpx;
  297. }
  298. .dot {
  299. width: 12rpx;
  300. height: 12rpx;
  301. border-radius: 50%;
  302. background: #4facfe;
  303. animation: bounce 1.4s infinite ease-in-out;
  304. }
  305. .dot:nth-child(1) {
  306. animation-delay: -0.32s;
  307. }
  308. .dot:nth-child(2) {
  309. animation-delay: -0.16s;
  310. }
  311. .loading-text {
  312. font-size: 24rpx;
  313. color: #666666;
  314. }
  315. /* 动画效果 */
  316. @keyframes fadeIn {
  317. from {
  318. opacity: 0;
  319. transform: translateY(20rpx);
  320. }
  321. to {
  322. opacity: 1;
  323. transform: translateY(0);
  324. }
  325. }
  326. @keyframes bounce {
  327. 0%, 80%, 100% {
  328. transform: scale(0.8);
  329. opacity: 0.5;
  330. }
  331. 40% {
  332. transform: scale(1);
  333. opacity: 1;
  334. }
  335. }
  336. /* 滚动锚点 */
  337. #bottom-anchor {
  338. height: 120rpx; /* 给最新消息预留可视缓冲,避免贴到底部输入区边缘 */
  339. }
  340. /* 导航栏下方简介区域 */
  341. .nav-intro-section {
  342. background: rgba(255, 255, 255, 0.95);
  343. border-bottom: 1rpx solid #e8e8e8;
  344. padding: 16rpx 32rpx;
  345. text-align: center;
  346. flex-shrink: 0;
  347. }
  348. .nav-intro-text {
  349. font-size: 24rpx;
  350. color: #666666;
  351. line-height: 1.4;
  352. display: block;
  353. }
  354. /* 底部版权信息 */
  355. .footer-section {
  356. background: #ffffff;
  357. border-top: 1rpx solid #e8e8e8;
  358. padding: 16rpx 32rpx;
  359. text-align: center;
  360. position: relative;
  361. }
  362. /* 顶部标题区域 */
  363. .header {
  364. text-align: center;
  365. margin-bottom: 0;
  366. padding: 20rpx 0 16rpx;
  367. flex-shrink: 0;
  368. }
  369. .logo-section {
  370. display: flex;
  371. align-items: center;
  372. justify-content: center;
  373. margin-bottom: 8rpx;
  374. }
  375. .logo {
  376. width: 80rpx;
  377. height: 80rpx;
  378. border-radius: 16rpx;
  379. margin-right: 12rpx;
  380. }
  381. .app-name {
  382. font-size: 28rpx;
  383. font-weight: bold;
  384. color: #ffffff;
  385. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.3);
  386. line-height: 1.2;
  387. }
  388. .welcome-text {
  389. font-size: 20rpx;
  390. color: rgba(255, 255, 255, 0.85);
  391. line-height: 1.3;
  392. max-width: 400rpx;
  393. margin: 0 auto;
  394. padding: 0 16rpx;
  395. }
  396. /* 功能介绍区域 */
  397. .feature-section {
  398. margin-bottom: 16rpx;
  399. flex-shrink: 0;
  400. }
  401. .feature-item {
  402. background: rgba(255, 255, 255, 0.98);
  403. border-radius: 16rpx;
  404. padding: 16rpx;
  405. margin-bottom: 8rpx;
  406. display: flex;
  407. align-items: center;
  408. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
  409. transition: all 0.3s ease;
  410. }
  411. .feature-item:active {
  412. transform: scale(0.98);
  413. }
  414. .feature-icon {
  415. font-size: 32rpx;
  416. margin-right: 16rpx;
  417. width: 40rpx;
  418. text-align: center;
  419. flex-shrink: 0;
  420. }
  421. .feature-content {
  422. flex: 1;
  423. min-width: 0;
  424. }
  425. .feature-title {
  426. font-size: 22rpx;
  427. font-weight: 600;
  428. color: #2c3e50;
  429. display: block;
  430. margin-bottom: 4rpx;
  431. line-height: 1.2;
  432. }
  433. .feature-desc {
  434. font-size: 18rpx;
  435. color: #7f8c8d;
  436. line-height: 1.3;
  437. display: block;
  438. }
  439. /* 操作按钮区域 */
  440. .action-section {
  441. display: flex;
  442. flex-direction: column;
  443. gap: 8rpx;
  444. margin-bottom: 16rpx;
  445. flex-shrink: 0;
  446. }
  447. .primary-btn {
  448. background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
  449. color: #ffffff;
  450. border: none;
  451. border-radius: 24rpx;
  452. height: 60rpx;
  453. font-size: 24rpx;
  454. font-weight: 600;
  455. display: flex;
  456. align-items: center;
  457. justify-content: center;
  458. box-shadow: 0 2rpx 8rpx rgba(255, 107, 107, 0.4);
  459. transition: all 0.3s ease;
  460. }
  461. .primary-btn::after {
  462. border: none;
  463. }
  464. .primary-btn:active {
  465. transform: scale(0.98);
  466. box-shadow: 0 2rpx 8rpx rgba(255, 107, 107, 0.4);
  467. }
  468. /* 移除不使用的样式 */
  469. /* 移除不使用的样式 */
  470. /* 移除不使用的样式 */
  471. /* 移除不使用的样式 */
  472. /* 移除不使用的样式 */
  473. /* 移除不使用的样式 */
  474. /* 移除不使用的样式 */
  475. /* 移除不使用的样式 */
  476. /* 移除不使用的样式 */
  477. /* 移除不使用的样式 */
  478. /* 移除不使用的样式 */
  479. /* 移除不使用的样式 */
  480. /* 移除不使用的样式 */
  481. /* 移除不使用的样式 */
  482. /* 输入区域 */
  483. .input-section {
  484. margin-bottom: 16rpx;
  485. flex-shrink: 0;
  486. }
  487. .legacy-message-input {
  488. width: 100%;
  489. height: 120rpx;
  490. background: #ffffff;
  491. border: 1rpx solid #e1e8ed;
  492. border-radius: 12rpx;
  493. padding: 12rpx;
  494. font-size: 20rpx;
  495. color: #2c3e50;
  496. box-sizing: border-box;
  497. resize: none;
  498. }
  499. .legacy-message-input::placeholder {
  500. color: #95a5a6;
  501. font-size: 20rpx;
  502. }
  503. .char-count {
  504. font-size: 16rpx;
  505. color: #7f8c8d;
  506. text-align: right;
  507. margin-top: 4rpx;
  508. }
  509. /* 助手回复区域 */
  510. .reply-section {
  511. background: rgba(255, 255, 255, 0.98);
  512. border-radius: 12rpx;
  513. padding: 16rpx;
  514. margin-bottom: 12rpx;
  515. box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.06);
  516. animation: fadeIn 0.4s ease-in-out;
  517. flex-shrink: 0;
  518. max-height: 200rpx;
  519. overflow-y: auto;
  520. }
  521. .reply-header {
  522. margin-bottom: 8rpx;
  523. }
  524. .reply-title {
  525. font-size: 22rpx;
  526. font-weight: 600;
  527. color: #3498db;
  528. display: block;
  529. line-height: 1.2;
  530. }
  531. .reply-content {
  532. background: #f8f9fa;
  533. border-radius: 8rpx;
  534. padding: 12rpx;
  535. margin-bottom: 8rpx;
  536. }
  537. .reply-text {
  538. font-size: 20rpx;
  539. color: #2c3e50;
  540. line-height: 1.4;
  541. white-space: pre-wrap;
  542. word-break: break-word;
  543. }
  544. .reply-actions {
  545. display: flex;
  546. justify-content: flex-end;
  547. }
  548. .reply-close-btn {
  549. background: #95a5a6;
  550. color: #ffffff;
  551. border: none;
  552. border-radius: 20rpx;
  553. height: 44rpx;
  554. font-size: 20rpx;
  555. font-weight: 500;
  556. padding: 0 20rpx;
  557. display: flex;
  558. align-items: center;
  559. justify-content: center;
  560. }
  561. .reply-close-btn::after {
  562. border: none;
  563. }
  564. .reply-close-btn:active {
  565. transform: scale(0.98);
  566. background: #5a6268;
  567. }
  568. @keyframes fadeIn {
  569. from {
  570. opacity: 0;
  571. transform: translateY(16rpx);
  572. }
  573. to {
  574. opacity: 1;
  575. transform: translateY(0);
  576. }
  577. }
  578. /* 底部信息 */
  579. .footer {
  580. text-align: center;
  581. padding: 8rpx 0;
  582. flex-shrink: 0;
  583. }
  584. .footer-text {
  585. font-size: 16rpx;
  586. color: rgba(255, 255, 255, 0.7);
  587. }
  588. .footer-section .footer-text {
  589. font-size: 20rpx;
  590. color: #999999;
  591. line-height: 1.4;
  592. }