Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

conversation.component.scss 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. .conversation-container {
  2. flex: 1;
  3. display: flex;
  4. flex-direction: column;
  5. min-height: 0;
  6. }
  7. .messages-container {
  8. flex: 1;
  9. overflow-y: auto;
  10. padding: 20px;
  11. background: #fafafa;
  12. min-height: 0;
  13. }
  14. .message-wrapper {
  15. margin-bottom: 20px;
  16. }
  17. .message {
  18. max-width: 95%;
  19. padding: 12px 16px;
  20. border-radius: 18px;
  21. position: relative;
  22. margin-bottom: 12px;
  23. }
  24. .message.user {
  25. background: linear-gradient(135deg, #007bff, #0056b3);
  26. color: white;
  27. border-left: 4px solid #0056b3;
  28. box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
  29. }
  30. .message.assistant {
  31. background: linear-gradient(135deg, #ffffff, #f8f9fa);
  32. color: #333;
  33. border: 1px solid #e0e0e0;
  34. border-left: 4px solid #6c757d;
  35. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  36. }
  37. .message-header {
  38. display: flex;
  39. align-items: center;
  40. margin-bottom: 8px;
  41. font-size: 12px;
  42. opacity: 0.8;
  43. }
  44. .message-icon {
  45. font-size: 16px;
  46. height: 16px;
  47. width: 16px;
  48. margin-right: 6px;
  49. }
  50. .message-role {
  51. font-weight: 500;
  52. margin-right: 8px;
  53. }
  54. .message-time {
  55. margin-left: auto;
  56. }
  57. .message-content {
  58. line-height: 1.5;
  59. white-space: pre-wrap;
  60. }
  61. .user .message-content {
  62. color: white;
  63. }
  64. .loading-spinner {
  65. position: absolute;
  66. top: 12px;
  67. right: 12px;
  68. }
  69. .input-container {
  70. display: flex;
  71. gap: 12px;
  72. padding: 16px;
  73. border-top: 1px solid #e0e0e0;
  74. background: white;
  75. flex-shrink: 0;
  76. }
  77. .input-field {
  78. flex: 1;
  79. }
  80. .send-button {
  81. align-self: center;
  82. height: 56px;
  83. min-width: 56px;
  84. }
  85. .empty-state {
  86. text-align: center;
  87. padding: 60px 20px;
  88. color: #666;
  89. }
  90. .empty-state mat-icon {
  91. font-size: 64px;
  92. height: 64px;
  93. width: 64px;
  94. margin-bottom: 16px;
  95. color: #ccc;
  96. }
  97. .no-session {
  98. padding: 20px;
  99. text-align: center;
  100. color: #666;
  101. background: #f5f5f5;
  102. }
  103. /* 可折叠标签样式 */
  104. details {
  105. margin: 8px 0;
  106. border-radius: 8px;
  107. overflow: hidden;
  108. }
  109. .thinking-details {
  110. border: 2px solid #2196f3;
  111. background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  112. border-radius: 8px;
  113. box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
  114. }
  115. .tool-details {
  116. border: 2px solid #9c27b0;
  117. background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
  118. border-radius: 8px;
  119. box-shadow: 0 2px 8px rgba(156, 39, 176, 0.2);
  120. }
  121. .thinking-summary,
  122. .tool-summary {
  123. padding: 8px 12px;
  124. cursor: pointer;
  125. font-weight: 500;
  126. display: flex;
  127. align-items: center;
  128. gap: 6px;
  129. user-select: none;
  130. }
  131. .thinking-summary {
  132. color: #0d47a1;
  133. background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
  134. border-bottom: 1px solid #64b5f6;
  135. font-weight: 600;
  136. }
  137. .tool-summary {
  138. color: #4a148c;
  139. background: linear-gradient(135deg, #e1bee7 0%, #ce93d8 100%);
  140. border-bottom: 1px solid #ba68c8;
  141. font-weight: 600;
  142. }
  143. /* details元素内的内容样式 */
  144. .thinking-details > *:not(summary),
  145. .tool-details > *:not(summary) {
  146. padding: 12px;
  147. border-top: 1px solid rgba(0, 0, 0, 0.05);
  148. }
  149. .thinking-details > *:not(summary) {
  150. background-color: #f0f7ff;
  151. color: #0d47a1;
  152. font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  153. font-size: 0.95em;
  154. line-height: 1.5;
  155. }
  156. .tool-details > *:not(summary) {
  157. background-color: #f5f0ff;
  158. color: #4a148c;
  159. font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  160. font-size: 0.95em;
  161. line-height: 1.5;
  162. }
  163. /* 标签样式(非折叠) */
  164. .thinking-tag,
  165. .tool-tag,
  166. .error-tag {
  167. display: inline-block;
  168. padding: 4px 8px;
  169. border-radius: 4px;
  170. font-size: 12px;
  171. font-weight: 500;
  172. margin-right: 8px;
  173. }
  174. .thinking-tag {
  175. background-color: #e3f2fd;
  176. color: #1565c0;
  177. }
  178. .tool-tag {
  179. background-color: #f3e5f5;
  180. color: #7b1fa2;
  181. }
  182. .error-tag {
  183. background-color: #ffebee;
  184. color: #c62828;
  185. }
  186. /* 确保markdown内容样式正确 */
  187. .message-content :deep(*) {
  188. margin-top: 8px;
  189. margin-bottom: 8px;
  190. }
  191. .message-content :deep(ul),
  192. .message-content :deep(ol) {
  193. padding-left: 24px;
  194. }
  195. .message-content :deep(code) {
  196. background-color: #f5f5f5;
  197. padding: 2px 4px;
  198. border-radius: 3px;
  199. font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  200. font-size: 0.9em;
  201. }
  202. .message-content :deep(pre) {
  203. margin: 12px 0;
  204. }
  205. /* 自定义details元素图标 */
  206. .message-content :deep(details) {
  207. position: relative;
  208. }
  209. .message-content :deep(details summary) {
  210. list-style: none;
  211. }
  212. .message-content :deep(details summary::-webkit-details-marker) {
  213. display: none;
  214. }
  215. .message-content :deep(details summary::before) {
  216. content: '▶';
  217. font-size: 10px;
  218. margin-right: 6px;
  219. transition: transform 0.2s;
  220. display: inline-block;
  221. }
  222. .message-content :deep(details[open] summary::before) {
  223. transform: rotate(90deg);
  224. }
  225. /* 确保标签内的内容正确显示 */
  226. .message-content :deep(.thinking-details),
  227. .message-content :deep(.tool-details) {
  228. white-space: normal;
  229. word-break: break-word;
  230. }