fraudTech commited on
Commit
b7b7391
·
1 Parent(s): 18137df

OpenWebUI redesign

Browse files
Files changed (3) hide show
  1. web/src/App.css +850 -1415
  2. web/src/App.tsx +600 -589
  3. web/src/Login.tsx +36 -27
web/src/App.css CHANGED
@@ -1,1755 +1,1190 @@
1
- * {
 
 
 
 
 
2
  margin: 0;
3
  padding: 0;
4
- box-sizing: border-box;
5
  }
6
 
7
- strong, b, [style*="font-weight: 700"], [style*="font-weight: bold"] {
8
- color: #e8d4c0 !important;
9
- font-weight: 600;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
 
12
- body {
13
- font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
14
- -webkit-font-smoothing: auto;
15
- -moz-osx-font-smoothing: auto;
16
- background: #1a1614;
17
- color: #d4c5b9;
18
  overflow: hidden;
19
- height: 100vh;
20
  }
21
 
22
- @keyframes flicker {
23
- 0% { opacity: 0.98; }
24
- 50% { opacity: 1; }
25
- 100% { opacity: 0.98; }
 
 
26
  }
27
 
28
- #root {
29
- height: 100vh;
30
- overflow: hidden;
31
- }
32
 
33
  .app {
34
  display: flex;
35
- flex-direction: column;
36
  height: 100vh;
37
- background: #1a1614;
38
- position: relative;
39
  overflow: hidden;
 
40
  }
41
 
42
- /* Remove CRT effects */
43
- .app::before,
44
- .app::after {
45
- display: none;
46
- }
47
 
48
- @keyframes scanline {
49
- 0% {
50
- transform: translateY(0);
51
- }
52
- 100% {
53
- transform: translateY(10px);
54
- }
55
  }
56
 
57
- @keyframes flicker {
58
- 0%, 100% {
59
- opacity: 0.8;
60
- }
61
- 50% {
62
- opacity: 1;
63
  }
64
  }
65
 
66
- @keyframes dot-bounce {
67
- 0%, 100% {
68
- transform: translateY(0);
69
- opacity: 0.5;
70
- }
71
- 50% {
72
- transform: translateY(-4px);
73
- opacity: 1;
74
- }
 
75
  }
76
 
77
- @keyframes progress {
78
- 0% {
79
- width: 0%;
80
- opacity: 0.6;
 
 
81
  }
82
- 50% {
83
- width: 50%;
84
- opacity: 1;
85
  }
86
- 100% {
87
- width: 100%;
88
- opacity: 0.6;
89
- }
90
- }
91
-
92
- .header {
93
- background: #211d1a;
94
- padding: 1rem 1.5rem;
95
- border-bottom: 1px solid #3a342e;
96
- display: flex;
97
- justify-content: space-between;
98
- align-items: center;
99
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
100
  }
101
 
102
- .header-left {
103
  display: flex;
104
  align-items: center;
105
- gap: 1rem;
106
- }
107
-
108
- .logo-text {
109
- font-size: 2.5rem;
110
- font-weight: 900;
111
- font-family: 'Michroma', 'Arial Black', 'Helvetica', sans-serif;
112
- color: #e8d4c0;
113
- letter-spacing: 0.05em;
114
- text-transform: lowercase;
115
- margin: 0;
116
- text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
117
  }
118
 
119
- @keyframes textGlow {
120
- from {
121
- filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5))
122
- drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
123
- }
124
- to {
125
- filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7))
126
- drop-shadow(0 0 15px rgba(255, 255, 255, 0.5));
127
- }
128
  }
129
 
130
- .header h1::before {
131
- content: '> ';
132
- color: #e8d4c0;
133
- animation: textGlow 2s ease-in-out infinite alternate;
 
 
 
 
 
 
 
 
134
  }
135
 
136
- .version {
137
- background: #2a2520;
138
- color: #a89784;
139
- padding: 0.25rem 0.75rem;
140
- font-size: 0.75rem;
141
- font-weight: 500;
142
- border-radius: 4px;
143
- border: 1px solid #3a342e;
144
  }
145
 
146
- .header-actions {
147
  display: flex;
148
- gap: 1rem;
149
  align-items: center;
150
- }
151
-
152
- .tools-badge {
153
- background: #2a2520;
154
- color: #c9b8a3;
155
- padding: 0.5rem 1rem;
 
156
  font-size: 0.875rem;
157
  font-weight: 500;
158
- border-radius: 6px;
159
- border: 1px solid #3a342e;
160
- }
161
-
162
- .settings-btn {
163
- background: #2a2520;
164
- border: 1px solid #3a342e;
165
- color: #c9b8a3;
166
- padding: 0.5rem 1rem;
167
  cursor: pointer;
168
- font-size: 0.9rem;
169
- font-weight: 500;
170
- transition: all 0.2s ease;
171
- display: flex;
172
- align-items: center;
173
- gap: 0.5rem;
174
- border-radius: 6px;
175
  }
176
 
177
- .settings-btn:hover {
178
- background: #3a342e;
179
- color: #e8d4c0;
180
- border-color: #4a433c;
181
  }
182
 
183
- .settings-btn:active {
184
- transform: scale(0.98);
 
 
 
 
185
  }
186
 
187
- .icon-settings {
188
- font-size: 1rem;
189
- }
190
 
191
- .settings-panel {
192
- background: #211d1a;
193
- padding: 1.5rem;
194
- border-bottom: 1px solid #3a342e;
 
 
 
195
  }
196
 
197
- .settings-panel h3 {
198
- color: #e8d4c0;
199
- margin-bottom: 1rem;
200
- font-weight: 600;
201
- font-size: 1rem;
 
 
 
 
 
 
 
202
  }
203
 
204
- .settings-panel h3::before {
205
- content: '';
206
- margin-right: 0;
 
 
 
207
  }
208
 
209
- .settings-panel h3::after {
210
- content: '';
211
- margin-left: 0;
 
 
 
 
212
  }
213
 
214
- .setting-group {
 
 
 
 
 
 
 
215
  display: flex;
216
- gap: 1rem;
217
  align-items: center;
218
- margin-bottom: 1rem;
 
219
  }
220
 
221
- .setting-group label {
222
- min-width: 150px;
223
- font-weight: 500;
224
- color: #c9b8a3;
225
- }
226
 
227
- .setting-group input {
228
- flex: 1;
229
- padding: 0.625rem;
230
- background: #2a2520;
231
- border: 1px solid #3a342e;
232
- color: #d4c5b9;
233
- font-size: 0.9rem;
234
- border-radius: 6px;
235
- transition: all 0.2s ease;
236
  }
237
 
238
- .setting-group input:focus {
239
- outline: none;
240
- border-color: #8b7355;
241
- background: #312c27;
 
 
 
242
  }
243
 
244
- .save-btn {
245
- background: #8b7355;
246
- color: #1a1614;
247
- border: none;
248
- padding: 0.625rem 1.5rem;
 
 
 
 
 
 
 
249
  cursor: pointer;
250
- font-weight: 500;
251
- font-size: 0.9rem;
252
- transition: all 0.2s ease;
253
- border-radius: 6px;
254
  }
255
 
256
- .save-btn:hover {
257
- background: #9d8264;
258
- }
259
 
260
- .save-btn:active {
261
- transform: scale(0.98);
 
 
262
  }
263
 
264
- .available-tools {
265
- background: #211d1a;
266
- padding: 1.5rem;
267
- border-bottom: 1px solid #3a342e;
 
 
268
  }
269
 
270
- .available-tools h4 {
271
- color: #e8d4c0;
272
- margin-bottom: 1rem;
 
 
273
  font-weight: 600;
274
- font-size: 1rem;
 
 
 
 
 
275
  }
276
 
277
- .available-tools h4::before {
278
- content: '';
279
- margin-right: 0;
280
- }
281
 
282
- .available-tools h4::after {
283
- content: '';
284
- margin-left: 0;
 
 
 
 
 
285
  }
286
 
287
- .tools-grid {
 
 
 
 
288
  display: flex;
289
- flex-wrap: wrap;
290
- gap: 0.5rem;
 
 
 
 
291
  }
292
 
293
- .tool-chip {
294
- background: #2a2520;
295
- padding: 0.375rem 0.875rem;
296
- font-size: 0.8rem;
297
- color: #c9b8a3;
298
  font-weight: 500;
299
- border: 1px solid #3a342e;
 
 
 
 
 
 
 
 
 
 
 
300
  border-radius: 4px;
 
 
 
 
301
  }
302
 
303
- .chat-container {
 
 
 
 
 
304
  display: flex;
305
  flex-direction: column;
306
- flex: 1;
 
 
307
  overflow: hidden;
308
- background: #1a1614;
309
- min-height: 0;
310
- max-height: calc(100vh - 60px);
311
- padding: 0 2rem 1.5rem 2rem;
312
  }
313
 
314
- .messages {
315
- flex: 1 1 0;
316
- overflow-y: auto;
317
- overflow-x: hidden;
318
- padding: 1.5rem;
319
  display: flex;
320
- flex-direction: column;
321
- gap: 1rem;
322
- scrollbar-width: thin;
323
- scrollbar-color: #3a342e #211d1a;
324
- min-height: 0;
 
 
325
  }
326
 
327
- .messages::-webkit-scrollbar {
328
- width: 10px;
 
 
 
 
 
 
 
 
 
 
329
  }
330
 
331
- .messages::-webkit-scrollbar-track {
332
- background: #211d1a;
 
 
 
 
 
333
  }
334
 
335
- .messages::-webkit-scrollbar-thumb {
336
- background: #3a342e;
337
- border-radius: 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  }
339
 
340
- .messages::-webkit-scrollbar-thumb:hover {
341
- background: #4a433c;
 
 
 
 
 
 
 
 
342
  }
343
 
 
 
 
 
 
344
  .welcome {
 
 
 
 
 
 
345
  text-align: center;
346
- padding: 4rem 2rem;
347
- }
348
-
349
- .welcome h2 {
350
- color: #e8d4c0;
351
- margin-bottom: 1rem;
352
- font-size: 2rem;
353
- font-weight: 600;
354
  }
355
 
356
- .welcome h2::before {
357
- content: '';
 
 
 
 
 
358
  }
359
 
360
- .welcome h2::after {
361
- content: '';
 
 
 
362
  }
363
 
364
- .welcome p {
365
- color: #a89784;
366
- font-size: 1rem;
 
 
367
  }
368
 
369
  .examples {
370
- margin-top: 2rem;
 
 
 
 
371
  }
372
 
373
- .examples h3 {
374
- margin-bottom: 1.5rem;
375
- color: #c9b8a3;
376
- font-weight: 600;
377
- font-size: 1rem;
378
  }
379
 
380
  .example-btn {
381
- background: #2a2520;
382
- border: 1px solid #3a342e;
383
- color: #c9b8a3;
384
- padding: 0.75rem 1.5rem;
385
- margin: 0.5rem;
 
 
386
  cursor: pointer;
387
- transition: all 0.2s ease;
388
- font-weight: 500;
389
- font-size: 0.9rem;
390
- border-radius: 6px;
 
 
391
  }
392
 
393
- .example-btn:hover {
394
- background: #3a342e;
395
- color: #e8d4c0;
396
- border-color: #4a433c;
 
 
 
 
 
 
 
 
397
  }
398
 
399
- .example-btn:active {
400
- transform: scale(0.98);
 
401
  }
402
 
403
- /* Math Symbols Popup */
404
- .math-symbols-popup {
405
- position: fixed;
406
- bottom: 120px;
407
- left: 50%;
408
- transform: translateX(-50%);
409
- z-index: 1000;
410
- max-width: 90%;
411
- width: 800px;
412
- animation: slideUpFade 0.2s ease;
413
- }
414
-
415
- @keyframes slideUpFade {
416
- from {
417
- opacity: 0;
418
- transform: translateX(-50%) translateY(20px);
419
- }
420
- to {
421
- opacity: 1;
422
- transform: translateX(-50%) translateY(0);
423
- }
424
  }
425
 
426
- .math-symbols-popup-content {
427
- background: #211d1a;
428
- border: 1px solid #3a342e;
429
- border-radius: 12px;
430
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
431
- max-height: 500px;
432
- overflow: hidden;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
433
  display: flex;
434
  flex-direction: column;
 
435
  }
436
 
437
- .math-symbols-popup-header {
438
  display: flex;
439
  align-items: center;
440
- justify-content: space-between;
441
- padding: 1rem 1.5rem;
442
- background: #2a2520;
443
- border-bottom: 1px solid #3a342e;
444
- font-size: 1rem;
445
- font-weight: 600;
446
- color: #c9b8a3;
447
  }
448
 
449
- .math-symbols-close-btn {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  background: transparent;
451
  border: none;
452
- color: #a89784;
453
  cursor: pointer;
454
- padding: 0.25rem;
455
  display: flex;
456
  align-items: center;
457
  justify-content: center;
458
- transition: all 0.2s ease;
459
- border-radius: 4px;
460
  }
461
 
462
- .math-symbols-close-btn:hover {
463
- background: #3a342e;
464
- color: #c9b8a3;
465
- }
466
 
467
- /* Math Symbols Section */
468
- .math-symbols {
469
- max-width: 100%;
470
- background: #211d1a;
471
- padding: 1.5rem;
472
- overflow-y: auto;
473
- max-height: 400px;
 
474
  }
475
 
476
- /* Symbol tabs */
477
- .symbol-tabs {
478
- display: flex;
479
- flex-wrap: wrap;
480
- gap: 0.375rem;
481
- margin-bottom: 1.25rem;
482
- padding-bottom: 0;
483
- border-bottom: none;
484
- }
485
 
486
- .symbol-tab {
487
- background: #2a2520;
488
- border: 1px solid #3a342e;
489
- color: #a89784;
490
- padding: 0.625rem 1rem;
491
- cursor: pointer;
492
- transition: all 0.2s ease;
493
- font-weight: 500;
494
- font-size: 0.875rem;
495
- border-radius: 8px;
496
- text-transform: none;
497
- }
498
 
499
- .symbol-tab:hover {
500
- background: #3a342e;
501
- color: #c9b8a3;
502
- border-color: #4a443c;
503
- }
504
 
