@topconsultnpm/sdkui-react 6.22.0-dev3.37 → 6.22.0-dev3.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -45
  2. package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +60 -67
  3. package/lib/components/base/Styled.d.ts +77 -93
  4. package/lib/components/base/TMCounterBar.d.ts +2 -2
  5. package/lib/components/base/TMCounterContainer.d.ts +1 -2
  6. package/lib/components/base/TMCustomButton.d.ts +1 -1
  7. package/lib/components/base/TMDataGridExportForm.d.ts +1 -2
  8. package/lib/components/base/TMFileManager.d.ts +1 -2
  9. package/lib/components/base/TMFileManagerDataGridView.d.ts +1 -2
  10. package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
  11. package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
  12. package/lib/components/base/TMFileManagerUtils.d.ts +6 -4
  13. package/lib/components/base/TMLayout.d.ts +4 -4
  14. package/lib/components/base/TMList.d.ts +1 -2
  15. package/lib/components/base/TMListView.d.ts +1 -1
  16. package/lib/components/base/TMSpinner.d.ts +2 -3
  17. package/lib/components/base/TMTab.d.ts +3 -4
  18. package/lib/components/base/TMTabControl.js +208 -208
  19. package/lib/components/base/TMTooltip.d.ts +1 -1
  20. package/lib/components/base/TMTreeView.d.ts +8 -14
  21. package/lib/components/base/TMUserAvatar.d.ts +1 -2
  22. package/lib/components/base/TMVilViewer.d.ts +1 -2
  23. package/lib/components/base/TMWaitPanel.d.ts +2 -3
  24. package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +1 -2
  25. package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
  26. package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +1 -2
  27. package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +1 -2
  28. package/lib/components/choosers/TMQuickSearchInfo.d.ts +1 -2
  29. package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
  30. package/lib/components/choosers/TMUserChooser.d.ts +2 -2
  31. package/lib/components/editors/TMEditorStyled.d.ts +42 -20
  32. package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
  33. package/lib/components/editors/TMHtmlContentDisplay.d.ts +1 -2
  34. package/lib/components/editors/TMHtmlEditor.d.ts +1 -2
  35. package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
  36. package/lib/components/features/assistant/TMHelpOnLineChat.js +828 -815
  37. package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
  38. package/lib/components/features/blog/TMBlogCommentForm.d.ts +1 -2
  39. package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +1 -1
  40. package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -2
  41. package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -8
  42. package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -2
  43. package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
  44. package/lib/components/features/documents/TMFileUploader.js +21 -21
  45. package/lib/components/features/documents/TMMasterInfoFields.d.ts +1 -2
  46. package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
  47. package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +1 -2
  48. package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +4 -4
  49. package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +1 -2
  50. package/lib/components/features/search/TMMetadataOutputForm.d.ts +1 -2
  51. package/lib/components/features/search/TMMetadataSorterForm.d.ts +1 -2
  52. package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
  53. package/lib/components/features/search/TMSearch.d.ts +1 -2
  54. package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -9
  55. package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
  56. package/lib/components/features/search/TMSignatureInfoContent.d.ts +1 -2
  57. package/lib/components/features/search/TMViewHistoryDcmt.d.ts +1 -2
  58. package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
  59. package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
  60. package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
  61. package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
  62. package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
  63. package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
  64. package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
  65. package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
  66. package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +2 -3
  67. package/lib/components/features/workflow/TMWorkflowPopup.d.ts +7 -8
  68. package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -3
  69. package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -3
  70. package/lib/components/forms/Login/Chooser.d.ts +2 -2
  71. package/lib/components/forms/TMChooserForm.d.ts +1 -2
  72. package/lib/components/forms/TMSaveForm.d.ts +4 -4
  73. package/lib/components/grids/TMBlogAttachments.d.ts +1 -2
  74. package/lib/components/grids/TMBlogHeader.d.ts +1 -1
  75. package/lib/components/grids/TMBlogsPost.d.ts +1 -1
  76. package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
  77. package/lib/components/grids/TMValidationItemsList.d.ts +1 -2
  78. package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -2
  79. package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +2 -2
  80. package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -5
  81. package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
  82. package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
  83. package/lib/components/pages/TMPage.d.ts +1 -1
  84. package/lib/components/query/TMQueryEditor.d.ts +10 -14
  85. package/lib/components/settings/SettingsAppearance.d.ts +1 -2
  86. package/lib/components/sidebar/TMAboutApp.d.ts +1 -2
  87. package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
  88. package/lib/components/sidebar/TMHeader.d.ts +3 -3
  89. package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -3
  90. package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +2 -3
  91. package/lib/components/viewers/TMMidViewer.d.ts +2 -2
  92. package/lib/components/viewers/TMTidViewer.d.ts +2 -2
  93. package/lib/helper/TMAppUpdatedModal.d.ts +1 -2
  94. package/lib/helper/TMAppUpdatedModal.js +93 -93
  95. package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
  96. package/lib/helper/TMIcons.d.ts +280 -280
  97. package/lib/helper/TMPdfViewer.d.ts +1 -2
  98. package/lib/helper/TMToppyMessage.d.ts +2 -2
  99. package/lib/helper/TMUtils.d.ts +4 -10
  100. package/lib/helper/helpers.d.ts +1 -1
  101. package/lib/hooks/useInputDialog.d.ts +1 -2
  102. package/lib/services/platform_services.d.ts +2 -3
  103. package/package.json +1 -1
@@ -235,7 +235,7 @@ const ChatPanel = ({ width, onWidthChange, messages, conversationId, isThinking,
235
235
  onFeedbackSubmitted(answer.id, rating);
236
236
  };
237
237
  const showSuggestions = messages.length === 0 && !isThinking && suggestions.length > 0;
238
- return (_jsxs(PanelContainer, { $width: width, children: [_jsx(ResizeHandle, { onMouseDown: onResizeStart }), _jsxs(ChatHeader, { children: [_jsxs(HeaderLeft, { children: [_jsx(ToppyAvatar, { src: ToppyImage, alt: "Toppy" }), _jsxs(HeaderText, { children: [_jsxs(HeaderGreeting, { children: ["Ciao ", userName] }), _jsx(HeaderQuestion, { children: "Come posso aiutarti?" })] })] }), _jsxs(HeaderRight, { children: [_jsx(TMTooltip, { content: "Nuova conversazione", children: _jsx(HeaderButton, { onClick: onNewConversation, disabled: !conversationId && messages.length === 0, title: "Nuova conversazione", children: _jsx(IconNewChat, { color: "white", fontSize: 18 }) }) }), _jsx(TMTooltip, { content: "Chiudi", children: _jsx(HeaderButton, { onClick: onClose, title: "Chiudi", children: _jsx(IconClose, { fontSize: 18 }) }) })] })] }), _jsxs(ChatBody, { children: [messages.length === 0 ? (_jsxs(WelcomeMessage, { children: [_jsx(WelcomeIcon, { children: "\uD83D\uDCA1" }), _jsxs(WelcomeText, { children: ["Ciao! Sono ", _jsx("strong", { children: "Toppy" }), ", il tuo assistente.", _jsx("br", {}), "Fai una domanda e ti aiuter\u00F2 a trovare la risposta."] })] })) : (messages.map((msg, index) => (_jsxs(MessageBubble, { $isUser: msg.isUser, children: [!msg.isUser && _jsx(BotAvatar, { src: ToppyImage, alt: "Toppy" }), msg.isUser ? (_jsx(MessageContent, { $isUser: true, children: msg.text })) : (_jsxs(BotMessageColumn, { children: [_jsx(BotMessageContent, { $isUser: false, children: _jsx(MarkdownContent, { children: renderMarkdown(msg.text) }) }), msg.text !== NO_ANSWER_TEXT && msg.text !== ERROR_TEXT && (_jsx(MessageFeedback, { answer: msg.text, submittedRating: submittedRatings[msg.id], onSubmit: (rating, tags, feedback) => onFeedbackSubmit(index, rating, tags, feedback) }))] }))] }, msg.id)))), isThinking && (_jsxs(MessageBubble, { $isUser: false, children: [_jsx(BotAvatar, { src: ToppyImage, alt: "Toppy" }), _jsx(ThinkingStatus, {}, messages.length)] })), _jsx("div", { ref: messagesEndRef })] }), _jsxs(ChatFooter, { children: [showSuggestions && (_jsxs(SuggestionsSection, { children: [_jsxs(SuggestionsTitle, { children: [_jsx(IconSparkle, { fontSize: 14 }), _jsx("span", { children: "Domande suggerite" })] }), _jsx(SuggestionsGrid, { children: suggestions.map((question, index) => (_jsxs(SuggestionCard, { type: "button", $index: index, title: question, onClick: () => onSuggestionClick(question), onMouseEnter: () => setHoveredSuggestion(question), onMouseLeave: () => setHoveredSuggestion(undefined), onFocus: () => setHoveredSuggestion(question), onBlur: () => setHoveredSuggestion(undefined), children: [_jsx(SuggestionIcon, { children: _jsx(IconQuestion, { fontSize: 16 }) }), _jsx(SuggestionText, { children: question }), _jsx(SuggestionArrow, { children: _jsx(IconArrowForward, { fontSize: 16 }) })] }, question))) })] })), _jsx(TMChatInput, { inputRef: inputRef, value: chatInput, onChange: setChatInput, onSend: askHandler, placeholder: hoveredSuggestion ?? 'Scrivi la tua domanda...', tooltip: "Invia", disabled: isThinking }), _jsx(FooterHint, { children: SDKUI_Localizator.HelpOnLineShiftEnterHint })] })] }));
238
+ return (_jsxs(PanelContainer, { $width: width, children: [_jsx(ResizeHandle, { onMouseDown: onResizeStart }), _jsxs(ChatHeader, { children: [_jsxs(HeaderLeft, { children: [_jsx(ToppyAvatar, { src: ToppyImage, alt: "Toppy" }), _jsxs(HeaderText, { children: [_jsxs(HeaderGreeting, { children: ["Ciao ", userName] }), _jsx(HeaderQuestion, { children: "Come posso aiutarti?" })] })] }), _jsxs(HeaderRight, { children: [_jsx(TMTooltip, { content: "Nuova conversazione", children: _jsx(HeaderButton, { onClick: onNewConversation, disabled: !conversationId && messages.length === 0, title: "Nuova conversazione", children: _jsx(IconNewChat, { color: "white", fontSize: 18 }) }) }), _jsx(TMTooltip, { content: "Chiudi", children: _jsx(HeaderButton, { onClick: onClose, title: "Chiudi", children: _jsx(IconClose, { fontSize: 18 }) }) })] })] }), _jsxs(ChatBody, { children: [messages.length === 0 ? (_jsxs(WelcomeMessage, { children: [_jsx(WelcomeIcon, { children: "\uD83D\uDCA1" }), _jsxs(WelcomeText, { children: ["Ciao! Sono ", _jsx("strong", { children: "Toppy" }), ", il tuo assistente.", _jsx("br", {}), "Fai una domanda e ti aiuter\u00F2 a trovare la risposta."] })] })) : (messages.map((msg, index) => (_jsxs(MessageBubble, { $isUser: msg.isUser, children: [!msg.isUser && _jsx(BotAvatar, { src: ToppyImage, alt: "Toppy" }), msg.isUser ? (_jsxs(_Fragment, { children: [_jsx(QuestionCopy, { children: _jsx(CopyButton, { text: msg.text }) }), _jsx(MessageContent, { $isUser: true, children: msg.text })] })) : (_jsxs(BotMessageColumn, { children: [_jsx(BotMessageContent, { $isUser: false, children: _jsx(MarkdownContent, { children: renderMarkdown(msg.text) }) }), msg.text !== NO_ANSWER_TEXT && msg.text !== ERROR_TEXT && (_jsx(MessageFeedback, { answer: msg.text, submittedRating: submittedRatings[msg.id], onSubmit: (rating, tags, feedback) => onFeedbackSubmit(index, rating, tags, feedback) }))] }))] }, msg.id)))), isThinking && (_jsxs(MessageBubble, { $isUser: false, children: [_jsx(BotAvatar, { src: ToppyImage, alt: "Toppy" }), _jsx(ThinkingStatus, {}, messages.length)] })), _jsx("div", { ref: messagesEndRef })] }), _jsxs(ChatFooter, { children: [showSuggestions && (_jsxs(SuggestionsSection, { children: [_jsxs(SuggestionsTitle, { children: [_jsx(IconSparkle, { fontSize: 14 }), _jsx("span", { children: "Domande suggerite" })] }), _jsx(SuggestionsGrid, { children: suggestions.map((question, index) => (_jsxs(SuggestionCard, { type: "button", $index: index, title: question, onClick: () => onSuggestionClick(question), onMouseEnter: () => setHoveredSuggestion(question), onMouseLeave: () => setHoveredSuggestion(undefined), onFocus: () => setHoveredSuggestion(question), onBlur: () => setHoveredSuggestion(undefined), children: [_jsx(SuggestionIcon, { children: _jsx(IconQuestion, { fontSize: 16 }) }), _jsx(SuggestionText, { children: question }), _jsx(SuggestionArrow, { children: _jsx(IconArrowForward, { fontSize: 16 }) })] }, question))) })] })), _jsx(TMChatInput, { inputRef: inputRef, value: chatInput, onChange: setChatInput, onSend: askHandler, placeholder: hoveredSuggestion ?? 'Scrivi la tua domanda...', tooltip: "Invia", disabled: isThinking }), _jsx(FooterHint, { children: SDKUI_Localizator.HelpOnLineShiftEnterHint })] })] }));
239
239
  };
