Spaces:
Runtime error
Runtime error
| hr.append-display { | |
| margin: 8px 0; | |
| border: none; | |
| height: 1px; | |
| border-top-width: 0; | |
| background-image: linear-gradient(to right, rgba(50,50,50, 0.1), rgba(150, 150, 150, 0.8), rgba(50,50,50, 0.1)); | |
| } | |
| .source-a { | |
| font-size: 0.8em; | |
| max-width: 100%; | |
| margin: 0; | |
| display: flex; | |
| flex-direction: row; | |
| flex-wrap: wrap; | |
| align-items: center; | |
| /* background-color: #dddddd88; */ | |
| border-radius: 1.5rem; | |
| padding: 0.2em; | |
| } | |
| .source-a a { | |
| display: inline-block; | |
| background-color: #aaaaaa50; | |
| border-radius: 1rem; | |
| padding: 0.5em; | |
| text-align: center; | |
| text-overflow: ellipsis; | |
| overflow: hidden; | |
| min-width: 20%; | |
| white-space: nowrap; | |
| margin: 0.2rem 0.1rem; | |
| text-decoration: none ; | |
| flex: 1; | |
| transition: flex 0.5s; | |
| } | |
| .source-a a:hover { | |
| background-color: #aaaaaa20; | |
| flex: 2; | |
| } | |
| /* 川虎助理 */ | |
| .agent-prefix { | |
| font-size: smaller; | |
| opacity: 0.6; | |
| padding: 6px 0 4px; | |
| } | |
| .agent-prefix::before { | |
| content: '🐯'; | |
| filter: grayscale(); | |
| padding: 0 4px; | |
| } | |
| /* 亮色(默认) */ | |
| #chuanhu-chatbot { | |
| background-color: var(--chatbot-background-color-light) ; | |
| color: var(--chatbot-color-light) ; | |
| } | |
| [data-testid = "bot"] { | |
| background-color: var(--message-bot-background-color-light) ; | |
| } | |
| [data-testid = "user"] { | |
| background-color: var(--message-user-background-color-light) ; | |
| } | |
| /* 暗色 */ | |
| .dark #chuanhu-chatbot { | |
| background-color: var(--chatbot-background-color-dark) ; | |
| color: var(--chatbot-color-dark) ; | |
| } | |
| .dark [data-testid = "bot"] { | |
| background-color: var(--message-bot-background-color-dark) ; | |
| } | |
| .dark [data-testid = "user"] { | |
| background-color: var(--message-user-background-color-dark) ; | |
| } | |
| /* 对话气泡 */ | |
| .message { | |
| border-radius: var(--radius-xl) ; | |
| border: none; | |
| padding: var(--spacing-xl) ; | |
| font-size: var(--text-md) ; | |
| line-height: var(--line-md) ; | |
| min-height: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl)); | |
| min-width: calc(var(--text-md)*var(--line-md) + 2*var(--spacing-xl)); | |
| } | |
| [data-testid = "bot"] { | |
| max-width: calc(85% - 38px); | |
| border-top-left-radius: 0 ; | |
| } | |
| [data-testid = "user"] { | |
| max-width: calc(85% - 38px); | |
| width: auto ; | |
| border-top-right-radius: 0 ; | |
| } | |
| /* 屏幕宽度大于等于500px的设备 */ | |
| /* update on 2023.4.8: 高度的细致调整已写入JavaScript */ | |
| @media screen and (min-width: 500px) { | |
| #chuanhu-chatbot { | |
| height: calc(100vh - 200px); | |
| } | |
| #chuanhu-chatbot>.wrapper>.wrap { | |
| max-height: calc(100vh - 200px - var(--line-sm)*1rem - 2*var(--block-label-margin) ); | |
| } | |
| } | |
| /* 屏幕宽度小于500px的设备 */ | |
| @media screen and (max-width: 499px) { | |
| #chuanhu-chatbot { | |
| height: calc(100vh - 140px); | |
| } | |
| #chuanhu-chatbot>.wrapper>.wrap { | |
| max-height: calc(100vh - 140px - var(--line-sm)*1rem - 2*var(--block-label-margin) ); | |
| } | |
| [data-testid = "bot"] { | |
| max-width: calc(98% - 20px) ; | |
| } | |
| .chatbot-avatar { | |
| display: none; | |
| } | |
| #app-title h1{ | |
| letter-spacing: -1px; font-size: 22px; | |
| } | |
| } | |
| #chuanhu-chatbot>.wrapper>.wrap { | |
| overflow-x: hidden; | |
| } | |
| .message.user p { | |
| white-space: pre-wrap; | |
| } | |
| .message .user-message { | |
| display: block; | |
| padding: 0 ; | |
| white-space: pre-wrap; | |
| } | |
| .message .md-message p { | |
| margin-top: 0.6em ; | |
| margin-bottom: 0.6em ; | |
| } | |
| .message .md-message p:first-child { margin-top: 0 ; } | |
| .message .md-message p:last-of-type { margin-bottom: 0 ; } | |
| .message .md-message { | |
| display: block; | |
| padding: 0 ; | |
| } | |
| .message .raw-message p { | |
| margin:0 ; | |
| } | |
| .message .raw-message { | |
| display: block; | |
| padding: 0 ; | |
| white-space: pre-wrap; | |
| } | |
| .message .hideM { | |
| display: none; | |
| } | |
| /* custom buttons */ | |
| .chuanhu-btn { | |
| border-radius: 5px; | |
| /* background-color: #E6E6E6 !important; */ | |
| color: rgba(120, 120, 120, 0.64) ; | |
| padding: 4px ; | |
| position: absolute; | |
| right: -22px; | |
| cursor: pointer ; | |
| transition: color .2s ease, background-color .2s ease; | |
| } | |
| .chuanhu-btn:hover { | |
| background-color: rgba(167, 167, 167, 0.25) ; | |
| color: unset ; | |
| } | |
| .chuanhu-btn:active { | |
| background-color: rgba(167, 167, 167, 0.5) ; | |
| } | |
| .chuanhu-btn:focus { | |
| outline: none; | |
| } | |
| .copy-bot-btn { | |
| /* top: 18px; */ | |
| bottom: 0; | |
| } | |
| .toggle-md-btn { | |
| /* top: 0; */ | |
| bottom: 20px; | |
| } | |
| /* note: this is deprecated */ | |
| .copy-code-btn { | |
| position: relative; | |
| float: right; | |
| font-size: 1em; | |
| cursor: pointer; | |
| } | |
| /* note: the button below disabled in chatbot.py */ | |
| .message div.icon-button > button[title="copy"] { | |
| display: none; | |
| } | |
| /* history message */ | |
| .wrapper>.wrap>.history-message { | |
| padding-bottom: 10px ; | |
| } | |
| .history-message { | |
| /* padding: 0 !important; */ | |
| opacity: 80%; | |
| display: flex; | |
| flex-direction: column; | |
| } | |
| .history-message>.history-message { | |
| padding: 0 ; | |
| } | |
| .history-message>.message-wrap { | |
| padding: 0 ; | |
| margin-bottom: 16px; | |
| } | |
| .history-message>.message { | |
| margin-bottom: 16px; | |
| } | |
| .wrapper>.wrap>.history-message::after { | |
| content: ""; | |
| display: block; | |
| height: 2px; | |
| background-color: var(--body-text-color-subdued); | |
| margin-bottom: 10px; | |
| margin-top: -10px; | |
| clear: both; | |
| } | |
| .wrapper>.wrap>.history-message>:last-child::after { | |
| content: "仅供查看"; | |
| display: block; | |
| text-align: center; | |
| color: var(--body-text-color-subdued); | |
| font-size: 0.8em; | |
| } | |
| /* #chuanhu-chatbot { | |
| transition: height 0.3s ease; | |
| note: find it better without transition animation...; | |
| } */ | |
| .message-row { | |
| flex-direction: row; | |
| display: flex; | |
| gap: 8px; | |
| width: 100%; | |
| } | |
| .bot-message-row { | |
| justify-content: flex-start; | |
| } | |
| .user-message-row { | |
| justify-content: flex-end; | |
| } | |
| .chatbot-avatar { | |
| width: 32px; | |
| height: 32px; | |
| background-color: transparent; | |
| background-size: cover; | |
| border-radius: 5px ; | |
| } | |
| .chatbot-avatar.bot-avatar { | |
| margin-left: 5px; | |
| } | |
| .chatbot-avatar.user-avatar { | |
| margin-right: 10px; | |
| } | |
| .chatbot-avatar img { | |
| border-radius: 5px ; | |
| object-fit: cover; | |
| width: 100%; | |
| height: 100%; | |
| } |