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11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <title>学生端门户 - 教育AI助手平台</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
    <style>

        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

        

        :root {

            /* 优雅的配色方案 */

            --primary-color: #0f2d49;

            --primary-light: #234a70;

            --secondary-color: #4a6cfd;

            --secondary-light: #7b91ff;

            --tertiary-color: #f7f9fe;

            --success-color: #10b981;

            --success-light: rgba(16, 185, 129, 0.1);

            --warning-color: #f59e0b;

            --warning-light: rgba(245, 158, 11, 0.1);

            --info-color: #0ea5e9;

            --info-light: rgba(14, 165, 233, 0.1);

            --danger-color: #ef4444;

            --danger-light: rgba(239, 68, 68, 0.1);

            --neutral-50: #f9fafb;

            --neutral-100: #f3f4f6;

            --neutral-200: #e5e7eb;

            --neutral-300: #d1d5db;

            --neutral-400: #9ca3af;

            --neutral-500: #6b7280;

            --neutral-600: #4b5563;

            --neutral-700: #374151;

            --neutral-800: #1f2937;

            --neutral-900: #111827;

            

            /* 样式变量 */

            --border-radius-sm: 0.25rem;

            --border-radius: 0.375rem;

            --border-radius-lg: 0.5rem;

            --border-radius-xl: 0.75rem;

            --border-radius-2xl: 1rem;

            --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);

            --card-shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.05), 0 6px 6px rgba(0, 0, 0, 0.1);

            --card-shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

            --transition-base: all 0.2s ease-in-out;

            --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

            --font-family: 'Inter', 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;

        }

        

        /* 基础样式 */

        body {

            font-family: var(--font-family);

            background-color: var(--neutral-50);

            color: var(--neutral-800);

            margin: 0;

            padding: 0;

            min-height: 100vh;

            display: flex;

            flex-direction: column;

            -webkit-font-smoothing: antialiased;

            -moz-osx-font-smoothing: grayscale;

        }

        

        h1, h2, h3, h4, h5, h6 {

            font-weight: 600;

            color: var(--neutral-900);

        }

        

        .text-gradient {

            background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));

            -webkit-background-clip: text;

            -webkit-text-fill-color: transparent;

            background-clip: text;

            color: transparent;

        }

        

        /* 滚动条样式 */

        ::-webkit-scrollbar {

            width: 6px;

            height: 6px;

        }

        

        ::-webkit-scrollbar-track {

            background: var(--neutral-100);

            border-radius: 10px;

        }

        

        ::-webkit-scrollbar-thumb {

            background: var(--neutral-300);

            border-radius: 10px;

        }

        

        ::-webkit-scrollbar-thumb:hover {

            background: var(--neutral-400);

        }

        

        /* 头部样式 */

        .header {

            background-color: white;

            border-bottom: 1px solid var(--neutral-200);

            padding: 1rem 1.5rem;

            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);

            position: sticky;

            top: 0;

            z-index: 100;

        }

        

        .header-content {

            max-width: 1400px;

            margin: 0 auto;

            display: flex;

            justify-content: space-between;

            align-items: center;

        }

        

        .header h1 {

            margin: 0;

            font-size: 1.5rem;

            font-weight: 700;

            background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));

            -webkit-background-clip: text;

            -webkit-text-fill-color: transparent;

            letter-spacing: -0.01em;

        }

        

        .user-info {

            display: flex;

            align-items: center;

            gap: 0.75rem;

        }

        

        .user-info .badge {

            font-size: 0.85rem;

            padding: 0.4rem 0.75rem;

            border-radius: var(--border-radius-lg);

            background: linear-gradient(to right, var(--secondary-color), var(--secondary-light));

            color: white;

            font-weight: 500;

        }

        

        .user-info button {

            color: var(--neutral-600);

            text-decoration: none;

            font-size: 0.9rem;

            transition: var(--transition-base);

        }

        

        .user-info button:hover {

            color: var(--secondary-color);

        }

        

        /* 主容器样式 */

        .main-container {

            flex: 1;

            max-width: 1400px;

            margin: 2rem auto;

            padding: 0 1.5rem;

            width: 100%;

            box-sizing: border-box;

        }

        

        /* 欢迎消息样式 */

        .welcome-message {

            background-color: white;

            border-radius: var(--border-radius-xl);

            box-shadow: var(--card-shadow);

            padding: 2rem;

            margin-bottom: 2.5rem;

            position: relative;

            overflow: hidden;

            border: none;

            transition: var(--transition-smooth);

        }

        

        .welcome-message:hover {

            box-shadow: var(--card-shadow-hover);

            transform: translateY(-3px);

        }

        

        .welcome-message::before {

            content: '';

            position: absolute;

            top: 0;

            bottom: 0;

            left: 0;

            width: 4px;

            background: linear-gradient(to bottom, var(--info-color), var(--secondary-light));

            border-radius: 4px 0 0 4px;

        }

        

        .welcome-message h2 {

            margin-top: 0;

            margin-bottom: 1rem;

            font-size: 1.6rem;

            font-weight: 700;

            color: var(--primary-color);

        }

        

        .welcome-message p {

            color: var(--neutral-600);

            margin-bottom: 0.75rem;

            font-size: 0.95rem;

            line-height: 1.5;

        }

        

        .welcome-message p:last-child {

            margin-bottom: 0;

        }

        

        /* 令牌输入样式 */

        .token-input {

            background-color: white;

            border-radius: var(--border-radius-xl);

            box-shadow: var(--card-shadow);

            padding: 2rem;

            margin-bottom: 2.5rem;

            position: relative;

            overflow: hidden;

            transition: var(--transition-smooth);

        }

        

        .token-input:hover {

            box-shadow: var(--card-shadow-hover);

            transform: translateY(-3px);

        }

        

        .token-input::before {

            content: '';

            position: absolute;

            top: 0;

            bottom: 0;

            left: 0;

            width: 4px;

            background: linear-gradient(to bottom, var(--warning-color), var(--secondary-light));

            border-radius: 4px 0 0 4px;

        }

        

        .token-input h3 {

            margin-top: 0;

            margin-bottom: 1rem;

            font-size: 1.35rem;

            font-weight: 600;

            color: var(--neutral-900);

        }

        

        .token-input p {

            color: var(--neutral-600);

            margin-bottom: 1.25rem;

        }

        

        .token-input .input-group {

            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);

            border-radius: var(--border-radius-lg);

            margin-bottom: 0;

        }

        

        .token-input .form-control {

            border-radius: var(--border-radius-lg) 0 0 var(--border-radius-lg);

            border: 1px solid var(--neutral-200);

            padding: 0.75rem 1rem;

            font-size: 0.95rem;

        }

        

        .token-input .form-control:focus {

            box-shadow: none;

            border-color: var(--secondary-color);

        }

        

        .token-input .btn {

            background: linear-gradient(to right, var(--secondary-color), var(--secondary-light));

            color: white;

            border: none;

            border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;

            padding: 0.75rem 1.25rem;

            transition: var(--transition-base);

        }

        

        .token-input .btn:hover {

            background: linear-gradient(to right, var(--secondary-light), var(--secondary-color));

            box-shadow: 0 4px 10px rgba(74, 108, 253, 0.2);

        }

        

        /* 标题样式 */

        .section-header {

            margin-bottom: 1.5rem;

            display: flex;

            flex-direction: column;

        }

        

        .section-header h2 {

            margin: 0;

            font-size: 1.5rem;

            font-weight: 700;

            color: var(--primary-color);

            margin-bottom: 0.5rem;

        }

        

        .section-header p {

            color: var(--neutral-600);

            margin: 0;

            font-size: 0.95rem;

        }

        

        /* Agent卡片样式 */

        .agent-card {

            background-color: white;

            border-radius: var(--border-radius-xl);

            margin-bottom: 1.5rem;

            box-shadow: var(--card-shadow);

            overflow: hidden;

            transition: var(--transition-smooth);

            position: relative;

            border: none;

        }

        

        .agent-card:hover {

            transform: translateY(-5px);

            box-shadow: var(--card-shadow-hover);

        }

        

        .agent-card::before {

            content: '';

            position: absolute;

            top: 0;

            bottom: 0;

            left: 0;

            width: 4px;

            background: linear-gradient(to bottom, var(--secondary-color), var(--secondary-light));

            border-radius: 4px 0 0 4px;

        }

        

        .agent-card-header {

            padding: 1.5rem;

            background-color: rgba(74, 108, 253, 0.03);

            border-bottom: 1px solid var(--neutral-100);

        }

        

        .agent-card-title {

            margin: 0;

            font-size: 1.25rem;

            font-weight: 600;

            color: var(--primary-color);

            display: flex;

            align-items: center;

        }

        

        .agent-card-title i {

            margin-right: 0.75rem;

            font-size: 1.2rem;

            color: var(--secondary-color);

        }

        

        .agent-card-content {

            padding: 1.5rem;

        }

        

        .agent-card-description {

            margin-bottom: 1.25rem;

            color: var(--neutral-700);

            font-size: 0.95rem;

            line-height: 1.5;

        }

        

        .agent-meta {

            display: flex;

            flex-wrap: wrap;

            margin-bottom: 1.25rem;

            gap: 1.5rem;

        }

        

        .agent-meta-item {

            display: flex;

            align-items: center;

            font-size: 0.9rem;

            color: var(--neutral-600);

        }

        

        .agent-meta-item i {

            margin-right: 0.5rem;

            font-size: 0.95rem;

            color: var(--secondary-color);

        }

        

        .agent-tags {

            display: flex;

            flex-wrap: wrap;

            gap: 0.5rem;

            margin-bottom: 1.5rem;

        }

        

        .agent-tag {

            display: inline-flex;

            align-items: center;

            padding: 0.35em 0.75em;

            background-color: rgba(74, 108, 253, 0.1);

            color: var(--secondary-color);

            border-radius: 20px;

            font-size: 0.85rem;

            font-weight: 500;

        }

        

        .agent-tag i {

            margin-right: 0.4rem;

        }

        

        .agent-actions {

            display: flex;

            justify-content: flex-end;

        }

        

        .agent-actions .btn {

            padding: 0.65em 1.25em;

            font-weight: 500;

            background: linear-gradient(to right, var(--secondary-color), var(--secondary-light));

            border: none;

            color: white;

            border-radius: var(--border-radius-lg);

            transition: var(--transition-base);

        }

        

        .agent-actions .btn:hover {

            background: linear-gradient(to right, var(--secondary-light), var(--secondary-color));

            transform: translateY(-2px);

            box-shadow: 0 4px 10px rgba(74, 108, 253, 0.2);

        }

        

        .agent-actions .btn i {

            margin-right: 0.5rem;

        }

        

        /* 活动记录样式 */

        .recent-activity {

            background-color: white;

            border-radius: var(--border-radius-xl);

            box-shadow: var(--card-shadow);

            padding: 1.5rem;

            margin-bottom: 2rem;

            position: relative;

            overflow: hidden;

            transition: var(--transition-smooth);

        }

        

        .recent-activity:hover {

            box-shadow: var(--card-shadow-hover);

            transform: translateY(-3px);

        }

        

        .recent-activity::before {

            content: '';

            position: absolute;

            top: 0;

            bottom: 0;

            left: 0;

            width: 4px;

            background: linear-gradient(to bottom, var(--success-color), var(--secondary-light));

            border-radius: 4px 0 0 4px;

        }

        

        .recent-activity h3 {

            margin-top: 0;

            margin-bottom: 1.5rem;

            font-size: 1.35rem;

            font-weight: 600;

            color: var(--neutral-900);

        }

        

        .activity-list {

            list-style: none;

            padding: 0;

            margin: 0;

        }

        

        .activity-item {

            display: flex;

            padding: 1rem 0;

            border-bottom: 1px solid var(--neutral-100);

            align-items: center;

        }

        

        .activity-item:last-child {

            border-bottom: none;

            padding-bottom: 0;

        }

        

        .activity-icon {

            width: 40px;

            height: 40px;

            border-radius: 50%;

            background-color: rgba(74, 108, 253, 0.1);

            display: flex;

            align-items: center;

            justify-content: center;

            margin-right: 1rem;

            flex-shrink: 0;

        }

        

        .activity-icon i {

            color: var(--secondary-color);

            font-size: 1.1rem;

        }

        

        .activity-content {

            flex: 1;

        }

        

        .activity-title {

            margin: 0;

            margin-bottom: 0.35rem;

            font-size: 0.95rem;

            font-weight: 500;

            color: var(--neutral-800);

        }

        

        .activity-time {

            font-size: 0.85rem;

            color: var(--neutral-500);

        }

        

        /* 动画效果 */

        @keyframes fadeIn {

            from { opacity: 0; transform: translateY(10px); }

            to { opacity: 1; transform: translateY(0); }

        }

        

        .fade-in {

            opacity: 0;

            animation: fadeIn 0.4s ease-out forwards;

        }

        

        .animate-delay-1 { animation-delay: 0.1s; }

        .animate-delay-2 { animation-delay: 0.2s; }

        .animate-delay-3 { animation-delay: 0.3s; }

        .animate-delay-4 { animation-delay: 0.4s; }

        .animate-delay-5 { animation-delay: 0.5s; }

        

        /* 响应式样式 */

        @media (max-width: 992px) {

            .main-container {

                padding: 0 1rem;

            }

            

            .agent-meta {

                flex-direction: column;

                gap: 0.75rem;

            }

        }

        

        @media (max-width: 768px) {

            .header h1 {

                font-size: 1.25rem;

            }

            

            .welcome-message h2 {

                font-size: 1.35rem;

            }

            

            .agent-card-title {

                font-size: 1.1rem;

            }

            

            .section-header h2 {

                font-size: 1.3rem;

            }

            

            .recent-activity h3,

            .token-input h3 {

                font-size: 1.2rem;

            }

        }

    </style>
