Files
ChatAIBot/static/css/app.css
T
2026-05-29 08:52:33 +03:00

593 lines
18 KiB
CSS

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
background: #1a1a2e;
color: #e0e0e0;
font-family: 'Segoe UI', sans-serif;
height: 100vh;
height: 100dvh;
display: flex;
flex-direction: column;
overflow: hidden;
}
header {
width: 100%;
padding: 12px 20px;
background: #16213e;
border-bottom: 1px solid #0f3460;
display: flex;
align-items: center;
gap: 12px;
flex-shrink: 0;
z-index: 10;
}
header h1 { font-size: 1.1rem; color: #e94560; }
#sidebarToggle {
background: none;
border: 1px solid #0f3460;
border-radius: 8px;
color: #888;
padding: 4px 10px;
cursor: pointer;
font-size: 1rem;
transition: all 0.2s;
}
#sidebarToggle:hover { border-color: #e94560; color: #e94560; }
.header-title {
flex: 1;
font-size: 0.9rem;
color: #ccc;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.rpg-toggle {
display: flex;
align-items: center;
gap: 6px;
font-size: 0.75rem;
color: #888;
border: 1px solid #0f3460;
border-radius: 10px;
padding: 4px 10px;
cursor: pointer;
user-select: none;
}
.rpg-toggle input { accent-color: #e94560; }
.rpg-toggle:hover { border-color: #e94560; color: #e94560; }
.app-body { display: flex; flex: 1; overflow: hidden; }
.sidebar {
width: 260px;
background: #16213e;
border-right: 1px solid #0f3460;
display: flex;
flex-direction: column;
flex-shrink: 0;
transition: width 0.25s ease, opacity 0.25s ease;
overflow: hidden;
}
.sidebar.collapsed { width: 0; opacity: 0; pointer-events: none; }
.sidebar-header {
padding: 12px 14px;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #0f3460;
}
.sidebar-header span {
font-size: 0.8rem;
color: #888;
text-transform: uppercase;
letter-spacing: 0.05em;
}
#newChatBtn {
background: #e94560;
border: none;
border-radius: 8px;
color: white;
padding: 5px 12px;
font-size: 0.8rem;
cursor: pointer;
}
#newChatBtn:hover { background: #c73652; }
.session-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.session-item {
display: flex;
align-items: center;
gap: 8px;
padding: 9px 14px;
cursor: pointer;
border-left: 3px solid transparent;
}
.session-item:hover { background: #1a1a2e; }
.session-item.active { background: #1a1a2e; border-left-color: #e94560; }
.session-item .s-title { flex: 1; font-size: 0.82rem; color: #ccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-item .s-companion { flex: 1; font-size: 0.72rem; color: #777; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-item .s-meta { font-size: 0.7rem; color: #555; }
.session-item .s-del { background: none; border: none; color: #555; cursor: pointer; opacity: 0; }
.session-item:hover .s-del { opacity: 1; }
.session-item .s-del:hover { color: #e94560; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.persona-bar {
display: flex;
gap: 8px;
padding: 8px 16px;
overflow-x: auto;
border-bottom: 1px solid #0f3460;
}
.system-blob {
border-bottom: 1px solid #0f3460;
background: #11162a;
padding: 8px 16px;
}
.system-blob-header {
display: flex;
align-items: center;
justify-content: space-between;
color: #888;
font-size: 0.8rem;
margin-bottom: 6px;
}
.system-blob-header button {
background: transparent;
border: 1px solid #0f3460;
border-radius: 8px;
color: #888;
padding: 4px 10px;
cursor: pointer;
}
.system-blob-header button:hover { border-color: #e94560; color: #e94560; }
.system-blob-content {
white-space: pre-wrap;
word-break: break-word;
font-size: 0.78rem;
color: #aaa;
max-height: 140px;
overflow: auto;
margin: 0;
}
.persona-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding: 6px 12px;
background: #16213e;
border: 1px solid #0f3460;
border-radius: 10px;
cursor: pointer;
position: relative;
flex-shrink: 0;
}
.persona-card:hover { border-color: #e94560; }
.persona-card.active { border-color: #e94560; background: #1f1535; }
.persona-card .emoji { font-size: 1.2rem; }
.persona-card .pname { font-size: 0.7rem; color: #ccc; }
.persona-card .avatar {
width: 28px;
height: 28px;
border-radius: 50%;
object-fit: cover;
border: 1px solid #0f3460;
}
.persona-card .del-btn {
position: absolute; top: -5px; right: -5px;
width: 14px; height: 14px;
background: #e94560; border: none; border-radius: 50%;
color: white; font-size: 0.55rem; cursor: pointer;
display: none;
}
.persona-card .edit-btn {
position: absolute; top: -5px; left: -5px;
width: 16px; height: 16px;
background: #0f3460; border: 1px solid #e94560; border-radius: 50%;
color: white; font-size: 0.55rem; cursor: pointer;
display: none; align-items: center; justify-content: center;
}
.persona-card:hover .del-btn { display: flex; align-items: center; justify-content: center; }
.persona-card:hover .edit-btn { display: flex; }
.persona-add, .card-import-btn {
display: flex; flex-direction: column; align-items: center;
padding: 6px 12px;
background: transparent;
border: 1px dashed #0f3460; border-radius: 10px;
cursor: pointer; color: #555; font-size: 0.7rem;
flex-shrink: 0;
}
.persona-add:hover, .card-import-btn:hover { border-color: #e94560; color: #e94560; }
.messages {
flex: 1;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 12px;
padding: 16px;
}
.message { display: flex; flex-direction: column; max-width: 75%; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }
.bubble {
padding: 10px 14px;
border-radius: 16px;
line-height: 1.5;
font-size: 0.95rem;
white-space: pre-wrap;
word-break: break-word;
}
.bubble.typing-active::after { content: '▋'; animation: blink 0.7s infinite; color: #e94560; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.message.user .bubble { background: #0f3460; border-bottom-right-radius: 4px; }
.message.assistant .bubble { background: #16213e; border: 1px solid #0f3460; border-bottom-left-radius: 4px; }
.label { font-size: 0.7rem; color: #888; margin-bottom: 4px; padding: 0 4px; }
.message.user .label { text-align: right; }
.image-prompt-block {
margin-top: 8px; padding: 8px 12px;
background: #1a1a2e;
border: 1px dashed #e94560;
border-radius: 8px;
font-size: 0.8rem; color: #e94560;
}
.image-prompt-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.image-prompt-block .prompt-text { display: block; color: #aaa; margin-top: 4px; font-style: italic; white-space: pre-wrap; }
.copy-prompt-btn, .gen-image-btn {
background: #0f3460;
border: 1px solid #e94560;
border-radius: 6px;
color: #e94560;
font-size: 0.7rem;
padding: 2px 8px;
cursor: pointer;
}
.copy-prompt-btn:hover, .gen-image-btn:hover { background: #e94560; color: white; }
.translate-btn {
align-self: flex-end;
background: #0f3460;
border: 1px solid #4a90d9;
border-radius: 6px;
color: #4a90d9;
font-size: 0.7rem;
padding: 2px 8px;
cursor: pointer;
margin-top: 4px;
}
.translate-btn:hover { background: #4a90d9; color: white; }
.translate-btn:disabled { opacity: 0.5; cursor: default; }
.chat-image { margin-top: 8px; max-width: 100%; border-radius: 8px; border: 1px solid #0f3460; }
.image-error { margin-top: 6px; font-size: 0.75rem; color: #888; }
.choice-row {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 8px;
}
.choice-btn {
background: #16213e;
border: 1px solid #0f3460;
border-radius: 10px;
color: #ccc;
font-size: 0.8rem;
padding: 6px 10px;
cursor: pointer;
}
.choice-btn:hover {
border-color: #e94560;
color: #e94560;
}
.typing {
align-self: flex-start;
display: flex; gap: 4px;
padding: 12px 16px;
background: #16213e;
border: 1px solid #0f3460;
border-radius: 16px;
}
.typing span { width: 6px; height: 6px; background: #888; border-radius: 50%; animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.input-area {
display: flex; gap: 10px;
padding: 12px 16px;
padding-bottom: max(12px, env(safe-area-inset-bottom));
border-top: 1px solid #0f3460;
}
textarea {
flex: 1;
background: #16213e;
border: 1px solid #0f3460;
border-radius: 12px;
color: #e0e0e0;
font-size: 0.95rem;
padding: 10px 14px;
resize: none; outline: none;
font-family: inherit;
max-height: 120px;
}
textarea:focus { border-color: #e94560; }
#sendBtn {
background: #e94560; border: none;
border-radius: 12px; color: white;
padding: 0 20px; cursor: pointer;
}
#sendBtn:disabled { background: #555; cursor: not-allowed; }
#clearBtn {
background: transparent;
border: 1px solid #0f3460;
border-radius: 12px; color: #888;
padding: 0 14px; cursor: pointer;
}
#clearBtn:hover { border-color: #e94560; color: #e94560; }
.modal-overlay {
display: none; position: fixed; inset: 0;
background: rgba(0,0,0,0.7);
z-index: 100; align-items: center; justify-content: center;
padding: 16px;
overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
background: #16213e; border: 1px solid #0f3460;
border-radius: 16px; padding: 24px;
width: 100%; max-width: 440px;
max-height: calc(100vh - 32px);
display: flex; flex-direction: column; gap: 12px;
margin: auto;
}
.modal-wizard { max-width: 480px; }
.modal-wizard-header { flex-shrink: 0; }
.modal-wizard-header h2 { margin-bottom: 8px; }
.modal-wizard-body {
flex: 1; min-height: 0;
overflow-y: auto;
padding-right: 4px;
}
.modal-wizard-footer {
flex-shrink: 0;
margin-top: 4px;
}
.wizard-steps {
display: flex; align-items: center; justify-content: center;
gap: 0; margin-bottom: 4px;
}
.wizard-step-dot {
width: 28px; height: 28px; border-radius: 50%;
background: #1a1a2e; border: 1px solid #0f3460;
color: #666; font-size: 0.75rem;
display: flex; align-items: center; justify-content: center;
transition: all 0.15s;
}
.wizard-step-dot.active { border-color: #e94560; color: #e94560; background: #1f0a14; }
.wizard-step-dot.done { border-color: #9b7fd4; color: #9b7fd4; }
.wizard-step-line { width: 40px; height: 1px; background: #0f3460; }
.wizard-page { display: none; flex-direction: column; gap: 12px; }
.wizard-page.active { display: flex; }
.wizard-page-title { font-size: 0.85rem; color: #9b7fd4; margin: 0 0 4px; }
.wizard-hint { font-size: 0.8rem; color: #666; margin: -4px 0 4px; }
.selected-genres-label { font-size: 0.8rem; color: #e94560; margin-top: 4px; }
.wizard-nav { display: flex; gap: 8px; }
.wizard-nav-btn {
padding: 8px 18px; border-radius: 8px; border: none; cursor: pointer;
background: #0f3460; color: #ccc;
}
.wizard-nav-btn:hover { color: #e0e0e0; }
.wizard-nav-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.modal h2 { font-size: 1.1rem; color: #e94560; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: #888; }
.modal input, .modal textarea {
background: #1a1a2e; border: 1px solid #0f3460;
border-radius: 8px; color: #e0e0e0;
padding: 8px 10px; outline: none; font-family: inherit;
}
.modal-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.modal-wizard-footer { justify-content: space-between; align-items: center; }
.modal-buttons button { padding: 8px 18px; border-radius: 8px; border: none; cursor: pointer; }
#modalCancel, #cardModalCancel { background: #0f3460; color: #aaa; }
#modalSave, #cardModalImport { background: #e94560; color: white; }
.empty-state {
flex: 1; display: flex;
align-items: center; justify-content: center;
color: #444; flex-direction: column; gap: 8px;
}
.empty-state .big { font-size: 2.5rem; }
.hidden { display: none !important; }
/* Narrator message bubble */
.message.narrator { align-self: center; max-width: 80%; }
.message.narrator .label { color: #9b7fd4; font-size: 0.75rem; margin-bottom: 4px; }
.message.narrator .bubble {
background: #1a1230;
border: 1px solid #4a2d8a;
border-left: 3px solid #9b7fd4;
border-radius: 12px;
padding: 10px 14px;
color: #ccc;
font-size: 0.9rem;
}
/* Dice block inside narrator bubble */
.dice-block {
display: flex; align-items: center; gap: 8px;
margin-bottom: 8px;
padding: 4px 8px;
border-radius: 8px;
background: #0f0a1e;
font-size: 0.8rem;
width: fit-content;
}
.dice-icon { font-size: 1.1rem; }
.dice-roll { font-size: 1.3rem; font-weight: bold; }
.dice-outcome { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.outcome-crit-fail { border: 1px solid #c0392b; }
.outcome-crit-fail .dice-roll { color: #e74c3c; }
.outcome-crit-fail .dice-outcome { color: #e74c3c; }
.outcome-fail { border: 1px solid #555; }
.outcome-fail .dice-roll { color: #aaa; }
.outcome-fail .dice-outcome { color: #888; }
.outcome-success { border: 1px solid #27ae60; }
.outcome-success .dice-roll { color: #2ecc71; }
.outcome-success .dice-outcome { color: #2ecc71; }
.outcome-crit-success { border: 1px solid #f39c12; }
.outcome-crit-success .dice-roll { color: #f1c40f; }
.outcome-crit-success .dice-outcome { color: #f1c40f; }
.narrator-text { white-space: pre-wrap; line-height: 1.5; }
/* Affinity display in header */
.affinity-display {
font-size: 0.8rem; padding: 4px 10px;
border: 1px solid #0f3460; border-radius: 10px;
color: #aaa; white-space: nowrap;
}
.affinity-display.affinity-high { border-color: #e94560; color: #e94560; }
.affinity-display.affinity-low { border-color: #555; color: #666; }
/* Quest panel in sidebar */
.quest-panel {
border-top: 1px solid #0f3460;
padding: 10px 14px;
flex-shrink: 0;
}
.quest-panel-header {
font-size: 0.75rem; color: #888;
text-transform: uppercase; letter-spacing: 0.05em;
margin-bottom: 6px;
}
.quest-item {
font-size: 0.8rem; padding: 4px 0;
color: #bbb; line-height: 1.4;
border-bottom: 1px solid #0f3460;
}
.quest-item:last-child { border-bottom: none; }
.quest-done { color: #555; text-decoration: line-through; }
.quest-failed { color: #c0392b; }
/* Genre modal grid */
.genre-grid {
display: grid; grid-template-columns: 1fr 1fr;
gap: 8px; margin: 4px 0;
}
.genre-btn {
background: #1a1a2e; border: 1px solid #0f3460;
border-radius: 8px; color: #ccc;
padding: 10px 8px; cursor: pointer;
font-size: 0.85rem; text-align: center;
transition: all 0.15s;
}
.genre-btn:hover { border-color: #9b7fd4; color: #e0e0e0; }
.genre-btn.selected { border-color: #e94560; color: #e94560; background: #1f0a14; }
/* RPG settings checkboxes */
.rpg-settings-grid {
display: grid; grid-template-columns: 1fr 1fr;
gap: 6px; margin: 4px 0;
}
.rpg-settings-grid label {
display: flex; align-items: center; gap: 6px;
font-size: 0.8rem; color: #aaa; cursor: pointer;
flex-direction: row;
}
.rpg-settings-grid input[type=checkbox] { accent-color: #e94560; }
.header-icon-btn {
background: transparent; border: 1px solid #0f3460;
border-radius: 10px; color: #aaa; padding: 4px 10px;
cursor: pointer; font-size: 1rem;
}
.header-icon-btn:hover { border-color: #e94560; color: #e94560; }
.rpg-badge {
font-size: 0.7rem; padding: 3px 8px;
border: 1px solid #9b7fd4; border-radius: 8px;
color: #9b7fd4; text-transform: uppercase;
letter-spacing: 0.05em;
}
.persona-pick-grid {
display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
gap: 8px;
}
.persona-pick-card {
background: #1a1a2e; border: 1px solid #0f3460;
border-radius: 10px; padding: 10px 8px;
cursor: pointer; text-align: center;
font-size: 0.8rem; color: #ccc;
transition: all 0.15s;
}
.persona-pick-card:hover { border-color: #9b7fd4; }
.persona-pick-card.selected { border-color: #e94560; color: #e94560; background: #1f0a14; }
.persona-pick-card .emoji { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.rpg-mode-option {
display: flex; align-items: center; gap: 8px;
font-size: 0.9rem; color: #ccc; cursor: pointer;
flex-direction: row !important;
padding: 8px 0;
}
.chat-settings-meta {
margin-top: 12px; padding: 10px;
background: #1a1a2e; border-radius: 8px;
font-size: 0.8rem; color: #888; line-height: 1.5;
}
.session-item .s-preview {
font-size: 0.75rem; color: #666;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
margin-top: 2px;
}
.session-item .s-row {
display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.session-item .s-badge {
font-size: 0.65rem; padding: 1px 5px;
border: 1px solid #9b7fd4; border-radius: 4px;
color: #9b7fd4;
}
.session-item .s-date { font-size: 0.7rem; color: #555; margin-left: auto; }
.session-item .s-title[contenteditable] {
outline: none; border-bottom: 1px dashed #e94560;
}
.message-actions {
display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap;
}
.message-actions button {
background: #0f3460; border: none; border-radius: 6px;
color: #aaa; font-size: 0.7rem; padding: 3px 8px; cursor: pointer;
}
.message-actions button:hover { color: #e94560; }
.message .bubble-edit {
width: 100%; min-height: 60px;
background: #1a1a2e; border: 1px solid #e94560;
border-radius: 8px; color: #e0e0e0; padding: 8px;
font-family: inherit; resize: vertical;
}