chat.css 19 KB

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