Update app.py
Browse files
app.py
CHANGED
@@ -170,170 +170,191 @@ def init_page_config():
|
|
170 |
|
171 |
def apply_custom_css():
|
172 |
"""
|
173 |
-
Aplica estilos CSS
|
174 |
-
|
175 |
"""
|
176 |
st.markdown("""
|
177 |
<style>
|
178 |
-
/*
|
179 |
-
|
180 |
-
|
181 |
-
color: #
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
|
|
|
|
187 |
}
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
.sidebar .sidebar-content {
|
194 |
-
background-color: #0e1117 !important;
|
195 |
-
}
|
196 |
-
|
197 |
-
/* Cabeçalhos da Sidebar */
|
198 |
-
.sidebar .sidebar-content h1,
|
199 |
-
.sidebar .sidebar-content h2,
|
200 |
-
.sidebar .sidebar-content h3 {
|
201 |
-
color: #fafafa !important;
|
202 |
-
}
|
203 |
-
|
204 |
-
/* Links da Sidebar */
|
205 |
-
.sidebar .sidebar-content a {
|
206 |
-
color: #4F8BF9 !important;
|
207 |
}
|
208 |
-
|
209 |
-
/*
|
210 |
-
.
|
211 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
}
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
background-color: #262730 !important;
|
218 |
-
color: #fafafa !important;
|
219 |
}
|
220 |
-
|
221 |
-
/*
|
222 |
.chat-message {
|
223 |
-
padding:
|
224 |
-
border-radius: 0.
|
225 |
margin-bottom: 1rem;
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
}
|
230 |
-
|
|
|
231 |
.user-message {
|
232 |
-
background
|
|
|
233 |
}
|
234 |
-
|
235 |
.assistant-message {
|
236 |
-
background
|
|
|
237 |
}
|
238 |
-
|
239 |
-
/*
|
240 |
.chat-header {
|
241 |
-
font-weight:
|
242 |
-
|
|
|
|
|
243 |
}
|
244 |
-
|
|
|
245 |
.chat-content {
|
246 |
-
|
247 |
-
|
|
|
248 |
}
|
249 |
-
|
250 |
.chat-content em {
|
251 |
-
color: #888;
|
252 |
-
font-size: 0.9em;
|
253 |
display: block;
|
254 |
-
margin-top:
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
/* Elementos da interface */
|
260 |
-
.main-title {
|
261 |
-
color: #FFA500;
|
262 |
-
font-size: 2.5em;
|
263 |
-
font-weight: bold;
|
264 |
-
margin-bottom: 30px;
|
265 |
}
|
266 |
-
|
267 |
-
/* Botões */
|
268 |
.stButton > button {
|
269 |
-
background-color
|
270 |
-
color:
|
271 |
-
border
|
272 |
-
|
|
|
|
|
|
|
273 |
}
|
274 |
-
|
275 |
.stButton > button:hover {
|
276 |
-
|
277 |
-
|
|
|
278 |
}
|
279 |
-
|
280 |
-
/*
|
281 |
.stTextInput > div > div > input {
|
282 |
-
background-color:
|
283 |
-
color:
|
284 |
-
border
|
|
|
|
|
|
|
285 |
}
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
}
|
291 |
-
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
294 |
}
|
295 |
-
|
296 |
-
/*
|
297 |
-
.
|
298 |
-
|
299 |
-
color: #888;
|
300 |
-
margin-top: 10px;
|
301 |
-
padding-top: 8px;
|
302 |
-
border-top: 1px solid #444;
|
303 |
}
|
304 |
-
|
305 |
-
/*
|
306 |
-
.
|
307 |
-
color:
|
|
|
|
|
|
|
|
|
308 |
}
|
309 |
-
|
310 |
-
/*
|
311 |
-
.
|
312 |
-
color:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
text-decoration: underline;
|
314 |
}
|
315 |
-
|
316 |
-
/*
|
317 |
-
.
|
318 |
-
|
319 |
-
|
320 |
-
|
|
|
|
|
321 |
}
|
322 |
-
|
323 |
-
/*
|
324 |
-
|
325 |
-
|
326 |
}
|
327 |
-
|
328 |
-
/*
|
329 |
-
.
|
330 |
-
|
331 |
}
|
332 |
-
|
333 |
-
/*
|
334 |
-
|
335 |
-
|
336 |
-
|
|
|
|
|
|
|
|
|
|
|
337 |
}
|
338 |
</style>
|
339 |
""", unsafe_allow_html=True)
|
|
|
170 |
|
171 |
def apply_custom_css():
|
172 |
"""
|
173 |
+
Aplica estilos CSS modernos e profissionais à interface
|
174 |
+
Utiliza um esquema de cores consistente e design contemporâneo
|
175 |
"""
|
176 |
st.markdown("""
|
177 |
<style>
|
178 |
+
/* Variáveis CSS para tema consistente */
|
179 |
+
:root {
|
180 |
+
--primary-color: #2D7FF9; /* Azul principal */
|
181 |
+
--secondary-color: #06D6A0; /* Verde água para acentos */
|
182 |
+
--background-main: #111827; /* Fundo principal escuro */
|
183 |
+
--background-light: #1F2937; /* Fundo secundário */
|
184 |
+
--text-primary: #F9FAFB; /* Texto principal */
|
185 |
+
--text-secondary: #D1D5DB; /* Texto secundário */
|
186 |
+
--accent-color: #818CF8; /* Cor de destaque */
|
187 |
+
--error-color: #EF4444; /* Vermelho para erros */
|
188 |
+
--success-color: #10B981; /* Verde para sucesso */
|
189 |
}
|
190 |
+
|
191 |
+
/* Reset e estilos base */
|
192 |
+
.stApp {
|
193 |
+
background-color: var(--background-main);
|
194 |
+
color: var(--text-primary);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
+
|
197 |
+
/* Título principal e cabeçalhos */
|
198 |
+
.main-title {
|
199 |
+
background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
|
200 |
+
-webkit-background-clip: text;
|
201 |
+
-webkit-text-fill-color: transparent;
|
202 |
+
font-size: 2.5em;
|
203 |
+
font-weight: 800;
|
204 |
+
margin-bottom: 1.5rem;
|
205 |
+
padding: 0.5rem 0;
|
206 |
}
|
207 |
+
|
208 |
+
h1, h2, h3 {
|
209 |
+
color: var(--text-primary);
|
210 |
+
font-weight: 600;
|
|
|
|
|
211 |
}
|
212 |
+
|
213 |
+
/* Container do Chat */
|
214 |
.chat-message {
|
215 |
+
padding: 1.25rem;
|
216 |
+
border-radius: 0.75rem;
|
217 |
margin-bottom: 1rem;
|
218 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
219 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
220 |
+
background-color: var(--background-light);
|
221 |
}
|
222 |
+
|
223 |
+
/* Mensagens do usuário vs assistente */
|
224 |
.user-message {
|
225 |
+
background: linear-gradient(145deg, #1a237e15, #1a237e25);
|
226 |
+
border-left: 4px solid var(--primary-color);
|
227 |
}
|
228 |
+
|
229 |
.assistant-message {
|
230 |
+
background: linear-gradient(145deg, #00695c15, #00695c25);
|
231 |
+
border-left: 4px solid var(--secondary-color);
|
232 |
}
|
233 |
+
|
234 |
+
/* Cabeçalho das mensagens */
|
235 |
.chat-header {
|
236 |
+
font-weight: 600;
|
237 |
+
color: var(--text-primary);
|
238 |
+
margin-bottom: 0.75rem;
|
239 |
+
font-size: 1.1em;
|
240 |
}
|
241 |
+
|
242 |
+
/* Conteúdo das mensagens */
|
243 |
.chat-content {
|
244 |
+
color: var(--text-secondary);
|
245 |
+
line-height: 1.6;
|
246 |
+
font-size: 1em;
|
247 |
}
|
248 |
+
|
249 |
.chat-content em {
|
|
|
|
|
250 |
display: block;
|
251 |
+
margin-top: 1rem;
|
252 |
+
padding-top: 0.75rem;
|
253 |
+
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
254 |
+
color: var(--text-secondary);
|
255 |
+
font-style: italic;
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
}
|
257 |
+
|
258 |
+
/* Botões e Interações */
|
259 |
.stButton > button {
|
260 |
+
background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
|
261 |
+
color: white;
|
262 |
+
border: none;
|
263 |
+
border-radius: 8px;
|
264 |
+
padding: 0.5rem 1.5rem;
|
265 |
+
font-weight: 600;
|
266 |
+
transition: all 0.3s ease;
|
267 |
}
|
268 |
+
|
269 |
.stButton > button:hover {
|
270 |
+
opacity: 0.9;
|
271 |
+
transform: translateY(-1px);
|
272 |
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
273 |
}
|
274 |
+
|
275 |
+
/* Campos de entrada */
|
276 |
.stTextInput > div > div > input {
|
277 |
+
background-color: var(--background-light);
|
278 |
+
color: var(--text-primary);
|
279 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
280 |
+
border-radius: 8px;
|
281 |
+
padding: 0.75rem;
|
282 |
+
transition: all 0.3s ease;
|
283 |
}
|
284 |
+
|
285 |
+
.stTextInput > div > div > input:focus {
|
286 |
+
border-color: var(--primary-color);
|
287 |
+
box-shadow: 0 0 0 2px rgba(45, 127, 249, 0.2);
|
288 |
}
|
289 |
+
|
290 |
+
/* Upload de arquivos */
|
291 |
+
.stUploadedFileData {
|
292 |
+
background-color: var(--background-light) !important;
|
293 |
+
color: var(--text-primary) !important;
|
294 |
+
border-radius: 8px;
|
295 |
+
padding: 1rem;
|
296 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
297 |
}
|
298 |
+
|
299 |
+
/* Barra de progresso */
|
300 |
+
.stProgress > div > div > div > div {
|
301 |
+
background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
|
|
|
|
|
|
|
|
|
302 |
}
|
303 |
+
|
304 |
+
/* Alertas e mensagens */
|
305 |
+
.stAlert {
|
306 |
+
background-color: var(--background-light);
|
307 |
+
color: var(--text-primary);
|
308 |
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
309 |
+
border-radius: 8px;
|
310 |
+
padding: 1rem;
|
311 |
}
|
312 |
+
|
313 |
+
/* Info icon e tooltips */
|
314 |
+
.stTooltipIcon {
|
315 |
+
color: var(--primary-color) !important;
|
316 |
+
}
|
317 |
+
|
318 |
+
/* Efeitos de hover em links */
|
319 |
+
a {
|
320 |
+
color: var(--primary-color);
|
321 |
+
text-decoration: none;
|
322 |
+
transition: all 0.2s ease;
|
323 |
+
}
|
324 |
+
|
325 |
+
a:hover {
|
326 |
+
color: var(--secondary-color);
|
327 |
text-decoration: underline;
|
328 |
}
|
329 |
+
|
330 |
+
/* Token info */
|
331 |
+
.token-info {
|
332 |
+
color: var(--text-secondary);
|
333 |
+
font-size: 0.9em;
|
334 |
+
margin-top: 1rem;
|
335 |
+
padding-top: 0.75rem;
|
336 |
+
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
337 |
}
|
338 |
+
|
339 |
+
/* Removendo elementos desnecessários */
|
340 |
+
div[data-testid="stToolbar"], .stDeployButton {
|
341 |
+
display: none;
|
342 |
}
|
343 |
+
|
344 |
+
/* Ajustes gerais de espaçamento e alinhamento */
|
345 |
+
.stMarkdown {
|
346 |
+
line-height: 1.6;
|
347 |
}
|
348 |
+
|
349 |
+
/* Ajustes para telas menores */
|
350 |
+
@media (max-width: 768px) {
|
351 |
+
.main-title {
|
352 |
+
font-size: 2em;
|
353 |
+
}
|
354 |
+
|
355 |
+
.chat-message {
|
356 |
+
padding: 1rem;
|
357 |
+
}
|
358 |
}
|
359 |
</style>
|
360 |
""", unsafe_allow_html=True)
|