505
- .symbol-tab.active {
506
- background: linear-gradient(135deg, #6b4ecf 0%, #8b6ee0 100%);
507
- color: #ffffff;
508
- border-color: #7b5ed0;
 
509
  font-weight: 600;
510
- box-shadow: 0 2px 8px rgba(107, 78, 207, 0.3);
511
- border-radius: 10px;
512
  }
513
 
514
- /* Symbol content area */
515
- .symbol-content {
516
- min-height: 150px;
517
- padding: 1rem 0;
518
- }
519
 
520
- .symbol-category {
521
- margin-bottom: 2rem;
 
 
 
 
 
 
 
 
522
  }
523
 
524
- .symbol-row {
525
- display: flex;
526
- flex-wrap: wrap;
527
- gap: 0.5rem;
528
- margin-bottom: 0.5rem;
 
 
 
 
 
 
 
 
529
  }
530
 
531
- .symbol-btn {
532
- background: #2a2520;
533
- border: 1px solid #3a342e;
534
- color: #c9b8a3;
535
- padding: 0.5rem 0.75rem;
536
- min-width: 45px;
537
- cursor: pointer;
538
- transition: all 0.2s ease;
539
- font-weight: 500;
540
- font-size: 1.1rem;
541
- border-radius: 4px;
542
- display: inline-flex;
543
- align-items: center;
544
- justify-content: center;
545
- }
546
-
547
- .symbol-btn:hover {
548
- background: #3a342e;
549
- color: #e8d4c0;
550
- border-color: #4a443c;
551
- transform: translateY(-2px);
552
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
553
- }
554
-
555
- .symbol-btn:active {
556
- transform: translateY(0) scale(0.98);
557
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
558
  }
559
 
560
- .template-btn {
561
- min-width: 60px;
562
- font-size: 0.75rem;
563
- font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
564
- background: #2d2622;
565
- border-color: #4a443c;
566
- color: #d4a574;
567
- font-weight: 600;
568
- padding: 0.6rem 1rem;
569
- }
570
 
571
- .template-btn:hover {
572
- background: #3d342e;
573
- border-color: #5a544c;
574
- color: #e8c090;
575
- }
576
 
577
- /* Scrollbar styling for math symbols */
578
- .math-symbols::-webkit-scrollbar {
579
- width: 8px;
 
 
 
 
 
580
  }
581
 
582
- .math-symbols::-webkit-scrollbar-track {
583
- background: #211d1a;
584
- border-radius: 4px;
585
- }
586
 
587
- .math-symbols::-webkit-scrollbar-thumb {
588
- background: #3a342e;
589
- border-radius: 4px;
 
 
590
  }
591
 
592
- .math-symbols::-webkit-scrollbar-thumb:hover {
593
- background: #4a443c;
594
- }
595
 
596
- .message {
597
- max-width: min(800px, 100%);
598
- width: 100%;
599
- padding: 1.25rem 1.5rem;
600
- border: 1px solid #3a342e;
601
- background: #211d1a;
602
- border-radius: 2px;
603
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
604
- overflow: hidden;
605
- min-width: 0;
606
- word-break: break-word;
607
  }
608
 
609
- .message-user {
610
- align-self: flex-end;
611
- margin-left: auto;
612
- background: #2a2520;
613
- }
614
 
615
- .message-user::before {
616
- content: '';
617
- margin-right: 0;
618
  }
619
 
620
- .message-assistant {
621
- align-self: flex-start;
622
- max-width: min(800px, 100%);
623
- }
624
 
625
- .message-assistant::before {
626
- content: '';
627
- margin-right: 0;
628
- }
629
 
630
- .message-header {
631
- display: flex;
632
- justify-content: space-between;
633
- margin-bottom: 0.75rem;
634
- font-size: 0.8rem;
635
- padding-bottom: 0.5rem;
636
- border-bottom: 1px solid #3a342e;
637
- gap: 2rem;
638
- align-items: center;
639
  }
640
 
641
- .message-header-right {
642
- display: flex;
643
- align-items: center;
644
- gap: 0.75rem;
645
- }
646
 
647
- .message-role {
648
- font-weight: 600;
649
- color: #8b7355;
650
- text-transform: uppercase;
651
- font-size: 0.75rem;
652
- letter-spacing: 0.5px;
653
  }
654
 
655
- .message-time {
656
- color: #6e5d4d;
657
- opacity: 0.8;
658
- font-size: 0.75rem;
659
- }
660
 
661
- /* Copy Markdown Button */
662
- .copy-markdown-btn {
663
- display: inline-flex;
664
  align-items: center;
665
- justify-content: center;
666
- gap: 0.35rem;
667
- padding: 0.4rem;
668
- background: #2a2520;
669
- border: 1px solid #3a342e;
670
- color: #8b7355;
671
- border-radius: 4px;
672
- cursor: pointer;
673
- font-size: 0.75rem;
674
  font-weight: 500;
675
- transition: all 0.2s ease;
676
- opacity: 0.7;
677
- }
678
-
679
- .copy-markdown-btn:hover {
680
- opacity: 1;
681
- background: #3a342e;
682
- color: #c9b8a3;
683
- border-color: #4a433c;
684
- transform: translateY(-1px);
685
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
686
  }
687
 
688
- .copy-markdown-btn:active {
689
- transform: translateY(0);
690
- box-shadow: none;
691
- }
692
 
693
- .copy-markdown-btn svg {
694
- width: 14px;
695
- height: 14px;
696
- stroke-width: 2.5;
697
- }
698
 
699
- .copy-btn-text {
700
- font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
701
- letter-spacing: 0.3px;
 
 
 
702
  }
 
 
703
 
704
- .message-content {
 
 
 
 
705
  line-height: 1.7;
706
- color: #d4c5b9;
707
- }
708
-
709
- .message-content .streaming-content {
710
- white-space: pre-wrap;
711
- word-break: break-word;
712
- font-family: inherit;
713
- color: inherit;
714
- margin-top: 0.35rem;
715
- }
716
-
717
- .message-content h1,
718
- .message-content h2,
719
- .message-content h3,
720
- .message-content h4,
721
- .message-content h5,
722
- .message-content h6,
723
- .message-content strong,
724
- .message-content b {
725
- color: #f4e6d0;
726
- font-weight: 600;
727
- }
728
-
729
- .message-content pre {
730
- background: #1a1614;
731
- padding: 1rem;
732
- overflow-x: auto;
733
- margin: 0.75rem 0;
734
- border: 1px solid #3a342e;
735
- border-radius: 6px;
736
- max-width: 100%;
737
  white-space: pre-wrap;
738
  word-break: break-word;
 
 
 
739
  }
740
 
741
- .message-content code {
742
- background: #2a2520;
743
- padding: 0.2rem 0.5rem;
744
- font-size: 0.9em;
745
- border-radius: 3px;
746
- color: #c9b8a3;
747
- font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
748
- }
749
-
750
- /* KaTeX Math Rendering Styles */
751
- /* Inline math - ensure proper spacing from surrounding text */
752
- .message-content .katex {
753
- font-size: 1.1em;
754
- color: #e8d4c0;
755
- display: inline-block;
756
- margin: 0 0.15em;
757
- }
758
-
759
- /* Display math blocks */
760
- .message-content .katex-display {
761
- display: block;
762
- margin: 1rem 0;
763
- padding: 1rem;
764
- background: #1a1614;
765
- border: 1px solid #3a342e;
766
- border-radius: 6px;
767
- overflow-x: auto;
768
- }
769
-
770
- /* Reset margin for katex inside display blocks */
771
- .message-content .katex-display > .katex {
772
- margin: 0;
773
- text-align: center;
774
- }
775
-
776
- /* Math operators and symbols */
777
- .message-content .katex .mord,
778
- .message-content .katex .mbin,
779
- .message-content .katex .mrel,
780
- .message-content .katex .mop {
781
- color: #e8d4c0;
782
- }
783
-
784
- /* Fractions */
785
- .message-content .katex .frac-line {
786
- border-bottom-color: #a89784;
787
- }
788
-
789
- /* Math text and operators */
790
- .message-content .katex .mathrm,
791
- .message-content .katex .mathit {
792
- color: #d4a574;
793
- }
794
-
795
- /* Ensure good contrast for all math elements */
796
- .message-content .katex * {
797
- color: inherit;
798
- }
799
 
800
- .tool-calls {
801
- margin-top: 1rem;
802
- padding-top: 1rem;
803
- border-top: 1px solid #3a342e;
804
- }
805
 
806
- .tool-calls h4 {
807
- margin-bottom: 0.75rem;
808
- color: #8b7355;
809
- font-size: 0.85rem;
810
- font-weight: 600;
811
- text-transform: uppercase;
812
- letter-spacing: 0.5px;
813
- }
814
-
815
- /* Tool call expander - closed by default */
816
  details.tool-call {
817
- background: #1a1614;
818
- margin-top: 0.5rem;
819
- border: 1px solid #3a342e;
820
- border-radius: 6px;
821
- transition: background 0.2s ease;
822
- }
823
-
824
- details.tool-call[open] {
825
- background: #1f1b18;
826
- }
827
-
828
- /* Clickable summary header */
829
- details.tool-call summary {
830
- cursor: pointer;
831
- padding: 1rem;
832
- user-select: none;
833
- list-style: none;
834
- transition: background 0.2s ease;
835
  }
836
 
837
- details.tool-call summary:hover {
838
- background: rgba(139, 115, 85, 0.1);
839
- }
840
 
841
- /* Hide default disclosure triangle */
842
- details.tool-call summary::-webkit-details-marker {
843
- display: none;
844
- }
845
 
846
- /* Tool call header styling */
847
  .tool-call-header {
848
  display: flex;
849
- justify-content: space-between;
850
  align-items: center;
851
- gap: 1rem;
852
- cursor: pointer;
853
- padding: 0.75rem 1rem;
854
- background: #1a1614;
855
- border: 1px solid #3a342e;
856
- border-radius: 6px;
857
- font-family: "SF Mono", Monaco, "Cascadia Code", Consolas, monospace;
858
- font-size: 0.9em;
859
- transition: background 0.2s;
860
  }
861
 
862
- .tool-call-header:hover {
863
- background: #221e1a;
864
- }
865
 
866
- /* Tool execution status indicators */
867
  .tool-status {
868
  display: inline-flex;
869
  align-items: center;
870
- gap: 0.5rem;
871
- font-size: 0.85em;
872
- padding: 0.25rem 0.75rem;
873
- border-radius: 4px;
874
  margin-left: auto;
875
  }
876
 
877
- .tool-status.generating {
878
- background: rgba(59, 130, 246, 0.15);
879
- color: #60a5fa;
880
- border: 1px solid rgba(59, 130, 246, 0.3);
881
- }
882
-
883
- .tool-status.executing {
884
- background: rgba(168, 85, 247, 0.15);
885
- color: #c084fc;
886
- border: 1px solid rgba(168, 85, 247, 0.3);
887
- }
888
 
889
  .tool-status .dot {
890
- width: 6px;
891
- height: 6px;
892
- border-radius: 50%;
893
- background: currentColor;
894
- animation: dot-bounce 1.4s infinite ease-in-out;
895
- }
896
-
897
- .tool-status .dot:nth-child(1) {
898
- animation-delay: 0ms;
899
  }
 
 
900
 
901
- .tool-status .dot:nth-child(2) {
902
- animation-delay: 160ms;
903
- }
904
 
905
- .tool-status .dot:nth-child(3) {
906
- animation-delay: 320ms;
907
- }
908
 
909
- @keyframes dot-bounce {
910
- 0%, 80%, 100% {
911
- transform: translateY(0);
912
- opacity: 0.5;
913
- }
914
- 40% {
915
- transform: translateY(-8px);
916
- opacity: 1;
917
- }
918
- }
919
 
920
- .tool-status .status-text {
921
- font-weight: 500;
922
- white-space: nowrap;
923
- }
924
 
925
- .tool-name {
926
- color: #d4a574;
927
- font-weight: 600;
928
- font-size: 0.9rem;
929
- }
930
-
931
- .checkmark {
932
- color: #7d9d7a;
933
- font-size: 1.2em;
934
- margin-left: auto;
935
- }
936
-
937
- .crossmark {
938
- color: #d46a6a;
939
- font-size: 1.2em;
940
- margin-left: auto;
941
- }
942
-
943
- /* Content area (hidden when closed) */
944
- .tool-call-content {
945
- padding: 0 1rem 1rem 1rem;
946
- border-top: 1px solid #3a342e;
947
- }
948
-
949
- .tool-section {
950
- margin-top: 0.75rem;
951
- }
952
-
953
- /* Collapsible input section */
954
- details.tool-section {
955
- background: transparent;
956
- border: none;
957
- border-radius: 0;
958
- }
959
 
960
  details.tool-section summary {
 
961
  cursor: pointer;
962
- padding: 0;
963
  user-select: none;
964
- list-style: none;
965
- margin-bottom: 0.5rem;
966
- transition: color 0.2s ease;
967
- }
968
-
969
- details.tool-section summary:hover {
970
- color: #d4a574;
971
  }
972
 
973
- /* Hide default disclosure triangle */
974
- details.tool-section summary::-webkit-details-marker {
975
- display: none;
976
- }
977
 
978
- /* Add custom arrow indicator */
979
  details.tool-section summary::before {
980
- content: '▶ ';
 
 
981
  display: inline-block;
982
- transition: transform 0.2s ease;
983
- margin-right: 0.25rem;
984
  }
985
 
986
- details.tool-section[open] summary::before {
987
- transform: rotate(90deg);
988
- }
989
 
990
  .tool-section-label {
991
- color: #8b7355;
992
- font-size: 0.8rem;
993
- font-weight: 600;
994
  text-transform: uppercase;
995
- letter-spacing: 0.5px;
 
996
  }
997
 
998
- .tool-code, .tool-output {
999
- background: #211d1a;
1000
- padding: 0.75rem;
 
 
 
 
 
 
1001
  overflow-x: auto;
1002
- font-size: 0.85rem;
1003
- border: 1px solid #3a342e;
1004
- color: #c9b8a3;
1005
- border-radius: 4px;
1006
- font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
1007
- white-space: pre-wrap;
1008
- word-break: break-word;
1009
  }
1010
 
1011
- /* Style for tool output images (matplotlib plots) */
 
 
 
 
 
 
 
 
 
 
 
 
 
1012
  .tool-output img {
1013
  max-width: 100%;
1014
- height: auto;
1015
- border-radius: 6px;
1016
- border: 1px solid #3a342e;
1017
- margin: 1rem 0;
1018
  display: block;
 
1019
  }
1020
 
1021
- /* Override monospace font for rendered markdown in tool output */
1022
- .tool-output > div {
1023
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
1024
- }
1025
 
1026
- /* Keep code blocks in tool output with monospace */
1027
- .tool-output pre,
1028
- .tool-output code {
1029
- font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
1030
- }
1031
 
1032
- /* Horizontal scroll for collapsed input */
1033
- .tool-input-scroll {
1034
- white-space: pre;
1035
- word-break: normal;
1036
- overflow-x: auto;
1037
- max-width: 100%;
1038
  }
1039
 
1040
- .typing-indicator {
 
 
 
 
 
 
 
 
 
1041
  display: flex;
1042
- align-items: center;
1043
- gap: 0.5rem;
1044
- padding: 1rem 0;
1045
- }
1046
-
1047
- .typing-indicator span {
1048
- width: 8px;
1049
- height: 8px;
1050
- background: #8b7355;
1051
- border-radius: 50%;
1052
- animation: typing 1.4s infinite;
1053
- }
1054
-
1055
- .typing-indicator span:nth-child(2) {
1056
- animation-delay: 0.2s;
1057
  }
1058
 
1059
- .typing-indicator span:nth-child(3) {
1060
- animation-delay: 0.4s;
 
 
 
 
 
 
 
 
1061
  }
1062
 
1063
- .status-message {
1064
- margin-left: 0.5rem;
1065
- color: #9d8264;
1066
- font-size: 0.9rem;
1067
- font-style: italic;
1068
- opacity: 0.9;
 
 
 
1069
  }
1070
 
1071
- /* Reasoning trace from deepseek-reasoner model */
1072
- details.reasoning-trace {
1073
- background: #1a1614;
1074
- margin-top: 1rem;
1075
- border: 1px solid #5a4a3a;
1076
- border-radius: 6px;
1077
- transition: background 0.2s ease;
1078
- }
1079
 
1080
- details.reasoning-trace.reasoning-streaming {
1081
- border-color: #b89968;
1082
- box-shadow: 0 0 0 1px rgba(184, 153, 104, 0.15);
1083
- }
1084
 
1085
- details.reasoning-trace[open] {
1086
- background: #1f1b18;
1087
- }
1088
 
1089
- details.reasoning-trace summary {
 
 
 
 
 
 
 
1090
  cursor: pointer;
1091
- padding: 1rem;
1092
- user-select: none;
1093
- list-style: none;
1094
- transition: background 0.2s ease;
1095
  }
1096
 
1097
- details.reasoning-trace summary:hover {
1098
- background: rgba(180, 150, 100, 0.1);
1099
- }
1100
 
1101
- details.reasoning-trace summary::-webkit-details-marker {
1102
- display: none;
1103
- }
1104
 
1105
- .reasoning-header {
1106
- display: flex;
1107
- align-items: center;
1108
- gap: 0.75rem;
1109
- color: #b89968;
1110
- font-size: 0.9rem;
1111
- font-weight: 500;
1112
- letter-spacing: 0.3px;
1113
- }
1114
-
1115
- .reasoning-icon {
1116
- font-size: 1.1rem;
1117
- opacity: 0.9;
1118
- }
1119
 
1120
- /* Live streaming pulse indicator for reasoning */
1121
- .reasoning-live-indicator {
 
 
 
 
 
 
 
 
1122
  display: inline-flex;
1123
  align-items: center;
1124
- gap: 3px;
1125
- margin-left: 0.5rem;
1126
- }
1127
-
1128
- .reasoning-live-dot {
1129
- display: inline-block;
1130
- width: 5px;
1131
- height: 5px;
1132
- border-radius: 50%;
1133
- background-color: #b89968;
1134
- animation: reasoning-bounce 1.2s ease-in-out infinite;
1135
- }
1136
-
1137
- .reasoning-live-dot:nth-child(2) {
1138
- animation-delay: 0.2s;
1139
  }
1140
 
1141
- .reasoning-live-dot:nth-child(3) {
1142
- animation-delay: 0.4s;
1143
- }
1144
 
1145
- @keyframes reasoning-bounce {
1146
- 0%, 60%, 100% {
1147
- transform: translateY(0);
1148
- opacity: 0.4;
1149
- }
1150
- 30% {
1151
- transform: translateY(-4px);
1152
- opacity: 1;
1153
- }
1154
- }
1155
 
1156
- .reasoning-content {
1157
- padding: 1rem;
1158
- background: #16120f;
1159
- color: #a89784;
1160
- font-size: 0.85rem;
1161
- line-height: 1.7;
1162
- font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
1163
- white-space: pre-wrap;
1164
- word-wrap: break-word;
1165
- max-height: 400px;
1166
- overflow-y: auto;
1167
- border-top: 1px solid #3a342e;
1168
- opacity: 0.9;
1169
  }
1170
 
1171
- @keyframes typing {
1172
- 0%, 60%, 100% {
1173
- transform: translateY(0);
1174
- opacity: 0.5;
1175
- }
1176
- 30% {
1177
- transform: translateY(-10px);
1178
- opacity: 1;
1179
- }
1180
  }
1181
 
1182
- .input-container {
 
1183
  background: transparent;
1184
- padding: 0;
1185
- position: relative;
1186
- flex-shrink: 0;
1187
- z-index: 10;
1188
- display: flex;
1189
- align-items: center;
1190
- margin-top: 0.75rem;
1191
- margin-bottom: 2rem;
1192
- }
1193
-
1194
- .input-container textarea {
1195
- width: 100%;
1196
- padding: 1rem 11rem 1rem 1.25rem;
1197
- background: #2a2520 !important;
1198
- border: 1px solid #3a342e !important;
1199
- outline: none !important;
1200
- color: #d4c5b9;
1201
  resize: none;
1202
- font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
1203
- font-size: 0.95rem;
1204
- line-height: 1.5;
1205
- border-radius: 10px !important;
1206
- transition: all 0.2s ease;
1207
- letter-spacing: 0.5px;
1208
- box-shadow: none !important;
1209
- -webkit-appearance: none !important;
1210
- -moz-appearance: none !important;
1211
- appearance: none !important;
1212
  }
1213
 
1214
- .input-container textarea:focus {
1215
- outline: none;
1216
- border: 1px solid #4a443c !important;
1217
- background: #2a2520;
1218
- box-shadow: 0 0 0 2px rgba(107, 78, 207, 0.2);
1219
- }
1220
 
1221
- .input-container textarea::placeholder {
1222
- color: #6e5d4d;
1223
- }
1224
 
1225
- .input-buttons {
1226
- position: absolute;
1227
- right: 0.75rem;
1228
- top: 50%;
1229
- transform: translateY(-50%);
 
 
 
1230
  display: flex;
1231
- gap: 0.5rem;
1232
  align-items: center;
 
 
 
 
1233
  }
1234
 
 
 
 
1235
  .model-toggle-btn {
1236
- background: #2a2520;
1237
- color: #c9b8a3;
1238
- border: 1px solid #3a342e;
1239
- padding: 0.75rem 0.9rem;
 
1240
  cursor: pointer;
1241
- font-size: 0.78rem;
 
1242
  font-weight: 700;
1243
- font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Consolas', monospace;
1244
  letter-spacing: 0.04em;
1245
- transition: all 0.2s ease;
1246
- border-radius: 8px;
1247
- display: flex;
1248
- align-items: center;
1249
- gap: 0.3rem;
1250
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
1251
- min-width: 2.4rem;
1252
- justify-content: center;
1253
- }
1254
-
1255
- .model-toggle-btn:hover:not(:disabled) {
1256
- background: #3a342e;
1257
- border-color: #4a443c;
1258
- box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
1259
- }
1260
-
1261
- .model-toggle-btn:active:not(:disabled) {
1262
- transform: scale(0.98);
1263
- }
1264
-
1265
- .model-toggle-btn--active {
1266
- background: linear-gradient(135deg, #1a3a2a 0%, #1e4530 100%);
1267
- color: #5ed99a;
1268
- border-color: #2d6b48;
1269
- box-shadow: 0 2px 8px rgba(46, 160, 100, 0.25);
1270
- }
1271
-
1272
- .model-toggle-btn--active:hover:not(:disabled) {
1273
- background: linear-gradient(135deg, #1e4530 0%, #235238 100%);
1274
- border-color: #3a7d58;
1275
- box-shadow: 0 3px 10px rgba(46, 160, 100, 0.35);
1276
- }
1277
-
1278
- .model-toggle-btn:disabled {
1279
- opacity: 0.4;
1280
- cursor: not-allowed;
1281
  }
1282
 
1283
- .math-symbols-btn {
1284
- background: #2a2520;
1285
- color: #c9b8a3;
1286
- border: 1px solid #3a342e;
1287
- padding: 0.75rem 1rem;
1288
- cursor: pointer;
1289
- font-size: 1.1rem;
1290
- font-weight: 600;
1291
- transition: all 0.2s ease;
1292
- border-radius: 8px;
1293
- display: flex;
1294
- align-items: center;
1295
- gap: 0.3rem;
1296
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
1297
- }
1298
 
1299
- .math-symbols-btn:hover {
1300
- background: #3a342e;
1301
- border-color: #4a443c;
1302
- box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
1303
  }
1304
 
1305
- .math-symbols-btn:active {
1306
- transform: scale(0.98);
 
1307
  }
1308
 
1309
- .math-symbols-btn svg {
1310
- width: 14px;
1311
- height: 14px;
1312
- opacity: 0.7;
1313
- }
1314
 
1315
  .send-btn {
1316
- background: linear-gradient(135deg, #6b4ecf 0%, #8b6ee0 100%);
1317
- color: #ffffff;
 
1318
  border: none;
1319
- padding: 0.75rem 1.5rem;
 
1320
  cursor: pointer;
1321
- font-size: 0.9rem;
1322
- font-weight: 600;
1323
- transition: all 0.2s ease;
1324
- border-radius: 8px;
1325
  display: flex;
1326
  align-items: center;
1327
- gap: 0.5rem;
1328
- box-shadow: 0 2px 8px rgba(107, 78, 207, 0.3);
 
 
1329
  }
1330
 
1331
- .send-btn:hover:not(:disabled) {
1332
- background: linear-gradient(135deg, #7b5ed0 0%, #9b7ee5 100%);
1333
- box-shadow: 0 4px 12px rgba(107, 78, 207, 0.4);
1334
- }
1335
 
1336
- .send-btn:active:not(:disabled) {
1337
- transform: scale(0.98);
 
 
 
 
1338
  }
1339
 
1340
- .send-btn:disabled {
1341
- opacity: 0.5;
1342
- cursor: not-allowed;
1343
- background: #4a433c;
1344
- box-shadow: none;
1345
- }
1346
 
1347
- /* Login Page Styles */
1348
- .login-container {
1349
  display: flex;
1350
- justify-content: center;
1351
- align-items: center;
1352
  height: 100vh;
1353
- background: #1a1614;
1354
- padding: 2rem;
1355
- }
1356
-
1357
- .login-container::before {
1358
- display: none;
1359
  }
1360
 
1361
- .login-box {
1362
- background: #211d1a;
1363
- border: 1px solid #3a342e;
1364
- padding: 2.5rem;
1365
- max-width: 420px;
1366
  width: 100%;
1367
- border-radius: 12px;
1368
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
 
 
 
 
1369
  }
1370
 
1371
- .login-header {
1372
- text-align: center;
1373
- margin-bottom: 2rem;
1374
- border-bottom: 1px solid #3a342e;
1375
- padding-bottom: 1.5rem;
1376
- }
1377
 
1378
- .login-header h1 {
1379
- font-size: 2rem;
1380
- color: #e8d4c0;
1381
- margin-bottom: 0.5rem;
1382
- font-weight: 600;
 
 
1383
  }
1384
 
1385
- .evo-title {
1386
- font-size: 4rem;
1387
- font-weight: 900;
1388
- font-family: 'Michroma', 'Arial Black', 'Helvetica', sans-serif;
1389
- color: #e8d4c0;
1390
- letter-spacing: 0.05em;
1391
- text-transform: lowercase;
1392
- margin: 0 0 1.5rem 0;
1393
- text-align: center;
1394
- text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
1395
- }
1396
 
1397
- .login-subtitle {
1398
- color: #a89784;
1399
- font-size: 0.75rem;
1400
- }
1401
 
1402
- .login-form {
1403
- display: flex;
1404
- flex-direction: column;
1405
- gap: 1.5rem;
1406
- }
1407
 
1408
- .form-group {
1409
- display: flex;
1410
- flex-direction: column;
1411
- gap: 0.5rem;
1412
- }
1413
 
1414
- .form-group label {
1415
- color: #c9b8a3;
1416
- font-size: 0.9rem;
1417
- font-weight: 500;
1418
- }
1419
-
1420
- .form-group input {
1421
- padding: 0.875rem;
1422
- background: #2a2520;
1423
- border: 1px solid #3a342e;
1424
- color: #d4c5b9;
1425
- font-size: 1rem;
1426
- transition: all 0.2s ease;
1427
- border-radius: 2px;
1428
- font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
1429
- letter-spacing: 0.5px;
1430
- }
1431
-
1432
- .form-group input:focus {
1433
  outline: none;
1434
- border-color: #8b7355;
1435
- background: #312c27;
1436
- box-shadow: 0 0 8px rgba(139, 115, 85, 0.4);
1437
  }
1438
 
1439
- .form-group input::placeholder {
1440
- color: #6e5d4d;
1441
- }
1442
 
1443
- .error-message {
1444
- background: #2d1a1a;
1445
- border: 1px solid #8b4545;
1446
- color: #d4a3a3;
1447
- padding: 0.875rem;
1448
- font-size: 0.9rem;
 
1449
  text-align: center;
1450
- border-radius: 6px;
1451
  }
1452
 
1453
- @keyframes errorPulse {
1454
- from {
1455
- box-shadow: 0 0 3px rgba(139, 69, 69, 0.3);
1456
- }
1457
- to {
1458
- box-shadow: 0 0 8px rgba(139, 69, 69, 0.5);
1459
- }
1460
- }
1461
-
1462
- .login-btn {
1463
- background: #8b7355;
1464
- color: #1a1614;
1465
- border: 1px solid #a89784;
1466
- padding: 0.875rem;
1467
- font-size: 1rem;
1468
- font-weight: 600;
1469
- cursor: pointer;
1470
- transition: all 0.2s ease;
1471
- margin-top: 0.5rem;
1472
- border-radius: 2px;
1473
- font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
1474
- text-transform: uppercase;
1475
- letter-spacing: 1px;
1476
- }
1477
-
1478
- .login-btn:hover:not(:disabled) {
1479
- background: #9d8264;
1480
- box-shadow: 0 0 10px rgba(157, 130, 100, 0.6);
1481
- text-shadow: 0 0 5px rgba(26, 22, 20, 0.8);
1482
- }
1483
-
1484
- .login-btn:active:not(:disabled) {
1485
- transform: scale(0.98);
1486
- }
1487
-
1488
- .login-btn:disabled {
1489
- opacity: 0.5;
1490
- cursor: not-allowed;
1491
- background: #4a433c;
1492
- }
1493
-
1494
- .login-footer {
1495
- margin-top: 1.5rem;
1496
- text-align: center;
1497
- padding-top: 1rem;
1498
- border-top: 1px solid #3a342e;
1499
- }
1500
-
1501
- .toggle-mode {
1502
- background: transparent;
1503
  border: none;
1504
- color: #8b7355;
 
1505
  font-size: 0.9rem;
1506
- cursor: pointer;
1507
- text-decoration: underline;
1508
- transition: all 0.2s ease;
1509
- }
1510
-
1511
- .toggle-mode:hover {
1512
- color: #9d8264;
1513
- }
1514
-
1515
- .demo-info {
1516
- margin-top: 1.5rem;
1517
- padding: 1rem;
1518
- background: #2a2520;
1519
- border: 1px solid #3a342e;
1520
- font-size: 0.85rem;
1521
- color: #a89784;
1522
- text-align: center;
1523
- border-radius: 6px;
1524
- }
1525
-
1526
- .demo-info p {
1527
- margin: 0.25rem 0;
1528
- }
1529
-
1530
- .demo-info strong {
1531
- color: #c9b8a3 !important;
1532
  font-weight: 600;
1533
- }
1534
-
1535
- /* Header User Info */
1536
- .header-right {
1537
- display: flex;
1538
- align-items: center;
1539
- gap: 1rem;
1540
- }
1541
-
1542
- .user-info {
1543
- color: #c9b8a3;
1544
- font-size: 0.9rem;
1545
- padding: 0.5rem 1rem;
1546
- background: #2a2520;
1547
- border: 1px solid #3a342e;
1548
- border-radius: 6px;
1549
- }
1550
-
1551
- .logout-btn {
1552
- background: #2a2520;
1553
- border: 1px solid #3a342e;
1554
- color: #c9b8a3;
1555
- padding: 0.5rem 1rem;
1556
- cursor: pointer;
1557
- font-size: 0.9rem;
1558
- font-weight: 500;
1559
- transition: all 0.2s ease;
1560
- border-radius: 6px;
1561
- }
1562
-
1563
- .logout-btn:hover {
1564
- background: #3a342e;
1565
- color: #e8d4c0;
1566
- border-color: #4a433c;
1567
- }
1568
-
1569
- .logout-btn:active {
1570
- transform: scale(0.98);
1571
- }
1572
-
1573
- .new-chat-btn {
1574
- background: #3a342e;
1575
- border: 1px solid #4a433c;
1576
- color: #e8d4c0;
1577
- padding: 0.5rem 1rem;
1578
  cursor: pointer;
1579
- font-size: 0.9rem;
1580
- font-weight: 500;
1581
- transition: all 0.2s ease;
1582
- border-radius: 6px;
1583
  }
1584
 
1585
- .new-chat-btn:hover {
1586
- background: #4a433c;
1587
- color: #ffffff;
1588
- border-color: #5a534c;
1589
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
1590
- }
1591
 
1592
- .new-chat-btn:active {
1593
- transform: scale(0.98);
1594
- }
1595
-
1596
- /* Thinking Expander Styles */
1597
- .thinking-expander {
1598
- margin: 0.75rem 0;
1599
- background: #211d1a;
1600
- border: 1px solid #3a342e;
1601
- border-radius: 8px;
1602
- overflow: hidden;
1603
- }
1604
-
1605
- .thinking-header {
1606
- cursor: pointer;
1607
- padding: 0.875rem 1rem;
1608
- background: #2a2520;
1609
- display: flex;
1610
- align-items: center;
1611
- gap: 0.75rem;
1612
- transition: background 0.2s ease;
1613
- list-style: none;
1614
- user-select: none;
1615
- }
1616
-
1617
- .thinking-header:hover {
1618
- background: #312c27;
1619
- }
1620
-
1621
- .thinking-header::-webkit-details-marker {
1622
- display: none;
1623
- }
1624
 
1625
- .thinking-spinner {
1626
- width: 16px;
1627
- height: 16px;
1628
- border: 2px solid #3a342e;
1629
- border-top-color: #8b7355;
1630
- border-radius: 50%;
1631
- animation: spin 1s linear infinite;
1632
- flex-shrink: 0;
1633
- }
1634
-
1635
- /* Stop animation when thinking is complete */
1636
- .thinking-spinner.complete {
1637
- animation: none;
1638
- border-top-color: #6e5d4d;
1639
- }
1640
-
1641
- @keyframes spin {
1642
- to {
1643
- transform: rotate(360deg);
1644
- }
1645
- }
1646
-
1647
- .thinking-label {
1648
- color: #c9b8a3;
1649
- font-weight: 600;
1650
- font-size: 0.95rem;
1651
- letter-spacing: 0.5px;
1652
- }
1653
-
1654
- .thinking-content {
1655
- padding: 0;
1656
- }
1657
-
1658
- .thinking-text {
1659
- padding: 1rem;
1660
- background: #1a1614;
1661
- color: #c9b8a3;
1662
- font-size: 0.95rem;
1663
- line-height: 1.6;
1664
- border-bottom: 1px solid #3a342e;
1665
- }
1666
-
1667
- .thinking-text p {
1668
- margin: 0.5rem 0;
1669
- }
1670
-
1671
- .thinking-text p:first-child {
1672
- margin-top: 0;
1673
- }
1674
-
1675
- .thinking-text p:last-child {
1676
- margin-bottom: 0;
1677
- }
1678
-
1679
- .thinking-expander[open] .thinking-spinner {
1680
- animation: spin 1s linear infinite;
1681
- }
1682
-
1683
- /* When thinking is complete (has final content), stop spinner */
1684
- .thinking-expander:not([open]) .thinking-spinner {
1685
- border-top-color: #6e5d4d;
1686
- animation: none;
1687
- }
1688
-
1689
- /* Thinking Section - Expandable Intermediate Responses */
1690
- .thinking-section {
1691
- margin: 1rem 0;
1692
- border: 1px solid #3a342e;
1693
- border-radius: 6px;
1694
- background: #1a1614;
1695
- overflow: hidden;
1696
- }
1697
-
1698
- .thinking-header {
1699
- padding: 0.75rem 1rem;
1700
- background: #211d1a;
1701
- cursor: pointer;
1702
- display: flex;
1703
- align-items: center;
1704
- gap: 0.5rem;
1705
- user-select: none;
1706
- transition: background 0.2s ease;
1707
- }
1708
-
1709
- .thinking-header:hover {
1710
- background: #2a2520;
1711
- }
1712
-
1713
- .thinking-icon {
1714
- font-size: 1rem;
1715
- opacity: 0.8;
1716
- }
1717
-
1718
- .thinking-label {
1719
- color: #9d8264;
1720
- font-size: 0.9rem;
1721
- font-weight: 500;
1722
- letter-spacing: 0.3px;
1723
- }
1724
-
1725
- .thinking-section[open] .thinking-header {
1726
- border-bottom: 1px solid #3a342e;
1727
- }
1728
-
1729
- .thinking-content {
1730
- padding: 1rem;
1731
- background: #1a1614;
1732
- color: #c9b8a3;
1733
- font-size: 0.9rem;
1734
- line-height: 1.6;
1735
- max-height: 500px;
1736
- overflow-y: auto;
1737
- }
1738
-
1739
- /* Live thinking indicator (while streaming, before final response) */
1740
- .thinking-live {
1741
- border-left: 3px solid #8b7355;
1742
- padding-left: 1rem;
1743
- margin: 0.5rem 0;
1744
- background: rgba(139, 115, 85, 0.05);
1745
- border-radius: 4px;
1746
- }
1747
-
1748
- .thinking-live-header {
1749
- color: #8b7355;
1750
- font-size: 0.85rem;
1751
- font-weight: 600;
1752
- margin-bottom: 0.5rem;
1753
- letter-spacing: 0.5px;
1754
- opacity: 0.9;
1755
- }
 
1
+ /* ==============================
2
+ EVO — OpenWebUI-inspired theme
3
+ ============================== */
4
+
5
+ *, *::before, *::after {
6
+ box-sizing: border-box;
7
  margin: 0;
8
  padding: 0;
 
9
  }
10
 
11
+ :root {
12
+ --bg-primary: #0f0f0f;
13
+ --bg-secondary: #171717;
14
+ --bg-tertiary: #1e1e1e;
15
+ --bg-hover: #262626;
16
+ --border: #2e2e2e;
17
+ --border-light: #3a3a3a;
18
+
19
+ --text-primary: #ececec;
20
+ --text-secondary:#a0a0a0;
21
+ --text-muted: #666;
22
+
23
+ --accent: #7c3aed;
24
+ --accent-hover: #6d28d9;
25
+ --accent-light: rgba(124,58,237,0.12);
26
+ --accent-glow: rgba(124,58,237,0.25);
27
+
28
+ --success: #10b981;
29
+ --success-bg: rgba(16,185,129,0.1);
30
+ --error: #ef4444;
31
+ --error-bg: rgba(239,68,68,0.1);
32
+ --warn: #f59e0b;
33
+ --warn-bg: rgba(245,158,11,0.1);
34
+
35
+ --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
36
+ --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace;
37
+
38
+ --sidebar-width: 260px;
39
+ --topbar-height: 52px;
40
+ --radius-sm: 6px;
41
+ --radius: 10px;
42
+ --radius-lg: 14px;
43
+ --radius-xl: 20px;
44
  }
45
 
46
+ html, body, #root {
47
+ height: 100%;
 
 
 
 
48
  overflow: hidden;
 
49
  }
50
 
51
+ body {
52
+ font-family: var(--font-sans);
53
+ background: var(--bg-primary);
54
+ color: var(--text-primary);
55
+ -webkit-font-smoothing: antialiased;
56
+ line-height: 1.5;
57
  }
58
 
59
+ /* ====== LAYOUT ====== */
 
 
 
60
 
61
  .app {
62
  display: flex;
 
63
  height: 100vh;
 
 
64
  overflow: hidden;
65
+ position: relative;
66
  }
67
 
68
+ /* ====== SIDEBAR ====== */
 
 
 
 
69
 
70
+ .sidebar-overlay {
71
+ display: none;
72
+ position: fixed;
73
+ inset: 0;
74
+ background: rgba(0,0,0,0.5);
75
+ z-index: 100;
 
76
  }
77
 
78
+ @media (max-width: 768px) {
79
+ .sidebar-overlay {
80
+ display: block;
 
 
 
81
  }
82
  }
83
 
84
+ .sidebar {
85
+ width: var(--sidebar-width);
86
+ height: 100vh;
87
+ background: var(--bg-secondary);
88
+ border-right: 1px solid var(--border);
89
+ display: flex;
90
+ flex-direction: column;
91
+ flex-shrink: 0;
92
+ z-index: 101;
93
+ transition: transform 0.25s ease;
94
  }
95
 
96
+ @media (max-width: 768px) {
97
+ .sidebar {
98
+ position: fixed;
99
+ left: 0;
100
+ top: 0;
101
+ transform: translateX(-100%);
102
  }
103
+ .sidebar--open {
104
+ transform: translateX(0);
 
105
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  }
107
 
108
+ .sidebar-header {
109
  display: flex;
110
  align-items: center;
111
+ justify-content: space-between;
112
+ padding: 0 12px;
113
+ height: var(--topbar-height);
114
+ border-bottom: 1px solid var(--border);
115
+ flex-shrink: 0;
 
 
 
 
 
 
 
116
  }
117
 
118
+ .sidebar-logo {
119
+ font-size: 1.35rem;
120
+ font-weight: 800;
121
+ letter-spacing: -0.03em;
122
+ color: var(--text-primary);
123
+ font-family: var(--font-sans);
 
 
 
124
  }
125
 
126
+ .sidebar-collapse-btn {
127
+ width: 28px;
128
+ height: 28px;
129
+ background: transparent;
130
+ border: none;
131
+ color: var(--text-muted);
132
+ cursor: pointer;
133
+ border-radius: var(--radius-sm);
134
+ display: flex;
135
+ align-items: center;
136
+ justify-content: center;
137
+ transition: background 0.15s, color 0.15s;
138
  }
139
 
140
+ .sidebar-collapse-btn:hover {
141
+ background: var(--bg-hover);
142
+ color: var(--text-primary);
 
 
 
 
 
143
  }
144
 
145
+ .sidebar .new-chat-btn {
146
  display: flex;
 
147
  align-items: center;
148
+ gap: 8px;
149
+ width: calc(100% - 24px);
150
+ margin: 12px 12px 8px;
151
+ padding: 9px 14px;
152
+ background: var(--bg-tertiary);
153
+ border: 1px solid var(--border);
154
+ color: var(--text-primary);
155
  font-size: 0.875rem;
156
  font-weight: 500;
157
+ font-family: var(--font-sans);
158
+ border-radius: var(--radius);
 
 
 
 
 
 
 
159
  cursor: pointer;
160
+ transition: background 0.15s, border-color 0.15s;
161
+ text-align: left;
 
 
 
 
 
162
  }
163
 
164
+ .sidebar .new-chat-btn:hover {
165
+ background: var(--bg-hover);
166
+ border-color: var(--border-light);
 
167
  }
168
 
169
+ .sidebar-conversations {
170
+ flex: 1;
171
+ overflow-y: auto;
172
+ padding: 4px 8px;
173
+ scrollbar-width: thin;
174
+ scrollbar-color: var(--border) transparent;
175
  }
176
 
177
+ .sidebar-conversations::-webkit-scrollbar { width: 4px; }
178
+ .sidebar-conversations::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
 
179
 
180
+ .sidebar-section-label {
181
+ font-size: 0.7rem;
182
+ font-weight: 600;
183
+ text-transform: uppercase;
184
+ letter-spacing: 0.06em;
185
+ color: var(--text-muted);
186
+ padding: 8px 8px 4px;
187
  }
188
 
189
+ .conv-item {
190
+ display: flex;
191
+ align-items: center;
192
+ gap: 8px;
193
+ padding: 8px 10px;
194
+ border-radius: var(--radius-sm);
195
+ cursor: pointer;
196
+ color: var(--text-secondary);
197
+ font-size: 0.85rem;
198
+ transition: background 0.12s;
199
+ position: relative;
200
+ min-height: 36px;
201
  }
202
 
203
+ .conv-item:hover { background: var(--bg-hover); color: var(--text-primary); }
204
+ .conv-item:hover .conv-delete-btn { opacity: 1; }
205
+
206
+ .conv-item--active {
207
+ background: var(--accent-light);
208
+ color: var(--text-primary);
209
  }
210
 
211
+ .conv-icon { flex-shrink: 0; opacity: 0.5; }
212
+
213
+ .conv-title {
214
+ flex: 1;
215
+ overflow: hidden;
216
+ text-overflow: ellipsis;
217
+ white-space: nowrap;
218
  }
219
 
220
+ .conv-delete-btn {
221
+ flex-shrink: 0;
222
+ background: transparent;
223
+ border: none;
224
+ color: var(--text-muted);
225
+ cursor: pointer;
226
+ padding: 3px;
227
+ border-radius: 4px;
228
  display: flex;
 
229
  align-items: center;
230
+ opacity: 0;
231
+ transition: opacity 0.15s, background 0.15s;
232
  }
233
 
234
+ .conv-delete-btn:hover { background: var(--error-bg); color: var(--error); }
 
 
 
 
235
 
236
+ .sidebar-footer {
237
+ border-top: 1px solid var(--border);
238
+ padding: 12px;
239
+ flex-shrink: 0;
240
+ display: flex;
241
+ flex-direction: column;
242
+ gap: 10px;
 
 
243
  }
244
 
245
+ .model-selector-label {
246
+ font-size: 0.7rem;
247
+ font-weight: 600;
248
+ text-transform: uppercase;
249
+ letter-spacing: 0.06em;
250
+ color: var(--text-muted);
251
+ margin-bottom: 5px;
252
  }
253
 
254
+ .model-option {
255
+ display: flex;
256
+ align-items: center;
257
+ gap: 8px;
258
+ width: 100%;
259
+ padding: 7px 10px;
260
+ border-radius: var(--radius-sm);
261
+ background: transparent;
262
+ border: 1px solid transparent;
263
+ color: var(--text-secondary);
264
+ font-size: 0.82rem;
265
+ font-family: var(--font-sans);
266
  cursor: pointer;
267
+ transition: background 0.12s, color 0.12s, border-color 0.12s;
268
+ text-align: left;
 
 
269
  }
270
 
271
+ .model-option:hover { background: var(--bg-hover); color: var(--text-primary); }
 
 
272
 
273
+ .model-option--active {
274
+ background: var(--accent-light);
275
+ border-color: rgba(124,58,237,0.3);
276
+ color: var(--text-primary);
277
  }
278
 
279
+ .model-dot {
280
+ width: 7px;
281
+ height: 7px;
282
+ border-radius: 50%;
283
+ background: var(--success);
284
+ flex-shrink: 0;
285
  }
286
 
287
+ .model-dot--r1 { background: var(--accent); }
288
+
289
+ .model-tag {
290
+ margin-left: auto;
291
+ font-size: 0.65rem;
292
  font-weight: 600;
293
+ padding: 1px 5px;
294
+ border-radius: 3px;
295
+ background: var(--success-bg);
296
+ color: var(--success);
297
+ text-transform: uppercase;
298
+ letter-spacing: 0.05em;
299
  }
300
 
301
+ .model-tag--r1 { background: var(--accent-light); color: #a78bfa; }
 
 
 
302
 
303
+ .user-section {
304
+ display: flex;
305
+ align-items: center;
306
+ gap: 8px;
307
+ padding: 7px 10px;
308
+ border-radius: var(--radius);
309
+ background: var(--bg-tertiary);
310
+ border: 1px solid var(--border);
311
  }
312
 
313
+ .user-avatar {
314
+ width: 28px;
315
+ height: 28px;
316
+ border-radius: 50%;
317
+ background: var(--accent);
318
  display: flex;
319
+ align-items: center;
320
+ justify-content: center;
321
+ font-size: 0.75rem;
322
+ font-weight: 700;
323
+ color: #fff;
324
+ flex-shrink: 0;
325
  }
326
 
327
+ .user-name {
328
+ flex: 1;
329
+ font-size: 0.82rem;
 
 
330
  font-weight: 500;
331
+ color: var(--text-primary);
332
+ overflow: hidden;
333
+ text-overflow: ellipsis;
334
+ white-space: nowrap;
335
+ }
336
+
337
+ .user-logout-btn {
338
+ background: transparent;
339
+ border: none;
340
+ color: var(--text-muted);
341
+ cursor: pointer;
342
+ padding: 3px;
343
  border-radius: 4px;
344
+ display: flex;
345
+ align-items: center;
346
+ transition: color 0.15s;
347
+ flex-shrink: 0;
348
  }
349
 
350
+ .user-logout-btn:hover { color: var(--error); }
351
+
352
+ /* ====== MAIN AREA ====== */
353
+
354
+ .main {
355
+ flex: 1;
356
  display: flex;
357
  flex-direction: column;
358
+ height: 100vh;
359
+ min-width: 0;
360
+ background: var(--bg-primary);
361
  overflow: hidden;
 
 
 
 
362
  }
363
 
364
+ /* ====== TOPBAR ====== */
365
+
366
+ .topbar {
367
+ height: var(--topbar-height);
 
368
  display: flex;
369
+ align-items: center;
370
+ gap: 10px;
371
+ padding: 0 16px;
372
+ border-bottom: 1px solid var(--border);
373
+ flex-shrink: 0;
374
+ background: var(--bg-primary);
375
+ z-index: 10;
376
  }
377
 
378
+ .topbar-menu-btn {
379
+ width: 32px;
380
+ height: 32px;
381
+ background: transparent;
382
+ border: none;
383
+ color: var(--text-secondary);
384
+ cursor: pointer;
385
+ border-radius: var(--radius-sm);
386
+ display: flex;
387
+ align-items: center;
388
+ justify-content: center;
389
+ transition: background 0.15s, color 0.15s;
390
  }
391
 
392
+ .topbar-menu-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
393
+
394
+ .topbar-logo {
395
+ font-size: 1.1rem;
396
+ font-weight: 800;
397
+ letter-spacing: -0.03em;
398
+ color: var(--text-primary);
399
  }
400
 
401
+ .topbar-spacer { flex: 1; }
402
+
403
+ .topbar-new-btn {
404
+ display: flex;
405
+ align-items: center;
406
+ gap: 6px;
407
+ padding: 6px 14px;
408
+ background: var(--bg-tertiary);
409
+ border: 1px solid var(--border);
410
+ color: var(--text-secondary);
411
+ font-size: 0.82rem;
412
+ font-weight: 500;
413
+ font-family: var(--font-sans);
414
+ border-radius: var(--radius);
415
+ cursor: pointer;
416
+ transition: background 0.15s, color 0.15s;
417
  }
418
 
419
+ .topbar-new-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
420
+
421
+ /* ====== MESSAGES ====== */
422
+
423
+ .messages {
424
+ flex: 1;
425
+ overflow-y: auto;
426
+ padding: 24px 0;
427
+ scrollbar-width: thin;
428
+ scrollbar-color: var(--border) transparent;
429
  }
430
 
431
+ .messages::-webkit-scrollbar { width: 5px; }
432
+ .messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
433
+
434
+ /* ====== WELCOME ====== */
435
+
436
  .welcome {
437
+ display: flex;
438
+ flex-direction: column;
439
+ align-items: center;
440
+ justify-content: center;
441
+ min-height: calc(100vh - var(--topbar-height) - 130px);
442
+ padding: 2rem;
443
  text-align: center;
 
 
 
 
 
 
 
 
444
  }
445
 
446
+ .welcome-logo {
447
+ font-size: 3.5rem;
448
+ font-weight: 800;
449
+ letter-spacing: -0.04em;
450
+ color: var(--text-primary);
451
+ margin-bottom: 16px;
452
+ opacity: 0.9;
453
  }
454
 
455
+ .welcome-heading {
456
+ font-size: 1.5rem;
457
+ font-weight: 600;
458
+ color: var(--text-primary);
459
+ margin-bottom: 8px;
460
  }
461
 
462
+ .welcome-sub {
463
+ font-size: 0.9rem;
464
+ color: var(--text-muted);
465
+ letter-spacing: 0.05em;
466
+ margin-bottom: 36px;
467
  }
468
 
469
  .examples {
470
+ display: grid;
471
+ grid-template-columns: repeat(2, 1fr);
472
+ gap: 10px;
473
+ max-width: 560px;
474
+ width: 100%;
475
  }
476
 
477
+ @media (max-width: 500px) {
478
+ .examples { grid-template-columns: 1fr; }
 
 
 
479
  }
480
 
481
  .example-btn {
482
+ display: flex;
483
+ align-items: flex-start;
484
+ gap: 10px;
485
+ padding: 14px 16px;
486
+ background: var(--bg-secondary);
487
+ border: 1px solid var(--border);
488
+ border-radius: var(--radius);
489
  cursor: pointer;
490
+ text-align: left;
491
+ color: var(--text-secondary);
492
+ font-size: 0.85rem;
493
+ font-family: var(--font-sans);
494
+ line-height: 1.4;
495
+ transition: background 0.15s, border-color 0.15s, color 0.15s;
496
  }
497
 
498
+ .example-btn:hover { background: var(--bg-tertiary); border-color: var(--border-light); color: var(--text-primary); }
499
+
500
+ .example-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; opacity: 0.8; }
501
+
502
+ /* ====== MESSAGE BUBBLES ====== */
503
+
504
+ .message {
505
+ display: flex;
506
+ gap: 14px;
507
+ padding: 16px max(16px, calc((100% - 760px) / 2));
508
+ align-items: flex-start;
509
+ animation: msgFadeIn 0.2s ease;
510
  }
511
 
512
+ @keyframes msgFadeIn {
513
+ from { opacity: 0; transform: translateY(6px); }
514
+ to { opacity: 1; transform: translateY(0); }
515
  }
516
 
517
+ .message-user { flex-direction: row-reverse; }
518
+ .message-user .message-body { align-items: flex-end; }
519
+ .message-user .message-meta { flex-direction: row-reverse; }
520
+
521
+ .message-user .message-body .message-content {
522
+ background: var(--bg-tertiary);
523
+ border: 1px solid var(--border);
524
+ border-radius: var(--radius-lg) var(--radius-sm) var(--radius-lg) var(--radius-lg);
 
 
 
 
 
 
 
 
 
 
 
 
 
525
  }
526
 
527
+ .message-assistant .message-body .message-content {
528
+ background: transparent;
529
+ }
530
+
531
+ .avatar {
532
+ width: 34px;
533
+ height: 34px;
534
+ border-radius: 50%;
535
+ display: flex;
536
+ align-items: center;
537
+ justify-content: center;
538
+ flex-shrink: 0;
539
+ font-size: 0.8rem;
540
+ font-weight: 700;
541
+ }
542
+
543
+ .avatar--user { background: var(--accent); color: #fff; }
544
+ .avatar--assistant { background: var(--bg-tertiary); border: 1px solid var(--border); color: var(--text-secondary); }
545
+
546
+ .message-body {
547
+ flex: 1;
548
+ min-width: 0;
549
  display: flex;
550
  flex-direction: column;
551
+ gap: 6px;
552
  }
553
 
554
+ .message-meta {
555
  display: flex;
556
  align-items: center;
557
+ gap: 8px;
 
 
 
 
 
 
558
  }
559
 
560
+ .message-role-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
561
+ .message-time { font-size: 0.72rem; color: var(--text-muted); }
562
+
563
+ .message-actions {
564
+ display: flex;
565
+ gap: 3px;
566
+ opacity: 0;
567
+ transition: opacity 0.15s;
568
+ margin-left: 4px;
569
+ }
570
+
571
+ .message:hover .message-actions { opacity: 1; }
572
+
573
+ .action-btn {
574
+ width: 26px;
575
+ height: 26px;
576
  background: transparent;
577
  border: none;
578
+ color: var(--text-muted);
579
  cursor: pointer;
580
+ border-radius: var(--radius-sm);
581
  display: flex;
582
  align-items: center;
583
  justify-content: center;
584
+ transition: background 0.12s, color 0.12s;
 
585
  }
586
 
587
+ .action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
588
+ .action-btn.copied { color: var(--success); }
 
 
589
 
590
+ .message-content {
591
+ font-size: 0.925rem;
592
+ line-height: 1.75;
593
+ color: var(--text-primary);
594
+ padding: 10px 14px;
595
+ border-radius: var(--radius);
596
+ min-width: 0;
597
+ word-break: break-word;
598
  }
599
 
600
+ .message-assistant .message-content { padding: 0; }
 
 
 
 
 
 
 
 
601
 
602
+ .message-content .streaming-content { white-space: pre-wrap; word-break: break-word; }
 
 
 
 
 
 
 
 
 
 
 
603
 
604
+ .message-content p { margin: 0.5em 0; }
605
+ .message-content p:first-child { margin-top: 0; }
606
+ .message-content p:last-child { margin-bottom: 0; }
 
 
607
 
608
+ .message-content h1,
609
+ .message-content h2,
610
+ .message-content h3,
611
+ .message-content h4 {
612
+ color: var(--text-primary);
613
  font-weight: 600;
614
+ margin: 1.1em 0 0.4em;
615
+ line-height: 1.3;
616
  }
617
 
618
+ .message-content h1 { font-size: 1.4rem; }
619
+ .message-content h2 { font-size: 1.2rem; }
620
+ .message-content h3 { font-size: 1.05rem; }
621
+
622
+ .message-content strong, .message-content b { color: var(--text-primary); font-weight: 600; }
623
 
624
+ .message-content ul, .message-content ol { padding-left: 1.5em; margin: 0.5em 0; }
625
+ .message-content li { margin: 0.25em 0; }
626
+
627
+ .message-content blockquote {
628
+ border-left: 3px solid var(--accent);
629
+ padding: 0.4em 1em;
630
+ margin: 0.75em 0;
631
+ color: var(--text-secondary);
632
+ background: var(--accent-light);
633
+ border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
634
  }
635
 
636
+ .message-content hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
637
+
638
+ .message-content a { color: #a78bfa; text-decoration: underline; text-underline-offset: 2px; }
639
+ .message-content a:hover { color: #c4b5fd; }
640
+
641
+ .message-content code {
642
+ background: var(--bg-tertiary);
643
+ border: 1px solid var(--border);
644
+ padding: 0.15em 0.45em;
645
+ font-size: 0.875em;
646
+ border-radius: 4px;
647
+ color: #e2c78a;
648
+ font-family: var(--font-mono);
649
  }
650
 
651
+ .message-content pre {
652
+ background: var(--bg-secondary) !important;
653
+ border: 1px solid var(--border) !important;
654
+ border-radius: var(--radius) !important;
655
+ padding: 1rem !important;
656
+ margin: 0.75rem 0 !important;
657
+ overflow-x: auto !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
  }
659
 
660
+ .message-content pre code { background: transparent; border: none; padding: 0; color: inherit; }
 
 
 
 
 
 
 
 
 
661
 
662
+ .message-content table { width: 100%; border-collapse: collapse; margin: 0.75em 0; font-size: 0.875rem; }
663
+ .message-content th, .message-content td { border: 1px solid var(--border); padding: 7px 12px; text-align: left; }
664
+ .message-content th { background: var(--bg-tertiary); font-weight: 600; }
665
+ .message-content tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
 
666
 
667
+ .message-content .katex { color: var(--text-primary); font-size: 1.05em; }
668
+ .message-content .katex-display {
669
+ margin: 1rem 0;
670
+ padding: 1rem;
671
+ background: var(--bg-secondary);
672
+ border: 1px solid var(--border);
673
+ border-radius: var(--radius);
674
+ overflow-x: auto;
675
  }
676
 
677
+ /* ====== TYPING INDICATOR ====== */
 
 
 
678
 
679
+ .typing-indicator {
680
+ display: flex;
681
+ align-items: center;
682
+ gap: 14px;
683
+ padding: 10px max(16px, calc((100% - 760px) / 2));
684
  }
685
 
686
+ .typing-dots { display: flex; align-items: center; gap: 6px; }
 
 
687
 
688
+ .typing-dots span {
689
+ width: 7px;
690
+ height: 7px;
691
+ border-radius: 50%;
692
+ background: var(--text-muted);
693
+ animation: dotBounce 1.3s infinite ease-in-out;
 
 
 
 
 
694
  }
695
 
696
+ .typing-dots span:nth-child(2) { animation-delay: 0.15s; }
697
+ .typing-dots span:nth-child(3) { animation-delay: 0.3s; }
 
 
 
698
 
699
+ @keyframes dotBounce {
700
+ 0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
701
+ 40% { transform: translateY(-6px); opacity: 1; }
702
  }
703
 
704
+ .status-message { font-size: 0.82rem; color: var(--text-muted); font-style: italic; }
 
 
 
705
 
706
+ /* ====== REASONING TRACE ====== */
 
 
 
707
 
708
+ details.reasoning-trace {
709
+ margin: 8px 0;
710
+ border: 1px solid var(--border);
711
+ border-radius: var(--radius);
712
+ overflow: hidden;
713
+ background: var(--bg-secondary);
 
 
 
714
  }
715
 
716
+ details.reasoning-trace.reasoning-streaming { border-color: rgba(245,158,11,0.4); }
 
 
 
 
717
 
718
+ details.reasoning-trace summary {
719
+ list-style: none;
720
+ cursor: pointer;
721
+ padding: 10px 14px;
722
+ user-select: none;
723
+ transition: background 0.12s;
724
  }
725
 
726
+ details.reasoning-trace summary:hover { background: var(--bg-hover); }
727
+ details.reasoning-trace summary::-webkit-details-marker { display: none; }
 
 
 
728
 
729
+ .reasoning-header {
730
+ display: flex;
 
731
  align-items: center;
732
+ gap: 8px;
733
+ font-size: 0.82rem;
 
 
 
 
 
 
 
734
  font-weight: 500;
735
+ color: var(--warn);
 
 
 
 
 
 
 
 
 
 
736
  }
737
 
738
+ .reasoning-icon { font-size: 1rem; }
 
 
 
739
 
740
+ .reasoning-live-indicator { display: flex; gap: 3px; margin-left: 4px; }
 
 
 
 
741
 
742
+ .reasoning-live-dot {
743
+ width: 5px;
744
+ height: 5px;
745
+ border-radius: 50%;
746
+ background: var(--warn);
747
+ animation: dotBounce 1.2s infinite ease-in-out;
748
  }
749
+ .reasoning-live-dot:nth-child(2) { animation-delay: 0.15s; }
750
+ .reasoning-live-dot:nth-child(3) { animation-delay: 0.3s; }
751
 
752
+ .reasoning-content {
753
+ padding: 12px 14px;
754
+ background: rgba(0,0,0,0.25);
755
+ color: var(--text-secondary);
756
+ font-size: 0.82rem;
757
  line-height: 1.7;
758
+ font-family: var(--font-mono);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
  white-space: pre-wrap;
760
  word-break: break-word;
761
+ max-height: 360px;
762
+ overflow-y: auto;
763
+ border-top: 1px solid var(--border);
764
  }
765
 
766
+ /* ====== TOOL CALLS ====== */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
767
 
768
+ .tool-calls { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
 
 
 
 
769
 
 
 
 
 
 
 
 
 
 
 
770
  details.tool-call {
771
+ border: 1px solid var(--border);
772
+ border-radius: var(--radius);
773
+ background: var(--bg-secondary);
774
+ overflow: hidden;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
775
  }
776
 
777
+ details.tool-call[open] { border-color: var(--border-light); }
 
 
778
 
779
+ details.tool-call > summary { list-style: none; cursor: pointer; user-select: none; }
780
+ details.tool-call > summary::-webkit-details-marker { display: none; }
 
 
781
 
 
782
  .tool-call-header {
783
  display: flex;
 
784
  align-items: center;
785
+ gap: 10px;
786
+ padding: 9px 14px;
787
+ transition: background 0.12s;
 
 
 
 
 
 
788
  }
789
 
790
+ .tool-call-header:hover { background: var(--bg-hover); }
791
+
792
+ .tool-name { font-size: 0.82rem; font-weight: 600; font-family: var(--font-mono); color: #a78bfa; }
793
 
 
794
  .tool-status {
795
  display: inline-flex;
796
  align-items: center;
797
+ gap: 5px;
798
+ font-size: 0.75rem;
799
+ padding: 2px 9px;
800
+ border-radius: 99px;
801
  margin-left: auto;
802
  }
803
 
804
+ .tool-status.generating { background: rgba(59,130,246,0.1); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
805
+ .tool-status.executing { background: rgba(168,85,247,0.1); color: #c084fc; border: 1px solid rgba(168,85,247,0.2); }
 
 
 
 
 
 
 
 
 
806
 
807
  .tool-status .dot {
808
+ width: 5px; height: 5px; border-radius: 50%; background: currentColor;
809
+ animation: dotBounce 1.3s infinite ease-in-out;
 
 
 
 
 
 
 
810
  }
811
+ .tool-status .dot:nth-child(2) { animation-delay: 0.15s; }
812
+ .tool-status .dot:nth-child(3) { animation-delay: 0.3s; }
813
 
814
+ .tool-status .status-text { font-weight: 500; white-space: nowrap; }
 
 
815
 
816
+ .checkmark { color: var(--success); font-size: 1em; margin-left: auto; }
817
+ .crossmark { color: var(--error); font-size: 1em; margin-left: auto; }
 
818
 
819
+ .tool-call-content { padding: 0 14px 12px; border-top: 1px solid var(--border); }
 
 
 
 
 
 
 
 
 
820
 
821
+ .tool-section { margin-top: 10px; }
 
 
 
822
 
823
+ details.tool-section { background: transparent; border: none; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
824
 
825
  details.tool-section summary {
826
+ list-style: none;
827
  cursor: pointer;
 
828
  user-select: none;
829
+ display: inline-flex;
830
+ align-items: center;
831
+ gap: 4px;
832
+ margin-bottom: 5px;
833
+ transition: color 0.12s;
 
 
834
  }
835
 
836
+ details.tool-section summary::-webkit-details-marker { display: none; }
 
 
 
837
 
 
838
  details.tool-section summary::before {
839
+ content: '\25B6';
840
+ font-size: 0.6em;
841
+ transition: transform 0.15s;
842
  display: inline-block;
843
+ color: var(--text-muted);
 
844
  }
845
 
846
+ details.tool-section[open] summary::before { transform: rotate(90deg); }
 
 
847
 
848
  .tool-section-label {
849
+ font-size: 0.72rem;
850
+ font-weight: 700;
 
851
  text-transform: uppercase;
852
+ letter-spacing: 0.06em;
853
+ color: var(--text-muted);
854
  }
855
 
856
+ .tool-code {
857
+ background: var(--bg-primary);
858
+ border: 1px solid var(--border);
859
+ padding: 10px 12px;
860
+ border-radius: var(--radius-sm);
861
+ font-size: 0.8rem;
862
+ font-family: var(--font-mono);
863
+ color: var(--text-secondary);
864
+ white-space: pre;
865
  overflow-x: auto;
 
 
 
 
 
 
 
866
  }
867
 
868
+ .tool-output {
869
+ background: var(--bg-primary);
870
+ border: 1px solid var(--border);
871
+ padding: 10px 12px;
872
+ border-radius: var(--radius-sm);
873
+ font-size: 0.82rem;
874
+ color: var(--text-secondary);
875
+ overflow-x: auto;
876
+ line-height: 1.6;
877
+ }
878
+
879
+ .tool-output > div { font-family: var(--font-sans); }
880
+ .tool-output pre, .tool-output code { font-family: var(--font-mono); }
881
+
882
  .tool-output img {
883
  max-width: 100%;
884
+ border-radius: var(--radius-sm);
885
+ margin: 8px 0;
 
 
886
  display: block;
887
+ border: 1px solid var(--border);
888
  }
889
 
890
+ .tool-input-scroll { white-space: pre; overflow-x: auto; max-width: 100%; word-break: normal; }
 
 
 
891
 
892
+ /* ====== INPUT WRAPPER ====== */
 
 
 
 
893
 
894
+ .input-wrapper {
895
+ flex-shrink: 0;
896
+ padding: 0 max(16px, calc((100% - 760px) / 2)) 16px;
897
+ background: var(--bg-primary);
898
+ position: relative;
 
899
  }
900
 
901
+ .math-symbols-popup {
902
+ position: absolute;
903
+ bottom: calc(100% + 8px);
904
+ left: max(16px, calc((100% - 760px) / 2));
905
+ right: max(16px, calc((100% - 760px) / 2));
906
+ z-index: 200;
907
+ background: var(--bg-secondary);
908
+ border: 1px solid var(--border);
909
+ border-radius: var(--radius-lg);
910
+ box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
911
  display: flex;
912
+ flex-direction: column;
913
+ max-height: 380px;
914
+ overflow: hidden;
 
 
 
 
 
 
 
 
 
 
 
 
915
  }
916
 
917
+ .math-symbols-popup-header {
918
+ display: flex;
919
+ align-items: center;
920
+ justify-content: space-between;
921
+ padding: 10px 16px;
922
+ border-bottom: 1px solid var(--border);
923
+ font-size: 0.875rem;
924
+ font-weight: 600;
925
+ color: var(--text-primary);
926
+ flex-shrink: 0;
927
  }
928
 
929
+ .math-symbols-close-btn {
930
+ background: transparent;
931
+ border: none;
932
+ color: var(--text-muted);
933
+ cursor: pointer;
934
+ padding: 3px;
935
+ border-radius: 4px;
936
+ display: flex;
937
+ transition: color 0.12s;
938
  }
939
 
940
+ .math-symbols-close-btn:hover { color: var(--text-primary); }
 
 
 
 
 
 
 
941
 
942
+ .math-symbols { overflow-y: auto; padding: 12px 14px; scrollbar-width: thin; flex: 1; }
 
 
 
943
 
944
+ .symbol-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
 
 
945
 
946
+ .symbol-tab {
947
+ background: var(--bg-tertiary);
948
+ border: 1px solid var(--border);
949
+ color: var(--text-secondary);
950
+ padding: 4px 10px;
951
+ font-size: 0.78rem;
952
+ font-family: var(--font-sans);
953
+ border-radius: var(--radius-sm);
954
  cursor: pointer;
955
+ transition: background 0.12s, color 0.12s;
 
 
 
956
  }
957
 
958
+ .symbol-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
 
 
959
 
960
+ .symbol-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
 
 
961
 
962
+ .symbol-content { padding: 4px 0; }
963
+ .symbol-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
 
 
 
 
 
 
 
 
 
 
 
 
964
 
965
+ .symbol-btn {
966
+ background: var(--bg-tertiary);
967
+ border: 1px solid var(--border);
968
+ color: var(--text-secondary);
969
+ padding: 5px 8px;
970
+ min-width: 36px;
971
+ font-size: 1rem;
972
+ cursor: pointer;
973
+ border-radius: var(--radius-sm);
974
+ transition: background 0.1s, transform 0.1s;
975
  display: inline-flex;
976
  align-items: center;
977
+ justify-content: center;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
978
  }
979
 
980
+ .symbol-btn:hover { background: var(--bg-hover); color: var(--text-primary); transform: translateY(-1px); }
981
+ .symbol-btn:active { transform: scale(0.96); }
 
982
 
983
+ .template-btn { font-size: 0.7rem; font-family: var(--font-mono); min-width: 52px; color: #e2c78a; border-color: var(--border-light); }
 
 
 
 
 
 
 
 
 
984
 
985
+ .input-box {
986
+ background: var(--bg-secondary);
987
+ border: 1px solid var(--border);
988
+ border-radius: var(--radius-xl);
989
+ display: flex;
990
+ align-items: flex-end;
991
+ padding: 10px 12px 10px 16px;
992
+ gap: 8px;
993
+ transition: border-color 0.15s, box-shadow 0.15s;
 
 
 
 
994
  }
995
 
996
+ .input-box:focus-within {
997
+ border-color: rgba(124,58,237,0.5);
998
+ box-shadow: 0 0 0 3px var(--accent-glow);
 
 
 
 
 
 
999
  }
1000
 
1001
+ .input-box textarea {
1002
+ flex: 1;
1003
  background: transparent;
1004
+ border: none;
1005
+ outline: none;
1006
+ color: var(--text-primary);
1007
+ font-family: var(--font-sans);
1008
+ font-size: 0.925rem;
1009
+ line-height: 1.6;
 
 
 
 
 
 
 
 
 
 
 
1010
  resize: none;
1011
+ min-height: 24px;
1012
+ max-height: 180px;
1013
+ overflow-y: auto;
1014
+ scrollbar-width: thin;
 
 
 
 
 
 
1015
  }
1016
 
1017
+ .input-box textarea::placeholder { color: var(--text-muted); }
1018
+ .input-box textarea:disabled { opacity: 0.6; }
 
 
 
 
1019
 
1020
+ .input-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
 
 
1021
 
1022
+ .action-icon-btn {
1023
+ width: 32px;
1024
+ height: 32px;
1025
+ background: transparent;
1026
+ border: 1px solid transparent;
1027
+ color: var(--text-muted);
1028
+ cursor: pointer;
1029
+ border-radius: var(--radius-sm);
1030
  display: flex;
 
1031
  align-items: center;
1032
+ justify-content: center;
1033
+ font-size: 0.9rem;
1034
+ font-weight: 700;
1035
+ transition: background 0.12s, color 0.12s, border-color 0.12s;
1036
  }
1037
 
1038
+ .action-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
1039
+ .action-icon-btn--active { background: var(--accent-light); color: #a78bfa; border-color: rgba(124,58,237,0.3); }
1040
+
1041
  .model-toggle-btn {
1042
+ height: 32px;
1043
+ padding: 0 10px;
1044
+ background: var(--bg-tertiary);
1045
+ border: 1px solid var(--border);
1046
+ color: var(--text-secondary);
1047
  cursor: pointer;
1048
+ border-radius: var(--radius-sm);
1049
+ font-size: 0.72rem;
1050
  font-weight: 700;
1051
+ font-family: var(--font-mono);
1052
  letter-spacing: 0.04em;
1053
+ transition: background 0.12s, color 0.12s, border-color 0.12s;
1054
+ white-space: nowrap;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1055
  }
1056
 
1057
+ .model-toggle-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1058
 
1059
+ .model-toggle-btn--r1 {
1060
+ background: linear-gradient(135deg, #1a1040 0%, #1e1450 100%);
1061
+ color: #a78bfa;
1062
+ border-color: rgba(124,58,237,0.4);
1063
  }
1064
 
1065
+ .model-toggle-btn--r1:hover:not(:disabled) {
1066
+ background: linear-gradient(135deg, #1e1450 0%, #231860 100%);
1067
+ border-color: rgba(124,58,237,0.6);
1068
  }
1069
 
1070
+ .model-toggle-btn:disabled { opacity: 0.4; cursor: not-allowed; }
 
 
 
 
1071
 
1072
  .send-btn {
1073
+ width: 34px;
1074
+ height: 34px;
1075
+ background: var(--accent);
1076
  border: none;
1077
+ color: #fff;
1078
+ border-radius: 50%;
1079
  cursor: pointer;
 
 
 
 
1080
  display: flex;
1081
  align-items: center;
1082
+ justify-content: center;
1083
+ transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
1084
+ flex-shrink: 0;
1085
+ box-shadow: 0 2px 8px var(--accent-glow);
1086
  }
1087
 
1088
+ .send-btn:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 4px 12px var(--accent-glow); }
1089
+ .send-btn:active:not(:disabled) { transform: scale(0.95); }
1090
+ .send-btn:disabled { background: var(--bg-hover); color: var(--text-muted); cursor: not-allowed; box-shadow: none; }
 
1091
 
1092
+ .input-footer {
1093
+ text-align: center;
1094
+ font-size: 0.7rem;
1095
+ color: var(--text-muted);
1096
+ margin-top: 6px;
1097
+ opacity: 0.7;
1098
  }
1099
 
1100
+ /* ====== Login page (keep old classes for compatibility) ====== */
 
 
 
 
 
1101
 
1102
+ .login-page {
 
1103
  display: flex;
 
 
1104
  height: 100vh;
1105
+ background: var(--bg-primary);
1106
+ align-items: center;
1107
+ justify-content: center;
1108
+ padding: 1.5rem;
 
 
1109
  }
1110
 
1111
+ .login-card {
 
 
 
 
1112
  width: 100%;
1113
+ max-width: 400px;
1114
+ background: var(--bg-secondary);
1115
+ border: 1px solid var(--border);
1116
+ border-radius: var(--radius-xl);
1117
+ padding: 2.5rem 2rem;
1118
+ box-shadow: 0 8px 40px rgba(0,0,0,0.5);
1119
  }
1120
 
1121
+ .login-brand { text-align: center; margin-bottom: 2rem; }
 
 
 
 
 
1122
 
1123
+ .login-logo {
1124
+ font-size: 3rem;
1125
+ font-weight: 800;
1126
+ letter-spacing: -0.04em;
1127
+ color: var(--text-primary);
1128
+ display: block;
1129
+ margin-bottom: 6px;
1130
  }
1131
 
1132
+ .login-tagline { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.04em; }
 
 
 
 
 
 
 
 
 
 
1133
 
1134
+ .login-form { display: flex; flex-direction: column; gap: 14px; }
 
 
 
1135
 
1136
+ .form-field { display: flex; flex-direction: column; gap: 5px; }
 
 
 
 
1137
 
1138
+ .form-field label { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); }
 
 
 
 
1139
 
1140
+ .form-field input {
1141
+ padding: 10px 14px;
1142
+ background: var(--bg-tertiary);
1143
+ border: 1px solid var(--border);
1144
+ border-radius: var(--radius);
1145
+ color: var(--text-primary);
1146
+ font-size: 0.925rem;
1147
+ font-family: var(--font-sans);
 
 
 
 
 
 
 
 
 
 
 
1148
  outline: none;
1149
+ transition: border-color 0.15s, box-shadow 0.15s;
 
 
1150
  }
1151
 
1152
+ .form-field input:focus { border-color: rgba(124,58,237,0.5); box-shadow: 0 0 0 3px var(--accent-glow); }
1153
+ .form-field input::placeholder { color: var(--text-muted); }
 
1154
 
1155
+ .login-error {
1156
+ background: var(--error-bg);
1157
+ border: 1px solid rgba(239,68,68,0.3);
1158
+ color: #fca5a5;
1159
+ padding: 10px 14px;
1160
+ border-radius: var(--radius);
1161
+ font-size: 0.87rem;
1162
  text-align: center;
 
1163
  }
1164
 
1165
+ .login-submit-btn {
1166
+ padding: 11px;
1167
+ background: var(--accent);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1168
  border: none;
1169
+ border-radius: var(--radius);
1170
+ color: #fff;
1171
  font-size: 0.9rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1172
  font-weight: 600;
1173
+ font-family: var(--font-sans);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1174
  cursor: pointer;
1175
+ transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
1176
+ margin-top: 4px;
1177
+ box-shadow: 0 2px 10px var(--accent-glow);
 
1178
  }
1179
 
1180
+ .login-submit-btn:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 4px 16px var(--accent-glow); }
1181
+ .login-submit-btn:active:not(:disabled) { transform: scale(0.98); }
1182
+ .login-submit-btn:disabled { background: var(--bg-hover); color: var(--text-muted); cursor: not-allowed; box-shadow: none; }
 
 
 
1183
 
1184
+ .login-saying { margin-top: 1.75rem; text-align: center; font-size: 0.75rem; color: var(--text-muted); font-style: italic; opacity: 0.7; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1185
 
1186
+ /* ====== SCROLLBAR ====== */
1187
+ * { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
1188
+ *::-webkit-scrollbar { width: 5px; height: 5px; }
1189
+ *::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
1190
+ *::-webkit-scrollbar-thumb:hover { background: var(--border-light); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
web/src/App.tsx CHANGED
@@ -242,6 +242,13 @@ interface User {
242
  name: string;
243
  }
244
 
 
 
 
 
 
 
 
245
  const GATEWAY_URL = import.meta.env.VITE_GATEWAY_URL || 'https://deepthoughtai-evo-gateway.hf.space';
246
  console.log('App Gateway URL:', GATEWAY_URL); // Debug log
247
 
@@ -257,10 +264,20 @@ function App() {
257
  const [activeSymbolCategory, setActiveSymbolCategory] = useState('greek');
258
  const [showMathSymbols, setShowMathSymbols] = useState(false);
259
  const [selectedModel, setSelectedModel] = useState<string>('deepseek-chat');
 
 
 
 
 
 
 
 
 
 
260
 
261
  const AVAILABLE_MODELS = [
262
- { id: 'deepseek-chat', label: 'V3', title: 'DeepSeek V3 (fast)' },
263
- { id: 'deepseek-reasoner', label: 'R1', title: 'DeepSeek R1 (deep reasoning)' },
264
  ];
265
 
266
  const toggleModel = () => {
@@ -271,6 +288,7 @@ function App() {
271
  const messagesEndRef = useRef<HTMLDivElement>(null);
272
  const messagesContainerRef = useRef<HTMLDivElement>(null);
273
  const abortControllerRef = useRef<AbortController | null>(null);
 
274
 
275
  // Logout on page close or refresh
276
  useEffect(() => {
@@ -297,6 +315,13 @@ function App() {
297
  };
298
  }, [sessionId]);
299
 
 
 
 
 
 
 
 
300
 
301
  const handleSendMessage = async () => {
302
  if (!input.trim() || isLoading) return;
@@ -607,7 +632,66 @@ function App() {
607
  };
608
 
609
  const insertSymbol = (symbol: string) => {
610
- setInput((prev) => prev + symbol);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
611
  };
612
 
613
  const copyAsMarkdown = (content: string, event: React.MouseEvent) => {
@@ -682,6 +766,11 @@ function App() {
682
  };
683
 
684
  const handleNewChat = async () => {
 
 
 
 
 
685
  // Cancel any ongoing request
686
  if (abortControllerRef.current) {
687
  abortControllerRef.current.abort();
@@ -710,6 +799,7 @@ function App() {
710
 
711
  // Clear frontend state
712
  setMessages([]);
 
713
  setInput('');
714
  setIsLoading(false);
715
  setResponseComplete(false);
@@ -744,621 +834,542 @@ function App() {
744
 
745
  return (
746
  <div className="app">
747
- <header className="header">
748
- <div className="header-left">
749
- <h1 className="logo-text">evo</h1>
750
- <span className="version">v1.0</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
751
  </div>
752
- <div className="header-right">
753
- <button
754
- className="new-chat-btn"
755
- onClick={handleNewChat}
756
- style={{ marginRight: '1rem' }}
757
- >
758
- New Chat
 
 
 
759
  </button>
760
- <span className="user-info">👤 {user?.name}</span>
761
- <button className="logout-btn" onClick={handleLogout}>
762
- Logout
 
 
 
 
763
  </button>
764
  </div>
765
- </header>
766
- <div className="chat-container">
767
  <div className="messages" ref={messagesContainerRef}>
768
- {messages.map((message) => {
769
- // Don't render empty assistant messages while loading
770
- // Note: must also check reasoningContent so R1 reasoning is shown immediately
771
- if (message.role === 'assistant' && !message.content && !message.reasoningContent && (!message.toolCalls || message.toolCalls.length === 0)) {
772
- return null;
773
- }
774
-
775
- return (
776
- <div key={message.id} className={`message message-${message.role}`}>
777
- <div className="message-header">
778
- <span className="message-role">
779
- {message.role === 'user' ? 'You' : 'Assistant'}
780
- </span>
781
- <div className="message-header-right">
782
- {message.role === 'assistant' && (
783
- <button
784
- className="copy-markdown-btn"
785
- onClick={(e) => copyEverything(message, e)}
786
- title="Copy everything (including expanders)"
787
- >
788
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
789
- <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
790
- <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
791
- <circle cx="11.5" cy="11.5" r="1.5" fill="currentColor"></circle>
792
- <circle cx="16.5" cy="11.5" r="1.5" fill="currentColor"></circle>
793
- <circle cx="11.5" cy="16.5" r="1.5" fill="currentColor"></circle>
794
- <circle cx="16.5" cy="16.5" r="1.5" fill="currentColor"></circle>
795
- </svg>
796
- </button>
797
- )}
798
- <button
799
- className="copy-markdown-btn"
800
- onClick={(e) => copyAsMarkdown(message.content, e)}
801
- title="Copy as markdown"
802
- >
803
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
804
- <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
805
- <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
806
- </svg>
807
- </button>
808
- <span className="message-time">
809
- {message.timestamp.toLocaleTimeString()}
810
- </span>
811
- </div>
812
  </div>
813
- {/* Final response content */}
814
- {message.content && (
815
- <div className="message-content">
816
- {message.role === 'assistant' && message.isStreaming ? (
817
- (() => {
818
- const { safe, tail } = splitStreamingContent(message.content);
819
- return (
820
- <>
821
- {safe && (
822
- <ReactMarkdown
823
- remarkPlugins={[
824
- [remarkMath, { singleDollarTextMath: true }],
825
- remarkGfm
826
- ]}
827
- rehypePlugins={[[rehypeKatex, { throwOnError: false, strict: false }]]}
828
- urlTransform={allowDataImageUrl}
829
- components={{
830
- code({ className, children, ...props }: any) {
831
- const match = /language-(\w+)/.exec(className || '');
832
- return match ? (
833
- <SyntaxHighlighter
834
- style={terminalTheme as any}
835
- language={match[1]}
836
- PreTag="div"
837
- {...props}
838
- >
839
- {String(children).replace(/\n$/, '')}
840
- </SyntaxHighlighter>
841
- ) : (
842
- <code className={className} {...props}>
843
- {children}
844
- </code>
845
- );
846
- },
847
- img({ src, alt, ...props }: any) {
848
- return <PlotImage src={src} alt={alt} {...props} />;
849
- },
850
- }}
851
- >
852
- {preprocessMathContent(safe)}
853
- </ReactMarkdown>
854
- )}
855
- {tail && <div className="streaming-content">{tail}</div>}
856
- </>
857
- );
858
- })()
859
- ) : (
860
- <ReactMarkdown
861
- remarkPlugins={[
862
- [remarkMath, { singleDollarTextMath: true }],
863
- remarkGfm
864
- ]}
865
- rehypePlugins={[[rehypeKatex, { throwOnError: false, strict: false }]]}
866
- urlTransform={allowDataImageUrl}
867
- components={{
868
- code({ className, children, ...props }: any) {
869
- const match = /language-(\w+)/.exec(className || '');
870
- return match ? (
871
- <SyntaxHighlighter
872
- style={terminalTheme as any}
873
- language={match[1]}
874
- PreTag="div"
875
- {...props}
876
- >
877
- {String(children).replace(/\n$/, '')}
878
- </SyntaxHighlighter>
879
- ) : (
880
- <code className={className} {...props}>
881
- {children}
882
- </code>
883
- );
884
- },
885
- img({ src, alt, ...props }: any) {
886
- return <PlotImage src={src} alt={alt} {...props} />;
887
- },
888
- }}
889
- >
890
- {preprocessMathContent(message.content)}
891
- </ReactMarkdown>
892
- )}
893
- </div>
894
- )}
895
- {/* Reasoning trace from deepseek-reasoner model */}
896
- {message.reasoningContent && (
897
- <details
898
- className={`reasoning-trace${message.isStreaming ? ' reasoning-streaming' : ''}`}
899
- open={message.reasoningExpanded}
900
- onToggle={(e) => {
901
- const open = (e.currentTarget as HTMLDetailsElement).open;
902
- setMessages((prev) =>
903
- prev.map((m) =>
904
- m.id === message.id ? { ...m, reasoningExpanded: open } : m
905
- )
906
- );
907
- }}
908
- >
909
- <summary className="reasoning-header">
910
- <span className="reasoning-icon"></span>
911
- <span>Reasoning</span>
912
- {message.isStreaming && (
913
- <span className="reasoning-live-indicator">
914
- <span className="reasoning-live-dot" />
915
- <span className="reasoning-live-dot" />
916
- <span className="reasoning-live-dot" />
917
- </span>
918
  )}
919
- </summary>
920
- <div
921
- className="reasoning-content"
922
- ref={(el) => { if (el && message.isStreaming) el.scrollTop = el.scrollHeight; }}
923
- >
924
- {message.reasoningContent}
925
  </div>
926
- </details>
927
- )}
928
- {/* Tool calls - unchanged from original */}
929
- {message.toolCalls && message.toolCalls.length > 0 && (
930
- <div className="tool-calls">
931
- {message.toolCalls.map((tool, idx) => (
932
- <details key={idx} className="tool-call">
933
- <summary className="tool-call-header">
934
- <span className="tool-name">{tool.name}</span>
935
- {tool.isGenerating && (
936
- <span className="tool-status generating">
937
- <span className="dot"></span>
938
- <span className="dot"></span>
939
- <span className="dot"></span>
940
- <span className="status-text">Generating...</span>
941
- </span>
942
- )}
943
- {tool.isExecuting && (
944
- <span className="tool-status executing">
945
- <span className="dot"></span>
946
- <span className="dot"></span>
947
- <span className="dot"></span>
948
- <span className="status-text">Executing...</span>
949
- </span>
950
- )}
951
- {tool.output && !tool.isGenerating && !tool.isExecuting && (
952
- tool.error ? (
953
- <span className="crossmark">✗</span>
954
- ) : (
955
- <span className="checkmark">✓</span>
956
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
957
  )}
958
- </summary>
959
- <div className="tool-call-content">
960
- <details className="tool-section">
961
- <summary className="tool-section-label">Input:</summary>
962
- <pre className="tool-code tool-input-scroll">{tool.input}</pre>
963
- </details>
964
- {tool.output && (
965
- <div className="tool-section">
966
- <div className="tool-section-label">Output:</div>
967
- <div className="tool-output">
968
- <ReactMarkdown
969
- remarkPlugins={[
970
- [remarkMath, { singleDollarTextMath: true }],
971
- remarkGfm
972
- ]}
973
- rehypePlugins={[[rehypeKatex, { throwOnError: false, strict: false }]]}
974
- urlTransform={allowDataImageUrl}
975
- components={{
976
- code({ className, children, ...props }: any) {
977
- const match = /language-(\w+)/.exec(className || '');
978
- return match ? (
979
- <SyntaxHighlighter
980
- style={terminalTheme as any}
981
- language={match[1]}
982
- PreTag="div"
983
- {...props}
984
- >
985
- {String(children).replace(/\n$/, '')}
986
- </SyntaxHighlighter>
987
- ) : (
988
- <code className={className} {...props}>
989
- {children}
990
- </code>
991
- );
992
- },
993
- img({ src, alt, ...props }: any) {
994
- return <PlotImage src={src} alt={alt} {...props} />;
995
- },
996
- }}
997
- >
998
- {preprocessMathContent(tool.output)}
999
- </ReactMarkdown>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1000
  </div>
1001
- </div>
1002
- )}
1003
  </div>
1004
- </details>
1005
- ))}
1006
  </div>
1007
- )}
1008
- </div>
1009
- );
1010
- })}
1011
- {/* Only show spinner if loading AND response is not complete AND no content yet in the last message */}
1012
  {isLoading && !responseComplete && (
1013
  <div className="typing-indicator">
1014
- <span></span>
1015
- <span></span>
1016
- <span></span>
1017
- <em className="status-message">{statusMessage || 'Thinking...'}</em>
 
 
 
 
 
1018
  </div>
1019
  )}
1020
  <div ref={messagesEndRef} />
1021
  </div>
1022
-
1023
- {/* Math Symbols Popup Modal */}
1024
- {showMathSymbols && (
1025
- <div className="math-symbols-popup">
1026
- <div className="math-symbols-popup-content">
1027
- <div className="math-symbols-popup-header">
1028
- <span>📐 Math Symbols</span>
1029
- <button
1030
- className="math-symbols-close-btn"
1031
- onClick={() => setShowMathSymbols(false)}
1032
- aria-label="Close"
1033
- >
1034
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
1035
- <line x1="18" y1="6" x2="6" y2="18"></line>
1036
- <line x1="6" y1="6" x2="18" y2="18"></line>
1037
- </svg>
1038
- </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1039
  </div>
1040
- <div className="math-symbols">
1041
- <div className="symbol-tabs">
1042
- <button
1043
- onClick={() => setActiveSymbolCategory('greek')}
1044
- className={`symbol-tab ${activeSymbolCategory === 'greek' ? 'active' : ''}`}
1045
- >
1046
- Greek
1047
- </button>
1048
- <button
1049
- onClick={() => setActiveSymbolCategory('operators')}
1050
- className={`symbol-tab ${activeSymbolCategory === 'operators' ? 'active' : ''}`}
1051
- >
1052
- Operators
1053
- </button>
1054
- <button
1055
- onClick={() => setActiveSymbolCategory('relations')}
1056
- className={`symbol-tab ${activeSymbolCategory === 'relations' ? 'active' : ''}`}
1057
- >
1058
- Relations
1059
- </button>
1060
- <button
1061
- onClick={() => setActiveSymbolCategory('sets')}
1062
- className={`symbol-tab ${activeSymbolCategory === 'sets' ? 'active' : ''}`}
1063
- >
1064
- Sets
1065
- </button>
1066
- <button
1067
- onClick={() => setActiveSymbolCategory('logic')}
1068
- className={`symbol-tab ${activeSymbolCategory === 'logic' ? 'active' : ''}`}
1069
- >
1070
- Logic
1071
- </button>
1072
- <button
1073
- onClick={() => setActiveSymbolCategory('arrows')}
1074
- className={`symbol-tab ${activeSymbolCategory === 'arrows' ? 'active' : ''}`}
1075
- >
1076
- Arrows
1077
- </button>
1078
- <button
1079
- onClick={() => setActiveSymbolCategory('special')}
1080
- className={`symbol-tab ${activeSymbolCategory === 'special' ? 'active' : ''}`}
1081
- >
1082
- Special
1083
- </button>
1084
- <button
1085
- onClick={() => setActiveSymbolCategory('calculus')}
1086
- className={`symbol-tab ${activeSymbolCategory === 'calculus' ? 'active' : ''}`}
1087
- >
1088
- Calculus
1089
- </button>
1090
- <button
1091
- onClick={() => setActiveSymbolCategory('linear')}
1092
- className={`symbol-tab ${activeSymbolCategory === 'linear' ? 'active' : ''}`}
1093
  >
1094
- Linear Algebra
1095
  </button>
1096
- <button
1097
- onClick={() => setActiveSymbolCategory('equations')}
1098
- className={`symbol-tab ${activeSymbolCategory === 'equations' ? 'active' : ''}`}
 
 
1099
  >
1100
- Equations
1101
  </button>
1102
- <button
1103
- onClick={() => setActiveSymbolCategory('matrices')}
1104
- className={`symbol-tab ${activeSymbolCategory === 'matrices' ? 'active' : ''}`}
 
 
1105
  >
1106
- Matrices
 
 
1107
  </button>
1108
  </div>
1109
- <div className="symbol-content">
1110
- {activeSymbolCategory === 'greek' && (
1111
- <div className="symbol-category">
1112
- <div className="symbol-row">
1113
- <button onClick={() => insertSymbol('\\alpha ')} className="symbol-btn" title="alpha">α</button>
1114
- <button onClick={() => insertSymbol('\\beta ')} className="symbol-btn" title="beta">β</button>
1115
- <button onClick={() => insertSymbol('\\gamma ')} className="symbol-btn" title="gamma">γ</button>
1116
- <button onClick={() => insertSymbol('\\delta ')} className="symbol-btn" title="delta">δ</button>
1117
- <button onClick={() => insertSymbol('\\epsilon ')} className="symbol-btn" title="epsilon">ε</button>
1118
- <button onClick={() => insertSymbol('\\theta ')} className="symbol-btn" title="theta">θ</button>
1119
- <button onClick={() => insertSymbol('\\lambda ')} className="symbol-btn" title="lambda">λ</button>
1120
- <button onClick={() => insertSymbol('\\mu ')} className="symbol-btn" title="mu">μ</button>
1121
- <button onClick={() => insertSymbol('\\pi ')} className="symbol-btn" title="pi">π</button>
1122
- <button onClick={() => insertSymbol('\\sigma ')} className="symbol-btn" title="sigma">σ</button>
1123
- <button onClick={() => insertSymbol('\\phi ')} className="symbol-btn" title="phi">φ</button>
1124
- <button onClick={() => insertSymbol('\\omega ')} className="symbol-btn" title="omega">ω</button>
1125
- </div>
1126
- <div className="symbol-row">
1127
- <button onClick={() => insertSymbol('\\Gamma ')} className="symbol-btn" title="Gamma">Γ</button>
1128
- <button onClick={() => insertSymbol('\\Delta ')} className="symbol-btn" title="Delta">Δ</button>
1129
- <button onClick={() => insertSymbol('\\Theta ')} className="symbol-btn" title="Theta">Θ</button>
1130
- <button onClick={() => insertSymbol('\\Lambda ')} className="symbol-btn" title="Lambda">Λ</button>
1131
- <button onClick={() => insertSymbol('\\Pi ')} className="symbol-btn" title="Pi">Π</button>
1132
- <button onClick={() => insertSymbol('\\Sigma ')} className="symbol-btn" title="Sigma">Σ</button>
1133
- <button onClick={() => insertSymbol('\\Phi ')} className="symbol-btn" title="Phi">Φ</button>
1134
- <button onClick={() => insertSymbol('\\Omega ')} className="symbol-btn" title="Omega">Ω</button>
1135
- </div>
1136
- </div>
1137
- )}
1138
- {activeSymbolCategory === 'operators' && (
1139
- <div className="symbol-category">
1140
- <div className="symbol-row">
1141
- <button onClick={() => insertSymbol('\\sum ')} className="symbol-btn" title="sum">∑</button>
1142
- <button onClick={() => insertSymbol('\\prod ')} className="symbol-btn" title="product">∏</button>
1143
- <button onClick={() => insertSymbol('\\int ')} className="symbol-btn" title="integral">∫</button>
1144
- <button onClick={() => insertSymbol('\\iint ')} className="symbol-btn" title="double integral">∬</button>
1145
- <button onClick={() => insertSymbol('\\oint ')} className="symbol-btn" title="contour integral">∮</button>
1146
- <button onClick={() => insertSymbol('\\partial ')} className="symbol-btn" title="partial">∂</button>
1147
- <button onClick={() => insertSymbol('\\nabla ')} className="symbol-btn" title="nabla">∇</button>
1148
- <button onClick={() => insertSymbol('\\sqrt{} ')} className="symbol-btn" title="square root">√</button>
1149
- <button onClick={() => insertSymbol('\\pm ')} className="symbol-btn" title="plus-minus">±</button>
1150
- <button onClick={() => insertSymbol('\\mp ')} className="symbol-btn" title="minus-plus">∓</button>
1151
- <button onClick={() => insertSymbol('\\times ')} className="symbol-btn" title="times">×</button>
1152
- <button onClick={() => insertSymbol('\\div ')} className="symbol-btn" title="divide">÷</button>
1153
- <button onClick={() => insertSymbol('\\cdot ')} className="symbol-btn" title="dot">·</button>
1154
- <button onClick={() => insertSymbol('\\ast ')} className="symbol-btn" title="asterisk">∗</button>
1155
- </div>
1156
- </div>
1157
- )}
1158
- {activeSymbolCategory === 'relations' && (
1159
- <div className="symbol-category">
1160
- <div className="symbol-row">
1161
- <button onClick={() => insertSymbol('\\leq ')} className="symbol-btn" title="less or equal">≤</button>
1162
- <button onClick={() => insertSymbol('\\geq ')} className="symbol-btn" title="greater or equal">≥</button>
1163
- <button onClick={() => insertSymbol('\\neq ')} className="symbol-btn" title="not equal">≠</button>
1164
- <button onClick={() => insertSymbol('\\approx ')} className="symbol-btn" title="approximately">≈</button>
1165
- <button onClick={() => insertSymbol('\\equiv ')} className="symbol-btn" title="equivalent">≡</button>
1166
- <button onClick={() => insertSymbol('\\sim ')} className="symbol-btn" title="similar">∼</button>
1167
- <button onClick={() => insertSymbol('\\simeq ')} className="symbol-btn" title="similar or equal">≃</button>
1168
- <button onClick={() => insertSymbol('\\cong ')} className="symbol-btn" title="congruent">≅</button>
1169
- <button onClick={() => insertSymbol('\\propto ')} className="symbol-btn" title="proportional">∝</button>
1170
- <button onClick={() => insertSymbol('\\ll ')} className="symbol-btn" title="much less">≪</button>
1171
- <button onClick={() => insertSymbol('\\gg ')} className="symbol-btn" title="much greater">≫</button>
1172
- </div>
1173
- </div>
1174
- )}
1175
- {activeSymbolCategory === 'sets' && (
1176
- <div className="symbol-category">
1177
- <div className="symbol-row">
1178
- <button onClick={() => insertSymbol('\\in ')} className="symbol-btn" title="element of">��</button>
1179
- <button onClick={() => insertSymbol('\\notin ')} className="symbol-btn" title="not element of">∉</button>
1180
- <button onClick={() => insertSymbol('\\subset ')} className="symbol-btn" title="subset">⊂</button>
1181
- <button onClick={() => insertSymbol('\\subseteq ')} className="symbol-btn" title="subset or equal">⊆</button>
1182
- <button onClick={() => insertSymbol('\\supset ')} className="symbol-btn" title="superset">⊃</button>
1183
- <button onClick={() => insertSymbol('\\supseteq ')} className="symbol-btn" title="superset or equal">⊇</button>
1184
- <button onClick={() => insertSymbol('\\cup ')} className="symbol-btn" title="union">∪</button>
1185
- <button onClick={() => insertSymbol('\\cap ')} className="symbol-btn" title="intersection">∩</button>
1186
- <button onClick={() => insertSymbol('\\emptyset ')} className="symbol-btn" title="empty set">∅</button>
1187
- <button onClick={() => insertSymbol('\\setminus ')} className="symbol-btn" title="set minus">\</button>
1188
- </div>
1189
- </div>
1190
- )}
1191
- {activeSymbolCategory === 'logic' && (
1192
- <div className="symbol-category">
1193
- <div className="symbol-row">
1194
- <button onClick={() => insertSymbol('\\forall ')} className="symbol-btn" title="for all">∀</button>
1195
- <button onClick={() => insertSymbol('\\exists ')} className="symbol-btn" title="exists">∃</button>
1196
- <button onClick={() => insertSymbol('\\nexists ')} className="symbol-btn" title="not exists">∄</button>
1197
- <button onClick={() => insertSymbol('\\land ')} className="symbol-btn" title="and">∧</button>
1198
- <button onClick={() => insertSymbol('\\lor ')} className="symbol-btn" title="or">∨</button>
1199
- <button onClick={() => insertSymbol('\\neg ')} className="symbol-btn" title="not">¬</button>
1200
- <button onClick={() => insertSymbol('\\implies ')} className="symbol-btn" title="implies">⟹</button>
1201
- <button onClick={() => insertSymbol('\\iff ')} className="symbol-btn" title="if and only if">⟺</button>
1202
- <button onClick={() => insertSymbol('\\vdash ')} className="symbol-btn" title="proves">⊢</button>
1203
- <button onClick={() => insertSymbol('\\models ')} className="symbol-btn" title="models">⊨</button>
1204
- </div>
1205
- </div>
1206
- )}
1207
- {activeSymbolCategory === 'arrows' && (
1208
- <div className="symbol-category">
1209
- <div className="symbol-row">
1210
- <button onClick={() => insertSymbol('\\to ')} className="symbol-btn" title="right arrow">→</button>
1211
- <button onClick={() => insertSymbol('\\rightarrow ')} className="symbol-btn" title="right arrow">→</button>
1212
- <button onClick={() => insertSymbol('\\leftarrow ')} className="symbol-btn" title="left arrow">←</button>
1213
- <button onClick={() => insertSymbol('\\leftrightarrow ')} className="symbol-btn" title="left-right arrow">↔</button>
1214
- <button onClick={() => insertSymbol('\\Rightarrow ')} className="symbol-btn" title="double right arrow">⇒</button>
1215
- <button onClick={() => insertSymbol('\\Leftarrow ')} className="symbol-btn" title="double left arrow">⇐</button>
1216
- <button onClick={() => insertSymbol('\\Leftrightarrow ')} className="symbol-btn" title="double left-right arrow">⇔</button>
1217
- <button onClick={() => insertSymbol('\\mapsto ')} className="symbol-btn" title="maps to">↦</button>
1218
- <button onClick={() => insertSymbol('\\uparrow ')} className="symbol-btn" title="up arrow">↑</button>
1219
- <button onClick={() => insertSymbol('\\downarrow ')} className="symbol-btn" title="down arrow">↓</button>
1220
- </div>
1221
- </div>
1222
- )}
1223
- {activeSymbolCategory === 'special' && (
1224
- <div className="symbol-category">
1225
- <div className="symbol-row">
1226
- <button onClick={() => insertSymbol('\\mathbb{R} ')} className="symbol-btn" title="real numbers">ℝ</button>
1227
- <button onClick={() => insertSymbol('\\mathbb{C} ')} className="symbol-btn" title="complex numbers">ℂ</button>
1228
- <button onClick={() => insertSymbol('\\mathbb{N} ')} className="symbol-btn" title="natural numbers">ℕ</button>
1229
- <button onClick={() => insertSymbol('\\mathbb{Z} ')} className="symbol-btn" title="integers">ℤ</button>
1230
- <button onClick={() => insertSymbol('\\mathbb{Q} ')} className="symbol-btn" title="rational numbers">ℚ</button>
1231
- <button onClick={() => insertSymbol('\\infty ')} className="symbol-btn" title="infinity">∞</button>
1232
- <button onClick={() => insertSymbol('\\aleph ')} className="symbol-btn" title="aleph">ℵ</button>
1233
- <button onClick={() => insertSymbol('\\hbar ')} className="symbol-btn" title="h-bar">ℏ</button>
1234
- <button onClick={() => insertSymbol('\\ell ')} className="symbol-btn" title="ell">ℓ</button>
1235
- </div>
1236
- <div className="symbol-row">
1237
- <button onClick={() => insertSymbol('\\langle \\rangle ')} className="symbol-btn" title="angle brackets">⟨⟩</button>
1238
- <button onClick={() => insertSymbol('\\lfloor \\rfloor ')} className="symbol-btn" title="floor">⌊⌋</button>
1239
- <button onClick={() => insertSymbol('\\lceil \\rceil ')} className="symbol-btn" title="ceiling">⌈⌉</button>
1240
- <button onClick={() => insertSymbol('\\{ \\} ')} className="symbol-btn" title="curly braces">{'{}'}</button>
1241
- <button onClick={() => insertSymbol('\\lVert \\rVert ')} className="symbol-btn" title="double bars">‖‖</button>
1242
- </div>
1243
- </div>
1244
- )}
1245
- {activeSymbolCategory === 'calculus' && (
1246
- <div className="symbol-category">
1247
- <div className="symbol-row">
1248
- <button onClick={() => insertSymbol('\\lim ')} className="symbol-btn" title="limit">lim</button>
1249
- <button onClick={() => insertSymbol('\\sup ')} className="symbol-btn" title="supremum">sup</button>
1250
- <button onClick={() => insertSymbol('\\inf ')} className="symbol-btn" title="infimum">inf</button>
1251
- <button onClick={() => insertSymbol('\\max ')} className="symbol-btn" title="maximum">max</button>
1252
- <button onClick={() => insertSymbol('\\min ')} className="symbol-btn" title="minimum">min</button>
1253
- <button onClick={() => insertSymbol('\\frac{}{} ')} className="symbol-btn" title="fraction">a/b</button>
1254
- <button onClick={() => insertSymbol('^{} ')} className="symbol-btn" title="superscript">x^n</button>
1255
- <button onClick={() => insertSymbol('_{} ')} className="symbol-btn" title="subscript">x_n</button>
1256
- </div>
1257
- </div>
1258
- )}
1259
- {activeSymbolCategory === 'linear' && (
1260
- <div className="symbol-category">
1261
- <div className="symbol-row">
1262
- <button onClick={() => insertSymbol('\\oplus ')} className="symbol-btn" title="direct sum">⊕</button>
1263
- <button onClick={() => insertSymbol('\\otimes ')} className="symbol-btn" title="tensor product">⊗</button>
1264
- <button onClick={() => insertSymbol('\\odot ')} className="symbol-btn" title="dot product">⊙</button>
1265
- <button onClick={() => insertSymbol('\\circ ')} className="symbol-btn" title="composition">∘</button>
1266
- <button onClick={() => insertSymbol('\\perp ')} className="symbol-btn" title="perpendicular">⊥</button>
1267
- <button onClick={() => insertSymbol('\\parallel ')} className="symbol-btn" title="parallel">∥</button>
1268
- <button onClick={() => insertSymbol('\\det ')} className="symbol-btn" title="determinant">det</button>
1269
- <button onClick={() => insertSymbol('\\dim ')} className="symbol-btn" title="dimension">dim</button>
1270
- </div>
1271
- </div>
1272
- )}
1273
- {activeSymbolCategory === 'equations' && (
1274
- <div className="symbol-category">
1275
- <div className="symbol-row">
1276
- <button onClick={() => insertSymbol('$ $')} className="symbol-btn template-btn" title="Inline equation: $ E = mc^2 $">$...$</button>
1277
- <button onClick={() => insertSymbol('$$\n \n$$')} className="symbol-btn template-btn" title="Display equation: $$ \\int_0^1 x^2 dx = \\frac{1}{3} $$">$$...$$</button>
1278
- <button onClick={() => insertSymbol('\\begin{align}\n & = \\\\\n & = \n\\end{align}')} className="symbol-btn template-btn" title="Aligned equations with alignment at = sign">align</button>
1279
- <button onClick={() => insertSymbol('\\begin{cases}\n & \\text{if } \\\\\n & \\text{if } \n\\end{cases}')} className="symbol-btn template-btn" title="Piecewise: f(x) = { x^2 if x ≥ 0, -x if x < 0 }">cases</button>
1280
- <button onClick={() => insertSymbol('\\begin{equation}\n \n\\end{equation}')} className="symbol-btn template-btn" title="Numbered equation with automatic numbering">equation</button>
1281
- <button onClick={() => insertSymbol('\\begin{aligned}\n & \\\\\n & \n\\end{aligned}')} className="symbol-btn template-btn" title="Multi-line derivation with alignment">aligned</button>
1282
- </div>
1283
- <div className="symbol-row">
1284
- <button onClick={() => insertSymbol('\\begin{cases}\n a_1x + b_1y = c_1 \\\\\n a_2x + b_2y = c_2\n\\end{cases}')} className="symbol-btn template-btn" title="Example: { 2x + 3y = 5, x - y = 1 }">2 eq</button>
1285
- <button onClick={() => insertSymbol('\\begin{cases}\n a_1x + b_1y + c_1z = d_1 \\\\\n a_2x + b_2y + c_2z = d_2 \\\\\n a_3x + b_3y + c_3z = d_3\n\\end{cases}')} className="symbol-btn template-btn" title="Example: { x + y + z = 6, 2x - y + z = 3, x + 2y - z = 1 }">3 eq</button>
1286
- <button onClick={() => insertSymbol('\\left\\{\\begin{array}{l}\n \\\\\n \\\\\n \n\\end{array}\\right.')} className="symbol-btn template-btn" title="Custom system of n equations">system</button>
1287
- </div>
1288
- </div>
1289
- )}
1290
- {activeSymbolCategory === 'matrices' && (
1291
- <div className="symbol-category">
1292
- <div className="symbol-row">
1293
- <button onClick={() => insertSymbol('\\begin{matrix}\n a & b \\\\\n c & d\n\\end{matrix}')} className="symbol-btn template-btn" title="Plain matrix: a b / c d">2×2</button>
1294
- <button onClick={() => insertSymbol('\\begin{pmatrix}\n a & b \\\\\n c & d\n\\end{pmatrix}')} className="symbol-btn template-btn" title="Matrix with parentheses: ( 1 2 / 3 4 )">(2×2)</button>
1295
- <button onClick={() => insertSymbol('\\begin{bmatrix}\n a & b \\\\\n c & d\n\\end{bmatrix}')} className="symbol-btn template-btn" title="Matrix with brackets: [ 1 2 / 3 4 ]">[2×2]</button>
1296
- <button onClick={() => insertSymbol('\\begin{vmatrix}\n a & b \\\\\n c & d\n\\end{vmatrix}')} className="symbol-btn template-btn" title="Determinant: | 1 2 / 3 4 | = ad - bc">|2×2|</button>
1297
- </div>
1298
- <div className="symbol-row">
1299
- <button onClick={() => insertSymbol('\\begin{pmatrix}\n a & b & c \\\\\n d & e & f \\\\\n g & h & i\n\\end{pmatrix}')} className="symbol-btn template-btn" title="3×3 identity: ( 1 0 0 / 0 1 0 / 0 0 1 )">(3×3)</button>
1300
- <button onClick={() => insertSymbol('\\begin{bmatrix}\n a & b & c \\\\\n d & e & f \\\\\n g & h & i\n\\end{bmatrix}')} className="symbol-btn template-btn" title="3×3 with brackets: [ 1 2 3 / 4 5 6 / 7 8 9 ]">[3×3]</button>
1301
- <button onClick={() => insertSymbol('\\begin{vmatrix}\n a & b & c \\\\\n d & e & f \\\\\n g & h & i\n\\end{vmatrix}')} className="symbol-btn template-btn" title="3×3 determinant for calculating volume/area">|3×3|</button>
1302
- </div>
1303
- <div className="symbol-row">
1304
- <button onClick={() => insertSymbol('\\begin{pmatrix}\n x_1 \\\\\n x_2 \\\\\n x_3\n\\end{pmatrix}')} className="symbol-btn template-btn" title="Column vector: ( x / y / z )">col vec</button>
1305
- <button onClick={() => insertSymbol('\\begin{pmatrix} x_1 & x_2 & x_3 \\end{pmatrix}')} className="symbol-btn template-btn" title="Row vector: ( a b c )">row vec</button>
1306
- <button onClick={() => insertSymbol('\\begin{pmatrix}\n a_{11} & a_{12} & \\cdots & a_{1n} \\\\\n a_{21} & a_{22} & \\cdots & a_{2n} \\\\\n \\vdots & \\vdots & \\ddots & \\vdots \\\\\n a_{m1} & a_{m2} & \\cdots & a_{mn}\n\\end{pmatrix}')} className="symbol-btn template-btn" title="General matrix with m rows and n columns">m×n</button>
1307
- </div>
1308
- </div>
1309
- )}
1310
- </div>
1311
- </div>
1312
- </div>
1313
- </div>
1314
- )}
1315
-
1316
- {/* Input container */}
1317
- <div className="input-container">
1318
- <textarea
1319
- value={input}
1320
- onChange={(e) => setInput(e.target.value)}
1321
- onKeyPress={handleKeyPress}
1322
- placeholder="Enter your math problem..."
1323
- rows={3}
1324
- disabled={isLoading}
1325
- />
1326
- <div className="input-buttons">
1327
- <button
1328
- onClick={toggleModel}
1329
- className={`model-toggle-btn${selectedModel === 'deepseek-reasoner' ? ' model-toggle-btn--active' : ''}`}
1330
- title={AVAILABLE_MODELS.find(m => m.id === selectedModel)?.title}
1331
- disabled={isLoading}
1332
- >
1333
- {AVAILABLE_MODELS.find(m => m.id === selectedModel)?.label}
1334
- </button>
1335
- <button
1336
- onClick={() => setShowMathSymbols(!showMathSymbols)}
1337
- className="math-symbols-btn"
1338
- title="Math Symbols"
1339
- >
1340
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
1341
- <path d="M12 2L2 7l10 5 10-5-10-5z"/>
1342
- <path d="M2 17l10 5 10-5"/>
1343
- <path d="M2 12l10 5 10-5"/>
1344
- </svg>
1345
- Σ
1346
- </button>
1347
- <button
1348
- onClick={handleSendMessage}
1349
- disabled={isLoading || !input.trim()}
1350
- className="send-btn"
1351
- >
1352
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
1353
- <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
1354
- </svg>
1355
- Solve
1356
- </button>
1357
  </div>
 
1358
  </div>
1359
- </div>
1360
  </div>
1361
  );
1362
  }
1363
 
1364
- export default App;
 
242
  name: string;
243
  }
244
 
245
+ interface ConversationItem {
246
+ id: string;
247
+ title: string;
248
+ timestamp: Date;
249
+ messages: Message[];
250
+ }
251
+
252
  const GATEWAY_URL = import.meta.env.VITE_GATEWAY_URL || 'https://deepthoughtai-evo-gateway.hf.space';
253
  console.log('App Gateway URL:', GATEWAY_URL); // Debug log
254
 
 
264
  const [activeSymbolCategory, setActiveSymbolCategory] = useState('greek');
265
  const [showMathSymbols, setShowMathSymbols] = useState(false);
266
  const [selectedModel, setSelectedModel] = useState<string>('deepseek-chat');
267
+ const [sidebarOpen, setSidebarOpen] = useState(true);
268
+ const [conversations, setConversations] = useState<ConversationItem[]>(() => {
269
+ try {
270
+ const stored = localStorage.getItem('evo_conversations');
271
+ if (!stored) return [];
272
+ const parsed = JSON.parse(stored);
273
+ return parsed.map((c: any) => ({ ...c, timestamp: new Date(c.timestamp) }));
274
+ } catch { return []; }
275
+ });
276
+ const [currentConvId, setCurrentConvId] = useState<string | null>(null);
277
 
278
  const AVAILABLE_MODELS = [
279
+ { id: 'deepseek-chat', label: 'DeepSeek V3', title: 'DeepSeek V3 (fast)' },
280
+ { id: 'deepseek-reasoner', label: 'DeepSeek R1', title: 'DeepSeek R1 (deep reasoning)' },
281
  ];
282
 
283
  const toggleModel = () => {
 
288
  const messagesEndRef = useRef<HTMLDivElement>(null);
289
  const messagesContainerRef = useRef<HTMLDivElement>(null);
290
  const abortControllerRef = useRef<AbortController | null>(null);
291
+ const textareaRef = useRef<HTMLTextAreaElement>(null);
292
 
293
  // Logout on page close or refresh
294
  useEffect(() => {
 
315
  };
316
  }, [sessionId]);
317
 
318
+ // Auto-save conversation when a response completes
319
+ useEffect(() => {
320
+ if (responseComplete && messages.length > 0) {
321
+ const newId = saveConversation(messages, currentConvId);
322
+ if (newId && !currentConvId) setCurrentConvId(String(newId));
323
+ }
324
+ }, [responseComplete]);
325
 
326
  const handleSendMessage = async () => {
327
  if (!input.trim() || isLoading) return;
 
632
  };
633
 
634
  const insertSymbol = (symbol: string) => {
635
+ const textarea = textareaRef.current;
636
+ if (textarea) {
637
+ const start = textarea.selectionStart;
638
+ const end = textarea.selectionEnd;
639
+ const newValue = input.slice(0, start) + symbol + input.slice(end);
640
+ setInput(newValue);
641
+ setTimeout(() => {
642
+ textarea.selectionStart = textarea.selectionEnd = start + symbol.length;
643
+ textarea.focus();
644
+ }, 0);
645
+ } else {
646
+ setInput((prev) => prev + symbol);
647
+ }
648
+ };
649
+
650
+ const saveConversation = (msgs: Message[], convId: string | null) => {
651
+ if (msgs.length === 0) return;
652
+ const firstUserMsg = msgs.find(m => m.role === 'user');
653
+ const title = firstUserMsg
654
+ ? firstUserMsg.content.slice(0, 60) + (firstUserMsg.content.length > 60 ? '…' : '')
655
+ : 'New conversation';
656
+ setConversations(prev => {
657
+ const existing = prev.findIndex(c => c.id === convId);
658
+ const updated: ConversationItem = {
659
+ id: convId || Date.now().toString(),
660
+ title,
661
+ timestamp: new Date(),
662
+ messages: msgs,
663
+ };
664
+ const next = existing >= 0
665
+ ? prev.map(c => c.id === convId ? updated : c)
666
+ : [updated, ...prev];
667
+ const limited = next.slice(0, 50);
668
+ try { localStorage.setItem('evo_conversations', JSON.stringify(limited)); } catch {}
669
+ return limited;
670
+ });
671
+ return convId || Date.now().toString();
672
+ };
673
+
674
+ const loadConversation = (conv: ConversationItem) => {
675
+ setMessages(conv.messages.map(m => ({ ...m, timestamp: new Date(m.timestamp) })));
676
+ setCurrentConvId(conv.id);
677
+ setInput('');
678
+ setIsLoading(false);
679
+ setResponseComplete(false);
680
+ setStatusMessage('');
681
+ setSidebarOpen(false);
682
+ };
683
+
684
+ const deleteConversation = (convId: string, e: React.MouseEvent) => {
685
+ e.stopPropagation();
686
+ setConversations(prev => {
687
+ const next = prev.filter(c => c.id !== convId);
688
+ try { localStorage.setItem('evo_conversations', JSON.stringify(next)); } catch {}
689
+ return next;
690
+ });
691
+ if (currentConvId === convId) {
692
+ setMessages([]);
693
+ setCurrentConvId(null);
694
+ }
695
  };
696
 
697
  const copyAsMarkdown = (content: string, event: React.MouseEvent) => {
 
766
  };
767
 
768
  const handleNewChat = async () => {
769
+ // Save current conversation before clearing
770
+ if (messages.length > 0) {
771
+ saveConversation(messages, currentConvId);
772
+ }
773
+
774
  // Cancel any ongoing request
775
  if (abortControllerRef.current) {
776
  abortControllerRef.current.abort();
 
799
 
800
  // Clear frontend state
801
  setMessages([]);
802
+ setCurrentConvId(null);
803
  setInput('');
804
  setIsLoading(false);
805
  setResponseComplete(false);
 
834
 
835
  return (
836
  <div className="app">
837
+ {/* Sidebar overlay (mobile) */}
838
+ {sidebarOpen && (
839
+ <div className="sidebar-overlay" onClick={() => setSidebarOpen(false)} />
840
+ )}
841
+
842
+ {/* Left sidebar */}
843
+ <aside className={`sidebar${sidebarOpen ? ' sidebar--open' : ''}`}>
844
+ <div className="sidebar-header">
845
+ <span className="sidebar-logo">evo</span>
846
+ <button className="sidebar-collapse-btn" onClick={() => setSidebarOpen(false)} title="Collapse sidebar">
847
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
848
+ <path d="M15 18l-6-6 6-6" />
849
+ </svg>
850
+ </button>
851
+ </div>
852
+
853
+ <button className="new-chat-btn" onClick={handleNewChat}>
854
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
855
+ <line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />
856
+ </svg>
857
+ New Chat
858
+ </button>
859
+
860
+ <div className="sidebar-conversations">
861
+ {conversations.length > 0 && (
862
+ <div className="sidebar-section-label">Recent</div>
863
+ )}
864
+ {conversations.map(conv => (
865
+ <div
866
+ key={conv.id}
867
+ className={`conv-item${currentConvId === conv.id ? ' conv-item--active' : ''}`}
868
+ onClick={() => loadConversation(conv)}
869
+ >
870
+ <svg className="conv-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
871
+ <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
872
+ </svg>
873
+ <span className="conv-title">{conv.title}</span>
874
+ <button
875
+ className="conv-delete-btn"
876
+ onClick={(e) => deleteConversation(conv.id, e)}
877
+ title="Delete"
878
+ >
879
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
880
+ <line x1="18" y1="6" x2="6" y2="18" /><line x1="6" y1="6" x2="18" y2="18" />
881
+ </svg>
882
+ </button>
883
+ </div>
884
+ ))}
885
+ </div>
886
+
887
+ <div className="sidebar-footer">
888
+ <div className="model-selector">
889
+ <div className="model-selector-label">Model</div>
890
+ <button
891
+ className={`model-option${selectedModel === 'deepseek-chat' ? ' model-option--active' : ''}`}
892
+ onClick={() => setSelectedModel('deepseek-chat')}
893
+ >
894
+ <span className="model-dot" />
895
+ DeepSeek V3
896
+ <span className="model-tag">Fast</span>
897
+ </button>
898
+ <button
899
+ className={`model-option${selectedModel === 'deepseek-reasoner' ? ' model-option--active' : ''}`}
900
+ onClick={() => setSelectedModel('deepseek-reasoner')}
901
+ >
902
+ <span className="model-dot model-dot--r1" />
903
+ DeepSeek R1
904
+ <span className="model-tag model-tag--r1">Reason</span>
905
+ </button>
906
+ </div>
907
+ <div className="user-section">
908
+ <div className="user-avatar">{user?.name?.[0]?.toUpperCase() ?? '?'}</div>
909
+ <span className="user-name">{user?.name}</span>
910
+ <button className="user-logout-btn" onClick={handleLogout} title="Sign out">
911
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
912
+ <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
913
+ <polyline points="16 17 21 12 16 7" />
914
+ <line x1="21" y1="12" x2="9" y2="12" />
915
+ </svg>
916
+ </button>
917
+ </div>
918
  </div>
919
+ </aside>
920
+
921
+ {/* Main content */}
922
+ <main className={`main${sidebarOpen ? ' main--sidebar-open' : ''}`}>
923
+ {/* Top bar */}
924
+ <div className="topbar">
925
+ <button className="topbar-menu-btn" onClick={() => setSidebarOpen(s => !s)} title="Toggle sidebar">
926
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
927
+ <line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="18" x2="21" y2="18" />
928
+ </svg>
929
  </button>
930
+ {!sidebarOpen && <span className="topbar-logo">evo</span>}
931
+ <div className="topbar-spacer" />
932
+ <button className="topbar-new-btn" onClick={handleNewChat}>
933
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
934
+ <line x1="12" y1="5" x2="12" y2="19" /><line x1="5" y1="12" x2="19" y2="12" />
935
+ </svg>
936
+ New chat
937
  </button>
938
  </div>
939
+
940
+ {/* Messages */}
941
  <div className="messages" ref={messagesContainerRef}>
942
+ {messages.length === 0 ? (
943
+ <div className="welcome">
944
+ <div className="welcome-logo">evo</div>
945
+ <h2 className="welcome-heading">How can I help you today?</h2>
946
+ <p className="welcome-sub">Prolog · Lean 4 · SymPy · Python · Web</p>
947
+ <div className="examples">
948
+ <button className="example-btn" onClick={() => setInput('Prove that √2 is irrational using Lean 4')}>
949
+ <span className="example-icon">𝓛</span>
950
+ <span>Prove √2 is irrational (Lean 4)</span>
951
+ </button>
952
+ <button className="example-btn" onClick={() => setInput('Solve the integral ∫ x² sin(x) dx using SymPy')}>
953
+ <span className="example-icon">∫</span>
954
+ <span>Solve ∫ x² sin(x) dx</span>
955
+ </button>
956
+ <button className="example-btn" onClick={() => setInput('Find all prime numbers less than 100 using Prolog')}>
957
+ <span className="example-icon">⊢</span>
958
+ <span>Find primes with Prolog</span>
959
+ </button>
960
+ <button className="example-btn" onClick={() => setInput('Explain the Riemann Hypothesis and its implications')}>
961
+ <span className="example-icon">ζ</span>
962
+ <span>Riemann Hypothesis</span>
963
+ </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
964
  </div>
965
+ </div>
966
+ ) : (
967
+ messages.map((message) => {
968
+ if (message.role === 'assistant' && !message.content && !message.reasoningContent && (!message.toolCalls || message.toolCalls.length === 0)) {
969
+ return null;
970
+ }
971
+ return (
972
+ <div key={message.id} className={`message message-${message.role}`}>
973
+ {/* Avatar */}
974
+ <div className="message-avatar">
975
+ {message.role === 'user' ? (
976
+ <div className="avatar avatar--user">{user?.name?.[0]?.toUpperCase() ?? 'U'}</div>
977
+ ) : (
978
+ <div className="avatar avatar--assistant">
979
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
980
+ <circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/>
981
+ </svg>
982
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
983
  )}
 
 
 
 
 
 
984
  </div>
985
+
986
+ {/* Message body */}
987
+ <div className="message-body">
988
+ <div className="message-meta">
989
+ <span className="message-role-label">
990
+ {message.role === 'user' ? (user?.name ?? 'You') : 'EVO'}
991
+ </span>
992
+ <span className="message-time">{message.timestamp.toLocaleTimeString()}</span>
993
+ {message.role === 'assistant' && (
994
+ <div className="message-actions">
995
+ <button
996
+ className="action-btn"
997
+ onClick={(e) => copyEverything(message, e)}
998
+ title="Copy all (with tool outputs)"
999
+ >
1000
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
1001
+ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
1002
+ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
1003
+ <circle cx="11.5" cy="11.5" r="1.5" fill="currentColor"></circle>
1004
+ <circle cx="16.5" cy="11.5" r="1.5" fill="currentColor"></circle>
1005
+ <circle cx="11.5" cy="16.5" r="1.5" fill="currentColor"></circle>
1006
+ <circle cx="16.5" cy="16.5" r="1.5" fill="currentColor"></circle>
1007
+ </svg>
1008
+ </button>
1009
+ <button
1010
+ className="action-btn"
1011
+ onClick={(e) => copyAsMarkdown(message.content, e)}
1012
+ title="Copy markdown"
1013
+ >
1014
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
1015
+ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
1016
+ <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
1017
+ </svg>
1018
+ </button>
1019
+ </div>
1020
+ )}
1021
+ </div>
1022
+
1023
+ {/* Message content */}
1024
+ {message.content && (
1025
+ <div className="message-content">
1026
+ {message.role === 'assistant' && message.isStreaming ? (
1027
+ (() => {
1028
+ const { safe, tail } = splitStreamingContent(message.content);
1029
+ return (
1030
+ <>
1031
+ {safe && (
1032
+ <ReactMarkdown
1033
+ remarkPlugins={[[remarkMath, { singleDollarTextMath: true }], remarkGfm]}
1034
+ rehypePlugins={[[rehypeKatex, { throwOnError: false, strict: false }]]}
1035
+ urlTransform={allowDataImageUrl}
1036
+ components={{
1037
+ code({ className, children, ...props }: any) {
1038
+ const match = /language-(\w+)/.exec(className || '');
1039
+ return match ? (
1040
+ <SyntaxHighlighter style={terminalTheme as any} language={match[1]} PreTag="div" {...props}>
1041
+ {String(children).replace(/\n$/, '')}
1042
+ </SyntaxHighlighter>
1043
+ ) : (
1044
+ <code className={className} {...props}>{children}</code>
1045
+ );
1046
+ },
1047
+ img({ src, alt, ...props }: any) { return <PlotImage src={src} alt={alt} {...props} />; },
1048
+ }}
1049
+ >
1050
+ {preprocessMathContent(safe)}
1051
+ </ReactMarkdown>
1052
+ )}
1053
+ {tail && <div className="streaming-content">{tail}</div>}
1054
+ </>
1055
+ );
1056
+ })()
1057
+ ) : (
1058
+ <ReactMarkdown
1059
+ remarkPlugins={[[remarkMath, { singleDollarTextMath: true }], remarkGfm]}
1060
+ rehypePlugins={[[rehypeKatex, { throwOnError: false, strict: false }]]}
1061
+ urlTransform={allowDataImageUrl}
1062
+ components={{
1063
+ code({ className, children, ...props }: any) {
1064
+ const match = /language-(\w+)/.exec(className || '');
1065
+ return match ? (
1066
+ <SyntaxHighlighter style={terminalTheme as any} language={match[1]} PreTag="div" {...props}>
1067
+ {String(children).replace(/\n$/, '')}
1068
+ </SyntaxHighlighter>
1069
+ ) : (
1070
+ <code className={className} {...props}>{children}</code>
1071
+ );
1072
+ },
1073
+ img({ src, alt, ...props }: any) { return <PlotImage src={src} alt={alt} {...props} />; },
1074
+ }}
1075
+ >
1076
+ {preprocessMathContent(message.content)}
1077
+ </ReactMarkdown>
1078
  )}
1079
+ </div>
1080
+ )}
1081
+
1082
+ {/* Reasoning trace */}
1083
+ {message.reasoningContent && (
1084
+ <details
1085
+ className={`reasoning-trace${message.isStreaming ? ' reasoning-streaming' : ''}`}
1086
+ open={message.reasoningExpanded}
1087
+ onToggle={(e) => {
1088
+ const open = (e.currentTarget as HTMLDetailsElement).open;
1089
+ setMessages((prev) =>
1090
+ prev.map((m) => m.id === message.id ? { ...m, reasoningExpanded: open } : m)
1091
+ );
1092
+ }}
1093
+ >
1094
+ <summary className="reasoning-header">
1095
+ <span className="reasoning-icon">🧠</span>
1096
+ <span>Reasoning</span>
1097
+ {message.isStreaming && (
1098
+ <span className="reasoning-live-indicator">
1099
+ <span className="reasoning-live-dot" />
1100
+ <span className="reasoning-live-dot" />
1101
+ <span className="reasoning-live-dot" />
1102
+ </span>
1103
+ )}
1104
+ </summary>
1105
+ <div
1106
+ className="reasoning-content"
1107
+ ref={(el) => { if (el && message.isStreaming) el.scrollTop = el.scrollHeight; }}
1108
+ >
1109
+ {message.reasoningContent}
1110
+ </div>
1111
+ </details>
1112
+ )}
1113
+
1114
+ {/* Tool calls */}
1115
+ {message.toolCalls && message.toolCalls.length > 0 && (
1116
+ <div className="tool-calls">
1117
+ {message.toolCalls.map((tool, idx) => (
1118
+ <details key={idx} className="tool-call">
1119
+ <summary className="tool-call-header">
1120
+ <span className="tool-name">{tool.name}</span>
1121
+ {tool.isGenerating && (
1122
+ <span className="tool-status generating">
1123
+ <span className="dot"></span><span className="dot"></span><span className="dot"></span>
1124
+ <span className="status-text">Generating...</span>
1125
+ </span>
1126
+ )}
1127
+ {tool.isExecuting && (
1128
+ <span className="tool-status executing">
1129
+ <span className="dot"></span><span className="dot"></span><span className="dot"></span>
1130
+ <span className="status-text">Executing...</span>
1131
+ </span>
1132
+ )}
1133
+ {tool.output && !tool.isGenerating && !tool.isExecuting && (
1134
+ tool.error ? <span className="crossmark">✗</span> : <span className="checkmark">✓</span>
1135
+ )}
1136
+ </summary>
1137
+ <div className="tool-call-content">
1138
+ <details className="tool-section">
1139
+ <summary className="tool-section-label">Input:</summary>
1140
+ <pre className="tool-code tool-input-scroll">{tool.input}</pre>
1141
+ </details>
1142
+ {tool.output && (
1143
+ <div className="tool-section">
1144
+ <div className="tool-section-label">Output:</div>
1145
+ <div className="tool-output">
1146
+ <ReactMarkdown
1147
+ remarkPlugins={[[remarkMath, { singleDollarTextMath: true }], remarkGfm]}
1148
+ rehypePlugins={[[rehypeKatex, { throwOnError: false, strict: false }]]}
1149
+ urlTransform={allowDataImageUrl}
1150
+ components={{
1151
+ code({ className, children, ...props }: any) {
1152
+ const match = /language-(\w+)/.exec(className || '');
1153
+ return match ? (
1154
+ <SyntaxHighlighter style={terminalTheme as any} language={match[1]} PreTag="div" {...props}>
1155
+ {String(children).replace(/\n$/, '')}
1156
+ </SyntaxHighlighter>
1157
+ ) : (
1158
+ <code className={className} {...props}>{children}</code>
1159
+ );
1160
+ },
1161
+ img({ src, alt, ...props }: any) { return <PlotImage src={src} alt={alt} {...props} />; },
1162
+ }}
1163
+ >
1164
+ {preprocessMathContent(tool.output)}
1165
+ </ReactMarkdown>
1166
+ </div>
1167
+ </div>
1168
+ )}
1169
  </div>
1170
+ </details>
1171
+ ))}
1172
  </div>
1173
+ )}
1174
+ </div>
1175
  </div>
1176
+ );
1177
+ })
1178
+ )}
1179
+
 
1180
  {isLoading && !responseComplete && (
1181
  <div className="typing-indicator">
1182
+ <div className="avatar avatar--assistant">
1183
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
1184
+ <circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/>
1185
+ </svg>
1186
+ </div>
1187
+ <div className="typing-dots">
1188
+ <span></span><span></span><span></span>
1189
+ <em className="status-message">{statusMessage || 'Thinking...'}</em>
1190
+ </div>
1191
  </div>
1192
  )}
1193
  <div ref={messagesEndRef} />
1194
  </div>
1195
+
1196
+ {/* Input area */}
1197
+ <div className="input-wrapper">
1198
+ {/* Math symbols popup */}
1199
+ {showMathSymbols && (
1200
+ <div className="math-symbols-popup">
1201
+ <div className="math-symbols-popup-content">
1202
+ <div className="math-symbols-popup-header">
1203
+ <span>Math Symbols</span>
1204
+ <button className="math-symbols-close-btn" onClick={() => setShowMathSymbols(false)} aria-label="Close">
1205
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
1206
+ <line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line>
1207
+ </svg>
1208
+ </button>
1209
+ </div>
1210
+ <div className="math-symbols">
1211
+ <div className="symbol-tabs">
1212
+ {['greek','operators','relations','sets','logic','arrows','special','calculus','linear','equations','matrices'].map(cat => (
1213
+ <button key={cat} onClick={() => setActiveSymbolCategory(cat)} className={`symbol-tab${activeSymbolCategory === cat ? ' active' : ''}`}>
1214
+ {cat.charAt(0).toUpperCase() + cat.slice(1)}
1215
+ </button>
1216
+ ))}
1217
+ </div>
1218
+ <div className="symbol-content">
1219
+ {activeSymbolCategory === 'greek' && (
1220
+ <div className="symbol-category">
1221
+ <div className="symbol-row">
1222
+ {[['\\alpha ','α'],['\\beta ','β'],['\\gamma ','γ'],['\\delta ','δ'],['\\epsilon ','ε'],['\\theta ','θ'],['\\lambda ','λ'],['\\mu ','μ'],['\\pi ','π'],['\\sigma ','σ'],['\\phi ','φ'],['\\omega ','ω']].map(([s,l]) => (
1223
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1224
+ ))}
1225
+ </div>
1226
+ <div className="symbol-row">
1227
+ {[['\\Gamma ','Γ'],['\\Delta ','Δ'],['\\Theta ','Θ'],['\\Lambda ','Λ'],['\\Pi ','Π'],['\\Sigma ','Σ'],['\\Phi ','Φ'],['\\Omega ','Ω']].map(([s,l]) => (
1228
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1229
+ ))}
1230
+ </div>
1231
+ </div>
1232
+ )}
1233
+ {activeSymbolCategory === 'operators' && (
1234
+ <div className="symbol-category"><div className="symbol-row">
1235
+ {[['\\sum ','∑'],['\\prod ','∏'],['\\int ','∫'],['\\iint ','∬'],['\\oint ','∮'],['\\partial ','∂'],['\\nabla ','∇'],['\\sqrt{} ','√'],['\\pm ','±'],['\\mp ','∓'],['\\times ','×'],['\\div ','÷'],['\\cdot ','·'],['\\ast ','∗']].map(([s,l]) => (
1236
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1237
+ ))}
1238
+ </div></div>
1239
+ )}
1240
+ {activeSymbolCategory === 'relations' && (
1241
+ <div className="symbol-category"><div className="symbol-row">
1242
+ {[['\\leq ','≤'],['\\geq ','≥'],['\\neq ','≠'],['\\approx ','≈'],['\\equiv ','≡'],['\\sim ','∼'],['\\simeq ','≃'],['\\cong ','≅'],['\\propto ','∝'],['\\ll ','≪'],['\\gg ','≫']].map(([s,l]) => (
1243
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1244
+ ))}
1245
+ </div></div>
1246
+ )}
1247
+ {activeSymbolCategory === 'sets' && (
1248
+ <div className="symbol-category"><div className="symbol-row">
1249
+ {[['\\in ','∈'],['\\notin ','∉'],['\\subset ','⊂'],['\\subseteq ','⊆'],['\\supset ','⊃'],['\\supseteq ','⊇'],['\\cup ','∪'],['\\cap ','∩'],['\\emptyset ','∅'],['\\setminus ','\\']].map(([s,l]) => (
1250
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1251
+ ))}
1252
+ </div></div>
1253
+ )}
1254
+ {activeSymbolCategory === 'logic' && (
1255
+ <div className="symbol-category"><div className="symbol-row">
1256
+ {[['\\forall ','∀'],['\\exists ','∃'],['\\nexists ','∄'],['\\land ','∧'],['\\lor ','∨'],['\\neg ','¬'],['\\implies ','⟹'],['\\iff ','⟺'],['\\vdash ','⊢'],['\\models ','⊨']].map(([s,l]) => (
1257
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1258
+ ))}
1259
+ </div></div>
1260
+ )}
1261
+ {activeSymbolCategory === 'arrows' && (
1262
+ <div className="symbol-category"><div className="symbol-row">
1263
+ {[['\\to ','→'],['\\leftarrow ','←'],['\\leftrightarrow ','↔'],['\\Rightarrow ','⇒'],['\\Leftarrow ','⇐'],['\\Leftrightarrow ','⇔'],['\\mapsto ','↦'],['\\uparrow ','↑'],['\\downarrow ','↓']].map(([s,l]) => (
1264
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1265
+ ))}
1266
+ </div></div>
1267
+ )}
1268
+ {activeSymbolCategory === 'special' && (
1269
+ <div className="symbol-category">
1270
+ <div className="symbol-row">
1271
+ {[['\\mathbb{R} ','ℝ'],['\\mathbb{C} ','ℂ'],['\\mathbb{N} ','ℕ'],['\\mathbb{Z} ','ℤ'],['\\mathbb{Q} ','ℚ'],['\\infty ','∞'],['\\aleph ','ℵ'],['\\hbar ','ℏ'],['\\ell ','ℓ']].map(([s,l]) => (
1272
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1273
+ ))}
1274
+ </div>
1275
+ <div className="symbol-row">
1276
+ {[['\\langle \\rangle ','⟨⟩'],['\\lfloor \\rfloor ','⌊⌋'],['\\lceil \\rceil ','⌈⌉'],['\\{ \\} ','{}'],['\\lVert \\rVert ','‖‖']].map(([s,l]) => (
1277
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1278
+ ))}
1279
+ </div>
1280
+ </div>
1281
+ )}
1282
+ {activeSymbolCategory === 'calculus' && (
1283
+ <div className="symbol-category"><div className="symbol-row">
1284
+ {[['\\lim ','lim'],['\\sup ','sup'],['\\inf ','inf'],['\\max ','max'],['\\min ','min'],['\\frac{}{} ','a/b'],['^{} ','xⁿ'],['_{} ','xₙ']].map(([s,l]) => (
1285
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1286
+ ))}
1287
+ </div></div>
1288
+ )}
1289
+ {activeSymbolCategory === 'linear' && (
1290
+ <div className="symbol-category"><div className="symbol-row">
1291
+ {[['\\oplus ','⊕'],['\\otimes ','⊗'],['\\odot ','⊙'],['\\circ ','∘'],['\\perp ','⊥'],['\\parallel ','∥'],['\\det ','det'],['\\dim ','dim']].map(([s,l]) => (
1292
+ <button key={s} onClick={() => insertSymbol(s)} className="symbol-btn" title={s.trim()}>{l}</button>
1293
+ ))}
1294
+ </div></div>
1295
+ )}
1296
+ {activeSymbolCategory === 'equations' && (
1297
+ <div className="symbol-category">
1298
+ <div className="symbol-row">
1299
+ <button onClick={() => insertSymbol('$ $')} className="symbol-btn template-btn" title="Inline math">$...$</button>
1300
+ <button onClick={() => insertSymbol('$$\n \n$$')} className="symbol-btn template-btn" title="Display math">$$...$$</button>
1301
+ <button onClick={() => insertSymbol('\\begin{align}\n & = \\\\\n & = \n\\end{align}')} className="symbol-btn template-btn">align</button>
1302
+ <button onClick={() => insertSymbol('\\begin{cases}\n & \\text{if } \\\\\n & \\text{if } \n\\end{cases}')} className="symbol-btn template-btn">cases</button>
1303
+ <button onClick={() => insertSymbol('\\begin{equation}\n \n\\end{equation}')} className="symbol-btn template-btn">equation</button>
1304
+ <button onClick={() => insertSymbol('\\begin{aligned}\n & \\\\\n & \n\\end{aligned}')} className="symbol-btn template-btn">aligned</button>
1305
+ </div>
1306
+ <div className="symbol-row">
1307
+ <button onClick={() => insertSymbol('\\begin{cases}\n a_1x + b_1y = c_1 \\\\\n a_2x + b_2y = c_2\n\\end{cases}')} className="symbol-btn template-btn">2 eq</button>
1308
+ <button onClick={() => insertSymbol('\\begin{cases}\n a_1x + b_1y + c_1z = d_1 \\\\\n a_2x + b_2y + c_2z = d_2 \\\\\n a_3x + b_3y + c_3z = d_3\n\\end{cases}')} className="symbol-btn template-btn">3 eq</button>
1309
+ </div>
1310
+ </div>
1311
+ )}
1312
+ {activeSymbolCategory === 'matrices' && (
1313
+ <div className="symbol-category">
1314
+ <div className="symbol-row">
1315
+ <button onClick={() => insertSymbol('\\begin{pmatrix}\n a & b \\\\\n c & d\n\\end{pmatrix}')} className="symbol-btn template-btn">(2×2)</button>
1316
+ <button onClick={() => insertSymbol('\\begin{bmatrix}\n a & b \\\\\n c & d\n\\end{bmatrix}')} className="symbol-btn template-btn">[2×2]</button>
1317
+ <button onClick={() => insertSymbol('\\begin{vmatrix}\n a & b \\\\\n c & d\n\\end{vmatrix}')} className="symbol-btn template-btn">|2×2|</button>
1318
+ <button onClick={() => insertSymbol('\\begin{pmatrix}\n a & b & c \\\\\n d & e & f \\\\\n g & h & i\n\\end{pmatrix}')} className="symbol-btn template-btn">(3×3)</button>
1319
+ <button onClick={() => insertSymbol('\\begin{pmatrix}\n x_1 \\\\\n x_2 \\\\\n x_3\n\\end{pmatrix}')} className="symbol-btn template-btn">col vec</button>
1320
+ <button onClick={() => insertSymbol('\\begin{pmatrix} x_1 & x_2 & x_3 \\end{pmatrix}')} className="symbol-btn template-btn">row vec</button>
1321
+ </div>
1322
+ </div>
1323
+ )}
1324
+ </div>
1325
+ </div>
1326
  </div>
1327
+ </div>
1328
+ )}
1329
+
1330
+ <div className="input-box">
1331
+ <textarea
1332
+ ref={textareaRef}
1333
+ value={input}
1334
+ onChange={(e) => setInput(e.target.value)}
1335
+ onKeyDown={handleKeyPress}
1336
+ placeholder="Ask anything... (Shift+Enter for new line)"
1337
+ rows={3}
1338
+ disabled={isLoading}
1339
+ />
1340
+ <div className="input-actions">
1341
+ <button
1342
+ onClick={() => setShowMathSymbols(!showMathSymbols)}
1343
+ className={`action-icon-btn${showMathSymbols ? ' action-icon-btn--active' : ''}`}
1344
+ title="Math Symbols"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1345
  >
1346
+ Σ
1347
  </button>
1348
+ <button
1349
+ onClick={toggleModel}
1350
+ className={`model-toggle-btn${selectedModel === 'deepseek-reasoner' ? ' model-toggle-btn--r1' : ''}`}
1351
+ title={AVAILABLE_MODELS.find(m => m.id === selectedModel)?.title}
1352
+ disabled={isLoading}
1353
  >
1354
+ {selectedModel === 'deepseek-chat' ? 'V3' : 'R1'}
1355
  </button>
1356
+ <button
1357
+ onClick={handleSendMessage}
1358
+ disabled={isLoading || !input.trim()}
1359
+ className="send-btn"
1360
+ title="Send (Enter)"
1361
  >
1362
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor">
1363
+ <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
1364
+ </svg>
1365
  </button>
1366
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1367
  </div>
1368
+ <div className="input-footer">Press Enter to send · Shift+Enter for new line</div>
1369
  </div>
1370
+ </main>
1371
  </div>
1372
  );
1373
  }
1374
 
1375
+ export default App;
web/src/Login.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useState, useMemo } from 'react';
2
 
3
  const LOGIC_SAYINGS = [
4
  "Logic is disciplined honesty",
@@ -115,14 +115,12 @@ const Login: React.FC<LoginProps> = ({ onLogin }) => {
115
  const [error, setError] = useState('');
116
  const [loading, setLoading] = useState(false);
117
 
118
- // Select a random logic saying on component mount
119
  const randomSaying = useMemo(
120
  () => LOGIC_SAYINGS[Math.floor(Math.random() * LOGIC_SAYINGS.length)],
121
  []
122
  );
123
 
124
  const GATEWAY_URL = import.meta.env.VITE_GATEWAY_URL || 'https://deepthoughtai-evo-gateway.hf.space';
125
- console.log('Gateway URL:', GATEWAY_URL); // Debug log
126
 
127
  const handleSubmit = async (e: React.FormEvent) => {
128
  e.preventDefault();
@@ -131,15 +129,15 @@ const Login: React.FC<LoginProps> = ({ onLogin }) => {
131
 
132
  try {
133
  const endpoint = isRegistering ? '/api/auth/register' : '/api/auth/login';
134
- const body = isRegistering
135
  ? { username, password, name }
136
  : { username, password };
137
 
138
  const response = await fetch(`${GATEWAY_URL}${endpoint}`, {
139
  method: 'POST',
140
- credentials: 'include', // Send and receive cookies
141
  headers: { 'Content-Type': 'application/json' },
142
- body: JSON.stringify(body)
143
  });
144
 
145
  const data = await response.json();
@@ -148,7 +146,6 @@ const Login: React.FC<LoginProps> = ({ onLogin }) => {
148
  throw new Error(data.error || 'Authentication failed');
149
  }
150
 
151
- // Backend returns token (JWT) - store as sessionId for consistency
152
  const sessionId = data.token || '';
153
  onLogin(sessionId, data.user);
154
  } catch (err: any) {
@@ -159,30 +156,33 @@ const Login: React.FC<LoginProps> = ({ onLogin }) => {
159
  };
160
 
161
  return (
162
- <div className="login-container">
163
- <div className="login-box">
164
- <div className="login-header">
165
- <h1 className="evo-title">evo</h1>
166
- <p className="login-subtitle">{randomSaying}</p>
167
  </div>
168
 
169
  <form onSubmit={handleSubmit} className="login-form">
170
- <div className="form-group">
171
- <label>Username</label>
172
  <input
 
173
  type="text"
174
  value={username}
175
  onChange={(e) => setUsername(e.target.value)}
176
  placeholder="Enter username"
177
  required
178
  autoComplete="username"
 
179
  />
180
  </div>
181
 
182
  {isRegistering && (
183
- <div className="form-group">
184
- <label>Full Name</label>
185
  <input
 
186
  type="text"
187
  value={name}
188
  onChange={(e) => setName(e.target.value)}
@@ -192,9 +192,10 @@ const Login: React.FC<LoginProps> = ({ onLogin }) => {
192
  </div>
193
  )}
194
 
195
- <div className="form-group">
196
- <label>Password</label>
197
  <input
 
198
  type="password"
199
  value={password}
200
  onChange={(e) => setPassword(e.target.value)}
@@ -204,25 +205,33 @@ const Login: React.FC<LoginProps> = ({ onLogin }) => {
204
  />
205
  </div>
206
 
207
- {error && <div className="error-message">{error}</div>}
208
 
209
- <button type="submit" className="login-btn" disabled={loading}>
210
- {loading ? 'Please wait...' : isRegistering ? 'Register' : 'Login'}
211
  </button>
212
  </form>
213
 
214
- <div className="login-footer">
 
 
215
  <button
216
  type="button"
217
- className="toggle-mode"
 
 
 
 
 
 
 
 
218
  onClick={() => {
219
  setIsRegistering(!isRegistering);
220
  setError('');
221
  }}
222
  >
223
- {isRegistering
224
- ? 'Already have an account? Login'
225
- : 'Need an account? Register'}
226
  </button>
227
  </div>
228
  </div>
@@ -230,4 +239,4 @@ const Login: React.FC<LoginProps> = ({ onLogin }) => {
230
  );
231
  };
232
 
233
- export default Login;
 
1
+ import React, { useState, useMemo } from 'react';
2
 
3
  const LOGIC_SAYINGS = [
4
  "Logic is disciplined honesty",
 
115
  const [error, setError] = useState('');
116
  const [loading, setLoading] = useState(false);
117
 
 
118
  const randomSaying = useMemo(
119
  () => LOGIC_SAYINGS[Math.floor(Math.random() * LOGIC_SAYINGS.length)],
120
  []
121
  );
122
 
123
  const GATEWAY_URL = import.meta.env.VITE_GATEWAY_URL || 'https://deepthoughtai-evo-gateway.hf.space';
 
124
 
125
  const handleSubmit = async (e: React.FormEvent) => {
126
  e.preventDefault();
 
129
 
130
  try {
131
  const endpoint = isRegistering ? '/api/auth/register' : '/api/auth/login';
132
+ const body = isRegistering
133
  ? { username, password, name }
134
  : { username, password };
135
 
136
  const response = await fetch(`${GATEWAY_URL}${endpoint}`, {
137
  method: 'POST',
138
+ credentials: 'include',
139
  headers: { 'Content-Type': 'application/json' },
140
+ body: JSON.stringify(body),
141
  });
142
 
143
  const data = await response.json();
 
146
  throw new Error(data.error || 'Authentication failed');
147
  }
148
 
 
149
  const sessionId = data.token || '';
150
  onLogin(sessionId, data.user);
151
  } catch (err: any) {
 
156
  };
157
 
158
  return (
159
+ <div className="login-page">
160
+ <div className="login-card">
161
+ <div className="login-brand">
162
+ <span className="login-logo">evo</span>
163
+ <p className="login-tagline">Prolog-first reasoning platform</p>
164
  </div>
165
 
166
  <form onSubmit={handleSubmit} className="login-form">
167
+ <div className="form-field">
168
+ <label htmlFor="username">Username</label>
169
  <input
170
+ id="username"
171
  type="text"
172
  value={username}
173
  onChange={(e) => setUsername(e.target.value)}
174
  placeholder="Enter username"
175
  required
176
  autoComplete="username"
177
+ autoFocus
178
  />
179
  </div>
180
 
181
  {isRegistering && (
182
+ <div className="form-field">
183
+ <label htmlFor="fullname">Full Name</label>
184
  <input
185
+ id="fullname"
186
  type="text"
187
  value={name}
188
  onChange={(e) => setName(e.target.value)}
 
192
  </div>
193
  )}
194
 
195
+ <div className="form-field">
196
+ <label htmlFor="password">Password</label>
197
  <input
198
+ id="password"
199
  type="password"
200
  value={password}
201
  onChange={(e) => setPassword(e.target.value)}
 
205
  />
206
  </div>
207
 
208
+ {error && <div className="login-error">{error}</div>}
209
 
210
+ <button type="submit" className="login-submit-btn" disabled={loading}>
211
+ {loading ? 'Please wait...' : isRegistering ? 'Create Account' : 'Sign In'}
212
  </button>
213
  </form>
214
 
215
+ <div className="login-saying">{randomSaying}</div>
216
+
217
+ <div style={{ textAlign: 'center', marginTop: '1rem' }}>
218
  <button
219
  type="button"
220
+ style={{
221
+ background: 'transparent',
222
+ border: 'none',
223
+ color: '#a78bfa',
224
+ cursor: 'pointer',
225
+ fontSize: '0.82rem',
226
+ textDecoration: 'underline',
227
+ textUnderlineOffset: '2px',
228
+ }}
229
  onClick={() => {
230
  setIsRegistering(!isRegistering);
231
  setError('');
232
  }}
233
  >
234
+ {isRegistering ? 'Already have an account? Sign in' : "Don't have an account? Register"}
 
 
235
  </button>
236
  </div>
237
  </div>
 
239
  );
240
  };
241
 
242
+ export default Login;