693 lines
13 KiB
CSS
693 lines
13 KiB
CSS
:root {
|
|
--base-font-size: calc(1rem + 0.1618vw);
|
|
--ratio: 1.618;
|
|
--s-2: calc(var(--s-1) / var(--ratio));
|
|
--s-1: calc(var(--s0) / var(--ratio));
|
|
--s0: var(--base-font-size);
|
|
--s1: calc(var(--s0) * var(--ratio));
|
|
--s2: calc(var(--s1) * var(--ratio));
|
|
--s3: calc(var(--s2) * var(--ratio));
|
|
|
|
--font-sans: system-ui, -apple-system, sans-serif;
|
|
--font-mono: ui-monospace, monospace;
|
|
|
|
--color-black: #1d1f21;
|
|
--color-blue: #4271ae;
|
|
--color-brown: #a3685a;
|
|
--color-cyan: #3e999f;
|
|
--color-gray0: #efefef;
|
|
--color-gray1: #e0e0e0;
|
|
--color-gray2: #d6d6d6;
|
|
--color-gray3: #8e908c;
|
|
--color-gray4: #969896;
|
|
--color-gray5: #4d4d4c;
|
|
--color-gray6: #282a2e;
|
|
--color-green: #718c00;
|
|
--color-orange: #f5871f;
|
|
--color-purple: #8959a8;
|
|
--color-red: #c82829;
|
|
--color-yellow: #eab700;
|
|
|
|
--color-bg: var(--color-gray0);
|
|
--color-surface: white;
|
|
--color-text: var(--color-black);
|
|
--color-text-muted: var(--color-gray3);
|
|
--color-border: var(--color-black);
|
|
--color-border-light: var(--color-gray2);
|
|
--color-primary: var(--color-blue);
|
|
--color-primary-hover: var(--color-cyan);
|
|
--color-recording: var(--color-red);
|
|
--color-error: var(--color-yellow);
|
|
|
|
--measure: 80ch;
|
|
--radius: 0.375rem;
|
|
--icon-size: 1.25rem;
|
|
--action-icon-size: 0.875rem;
|
|
--border-width: 2px;
|
|
--textarea-line-height: 1.5rem;
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Reset */
|
|
/* ==================== */
|
|
|
|
*,
|
|
*::before,
|
|
*::after {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Base */
|
|
/* ==================== */
|
|
|
|
html {
|
|
font-size: 100%;
|
|
font-family: var(--font-sans);
|
|
line-height: 1.5;
|
|
color: var(--color-text);
|
|
background: var(--color-bg);
|
|
}
|
|
|
|
body {
|
|
overflow: hidden;
|
|
min-height: 100dvh;
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Layout */
|
|
/* ==================== */
|
|
|
|
.container {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 100dvh;
|
|
height: 100dvh;
|
|
max-width: calc(var(--measure) + var(--s3) * 2);
|
|
margin-inline: auto;
|
|
padding: var(--s0);
|
|
padding-bottom: 0;
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Chat */
|
|
/* ==================== */
|
|
|
|
.chat {
|
|
flex: 1 1 0;
|
|
min-height: 0;
|
|
overflow-y: auto;
|
|
padding: var(--s1);
|
|
background: var(--color-surface);
|
|
border: 1px solid var(--color-border-light);
|
|
border-radius: var(--radius);
|
|
}
|
|
|
|
.chat > * + * {
|
|
margin-top: var(--s0);
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Collapsible */
|
|
/* ==================== */
|
|
|
|
.collapsible {
|
|
border: 1px dashed var(--color-border-light);
|
|
border-radius: var(--radius);
|
|
}
|
|
|
|
.collapsible[open] .collapsible__summary::before {
|
|
transform: rotate(90deg);
|
|
}
|
|
|
|
.collapsible:last-of-type:has(~ .message__actions:empty) {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.collapsible__content {
|
|
padding: var(--s-2) var(--s-1);
|
|
border-top: 1px dashed var(--color-border-light);
|
|
}
|
|
|
|
.collapsible__content > pre {
|
|
margin: 0;
|
|
font-family: var(--font-mono);
|
|
font-size: var(--s-1);
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
|
|
.collapsible__label {
|
|
font-size: var(--s-1);
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
.collapsible__pre {
|
|
margin: 0;
|
|
padding: var(--s-2);
|
|
font-family: var(--font-mono);
|
|
font-size: var(--s-1);
|
|
background: var(--color-bg);
|
|
border-radius: var(--radius);
|
|
overflow-x: auto;
|
|
white-space: pre-wrap;
|
|
word-break: break-word;
|
|
}
|
|
|
|
.collapsible__section {
|
|
margin-bottom: var(--s-2);
|
|
}
|
|
|
|
.collapsible__section:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.collapsible__section-label {
|
|
font-size: var(--s-2);
|
|
font-weight: 500;
|
|
color: var(--color-text-muted);
|
|
margin-bottom: 0.25rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
|
|
.collapsible__summary {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--s-2);
|
|
padding: var(--s-2) var(--s-1);
|
|
cursor: pointer;
|
|
user-select: none;
|
|
list-style: none;
|
|
}
|
|
|
|
.collapsible__summary::-webkit-details-marker {
|
|
display: none;
|
|
}
|
|
|
|
.collapsible__summary::before {
|
|
content: "▶";
|
|
font-size: 0.625em;
|
|
color: var(--color-text-muted);
|
|
transition: transform 0.15s ease;
|
|
}
|
|
|
|
.collapsible__summary .icon {
|
|
width: var(--icon-size);
|
|
height: var(--icon-size);
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
.collapsible--reasoning .collapsible__summary .icon {
|
|
color: var(--color-purple);
|
|
}
|
|
|
|
.collapsible--reasoning:has(+ .collapsible--tool) {
|
|
margin-bottom: 0;
|
|
border-bottom-left-radius: 0;
|
|
border-bottom-right-radius: 0;
|
|
}
|
|
|
|
.collapsible--reasoning + .collapsible--tool {
|
|
margin-top: 0;
|
|
border-top: none;
|
|
border-top-left-radius: 0;
|
|
border-top-right-radius: 0;
|
|
}
|
|
|
|
.collapsible--tool .collapsible__summary .icon {
|
|
color: var(--color-orange);
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Compose */
|
|
/* ==================== */
|
|
|
|
.compose {
|
|
background: var(--color-surface);
|
|
border: 1px solid var(--color-border-light);
|
|
border-radius: var(--radius);
|
|
overflow: hidden;
|
|
margin-bottom: var(--s0);
|
|
}
|
|
|
|
.compose__action-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0.25rem;
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: 0.25rem;
|
|
color: var(--color-text-muted);
|
|
cursor: pointer;
|
|
transition:
|
|
color 0.15s ease,
|
|
background-color 0.15s ease;
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
.compose__action-btn:hover {
|
|
color: var(--color-text);
|
|
}
|
|
}
|
|
|
|
.compose__action-btn:focus-visible {
|
|
outline: 2px solid var(--color-primary);
|
|
outline-offset: 1px;
|
|
}
|
|
|
|
.compose__action-btn:disabled {
|
|
opacity: 0.4;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.compose__action-btn .icon {
|
|
width: var(--action-icon-size);
|
|
height: var(--action-icon-size);
|
|
}
|
|
|
|
.compose__action-btn--record.recording {
|
|
color: white;
|
|
background: var(--color-recording);
|
|
animation: pulse 1s ease-in-out infinite;
|
|
}
|
|
|
|
.compose__action-btn--send.loading {
|
|
position: relative;
|
|
color: transparent;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.compose__action-btn--send.loading::after {
|
|
content: "";
|
|
position: absolute;
|
|
width: 0.75rem;
|
|
height: 0.75rem;
|
|
border: 2px solid var(--color-gray2);
|
|
border-top-color: var(--color-primary);
|
|
border-radius: 50%;
|
|
animation: spin 0.8s linear infinite;
|
|
}
|
|
|
|
.compose__actions {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0.125rem var(--s-2);
|
|
border-top: 1px dotted var(--color-border-light);
|
|
}
|
|
|
|
.compose__actions-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.125rem;
|
|
}
|
|
|
|
.compose__attachment {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.25rem;
|
|
padding: 0.125rem 0.375rem;
|
|
font-size: var(--s-1);
|
|
background: var(--color-gray1);
|
|
border-radius: var(--radius);
|
|
color: var(--color-text);
|
|
}
|
|
|
|
.compose__attachment-name {
|
|
max-width: 120px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.compose__attachment-remove {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0;
|
|
background: none;
|
|
border: none;
|
|
color: var(--color-text-muted);
|
|
cursor: pointer;
|
|
transition: color 0.15s ease;
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
.compose__attachment-remove:hover {
|
|
color: var(--color-red);
|
|
}
|
|
}
|
|
|
|
.compose__attachment-remove .icon {
|
|
width: 0.875rem;
|
|
height: 0.875rem;
|
|
}
|
|
|
|
.compose__attachments {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: var(--s-2);
|
|
padding: var(--s-2) var(--s-1);
|
|
border-top: 1px dotted var(--color-border-light);
|
|
}
|
|
|
|
.compose__attachments:empty {
|
|
display: none;
|
|
}
|
|
|
|
.compose__textarea {
|
|
display: block;
|
|
width: 100%;
|
|
height: auto;
|
|
min-height: calc(var(--textarea-line-height) + var(--s-1) * 2);
|
|
max-height: calc(var(--textarea-line-height) * 5 + var(--s-1) * 2);
|
|
padding: var(--s-1);
|
|
font-family: inherit;
|
|
font-size: var(--s0);
|
|
line-height: var(--textarea-line-height);
|
|
color: var(--color-text);
|
|
background: var(--color-surface);
|
|
border: none;
|
|
resize: none;
|
|
overflow-y: auto;
|
|
field-sizing: content;
|
|
}
|
|
|
|
.compose__textarea:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.compose__textarea::placeholder {
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Footer */
|
|
/* ==================== */
|
|
|
|
.footer {
|
|
margin-top: var(--s0);
|
|
background: var(--color-bg);
|
|
}
|
|
|
|
.footer__select {
|
|
height: 2rem;
|
|
padding: 0 var(--s-1);
|
|
font-family: inherit;
|
|
font-size: var(--s-1);
|
|
line-height: 2rem;
|
|
color: var(--color-text);
|
|
background: var(--color-surface);
|
|
border: 1px solid var(--color-border-light);
|
|
border-radius: var(--radius);
|
|
cursor: pointer;
|
|
max-width: 150px;
|
|
}
|
|
|
|
.footer__select:focus-visible {
|
|
outline: 2px solid var(--color-primary);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.footer__toolbar {
|
|
border-inline: none;
|
|
border-bottom: none;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--s-2);
|
|
padding: var(--s-2);
|
|
background: var(--color-surface);
|
|
border: 1px solid var(--color-border-light);
|
|
border-radius: var(--radius);
|
|
}
|
|
|
|
.footer__toolbar-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 2rem;
|
|
width: 2rem;
|
|
padding: 0;
|
|
background: transparent;
|
|
border: 1px solid var(--color-border-light);
|
|
border-radius: var(--radius);
|
|
color: var(--color-text-muted);
|
|
cursor: pointer;
|
|
transition: all 0.15s ease;
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
.footer__toolbar-btn:hover {
|
|
color: var(--color-text);
|
|
border-color: var(--color-text-muted);
|
|
}
|
|
}
|
|
|
|
.footer__toolbar-btn:focus-visible {
|
|
outline: 2px solid var(--color-primary);
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
.footer__toolbar-btn .icon {
|
|
width: 1rem;
|
|
height: 1rem;
|
|
}
|
|
|
|
.footer__toolbar-btn--muted {
|
|
color: var(--color-red);
|
|
border-color: var(--color-red);
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
.footer__toolbar-btn--muted:hover {
|
|
color: var(--color-red);
|
|
border-color: var(--color-red);
|
|
}
|
|
}
|
|
|
|
.footer__toolbar-spacer {
|
|
flex: 1;
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Message */
|
|
/* ==================== */
|
|
|
|
.message {
|
|
display: flex;
|
|
max-width: 100%;
|
|
border: var(--border-width) solid var(--color-border);
|
|
border-radius: var(--radius);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.message--assistant .message__icon {
|
|
color: var(--color-primary);
|
|
}
|
|
|
|
.message--debug-open .message__debug {
|
|
display: block;
|
|
}
|
|
|
|
.message--error {
|
|
border-color: var(--color-error);
|
|
}
|
|
|
|
.message--error .message__icon {
|
|
border-color: var(--color-error);
|
|
}
|
|
|
|
.message--user .message__icon {
|
|
color: var(--color-green);
|
|
}
|
|
|
|
.message__action-btn {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0.125rem;
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: 0.125rem;
|
|
color: var(--color-text-muted);
|
|
cursor: pointer;
|
|
transition: color 0.15s ease;
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
.message__action-btn:hover {
|
|
color: var(--color-text);
|
|
}
|
|
}
|
|
|
|
.message__action-btn:focus-visible {
|
|
outline: 2px solid var(--color-primary);
|
|
outline-offset: 1px;
|
|
}
|
|
|
|
.message__action-btn svg {
|
|
width: var(--action-icon-size);
|
|
height: var(--action-icon-size);
|
|
}
|
|
|
|
.message__action-btn--success {
|
|
color: var(--color-primary);
|
|
}
|
|
|
|
.message__actions {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 0.125rem;
|
|
padding: 0.125rem 0.25rem;
|
|
border-top: 1px dotted var(--color-border-light);
|
|
background: var(--color-surface);
|
|
}
|
|
|
|
.message__actions:empty {
|
|
display: none;
|
|
}
|
|
|
|
.message__body {
|
|
flex: 1;
|
|
min-width: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.message__content {
|
|
padding: var(--s-2) var(--s-1);
|
|
white-space: pre-wrap;
|
|
word-wrap: break-word;
|
|
overflow-wrap: break-word;
|
|
}
|
|
|
|
.message__content img {
|
|
display: block;
|
|
max-width: 100%;
|
|
height: auto;
|
|
margin-block: var(--s-1);
|
|
border: 1px solid var(--color-border-light);
|
|
border-radius: var(--radius);
|
|
}
|
|
|
|
.message__debug {
|
|
display: none;
|
|
padding: var(--s-2) var(--s-1);
|
|
border-top: 1px dotted var(--color-border-light);
|
|
background: var(--color-surface);
|
|
}
|
|
|
|
.message__debug-list {
|
|
display: grid;
|
|
grid-template-columns: auto 1fr;
|
|
gap: 0.125rem 1rem;
|
|
margin: 0;
|
|
font-size: var(--s-1);
|
|
}
|
|
|
|
.message__debug-list dt,
|
|
.message__debug-list dd {
|
|
margin: 0;
|
|
text-align: left;
|
|
color: var(--color-text);
|
|
}
|
|
|
|
.message__debug-list dt {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.message__icon {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: var(--s-2);
|
|
border-right: var(--border-width) solid var(--color-border);
|
|
background: var(--color-bg);
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
.message__icon svg {
|
|
width: var(--icon-size);
|
|
height: var(--icon-size);
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Animations */
|
|
/* ==================== */
|
|
|
|
@keyframes pulse {
|
|
0%,
|
|
100% {
|
|
opacity: 1;
|
|
}
|
|
50% {
|
|
opacity: 0.7;
|
|
}
|
|
}
|
|
|
|
@keyframes spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
/* ==================== */
|
|
/* Media: Mobile */
|
|
/* ==================== */
|
|
|
|
@media (max-width: 639px) {
|
|
.container {
|
|
padding: 0;
|
|
padding-top: var(--s-1);
|
|
}
|
|
|
|
.chat {
|
|
border-radius: 0;
|
|
border-inline: none;
|
|
}
|
|
|
|
.footer {
|
|
margin-top: var(--s-1);
|
|
padding-bottom: 0;
|
|
}
|
|
|
|
.compose {
|
|
border-radius: 0;
|
|
border-inline: none;
|
|
margin-bottom: var(--s-1);
|
|
}
|
|
|
|
.compose__action-btn {
|
|
min-width: 44px;
|
|
min-height: 44px;
|
|
padding: var(--s-1);
|
|
}
|
|
|
|
.compose__action-btn .icon {
|
|
width: var(--icon-size);
|
|
height: var(--icon-size);
|
|
}
|
|
|
|
.footer__toolbar {
|
|
border-inline: none;
|
|
border-bottom: none;
|
|
border-radius: 0;
|
|
margin-top: 0;
|
|
}
|
|
|
|
.footer__toolbar-btn {
|
|
height: 1.75rem;
|
|
width: 1.75rem;
|
|
}
|
|
|
|
.footer__select {
|
|
height: 1.75rem;
|
|
line-height: 1.75rem;
|
|
max-width: 128px;
|
|
font-size: var(--s-1);
|
|
}
|
|
}
|