242 lines
4.1 KiB
CSS
242 lines
4.1 KiB
CSS
|
|
/* ============================================================
|
||
|
|
CamTalk — 主应用样式
|
||
|
|
============================================================ */
|
||
|
|
|
||
|
|
:root {
|
||
|
|
--color-primary: #2563eb;
|
||
|
|
--color-primary-hover: #1d4ed8;
|
||
|
|
--color-bg: #0f172a;
|
||
|
|
--color-surface: #1e293b;
|
||
|
|
--color-text: #f1f5f9;
|
||
|
|
--color-text-muted: #94a3b8;
|
||
|
|
--color-border: #334155;
|
||
|
|
--color-success: #22c55e;
|
||
|
|
--color-warning: #f59e0b;
|
||
|
|
--color-error: #ef4444;
|
||
|
|
--radius: 8px;
|
||
|
|
}
|
||
|
|
|
||
|
|
* {
|
||
|
|
margin: 0;
|
||
|
|
padding: 0;
|
||
|
|
box-sizing: border-box;
|
||
|
|
}
|
||
|
|
|
||
|
|
body {
|
||
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||
|
|
background: var(--color-bg);
|
||
|
|
color: var(--color-text);
|
||
|
|
min-height: 100vh;
|
||
|
|
}
|
||
|
|
|
||
|
|
.app {
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
min-height: 100vh;
|
||
|
|
max-width: 900px;
|
||
|
|
margin: 0 auto;
|
||
|
|
padding: 0 16px;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* ---- Header ---- */
|
||
|
|
|
||
|
|
.app-header {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: space-between;
|
||
|
|
padding: 16px 0;
|
||
|
|
border-bottom: 1px solid var(--color-border);
|
||
|
|
}
|
||
|
|
|
||
|
|
.app-header h1 {
|
||
|
|
font-size: 1.5rem;
|
||
|
|
font-weight: 700;
|
||
|
|
}
|
||
|
|
|
||
|
|
.status {
|
||
|
|
font-size: 0.85rem;
|
||
|
|
padding: 4px 12px;
|
||
|
|
border-radius: 12px;
|
||
|
|
background: var(--color-surface);
|
||
|
|
}
|
||
|
|
|
||
|
|
.status--connected {
|
||
|
|
color: var(--color-success);
|
||
|
|
border: 1px solid var(--color-success);
|
||
|
|
}
|
||
|
|
|
||
|
|
.status--connecting {
|
||
|
|
color: var(--color-warning);
|
||
|
|
border: 1px solid var(--color-warning);
|
||
|
|
}
|
||
|
|
|
||
|
|
.status--disconnected {
|
||
|
|
color: var(--color-text-muted);
|
||
|
|
border: 1px solid var(--color-border);
|
||
|
|
}
|
||
|
|
|
||
|
|
/* ---- Main ---- */
|
||
|
|
|
||
|
|
.app-main {
|
||
|
|
flex: 1;
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
gap: 16px;
|
||
|
|
padding: 16px 0;
|
||
|
|
overflow: hidden;
|
||
|
|
}
|
||
|
|
|
||
|
|
.video-section {
|
||
|
|
position: relative;
|
||
|
|
flex-shrink: 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
.vad-indicator {
|
||
|
|
position: absolute;
|
||
|
|
bottom: 12px;
|
||
|
|
left: 12px;
|
||
|
|
background: rgba(0, 0, 0, 0.7);
|
||
|
|
color: var(--color-success);
|
||
|
|
padding: 6px 12px;
|
||
|
|
border-radius: var(--radius);
|
||
|
|
font-size: 0.85rem;
|
||
|
|
animation: pulse 1.5s ease-in-out infinite;
|
||
|
|
}
|
||
|
|
|
||
|
|
@keyframes pulse {
|
||
|
|
0%, 100% { opacity: 1; }
|
||
|
|
50% { opacity: 0.6; }
|
||
|
|
}
|
||
|
|
|
||
|
|
.chat-section {
|
||
|
|
flex: 1;
|
||
|
|
overflow-y: auto;
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
gap: 12px;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* ---- Video Preview ---- */
|
||
|
|
|
||
|
|
.video-preview {
|
||
|
|
position: relative;
|
||
|
|
width: 100%;
|
||
|
|
aspect-ratio: 4 / 3;
|
||
|
|
background: var(--color-surface);
|
||
|
|
border-radius: var(--radius);
|
||
|
|
overflow: hidden;
|
||
|
|
}
|
||
|
|
|
||
|
|
.video-preview__video {
|
||
|
|
width: 100%;
|
||
|
|
height: 100%;
|
||
|
|
object-fit: cover;
|
||
|
|
}
|
||
|
|
|
||
|
|
.video-preview__placeholder {
|
||
|
|
position: absolute;
|
||
|
|
inset: 0;
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
color: var(--color-text-muted);
|
||
|
|
}
|
||
|
|
|
||
|
|
/* ---- Chat Panel ---- */
|
||
|
|
|
||
|
|
.chat-panel {
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
gap: 12px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.chat-panel--empty {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
padding: 48px 0;
|
||
|
|
color: var(--color-text-muted);
|
||
|
|
}
|
||
|
|
|
||
|
|
.chat-message {
|
||
|
|
padding: 12px 16px;
|
||
|
|
border-radius: var(--radius);
|
||
|
|
background: var(--color-surface);
|
||
|
|
}
|
||
|
|
|
||
|
|
.chat-message--user {
|
||
|
|
border-left: 3px solid var(--color-primary);
|
||
|
|
}
|
||
|
|
|
||
|
|
.chat-message--assistant {
|
||
|
|
border-left: 3px solid var(--color-success);
|
||
|
|
}
|
||
|
|
|
||
|
|
.chat-message--streaming {
|
||
|
|
opacity: 0.8;
|
||
|
|
}
|
||
|
|
|
||
|
|
.chat-message__role {
|
||
|
|
font-size: 0.75rem;
|
||
|
|
font-weight: 600;
|
||
|
|
text-transform: uppercase;
|
||
|
|
color: var(--color-text-muted);
|
||
|
|
margin-bottom: 4px;
|
||
|
|
}
|
||
|
|
|
||
|
|
.chat-message__content {
|
||
|
|
font-size: 0.95rem;
|
||
|
|
line-height: 1.5;
|
||
|
|
white-space: pre-wrap;
|
||
|
|
}
|
||
|
|
|
||
|
|
/* ---- Footer ---- */
|
||
|
|
|
||
|
|
.app-footer {
|
||
|
|
display: flex;
|
||
|
|
gap: 12px;
|
||
|
|
justify-content: center;
|
||
|
|
padding: 16px 0;
|
||
|
|
border-top: 1px solid var(--color-border);
|
||
|
|
}
|
||
|
|
|
||
|
|
/* ---- Buttons ---- */
|
||
|
|
|
||
|
|
.btn {
|
||
|
|
padding: 10px 24px;
|
||
|
|
border: none;
|
||
|
|
border-radius: var(--radius);
|
||
|
|
font-size: 0.95rem;
|
||
|
|
font-weight: 600;
|
||
|
|
cursor: pointer;
|
||
|
|
transition: background 0.2s;
|
||
|
|
}
|
||
|
|
|
||
|
|
.btn--primary {
|
||
|
|
background: var(--color-primary);
|
||
|
|
color: white;
|
||
|
|
}
|
||
|
|
|
||
|
|
.btn--primary:hover {
|
||
|
|
background: var(--color-primary-hover);
|
||
|
|
}
|
||
|
|
|
||
|
|
.btn--secondary {
|
||
|
|
background: var(--color-surface);
|
||
|
|
color: var(--color-text);
|
||
|
|
border: 1px solid var(--color-border);
|
||
|
|
}
|
||
|
|
|
||
|
|
.btn--secondary:hover {
|
||
|
|
background: var(--color-border);
|
||
|
|
}
|
||
|
|
|
||
|
|
.btn--warning {
|
||
|
|
background: var(--color-warning);
|
||
|
|
color: #000;
|
||
|
|
}
|
||
|
|
|
||
|
|
.btn--warning:hover {
|
||
|
|
opacity: 0.9;
|
||
|
|
}
|