| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963 |
- :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;
- 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 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;
- }
- .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.running::before {
- content: "";
- width: 14px;
- height: 14px;
- border-radius: 50%;
- border: 2px solid currentColor;
- border-top-color: transparent;
- animation: chat-spin 0.8s linear infinite;
- }
- .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 {
|