</head>
<body>
    <header class="header">
        <div class="header-content">
            <h1>教育AI助手平台 - 学生端</h1>
            <div class="user-info">
                <span class="badge" id="user-name">张三</span>
                <button class="btn btn-sm btn-link text-decoration-none" id="logout-btn">登出</button>
            </div>
        </div>
    </header>
    
    <div class="main-container">
        <div class="welcome-message fade-in">
            <h2>欢迎回来,<span id="welcome-name">张三</span></h2>
            <p>教育AI助手平台为您提供智能学习辅助工具,帮助您更高效地学习和解决问题。</p>
            <p>下方是您的教师分享给您的AI助手,点击"开始对话"与它们互动。</p>
        </div>
        
        <div class="token-input fade-in animate-delay-1">
            <h3>访问新的AI助手</h3>
            <p>输入教师分享的访问令牌,即可使用新的AI助手。</p>
            <div class="input-group">
                <input type="text" class="form-control" id="access-token" placeholder="输入访问令牌">
                <button class="btn" id="access-button">
                    <i class="bi bi-arrow-right-circle me-1"></i> 访问
                </button>
            </div>
        </div>
        
        <div class="section-header fade-in animate-delay-2">
            <h2>我的AI助手</h2>
            <p>教师分享给您的智能学习助手</p>
        </div>
        
        <div class="row" id="agents-container">
            <!-- 代码将在JavaScript中动态生成 -->
        </div>
        
        <div class="recent-activity fade-in animate-delay-4">
            <h3>最近活动</h3>
            <ul class="activity-list" id="activity-list">
                <!-- 代码将在JavaScript中动态生成 -->
            </ul>
        </div>
    </div>
    
    <script>

        // DOM元素

        const userNameElement = document.getElementById('user-name');

        const welcomeNameElement = document.getElementById('welcome-name');

        const logoutBtn = document.getElementById('logout-btn');

        const accessButton = document.getElementById('access-button');

        const agentsContainer = document.getElementById('agents-container');

        const activityList = document.getElementById('activity-list');

        

        // 页面加载函数

        document.addEventListener('DOMContentLoaded', function() {

            // 检查登录状态

            checkAuthStatus();

            

            // 加载用户的AI助手列表

            loadAgents();

            

            // 初始化登出按钮

            logoutBtn.addEventListener('click', logout);

            

            // 初始化访问令牌按钮

            accessButton.addEventListener('click', accessWithToken);

        });

        

        // 检查认证状态

        async function checkAuthStatus() {

            try {

                const response = await fetch('/api/auth/check');

                const data = await response.json();

                

                if (!data.success) {

                    // 未登录,跳转到登录页面

                    window.location.href = '/login.html';

                    return;

                }

                

                // 更新用户信息显示

                userNameElement.textContent = data.user.name;

                welcomeNameElement.textContent = data.user.name;

                

                // 如果不是学生,跳转到教师端

                if (data.user.type !== 'student') {

                    window.location.href = '/index.html';

                }

            } catch (error) {

                console.error('验证登录状态出错:', error);

                window.location.href = '/login.html';

            }

        }

        

        // 登出

        async function logout() {

            try {

                const response = await fetch('/api/auth/logout', {

                    method: 'POST'

                });

                

                const data = await response.json();

                

                if (data.success) {

                    window.location.href = '/login.html';

                }

            } catch (error) {

                console.error('登出出错:', error);

                alert('登出失败,请重试');

            }

        }

        

        // 加载Agent列表

        async function loadAgents() {

            try {

                // 显示加载状态

                agentsContainer.innerHTML = `

                    <div class="col-12 text-center py-4">

                        <div class="spinner-border text-primary" role="status">

                            <span class="visually-hidden">加载中...</span>

                        </div>

                        <p class="mt-3">正在加载AI助手列表...</p>

                    </div>

                `;

                

                // 获取Agent列表

                const response = await fetch('/api/student/agents');

                const result = await response.json();

                

                if (result.success) {

                    const agents = result.agents || [];

                    

                    if (agents.length === 0) {

                        agentsContainer.innerHTML = `

                            <div class="col-12">

                                <div class="alert alert-info">

                                    <i class="bi bi-info-circle me-2"></i>

                                    您还没有可用的AI助手。请向您的教师获取访问令牌。

                                </div>

                            </div>

                        `;

                        

                        // 无Agent时,清空活动列表

                        activityList.innerHTML = `

                            <li class="text-center py-3 text-muted">

                                暂无活动记录

                            </li>

                        `;

                        

                        return;

                    }

                    

                    // 渲染Agent列表

                    agentsContainer.innerHTML = '';

                    

                    agents.forEach(agent => {

                        const col = document.createElement('div');

                        col.className = 'col-lg-6 col-12 fade-in';

                        

                        // 格式化最后使用时间

                        let lastUsedText = '从未使用';

                        if (agent.last_used) {

                            const lastUsedDate = new Date(agent.last_used * 1000);

                            lastUsedText = lastUsedDate.toLocaleString();

                        }

                        

                        // 构建插件标签

                        let pluginsHtml = '';

                        if (agent.plugins && agent.plugins.length > 0) {

                            pluginsHtml = '<div class="agent-tags">';

                            

                            agent.plugins.forEach(plugin => {

                                let pluginName = '未知插件';

                                let pluginIcon = 'puzzle';

                                

                                if (plugin === 'code') {

                                    pluginName = '代码执行';

                                    pluginIcon = 'code-square';

                                } else if (plugin === 'visualization') {

                                    pluginName = '3D可视化';

                                    pluginIcon = 'bar-chart';

                                } else if (plugin === 'mindmap') {

                                    pluginName = '思维导图';

                                    pluginIcon = 'diagram-3';

                                }

                                

                                pluginsHtml += `

                                    <span class="agent-tag">

                                        <i class="bi bi-${pluginIcon}"></i> ${pluginName}

                                    </span>

                                `;

                            });

                            

                            pluginsHtml += '</div>';

                        }

                        

                        // 构建主题和教师标签

                        let metaHtml = '<div class="agent-meta">';

                        

                        if (agent.subject) {

                            metaHtml += `

                                <div class="agent-meta-item">

                                    <i class="bi bi-book"></i> ${agent.subject}

                                </div>

                            `;

                        }

                        

                        if (agent.instructor) {

                            metaHtml += `

                                <div class="agent-meta-item">

                                    <i class="bi bi-person"></i> ${agent.instructor}

                                </div>

                            `;

                        }

                        

                        metaHtml += `

                            <div class="agent-meta-item">

                                <i class="bi bi-clock"></i> 最后使用: ${lastUsedText}

                            </div>

                        </div>`;

                        

                        // 构建Agent卡片

                        col.innerHTML = `

                            <div class="agent-card">

                                <div class="agent-card-header">

                                    <h3 class="agent-card-title">

                                        <i class="bi bi-robot"></i> ${agent.name}

                                    </h3>

                                </div>

                                <div class="agent-card-content">

                                    <div class="agent-card-description">

                                        ${agent.description || '暂无描述'}

                                    </div>

                                    ${metaHtml}

                                    ${pluginsHtml}

                                    <div class="agent-actions">

                                        <a href="/student/${agent.id}?token=${agent.token}" class="btn">

                                            <i class="bi bi-chat-dots me-1"></i> 开始对话

                                        </a>

                                    </div>

                                </div>

                            </div>

                        `;

                        

                        agentsContainer.appendChild(col);

                    });

                    

                    // 生成简单的活动记录(实际中应从API获取)

                    loadActivityRecords();

                } else {

                    agentsContainer.innerHTML = `

                        <div class="col-12">

                            <div class="alert alert-danger">

                                <i class="bi bi-exclamation-triangle me-2"></i>

                                加载Agent列表失败: ${result.message}

                            </div>

                        </div>

                    `;

                    

                    // 加载失败时,清空活动列表

                    activityList.innerHTML = `

                        <li class="text-center py-3 text-muted">

                            暂无活动记录

                        </li>

                    `;

                }

            } catch (error) {

                console.error('加载Agent列表出错:', error);

                agentsContainer.innerHTML = `

                    <div class="col-12">

                        <div class="alert alert-danger">

                            <i class="bi bi-exclamation-triangle me-2"></i>

                            加载Agent列表时发生错误,请刷新页面重试

                        </div>

                    </div>

                `;

            }

        }

        

        // 加载活动记录(实际中应从API获取)

        // 加载活动记录

