Spaces:
Sleeping
Sleeping
File size: 5,743 Bytes
f374654 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
:root {
--bg-color: #131314;
--sidebar-color: #1e1f20;
--chat-area-color: #131314;
--user-msg-color: #383a3f;
--assistant-msg-color: #252629;
--text-color: #e3e3e3;
--border-color: #333;
--accent-color: #4CAF50;
--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: var(--font-family);
background-color: var(--bg-color);
color: var(--text-color);
display: flex;
height: 100vh;
overflow: hidden;
}
.app-container {
display: flex;
width: 100%;
height: 100%;
position: relative;
}
/* Sidebar (hidden on mobile by default) */
.sidebar {
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 260px;
background-color: var(--sidebar-color);
display: flex;
flex-direction: column;
padding: 10px;
transform: translateX(-100%);
transition: transform 0.3s ease-in-out;
z-index: 101; /* Must be on top */
}
.app-container.sidebar-visible .sidebar {
transform: translateX(0);
}
.sidebar-header {
display: flex;
gap: 10px;
align-items: center;
}
.sidebar-button {
flex-grow: 1; /* Allow button to take available space */
padding: 10px 15px;
background-color: transparent;
border: 1px solid var(--border-color);
border-radius: 8px;
color: var(--text-color);
cursor: pointer;
font-size: 1rem;
display: flex;
align-items: center;
gap: 10px;
transition: background-color 0.2s;
}
.sidebar-button:hover { background-color: var(--user-msg-color); }
.chat-history { flex-grow: 1; overflow-y: auto; margin-top: 20px; }
.chat-history-item {
padding: 10px 15px;
margin-bottom: 5px;
border-radius: 6px;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
transition: background-color 0.2s;
}
.chat-history-item:hover { background-color: var(--user-msg-color); }
.chat-history-item.active { background-color: var(--user-msg-color); font-weight: bold; }
.close-sidebar-btn {
background: none;
border: none;
color: #999;
cursor: pointer;
display: none; /* Hidden by default */
padding: 5px;
}
.app-container.sidebar-visible .close-sidebar-btn {
display: block; /* Show when sidebar is visible */
}
/* Main Chat Area */
.chat-area {
width: 100%;
display: flex;
flex-direction: column;
background-color: var(--chat-area-color);
position: relative;
transition: filter 0.3s;
}
.app-container.sidebar-visible .chat-area::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 100;
}
.chat-header { display: flex; align-items: center; padding: 10px; border-bottom: 1px solid var(--border-color); }
.menu-toggle { background: none; border: none; color: var(--text-color); cursor: pointer; }
#chat-title { margin-left: 15px; font-size: 1.1rem; }
.chat-messages { flex-grow: 1; overflow-y: auto; padding: 10px 20px; display: flex; flex-direction: column; }
.welcome-message { text-align: center; margin: auto; color: #888; }
.message { max-width: 90%; margin-bottom: 15px; padding: 10px 15px; border-radius: 12px; line-height: 1.6; word-wrap: break-word; }
.message p, .message ul, .message ol { margin: 0.5em 0; }
.message ul, .message ol { padding-left: 20px; }
.message code { background-color: #111; padding: 2px 4px; border-radius: 4px; }
.message pre { background-color: #111; padding: 10px; border-radius: 8px; overflow-x: auto; }
.message img.user-upload { max-width: 150px; border-radius: 8px; margin-top: 10px; }
.user-message { background-color: var(--user-msg-color); align-self: flex-end; }
.assistant-message { background-color: var(--assistant-msg-color); align-self: flex-start; }
.assistant-message.loading::after { content: '...'; display: inline-block; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
/* Chat Input */
.chat-input-area { padding: 10px 20px; border-top: 1px solid var(--border-color); }
.image-preview { position: relative; width: 80px; margin-bottom: 10px; }
#image-preview { width: 100%; border-radius: 8px; }
#remove-image-btn {
position: absolute; top: -5px; right: -5px;
background: #000; color: #fff; border: 1px solid #fff;
border-radius: 50%; width: 20px; height: 20px;
cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.chat-input-wrapper { display: flex; align-items: flex-end; gap: 10px; }
#message-input {
flex-grow: 1; background: var(--assistant-msg-color);
border: 1px solid var(--border-color); color: var(--text-color);
font-size: 1rem; padding: 10px; resize: none;
max-height: 150px; overflow-y: auto; outline: none; border-radius: 8px;
}
.input-action-btn { background: transparent; border: none; color: #888; cursor: pointer; height: 44px; width: 44px; display: flex; align-items: center; justify-content: center; }
.send-btn { background: var(--accent-color); color: white; border-radius: 8px; }
/* Desktop styles */
@media (min-width: 768px) {
.chat-header { display: none; }
.sidebar { position: static; transform: translateX(0); border-right: 1px solid var(--border-color); }
.close-sidebar-btn { display: none !important; } /* Close button is never needed on desktop */
.app-container.sidebar-visible .chat-area::before { display: none; } /* No overlay on desktop */
.chat-area { width: auto; flex-grow: 1; }
} |