chat.css 19 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055
  1. .chat-container {
  2. display: flex;
  3. flex-direction: column;
  4. height: calc(100vh - 60px); /* 减去header高度 */
  5. background: #fcfcfd; /* 更浅的背景色,接近白色 */
  6. }
  7. .chat-messages {
  8. flex: 1;
  9. overflow-y: auto;
  10. padding: 20px;
  11. display: flex;
  12. flex-direction: column;
  13. gap: 16px;
  14. scroll-behavior: smooth;
  15. background: #fcfcfd; /* 与容器背景保持一致 */
  16. }
  17. .fill-button {
  18. padding: 4px 8px;
  19. margin-left: 8px;
  20. border-radius: 4px;
  21. border: 1px solid #ddd;
  22. background: #fff;
  23. cursor: pointer;
  24. }
  25. .fill-button:hover {
  26. background: #f5f5f5;
  27. }
  28. .message {
  29. display: flex;
  30. max-width: 85%;
  31. margin-bottom: 4px;
  32. width: 100%;
  33. }
  34. .message.user {
  35. justify-content: flex-end;
  36. margin-left: auto;
  37. }
  38. .message-content {
  39. position: relative;
  40. padding: 12px 16px;
  41. border-radius: 12px;
  42. background: #fff;
  43. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  44. transition: all 0.3s ease;
  45. max-width: 100%;
  46. overflow-wrap: break-word;
  47. word-wrap: break-word;
  48. word-break: break-word;
  49. hyphens: auto;
  50. }
  51. .message.user .message-content {
  52. background: #e8f4ff;
  53. border-top-right-radius: 4px;
  54. }
  55. .message.assistant .message-content {
  56. background: #f0f4f8;
  57. border-top-left-radius: 4px;
  58. }
  59. .message p {
  60. margin: 0;
  61. line-height: 1.5;
  62. color: #333;
  63. }
  64. .chat-input-container {
  65. position: sticky !important; /* 确保固定在底部 */
  66. bottom: 0 !important;
  67. padding: 16px !important;
  68. background: #fff !important;
  69. border-top: 1px solid #f0f0f0 !important;
  70. z-index: 1 !important; /* 确保在消息上方 */
  71. }
  72. .input-wrapper {
  73. position: relative !important;
  74. display: flex !important;
  75. gap: 8px !important;
  76. background: #f0f4f8 !important;
  77. border-radius: 8px !important;
  78. padding: 8px 12px !important;
  79. transition: all 0.3s ease-out !important;
  80. min-height: 40px !important; /* 设置固定的最小高度 */
  81. max-height: 120px !important;
  82. margin-top: 8px;
  83. }
  84. .input-wrapper:focus-within {
  85. box-shadow: 0 0 0 1px #1a73e8;
  86. background: #f0f4f8 !important; /* 保持背景色一致 */
  87. }
  88. #chat-input {
  89. flex: 1 !important;
  90. border: none !important;
  91. background: transparent !important;
  92. resize: none !important;
  93. padding: 8px !important;
  94. font-size: 14px !important;
  95. line-height: 1.5 !important;
  96. min-height: 24px !important; /* 确保最小高度一致 */
  97. max-height: 100px !important;
  98. outline: none !important;
  99. color: #333 !important;
  100. overflow-y: auto !important;
  101. box-sizing: border-box !important; /* 添加盒模型设置 */
  102. }
  103. /* 确保输入框placeholder样式一致 */
  104. #chat-input::placeholder {
  105. opacity: 1 !important;
  106. color: #999 !important;
  107. line-height: 24px !important;
  108. }
  109. /* 输入框禁用状态样式 */
  110. #chat-input:disabled {
  111. cursor: not-allowed !important;
  112. color: #999 !important;
  113. background: #f5f5f5 !important;
  114. }
  115. .input-buttons {
  116. display: flex;
  117. align-items: center;
  118. gap: 8px;
  119. }
  120. .icon-button {
  121. position: relative;
  122. overflow: hidden;
  123. background: none;
  124. border: none;
  125. padding: 6px;
  126. cursor: pointer;
  127. color: #666;
  128. border-radius: 4px;
  129. transition: all 0.2s;
  130. }
  131. .icon-button::after {
  132. content: "";
  133. position: absolute;
  134. top: 50%;
  135. left: 50%;
  136. width: 100%;
  137. height: 100%;
  138. background: currentColor;
  139. border-radius: 50%;
  140. transform: translate(-50%, -50%) scale(0);
  141. opacity: 0;
  142. transition: all 0.2s ease;
  143. }
  144. .icon-button:hover::after {
  145. transform: translate(-50%, -50%) scale(1.5);
  146. opacity: 0.1;
  147. }
  148. /* 工具栏 */
  149. .toolbar {
  150. display: flex;
  151. align-items: center;
  152. justify-content: flex-end; /* 改为从右向左排列 */
  153. background: #fff;
  154. border-radius: 8px;
  155. }
  156. .toolbar-left,
  157. .toolbar-right {
  158. display: flex;
  159. align-items: center;
  160. gap: 8px;
  161. flex-direction: row-reverse; /* 按钮从右向左排列 */
  162. }
  163. /* 工具栏按钮 */
  164. .toolbar-button {
  165. display: inline-flex;
  166. align-items: center;
  167. gap: 6px;
  168. padding: 8px 12px; /* 只保留左内边距 */
  169. border: none;
  170. border-radius: 6px;
  171. background: #f5f7fa;
  172. color: #444;
  173. font-size: 13px;
  174. font-weight: 500;
  175. cursor: pointer;
  176. transition: all 0.2s ease;
  177. }
  178. .toolbar-button:hover {
  179. background: #edf2fc;
  180. color: #1a73e8;
  181. }
  182. .toolbar-button svg {
  183. width: 16px;
  184. height: 16px;
  185. }
  186. /* 快捷指令面板优化 */
  187. .prompt-panel {
  188. position: absolute;
  189. bottom: 100%;
  190. left: 16px;
  191. right: 16px;
  192. margin-bottom: 8px;
  193. background: #fff;
  194. border-radius: 8px;
  195. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  196. max-height: 400px;
  197. display: none;
  198. overflow: hidden;
  199. }
  200. .prompt-panel.show {
  201. display: flex;
  202. flex-direction: column;
  203. animation: slideUp 0.2s ease-out;
  204. }
  205. .prompt-header {
  206. display: flex;
  207. justify-content: space-between;
  208. align-items: center;
  209. padding: 12px 16px;
  210. border-bottom: 1px solid #eee;
  211. background: #f8f9fa;
  212. }
  213. .prompt-header h3 {
  214. margin: 0;
  215. font-size: 14px;
  216. color: #333;
  217. font-weight: 500;
  218. }
  219. .prompt-list {
  220. flex: 1;
  221. overflow-y: auto;
  222. padding: 8px;
  223. }
  224. .prompt-item {
  225. display: flex;
  226. align-items: center;
  227. width: 100%;
  228. padding: 10px 12px;
  229. text-align: left;
  230. background: none;
  231. border: none;
  232. border-radius: 6px;
  233. cursor: pointer;
  234. transition: all 0.2s;
  235. color: #333;
  236. font-size: 13px;
  237. line-height: 1.4;
  238. }
  239. .prompt-item:hover {
  240. background: #f0f4f8;
  241. }
  242. .prompt-item svg {
  243. width: 16px;
  244. height: 16px;
  245. margin-right: 8px;
  246. color: #666;
  247. }
  248. @keyframes slideUp {
  249. from {
  250. transform: translateY(20px);
  251. opacity: 0;
  252. }
  253. to {
  254. transform: translateY(0);
  255. opacity: 1;
  256. }
  257. }
  258. /* 滚动条样式 */
  259. .chat-messages::-webkit-scrollbar {
  260. width: 6px;
  261. }
  262. .chat-messages::-webkit-scrollbar-track {
  263. background: transparent;
  264. }
  265. .chat-messages::-webkit-scrollbar-thumb {
  266. background: #ddd;
  267. border-radius: 3px;
  268. }
  269. .chat-messages::-webkit-scrollbar-thumb:hover {
  270. background: #ccc;
  271. }
  272. /* 打字动画相关样式 */
  273. .message-content.typing {
  274. display: flex;
  275. flex-direction: column;
  276. }
  277. .message-content.typing p {
  278. display: inline;
  279. white-space: pre-wrap;
  280. word-break: break-word;
  281. }
  282. .message-content.typing p::after {
  283. content: "|";
  284. display: inline;
  285. margin-left: 1px;
  286. font-weight: bold;
  287. animation: blink 1s infinite;
  288. vertical-align: baseline;
  289. }
  290. @keyframes blink {
  291. 0%,
  292. 100% {
  293. opacity: 1;
  294. }
  295. 50% {
  296. opacity: 0;
  297. }
  298. }
  299. /* 加载动画样式 */
  300. .typing-indicator {
  301. display: flex;
  302. gap: 4px;
  303. padding: 4px 8px;
  304. }
  305. .typing-indicator span {
  306. width: 8px;
  307. height: 8px;
  308. background: #90a4ae;
  309. border-radius: 50%;
  310. animation: bounce 1.4s infinite ease-in-out;
  311. }
  312. .typing-indicator span:nth-child(1) {
  313. animation-delay: -0.32s;
  314. }
  315. .typing-indicator span:nth-child(2) {
  316. animation-delay: -0.16s;
  317. }
  318. @keyframes bounce {
  319. 0%,
  320. 80%,
  321. 100% {
  322. transform: scale(0);
  323. }
  324. 40% {
  325. transform: scale(1);
  326. }
  327. }
  328. /* 消息内容的过渡效果 */
  329. .message-content {
  330. transition: opacity 0.3s ease;
  331. }
  332. .message-content.loading {
  333. min-width: 60px;
  334. min-height: 24px;
  335. }
  336. /* 消息时间戳样式 */
  337. .message-timestamp {
  338. font-size: 12px;
  339. color: #999;
  340. line-height: 24px; /* 与按钮高度一致 */
  341. margin: 0; /* 移除可能的外边距 */
  342. padding: 0 2px; /* 添加少许水平内边距 */
  343. }
  344. /* 消息hover效果 */
  345. .message-content:hover {
  346. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  347. }
  348. /* 添加头像占位 */
  349. .message.assistant::before {
  350. content: "";
  351. width: 32px;
  352. height: 32px;
  353. min-width: 32px;
  354. margin-right: 8px;
  355. border-radius: 50%;
  356. background: #fff url("../images/icon128.png") center/cover no-repeat;
  357. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  358. transition: all 0.3s ease;
  359. }
  360. /* 头像悬停效果 */
  361. .message.assistant:hover::before {
  362. transform: scale(1.1);
  363. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  364. }
  365. /* 消息分组 */
  366. .message + .message.assistant,
  367. .message + .message.user {
  368. margin-top: 2px;
  369. }
  370. .message:not(:first-child) {
  371. margin-top: 16px;
  372. }
  373. /* 添加新消息指示器 */
  374. .new-messages-indicator {
  375. position: absolute;
  376. bottom: 80px;
  377. left: 50%;
  378. transform: translateX(-50%);
  379. background: rgba(33, 150, 243, 0.9);
  380. color: #fff;
  381. padding: 8px 16px;
  382. border-radius: 20px;
  383. font-size: 14px;
  384. cursor: pointer;
  385. opacity: 0;
  386. transition: all 0.3s ease;
  387. pointer-events: none;
  388. }
  389. .new-messages-indicator.show {
  390. opacity: 1;
  391. pointer-events: auto;
  392. }
  393. /* 消息格式化样式 */
  394. .message-content p {
  395. margin: 0;
  396. line-height: 1.5;
  397. }
  398. .message-content pre {
  399. background: #f6f8fa;
  400. padding: 16px;
  401. border-radius: 6px;
  402. overflow-x: auto;
  403. margin: 8px 0;
  404. max-width: 100%; /* 限制最大宽度 */
  405. white-space: pre-wrap; /* 允许代码块换行 */
  406. }
  407. .message-content code {
  408. font-family: monospace;
  409. background: #f6f8fa;
  410. padding: 2px 4px;
  411. border-radius: 4px;
  412. font-size: 0.9em;
  413. }
  414. .message-content pre code {
  415. padding: 0;
  416. background: none;
  417. font-size: 0.9em;
  418. line-height: 1.5;
  419. white-space: pre-wrap; /* 允许代码换行 */
  420. }
  421. .message-content a {
  422. color: #1a73e8;
  423. text-decoration: none;
  424. word-break: break-all; /* 确保长链接可以换行 */
  425. }
  426. .message-content a:hover {
  427. text-decoration: underline;
  428. }
  429. .message-content strong {
  430. font-weight: 600;
  431. }
  432. .message-content em {
  433. font-style: italic;
  434. }
  435. /* 消息操作栏样式 */
  436. .message-actions {
  437. display: flex;
  438. justify-content: flex-end;
  439. align-items: center; /* 确保垂直居中对齐 */
  440. gap: 8px;
  441. margin-top: 4px;
  442. min-height: 24px; /* 设置最小高度确保一致性 */
  443. }
  444. /* 复制按钮样式 */
  445. .fill-button,
  446. .copy-button {
  447. display: flex;
  448. align-items: center;
  449. gap: 4px;
  450. height: 24px; /* 固定高度 */
  451. padding: 0 6px; /* 调整水平内边距 */
  452. font-size: 12px;
  453. color: #666;
  454. background: none;
  455. border: none;
  456. border-radius: 4px;
  457. cursor: pointer;
  458. transition: all 0.2s ease;
  459. }
  460. .fill-button:hover,
  461. .copy-button:hover {
  462. background: rgba(0, 0, 0, 0.05);
  463. color: #1a73e8;
  464. }
  465. .fill-button svg,
  466. .copy-button svg {
  467. width: 14px;
  468. height: 14px;
  469. }
  470. /* 复制成功提示 */
  471. .copy-button.copied {
  472. color: #00c853;
  473. pointer-events: none;
  474. }
  475. /* Markdown样式 */
  476. .message-content h1,
  477. .message-content h2,
  478. .message-content h3,
  479. .message-content h4,
  480. .message-content h5,
  481. .message-content h6 {
  482. margin: 16px 0 8px;
  483. font-weight: 600;
  484. line-height: 1.25;
  485. color: #333;
  486. }
  487. .message-content h1 {
  488. font-size: 1.5em;
  489. }
  490. .message-content h2 {
  491. font-size: 1.3em;
  492. }
  493. .message-content h3 {
  494. font-size: 1.2em;
  495. }
  496. .message-content h4 {
  497. font-size: 1.1em;
  498. }
  499. .message-content h5 {
  500. font-size: 1em;
  501. }
  502. .message-content h6 {
  503. font-size: 0.9em;
  504. }
  505. .message-content ul,
  506. .message-content ol {
  507. margin: 8px 0;
  508. padding-left: 20px;
  509. }
  510. .message-content li {
  511. margin: 4px 0;
  512. }
  513. .message-content blockquote {
  514. margin: 8px 0;
  515. padding: 8px 16px;
  516. border-left: 4px solid #ddd;
  517. background: rgba(0, 0, 0, 0.02);
  518. color: #666;
  519. }
  520. .message-content hr {
  521. margin: 16px 0;
  522. border: none;
  523. border-top: 1px solid #eee;
  524. }
  525. /* 调整代码块样式 */
  526. .message-content pre {
  527. background: #f6f8fa;
  528. padding: 16px;
  529. border-radius: 6px;
  530. overflow-x: auto;
  531. margin: 8px 0;
  532. max-width: 100%; /* 限制最大宽度 */
  533. white-space: pre-wrap; /* 允许代码块换行 */
  534. }
  535. .message-content pre code {
  536. padding: 0;
  537. background: none;
  538. font-size: 0.9em;
  539. line-height: 1.5;
  540. white-space: pre-wrap; /* 允许代码换行 */
  541. }
  542. /* 打断按钮样式 */
  543. .stop-button {
  544. display: none; /* 默认隐藏 */
  545. padding: 6px 12px;
  546. color: #666;
  547. background: none;
  548. border: 1px solid #ddd;
  549. border-radius: 4px;
  550. cursor: pointer;
  551. font-size: 12px;
  552. transition: all 0.2s ease;
  553. }
  554. .stop-button.show {
  555. display: flex;
  556. align-items: center;
  557. gap: 4px;
  558. }
  559. .stop-button:hover {
  560. color: #d32f2f;
  561. border-color: #d32f2f;
  562. background: rgba(211, 47, 47, 0.05);
  563. }
  564. .stop-button svg {
  565. width: 14px;
  566. height: 14px;
  567. }
  568. /* 中断消息样式 */
  569. .message.assistant .message-content.interrupted {
  570. background: #fff1f0;
  571. border-left: 4px solid #ff4d4f;
  572. border-top-left-radius: 0;
  573. padding-left: 12px;
  574. color: #cf1322;
  575. }
  576. .message-content.interrupted .message-timestamp {
  577. color: rgba(207, 19, 34, 0.6);
  578. }
  579. .input-wrapper.generating {
  580. background: #f5f5f5;
  581. }
  582. /* 修改:只禁用输入框和其他按钮 */
  583. .input-wrapper.generating #chat-input,
  584. .input-wrapper.generating .icon-button {
  585. pointer-events: none;
  586. opacity: 0.5; /* 添加透明度表示禁用状态 */
  587. }
  588. .input-wrapper.generating #chat-input::placeholder {
  589. color: #999;
  590. opacity: 0.8;
  591. }
  592. /* 确保只有停止按钮可以点击 */
  593. .input-wrapper.generating .stop-button {
  594. pointer-events: auto;
  595. opacity: 1; /* 保持完全不透明 */
  596. cursor: pointer;
  597. }
  598. /* 页面信息卡片 */
  599. .page-info-card {
  600. display: flex;
  601. align-items: center;
  602. gap: 12px;
  603. padding: 12px 16px;
  604. margin: 0 16px 8px; /* 保持底部间距为8px */
  605. background: #fff;
  606. border-radius: 8px;
  607. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  608. }
  609. /* 网站图标 */
  610. .page-favicon {
  611. width: 16px;
  612. height: 16px;
  613. flex-shrink: 0;
  614. }
  615. /* 页面标题容器 */
  616. .page-title-container {
  617. flex: 1;
  618. position: relative;
  619. overflow: hidden;
  620. white-space: nowrap;
  621. scrollbar-width: none;
  622. -ms-overflow-style: none;
  623. }
  624. /* 隐藏滚动条但保持可滚动 */
  625. .page-title-container::-webkit-scrollbar {
  626. display: none;
  627. }
  628. /* 页面标题 */
  629. .page-title {
  630. font-size: 14px;
  631. color: #333;
  632. margin: 0;
  633. display: inline-block;
  634. position: relative; /* 添加相对定位 */
  635. padding-right: 20px;
  636. /* 移除这些可能导致标题消失的样式 */
  637. /* padding-left: 100%; */
  638. /* transform: translateX(-100%); */
  639. }
  640. /* 当容器被hover时启动滚动动画 */
  641. .page-title-container:hover .page-title {
  642. animation: scrollText 20s linear infinite; /* 增加动画时间到20秒 */
  643. }
  644. /* 修改滚动动画逻辑 */
  645. @keyframes scrollText {
  646. from {
  647. transform: translateX(0);
  648. }
  649. to {
  650. transform: translateX(-100%);
  651. }
  652. }
  653. /* 优化渐变遮罩 */
  654. .page-title-container::after {
  655. content: "";
  656. position: absolute;
  657. top: 0;
  658. right: 0;
  659. width: 30px; /* 减小遮罩宽度 */
  660. height: 100%;
  661. background: linear-gradient(
  662. to right,
  663. rgba(255, 255, 255, 0),
  664. rgba(255, 255, 255, 0.8)
  665. ); /* 降低不透明度 */
  666. pointer-events: none;
  667. }
  668. /* 添加左侧渐变遮罩 */
  669. .page-title-container::before {
  670. content: "";
  671. position: absolute;
  672. top: 0;
  673. left: 0;
  674. width: 30px; /* 减小遮罩宽度 */
  675. height: 100%;
  676. background: linear-gradient(
  677. to left,
  678. rgba(255, 255, 255, 0),
  679. rgba(255, 255, 255, 0.8)
  680. ); /* 降低不透明度 */
  681. pointer-events: none;
  682. z-index: 1;
  683. }
  684. /* 滚动时显示左侧遮罩 */
  685. .page-title-container:hover::before {
  686. opacity: 1;
  687. }
  688. /* 总结按钮 */
  689. .summarize-button {
  690. position: relative; /* 添加相对定位 */
  691. padding: 6px 12px;
  692. color: #1a73e8;
  693. background: #e8f0fe;
  694. border: none;
  695. border-radius: 4px;
  696. font-size: 13px;
  697. cursor: pointer;
  698. transition: all 0.2s ease;
  699. flex-shrink: 0;
  700. overflow: hidden; /* 确保星星不会溢出按钮区域 */
  701. }
  702. /* 星星元素 */
  703. .summarize-button::after {
  704. content: "✦";
  705. position: absolute;
  706. top: 0;
  707. right: 2px;
  708. font-size: 10px;
  709. opacity: 0;
  710. transform: translateY(10px);
  711. transition: all 0.3s ease;
  712. }
  713. /* 鼠标悬停时的动画效果 */
  714. .summarize-button:hover {
  715. background: #d2e3fc;
  716. transform: translateY(-1px);
  717. }
  718. .summarize-button:hover::after {
  719. opacity: 1;
  720. transform: translateY(0);
  721. animation: twinkle 1s infinite;
  722. }
  723. /* 点击效果 */
  724. .summarize-button:active {
  725. transform: translateY(0);
  726. }
  727. /* 星星闪烁动画 */
  728. @keyframes twinkle {
  729. 0% {
  730. opacity: 1;
  731. transform: scale(1) rotate(0deg);
  732. }
  733. 50% {
  734. opacity: 0.5;
  735. transform: scale(1.2) rotate(180deg);
  736. }
  737. 100% {
  738. opacity: 1;
  739. transform: scale(1) rotate(360deg);
  740. }
  741. }
  742. /* 输入框过渡动画 */
  743. .input-transition {
  744. transition: height 0.3s ease-out !important;
  745. will-change: height !important;
  746. }
  747. #chat-input {
  748. flex: 1 !important;
  749. border: none !important;
  750. background: transparent !important;
  751. resize: none !important;
  752. padding: 8px !important;
  753. font-size: 14px !important;
  754. line-height: 1.5 !important;
  755. min-height: 24px !important;
  756. max-height: 100px !important;
  757. outline: none !important;
  758. color: #333 !important;
  759. overflow-y: auto !important;
  760. box-sizing: border-box !important; /* 添加盒模型设置 */
  761. }
  762. /* 快捷指令面板头部 */
  763. .prompt-header {
  764. display: flex;
  765. justify-content: space-between;
  766. align-items: center;
  767. padding: 12px 16px;
  768. border-bottom: 1px solid #eee;
  769. background: #f8f9fa;
  770. }
  771. /* 关闭按钮样式优化 */
  772. .close-prompt {
  773. display: flex;
  774. align-items: center;
  775. justify-content: center;
  776. width: 24px;
  777. height: 24px;
  778. padding: 0;
  779. border: none;
  780. border-radius: 4px;
  781. background: transparent;
  782. color: #666;
  783. font-size: 18px;
  784. cursor: pointer;
  785. transition: all 0.2s ease;
  786. }
  787. .close-prompt:hover {
  788. background: rgba(0, 0, 0, 0.05);
  789. color: #333;
  790. }
  791. /* 使用SVG图标替代文字 */
  792. .close-prompt svg {
  793. width: 16px;
  794. height: 16px;
  795. }
  796. /* 工具箱面板 */
  797. .tools-panel {
  798. position: absolute;
  799. bottom: 100%;
  800. left: 16px;
  801. right: 16px;
  802. margin-bottom: 8px;
  803. background: #fff;
  804. border-radius: 8px;
  805. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  806. max-height: 500px;
  807. display: none;
  808. overflow: hidden;
  809. }
  810. .tools-panel.show {
  811. display: flex;
  812. flex-direction: column;
  813. animation: slideUp 0.2s ease-out;
  814. }
  815. .tools-header {
  816. display: flex;
  817. justify-content: space-between;
  818. align-items: center;
  819. padding: 12px 16px;
  820. border-bottom: 1px solid #eee;
  821. background: #f8f9fa;
  822. }
  823. .tools-header h3 {
  824. margin: 0;
  825. font-size: 14px;
  826. color: #333;
  827. font-weight: 500;
  828. }
  829. .tools-content {
  830. flex: 1;
  831. overflow-y: auto;
  832. padding: 16px;
  833. }
  834. .tools-section {
  835. margin-bottom: 20px;
  836. }
  837. .tools-section:last-child {
  838. margin-bottom: 0;
  839. }
  840. .tools-section h4 {
  841. margin: 0 0 12px;
  842. font-size: 13px;
  843. color: #666;
  844. font-weight: 500;
  845. }
  846. .tools-grid {
  847. display: grid;
  848. grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  849. gap: 8px;
  850. }
  851. .tool-item {
  852. display: flex;
  853. flex-direction: column;
  854. align-items: center;
  855. gap: 6px;
  856. padding: 12px;
  857. border: none;
  858. border-radius: 6px;
  859. background: #f5f7fa;
  860. color: #444;
  861. font-size: 12px;
  862. cursor: pointer;
  863. transition: all 0.2s ease;
  864. }
  865. .tool-item:hover {
  866. background: #edf2fc;
  867. color: #1a73e8;
  868. }
  869. .tool-item svg {
  870. width: 20px;
  871. height: 20px;
  872. }
  873. .close-tools {
  874. display: flex;
  875. align-items: center;
  876. justify-content: center;
  877. width: 24px;
  878. height: 24px;
  879. padding: 0;
  880. border: none;
  881. border-radius: 4px;
  882. background: transparent;
  883. color: #666;
  884. cursor: pointer;
  885. transition: all 0.2s ease;
  886. }
  887. .close-tools:hover {
  888. background: rgba(0, 0, 0, 0.05);
  889. color: #333;
  890. }
  891. .close-tools svg {
  892. width: 16px;
  893. height: 16px;
  894. }
  895. /* 文件上传按钮样式 */
  896. #upload-button {
  897. position: relative;
  898. overflow: hidden;
  899. background: none;
  900. border: none;
  901. padding: 6px;
  902. cursor: pointer;
  903. color: #666;
  904. border-radius: 4px;
  905. transition: all 0.2s;
  906. }
  907. #upload-button:hover {
  908. color: #1a73e8;
  909. background: rgba(26, 115, 232, 0.08);
  910. }
  911. #upload-button svg {
  912. width: 20px;
  913. height: 20px;
  914. }
  915. /* 文件上传按钮点击效果 */
  916. #upload-button:active {
  917. transform: scale(0.95);
  918. }
  919. /* 停止生成按钮 */
  920. .stop-button {
  921. display: none;
  922. color: #d32f2f;
  923. }
  924. .stop-button.show {
  925. display: inline-flex;
  926. }
  927. .stop-button:hover {
  928. background-color: rgba(211, 47, 47, 0.08);
  929. }