async function loadActivityRecords() {

    try {

        // 从API获取活动记录

        const response = await fetch('/api/student/activities');

        const result = await response.json();

        

        if (result.success) {

            const activities = result.activities || [];

            

            if (activities.length === 0) {

                activityList.innerHTML = `

                    <li class="text-center py-3 text-muted">

                        暂无活动记录

                    </li>

                `;

                return;

            }

            

            // 渲染活动记录

            activityList.innerHTML = '';

            

            activities.forEach(activity => {

                let iconClass = 'bi-activity';

                

                switch (activity.type) {

                    case 'chat':

                        iconClass = 'bi-chat-dots';

                        break;

                    case 'code':

                        iconClass = 'bi-code-square';

                        break;

                    case 'viz':

                        iconClass = 'bi-bar-chart';

                        break;

                    case 'mindmap':

                        iconClass = 'bi-diagram-3';

                        break;

                }

                

                const li = document.createElement('li');

                li.className = 'activity-item';

                

                // 如果有agent_id和token,添加链接

                let titleHtml = `<h4 class="activity-title">${activity.title}</h4>`;

                if (activity.agent_id) {

                    // 查找对应Agent的token

                    const agent = agents.find(a => a.id === activity.agent_id);

                    if (agent && agent.token) {

                        titleHtml = `

                            <h4 class="activity-title">

                                <a href="/student/${activity.agent_id}?token=${agent.token}">${activity.title}</a>

                            </h4>

                        `;

                    }

                }

                

                li.innerHTML = `

                    <div class="activity-icon">

                        <i class="bi ${iconClass}"></i>

                    </div>

                    <div class="activity-content">

                        ${titleHtml}

                        <div class="activity-time">${activity.time}</div>

                    </div>

                `;

                

                activityList.appendChild(li);

            });

        } else {

            activityList.innerHTML = `

                <li class="text-center py-3 text-muted">

                    <i class="bi bi-exclamation-circle me-2"></i>

                    无法加载活动记录

                </li>

            `;

        }

    } catch (error) {

        console.error('加载活动记录出错:', error);

        activityList.innerHTML = `

            <li class="text-center py-3 text-muted">

                <i class="bi bi-exclamation-circle me-2"></i>

                加载活动记录时出错

            </li>

        `;

    }

}

        // 使用令牌访问AI助手

        async function accessWithToken() {

            const token = document.getElementById('access-token').value.trim();

            

            if (!token) {

                showMessage('请输入访问令牌', 'warning');

                return;

            }

            

            try {

                // 验证令牌有效性

                const response = await fetch('/api/verify_token', {

                    method: 'POST',

                    headers: {

                        'Content-Type': 'application/json'

                    },

                    body: JSON.stringify({ token })

                });

                

                const result = await response.json();

                

                if (result.success) {

                    // 令牌有效,重定向到Agent页面

                    const agent = result.agent;

                    window.location.href = `/student/${agent.id}?token=${token}`;

                } else {

                    showMessage(result.message || '无效的访问令牌', 'danger');

                }

            } catch (error) {

                console.error('验证令牌出错:', error);

                showMessage('验证令牌时发生错误,请重试', 'danger');

            }

        }

        

        // 显示提示消息

        function showMessage(message, type) {

            // 移除现有的提示

            const existingAlert = document.querySelector('.token-input .alert');

            if (existingAlert) {

                existingAlert.remove();

            }

            

            // 创建新提示

            const alertDiv = document.createElement('div');

            alertDiv.className = `alert alert-${type} mt-3`;

            alertDiv.innerHTML = `

                <i class="bi ${type === 'danger' ? 'bi-exclamation-triangle' : 'bi-info-circle'} me-2"></i>

                ${message}

            `;

            

            // 添加到令牌输入区域

            document.querySelector('.token-input .input-group').insertAdjacentElement('afterend', alertDiv);

            

            // 3秒后自动移除

            setTimeout(() => {

                alertDiv.style.opacity = '0';

                setTimeout(() => alertDiv.remove(), 300);

            }, 3000);

        }

    </script>
</body>
</html>