nianjie/static/styles.css

271 lines
5.8 KiB
CSS

:root {
--bg: #f7f8fb;
--panel: #ffffff;
--border: #e5e7ed;
--accent: #1f6feb;
--text: #1f2430;
--muted: #6b7280;
--radius: 14px;
--shadow: 0 8px 24px rgba(31, 47, 79, 0.08);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
margin: 0;
font-family: "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
background: radial-gradient(circle at 20% 20%, rgba(31,111,235,0.05), transparent 35%),
radial-gradient(circle at 80% 10%, rgba(31,111,235,0.08), transparent 30%),
var(--bg);
color: var(--text);
min-height: 100vh;
}
.app-shell {
display: grid;
grid-template-columns: 280px 1fr;
min-height: 100vh;
height: 100vh;
}
.sidebar {
background: #fff;
border-right: 1px solid var(--border);
padding: 18px;
display: flex;
flex-direction: column;
gap: 12px;
}
.sidebar-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.logo {
font-weight: 700;
letter-spacing: 0.4px;
}
button {
border: 1px solid var(--border);
background: #fff;
color: var(--text);
padding: 8px 12px;
border-radius: 10px;
cursor: pointer;
transition: all 0.15s ease;
font-size: 14px;
}
button:hover { border-color: #c8d0e0; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
button:active { transform: translateY(1px); }
button.primary {
background: var(--accent);
color: #fff;
border-color: var(--accent);
box-shadow: 0 6px 20px rgba(31,111,235,0.25);
}
button.primary:hover { background: #195cc4; }
button.ghost { background: transparent; border: none; font-size: 18px; padding: 6px 10px; }
.sidebar-actions { display: flex; gap: 10px; }
.history-header { font-size: 13px; color: var(--muted); padding: 4px 2px; }
.conversation-list {
list-style: none;
margin: 0;
padding: 0;
overflow-y: auto;
flex: 1;
display: flex;
flex-direction: column;
gap: 6px;
}
.conversation-list li {
padding: 10px 12px;
border: 1px solid transparent;
border-radius: 12px;
background: #f9fafc;
cursor: pointer;
transition: all 0.15s ease;
color: var(--text);
}
.conversation-list li:hover { border-color: var(--border); }
.conversation-list li.active {
background: #e9f1ff;
border-color: var(--accent);
color: #0f2a5f;
}
.chat-pane {
display: grid;
grid-template-rows: auto 1fr auto;
background: transparent;
height: 100vh;
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 18px 24px 12px;
}
.topbar .title { font-weight: 600; font-size: 16px; }
.status { color: var(--muted); font-size: 13px; }
.chat-log {
padding: 12px 24px 24px;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 14px;
}
.message {
display: inline-block;
width: auto;
max-width: 70%;
padding: 12px 14px;
border-radius: var(--radius);
background: #fff;
border: 1px solid var(--border);
box-shadow: var(--shadow);
line-height: 1.5;
white-space: normal;
word-break: break-word;
}
.message.assistant { background: #f1f4fb; border-color: #dfe6f5; }
.message.user {
background: #fff;
margin-left: auto;
border-color: #d7dbe5;
white-space: pre-wrap;
}
.assistant-before,
.assistant-after {
white-space: pre-wrap;
line-height: 1.5;
}
.assistant-tool { margin: 2px 0 2px 0; }
.search-state {
display: block;
margin: 0;
color: #1f6feb;
font-weight: 600;
line-height: 1.5;
white-space: normal;
}
.search-state .loader-wrapper { margin: 0; justify-content: flex-start; }
.search-state.done { color: #1f6feb; }
.composer {
border-top: 1px solid var(--border);
padding: 14px 20px 16px;
background: linear-gradient(180deg, rgba(255,255,255,0.92), #fff);
display: flex;
flex-direction: column;
gap: 8px;
}
.composer textarea {
width: 100%;
resize: none;
border: 1px solid var(--border);
border-radius: 12px;
padding: 12px;
font-size: 14px;
line-height: 1.5;
outline: none;
background: #fff;
transition: border 0.15s ease;
}
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,111,235,0.12); }
.composer-actions {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.hint { color: var(--muted); font-size: 13px; }
.loader-wrapper {
position: relative;
display: inline-flex;
min-height: 24px;
align-items: center;
justify-content: flex-start;
color: #1f6feb;
user-select: none;
gap: 10px;
}
.letter-wrapper {
display: flex;
gap: 1px;
}
.loader-letter {
display: inline-block;
opacity: 0.4;
transform: translateY(0);
animation: loader-letter-anim 2s infinite;
z-index: 1;
border-radius: 50ch;
border: none;
color: #1f6feb;
font-weight: 600;
}
.search-done {
display: inline-block;
color: #1f6feb;
font-weight: 600;
}
.loader-letter:nth-child(1) { animation-delay: 0s; }
.loader-letter:nth-child(2) { animation-delay: 0.1s; }
.loader-letter:nth-child(3) { animation-delay: 0.2s; }
.loader-letter:nth-child(4) { animation-delay: 0.3s; }
.loader-letter:nth-child(5) { animation-delay: 0.4s; }
.loader-letter:nth-child(6) { animation-delay: 0.5s; }
.loader-letter:nth-child(7) { animation-delay: 0.6s; }
.loader-letter:nth-child(8) { animation-delay: 0.7s; }
.loader-letter:nth-child(9) { animation-delay: 0.8s; }
.loader-letter:nth-child(10) { animation-delay: 0.9s; }
@keyframes loader-letter-anim {
0%, 100% {
opacity: 0.4;
transform: translateY(0);
}
20% {
opacity: 1;
transform: scale(1.15);
}
40% {
opacity: 0.7;
transform: translateY(0);
}
}
@media (max-width: 900px) {
.app-shell { grid-template-columns: 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 -100%; max-width: 260px; z-index: 10; transition: transform 0.2s ease; box-shadow: var(--shadow); }
.sidebar.open { transform: translateX(100%); }
.chat-pane { margin-left: 0; }
.chat-log .message { max-width: 100%; }
.topbar { padding-right: 12px; }
}