240
240
  const TMChatInput = ({ value, onChange, onSend, placeholder = 'Scrivi la tua domanda...', disabled = false, inputRef, tooltip = 'Ricerca AI' }) => {
241
241
  const isDisabled = disabled || value.length < 2;
@@ -250,14 +250,24 @@ const TMChatInput = ({ value, onChange, onSend, placeholder = 'Scrivi la tua dom
250
250
  }
251
251
  } }), _jsx(TMTooltip, { content: tooltip, children: _jsx(InlineSendButton, { $disabled: isDisabled, disabled: isDisabled, onClick: onSend, title: tooltip, children: _jsx(IconSendFilled, { fontSize: 20 }) }) })] }));
252
252
  };
253
+ const CopyButton = ({ text }) => {
254
+ const [copied, setCopied] = useState(false);
255
+ const copiedTimerRef = useRef();
256
+ useEffect(() => () => clearTimeout(copiedTimerRef.current), []);
257
+ const onCopyClick = async () => {
258
+ if (!(await copyToClipboard(text)))
259
+ return;
260
+ setCopied(true);
261
+ clearTimeout(copiedTimerRef.current);
262
+ copiedTimerRef.current = setTimeout(() => setCopied(false), 2000);
263
+ };
264
+ return (_jsx(TMTooltip, { content: copied ? 'Copiato' : 'Copia', children: _jsx(FeedbackActionButton, { type: "button", $active: false, $locked: false, $success: copied, "aria-label": "Copia", onClick: onCopyClick, children: copied ? _jsx(IconCheck, { fontSize: 16 }) : _jsx(IconCopy, { fontSize: 16 }) }) }));
265
+ };
253
266
  const MessageFeedback = ({ answer, submittedRating, onSubmit }) => {
254
267
  const [draftRating, setDraftRating] = useState(undefined);
255
268
  const [selectedTags, setSelectedTags] = useState([]);
256
269
  const [feedback, setFeedback] = useState('');
257
- const [copied, setCopied] = useState(false);
258
- const copiedTimerRef = useRef();
259
270
  const panelRef = useRef(null);
260
- useEffect(() => () => clearTimeout(copiedTimerRef.current), []);
261
271
  useEffect(() => {
262
272
  if (draftRating)
263
273
  panelRef.current?.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
@@ -283,20 +293,13 @@ const MessageFeedback = ({ answer, submittedRating, onSubmit }) => {
283
293
  const onTagClick = (tag) => {
284
294
  setSelectedTags(prev => prev.includes(tag) ? prev.filter(t => t !== tag) : [...prev, tag]);
285
295
  };
286
- const onCopyClick = async () => {
287
- if (!(await copyToClipboard(answer)))
288
- return;
289
- setCopied(true);
290
- clearTimeout(copiedTimerRef.current);
291
- copiedTimerRef.current = setTimeout(() => setCopied(false), 2000);
292
- };
293
296
  const onSubmitClick = () => {
294
297
  if (!draftRating || !canSubmit)
295
298
  return;
296
299
  onSubmit(draftRating, selectedTags, feedback.trim());
297
300
  resetDraft();
298
301
  };
299
- return (_jsxs(FeedbackContainer, { children: [_jsxs(FeedbackActions, { children: [_jsx(TMTooltip, { content: "Mi piace", children: _jsx(FeedbackActionButton, { type: "button", $active: activeRating === 'like', $locked: isSubmitted, disabled: isSubmitted && submittedRating !== 'like', "aria-pressed": activeRating === 'like', "aria-label": "Mi piace", onClick: () => onRatingClick('like'), children: _jsx(IconThumbUp, { fontSize: 16 }) }) }), _jsx(TMTooltip, { content: "Non mi piace", children: _jsx(FeedbackActionButton, { type: "button", $active: activeRating === 'dislike', $locked: isSubmitted, disabled: isSubmitted && submittedRating !== 'dislike', "aria-pressed": activeRating === 'dislike', "aria-label": "Non mi piace", onClick: () => onRatingClick('dislike'), children: _jsx(IconThumbUp, { fontSize: 16, style: { transform: 'rotate(180deg)' } }) }) }), _jsx(TMTooltip, { content: copied ? 'Copiato' : 'Copia', children: _jsx(FeedbackActionButton, { type: "button", $active: false, $locked: false, $success: copied, "aria-label": "Copia", onClick: onCopyClick, children: copied ? _jsx(IconCheck, { fontSize: 16 }) : _jsx(IconCopy, { fontSize: 16 }) }) }), isSubmitted && (_jsxs(SentBadge, { role: "status", children: [_jsx(IconCheck, { fontSize: 12 }), "Inviato"] }))] }), !isSubmitted && draftRating && (_jsxs(FeedbackPanel, { ref: panelRef, children: [_jsxs(FeedbackPanelHeader, { children: [_jsx(FeedbackPanelTitle, { children: FEEDBACK_TITLES[draftRating] }), _jsx(FeedbackCloseButton, { type: "button", "aria-label": "Chiudi", title: "Chiudi", onClick: resetDraft, children: _jsx(IconClose, { fontSize: 16 }) })] }), _jsx(FeedbackLabel, { children: "Era..." }), _jsx(FeedbackTags, { children: FEEDBACK_TAGS[draftRating].map(tag => (_jsx(FeedbackTag, { type: "button", $selected: selectedTags.includes(tag), "aria-pressed": selectedTags.includes(tag), onClick: () => onTagClick(tag), children: tag }, tag))) }), _jsx(FeedbackLabel, { children: "Feedback aggiuntivo" }), _jsx(FeedbackTextarea, { value: feedback, maxLength: FEEDBACK_MAX_LENGTH, placeholder: "Raccontaci di pi\u00F9", onChange: (e) => setFeedback(e.target.value.slice(0, FEEDBACK_MAX_LENGTH)), onKeyDown: (e) => { if (e.key === 'Enter')
302
+ return (_jsxs(FeedbackContainer, { children: [_jsxs(FeedbackActions, { children: [_jsx(CopyButton, { text: answer }), isSubmitted && (_jsxs(SentBadge, { role: "status", children: [_jsx(IconCheck, { fontSize: 12 }), "Inviato"] }))] }), !isSubmitted && draftRating && (_jsxs(FeedbackPanel, { ref: panelRef, children: [_jsxs(FeedbackPanelHeader, { children: [_jsx(FeedbackPanelTitle, { children: FEEDBACK_TITLES[draftRating] }), _jsx(FeedbackCloseButton, { type: "button", "aria-label": "Chiudi", title: "Chiudi", onClick: resetDraft, children: _jsx(IconClose, { fontSize: 16 }) })] }), _jsx(FeedbackLabel, { children: "Era..." }), _jsx(FeedbackTags, { children: FEEDBACK_TAGS[draftRating].map(tag => (_jsx(FeedbackTag, { type: "button", $selected: selectedTags.includes(tag), "aria-pressed": selectedTags.includes(tag), onClick: () => onTagClick(tag), children: tag }, tag))) }), _jsx(FeedbackLabel, { children: "Feedback aggiuntivo" }), _jsx(FeedbackTextarea, { value: feedback, maxLength: FEEDBACK_MAX_LENGTH, placeholder: "Raccontaci di pi\u00F9", onChange: (e) => setFeedback(e.target.value.slice(0, FEEDBACK_MAX_LENGTH)), onKeyDown: (e) => { if (e.key === 'Enter')
300
303
  e.stopPropagation(); } }), _jsxs(FeedbackPanelFooter, { children: [_jsxs(FeedbackCounter, { $full: feedback.length >= FEEDBACK_MAX_LENGTH, children: [feedback.length, "/", FEEDBACK_MAX_LENGTH] }), _jsx(FeedbackSubmitButton, { type: "button", disabled: !canSubmit, onClick: onSubmitClick, children: "Invia" })] })] }, draftRating))] }));
301
304
  };
302
305
  //#endregion
@@ -565,807 +568,817 @@ function IconCheck(props) {
565
568
  }
566
569
  //#endregion
567
570
  //#region Styled Components
568
- const fadeIn = keyframes `
569
- from { opacity: 0; }
570
- to { opacity: 1; }
571
- `;
572
- const slideInRight = keyframes `
573
- from { transform: translateX(100%); }
574
- to { transform: translateX(0); }
575
- `;
576
- const phraseIn = keyframes `
577
- from { opacity: 0; transform: translateY(4px); }
578
- to { opacity: 1; transform: translateY(0); }
579
- `;
580
- const suggestionIn = keyframes `
581
- from { opacity: 0; transform: translateY(6px); }
582
- to { opacity: 1; transform: translateY(0); }
583
- `;
584
- const feedbackIn = keyframes `
585
- from { opacity: 0; transform: translateY(-4px); }
586
- to { opacity: 1; transform: translateY(0); }
587
- `;
588
- const badgeIn = keyframes `
589
- 0% { opacity: 0; transform: scale(0.85); }
590
- 60% { opacity: 1; transform: scale(1.05); }
591
- 100% { opacity: 1; transform: scale(1); }
592
- `;
593
- const dotCycle = keyframes `
594
- 0% { opacity: 0; }
595
- 25%, 75% { opacity: 1; }
596
- 100% { opacity: 0; }
597
- `;
598
- const ToppyHeaderButton = styled.button `
599
- display: flex;
600
- align-items: center;
601
- gap: 8px;
602
- height: 36px;
603
- padding: 0 14px 0 5px;
604
- border-radius: 18px;
605
- border: 1px solid ${TMColors.primary}35;
606
- background: ${TMColors.primary}0d;
607
- color: ${TMColors.primary};
608
- font-size: 13px;
609
- font-weight: 600;
610
- white-space: nowrap;
611
- cursor: pointer;
612
- flex-shrink: 0;
613
- transition: all 0.2s ease;
614
-
615
- &:hover {
616
- background: ${TMColors.primary}1a;
617
- border-color: ${TMColors.primary}66;
618
- transform: translateY(-1px);
619
- box-shadow: 0 4px 12px ${TMColors.primary}25;
620
- }
621
- &:active { transform: translateY(0); }
622
- `;
623
- const ToppyHeaderAvatar = styled.img `
624
- width: 28px;
625
- height: 28px;
626
- border-radius: 50%;
627
- object-fit: contain;
628
- pointer-events: none;
629
- `;
630
- const ToppyHeaderText = styled.span `
631
- line-height: 1;
632
- `;
633
- const Fab = styled.button `
634
- position: fixed;
635
- bottom: 24px;
636
- right: 24px;
637
- width: 60px;
638
- height: 60px;
639
- border-radius: 50%;
640
- border: none;
641
- padding: 0;
642
- cursor: pointer;
643
- display: flex;
644
- align-items: center;
645
- justify-content: center;
646
- background: white;
647
- box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
648
- z-index: 100000;
649
- transition: transform 0.2s ease, box-shadow 0.2s ease;
650
- animation: ${fadeIn} 0.3s ease-out;
651
-
652
- &:hover { transform: scale(1.08); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3); }
653
- &:active { transform: scale(0.96); }
654
- `;
655
- const FabAvatar = styled.img `
656
- width: 52px;
657
- height: 52px;
658
- border-radius: 50%;
659
- object-fit: contain;
660
- pointer-events: none;
661
- `;
662
- const Overlay = styled.div `
663
- position: fixed;
664
- inset: 0;
665
- background: rgba(0, 0, 0, 0.45);
666
- z-index: 100000;
667
- animation: ${fadeIn} 0.2s ease-out;
668
- `;
669
- const PanelContainer = styled.div `
670
- position: fixed;
671
- top: 0;
672
- right: 0;
673
- height: 100vh;
674
- width: ${props => props.$width}px;
675
- max-width: 100vw;
676
- background: white;
677
- display: flex;
678
- flex-direction: column;
679
- box-shadow: -8px 0 32px rgba(0, 0, 0, 0.28);
680
- z-index: 100001;
681
- animation: ${slideInRight} 0.25s ease-out;
682
- `;
683
- const ResizeHandle = styled.div `
684
- position: absolute;
685
- left: 0;
686
- top: 0;
687
- bottom: 0;
688
- width: 6px;
689
- cursor: col-resize;
690
- background: transparent;
691
- z-index: 2;
692
- transition: background 0.2s ease;
693
-
694
- &:hover { background: ${TMColors.primary}55; }
695
- `;
696
- const ChatHeader = styled.div `
697
- display: flex;
698
- align-items: center;
699
- justify-content: space-between;
700
- padding: 16px 20px;
701
- background: linear-gradient(135deg, ${TMColors.primary} 0%, ${TMColors.primary}dd 100%);
702
- color: white;
703
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
704
- `;
705
- const HeaderLeft = styled.div `
706
- display: flex;
707
- align-items: center;
708
- gap: 12px;
709
- flex: 1;
710
- min-width: 0;
711
- `;
712
- const HeaderRight = styled.div `
713
- display: flex;
714
- align-items: center;
715
- gap: 8px;
716
- margin-left: 12px;
717
- flex-shrink: 0;
718
- `;
719
- const ToppyAvatar = styled.img `
720
- width: 44px;
721
- height: 44px;
722
- border-radius: 50%;
723
- background: white;
724
- padding: 4px;
725
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
726
- flex-shrink: 0;
727
- object-fit: contain;
728
- `;
729
- const HeaderText = styled.div `
730
- display: flex;
731
- flex-direction: column;
732
- gap: 2px;
733
- min-width: 0;
734
- `;
735
- const HeaderGreeting = styled.h2 `
736
- margin: 0;
737
- font-size: 17px;
738
- font-weight: 600;
739
- color: white;
740
- white-space: nowrap;
741
- overflow: hidden;
742
- text-overflow: ellipsis;
743
- `;
744
- const HeaderQuestion = styled.p `
745
- margin: 0;
746
- font-size: 13px;
747
- color: rgba(255, 255, 255, 0.9);
748
- `;
749
- const HeaderButton = styled.button `
750
- width: 32px;
751
- height: 32px;
752
- border-radius: 50%;
753
- background: rgba(255, 255, 255, 0.2);
754
- border: 1px solid rgba(255, 255, 255, 0.3);
755
- color: white;
756
- cursor: pointer;
757
- display: flex;
758
- align-items: center;
759
- justify-content: center;
760
- flex-shrink: 0;
761
- transition: all 0.2s ease;
762
-
763
- &:hover:not(:disabled) { background: rgba(255, 255, 255, 0.3); transform: scale(1.05); }
764
- &:active:not(:disabled) { transform: scale(0.95); }
765
- &:disabled { opacity: 0.45; cursor: default; }
766
- `;
767
- const ChatBody = styled.div `
768
- flex: 1;
769
- padding: 20px;
770
- overflow-y: auto;
771
- background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
772
- `;
773
- const WelcomeMessage = styled.div `
774
- display: flex;
775
- gap: 16px;
776
- padding: 18px;
777
- background: white;
778
- border-radius: 12px;
779
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
780
- border-left: 4px solid ${TMColors.primary};
781
- animation: ${fadeIn} 0.5s ease-out;
782
- `;
783
- const WelcomeIcon = styled.div `
784
- font-size: 30px;
785
- flex-shrink: 0;
786
- `;
787
- const WelcomeText = styled.p `
788
- margin: 0;
789
- font-size: 14px;
790
- line-height: 1.6;
791
- color: #242424;
792
-
793
- strong { color: ${TMColors.primary}; font-weight: 600; }
794
- `;
795
- const MessageBubble = styled.div `
796
- display: flex;
797
- gap: 10px;
798
- margin-bottom: 16px;
799
- align-items: flex-start;
800
- justify-content: ${props => (props.$isUser ? 'flex-end' : 'flex-start')};
801
- animation: ${fadeIn} 0.3s ease-out;
802
- `;
803
- const BotAvatar = styled.img `
804
- width: 32px;
805
- height: 32px;
806
- border-radius: 50%;
807
- background: white;
808
- padding: 2px;
809
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
810
- flex-shrink: 0;
811
- object-fit: contain;
812
- `;
813
- const MessageContent = styled.div `
814
- max-width: 80%;
815
- padding: 10px 14px;
816
- border-radius: 12px;
817
- font-size: 14px;
818
- line-height: 1.5;
819
- background: ${props => (props.$isUser ? TMColors.primary : '#f0f2f5')};
820
- color: ${props => (props.$isUser ? 'white' : '#242424')};
821
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
822
- word-wrap: break-word;
823
- overflow-wrap: anywhere;
824
- white-space: ${props => (props.$isUser ? 'pre-wrap' : 'normal')};
825
- border-bottom-${props => (props.$isUser ? 'right' : 'left')}-radius: 4px;
826
- `;
827
- const BotMessageColumn = styled.div `
828
- display: flex;
829
- flex-direction: column;
830
- align-items: flex-start;
831
- width: 80%;
832
- min-width: 0;
833
- `;
834
- const BotMessageContent = styled(MessageContent) `
835
- max-width: 100%;
836
- `;
837
- const FeedbackContainer = styled.div `
838
- width: 100%;
839
- margin-top: 4px;
840
- `;
841
- const FeedbackActions = styled.div `
842
- display: flex;
843
- align-items: center;
844
- gap: 2px;
845
- `;
846
- const FeedbackActionButton = styled.button `
847
- display: flex;
848
- align-items: center;
849
- justify-content: center;
850
- width: 28px;
851
- height: 28px;
852
- padding: 0;
853
- border-radius: 8px;
854
- border: 1px solid ${props => (props.$active ? `${TMColors.primary}55` : 'transparent')};
855
- background: ${props => (props.$active ? `${TMColors.primary}12` : 'transparent')};
856
- color: ${props => (props.$success ? '#2e7d32' : props.$active ? TMColors.primary : '#8a8f98')};
857
- cursor: ${props => (props.$locked ? 'default' : 'pointer')};
858
- transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
859
-
860
- &:hover:not(:disabled) {
861
- background: ${props => (props.$active ? `${TMColors.primary}12` : 'rgba(0, 0, 0, 0.05)')};
862
- color: ${props => (props.$success ? '#2e7d32' : props.$active ? TMColors.primary : '#242424')};
863
- }
864
-
865
- &:focus-visible {
866
- outline: 2px solid ${TMColors.primary}55;
867
- outline-offset: 1px;
868
- }
869
-
870
- &:disabled {
871
- opacity: 0.35;
872
- cursor: default;
873
- }
874
- `;
875
- const SentBadge = styled.span `
876
- display: inline-flex;
877
- align-items: center;
878
- gap: 4px;
879
- margin-left: 6px;
880
- padding: 3px 9px 3px 7px;
881
- border-radius: 999px;
882
- background: #e8f5e9;
883
- border: 1px solid #c8e6c9;
884
- color: #2e7d32;
885
- font-size: 11px;
886
- font-weight: 600;
887
- line-height: 1;
888
- letter-spacing: 0.02em;
889
- animation: ${badgeIn} 0.35s ease-out;
890
-
891
- @media (prefers-reduced-motion: reduce) {
892
- animation: none;
893
- }
894
- `;
895
- const FeedbackPanel = styled.div `
896
- margin-top: 6px;
897
- padding: 14px 16px;
898
- border: 1px solid #e5e7eb;
899
- border-radius: 12px;
900
- background: white;
901
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
902
- scroll-margin: 12px;
903
- animation: ${feedbackIn} 0.2s ease-out;
904
- `;
905
- const FeedbackPanelHeader = styled.div `
906
- display: flex;
907
- align-items: flex-start;
908
- justify-content: space-between;
909
- gap: 12px;
910
- margin-bottom: 10px;
911
- `;
912
- const FeedbackPanelTitle = styled.div `
913
- font-size: 14px;
914
- font-weight: 600;
915
- color: #242424;
916
- line-height: 1.35;
917
- `;
918
- const FeedbackCloseButton = styled.button `
919
- display: flex;
920
- align-items: center;
921
- justify-content: center;
922
- width: 24px;
923
- height: 24px;
924
- padding: 0;
925
- border: none;
926
- border-radius: 6px;
927
- background: transparent;
928
- color: #6b7280;
929
- cursor: pointer;
930
- flex-shrink: 0;
931
- transition: background 0.2s ease, color 0.2s ease;
932
-
933
- &:hover { background: rgba(0, 0, 0, 0.06); color: #242424; }
934
- `;
935
- const FeedbackLabel = styled.div `
936
- margin: 0 0 8px 0;
937
- font-size: 12px;
938
- font-weight: 600;
939
- color: #6b7280;
940
- `;
941
- const FeedbackTags = styled.div `
942
- display: flex;
943
- flex-wrap: wrap;
944
- gap: 8px;
945
- margin-bottom: 14px;
946
- `;
947
- const FeedbackTag = styled.button `
948
- padding: 6px 12px;
949
- border-radius: 8px;
950
- border: 1px solid ${props => (props.$selected ? TMColors.primary : '#dcdfe3')};
951
- background: ${props => (props.$selected ? `${TMColors.primary}10` : 'white')};
952
- color: ${props => (props.$selected ? TMColors.primary : '#242424')};
953
- font-family: inherit;
954
- font-size: 13px;
955
- font-weight: ${props => (props.$selected ? 600 : 400)};
956
- line-height: 1.2;
957
- cursor: pointer;
958
- transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
959
-
960
- &:hover { border-color: ${TMColors.primary}88; }
961
-
962
- &:focus-visible {
963
- outline: 2px solid ${TMColors.primary}55;
964
- outline-offset: 1px;
965
- }
966
- `;
967
- const FeedbackTextarea = styled.textarea `
968
- display: block;
969
- width: 100%;
970
- min-height: 70px;
971
- padding: 9px 11px;
972
- border: 1px solid #dcdfe3;
973
- border-radius: 8px;
974
- font-family: inherit;
975
- font-size: 13px;
976
- line-height: 1.45;
977
- color: #242424;
978
- background: white;
979
- resize: none;
980
- box-sizing: border-box;
981
- transition: border-color 0.2s ease, box-shadow 0.2s ease;
982
-
983
- &::placeholder { color: #9ca3af; }
984
-
985
- &:focus {
986
- outline: none;
987
- border-color: ${TMColors.primary};
988
- box-shadow: 0 0 0 3px ${TMColors.primary}15;
989
- }
990
- `;
991
- const FeedbackPanelFooter = styled.div `
992
- display: flex;
993
- align-items: center;
994
- justify-content: space-between;
995
- margin-top: 10px;
996
- `;
997
- const FeedbackCounter = styled.span `
998
- font-size: 11px;
999
- color: ${props => (props.$full ? '#c62828' : '#9ca3af')};
1000
- font-variant-numeric: tabular-nums;
1001
- `;
1002
- const FeedbackSubmitButton = styled.button `
1003
- padding: 7px 18px;
1004
- border: none;
1005
- border-radius: 8px;
1006
- background: ${TMColors.primary};
1007
- color: white;
1008
- font-family: inherit;
1009
- font-size: 13px;
1010
- font-weight: 600;
1011
- cursor: pointer;
1012
- transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
1013
-
1014
- &:hover:not(:disabled) {
1015
- box-shadow: 0 4px 12px ${TMColors.primary}40;
1016
- transform: translateY(-1px);
1017
- }
1018
-
1019
- &:active:not(:disabled) { transform: translateY(0); }
1020
-
1021
- &:disabled {
1022
- opacity: 0.4;
1023
- cursor: default;
1024
- }
1025
- `;
1026
- const MarkdownContent = styled.div `
1027
- & > *:first-child { margin-top: 0; }
1028
- & > *:last-child { margin-bottom: 0; }
1029
-
1030
- a { color: ${TMColors.primary}; text-decoration: underline; }
1031
- strong { font-weight: 600; }
1032
- `;
1033
- const MdParagraph = styled.p `
1034
- margin: 0 0 8px 0;
1035
- line-height: 1.55;
1036
- `;
1037
- const MdHeading = styled.div `
1038
- margin: 12px 0 6px 0;
1039
- font-weight: 700;
1040
- line-height: 1.3;
1041
- font-size: ${props => `${Math.max(14, 20 - (props.$level - 1) * 2)}px`};
1042
- `;
1043
- const MdUl = styled.ul `
1044
- margin: 4px 0 8px 0;
1045
- padding-left: 20px;
1046
- li { margin: 2px 0; line-height: 1.5; }
1047
- `;
1048
- const MdOl = styled.ol `
1049
- margin: 4px 0 8px 0;
1050
- padding-left: 22px;
1051
- li { margin: 2px 0; line-height: 1.5; }
1052
- `;
1053
- const MdCode = styled.code `
1054
- background: rgba(0, 0, 0, 0.06);
1055
- padding: 1px 5px;
1056
- border-radius: 4px;
1057
- font-family: 'Consolas', 'Monaco', monospace;
1058
- font-size: 0.9em;
1059
- `;
1060
- const MdPre = styled.pre `
1061
- background: rgba(0, 0, 0, 0.06);
1062
- padding: 10px 12px;
1063
- border-radius: 8px;
1064
- overflow-x: auto;
1065
- margin: 8px 0;
1066
- font-family: 'Consolas', 'Monaco', monospace;
1067
- font-size: 0.88em;
1068
- white-space: pre;
1069
- `;
1070
- const MdTableWrapper = styled.div `
1071
- margin: 8px 0;
1072
- max-width: 100%;
1073
- overflow-x: auto;
1074
- border: 1px solid #dcdfe3;
1075
- border-radius: 8px;
1076
-
1077
- &::-webkit-scrollbar { height: 6px; }
1078
- &::-webkit-scrollbar-track { background: transparent; }
1079
- &::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
1080
- &::-webkit-scrollbar-thumb:hover { background: #999; }
1081
- `;
1082
- const MdTable = styled.table `
1083
- border-collapse: collapse;
1084
- width: 100%;
1085
- font-size: 0.92em;
1086
- background: white;
1087
- `;
1088
- const MdTh = styled.th `
1089
- padding: 7px 10px;
1090
- background: ${TMColors.primary}14;
1091
- color: #242424;
1092
- font-weight: 600;
1093
- text-align: ${props => props.$align ?? 'left'};
1094
- border-bottom: 1px solid #dcdfe3;
1095
- white-space: nowrap;
1096
-
1097
- &:not(:last-child) { border-right: 1px solid #e6e8eb; }
1098
- `;
1099
- const MdTd = styled.td `
1100
- padding: 7px 10px;
1101
- text-align: ${props => props.$align ?? 'left'};
1102
- vertical-align: top;
1103
- border-top: 1px solid #eceef0;
1104
-
1105
- &:not(:last-child) { border-right: 1px solid #eceef0; }
1106
-
1107
- tr:nth-child(even) & { background: #fafbfc; }
1108
- `;
1109
- const MdBlockquote = styled.blockquote `
1110
- margin: 8px 0;
1111
- padding: 6px 12px;
1112
- border-left: 3px solid ${TMColors.primary}66;
1113
- background: ${TMColors.primary}0a;
1114
- border-radius: 0 6px 6px 0;
1115
- color: #444;
1116
-
1117
- & > *:first-child { margin-top: 0; }
1118
- & > *:last-child { margin-bottom: 0; }
1119
- `;
1120
- const MdHr = styled.hr `
1121
- border: none;
1122
- border-top: 1px solid #dcdfe3;
1123
- margin: 12px 0;
1124
- `;
1125
- const ThinkingIndicator = styled.div `
1126
- display: flex;
1127
- align-items: center;
1128
- gap: 10px;
1129
- max-width: 80%;
1130
- padding: 7px 12px;
1131
- background: #f0f2f5;
1132
- border-radius: 12px;
1133
- border-bottom-left-radius: 4px;
1134
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1135
- `;
1136
- const ThinkingCaption = styled.div `
1137
- display: flex;
1138
- flex-direction: column;
1139
- align-items: flex-start;
1140
- gap: 0;
1141
- min-width: 0;
1142
- `;
1143
- const ThinkingPhrase = styled.span `
1144
- display: inline-flex;
1145
- align-items: center;
1146
- min-width: 0;
1147
- font-size: 12px;
1148
- font-style: italic;
1149
- line-height: 1.15;
1150
- color: #6b7280;
1151
- animation: ${phraseIn} 0.25s ease-out;
1152
- `;
1153
- const ThinkingDots = styled.span `
1154
- display: inline-flex;
1155
- width: 12px;
1156
- flex-shrink: 0;
1157
- `;
1158
- const ThinkingDot = styled.span `
1159
- animation: ${dotCycle} 1.2s linear infinite;
1160
- animation-delay: ${props => props.$delay}s;
1161
- will-change: opacity;
1162
-
1163
- @media (prefers-reduced-motion: reduce) {
1164
- animation: none;
1165
- opacity: 1;
1166
- }
1167
- `;
1168
- const ThinkingCounter = styled.span `
1169
- margin-top: 2px;
1170
- font-size: 10px;
1171
- font-weight: 600;
1172
- line-height: 1.1;
1173
- letter-spacing: 0.02em;
1174
- color: ${TMColors.primary}b3;
1175
- font-variant-numeric: tabular-nums;
1176
- font-feature-settings: 'tnum';
1177
- opacity: ${props => (props.$visible ? 1 : 0)};
1178
- transition: opacity 0.3s ease;
1179
- `;
1180
- const ChatFooter = styled.div `
1181
- padding: 16px 20px;
1182
- background: white;
1183
- border-top: 1px solid #e1e5e9;
1184
- box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
1185
- `;
1186
- const SuggestionsSection = styled.div `
1187
- margin-bottom: 14px;
1188
- `;
1189
- const SuggestionsTitle = styled.div `
1190
- display: flex;
1191
- align-items: center;
1192
- gap: 6px;
1193
- margin: 0 0 8px 2px;
1194
- font-size: 11px;
1195
- font-weight: 600;
1196
- letter-spacing: 0.06em;
1197
- text-transform: uppercase;
1198
- color: #6b7280;
1199
-
1200
- svg { color: ${TMColors.primary}; }
1201
- `;
1202
- const SuggestionsGrid = styled.div `
1203
- display: grid;
1204
- grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
1205
- gap: 8px;
1206
- `;
1207
- const SuggestionIcon = styled.span `
1208
- display: flex;
1209
- align-items: center;
1210
- justify-content: center;
1211
- width: 28px;
1212
- height: 28px;
1213
- border-radius: 8px;
1214
- flex-shrink: 0;
1215
- background: ${TMColors.primary}14;
1216
- color: ${TMColors.primary};
1217
- transition: background 0.2s ease, color 0.2s ease;
1218
- `;
1219
- const SuggestionText = styled.span `
1220
- flex: 1;
1221
- min-width: 0;
1222
- display: -webkit-box;
1223
- -webkit-line-clamp: 2;
1224
- -webkit-box-orient: vertical;
1225
- overflow: hidden;
1226
- `;
1227
- const SuggestionArrow = styled.span `
1228
- display: flex;
1229
- flex-shrink: 0;
1230
- color: ${TMColors.primary};
1231
- opacity: 0;
1232
- transform: translateX(-4px);
1233
- transition: opacity 0.2s ease, transform 0.2s ease;
1234
- `;
1235
- const SuggestionCard = styled.button `
1236
- display: flex;
1237
- align-items: center;
1238
- gap: 10px;
1239
- width: 100%;
1240
- min-height: 52px;
1241
- padding: 9px 12px;
1242
- border: 1px solid ${TMColors.primary}22;
1243
- border-radius: 12px;
1244
- background: linear-gradient(135deg, #ffffff 0%, ${TMColors.primary}08 100%);
1245
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
1246
- color: #242424;
1247
- font-family: inherit;
1248
- font-size: 13px;
1249
- line-height: 1.35;
1250
- text-align: left;
1251
- cursor: pointer;
1252
- opacity: 0;
1253
- animation: ${suggestionIn} 0.35s ease-out forwards;
1254
- animation-delay: ${props => props.$index * 70}ms;
1255
- transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
1256
-
1257
- &:hover, &:focus-visible {
1258
- border-color: ${TMColors.primary}66;
1259
- background: ${TMColors.primary}0d;
1260
- box-shadow: 0 4px 14px ${TMColors.primary}1f;
1261
- transform: translateY(-1px);
1262
- }
1263
-
1264
- &:hover ${SuggestionIcon}, &:focus-visible ${SuggestionIcon} {
1265
- background: ${TMColors.primary};
1266
- color: white;
1267
- }
1268
-
1269
- &:hover ${SuggestionArrow}, &:focus-visible ${SuggestionArrow} {
1270
- opacity: 1;
1271
- transform: translateX(0);
1272
- }
1273
-
1274
- &:focus-visible {
1275
- outline: 2px solid ${TMColors.primary}55;
1276
- outline-offset: 2px;
1277
- }
1278
-
1279
- &:active {
1280
- transform: translateY(0) scale(0.99);
1281
- }
1282
-
1283
- @media (prefers-reduced-motion: reduce) {
1284
- animation: none;
1285
- opacity: 1;
1286
- transition: none;
1287
- }
1288
- `;
1289
- const FooterHint = styled.p `
1290
- margin: 6px 0 0 0;
1291
- font-size: 11px;
1292
- color: #999;
1293
- text-align: center;
1294
- `;
1295
- const ChatInputWrapper = styled.div `
1296
- position: relative;
1297
- flex: 1;
1298
- display: flex;
1299
- `;
1300
- const ChatInputTextarea = styled.textarea `
1301
- width: 100%;
1302
- padding: 14px 60px 14px 16px;
1303
- border: 2px solid #e1e5e9;
1304
- border-radius: 12px;
1305
- font-size: 15px;
1306
- font-family: inherit;
1307
- line-height: 1.5;
1308
- transition: all 0.2s ease;
1309
- background: #f8f9fa;
1310
- resize: none;
1311
- min-height: 100px;
1312
- max-height: 120px;
1313
- overflow-y: hidden;
1314
-
1315
- &:focus {
1316
- outline: none;
1317
- border-color: ${TMColors.primary};
1318
- background: white;
1319
- box-shadow: 0 0 0 4px ${TMColors.primary}15;
1320
- }
1321
-
1322
- &::placeholder {
1323
- color: #999;
1324
- }
1325
-
1326
- &::-webkit-scrollbar {
1327
- width: 6px;
1328
- }
1329
-
1330
- &::-webkit-scrollbar-track {
1331
- background: transparent;
1332
- }
1333
-
1334
- &::-webkit-scrollbar-thumb {
1335
- background: #ccc;
1336
- border-radius: 3px;
1337
- }
1338
-
1339
- &::-webkit-scrollbar-thumb:hover {
1340
- background: #999;
1341
- }
1342
- `;
1343
- const InlineSendButton = styled.button `
1344
- position: absolute;
1345
- bottom: 8px;
1346
- right: 8px;
1347
- width: 40px;
1348
- height: 40px;
1349
- border-radius: 10px;
1350
- background: ${props => props.$disabled ? '#ccc' : '#4caf50'};
1351
- border: none;
1352
- color: white;
1353
- cursor: ${props => props.$disabled ? 'default' : 'pointer'};
1354
- display: flex;
1355
- align-items: center;
1356
- justify-content: center;
1357
- transition: all 0.2s ease;
1358
-
1359
- &:hover:not(:disabled) {
1360
- background: #45a049;
1361
- transform: scale(1.05);
1362
- }
1363
-
1364
- &:active:not(:disabled) {
1365
- transform: scale(0.95);
1366
- }
1367
-
1368
- &:disabled {
1369
- opacity: 0.6;
1370
- }
571
+ const fadeIn = keyframes `
572
+ from { opacity: 0; }
573
+ to { opacity: 1; }
574
+ `;
575
+ const slideInRight = keyframes `
576
+ from { transform: translateX(100%); }
577
+ to { transform: translateX(0); }
578
+ `;
579
+ const phraseIn = keyframes `
580
+ from { opacity: 0; transform: translateY(4px); }
581
+ to { opacity: 1; transform: translateY(0); }
582
+ `;
583
+ const suggestionIn = keyframes `
584
+ from { opacity: 0; transform: translateY(6px); }
585
+ to { opacity: 1; transform: translateY(0); }
586
+ `;
587
+ const feedbackIn = keyframes `
588
+ from { opacity: 0; transform: translateY(-4px); }
589
+ to { opacity: 1; transform: translateY(0); }
590
+ `;
591
+ const badgeIn = keyframes `
592
+ 0% { opacity: 0; transform: scale(0.85); }
593
+ 60% { opacity: 1; transform: scale(1.05); }
594
+ 100% { opacity: 1; transform: scale(1); }
595
+ `;
596
+ const dotCycle = keyframes `
597
+ 0% { opacity: 0; }
598
+ 25%, 75% { opacity: 1; }
599
+ 100% { opacity: 0; }
600
+ `;
601
+ const ToppyHeaderButton = styled.button `
602
+ display: flex;
603
+ align-items: center;
604
+ gap: 8px;
605
+ height: 36px;
606
+ padding: 0 14px 0 5px;
607
+ border-radius: 18px;
608
+ border: 1px solid ${TMColors.primary}35;
609
+ background: ${TMColors.primary}0d;
610
+ color: ${TMColors.primary};
611
+ font-size: 13px;
612
+ font-weight: 600;
613
+ white-space: nowrap;
614
+ cursor: pointer;
615
+ flex-shrink: 0;
616
+ transition: all 0.2s ease;
617
+
618
+ &:hover {
619
+ background: ${TMColors.primary}1a;
620
+ border-color: ${TMColors.primary}66;
621
+ transform: translateY(-1px);
622
+ box-shadow: 0 4px 12px ${TMColors.primary}25;
623
+ }
624
+ &:active { transform: translateY(0); }
625
+ `;
626
+ const ToppyHeaderAvatar = styled.img `
627
+ width: 28px;
628
+ height: 28px;
629
+ border-radius: 50%;
630
+ object-fit: contain;
631
+ pointer-events: none;
632
+ `;
633
+ const ToppyHeaderText = styled.span `
634
+ line-height: 1;
635
+ `;
636
+ const Fab = styled.button `
637
+ position: fixed;
638
+ bottom: 24px;
639
+ right: 24px;
640
+ width: 60px;
641
+ height: 60px;
642
+ border-radius: 50%;
643
+ border: none;
644
+ padding: 0;
645
+ cursor: pointer;
646
+ display: flex;
647
+ align-items: center;
648
+ justify-content: center;
649
+ background: white;
650
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
651
+ z-index: 100000;
652
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
653
+ animation: ${fadeIn} 0.3s ease-out;
654
+
655
+ &:hover { transform: scale(1.08); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3); }
656
+ &:active { transform: scale(0.96); }
657
+ `;
658
+ const FabAvatar = styled.img `
659
+ width: 52px;
660
+ height: 52px;
661
+ border-radius: 50%;
662
+ object-fit: contain;
663
+ pointer-events: none;
664
+ `;
665
+ const Overlay = styled.div `
666
+ position: fixed;
667
+ inset: 0;
668
+ background: rgba(0, 0, 0, 0.45);
669
+ z-index: 100000;
670
+ animation: ${fadeIn} 0.2s ease-out;
671
+ `;
672
+ const PanelContainer = styled.div `
673
+ position: fixed;
674
+ top: 0;
675
+ right: 0;
676
+ height: 100vh;
677
+ width: ${props => props.$width}px;
678
+ max-width: 100vw;
679
+ background: white;
680
+ display: flex;
681
+ flex-direction: column;
682
+ box-shadow: -8px 0 32px rgba(0, 0, 0, 0.28);
683
+ z-index: 100001;
684
+ animation: ${slideInRight} 0.25s ease-out;
685
+ `;
686
+ const ResizeHandle = styled.div `
687
+ position: absolute;
688
+ left: 0;
689
+ top: 0;
690
+ bottom: 0;
691
+ width: 6px;
692
+ cursor: col-resize;
693
+ background: transparent;
694
+ z-index: 2;
695
+ transition: background 0.2s ease;
696
+
697
+ &:hover { background: ${TMColors.primary}55; }
698
+ `;
699
+ const ChatHeader = styled.div `
700
+ display: flex;
701
+ align-items: center;
702
+ justify-content: space-between;
703
+ padding: 16px 20px;
704
+ background: linear-gradient(135deg, ${TMColors.primary} 0%, ${TMColors.primary}dd 100%);
705
+ color: white;
706
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
707
+ `;
708
+ const HeaderLeft = styled.div `
709
+ display: flex;
710
+ align-items: center;
711
+ gap: 12px;
712
+ flex: 1;
713
+ min-width: 0;
714
+ `;
715
+ const HeaderRight = styled.div `
716
+ display: flex;
717
+ align-items: center;
718
+ gap: 8px;
719
+ margin-left: 12px;
720
+ flex-shrink: 0;
721
+ `;
722
+ const ToppyAvatar = styled.img `
723
+ width: 44px;
724
+ height: 44px;
725
+ border-radius: 50%;
726
+ background: white;
727
+ padding: 4px;
728
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
729
+ flex-shrink: 0;
730
+ object-fit: contain;
731
+ `;
732
+ const HeaderText = styled.div `
733
+ display: flex;
734
+ flex-direction: column;
735
+ gap: 2px;
736
+ min-width: 0;
737
+ `;
738
+ const HeaderGreeting = styled.h2 `
739
+ margin: 0;
740
+ font-size: 17px;
741
+ font-weight: 600;
742
+ color: white;
743
+ white-space: nowrap;
744
+ overflow: hidden;
745
+ text-overflow: ellipsis;
746
+ `;
747
+ const HeaderQuestion = styled.p `
748
+ margin: 0;
749
+ font-size: 13px;
750
+ color: rgba(255, 255, 255, 0.9);
751
+ `;
752
+ const HeaderButton = styled.button `
753
+ width: 32px;
754
+ height: 32px;
755
+ border-radius: 50%;
756
+ background: rgba(255, 255, 255, 0.2);
757
+ border: 1px solid rgba(255, 255, 255, 0.3);
758
+ color: white;
759
+ cursor: pointer;
760
+ display: flex;
761
+ align-items: center;
762
+ justify-content: center;
763
+ flex-shrink: 0;
764
+ transition: all 0.2s ease;
765
+
766
+ &:hover:not(:disabled) { background: rgba(255, 255, 255, 0.3); transform: scale(1.05); }
767
+ &:active:not(:disabled) { transform: scale(0.95); }
768
+ &:disabled { opacity: 0.45; cursor: default; }
769
+ `;
770
+ const ChatBody = styled.div `
771
+ flex: 1;
772
+ padding: 20px;
773
+ overflow-y: auto;
774
+ background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
775
+ `;
776
+ const WelcomeMessage = styled.div `
777
+ display: flex;
778
+ gap: 16px;
779
+ padding: 18px;
780
+ background: white;
781
+ border-radius: 12px;
782
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
783
+ border-left: 4px solid ${TMColors.primary};
784
+ animation: ${fadeIn} 0.5s ease-out;
785
+ `;
786
+ const WelcomeIcon = styled.div `
787
+ font-size: 30px;
788
+ flex-shrink: 0;
789
+ `;
790
+ const WelcomeText = styled.p `
791
+ margin: 0;
792
+ font-size: 14px;
793
+ line-height: 1.6;
794
+ color: #242424;
795
+
796
+ strong { color: ${TMColors.primary}; font-weight: 600; }
797
+ `;
798
+ const MessageBubble = styled.div `
799
+ display: flex;
800
+ gap: 10px;
801
+ margin-bottom: 16px;
802
+ align-items: flex-start;
803
+ justify-content: ${props => (props.$isUser ? 'flex-end' : 'flex-start')};
804
+ animation: ${fadeIn} 0.3s ease-out;
805
+ `;
806
+ const BotAvatar = styled.img `
807
+ width: 32px;
808
+ height: 32px;
809
+ border-radius: 50%;
810
+ background: white;
811
+ padding: 2px;
812
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
813
+ flex-shrink: 0;
814
+ object-fit: contain;
815
+ `;
816
+ const MessageContent = styled.div `
817
+ max-width: 80%;
818
+ padding: 10px 14px;
819
+ border-radius: 12px;
820
+ font-size: 14px;
821
+ line-height: 1.5;
822
+ background: ${props => (props.$isUser ? TMColors.primary : '#f0f2f5')};
823
+ color: ${props => (props.$isUser ? 'white' : '#242424')};
824
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
825
+ word-wrap: break-word;
826
+ overflow-wrap: anywhere;
827
+ white-space: ${props => (props.$isUser ? 'pre-wrap' : 'normal')};
828
+ border-bottom-${props => (props.$isUser ? 'right' : 'left')}-radius: 4px;
829
+ `;
830
+ const BotMessageColumn = styled.div `
831
+ display: flex;
832
+ flex-direction: column;
833
+ align-items: flex-start;
834
+ width: 80%;
835
+ min-width: 0;
836
+ `;
837
+ const BotMessageContent = styled(MessageContent) `
838
+ max-width: 100%;
839
+ `;
840
+ const QuestionCopy = styled.div `
841
+ align-self: center;
842
+ flex-shrink: 0;
843
+ opacity: 0.55;
844
+ transition: opacity 0.2s ease;
845
+
846
+ ${MessageBubble}:hover &, &:focus-within {
847
+ opacity: 1;
848
+ }
849
+ `;
850
+ const FeedbackContainer = styled.div `
851
+ width: 100%;
852
+ margin-top: 4px;
853
+ `;
854
+ const FeedbackActions = styled.div `
855
+ display: flex;
856
+ align-items: center;
857
+ gap: 2px;
858
+ `;
859
+ const FeedbackActionButton = styled.button `
860
+ display: flex;
861
+ align-items: center;
862
+ justify-content: center;
863
+ width: 28px;
864
+ height: 28px;
865
+ padding: 0;
866
+ border-radius: 8px;
867
+ border: 1px solid ${props => (props.$active ? `${TMColors.primary}55` : 'transparent')};
868
+ background: ${props => (props.$active ? `${TMColors.primary}12` : 'transparent')};
869
+ color: ${props => (props.$success ? '#2e7d32' : props.$active ? TMColors.primary : '#8a8f98')};
870
+ cursor: ${props => (props.$locked ? 'default' : 'pointer')};
871
+ transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
872
+
873
+ &:hover:not(:disabled) {
874
+ background: ${props => (props.$active ? `${TMColors.primary}12` : 'rgba(0, 0, 0, 0.05)')};
875
+ color: ${props => (props.$success ? '#2e7d32' : props.$active ? TMColors.primary : '#242424')};
876
+ }
877
+
878
+ &:focus-visible {
879
+ outline: 2px solid ${TMColors.primary}55;
880
+ outline-offset: 1px;
881
+ }
882
+
883
+ &:disabled {
884
+ opacity: 0.35;
885
+ cursor: default;
886
+ }
887
+ `;
888
+ const SentBadge = styled.span `
889
+ display: inline-flex;
890
+ align-items: center;
891
+ gap: 4px;
892
+ margin-left: 6px;
893
+ padding: 3px 9px 3px 7px;
894
+ border-radius: 999px;
895
+ background: #e8f5e9;
896
+ border: 1px solid #c8e6c9;
897
+ color: #2e7d32;
898
+ font-size: 11px;
899
+ font-weight: 600;
900
+ line-height: 1;
901
+ letter-spacing: 0.02em;
902
+ animation: ${badgeIn} 0.35s ease-out;
903
+
904
+ @media (prefers-reduced-motion: reduce) {
905
+ animation: none;
906
+ }
907
+ `;
908
+ const FeedbackPanel = styled.div `
909
+ margin-top: 6px;
910
+ padding: 14px 16px;
911
+ border: 1px solid #e5e7eb;
912
+ border-radius: 12px;
913
+ background: white;
914
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
915
+ scroll-margin: 12px;
916
+ animation: ${feedbackIn} 0.2s ease-out;
917
+ `;
918
+ const FeedbackPanelHeader = styled.div `
919
+ display: flex;
920
+ align-items: flex-start;
921
+ justify-content: space-between;
922
+ gap: 12px;
923
+ margin-bottom: 10px;
924
+ `;
925
+ const FeedbackPanelTitle = styled.div `
926
+ font-size: 14px;
927
+ font-weight: 600;
928
+ color: #242424;
929
+ line-height: 1.35;
930
+ `;
931
+ const FeedbackCloseButton = styled.button `
932
+ display: flex;
933
+ align-items: center;
934
+ justify-content: center;
935
+ width: 24px;
936
+ height: 24px;
937
+ padding: 0;
938
+ border: none;
939
+ border-radius: 6px;
940
+ background: transparent;
941
+ color: #6b7280;
942
+ cursor: pointer;
943
+ flex-shrink: 0;
944
+ transition: background 0.2s ease, color 0.2s ease;
945
+
946
+ &:hover { background: rgba(0, 0, 0, 0.06); color: #242424; }
947
+ `;
948
+ const FeedbackLabel = styled.div `
949
+ margin: 0 0 8px 0;
950
+ font-size: 12px;
951
+ font-weight: 600;
952
+ color: #6b7280;
953
+ `;
954
+ const FeedbackTags = styled.div `
955
+ display: flex;
956
+ flex-wrap: wrap;
957
+ gap: 8px;
958
+ margin-bottom: 14px;
959
+ `;
960
+ const FeedbackTag = styled.button `
961
+ padding: 6px 12px;
962
+ border-radius: 8px;
963
+ border: 1px solid ${props => (props.$selected ? TMColors.primary : '#dcdfe3')};
964
+ background: ${props => (props.$selected ? `${TMColors.primary}10` : 'white')};
965
+ color: ${props => (props.$selected ? TMColors.primary : '#242424')};
966
+ font-family: inherit;
967
+ font-size: 13px;
968
+ font-weight: ${props => (props.$selected ? 600 : 400)};
969
+ line-height: 1.2;
970
+ cursor: pointer;
971
+ transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
972
+
973
+ &:hover { border-color: ${TMColors.primary}88; }
974
+
975
+ &:focus-visible {
976
+ outline: 2px solid ${TMColors.primary}55;
977
+ outline-offset: 1px;
978
+ }
979
+ `;
980
+ const FeedbackTextarea = styled.textarea `
981
+ display: block;
982
+ width: 100%;
983
+ min-height: 70px;
984
+ padding: 9px 11px;
985
+ border: 1px solid #dcdfe3;
986
+ border-radius: 8px;
987
+ font-family: inherit;
988
+ font-size: 13px;
989
+ line-height: 1.45;
990
+ color: #242424;
991
+ background: white;
992
+ resize: none;
993
+ box-sizing: border-box;
994
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
995
+
996
+ &::placeholder { color: #9ca3af; }
997
+
998
+ &:focus {
999
+ outline: none;
1000
+ border-color: ${TMColors.primary};
1001
+ box-shadow: 0 0 0 3px ${TMColors.primary}15;
1002
+ }
1003
+ `;
1004
+ const FeedbackPanelFooter = styled.div `
1005
+ display: flex;
1006
+ align-items: center;
1007
+ justify-content: space-between;
1008
+ margin-top: 10px;
1009
+ `;
1010
+ const FeedbackCounter = styled.span `
1011
+ font-size: 11px;
1012
+ color: ${props => (props.$full ? '#c62828' : '#9ca3af')};
1013
+ font-variant-numeric: tabular-nums;
1014
+ `;
1015
+ const FeedbackSubmitButton = styled.button `
1016
+ padding: 7px 18px;
1017
+ border: none;
1018
+ border-radius: 8px;
1019
+ background: ${TMColors.primary};
1020
+ color: white;
1021
+ font-family: inherit;
1022
+ font-size: 13px;
1023
+ font-weight: 600;
1024
+ cursor: pointer;
1025
+ transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
1026
+
1027
+ &:hover:not(:disabled) {
1028
+ box-shadow: 0 4px 12px ${TMColors.primary}40;
1029
+ transform: translateY(-1px);
1030
+ }
1031
+
1032
+ &:active:not(:disabled) { transform: translateY(0); }
1033
+
1034
+ &:disabled {
1035
+ opacity: 0.4;
1036
+ cursor: default;
1037
+ }
1038
+ `;
1039
+ const MarkdownContent = styled.div `
1040
+ & > *:first-child { margin-top: 0; }
1041
+ & > *:last-child { margin-bottom: 0; }
1042
+
1043
+ a { color: ${TMColors.primary}; text-decoration: underline; }
1044
+ strong { font-weight: 600; }
1045
+ `;
1046
+ const MdParagraph = styled.p `
1047
+ margin: 0 0 8px 0;
1048
+ line-height: 1.55;
1049
+ `;
1050
+ const MdHeading = styled.div `
1051
+ margin: 12px 0 6px 0;
1052
+ font-weight: 700;
1053
+ line-height: 1.3;
1054
+ font-size: ${props => `${Math.max(14, 20 - (props.$level - 1) * 2)}px`};
1055
+ `;
1056
+ const MdUl = styled.ul `
1057
+ margin: 4px 0 8px 0;
1058
+ padding-left: 20px;
1059
+ li { margin: 2px 0; line-height: 1.5; }
1060
+ `;
1061
+ const MdOl = styled.ol `
1062
+ margin: 4px 0 8px 0;
1063
+ padding-left: 22px;
1064
+ li { margin: 2px 0; line-height: 1.5; }
1065
+ `;
1066
+ const MdCode = styled.code `
1067
+ background: rgba(0, 0, 0, 0.06);
1068
+ padding: 1px 5px;
1069
+ border-radius: 4px;
1070
+ font-family: 'Consolas', 'Monaco', monospace;
1071
+ font-size: 0.9em;
1072
+ `;
1073
+ const MdPre = styled.pre `
1074
+ background: rgba(0, 0, 0, 0.06);
1075
+ padding: 10px 12px;
1076
+ border-radius: 8px;
1077
+ overflow-x: auto;
1078
+ margin: 8px 0;
1079
+ font-family: 'Consolas', 'Monaco', monospace;
1080
+ font-size: 0.88em;
1081
+ white-space: pre;
1082
+ `;
1083
+ const MdTableWrapper = styled.div `
1084
+ margin: 8px 0;
1085
+ max-width: 100%;
1086
+ overflow-x: auto;
1087
+ border: 1px solid #dcdfe3;
1088
+ border-radius: 8px;
1089
+
1090
+ &::-webkit-scrollbar { height: 6px; }
1091
+ &::-webkit-scrollbar-track { background: transparent; }
1092
+ &::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
1093
+ &::-webkit-scrollbar-thumb:hover { background: #999; }
1094
+ `;
1095
+ const MdTable = styled.table `
1096
+ border-collapse: collapse;
1097
+ width: 100%;
1098
+ font-size: 0.92em;
1099
+ background: white;
1100
+ `;
1101
+ const MdTh = styled.th `
1102
+ padding: 7px 10px;
1103
+ background: ${TMColors.primary}14;
1104
+ color: #242424;
1105
+ font-weight: 600;
1106
+ text-align: ${props => props.$align ?? 'left'};
1107
+ border-bottom: 1px solid #dcdfe3;
1108
+ white-space: nowrap;
1109
+
1110
+ &:not(:last-child) { border-right: 1px solid #e6e8eb; }
1111
+ `;
1112
+ const MdTd = styled.td `
1113
+ padding: 7px 10px;
1114
+ text-align: ${props => props.$align ?? 'left'};
1115
+ vertical-align: top;
1116
+ border-top: 1px solid #eceef0;
1117
+
1118
+ &:not(:last-child) { border-right: 1px solid #eceef0; }
1119
+
1120
+ tr:nth-child(even) & { background: #fafbfc; }
1121
+ `;
1122
+ const MdBlockquote = styled.blockquote `
1123
+ margin: 8px 0;
1124
+ padding: 6px 12px;
1125
+ border-left: 3px solid ${TMColors.primary}66;
1126
+ background: ${TMColors.primary}0a;
1127
+ border-radius: 0 6px 6px 0;
1128
+ color: #444;
1129
+
1130
+ & > *:first-child { margin-top: 0; }
1131
+ & > *:last-child { margin-bottom: 0; }
1132
+ `;
1133
+ const MdHr = styled.hr `
1134
+ border: none;
1135
+ border-top: 1px solid #dcdfe3;
1136
+ margin: 12px 0;
1137
+ `;
1138
+ const ThinkingIndicator = styled.div `
1139
+ display: flex;
1140
+ align-items: center;
1141
+ gap: 10px;
1142
+ max-width: 80%;
1143
+ padding: 7px 12px;
1144
+ background: #f0f2f5;
1145
+ border-radius: 12px;
1146
+ border-bottom-left-radius: 4px;
1147
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1148
+ `;
1149
+ const ThinkingCaption = styled.div `
1150
+ display: flex;
1151
+ flex-direction: column;
1152
+ align-items: flex-start;
1153
+ gap: 0;
1154
+ min-width: 0;
1155
+ `;
1156
+ const ThinkingPhrase = styled.span `
1157
+ display: inline-flex;
1158
+ align-items: center;
1159
+ min-width: 0;
1160
+ font-size: 12px;
1161
+ font-style: italic;
1162
+ line-height: 1.15;
1163
+ color: #6b7280;
1164
+ animation: ${phraseIn} 0.25s ease-out;
1165
+ `;
1166
+ const ThinkingDots = styled.span `
1167
+ display: inline-flex;
1168
+ width: 12px;
1169
+ flex-shrink: 0;
1170
+ `;
1171
+ const ThinkingDot = styled.span `
1172
+ animation: ${dotCycle} 1.2s linear infinite;
1173
+ animation-delay: ${props => props.$delay}s;
1174
+ will-change: opacity;
1175
+
1176
+ @media (prefers-reduced-motion: reduce) {
1177
+ animation: none;
1178
+ opacity: 1;
1179
+ }
1180
+ `;
1181
+ const ThinkingCounter = styled.span `
1182
+ margin-top: 2px;
1183
+ font-size: 10px;
1184
+ font-weight: 600;
1185
+ line-height: 1.1;
1186
+ letter-spacing: 0.02em;
1187
+ color: ${TMColors.primary}b3;
1188
+ font-variant-numeric: tabular-nums;
1189
+ font-feature-settings: 'tnum';
1190
+ opacity: ${props => (props.$visible ? 1 : 0)};
1191
+ transition: opacity 0.3s ease;
1192
+ `;
1193
+ const ChatFooter = styled.div `
1194
+ padding: 16px 20px;
1195
+ background: white;
1196
+ border-top: 1px solid #e1e5e9;
1197
+ box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
1198
+ `;
1199
+ const SuggestionsSection = styled.div `
1200
+ margin-bottom: 14px;
1201
+ `;
1202
+ const SuggestionsTitle = styled.div `
1203
+ display: flex;
1204
+ align-items: center;
1205
+ gap: 6px;
1206
+ margin: 0 0 8px 2px;
1207
+ font-size: 11px;
1208
+ font-weight: 600;
1209
+ letter-spacing: 0.06em;
1210
+ text-transform: uppercase;
1211
+ color: #6b7280;
1212
+
1213
+ svg { color: ${TMColors.primary}; }
1214
+ `;
1215
+ const SuggestionsGrid = styled.div `
1216
+ display: grid;
1217
+ grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
1218
+ gap: 8px;
1219
+ `;
1220
+ const SuggestionIcon = styled.span `
1221
+ display: flex;
1222
+ align-items: center;
1223
+ justify-content: center;
1224
+ width: 28px;
1225
+ height: 28px;
1226
+ border-radius: 8px;
1227
+ flex-shrink: 0;
1228
+ background: ${TMColors.primary}14;
1229
+ color: ${TMColors.primary};
1230
+ transition: background 0.2s ease, color 0.2s ease;
1231
+ `;
1232
+ const SuggestionText = styled.span `
1233
+ flex: 1;
1234
+ min-width: 0;
1235
+ display: -webkit-box;
1236
+ -webkit-line-clamp: 2;
1237
+ -webkit-box-orient: vertical;
1238
+ overflow: hidden;
1239
+ `;
1240
+ const SuggestionArrow = styled.span `
1241
+ display: flex;
1242
+ flex-shrink: 0;
1243
+ color: ${TMColors.primary};
1244
+ opacity: 0;
1245
+ transform: translateX(-4px);
1246
+ transition: opacity 0.2s ease, transform 0.2s ease;
1247
+ `;
1248
+ const SuggestionCard = styled.button `
1249
+ display: flex;
1250
+ align-items: center;
1251
+ gap: 10px;
1252
+ width: 100%;
1253
+ min-height: 52px;
1254
+ padding: 9px 12px;
1255
+ border: 1px solid ${TMColors.primary}22;
1256
+ border-radius: 12px;
1257
+ background: linear-gradient(135deg, #ffffff 0%, ${TMColors.primary}08 100%);
1258
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
1259
+ color: #242424;
1260
+ font-family: inherit;
1261
+ font-size: 13px;
1262
+ line-height: 1.35;
1263
+ text-align: left;
1264
+ cursor: pointer;
1265
+ opacity: 0;
1266
+ animation: ${suggestionIn} 0.35s ease-out forwards;
1267
+ animation-delay: ${props => props.$index * 70}ms;
1268
+ transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
1269
+
1270
+ &:hover, &:focus-visible {
1271
+ border-color: ${TMColors.primary}66;
1272
+ background: ${TMColors.primary}0d;
1273
+ box-shadow: 0 4px 14px ${TMColors.primary}1f;
1274
+ transform: translateY(-1px);
1275
+ }
1276
+
1277
+ &:hover ${SuggestionIcon}, &:focus-visible ${SuggestionIcon} {
1278
+ background: ${TMColors.primary};
1279
+ color: white;
1280
+ }
1281
+
1282
+ &:hover ${SuggestionArrow}, &:focus-visible ${SuggestionArrow} {
1283
+ opacity: 1;
1284
+ transform: translateX(0);
1285
+ }
1286
+
1287
+ &:focus-visible {
1288
+ outline: 2px solid ${TMColors.primary}55;
1289
+ outline-offset: 2px;
1290
+ }
1291
+
1292
+ &:active {
1293
+ transform: translateY(0) scale(0.99);
1294
+ }
1295
+
1296
+ @media (prefers-reduced-motion: reduce) {
1297
+ animation: none;
1298
+ opacity: 1;
1299
+ transition: none;
1300
+ }
1301
+ `;
1302
+ const FooterHint = styled.p `
1303
+ margin: 6px 0 0 0;
1304
+ font-size: 11px;
1305
+ color: #999;
1306
+ text-align: center;
1307
+ `;
1308
+ const ChatInputWrapper = styled.div `
1309
+ position: relative;
1310
+ flex: 1;
1311
+ display: flex;
1312
+ `;
1313
+ const ChatInputTextarea = styled.textarea `
1314
+ width: 100%;
1315
+ padding: 14px 60px 14px 16px;
1316
+ border: 2px solid #e1e5e9;
1317
+ border-radius: 12px;
1318
+ font-size: 15px;
1319
+ font-family: inherit;
1320
+ line-height: 1.5;
1321
+ transition: all 0.2s ease;
1322
+ background: #f8f9fa;
1323
+ resize: none;
1324
+ min-height: 100px;
1325
+ max-height: 120px;
1326
+ overflow-y: hidden;
1327
+
1328
+ &:focus {
1329
+ outline: none;
1330
+ border-color: ${TMColors.primary};
1331
+ background: white;
1332
+ box-shadow: 0 0 0 4px ${TMColors.primary}15;
1333
+ }
1334
+
1335
+ &::placeholder {
1336
+ color: #999;
1337
+ }
1338
+
1339
+ &::-webkit-scrollbar {
1340
+ width: 6px;
1341
+ }
1342
+
1343
+ &::-webkit-scrollbar-track {
1344
+ background: transparent;
1345
+ }
1346
+
1347
+ &::-webkit-scrollbar-thumb {
1348
+ background: #ccc;
1349
+ border-radius: 3px;
1350
+ }
1351
+
1352
+ &::-webkit-scrollbar-thumb:hover {
1353
+ background: #999;
1354
+ }
1355
+ `;
1356
+ const InlineSendButton = styled.button `
1357
+ position: absolute;
1358
+ bottom: 8px;
1359
+ right: 8px;
1360
+ width: 40px;
1361
+ height: 40px;
1362
+ border-radius: 10px;
1363
+ background: ${props => props.$disabled ? '#ccc' : '#4caf50'};
1364
+ border: none;
1365
+ color: white;
1366
+ cursor: ${props => props.$disabled ? 'default' : 'pointer'};
1367
+ display: flex;
1368
+ align-items: center;
1369
+ justify-content: center;
1370
+ transition: all 0.2s ease;
1371
+
1372
+ &:hover:not(:disabled) {
1373
+ background: #45a049;
1374
+ transform: scale(1.05);
1375
+ }
1376
+
1377
+ &:active:not(:disabled) {
1378
+ transform: scale(0.95);
1379
+ }
1380
+
1381
+ &:disabled {
1382
+ opacity: 0.6;
1383
+ }
1371
1384
  `;