feat: rebuild xiteng.site homelab platform

This commit is contained in:
2026-08-12 09:48:25 +08:00
parent 557b0eca33
commit 5b84988789
128 changed files with 14979 additions and 292 deletions
+201
View File
@@ -0,0 +1,201 @@
svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root {
color-scheme: light;
--bg: #f7f7f5;
--panel: rgba(255, 255, 255, 0.88);
--text: #171717;
--muted: #6f6f6a;
--line: rgba(23, 23, 23, 0.11);
--soft: #eeeeea;
--accent: #171717;
--accent-text: #ffffff;
--danger: #a3382d;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { position: relative; height: 100dvh; background: radial-gradient(circle at 50% -20%, #fff 0, var(--bg) 42%); }
.app-header { position: absolute; inset: 0 0 auto; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; height: 64px; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); }
.header-leading { display: flex; align-items: center; gap: 8px; justify-self: start; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; letter-spacing: -0.02em; }
.brand-mark, .welcome-mark { display: grid; place-items: center; color: #fff; background: #171717; font-weight: 800; letter-spacing: -0.08em; }
.brand-mark { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
.offline-badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(163,56,45,.2); border-radius: 999px; padding: 4px 7px; background: rgba(163,56,45,.07); color: var(--danger); font-size: 10px; font-weight: 650; letter-spacing: 0; white-space: nowrap; }
.chat-controls { display: flex; align-items: center; justify-self: end; gap: 8px; }
.header-button, .local-key-menu > summary, .generation-menu > summary { display: flex; height: 36px; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.72); color: var(--text); text-decoration: none; }
.header-button { padding: 0 11px; cursor: pointer; }
.account-button { padding: 4px 10px 4px 5px; }
.header-avatar { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; background: var(--soft); }
.header-button:hover, .local-key-menu > summary:hover, .generation-menu > summary:hover { background: #fff; border-color: rgba(23,23,23,.2); }
.local-key-menu, .generation-menu { position: relative; }
.local-key-menu > summary, .generation-menu > summary { width: 36px; justify-content: center; cursor: pointer; list-style: none; }
.local-key-menu > summary::-webkit-details-marker, .generation-menu > summary::-webkit-details-marker { display: none; }
.local-key-menu > div { position: absolute; z-index: 31; top: 43px; right: 0; display: grid; width: min(320px, calc(100vw - 24px)); max-height: min(520px, calc(100dvh - 80px)); overflow-y: auto; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--panel); box-shadow: 0 14px 36px rgba(0,0,0,.14); }
.local-key-menu-title { padding: 5px 7px 8px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.local-key-entry { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; border-radius: 9px; padding: 7px; }
.local-key-entry:hover { background: var(--soft); }
.local-key-entry > span { min-width: 0; text-align: left; }
.local-key-entry > span strong, .local-key-entry > span small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.local-key-entry > span small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.local-key-entry > span .local-key-error { max-width: 190px; color: var(--danger); white-space: normal; }
.local-key-entry > div { display: flex; flex: 0 0 auto; gap: 2px; }
.local-key-menu button { border: 0; border-radius: 8px; padding: 8px 9px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.local-key-menu button:hover { background: var(--panel); }
.local-key-menu button.dangerous { color: #b42318; }
.generation-menu > div { position: absolute; z-index: 31; top: 43px; right: 0; display: grid; width: min(280px, calc(100vw - 24px)); gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); box-shadow: 0 14px 36px rgba(0,0,0,.14); }
.generation-menu > div > strong { font-size: 12px; }
.generation-menu label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.generation-menu select, .generation-menu input[type="number"] { min-width: 0; width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--bg); color: var(--text); }
.generation-menu .generation-check { display: flex; align-items: center; gap: 7px; color: var(--text); }
.generation-menu button { border: 0; border-radius: 8px; padding: 9px; background: var(--soft); color: var(--text); cursor: pointer; }
.model-picker { position: relative; }
.model-picker > summary { display: flex; min-width: 190px; max-width: 290px; height: 36px; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 11px; padding: 0 10px; background: rgba(255,255,255,.72); color: var(--text); cursor: pointer; list-style: none; }
.model-picker > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker > summary::-webkit-details-marker { display: none; }
.model-picker[open] > summary { border-color: rgba(23,23,23,.24); background: #fff; }
.model-picker[open] > summary svg { transform: rotate(180deg); }
.model-menu { position: absolute; z-index: 30; top: 43px; left: 0; width: min(430px, calc(100vw - 24px)); max-height: min(670px, calc(100dvh - 82px)); overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: var(--panel); box-shadow: 0 18px 48px rgba(0,0,0,.15); backdrop-filter: blur(18px); }
.model-search { position: sticky; z-index: 1; top: -8px; display: flex; height: 40px; align-items: center; gap: 8px; margin: -1px -1px 5px; padding: 0 9px; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.model-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.model-menu-group { display: grid; gap: 2px; padding: 5px 0 8px; }
.model-menu-group + .model-menu-group { border-top: 1px solid var(--line); }
.model-menu-group h3 { display: flex; align-items: center; gap: 5px; margin: 0; padding: 4px 8px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.model-option { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 8px; padding: 8px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.model-option:hover, .model-option.active { background: var(--soft); }
.model-option > span { min-width: 0; }
.model-option strong, .model-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-option strong { font-size: 12px; font-weight: 620; }
.model-option small { color: var(--muted); font-size: 10px; }
.model-menu-empty { margin: 10px; color: var(--muted); text-align: center; }
.state-card > .model-picker { display: inline-block; margin-bottom: 24px; text-align: left; }
.state-card > .model-picker > summary { min-width: 260px; }
.history-toggle, .history-heading button, .history-delete { display: grid; place-items: center; border: 0; background: transparent; color: inherit; cursor: pointer; }
.history-toggle { width: 32px; height: 32px; border-radius: 9px; }
.history-toggle:hover, .history-heading button:hover, .history-delete:hover { background: var(--soft); }
.history-sidebar { position: absolute; z-index: 9; top: 64px; bottom: 0; left: 0; width: 252px; display: flex; flex-direction: column; transform: translateX(-102%); border-right: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); transition: transform .18s ease; }
.history-sidebar.open { transform: translateX(0); }
.history-heading { display: flex; height: 52px; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.history-heading > div { display: flex; gap: 2px; }
.history-heading button { width: 30px; height: 30px; border-radius: 8px; }
.history-close { display: none !important; }
.history-list { min-height: 0; flex: 1; overflow-y: auto; padding: 8px; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; border-radius: 9px; }
.history-item:hover, .history-item.active { background: var(--soft); }
.history-select { min-width: 0; border: 0; padding: 9px 4px 9px 9px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.history-select strong, .history-select small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-select strong { font-size: 12px; font-weight: 650; }
.history-select small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.history-delete { width: 26px; height: 26px; border-radius: 7px; color: var(--muted); opacity: 0; }
.history-item:hover .history-delete, .history-item.active .history-delete { opacity: 1; }
.history-backdrop { display: none; }
.with-history .thread-root { padding-left: 0; transition: padding-left .18s ease; }
.with-history.history-open .thread-root { padding-left: 252px; }
.thread-root { height: 100dvh; padding-top: 64px; }
.thread-viewport { position: relative; display: flex; height: 100%; flex-direction: column; overflow-y: auto; scroll-behavior: smooth; padding: 24px 18px 0; }
#message-list { display: flex; flex: 1 0 auto; flex-direction: column; }
.welcome { display: flex; width: min(680px, 100%); flex: 1; flex-direction: column; justify-content: center; margin: 0 auto; padding: 80px 4px 210px; }
.welcome-mark { width: 48px; height: 48px; border-radius: 16px; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.welcome h1 { margin: 22px 0 8px; font-size: clamp(30px, 5vw, 46px); line-height: 1.08; letter-spacing: -.045em; }
.welcome p { max-width: 560px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.message { width: min(760px, 100%); margin: 0 auto; padding: 14px 0; }
.user-message { display: flex; justify-content: flex-end; }
.message-content { overflow-wrap: anywhere; font-size: 15px; line-height: 1.72; }
.user-content { max-width: min(620px, 86%); border-radius: 16px 16px 5px 16px; padding: 7px 13px; background: var(--soft); line-height: 1.5; white-space: pre-wrap; }
.user-content > p { margin: 0; }
.user-content > p + p { margin-top: 6px; }
.assistant-content { padding: 2px 4px; }
.assistant-content .aui-md { color: var(--text); }
.assistant-content .aui-md > :first-child { margin-top: 0; }
.assistant-content .aui-md > :last-child { margin-bottom: 0; }
.assistant-content pre { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #20201f; color: #f6f6f3; }
.assistant-content code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .88em; }
.assistant-content :not(pre) > code { border-radius: 5px; padding: 2px 5px; background: var(--soft); }
.assistant-content a { color: inherit; text-underline-offset: 3px; }
.message-reasoning { margin: 0 0 12px; border-left: 2px solid var(--line); padding-left: 12px; color: var(--muted); }
.message-reasoning > summary { cursor: pointer; font-size: 12px; font-weight: 650; }
.message-reasoning > div { margin-top: 7px; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.message-error { margin-top: 10px; border: 1px solid rgba(163,56,45,.2); border-radius: 10px; padding: 10px 12px; background: rgba(163,56,45,.07); color: var(--danger); font-size: 13px; }
.thread-footer { position: sticky; bottom: 0; display: flex; width: min(760px, 100%); flex-direction: column; align-items: center; margin: auto auto 0; padding: 40px 0 16px; background: linear-gradient(to bottom, transparent, var(--bg) 38%); }
.scroll-button { position: absolute; top: 1px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--muted); box-shadow: 0 5px 18px rgba(0,0,0,.08); cursor: pointer; }
.message-footer { display: flex; min-height: 30px; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 0; }
.response-meta { display: flex; min-width: 0; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.response-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.response-meta span + span::before { margin-right: 7px; content: "·"; }
.scroll-button:disabled { visibility: hidden; }
.composer { display: grid; width: 100%; grid-template-columns: 1fr auto; align-items: end; gap: 8px; border: 1px solid rgba(23,23,23,.15); border-radius: 20px; padding: 8px 8px 8px 16px; background: #fff; box-shadow: 0 14px 45px rgba(0,0,0,.09); }
.composer:focus-within { border-color: rgba(23,23,23,.32); box-shadow: 0 14px 45px rgba(0,0,0,.1), 0 0 0 3px rgba(23,23,23,.04); }
.message-actions { display: flex; flex: 0 0 auto; gap: 2px; margin: 0; opacity: 1; visibility: visible; }
.icon-button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--soft); color: var(--text); }
.composer-input { max-height: 180px; min-height: 38px; resize: none; border: 0; outline: 0; padding: 9px 0 7px; background: transparent; color: var(--text); line-height: 1.5; }
.composer-input:disabled { cursor: not-allowed; color: var(--muted); }
.composer-input::placeholder { color: #9a9a94; }
.send-button { display: grid; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 13px; background: var(--accent); color: var(--accent-text); cursor: pointer; }
.send-button:disabled { cursor: default; opacity: .35; }
.composer-note { margin: 8px 0 0; color: #90908a; font-size: 11px; }
.composer-note.offline { color: var(--danger); }
.state-page { position: relative; display: grid; min-height: 100dvh; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 10%, #fff, var(--bg) 52%); }
.state-card { width: min(520px, 100%); text-align: center; }
.state-provider-select { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; color: var(--muted); background: var(--panel); }
.state-provider-select select { border: 0; outline: 0; color: var(--text); background: transparent; }
.state-mark { display: grid; width: 52px; height: 52px; place-items: center; margin: 0 auto 18px; border-radius: 17px; background: #171717; color: #fff; font-weight: 800; }
.state-card h1 { margin: 0 0 10px; font-size: 28px; letter-spacing: -.035em; }
.state-card p { margin: 0 auto; color: var(--muted); line-height: 1.7; }
.state-card code { border-radius: 5px; padding: 2px 5px; background: var(--soft); color: var(--text); }
.primary-link { display: inline-flex; margin-top: 22px; border-radius: 12px; padding: 11px 16px; background: #171717; color: #fff; text-decoration: none; }
.button-link { border: 0; cursor: pointer; }
.loader { display: block; width: 30px; height: 30px; margin: 0 auto 16px; border: 3px solid var(--line); border-top-color: #171717; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.response-loader { display: inline-block; width: 7px; height: 18px; border-radius: 2px; background: currentColor; vertical-align: text-bottom; animation: pulse 1s ease-in-out infinite; }
.icon-button.copied { color: #25824d; }
.icon-button:disabled { cursor: default; opacity: .4; }
@keyframes pulse { 50% { opacity: .25; } }
@media (max-width: 680px) {
.app-header { grid-template-columns: auto auto 1fr; height: 58px; gap: 10px; padding: 0 12px; }
.thread-root { padding-top: 58px; }
.chat-controls { min-width: 0; gap: 5px; }
.chat-controls > * { flex: 0 0 auto; }
.model-picker > summary { min-width: 0; width: min(132px, 34vw); }
.account-button { width: 36px; }
.app-header { overflow: clip; }
.brand > span:nth-child(2), .header-button span { display: none; }
.offline-badge { padding: 4px 6px; font-size: 0; }
.header-button { width: 36px; justify-content: center; padding: 0; }
.provider-control select { max-width: 105px; }
.model-picker > summary { min-width: 132px; max-width: 170px; }
.model-menu { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; max-height: calc(100dvh - 76px); }
.local-key-menu > div { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; max-height: calc(100dvh - 76px); }
.generation-menu > div { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; max-height: calc(100dvh - 76px); overflow-y: auto; }
.history-sidebar { position: fixed; z-index: 40; top: 0; width: min(300px, 86vw); border-right: 1px solid var(--line); }
.history-heading { height: 58px; }
.history-close { display: grid !important; }
.history-backdrop { position: fixed; z-index: 35; inset: 0; display: block; border: 0; background: rgba(0,0,0,.36); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.history-backdrop.open { opacity: 1; pointer-events: auto; }
.with-history.history-open .thread-root { padding-left: 0; }
.thread-viewport { padding-inline: 12px; }
.welcome { padding-bottom: 170px; }
.user-content { max-width: 92%; }
.thread-footer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.composer-note { display: none; }
}
@media (prefers-color-scheme: dark) {
:root { color-scheme: dark; --bg: #111210; --panel: rgba(22,23,21,.88); --text: #f2f2ee; --muted: #a1a19a; --line: rgba(255,255,255,.12); --soft: #242521; --accent: #f0f0ec; --accent-text: #171717; }
.app-shell { background: radial-gradient(circle at 50% -20%, #272824 0, var(--bg) 42%); }
.header-button, .local-key-menu > summary, .local-key-menu > div, .generation-menu > summary, .generation-menu > div, .model-picker > summary, .model-menu, .composer, .history-sidebar { background: rgba(31,32,29,.9); }
.model-picker[open] > summary { border-color: rgba(255,255,255,.24); background: #292a26; }
.header-button:hover, .local-key-menu > summary:hover { background: #292a26; }
.assistant-content pre { background: #080908; }
.state-page { background: radial-gradient(circle at 50% 10%, #272824, var(--bg) 52%); }
.brand-mark, .welcome-mark, .state-mark, .primary-link { background: #efefeb; color: #171717; }
.loader { border-top-color: #efefeb; }
}