chat.css 19 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054
  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. .copy-button {
  446. display: flex;
  447. align-items: center;
  448. gap: 4px;
  449. height: 24px; /* 固定高度 */
  450. padding: 0 6px; /* 调整水平内边距 */
  451. font-size: 12px;
  452. color: #666;
  453. background: none;
  454. border: none;
  455. border-radius: 4px;
  456. cursor: pointer;
  457. transition: all 0.2s ease;
  458. }
  459. .copy-button:hover {
  460. background: rgba(0, 0, 0, 0.05);
  461. color: #1a73e8;
  462. }
  463. .copy-button svg {
  464. width: 14px;
  465. height: 14px;
  466. }
  467. /* 复制成功提示 */
  468. .copy-button.copied {
  469. color: #00c853;
  470. pointer-events: none;
  471. }
  472. /* Markdown样式 */
  473. .message-content h1,
  474. .message-content h2,
  475. .message-content h3,
  476. .message-content h4,
  477. .message-content h5,
  478. .message-content h6 {
  479. margin: 16px 0 8px;
  480. font-weight: 600;
  481. line-height: 1.25;
  482. color: #333;
  483. }
  484. .message-content h1 {
  485. font-size: 1.5em;
  486. }
  487. .message-content h2 {
  488. font-size: 1.3em;
  489. }
  490. .message-content h3 {
  491. font-size: 1.2em;
  492. }
  493. .message-content h4 {
  494. font-size: 1.1em;
  495. }
  496. .message-content h5 {
  497. font-size: 1em;
  498. }
  499. .message-content h6 {
  500. font-size: 0.9em;
  501. }
  502. .message-content ul,
  503. .message-content ol {
  504. margin: 8px 0;
  505. padding-left: 20px;
  506. }
  507. .message-content li {
  508. margin: 4px 0;
  509. }
  510. .message-content blockquote {
  511. margin: 8px 0;
  512. padding: 8px 16px;
  513. border-left: 4px solid #ddd;
  514. background: rgba(0, 0, 0, 0.02);
  515. color: #666;
  516. }
  517. .message-content hr {
  518. margin: 16px 0;
  519. border: none;
  520. border-top: 1px solid #eee;
  521. }
  522. /* 调整代码块样式 */
  523. .message-content pre {
  524. background: #f6f8fa;
  525. padding: 16px;
  526. border-radius: 6px;
  527. overflow-x: auto;
  528. margin: 8px 0;
  529. max-width: 100%; /* 限制最大宽度 */
  530. white-space: pre-wrap; /* 允许代码块换行 */
  531. }
  532. .message-content pre code {
  533. padding: 0;
  534. background: none;
  535. font-size: 0.9em;
  536. line-height: 1.5;
  537. white-space: pre-wrap; /* 允许代码换行 */
  538. }
  539. /* 打断按钮样式 */
  540. .stop-button {
  541. display: none; /* 默认隐藏 */
  542. padding: 6px 12px;
  543. color: #666;
  544. background: none;
  545. border: 1px solid #ddd;
  546. border-radius: 4px;
  547. cursor: pointer;
  548. font-size: 12px;
  549. transition: all 0.2s ease;
  550. }
  551. .stop-button.show {
  552. display: flex;
  553. align-items: center;
  554. gap: 4px;
  555. }
  556. .stop-button:hover {
  557. color: #d32f2f;
  558. border-color: #d32f2f;
  559. background: rgba(211, 47, 47, 0.05);
  560. }
  561. .stop-button svg {
  562. width: 14px;
  563. height: 14px;
  564. }
  565. /* 中断消息样式 */
  566. .message.assistant .message-content.interrupted {
  567. background: #fff1f0;
  568. border-left: 4px solid #ff4d4f;
  569. border-top-left-radius: 0;
  570. padding-left: 12px;
  571. color: #cf1322;
  572. }
  573. .message-content.interrupted .message-timestamp {
  574. color: rgba(207, 19, 34, 0.6);
  575. }
  576. .input-wrapper.generating {
  577. background: #f5f5f5;
  578. }
  579. /* 修改:只禁用输入框和其他按钮 */
  580. .input-wrapper.generating #chat-input,
  581. .input-wrapper.generating .icon-button {
  582. pointer-events: none;
  583. opacity: 0.5; /* 添加透明度表示禁用状态 */
  584. }
  585. .input-wrapper.generating #chat-input::placeholder {
  586. color: #999;
  587. opacity: 0.8;
  588. }
  589. /* 确保只有停止按钮可以点击 */
  590. .input-wrapper.generating .stop-button {
  591. pointer-events: auto;
  592. opacity: 1; /* 保持完全不透明 */
  593. cursor: pointer;
  594. }
  595. /* 页面信息卡片 */
  596. .page-info-card {
  597. display: flex;
  598. align-items: center;
  599. gap: 12px;
  600. padding: 12px 16px;
  601. margin: 0 16px 8px; /* 保持底部间距为8px */
  602. background: #fff;
  603. border-radius: 8px;
  604. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  605. }
  606. /* 网站图标 */
  607. .page-favicon {
  608. width: 16px;
  609. height: 16px;
  610. flex-shrink: 0;
  611. }
  612. /* 页面标题容器 */
  613. .page-title-container {
  614. flex: 1;
  615. position: relative;
  616. overflow: hidden;
  617. white-space: nowrap;
  618. scrollbar-width: none;
  619. -ms-overflow-style: none;
  620. }
  621. /* 隐藏滚动条但保持可滚动 */
  622. .page-title-container::-webkit-scrollbar {
  623. display: none;
  624. }
  625. /* 页面标题 */
  626. .page-title {
  627. font-size: 14px;
  628. color: #333;
  629. margin: 0;
  630. display: inline-block;
  631. position: relative; /* 添加相对定位 */
  632. padding-right: 20px;
  633. /* 移除这些可能导致标题消失的样式 */
  634. /* padding-left: 100%; */
  635. /* transform: translateX(-100%); */
  636. }
  637. /* 当容器被hover时启动滚动动画 */
  638. .page-title-container:hover .page-title {
  639. animation: scrollText 20s linear infinite; /* 增加动画时间到20秒 */
  640. }
  641. /* 修改滚动动画逻辑 */
  642. @keyframes scrollText {
  643. from {
  644. transform: translateX(0);
  645. }
  646. to {
  647. transform: translateX(-100%);
  648. }
  649. }
  650. /* 优化渐变遮罩 */
  651. .page-title-container::after {
  652. content: "";
  653. position: absolute;
  654. top: 0;
  655. right: 0;
  656. width: 30px; /* 减小遮罩宽度 */
  657. height: 100%;
  658. background: linear-gradient(
  659. to right,
  660. rgba(255, 255, 255, 0),
  661. rgba(255, 255, 255, 0.8)
  662. ); /* 降低不透明度 */
  663. pointer-events: none;
  664. }
  665. /* 添加左侧渐变遮罩 */
  666. .page-title-container::before {
  667. content: "";
  668. position: absolute;
  669. top: 0;
  670. left: 0;
  671. width: 30px; /* 减小遮罩宽度 */
  672. height: 100%;
  673. background: linear-gradient(
  674. to left,
  675. rgba(255, 255, 255, 0),
  676. rgba(255, 255, 255, 0.8)
  677. ); /* 降低不透明度 */
  678. pointer-events: none;
  679. z-index: 1;
  680. }
  681. /* 滚动时显示左侧遮罩 */
  682. .page-title-container:hover::before {
  683. opacity: 1;
  684. }
  685. /* 总结按钮 */
  686. .summarize-button {
  687. position: relative; /* 添加相对定位 */
  688. padding: 6px 12px;
  689. color: #1a73e8;
  690. background: #e8f0fe;
  691. border: none;
  692. border-radius: 4px;
  693. font-size: 13px;
  694. cursor: pointer;
  695. transition: all 0.2s ease;
  696. flex-shrink: 0;
  697. overflow: hidden; /* 确保星星不会溢出按钮区域 */
  698. }
  699. /* 星星元素 */
  700. .summarize-button::after {
  701. content: "✦";
  702. position: absolute;
  703. top: 0;
  704. right: 2px;
  705. font-size: 10px;
  706. opacity: 0;
  707. transform: translateY(10px);
  708. transition: all 0.3s ease;
  709. }
  710. /* 鼠标悬停时的动画效果 */
  711. .summarize-button:hover {
  712. background: #d2e3fc;
  713. transform: translateY(-1px);
  714. }
  715. .summarize-button:hover::after {
  716. opacity: 1;
  717. transform: translateY(0);
  718. animation: twinkle 1s infinite;
  719. }
  720. /* 点击效果 */
  721. .summarize-button:active {
  722. transform: translateY(0);
  723. }
  724. /* 星星闪烁动画 */
  725. @keyframes twinkle {
  726. 0% {
  727. opacity: 1;
  728. transform: scale(1) rotate(0deg);
  729. }
  730. 50% {
  731. opacity: 0.5;
  732. transform: scale(1.2) rotate(180deg);
  733. }
  734. 100% {
  735. opacity: 1;
  736. transform: scale(1) rotate(360deg);
  737. }
  738. }
  739. /* 输入框过渡动画 */
  740. .input-transition {
  741. transition: height 0.3s ease-out !important;
  742. will-change: height !important;
  743. }
  744. #chat-input {
  745. flex: 1 !important;
  746. border: none !important;
  747. background: transparent !important;
  748. resize: none !important;
  749. padding: 8px !important;
  750. font-size: 14px !important;
  751. line-height: 1.5 !important;
  752. min-height: 24px !important;
  753. max-height: 100px !important;
  754. outline: none !important;
  755. color: #333 !important;
  756. overflow-y: auto !important;
  757. box-sizing: border-box !important; /* 添加盒模型设置 */
  758. }
  759. /* 快捷指令面板头部 */
  760. .prompt-header {
  761. display: flex;
  762. justify-content: space-between;
  763. align-items: center;
  764. padding: 12px 16px;
  765. border-bottom: 1px solid #eee;
  766. background: #f8f9fa;
  767. }
  768. /* 关闭按钮样式优化 */
  769. .close-prompt {
  770. display: flex;
  771. align-items: center;
  772. justify-content: center;
  773. width: 24px;
  774. height: 24px;
  775. padding: 0;
  776. border: none;
  777. border-radius: 4px;
  778. background: transparent;
  779. color: #666;
  780. font-size: 18px;
  781. cursor: pointer;
  782. transition: all 0.2s ease;
  783. }
  784. .close-prompt:hover {
  785. background: rgba(0, 0, 0, 0.05);
  786. color: #333;
  787. }
  788. /* 使用SVG图标替代文字 */
  789. .close-prompt svg {
  790. width: 16px;
  791. height: 16px;
  792. }
  793. /* 工具箱面板 */
  794. .tools-panel {
  795. position: absolute;
  796. bottom: 100%;
  797. left: 16px;
  798. right: 16px;
  799. margin-bottom: 8px;
  800. background: #fff;
  801. border-radius: 8px;
  802. box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  803. max-height: 500px;
  804. display: none;
  805. overflow: hidden;
  806. }
  807. .tools-panel.show {
  808. display: flex;
  809. flex-direction: column;
  810. animation: slideUp 0.2s ease-out;
  811. }
  812. .tools-header {
  813. display: flex;
  814. justify-content: space-between;
  815. align-items: center;
  816. padding: 12px 16px;
  817. border-bottom: 1px solid #eee;
  818. background: #f8f9fa;
  819. }
  820. .tools-header h3 {
  821. margin: 0;
  822. font-size: 14px;
  823. color: #333;
  824. font-weight: 500;
  825. }
  826. .tools-content {
  827. flex: 1;
  828. overflow-y: auto;
  829. padding: 16px;
  830. }
  831. .tools-section {
  832. margin-bottom: 20px;
  833. }
  834. .tools-section:last-child {
  835. margin-bottom: 0;
  836. }
  837. .tools-section h4 {
  838. margin: 0 0 12px;
  839. font-size: 13px;
  840. color: #666;
  841. font-weight: 500;
  842. }
  843. .tools-grid {
  844. display: grid;
  845. grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  846. gap: 8px;
  847. }
  848. .tool-item {
  849. display: flex;
  850. flex-direction: column;
  851. align-items: center;
  852. gap: 6px;
  853. padding: 12px;
  854. border: none;
  855. border-radius: 6px;
  856. background: #f5f7fa;
  857. color: #444;
  858. font-size: 12px;
  859. cursor: pointer;
  860. transition: all 0.2s ease;
  861. }
  862. .tool-item:hover {
  863. background: #edf2fc;
  864. color: #1a73e8;
  865. }
  866. .tool-item svg {
  867. width: 20px;
  868. height: 20px;
  869. }
  870. .close-tools {
  871. display: flex;
  872. align-items: center;
  873. justify-content: center;
  874. width: 24px;
  875. height: 24px;
  876. padding: 0;
  877. border: none;
  878. border-radius: 4px;
  879. background: transparent;
  880. color: #666;
  881. cursor: pointer;
  882. transition: all 0.2s ease;
  883. }
  884. .close-tools:hover {
  885. background: rgba(0, 0, 0, 0.05);
  886. color: #333;
  887. }
  888. .close-tools svg {
  889. width: 16px;
  890. height: 16px;
  891. }
  892. /* 文件上传按钮样式 */
  893. #upload-button {
  894. position: relative;
  895. overflow: hidden;
  896. background: none;
  897. border: none;
  898. padding: 6px;
  899. cursor: pointer;
  900. color: #666;
  901. border-radius: 4px;
  902. transition: all 0.2s;
  903. }
  904. #upload-button:hover {
  905. color: #1a73e8;
  906. background: rgba(26, 115, 232, 0.08);
  907. }
  908. #upload-button svg {
  909. width: 20px;
  910. height: 20px;
  911. }
  912. /* 文件上传按钮点击效果 */
  913. #upload-button:active {
  914. transform: scale(0.95);
  915. }
  916. /* 停止生成按钮 */
  917. .stop-button {
  918. display: none;
  919. color: #d32f2f;
  920. }
  921. .stop-button.show {
  922. display: inline-flex;
  923. }
  924. .stop-button:hover {
  925. background-color: rgba(211, 47, 47, 0.08);
  926. }