| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022 |
- :root {
- color-scheme: light dark;
- --bg-main: #f5f6f8;
- --bg-sidebar: #ffffff;
- --bg-panel: #ffffff;
- --border-color: #d8dce4;
- --primary: #1f77ff;
- --primary-text: #ffffff;
- --accent: #0d6efd;
- --text-color: #1a1a1a;
- --secondary-text: #6c757d;
- --user-message: #e9f2ff;
- --assistant-message: #f1f3f5;
- --shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
- .hidden {
- display: none !important;
- }
- .auth-view {
- position: fixed;
- inset: 0;
- background: linear-gradient(120deg, #4f46e5, #9333ea);
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 20px;
- z-index: 20;
- }
- .auth-card {
- width: min(420px, 100%);
- background: #fff;
- border-radius: 16px;
- padding: 32px;
- box-shadow: var(--shadow);
- display: flex;
- flex-direction: column;
- gap: 16px;
- }
- .auth-card h1 {
- margin: 0;
- font-size: 24px;
- text-align: center;
- color: #111;
- }
- .auth-hint {
- margin: 0;
- font-size: 14px;
- color: var(--secondary-text);
- text-align: center;
- }
- .auth-form {
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .auth-form label {
- font-size: 14px;
- color: var(--secondary-text);
- display: flex;
- flex-direction: column;
- gap: 4px;
- }
- .auth-form input {
- border-radius: 8px;
- border: 1px solid var(--border-color);
- padding: 10px;
- font-size: 14px;
- }
- .auth-switch {
- display: flex;
- justify-content: space-between;
- gap: 12px;
- }
- .header-actions {
- display: flex;
- align-items: center;
- gap: 8px;
- float: right;
- }
- .user-badge {
- font-size: 14px;
- color: var(--secondary-text);
- }
- .header-title {
- display: flex;
- flex-direction: column;
- gap: 2px;
- width:300px;
- float:left;
- }
- .session-indicator {
- font-size: 14px;
- color: var(--secondary-text);
- }
- .admin-role-indicator {
- width: 36px;
- height: 36px;
- border-radius: 50%;
- border: 1px solid var(--border-color);
- background: #fff;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- color: var(--primary);
- box-shadow: var(--shadow);
- }
- .admin-role-indicator svg {
- width: 18px;
- height: 18px;
- }
- .user-menu {
- position: relative;
- }
- .avatar-button {
- display: flex;
- align-items: center;
- gap: 6px;
- border: 1px solid var(--border-color);
- border-radius: 999px;
- padding: 6px 10px;
- background: #fff;
- cursor: pointer;
- min-width: 0;
- }
- .avatar-initials {
- width: 28px;
- height: 28px;
- border-radius: 50%;
- background: var(--primary);
- color: var(--primary-text);
- display: inline-flex;
- align-items: center;
- justify-content: center;
- font-weight: 600;
- }
- .avatar-caret {
- width: 18px;
- height: 18px;
- color: var(--secondary-text);
- }
- .user-menu-dropdown {
- position: absolute;
- top: calc(100% + 8px);
- right: 0;
- min-width: 180px;
- border-radius: 12px;
- border: 1px solid var(--border-color);
- background: #fff;
- box-shadow: var(--shadow);
- padding: 8px;
- display: flex;
- flex-direction: column;
- gap: 4px;
- opacity: 0;
- transform: translateY(-6px);
- pointer-events: none;
- transition: opacity 0.2s ease, transform 0.2s ease;
- z-index: 5;
- }
- .user-menu.open .user-menu-dropdown {
- opacity: 1;
- transform: translateY(0);
- pointer-events: auto;
- }
- .menu-item {
- border: none;
- background: none;
- padding: 8px 10px;
- text-align: left;
- border-radius: 8px;
- font-size: 14px;
- color:black;
- cursor: pointer;
- }
- .menu-item:hover:not(:disabled) {
- background: #f1f3f5;
- }
- .menu-item:disabled {
- opacity: 0.5;
- cursor: not-allowed;
- }
- .overlay {
- position: fixed;
- inset: 0;
- background: rgba(15, 23, 42, 0.45);
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 20px;
- z-index: 30;
- }
- .overlay-content {
- width: min(720px, 100%);
- max-height: 90vh;
- overflow-y: auto;
- background: #fff;
- border-radius: 16px;
- padding: 24px;
- box-shadow: var(--shadow);
- display: flex;
- flex-direction: column;
- gap: 16px;
- }
- .overlay-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .icon-button {
- border: none;
- background: transparent;
- font-size: 20px;
- cursor: pointer;
- padding: 4px 8px;
- }
- .overlay-close {
- border-radius: 50%;
- border: 1px solid var(--border-color);
- background: #f1f3f5;
- width: 32px;
- height: 32px;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- font-size: 18px;
- }
- .overlay-close:hover {
- background: #e6e9ef;
- }
- .overlay-close .icon-close {
- width: 16px;
- height: 16px;
- }
- .admin-form {
- border: 1px solid var(--border-color);
- border-radius: 12px;
- padding: 16px;
- background: #f8fafc;
- }
- .admin-form h3 {
- margin: 0 0 12px;
- font-size: 16px;
- }
- .admin-form-grid {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
- gap: 12px;
- }
- .admin-form input {
- width: 100%;
- border-radius: 8px;
- border: 1px solid var(--border-color);
- padding: 8px 10px;
- }
- .admin-section {
- border: 1px solid var(--border-color);
- border-radius: 12px;
- padding: 16px;
- background: #fff;
- display: flex;
- flex-direction: column;
- gap: 12px;
- }
- .admin-section-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 12px;
- }
- .admin-search {
- display: flex;
- gap: 8px;
- }
- .admin-search input {
- border: 1px solid var(--border-color);
- border-radius: 8px;
- padding: 8px 10px;
- }
- .admin-list {
- display: flex;
- flex-direction: column;
- gap: 8px;
- }
- .admin-row {
- border: 1px solid var(--border-color);
- border-radius: 10px;
- padding: 12px;
- display: flex;
- justify-content: space-between;
- gap: 12px;
- background: #fdfdfd;
- }
- .admin-row-info {
- display: flex;
- flex-direction: column;
- gap: 4px;
- }
- .admin-row-info strong {
- font-size: 15px;
- color: #111;
- }
- .admin-row-meta {
- font-size: 13px;
- color: var(--secondary-text);
- }
- .admin-row-preview {
- font-size: 13px;
- color: var(--secondary-text);
- max-height: 60px;
- overflow: hidden;
- }
- .admin-row-actions {
- display: flex;
- flex-direction: column;
- gap: 6px;
- align-items: flex-end;
- }
- .empty-note {
- margin: 0;
- font-size: 14px;
- color: var(--secondary-text);
- text-align: center;
- }
- * {
- box-sizing: border-box;
- }
- body {
- margin: 0;
- font-family: "PingFang SC", "Microsoft YaHei", "Helvetica", "Arial", sans-serif;
- background: var(--bg-main);
- color: var(--text-color);
- height: 100vh;
- display: flex;
- }
- .app-shell {
- display: flex;
- flex: 1;
- max-height: 100vh;
- width: 100%;
- }
- .sidebar {
- width: 320px;
- background: var(--bg-sidebar);
- border-right: 1px solid var(--border-color);
- display: flex;
- flex-direction: column;
- overflow: hidden;
- }
- .sidebar-scroll {
- flex: 1;
- padding: 10px 16px 2px;
- overflow-y: auto;
- display: flex;
- flex-direction: column;
- gap: 18px;
- }
- .sidebar-history {
- border-top: 1px solid var(--border-color);
- padding: 3px ;
- background: #fff;
- display: flex;
- flex-direction: column;
- gap: 10px;
- overflow: auto; /* 允许滚动 */
- scrollbar-width: none; /* Firefox */
- }
- .sidebar-history::-webkit-scrollbar {
- display: none; /* Chrome 和 Safari */
- }
- .sidebar-history-header {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 8px;
- }
- .history-count {
- font-size: 12px;
- color: var(--secondary-text);
- }
- .sidebar-section {
- margin: 0;
- display: flex;
- flex-direction: column;
- gap: 6px;
- }
- .sidebar-actions {
- flex-direction: row;
- align-items: center;
- }
- .sidebar-actions .primary-button,
- .sidebar-actions .secondary-button {
- flex: 1;
- }
- .sidebar-label {
- font-size: 14px;
- font-weight: 600;
- color: var(--secondary-text);
- }
- .sidebar-input,
- .sidebar-range {
- width: 100%;
- padding: 8px 10px;
- border: 1px solid var(--border-color);
- border-radius: 8px;
- font-size: 14px;
- background: #fff;
- color: inherit;
- }
- .sidebar-range {
- height: 4px;
- padding: 0;
- }
- .sidebar-help {
- font-size: 13px;
- color: var(--secondary-text);
- }
- .sidebar-heading {
- margin: 0;
- font-size: 16px;
- font-weight: 600;
- }
- .primary-button,
- .secondary-button {
- border: none;
- border-radius: 8px;
- padding: 10px 14px;
- font-size: 14px;
- cursor: pointer;
- transition: all 0.2s ease;
- }
- .primary-button {
- background: var(--primary);
- color: var(--primary-text);
- }
- .primary-button:disabled {
- opacity: 0.6;
- cursor: not-allowed;
- }
- .primary-button:hover:not(:disabled) {
- background: var(--accent);
- }
- .secondary-button {
- background: #f1f3f5;
- color: var(--text-color);
- border: 1px solid var(--border-color);
- }
- .secondary-button:hover:not(:disabled) {
- background: #e6e9ef;
- }
- .secondary-button.small {
- font-size: 13px;
- padding: 6px 10px;
- }
- .secondary-button.danger {
- background: #dc3545;
- border-color: #dc3545;
- color: #fff;
- }
- .secondary-button.danger:hover:not(:disabled) {
- background: #c82333;
- }
- .history-list {
- display: flex;
- flex-direction: column;
- gap: 6px;
- max-height: 240px;
- overflow-y: auto;
- }
- .history-row {
- display: grid;
- grid-template-columns: 1fr auto auto;
- gap: 4px;
- align-items: center;
- padding: 4px 10px;
- border: 1px solid var(--border-color);
- border-radius: 8px;
- background: #fff;
- }
- .history-row.active {
- border-color: var(--accent);
- box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.12);
- }
- .history-title-link {
- border: none;
- background: none;
- padding: 0;
- margin: 0;
- font-size: 14px;
- font-weight: 500;
- text-align: left;
- color: var(--accent);
- cursor: pointer;
- display: flex;
- flex-direction: column;
- align-items: flex-start;
- gap: 2px;
- width: 100%;
- text-decoration: none;
- }
- .history-title-link:hover,
- .history-title-link:focus-visible {
- text-decoration: underline;
- }
- .history-row.active .history-title-link {
- color: var(--text-color);
- font-weight: 600;
- }
- .history-title-text,
- .history-subtitle {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 100%;
- }
- .history-subtitle {
- font-size: 11px;
- color: var(--secondary-text);
- }
- .history-icon-button {
- border: none;
- background: #f8f9fb;
- border-radius: 6px;
- padding: 6px 8px;
- cursor: pointer;
- font-size: 16px;
- line-height: 1;
- }
- .history-icon-button:hover {
- background: #e6e9ef;
- }
- .history-pagination {
- display: flex;
- justify-content: space-between;
- gap: 2px;
- margin-bottom: 5px;
- margin-left: 10px;
- margin-right: 10px;
- }
- .history-pagination .secondary-button {
- padding: 3px 3px;
- font-size: 11px;
- border-radius: 6px;
- }
- .main-panel {
- flex: 1;
- display: flex;
- flex-direction: column;
- background: var(--bg-panel);
- box-shadow: var(--shadow);
- }
- .app-header {
- padding: 20px 24px;
- border-bottom: 1px solid var(--border-color);
- }
- .app-header h1 {
- margin: 0;
- font-size: 22px;
- font-weight: 600;
- }
- .chat-messages {
- flex: 1;
- padding: 24px;
- overflow-y: auto;
- display: flex;
- flex-direction: column;
- gap: 16px;
- background: linear-gradient(180deg, rgba(243, 247, 255, 0.8), rgba(255, 255, 255, 0.9));
- }
- .message {
- padding: 16px;
- border-radius: 12px;
- border: 1px solid var(--border-color);
- max-width: 860px;
- display: flex;
- flex-direction: column;
- gap: 10px;
- }
- .message.notice {
- background: #fff8e1;
- border-style: dashed;
- color: #8c6b00;
- align-self: center;
- }
- .message.user {
- background: var(--user-message);
- align-self: flex-end;
- }
- .message.assistant {
- background: var(--assistant-message);
- align-self: flex-start;
- }
- .message-header {
- font-size: 13px;
- font-weight: 600;
- color: var(--secondary-text);
- }
- .message-content {
- font-size: 14px;
- line-height: 1.6;
- color: var(--text-color);
- white-space: normal;
- word-break: break-word;
- }
- .message-content ul {
- margin: 8px 0 8px 18px;
- padding-left: 16px;
- }
- .message-content li {
- margin-bottom: 4px;
- }
- .message-content blockquote {
- margin: 10px 0;
- padding-left: 14px;
- border-left: 3px solid var(--border-color);
- color: var(--secondary-text);
- }
- .message-content table.md-table {
- width: 100%;
- border-collapse: collapse;
- margin: 12px 0;
- font-size: 14px;
- background: #fff;
- }
- .message-content table.md-table th,
- .message-content table.md-table td {
- border: 1px solid var(--border-color);
- padding: 8px 10px;
- text-align: left;
- vertical-align: top;
- }
- .message-content table.md-table thead {
- background: #f5f6f8;
- font-weight: 600;
- }
- .message-content h1,
- .message-content h2,
- .message-content h3,
- .message-content h4,
- .message-content h5,
- .message-content h6 {
- margin: 12px 0 6px;
- font-weight: 600;
- }
- .message-content h1 { font-size: 20px; }
- .message-content h2 { font-size: 18px; }
- .message-content h3 { font-size: 16px; }
- .message-content h4 { font-size: 15px; }
- .message-content h5,
- .message-content h6 { font-size: 14px; }
- .message-content pre {
- background: #0d1117;
- color: #e6edf3;
- padding: 12px;
- border-radius: 10px;
- overflow-x: auto;
- font-family: "JetBrains Mono", "Fira Code", "Menlo", "Consolas", monospace;
- font-size: 13px;
- line-height: 1.5;
- margin: 10px 0;
- }
- .code-block {
- position: relative;
- margin: 10px 0;
- }
- .code-block pre {
- margin: 0;
- padding-right: 48px;
- }
- .code-copy-btn {
- position: absolute;
- top: 10px;
- right: 12px;
- border: 1px solid rgba(255, 255, 255, 0.25);
- background: rgba(255, 255, 255, 0.12);
- color: #fff;
- border-radius: 6px;
- padding: 2px 10px;
- font-size: 12px;
- cursor: pointer;
- transition: background 0.2s ease, color 0.2s ease;
- }
- .code-copy-btn:disabled {
- opacity: 0.6;
- cursor: not-allowed;
- }
- .code-copy-btn:not(:disabled):hover {
- background: rgba(255, 255, 255, 0.2);
- }
- .message-content code {
- font-family: "JetBrains Mono", "Fira Code", "Menlo", "Consolas", monospace;
- background: rgba(13, 110, 253, 0.12);
- color: #0d47a1;
- padding: 2px 6px;
- border-radius: 6px;
- font-size: 13px;
- }
- .message-content pre code {
- display: block;
- background: transparent;
- color: inherit;
- padding: 0;
- }
- .message-content img {
- max-width: 100%;
- border-radius: 8px;
- margin: 6px 0;
- }
- .message-actions {
- display: flex;
- justify-content: flex-end;
- gap: 6px;
- }
- .message-button {
- border: none;
- background: var(--primary);
- color: var(--primary-text);
- border-radius: 6px;
- padding: 3px 8px;
- font-size: 11px;
- font-weight: 500;
- cursor: pointer;
- white-space: nowrap;
- transition: background 0.2s ease;
- }
- .message-button:hover {
- background: var(--accent);
- }
- .chat-form {
- padding: 16px 20px;
- border-top: 1px solid var(--border-color);
- display: flex;
- flex-direction: column;
- gap: 10px;
- background: #fff;
- }
- .chat-textarea {
- width: 100%;
- border-radius: 12px;
- border: 1px solid var(--border-color);
- padding: 10px;
- font-size: 14px;
- resize: vertical;
- min-height: 70px;
- }
- .chat-form-footer {
- display: flex;
- align-items: center;
- gap: 10px;
- }
- #send-btn {
- margin-left: auto;
- }
- #end-chat-btn {
- min-width: 110px;
- }
- .file-input-label {
- display: inline-flex;
- align-items: center;
- padding: 6px 12px;
- border-radius: 8px;
- border: 1px dashed var(--border-color);
- color: var(--secondary-text);
- cursor: pointer;
- background: #fafbfc;
- }
- .file-input {
- display: none;
- }
- .chat-status {
- min-height: 20px;
- font-size: 13px;
- color: var(--secondary-text);
- display: flex;
- align-items: center;
- gap: 8px;
- }
- .chat-status.running {
- color: var(--accent);
- }
- .chat-status-spinner {
- width: 14px;
- height: 14px;
- border-radius: 50%;
- border: 2px solid currentColor;
- border-top-color: transparent;
- animation: chat-spin 0.8s linear infinite;
- }
- .chat-status-text {
- display: inline-flex;
- align-items: center;
- }
- .chat-status.error {
- color: #dc3545;
- }
- .toast {
- position: fixed;
- bottom: 24px;
- left: 50%;
- transform: translateX(-50%);
- background: rgba(33, 37, 41, 0.9);
- color: #fff;
- padding: 12px 18px;
- border-radius: 12px;
- font-size: 14px;
- box-shadow: var(--shadow);
- opacity: 0;
- transition: opacity 0.3s ease, transform 0.3s ease;
- pointer-events: none;
- z-index: 999;
- }
- .toast.show {
- opacity: 1;
- transform: translate(-50%, 0);
- }
- .toast.success {
- background: #28a745;
- }
- .toast.error {
- background: #dc3545;
- }
- .hidden {
- display: none;
- }
- .clamped {
- display: -webkit-box;
- -webkit-line-clamp: 3;
- -webkit-box-orient: vertical;
- overflow: hidden;
- }
- mark.hl {
- background: #fff3a3;
- color: inherit;
- padding: 0 2px;
- border-radius: 3px;
- }
- @keyframes chat-spin {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(360deg);
- }
- }
- @media (max-width: 960px) {
- .app-shell {
- flex-direction: column;
- }
- .sidebar {
- width: 100%;
- border-right: none;
- border-bottom: 1px solid var(--border-color);
- }
- .sidebar-scroll {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
- gap: 16px;
- }
- .main-panel {
- box-shadow: none;
- }
- .history-list {
- max-height: 180px;
- }
- .sidebar-actions {
- flex-direction: column;
- }
- }
- @media (max-width: 600px) {
- .chat-form-footer {
- flex-direction: column;
- align-items: stretch;
- }
- .chat-form-footer .primary-button {
- width: 100%;
- }
- .file-input-label {
- width: 100%;
- justify-content: center;
- }
- }
- :root {
|