File size: 50,188 Bytes
16a249d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e1a6ec
16a249d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e1a6ec
 
16a249d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e1a6ec
 
16a249d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e1a6ec
16a249d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e1a6ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16a249d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e1a6ec
16a249d
8e1a6ec
16a249d
8e1a6ec
 
16a249d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8e1a6ec
16a249d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
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
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Open Materials Challenge #1 ์ „๊ณ ์ฒด ์ „ํ•ด์งˆ</title>
<!-- <head> ๋Š” ์„ ํƒ์ด ์•„๋‹ˆ๋‹ค: ํ”Œ๋žซํผ์ด ์ž๊ธฐ ํƒœ๊ทธ๋ฅผ ๋ฌธ์„œ์— ์ฃผ์ž…ํ•˜๋Š”๋ฐ, ๋ฐ›์„ head ๊ฐ€ ์—†์œผ๋ฉด
     ๊ทธ๊ฒƒ๋“ค์ด doctype ์•ž์— ๋†“์ด๊ณ  ํŽ˜์ด์ง€ ์ „์ฒด๊ฐ€ ์ฟผํฌ ๋ชจ๋“œ๋กœ ๋–จ์–ด์ง„๋‹ค. -->
<style>
  :root{
    --bg:#f7f8fa; --card:#fff; --ink:#16181d; --muted:#6b7280; --line:#e5e7eb;
    --accent:#1f6f4a; --accent-soft:#e8f3ed; --warn:#9a6700; --warn-soft:#fff8e1;
    --anchor:#fffbe6; --anchor-line:#f2e3a8;
  }
  :root:not([data-theme="light"]){}
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg:#101215; --card:#171a1f; --ink:#e8eaed; --muted:#9aa1ab; --line:#2a2f37;
      --accent:#4bbb87; --accent-soft:#16281f; --warn:#e0b23c; --warn-soft:#2a2312;
      --anchor:#241f10; --anchor-line:#4a4022;
    }
  }
  :root[data-theme="dark"]{
    --bg:#101215; --card:#171a1f; --ink:#e8eaed; --muted:#9aa1ab; --line:#2a2f37;
    --accent:#4bbb87; --accent-soft:#16281f; --warn:#e0b23c; --warn-soft:#2a2312;
    --anchor:#241f10; --anchor-line:#4a4022;
  }
  *{box-sizing:border-box}
  body{margin:0;background:var(--bg);color:var(--ink);
    font:15px/1.65 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans KR",sans-serif}
  .wrap{max-width:1120px;margin:0 auto;padding:20px 16px 80px}
  header{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin:8px 0 4px}
  h1{font-size:22px;margin:0;letter-spacing:-.3px}
  h2{font-size:17px;margin:0 0 10px;display:flex;align-items:baseline;gap:10px}
  .sub{color:var(--muted);font-size:14px}
  .card{background:var(--card);border:1px solid var(--line);border-radius:14px;
    padding:18px 20px;margin:14px 0}
  .grid{display:grid;grid-template-columns:1fr 360px;gap:14px;align-items:start}
  @media (max-width:900px){.grid{grid-template-columns:1fr}}
  .cnt{color:var(--muted);font-size:13px;font-weight:400;margin-left:auto}
  #langbar,#seasonbar{display:flex;gap:6px;flex-wrap:wrap}
  #langbar{margin-left:auto}
  #langbar button,#seasonbar button{border:1px solid var(--line);background:var(--card);
    color:var(--muted);border-radius:8px;padding:5px 12px;cursor:pointer;font:inherit;font-size:13px}
  #langbar button.on,#seasonbar button.on{background:var(--accent);color:#fff;border-color:var(--accent)}
  .scroll{overflow-x:auto}
  table{width:100%;border-collapse:collapse;font-size:13.5px;min-width:780px}
  th,td{padding:8px 10px;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap}
  th{color:var(--muted);font-weight:600;font-size:12.5px;cursor:pointer;user-select:none}
  th .ar{opacity:.4;margin-left:3px;font-size:10px}
  th.sorted{color:var(--accent)} th.sorted .ar{opacity:1}
  tr.anchor{background:var(--anchor)}
  tr.anchor td{border-bottom-color:var(--anchor-line)}
  td.num{text-align:right;font-variant-numeric:tabular-nums}
  .pill{display:inline-block;padding:1px 7px;border-radius:999px;font-size:11.5px;
    background:var(--accent-soft);color:var(--accent);border:1px solid transparent}
  .note{color:var(--muted);font-size:12.5px;margin-top:12px;line-height:1.7}
  .pager{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;
    padding:14px 4px 2px;font-size:13px}
  .pager button{border:1px solid var(--line);background:var(--card);color:var(--muted);
    border-radius:8px;padding:5px 11px;cursor:pointer;font:inherit;min-width:36px}
  .pager button.on{background:var(--accent);color:#fff;border-color:var(--accent)}
  .pager button:disabled{opacity:.4;cursor:default}
  .pager .pinfo{color:var(--muted);margin:0 8px}
  .pager .gap{color:var(--muted);padding:0 2px}
  label{display:block;font-size:13px;color:var(--muted);margin:12px 0 5px}
  input,textarea,select{width:100%;padding:9px 11px;border:1px solid var(--line);
    border-radius:9px;background:var(--bg);color:var(--ink);font:inherit;font-size:14px}
  textarea{resize:vertical;min-height:64px}
  .radio{display:flex;gap:8px;margin-top:6px}
  .radio label{flex:1;display:flex;align-items:center;gap:7px;margin:0;padding:10px;
    border:1px solid var(--line);border-radius:9px;cursor:pointer;font-size:13px;color:var(--ink)}
  .radio label.on{border-color:var(--accent);background:var(--accent-soft)}
  .go{width:100%;margin-top:16px;padding:12px;border:0;border-radius:10px;
    background:var(--accent);color:#fff;font:inherit;font-size:15px;font-weight:600;cursor:pointer}
  .go:disabled{opacity:.5;cursor:default}
  .msg{margin-top:10px;padding:10px 12px;border-radius:9px;font-size:13px;display:none}
  .msg.ok{display:block;background:var(--accent-soft);color:var(--accent)}
  .msg.bad{display:block;background:var(--warn-soft);color:var(--warn)}
  .callout{background:var(--warn-soft);border:1px solid var(--anchor-line);
    border-radius:10px;padding:12px 14px;font-size:13px;color:var(--ink);margin:12px 0}
  .axes{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 2px}
  .axes span{font-size:12.5px;color:var(--muted);background:var(--bg);
    border:1px solid var(--line);border-radius:999px;padding:3px 10px}
  .axes b{color:var(--ink)}
  a{color:var(--accent)}
  .badges{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
  .badges img{height:22px}
  #divbar{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px}
  #divbar button{border:1px solid var(--line);background:var(--card);color:var(--muted);
    border-radius:999px;padding:4px 12px;cursor:pointer;font:inherit;font-size:12.5px}
  #divbar button.on{background:var(--accent);color:#fff;border-color:var(--accent)}
  #divbar button .dn{opacity:.65;margin-left:5px;font-size:11.5px}
  .hf-user{color:var(--accent);text-decoration:none;white-space:nowrap}
  .hf-user:hover{text-decoration:underline}
  .signin{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--accent);
    background:var(--accent);color:#fff;border-radius:9px;padding:6px 13px;font-size:13px;
    text-decoration:none;font-weight:600}
  .signin.out{background:var(--card);color:var(--muted);border-color:var(--line);font-weight:400}
  .me{display:flex;align-items:center;gap:9px;margin:10px 0 0;font-size:13px;color:var(--muted)}
  .me img{width:22px;height:22px;border-radius:50%}
  .xlink{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);
    background:var(--card);border-radius:9px;padding:6px 12px;font-size:12.5px;
    color:var(--muted);text-decoration:none;margin-top:8px}
  .xlink:hover{border-color:var(--accent);color:var(--accent)}
  .xlink b{color:var(--ink);font-weight:600}
  .xlink em{font-style:normal;opacity:.75}
  .lead{font-size:15px;margin:0 0 12px}
  .sinfo{display:flex;gap:16px;flex-wrap:wrap;color:var(--muted);font-size:13px;margin:10px 0 0}
  .sinfo b{color:var(--ink);font-weight:600}
  #tabbar{display:flex;gap:2px;margin:16px 0 0;border-bottom:1px solid var(--line);flex-wrap:wrap}
  #tabbar button{border:0;background:none;color:var(--muted);font:inherit;font-size:14px;
    padding:9px 15px;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px}
  #tabbar button:hover{color:var(--ink)}
  #tabbar button.on{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}
  #tabbar .tc{margin-left:5px;font-size:11.5px;opacity:.7}
  .axhelp{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:8px;margin:12px 0 2px}
  .axhelp div{font-size:12.5px;color:var(--muted);line-height:1.55}
  .axhelp b{color:var(--ink)}
  tr.det td{background:var(--bg);white-space:normal;font-size:12.5px;color:var(--muted);
    border-bottom:1px solid var(--line)}
  tr.det ul{margin:2px 0;padding-left:16px} tr.det li{margin:2px 0}
  tr.held td{opacity:.72}
  .pill.warn{background:var(--warn-soft);color:var(--warn)}
  tr.pick{cursor:pointer}
  tr.pick:hover td{background:var(--accent-soft)}
  .facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:10px;margin:12px 0}
  .fact{background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:11px 13px;font-size:13px}
  .fact b{display:block;color:var(--accent);font-size:12px;margin-bottom:3px}
  .pcard{border:1px solid var(--line);border-radius:11px;margin:10px 0;overflow:hidden}
  .phead{display:flex;align-items:center;gap:9px;padding:9px 13px;background:var(--bg);
    border-bottom:1px solid var(--line);flex-wrap:wrap}
  .ptag{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;
    border-radius:6px;background:var(--accent);color:#fff;font-size:12px;font-weight:700}
  .phead b{font-size:14px} .phead span{color:var(--muted);font-size:12.5px}
  .pcopy{margin-left:auto;border:1px solid var(--line);background:var(--card);color:var(--muted);
    border-radius:7px;padding:4px 11px;cursor:pointer;font:inherit;font-size:12px}
  .pcopy:hover{border-color:var(--accent);color:var(--accent)}
  .pbody{padding:12px 14px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
    font-size:12.5px;line-height:1.6;white-space:pre-wrap;color:var(--ink);max-height:280px;overflow:auto}
  .pbody em{color:var(--warn);font-style:normal;font-weight:600}
  .mrow{display:grid;grid-template-columns:minmax(120px,1.4fr) 1fr auto;gap:10px;
    align-items:center;padding:7px 0;border-bottom:1px solid var(--line);font-size:13px}
  .mrow:last-child{border-bottom:0}
  .mname{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mbar{position:relative;height:16px;background:var(--bg);border-radius:5px;overflow:hidden}
  .mbar i{position:absolute;inset:0 auto 0 0;background:var(--accent);border-radius:5px}
  .mbar u{position:absolute;top:0;bottom:0;width:2px;background:var(--ink);opacity:.55}
  .mnum{font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap;font-size:12.5px}
  .mlegend{display:flex;gap:14px;color:var(--muted);font-size:12px;margin-top:10px;flex-wrap:wrap}
  .mlegend i{display:inline-block;width:10px;height:10px;background:var(--accent);border-radius:2px;margin-right:4px}
  .mlegend u{display:inline-block;width:2px;height:11px;background:var(--ink);opacity:.55;margin-right:4px;
    vertical-align:-1px;text-decoration:none}
</style>
</head>
<body>
<div class="wrap">

<header>
  <h1 id="t_title">Open Materials Challenge</h1>
  <span class="sub" id="t_sub"></span>
  <div id="langbar">
    <button data-lang="ko" class="on">ํ•œ๊ตญ์–ด</button>
    <button data-lang="en">English</button>
  </div>
</header>
<div id="seasonbar" style="margin:14px 0 0"></div>
<div class="sinfo" id="sinfo"></div>
<a class="xlink" id="xlink" href="https://huggingface.co/spaces/FINAL-Bench/open-discovery-challenge" target="_blank" rel="noopener"></a>
    <a class="xlink" id="xlink2" href="https://huggingface.co/spaces/FINAL-Bench/leadboard" target="_blank" rel="noopener"></a>
<div id="tabbar"></div>

<section data-tab="board">
<div class="card">
  <h2 id="t_about_h"></h2>
  <div id="t_about"></div>
  <div class="axes" id="wts"></div>
  <div class="axhelp" id="axhelp"></div>
  <div class="callout" id="t_honest"></div>
</div>

</section>

<section data-tab="guide" hidden>
<div class="card">
  <h2 id="t_guide_h"></h2>
  <p class="lead" id="t_guide_lead"></p>
  <div class="facts" id="facts"></div>
  <div id="t_guide_how"></div>
  <div id="prompts"></div>
</div>

</section>

<section data-tab="models" hidden>
<div class="card">
  <h2><span id="t_models_h"></span><span class="cnt" id="mcounts"></span></h2>
  <div id="t_models_lead" class="note" style="margin-top:0"></div>
  <div id="models"></div>
  <div class="mlegend" id="t_mlegend"></div>
</div>
</section>

<section data-tab="board" hidden>
<div class="grid">
  <div class="card">
    <h2><span id="t_board_h"></span><span class="cnt" id="counts"></span></h2>
    <div id="divbar"></div>
    <div id="trackbar"></div>
    <div class="scroll">
      <table>
        <thead><tr id="head"></tr></thead>
        <tbody id="rows"></tbody>
      </table>
    </div>
    <div class="pager" id="pager"></div>
    <div class="note" id="t_boardnote"></div>
  </div>

  <div class="card">
    <h2 id="t_submit_h"></h2>
    <div id="gate" class="callout" style="display:none"></div>
    <div class="me" id="me"></div>
    <label id="l_formula"></label>
    <input id="f_formula" placeholder="Li3YCl6">
    <label id="l_name"></label>
    <input id="f_name" placeholder="">
    <label id="l_model"></label>
    <input id="f_model" placeholder="anthropic/claude-โ€ฆ, Qwen/โ€ฆ">
    <label id="l_cif"></label>
    <textarea id="f_cif" placeholder="# generated using pymatgen&#10;data_โ€ฆ"></textarea>
    <div class="note" id="t_cifnote" style="margin-top:4px"></div>
    <label id="l_why"></label>
    <textarea id="f_why"></textarea>
    <label id="l_vis"></label>
    <div class="radio" id="visbox">
      <label class="on"><input type="radio" name="vis" value="private" checked><span id="t_priv"></span></label>
      <label><input type="radio" name="vis" value="public"><span id="t_pub"></span></label>
    </div>
    <button class="go" id="go"></button>
    <div class="msg" id="msg"></div>
    <div class="note" id="t_limits"></div>
  </div>
</div>

</section>

<section data-tab="board" hidden>
<div class="card">
  <h2 id="t_broker_h"></h2>
  <div id="t_broker"></div>
</div>
</section>

</div>
<script>
const T = {
 ko:{
  sub:"์ธ๋ฅ˜์˜ ๋‚œ์ œ๋ฅผ AI ์™€ ํ•จ๊ป˜ โ€” ๊ฐœ์ธ์ด ์ฐธ์—ฌํ•˜๋Š” ์‹ ์†Œ์žฌ ํƒ์ƒ‰",
  about_h:"์ด ๋Œ€ํšŒ๋Š” ๋ฌด์—‡์ธ๊ฐ€",
  about:`<p>์ „๊ณ ์ฒด ๋ฐฐํ„ฐ๋ฆฌ๋Š” ๋ฆฌํŠฌ์ด์˜จ ์ „์ง€์˜ ์•ก์ฒด ์ „ํ•ด์งˆ์„ ๊ณ ์ฒด๋กœ ๋ฐ”๊พผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋” ์•ˆ์ „ํ•˜๊ณ  ๋” ์˜ค๋ž˜ ๊ฐˆ ์ˆ˜ ์žˆ์ง€๋งŒ,
    <b>๊ณ ์ฒด์ด๋ฉด์„œ ๋ฆฌํŠฌ๋งŒ ์ž˜ ํ†ต๊ณผ์‹œํ‚ค๋Š” ๋ฌผ์งˆ</b>์„ ์ฐพ๋Š” ์ผ์ด ์•„์ง ํ’€๋ฆฌ์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.</p>
   <p>์ด ๋Œ€ํšŒ๋Š” ๊ทธ ํ›„๋ณด ๋ฌผ์งˆ์„ ์ฐพ์Šต๋‹ˆ๋‹ค. ์ฐธ๊ฐ€์ž๋Š” <b>์กฐ์„ฑ ํ•˜๋‚˜</b>๋ฅผ ๋ƒ…๋‹ˆ๋‹ค โ€” ์˜ˆ: <code>Li3YCl6</code>.
    ์ €ํฌ๊ฐ€ ๊ณ„์‚ฐ์œผ๋กœ ์ฑ„์ ํ•ด ์ˆœ์œ„ํ‘œ์— ์˜ฌ๋ฆฝ๋‹ˆ๋‹ค. ์ƒ๊ธˆ์€ ์—†์Šต๋‹ˆ๋‹ค.</p>`,
  honest:`<b>์ด ์‹œ์ฆŒ์ด ์ฑ„์ ํ•˜๋Š” ๊ฒƒ.</b> <b>์ „๊ธฐํ™”ํ•™์  ๊ฐ•๊ฑด์„ฑ</b>์ž…๋‹ˆ๋‹ค โ€” ๋†’์€ ์ „์••์„ ๊ฒฌ๋””๋Š”์ง€,
    ๋ฆฌํŠฌ ๊ธˆ์†์— ๋‹ฟ์•„๋„ ๋ฒ„ํ‹ฐ๋Š”์ง€, ๋ฆฌํŠฌ์ด ์ง€๋‚˜๊ฐˆ ๊ธธ์ด ๋šซ๋ ค ์žˆ๋Š”์ง€.
    <b>์ด์˜จ์ „๋„๋„๋Š” ์ด๋ฒˆ ์‹œ์ฆŒ์˜ ์ฑ„์  ํ•ญ๋ชฉ์ด ์•„๋‹™๋‹ˆ๋‹ค.</b> ๋”ฐ๋ผ์„œ ์ „๋„๋„๊ฐ€ ๋†’์€ ๊ณ„์—ด์ด๋ผ๋„
    ์‚ฐํ™”์ฐฝ์ด ์ข๊ฑฐ๋‚˜ ๋ฆฌํŠฌ ๊ธˆ์†๊ณผ ๋ฐ˜์‘ํ•˜๋ฉด ๋‚ฎ๊ฒŒ ๋‚˜์˜ต๋‹ˆ๋‹ค โ€” ๊ทธ ๋‘ ๊ฐ€์ง€๊ฐ€ ์ด ์‹œ์ฆŒ์ด ๋ฌป๋Š” ๋ฌธ์ œ์ž…๋‹ˆ๋‹ค.
    ๋ชจ๋“  ๊ฐ’์€ <b>๊ณ„์‚ฐ ์ถ”์ •์น˜</b>์ด๋ฉฐ ์‹ค์ œ ์„ฑ๋Šฅ์ด๋‚˜ ์•ˆ์ „์„ฑ์„ ๋œปํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.`,
  guide_h:"์ฐธ๊ฐ€ ๊ฐ€์ด๋“œ",
  guide_lead:`์ „๊ณ ์ฒด ์ „์ง€๋Š” ๋ฆฌํŠฌ ์ด์˜จ์ด <b>๊ณ ์ฒด ์•ˆ์„</b> ์ง€๋‚˜๊ฐ€์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ๊ทธ ๋ฌผ์งˆ์€ ๋™์‹œ์—
    <b>์ „์ž๋Š” ํ†ต๊ณผ์‹œํ‚ค์ง€ ์•Š์•„์•ผ</b> ํ•˜๊ณ , ์ถฉ์ „ ์ „์••์„ ๊ฒฌ๋ŽŒ์•ผ ํ•˜๊ณ , ์Œ๊ทน์˜ <b>๋ฆฌํŠฌ ๊ธˆ์†</b>์— ๋‹ฟ์•„๋„
    ๋ถ„ํ•ด๋˜์ง€ ์•Š์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋„ค ๊ฐ€์ง€๋ฅผ ํ•œ ๋ฌผ์งˆ์—์„œ ๋™์‹œ์— ๋งŒ์กฑ์‹œํ‚ค๋Š” ๊ฒƒ์ด ์•„์ง ํ’€๋ฆฌ์ง€ ์•Š์€ ๋ฌธ์ œ์ž…๋‹ˆ๋‹ค.`,
  facts:[
    ["ํ‘œ์ ", "๋ฆฌํŠฌ์ด ์ง€๋‚˜๊ฐˆ ํ†ต๋กœ๊ฐ€ ์žˆ๋Š” ๊ณ ์ฒด. ๋ฆฌํŠฌ์„ ๋ฐ˜๋“œ์‹œ ํฌํ•จํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค."],
    ["๋„˜์–ด์•ผ ํ•  ๊ด€๋ฌธ", "์ „์ž๊ฐ€ ํ†ตํ•˜๋ฉด ์ „์ง€๊ฐ€ ๊ทธ๋Œ€๋กœ ๋‹จ๋ฝ๋ฉ๋‹ˆ๋‹ค. ์ „์ž ์ ˆ์—ฐ์„ฑ์ด ์ „์ œ ์กฐ๊ฑด์ž…๋‹ˆ๋‹ค."],
    ["๊ฐ€์žฅ ์–ด๋ ค์šด ๊ณณ", "์‚ฐํ™” ์•ˆ์ •์„ฑ๊ณผ ๋ฆฌํŠฌ๊ธˆ์† ์•ˆ์ •์„ฑ์€ ์„œ๋กœ ์ž˜ ์•ˆ ๋งž์Šต๋‹ˆ๋‹ค. ๋‘˜ ๋‹ค ์žก๋Š” ๊ฒƒ์ด ์ด ์‹œ์ฆŒ์˜ ๊ณผ์ œ์ž…๋‹ˆ๋‹ค."],
    ["์ œ์ถœ", "์กฐ์„ฑ ํ•˜๋‚˜. ๊ตฌ์กฐ(CIF)๋Š” ์„ ํƒ์ด๋ฉฐ, ๋‚ด๋ฉด ์ฑ„์ ์ด ๋” ๋น ๋ฅด๊ณ  ์ •ํ™•ํ•ฉ๋‹ˆ๋‹ค."]],
  guide_how:`<p style="margin:14px 0 2px">์•„๋ž˜ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์“ฐ์‹œ๋Š” AI ๋ชจ๋ธ์— ๊ทธ๋Œ€๋กœ ๋„ฃ์œผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
    <b>๋ณต์‚ฌ</b> ๋ฒ„ํŠผ์œผ๋กœ ๊ฐ€์ ธ๊ฐ€์‹  ๋’ค, ๊ธฐ์šธ์ž„์ฒด๋กœ ํ‘œ์‹œ๋œ ๋ถ€๋ถ„์€ ๋ณธ์ธ ๊ด€์‹ฌ์‚ฌ๋กœ ๋ฐ”๊ฟ” ์ฃผ์‹ญ์‹œ์˜ค โ€”
    ๊ทธ๋ž˜์•ผ ๋‹ค๋ฅธ ์ฐธ๊ฐ€์ž์™€ ๊ฐ™์€ ํ›„๋ณด๊ฐ€ ๊ฒน์น˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋‚˜์˜จ ์กฐ์„ฑ์„ ์˜ค๋ฅธ์ชฝ ์นธ์— ํ•˜๋‚˜์”ฉ ์ œ์ถœํ•˜์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.</p>`,
  models_h:"AI ๋ชจ๋ธ๋ณ„ ์„ฑ๊ณผ",
  models_lead:`์–ด๋А ๋ชจ๋ธ์ด <b>๊ฐ€์žฅ ์ข‹์€ ํ›„๋ณด</b>๋ฅผ ๋ƒˆ๋Š”์ง€(๋ง‰๋Œ€)์™€ <b>์–ผ๋งˆ๋‚˜ ์“ฐ์ด๋Š”์ง€</b>(์˜ค๋ฅธ์ชฝ)๋ฅผ
    ํ•จ๊ป˜ ๋ด…๋‹ˆ๋‹ค. ๋งŽ์ด ์“ฐ์ธ๋‹ค๊ณ  ์ž˜ํ•˜๋Š” ๊ฒƒ์€ ์•„๋‹ˆ๋ฏ€๋กœ ๋”ฐ๋กœ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.`,
  mempty:"์ฑ„์ ๋œ ์ œ์ถœ์ด ์Œ“์ด๋ฉด ๋ชจ๋ธ๋ณ„ ์„ฑ๊ณผ๊ฐ€ ์—ฌ๊ธฐ์— ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.",
  mcounts:(m,n)=>`๋ชจ๋ธ ${m} ยท ์ œ์ถœ ${n}`,
  mlegend:`<span><i></i>์ตœ๊ณ  ์ ์ˆ˜</span><span><u></u>ํ‰๊ท </span><span>์ œ์ถœ ์ˆ˜</span>`,
  tabs:{board:"๋Œ€ํšŒ ยท ์ˆœ์œ„ํ‘œ", guide:"์ฐธ๊ฐ€ ๊ฐ€์ด๋“œ", models:"๋ชจ๋ธ๋ณ„ ์„ฑ๊ณผ"},
  tracks:{all:"์ „์ฒด", mp:"MP ์ˆ˜๋ก (MP ๊ฐ’์œผ๋กœ ์ฑ„์ )", novel:"์‹ ๊ทœ ์กฐ์„ฑ (์ง์ ‘ ๊ณ„์‚ฐ)"},
  tracknote:"MP ์— ๊ฐ’์ด ์žˆ์œผ๋ฉด ๊ทธ ๊ฐ’์„, ์—†์œผ๋ฉด ์ €ํฌ๊ฐ€ ์ง์ ‘ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. ๋‘ ์ž์˜ ๋ˆˆ๊ธˆ์ด ๋‹ฌ๋ผ (๊ฐ™์€ ์กฐ์„ฑ 40๊ฑด ์‹ค์ธก, ์ง์ ‘ ๊ณ„์‚ฐ ์ชฝ์ด 88%์—์„œ ํ‰๊ท  1.0์  ๋‚ฎ์Œ) ์ˆœ์œ„๋ฅผ ๋”ฐ๋กœ ๋งค๊น๋‹ˆ๋‹ค.",
  divs:{all:"์ „์ฒด", fluoride:"๋ถˆํ™”๋ฌผ", halide:"์—ผํ™”ยท๋ธŒ๋กฌํ™”ยท์š”์˜ค๋“œํ™”", sulfide:"ํ™ฉํ™”๋ฌผ",
        oxide:"์‚ฐํ™”๋ฌผ", nitride:"์งˆํ™”๋ฌผ", hydride:"์ˆ˜์†Œํ™”๋ฌผ", other:"๊ธฐํƒ€"},
  divnote:"์Œ์ด์˜จ ๊ณจ๊ฒฉ์— ๋”ฐ๋ผ ๋ถ€๋ฌธ์„ ๋‚˜๋ˆด์Šต๋‹ˆ๋‹ค. <b>์ ์ˆ˜๋Š” ๋ถ€๋ฌธ๊ณผ ๋ฌด๊ด€ํ•˜๊ฒŒ ๋™์ผํ•œ ๊ธฐ์ค€</b>์œผ๋กœ ๋งค๊ฒจ์ง€๋ฉฐ, ๋ถ€๋ฌธ์€ ๊ฐ™์€ ํ™”ํ•™ ๊ณ„์—ด ์•ˆ์—์„œ ๋น„๊ตํ•˜์‹œ๋ผ๊ณ  ๋‘” ๊ฒƒ์ž…๋‹ˆ๋‹ค.",
  xlink:`๐Ÿงช <b>Open Discovery Challenge</b> <em>โ€” ์‹ ์•ฝ ํ›„๋ณด ๋ฌผ์งˆ์„ ์ฐพ๋Š” ์ž๋งค ๋Œ€ํšŒ</em> โ†—`,
    xlink2:`๐ŸŽฏ <b>LEADBOARD</b> <em>โ€” ์‹ ์•ฝ ์˜ˆ์ธก ๋„๊ตฌ๋ฅผ ๋ถ„์•ผ๋ณ„๋กœ ์žฌ๋Š” ์‹œํ—˜๋Œ€</em> โ†—`,
  sinfo:(o,c)=>[`์‹œ์ฆŒ ๊ธฐ๊ฐ„ <b>${o} ~ ${c}</b>`,`์ƒ๊ธˆ <b>์—†์Œ</b>`,`์ œ์ถœ <b>์กฐ์„ฑ ํ•˜๋‚˜</b>`],
  axhelp:[
   ["์‚ฐํ™” ์•ˆ์ •์„ฑ","์ถฉ์ „ ์ „์••์ด ๋†’์•„์กŒ์„ ๋•Œ ์ „ํ•ด์งˆ ์ž์‹ ์ด ๋ถ„ํ•ด๋˜์ง€ ์•Š๊ณ  ๋ฒ„ํ‹ฐ๋Š” ์ •๋„."],
   ["Li๊ธˆ์† ์•ˆ์ •์„ฑ","๋ฆฌํŠฌ ๊ธˆ์† ์Œ๊ทน์— ๋‹ฟ์•˜์„ ๋•Œ ๋ฐ˜์‘ํ•ด ๋ง๊ฐ€์ง€์ง€ ์•Š๋Š” ์ •๋„."],
   ["์šฉ๋„ ์‹ ๊ทœ์„ฑ","์ด ์กฐ์„ฑ์ด ๊ณ ์ฒด์ „ํ•ด์งˆ ์šฉ๋„๋กœ ๋ณด๊ณ ๋œ ์ ์ด ์—†์„์ˆ˜๋ก ๋†’์Šต๋‹ˆ๋‹ค."],
   ["๋ฆฌํŠฌ ์ด๋™ ๊ฒฝ๋กœ","์ ์ˆ˜๊ฐ€ ์•„๋‹ˆ๋ผ <b>์ฐธ๊ฐ€ ์กฐ๊ฑด</b>์ž…๋‹ˆ๋‹ค. ๋ฆฌํŠฌ์ด ์ง€๋‚˜๊ฐˆ ๊ด€ํ†ต ๊ฒฝ๋กœ๊ฐ€ ์—†์œผ๋ฉด ์ ‘์ˆ˜๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค."]],
  limits:(L)=>`์ œ์ถœ ์ œํ•œ โ€” ๋ฆฌํŠฌ ํ•„์ˆ˜ ยท ๊ธฐ์•ฝ ์กฐ์„ฑ ์›์ž ์ˆ˜ ${L.max_atoms}๊ฐœ ์ดํ•˜ ยท ์›์†Œ 6์ข… ์ดํ•˜.
    ๊ฐ™์€ ๋ฌผ์งˆ์„ ์ •์ˆ˜๋ฐฐ๋กœ ๋ฐ”๊ฟ” ๋‹ค์‹œ ๋‚ด๋ฉด ๊ฐ™์€ ์ œ์ถœ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค.`,
  detail_h:"์ฑ„์  ๋‚ด์—ญ",
  board_h:"์ˆœ์œ„ํ‘œ",
  boardnote:`<b>๊ธฐ์ค€๋ฌผ์งˆ(๋…ธ๋ž€ ํ–‰)</b>์€ ์ ์ˆ˜๋ฅผ ๋ฐ›๋˜ ๋“ฑ์ˆ˜๋ฅผ ๊ฐ–์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์‹ค์ œ๋กœ ์“ฐ์ด๋Š” ์ „ํ•ด์งˆ์ด ๋ช‡ ์ ์ธ์ง€
    ๋ˆˆ์œผ๋กœ ๋น„๊ตํ•˜์‹œ๋ผ๊ณ  ๋„ฃ์—ˆ์Šต๋‹ˆ๋‹ค.<br>
    ๋น„๊ณต๊ฐœ ์ œ์ถœ์€ ์กฐ์„ฑ์„ ๊ฐ€๋ฆฌ๊ณ  <b>์›์†Œ ์ข…๋ฅ˜๋งŒ</b> ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ์›๋ณธ์€ ๋น„๊ณต๊ฐœ๋กœ ๋ณด๊ด€๋ฉ๋‹ˆ๋‹ค.<br>
    <b>๊ตฌ์กฐ ํ•„์š” ยท ๋น„๊ต์ž๋ฃŒ ๋ถ€์กฑ</b>๋Š” ์ฑ„์  ์š”๊ฑด์ด ๊ฐ–์ถฐ์ง€์ง€ ์•Š์€ ์ƒํƒœ์ž…๋‹ˆ๋‹ค. 0์ ์œผ๋กœ ๊ธฐ๋กํ•˜์ง€
    ์•Š๊ณ  ๋“ฑ์ˆ˜๋„ ๋งค๊ธฐ์ง€ ์•Š์Šต๋‹ˆ๋‹ค โ€” ์žฌ์ง€ ์•Š์€ ๊ฒƒ์„ ์„ฑ์ ์œผ๋กœ ์ ์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.
    <b>๋Œ€๋ถ€๋ถ„์€ ๊ตฌ์กฐ ํŒŒ์ผ(CIF)์„ ์ฒจ๋ถ€ํ•ด ๋‹ค์‹œ ์ œ์ถœํ•˜์‹œ๋ฉด ์ฑ„์ ๋ฉ๋‹ˆ๋‹ค.</b> ํ–‰์„ ๋ˆ„๋ฅด๋ฉด ํ•„์š”ํ•œ ๊ฒƒ์ด ๋‚˜์˜ต๋‹ˆ๋‹ค.<br>
    ์—ด ์ œ๋ชฉ์„ ๋ˆŒ๋Ÿฌ ์ •๋ ฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.`,
  submit_h:"์ œ์ถœ",
  l_formula:"์กฐ์„ฑ (ํ™”ํ•™์‹)", l_name:"ํ‘œ์‹œ ID (์ด๋ฆ„ยท์†Œ์†ยท๋‹‰๋„ค์ž„)", l_model:"์‚ฌ์šฉ ๋ชจ๋ธ๋ช… (์„ ํƒ)",
  l_cif:"๊ตฌ์กฐ ํŒŒ์ผ CIF (์„ ํƒ)", l_why:"์„ค๊ณ„ ๊ทผ๊ฑฐ (์„ ํƒ)", l_vis:"๊ณต๊ฐœ ์—ฌ๋ถ€",
  cifnote:`๊ตฌ์กฐ๋ฅผ ํ•จ๊ป˜ ๋‚ด๋ฉด ๋” ๋น ๋ฅด๊ณ  ์ •ํ™•ํ•˜๊ฒŒ ์ฑ„์ ๋ฉ๋‹ˆ๋‹ค. ์—†์œผ๋ฉด ์ €ํฌ๊ฐ€ ๊ตฌ์กฐ๋ฅผ ์ถ”์ •ํ•˜๋ฉฐ,
    ์ถ”์ •์ด ๋˜์ง€ ์•Š๋Š” ์กฐ์„ฑ์€ <b>๊ตฌ์กฐ ํ•„์š”</b>๋กœ ํ‘œ์‹œ๋˜๊ณ  ๊ตฌ์กฐ๋ฅผ ์ฒจ๋ถ€ํ•ด ๋‹ค์‹œ ์ œ์ถœํ•˜์‹œ๋ฉด ์ฑ„์ ๋ฉ๋‹ˆ๋‹ค.`,
  priv:"๐Ÿ”’ ๋น„๊ณต๊ฐœ (๊ธฐ๋ณธ)", pub:"๐Ÿ”“ ์กฐ์„ฑ ๊ณต๊ฐœ",
  go:"์ œ์ถœํ•˜๊ธฐ",
  gate:"์ œ์ถœํ•˜๋ ค๋ฉด <b>Hugging Face ๋กœ๊ทธ์ธ</b>์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ œ์ถœ์ž ๊ณ„์ •์ด ์ˆœ์œ„ํ‘œ์— ํ•จ๊ป˜ ํ‘œ์‹œ๋˜๋ฉฐ, ์ด๋Š” ๋‹ค๋ฅธ ์‚ฌ๋žŒ ์ด๋ฆ„์œผ๋กœ ์˜ฌ๋ฆฌ๋Š” ๊ฒƒ์„ ๋ง‰๊ณ  ๋ชจ๋ธ๋ณ„ ์ง‘๊ณ„๋ฅผ ์‹ ๋ขฐํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค.",
  signin:"Hugging Face ๋กœ ๋กœ๊ทธ์ธ", signout:"๋กœ๊ทธ์•„์›ƒ", signed_as:"๋กœ๊ทธ์ธ:",
  broker_h:"์ œ์ถœ ๊ธฐ๋ก๊ณผ ์ œ3์ž ์—ฐ๊ฒฐ",
  broker:`<p>์ œ์ถœ์€ ์‹œ๊ฐ๊ณผ ํ•จ๊ป˜ ์ €ํฌ ์›์žฅ์— ๊ธฐ๋ก๋ฉ๋‹ˆ๋‹ค. ์กฐ์„ฑ์„ <b>๋น„๊ณต๊ฐœ</b>๋กœ ๋‘๋ฉด ์ €ํฌ๋งŒ ๋ณด๊ด€ํ•˜๋ฉฐ,
    ๊ณต๊ฐœํ•˜์ง€ ์•Š๋Š” ํ•œ ์™ธ๋ถ€์— ๋“œ๋Ÿฌ๋‚˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ด ๊ธฐ๋ก์ด ํ–ฅํ›„ ๊ถŒ๋ฆฌ ์ฃผ์žฅ์— ์ฐธ๊ณ ๊ฐ€ ๋  ์ˆ˜ ์žˆ์œผ๋‚˜,
    <b>ํŠนํ—ˆ ์ถœ์›์„ ๋Œ€์‹ ํ•˜์ง€ ์•Š์œผ๋ฉฐ ๋ฒ•์  ํšจ๋ ฅ์„ ๋ณด์žฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.</b> ์ถœ์›์€ ์ „๋ฌธ๊ฐ€์™€ ์ƒ์˜ํ•˜์‹ญ์‹œ์˜ค.</p>
   <p>์ œ3์ž๊ฐ€ ํŠน์ • ์ œ์ถœ์— ๋Œ€ํ•ด ํ˜‘์˜๋ฅผ ์š”์ฒญํ•˜๋Š” ๊ฒฝ์šฐ, ์šด์˜์ž๊ฐ€ <b>์ค‘๊ฐœ</b>ํ•ฉ๋‹ˆ๋‹ค.
    ์ œ์ถœ์ž์˜ ์‹ ์›์ด๋‚˜ ์—ฐ๋ฝ์ฒ˜๋Š” <b>๋ณธ์ธ ๋™์˜ ์—†์ด ์ „๋‹ฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.</b></p>`,
  cols:{rank:"#",cand:"ํ›„๋ณด",user:"์ œ์ถœ์ž",who:"๋ชจ๋ธ",date:"์ œ์ถœ์ผ",
        oxidation:"์‚ฐํ™”",li_stability:"Li์•ˆ์ •",migration:"์ด๋™",novelty:"์‹ ๊ทœ",total:"์ด์ "},
  counts:(a,b,h)=>`์ฑ„์  ${a} ยท ๊ธฐ์ค€๋ฌผ์งˆ ${b}` + (h ? ` ยท ๋ฏธ์‚ฐ์ถœ ${h}` : ""),
  prange:(a,b,n)=>`${a.toLocaleString()}โ€“${b.toLocaleString()} / ์ „์ฒด ${n.toLocaleString()}`,
  empty:"์•„์ง ์ฑ„์ ๋œ ์ œ์ถœ์ด ์—†์Šต๋‹ˆ๋‹ค.",
  fail:"์ˆœ์œ„ํ‘œ๋ฅผ ๋ถˆ๋Ÿฌ์˜ค์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค: ",
  ok:(id,q)=>`์ ‘์ˆ˜๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ํ›„๋ณด ID <b>${id}</b> ยท ๋Œ€๊ธฐ ${q}๊ฑด`,
  need:"์กฐ์„ฑ๊ณผ ํ‘œ์‹œ ID๋ฅผ ์ž…๋ ฅํ•ด ์ฃผ์„ธ์š”.",
  hold:"๋ฏธ์‚ฐ์ถœ",
  holds:{need_structure:"๊ตฌ์กฐ ํ•„์š”", no_reference:"๋น„๊ต์ž๋ฃŒ ๋ถ€์กฑ", no_value:"์‚ฐ์ถœ ๋ถˆ๊ฐ€"},
  holdnote:"์•„๋ž˜ ์š”๊ฑด์„ ๊ฐ–์ถฐ ๋‹ค์‹œ ์ œ์ถœํ•˜์‹œ๋ฉด ์ฑ„์ ๋ฉ๋‹ˆ๋‹ค."
 },
 en:{
  sub:"Open problems, worked on together โ€” materials discovery anyone can join",
  about_h:"What this is",
  about:`<p>A solid-state battery replaces the liquid electrolyte of a lithium-ion cell with a solid.
    It can be safer and last longer, but finding a material that is <b>solid and still lets lithium through</b>
    remains unsolved.</p>
   <p>This challenge looks for candidates. You submit <b>one composition</b> โ€” for example <code>Li3YCl6</code>.
    We score it computationally and place it on the board. There is no prize.</p>`,
  honest:`<b>What this season scores.</b> <b>Electrochemical robustness</b>: whether the material holds up at
    high voltage, survives contact with lithium metal, and has a path for lithium to move through.
    <b>Ionic conductivity is not a scored axis this season.</b> A highly conductive family therefore still
    scores low if its oxidation window is narrow or it reacts with lithium metal โ€” those two are the problem
    this season puts to you.
    Every value is a <b>computational estimate</b> and implies nothing about real performance or safety.`,
  guide_h:"How to take part",
  guide_lead:`In a solid-state cell the lithium ion has to travel <b>through a solid</b>. That same solid
    must <b>block electrons</b>, hold up at the charging voltage, and survive contact with the
    <b>lithium metal</b> anode without decomposing. Meeting all four in one material is the open problem.`,
  facts:[
    ["Target", "A solid with a path for lithium to move through. It must contain lithium."],
    ["Get past this", "If electrons pass, the cell simply shorts. Electronic insulation is a precondition."],
    ["Hardest part", "Oxidation stability and lithium-metal stability pull against each other. Holding both is the task."],
    ["Submission", "One composition. A structure (CIF) is optional and makes scoring faster and more accurate."]],
  guide_how:`<p style="margin:14px 0 2px">Paste a prompt below into the model you use. Hit <b>Copy</b>,
    then change the italicised part to something of your own โ€” otherwise your candidates will collide with
    other entrants'. Submit the compositions it returns, one at a time, on the right.</p>`,
  models_h:"By model",
  models_lead:`Which model produced the <b>best candidate</b> (bar) and <b>how often it is used</b> (right).
    Being used a lot is not the same as doing well, so the two are shown separately.`,
  mempty:"Model standings appear here once scored entries accumulate.",
  mcounts:(m,n)=>`${m} models ยท ${n} entries`,
  mlegend:`<span><i></i>Best score</span><span><u></u>Mean</span><span>Entries</span>`,
  tabs:{board:"Challenge ยท Board", guide:"How to take part", models:"By model"},
  tracks:{all:"All", mp:"In MP (scored on MP values)", novel:"Novel (computed here)"},
  tracknote:"Where Materials Project has a value we use it; where it does not, we compute one. The two rulers disagree (40 identical compositions measured; the computed path scores 1.0 point lower on 88% of them), so the two are ranked separately.",
  divs:{all:"All", fluoride:"Fluoride", halide:"Chloride / bromide / iodide", sulfide:"Sulfide",
        oxide:"Oxide", nitride:"Nitride", hydride:"Hydride", other:"Other"},
  divnote:"Divisions follow the anion framework. <b>Scores are identical across divisions</b> - the split is there so you can compare within a chemical family.",
  xlink:`๐Ÿงช <b>Open Discovery Challenge</b> <em>โ€” the sister challenge, for drug candidates</em> โ†—`,
    xlink2:`๐ŸŽฏ <b>LEADBOARD</b> <em>โ€” the benchmark for drug prediction tools</em> โ†—`,
  sinfo:(o,c)=>[`Season <b>${o} โ€“ ${c}</b>`,`Prize <b>none</b>`,`Submit <b>one composition</b>`],
  axhelp:[
   ["Oxidation","How well the electrolyte itself resists decomposing as the cell voltage rises."],
   ["Li-metal stability","How well it survives contact with a lithium-metal anode."],
   ["Use novelty","Higher when the composition has not been reported as a solid electrolyte."],
   ["Lithium pathway","Not a score but an <b>entry condition</b>: without a percolating path for lithium, an entry is not accepted."]],
  limits:(L)=>`Limits โ€” lithium required ยท at most ${L.max_atoms} atoms in the reduced composition ยท
    at most 6 elements. Re-submitting the same material as an integer multiple counts as the same entry.`,
  detail_h:"How this was scored",
  board_h:"Leaderboard",
  boardnote:`<b>Reference materials (amber rows)</b> are scored but hold no rank. They are there so you can see
    where materials in actual use land.<br>
    Private entries show <b>elements only</b>; the composition is held back.<br>
    <b>Structure needed / no reference data</b> means the requirements for scoring are not yet met.
    Nothing is recorded as zero and no rank is assigned - an unmeasured entry is not given a standing.
    <b>Most cases are scored once a structure file (CIF) is attached and the entry resubmitted.</b>
    Click the row to see what is required.<br>
    Click a column header to sort.`,
  submit_h:"Submit",
  l_formula:"Composition (formula)", l_name:"Display ID (name, affiliation or handle)",
  l_model:"Model used (optional)", l_cif:"Structure file, CIF (optional)",
  l_why:"Design rationale (optional)", l_vis:"Visibility",
  cifnote:`Including a structure makes scoring faster and more accurate. Without one we estimate the
    structure; where that is not possible the entry is marked <b>structure needed</b> and is scored
    once a structure is attached and it is resubmitted.`,
  priv:"๐Ÿ”’ Private (default)", pub:"๐Ÿ”“ Show composition",
  go:"Submit",
  gate:"Submitting requires a <b>Hugging Face sign-in</b>. Your account appears alongside the entry, which stops anyone posting under another person's name and keeps the per-model standings trustworthy.",
  signin:"Sign in with Hugging Face", signout:"Sign out", signed_as:"Signed in as",
  broker_h:"Record of submission, and third-party contact",
  broker:`<p>Entries are recorded with a timestamp in our ledger. A <b>private</b> composition stays with us and
    is not disclosed unless you choose to publish it. This record may serve as a reference later, but it
    <b>is not a patent filing and carries no guaranteed legal effect.</b> Consult a professional before filing.</p>
   <p>If a third party asks to discuss a specific entry, we pass the request along. We never share a
    submitter's identity or contact details <b>without their consent.</b></p>`,
  cols:{rank:"#",cand:"Entry",user:"Submitter",who:"Model",date:"Date",
        oxidation:"Oxid.",li_stability:"Li-stab.",migration:"Migration",novelty:"Novelty",total:"Total"},
  counts:(a,b,h)=>`${a} scored ยท ${b} references` + (h ? ` ยท ${h} not scored` : ""),
  prange:(a,b,n)=>`${a.toLocaleString()}โ€“${b.toLocaleString()} of ${n.toLocaleString()}`,
  empty:"No entries have been scored yet.",
  fail:"Could not load the leaderboard: ",
  ok:(id,q)=>`Accepted. Entry <b>${id}</b> ยท ${q} in queue`,
  need:"Please enter a composition and a display ID.",
  hold:"not scored",
  holds:{need_structure:"structure needed", no_reference:"no reference data", no_value:"no value"},
  holdnote:"Meet the requirement below and resubmit; the entry will then be scored."
 }
};

// ํ”„๋กฌํ”„ํŠธ๋Š” **๋ชฉํ‘œ**๋งŒ ๋งํ•œ๋‹ค. ๋ฌด์—‡์„ ์–ด๋–ป๊ฒŒ ์žฌ๋Š”์ง€๋Š” ์ ์ง€ ์•Š๋Š”๋‹ค - ์ ์œผ๋ฉด ๋ฌผ์งˆ์ด ์•„๋‹ˆ๋ผ
// ์ฑ„์ ๊ธฐ๋ฅผ ๊ฒจ๋ƒฅํ•œ ์ œ์ถœ์ด ๋“ค์–ด์˜จ๋‹ค.
const PROMPTS_BY_SEASON = {
 1: [
  {id:"A", ko:["๊ธฐ๋ณธํ˜•","์ฒ˜์Œ ์‹œ์ž‘ํ•œ๋‹ค๋ฉด ์ด๊ฒƒ๋ถ€ํ„ฐ"], en:["Starter","Begin here"],
   body:`You are proposing candidate solid electrolytes for an all-solid-state lithium battery,
for an open materials challenge.

Requirements for every candidate:
- Contains lithium, with a plausible connected pathway for Li+ to migrate through the
  lattice.
- An electronic insulator. If electrons conduct, the cell short-circuits; this is a
  precondition, not a trade-off.
- Wide electrochemical window: stable against oxidation at high cell voltage.
- Stable in contact with lithium metal at the anode, or decomposing only into a passivating
  layer rather than an electronically conductive one.
- Plausibly synthesisable: a composition close to a stable phase, not an exotic guess.

Propose 8 candidate compositions as a JSON array:
[{"formula":"...","name":"...","rationale":"why lithium should move through it, why it
should not conduct electrons, and how it behaves against lithium metal"}]

Use plain chemical formulae, e.g. Li3YCl6 or LiZr2(PO4)3.

<em>VARY THIS: name a chemical family you want to explore (halides, oxides, phosphates,
oxyhalides, anti-perovskites, โ€ฆ) or a constraint of your own, so your set does not collide
with other entrants'. Identical submissions are rejected.</em>`},

  {id:"B", ko:["์‚ฐํ™” ์•ˆ์ •์„ฑ","๋†’์€ ์ „์••์„ ๊ฒฌ๋””๋Š” ์„ค๊ณ„ (40์ )"], en:["Oxidation","Holding up at high voltage (40 pts)"],
   body:`Propose solid lithium-ion electrolytes designed specifically for a WIDE oxidation
window, so they survive against a high-voltage cathode.

Reason from this:
- The anion is usually what oxidises first. Sulfide frameworks conduct well but oxidise at
  low potential; more electronegative anions push the oxidation limit higher.
- The counter-cation matters: a cation already in a high oxidation state has less room to
  be oxidised further.
- A material that resists oxidation but has no lithium pathway is worthless. A connected
  migration path is a precondition, not a trade-off.

For each candidate state explicitly: which anion framework you chose and why you expect it
to resist oxidation, and how lithium still moves through it.

Propose 8 candidates as JSON: [{"formula","name","rationale"}]

<em>VARY THIS: commit to ONE anion chemistry and build the whole set around it, rather than
eight unrelated guesses.</em>`},

  {id:"C", ko:["๋ฆฌํŠฌ๊ธˆ์† ์•ˆ์ •์„ฑ","์Œ๊ทน์—์„œ ๋ฒ„ํ‹ฐ๋Š” ์„ค๊ณ„ (35์ )"], en:["Lithium-metal stability","Surviving the anode (35 pts)"],
   body:`Propose solid lithium-ion electrolytes designed to survive direct contact with
LITHIUM METAL.

Reason from this:
- Lithium metal is strongly reducing. Any cation in the electrolyte that can be reduced
  will be. Transition metals in high oxidation states are the classic failure: they reduce,
  the interface becomes electronically conductive, and the reaction never stops.
- The useful case is a decomposition product that is itself an insulator, so the interface
  passivates and the reaction halts.
- Wide oxidation window alone does not help if the anode side fails. Both ends of the
  window matter.

For each candidate state explicitly: which element you expect lithium metal to attack, and
why the interface should stop reacting rather than keep going.

Propose 8 candidates as JSON: [{"formula","name","rationale"}]

<em>VARY THIS: choose one strategy โ€” reduction-proof cations, or a self-passivating
decomposition product โ€” and build the set around it.</em>`},

  {id:"D", ko:["์šฉ๋„ ์‹ ๊ทœ์„ฑ","๊ฐ€์žฅ ํฐ ์ ์ˆ˜ ์—ฌ์ง€ (25์ )"], en:["Use novelty","Where the headroom is (25 pts)"],
   body:`Propose lithium-containing compositions that are NOT already reported as solid
electrolytes.

Important distinction: the composition does not have to be brand new. What matters is
whether anyone has proposed it FOR THIS USE. A known compound that nobody has evaluated as
a lithium electrolyte is exactly the target; a well-studied electrolyte family is not.

So avoid the ones already worked over โ€” the common sulfide, garnet, NASICON and
argyrodite electrolyte families โ€” and look at lithium compounds studied for other reasons
entirely, or not studied much at all.

Every candidate must still meet the basics: a lithium migration path, electronic
insulation, and reasonable stability at both electrodes. Novelty with no function scores
nothing.

For each candidate state: what the composition is normally known for (if anything), and
why it might work as an electrolyte.

Propose 8 candidates as JSON: [{"formula","name","rationale"}]

<em>VARY THIS: pick one source of overlooked compounds โ€” a mineral class, a family studied
for optics or ionics elsewhere, a ternary system that is sparsely mapped โ€” and work it.</em>`}
 ]
};

const $ = s => document.querySelector(s);
const COLS = ["rank","cand","user","who","date","oxidation","li_stability","novelty","total"];
// ํ‘œ๊ฐ€ ์ปค์ง€๋ฉด ํ•œ๊บผ๋ฒˆ์— ๊ทธ๋ฆฌ์ง€ ์•Š๊ณ  ํ•œ ํŽ˜์ด์ง€์”ฉ ๊ทธ๋ฆฐ๋‹ค.
const PAGE_SIZE = 500;
let LANG = "ko", DATA = null, SEASONS = [], SEASON = 1;
let sortKey = "total", sortDir = -1, page = 0, DIV = "all", TRK = "all";
const t = () => T[LANG];

let ME = null;

function renderAuth(){
  const d = t(), g = $("#gate"), m = $("#me");
  if(!ME || !ME.oauth_configured){ g.style.display="none"; m.innerHTML=""; return; }
  if(ME.signed_in && ME.user){
    g.style.display = "none";
    const u = ME.user;
    const pic = u.picture ? `<img src="${esc(u.picture)}" alt="">` : "๐Ÿค—";
    m.innerHTML = `${pic}<span>${d.signed_as} ${hfProfile(u.name)}</span>`
                + `<a class="signin out" href="/logout" style="margin-left:auto">${esc(d.signout)}</a>`;
  } else {
    g.style.display = "block";
    g.innerHTML = d.gate;
    m.innerHTML = `<a class="signin" href="/login">๐Ÿค— ${esc(d.signin)}</a>`;
  }
}

function hfProfile(user){
  if(!user) return "";
  const url = `https://huggingface.co/${encodeURIComponent(user)}`;
  return `<a class="hf-user" href="${url}" target="_blank" rel="noopener noreferrer"`
       + ` title="Hugging Face: ${esc(user)}">๐Ÿค— ${esc(user)}</a>`;
}

function esc(s){ return String(s ?? "").replace(/[&<>"']/g,c=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[c])); }

function setLang(l){
  LANG = l;
  document.documentElement.lang = l;
  document.querySelectorAll("#langbar button").forEach(b=>b.classList.toggle("on", b.dataset.lang===l));
  const d = t();
  $("#t_sub").textContent = d.sub;
  $("#t_about_h").textContent = d.about_h;
  $("#t_about").innerHTML = d.about;
  $("#t_honest").innerHTML = d.honest;
  $("#t_board_h").textContent = d.board_h;
  $("#t_boardnote").innerHTML = d.boardnote;
  $("#t_submit_h").textContent = d.submit_h;
  $("#t_broker_h").textContent = d.broker_h;
  $("#t_broker").innerHTML = d.broker;
  $("#t_cifnote").innerHTML = d.cifnote;
  $("#xlink").innerHTML = d.xlink;
  { const x2 = document.querySelector("#xlink2"); if(x2 && d.xlink2) x2.innerHTML = d.xlink2; }
  renderAuth();
  $("#t_guide_h").textContent = d.guide_h;
  $("#t_guide_lead").innerHTML = d.guide_lead;
  $("#t_guide_how").innerHTML = d.guide_how;
  $("#t_models_h").textContent = d.models_h;
  $("#t_models_lead").innerHTML = d.models_lead;
  renderFacts();
  renderPrompts();
  renderTabs();
  renderSeasonInfo();
  renderAxHelp();
  $("#t_priv").textContent = d.priv;
  $("#t_pub").textContent = d.pub;
  $("#go").textContent = d.go;
  for(const k of ["formula","name","model","cif","why","vis"]) $("#l_"+k).textContent = d["l_"+k];
  const g = $("#gate"); if(g.style.display !== "none") g.innerHTML = d.gate;
  renderSeasonBar();
  if(DATA) render();
}
document.querySelectorAll("#langbar button").forEach(b=>b.onclick=()=>setLang(b.dataset.lang));

function renderSeasonBar(){
  $("#seasonbar").innerHTML = SEASONS.slice().sort((a,b)=>b.number-a.number).map(s=>{
    const nm = LANG==="ko" ? (s.topic_ko||s.topic) : s.topic;
    return `<button data-season="${s.number}" class="${s.number===SEASON?"on":""}">
      #${s.number} ${esc(nm)}</button>`;
  }).join("");
  document.querySelectorAll("#seasonbar button").forEach(b=>
    b.onclick=()=>{ SEASON=parseInt(b.dataset.season,10); page=0;
      renderSeasonBar(); renderPrompts(); renderSeasonInfo(); renderAxHelp();
      MODELS_LOADED = false; load(); if(TAB==="models"){ MODELS_LOADED=true; loadModels(); } });
}

function sortVal(e,k){
  if(k==="rank")  return e.rank ?? 1e9;
  if(k==="cand")  return String(e.candidate_id||"").toLowerCase();
  if(k==="user")  return String(e.hf_user||e.display_name||"").toLowerCase();
  if(k==="who")   return String(e.model_name||"").toLowerCase();
  if(k==="date")  return e.submitted_at ?? 0;
  if(k==="total") return e.total ?? -1;
  return (e.axes||{})[k] ?? -1;
}

let TAB = "board";

function renderTabs(){
  const d = t();
  $("#tabbar").innerHTML = ["board","guide","models"].map(k=>
    `<button data-tab="${k}" class="${k===TAB?"on":""}">${esc(d.tabs[k])}</button>`).join("");
  $("#tabbar").querySelectorAll("button").forEach(b=>b.onclick=()=>{
    TAB = b.dataset.tab; renderTabs(); showTab();
    window.scrollTo({top:0,behavior:"smooth"});
  });
}

function showTab(){
  document.querySelectorAll("section[data-tab]").forEach(sec=>{
    sec.hidden = sec.dataset.tab !== TAB;
  });
  // ๋ชจ๋ธ ์ง‘๊ณ„๋Š” ๊ทธ ํƒญ์„ ์—ด ๋•Œ ์ฒ˜์Œ ๋ถ€๋ฅธ๋‹ค. ์•ˆ ๋ณด๋Š” ํ™”๋ฉด์„ ์œ„ํ•ด ๋งค๋ฒˆ ๋ฐ›์•„์˜ฌ ์ด์œ ๊ฐ€ ์—†๋‹ค.
  if(TAB==="models" && !MODELS_LOADED){ MODELS_LOADED = true; loadModels(); }
}
let MODELS_LOADED = false;

function seasonInfo(){ return SEASONS.find(x=>x.number===SEASON) || SEASONS[0] || {}; }

function renderSeasonInfo(){
  const si = seasonInfo(), d = t();
  if(!si.opens){ $("#sinfo").innerHTML=""; return; }
  $("#sinfo").innerHTML = d.sinfo(si.opens, si.closes).map(x=>`<span>${x}</span>`).join("");
}

function renderAxHelp(){
  const d = t();
  $("#axhelp").innerHTML = (d.axhelp||[]).map(([k,v])=>
    `<div><b>${esc(k)}</b> โ€” ${esc(v)}</div>`).join("");
  const L = (seasonInfo().limits)||{};
  $("#t_limits").innerHTML = L.max_atoms ? d.limits(L) : "";
}

function promptsFor(){ return PROMPTS_BY_SEASON[SEASON] || PROMPTS_BY_SEASON[1]; }

function renderPrompts(){
  const d = t(), host = $("#prompts");
  if(!host) return;
  host.innerHTML = promptsFor().map((p,i)=>{
    const [title,sub] = (LANG==="ko" ? p.ko : p.en);
    return `<div class="pcard">
      <div class="phead"><span class="ptag">${p.id}</span><b>${esc(title)}</b><span>${esc(sub)}</span>
        <button class="pcopy" data-i="${i}">${LANG==="ko"?"๋ณต์‚ฌ":"Copy"}</button></div>
      <div class="pbody">${p.body.trim()}</div></div>`;
  }).join("");
  host.querySelectorAll(".pcopy").forEach(b=>b.onclick=async()=>{
    // ๊ฐ•์กฐ ํ‘œ์‹œ๋Š” ํ™”๋ฉด์šฉ์ด๋‹ค. ํด๋ฆฝ๋ณด๋“œ์—๋Š” ๊นจ๋—ํ•œ ๋ณธ๋ฌธ๋งŒ ๋„ฃ๋Š”๋‹ค.
    const raw = promptsFor()[+b.dataset.i].body.replace(/<\/?em>/g,"").trim();
    try{ await navigator.clipboard.writeText(raw); }
    catch(_){ const ta=document.createElement("textarea"); ta.value=raw;
      document.body.appendChild(ta); ta.select(); document.execCommand("copy"); ta.remove(); }
    const was=b.textContent;
    b.textContent = LANG==="ko" ? "๋ณต์‚ฌ๋จ โœ“" : "Copied โœ“";
    setTimeout(()=>{ b.textContent=was; },1500);
  });
}

function renderFacts(){
  const d = t();
  $("#facts").innerHTML = (d.facts||[]).map(([k,v])=>
    `<div class="fact"><b>${esc(k)}</b>${esc(v)}</div>`).join("");
}

function renderModels(m){
  const d = t(), host = $("#models");
  const rows = (m && m.models) || [];
  $("#mcounts").textContent = d.mcounts((m&&m.counts&&m.counts.models)||0,
                                        (m&&m.counts&&m.counts.entries)||0);
  $("#t_mlegend").innerHTML = d.mlegend;
  if(!rows.length){ host.innerHTML = `<div class="note">${d.mempty}</div>`; return; }
  const max = Math.max(...rows.map(r=>r.best), 1);
  host.innerHTML = rows.slice(0,14).map(r=>`
    <div class="mrow">
      <div class="mname" title="${esc(r.model)}">${esc(r.model)}</div>
      <div class="mbar"><i style="width:${(r.best/max*100).toFixed(1)}%"></i>
        <u style="left:${(r.mean/max*100).toFixed(1)}%"></u></div>
      <div class="mnum">${r.best.toFixed(1)} ยท ${r.n}</div>
    </div>`).join("");
}

async function loadModels(){
  try{ renderModels(await (await fetch(`/api/models?season=${SEASON}`)).json()); }
  catch(e){ renderModels(null); }
}

function renderDivBar(){
  const d = t(), host = $("#divbar");
  const tally = (DATA && DATA.divisions) || {};
  const keys = Object.keys(tally).sort((a,b)=>(tally[b]||0)-(tally[a]||0));
  if(!keys.length){ host.innerHTML=""; return; }
  const total = Object.values(tally).reduce((a,b)=>a+b,0);
  const btn = (k,n)=>`<button data-d="${k}" class="${k===DIV?"on":""}">${esc(d.divs[k]||k)}<span class="dn">${n}</span></button>`;
  host.innerHTML = btn("all",total) + keys.map(k=>btn(k,tally[k])).join("");
  host.querySelectorAll("button[data-d]").forEach(b=>b.onclick=()=>{
    DIV=b.dataset.d; page=0; render();
  });
}

function renderTrackBar(){
  const d = t(), host = $("#trackbar");
  if(!host) return;
  const tally = {all:0, mp:0, novel:0};
  (DATA.entries||[]).forEach(e=>{ if(e.is_anchor) return; tally.all++;
    if(e.track==="mp") tally.mp++; else if(e.track==="novel") tally.novel++; });
  if(!tally.mp && !tally.novel){ host.innerHTML=""; return; }
  const btn=(k,n)=>`<button data-k="${k}" class="${k===TRK?"on":""}">${esc(d.tracks[k]||k)}<span class="dn">${n}</span></button>`;
  host.innerHTML = btn("all",tally.all)+btn("mp",tally.mp)+btn("novel",tally.novel)
    + `<div class="sub" style="margin-top:6px">${esc(d.tracknote||"")}</div>`;
  host.querySelectorAll("button[data-k]").forEach(b=>b.onclick=()=>{
    TRK=b.dataset.k; page=0; render();
  });
}

function renderPager(total,pages){
  const host = $("#pager"), d = t();
  if(pages<=1){ host.innerHTML=""; return; }
  const from = page*PAGE_SIZE+1, to = Math.min(total,(page+1)*PAGE_SIZE);
  let nums=[];
  if(pages<=9){ for(let i=0;i<pages;i++) nums.push(i); }
  else{
    const near=[page-1,page,page+1].filter(i=>i>0&&i<pages-1);
    nums=[...new Set([0,...near,pages-1])].sort((a,b)=>a-b);
  }
  let out=`<button ${page===0?"disabled":""} data-p="${page-1}">โ€น</button>`, prev=-1;
  for(const i of nums){
    if(i-prev>1) out+=`<span class="gap">โ€ฆ</span>`;
    out+=`<button class="${i===page?"on":""}" data-p="${i}">${i+1}</button>`; prev=i;
  }
  out+=`<button ${page>=pages-1?"disabled":""} data-p="${page+1}">โ€บ</button>`;
  out+=`<span class="pinfo">${d.prange(from,to,total)}</span>`;
  host.innerHTML=out;
  host.querySelectorAll("button[data-p]").forEach(b=>b.onclick=()=>{
    if(b.disabled) return;
    page=parseInt(b.dataset.p,10); render();
    const c=document.querySelector(".card .scroll");
    if(c) window.scrollTo({top:c.getBoundingClientRect().top+window.scrollY-80,behavior:"smooth"});
  });
}

function render(){
  const d = t(), W = (DATA.season && DATA.season.weights) || {};
  $("#wts").innerHTML = Object.entries(W)
    .map(([k,v])=>`<span>${esc(d.cols[k]||k)} <b>${v}</b></span>`).join("");
  $("#counts").textContent = d.counts(DATA.counts.scored, DATA.counts.anchors, DATA.counts.held || 0);

  $("#head").innerHTML = COLS.map(k=>{
    const on = sortKey===k, ar = on ? (sortDir<0?"โ–ผ":"โ–ฒ") : "โ–พ";
    return `<th data-k="${k}" class="${on?"sorted":""}">${esc(d.cols[k]||k)}<span class="ar">${ar}</span></th>`;
  }).join("");
  document.querySelectorAll("#head th").forEach(th=>th.onclick=()=>{
    const k=th.dataset.k;
    if(sortKey===k) sortDir=-sortDir;
    else { sortKey=k; sortDir=(k==="rank"||k==="cand"||k==="who")?1:-1; }
    page=0; render();
  });

  renderDivBar();
  renderTrackBar();
  // ๋ถ€๋ฌธ์„ ๊ณ ๋ฅด๋ฉด ๊ทธ ๋ถ€๋ฌธ + ๊ธฐ์ค€๋ฌผ์งˆ๋งŒ ๋‚จ๊ธด๋‹ค. ๊ธฐ์ค€๋ฌผ์งˆ์€ ์ฒ™๋„๋ผ ํ•ญ์ƒ ๋ณด์—ฌ์•ผ ํ•œ๋‹ค.
  let pool = DIV==="all" ? DATA.entries
    : DATA.entries.filter(e=>e.is_anchor || e.division===DIV);
  // ๊ธฐ์ค€๋ฌผ์งˆ์€ ์ฒ™๋„๋ผ ์–ด๋А ํŠธ๋ž™์„ ๊ณจ๋ผ๋„ ๋‚จ๊ธด๋‹ค.
  if(TRK!=="all") pool = pool.filter(e=>e.is_anchor || e.track===TRK);
  const all = pool.slice().sort((a,b)=>{
    const x=sortVal(a,sortKey), y=sortVal(b,sortKey);
    if(x<y) return -sortDir; if(x>y) return sortDir; return 0;
  });
  const pages = Math.max(1, Math.ceil(all.length/PAGE_SIZE));
  if(page>=pages) page=pages-1;
  if(page<0) page=0;
  const rows = all.slice(page*PAGE_SIZE, page*PAGE_SIZE+PAGE_SIZE);
  renderPager(all.length, pages);

  { const bn = $("#t_boardnote"); if(bn) bn.innerHTML = d.boardnote + "<br>" + d.divnote; }
  $("#rows").innerHTML = rows.length ? rows.map(e=>{
    const a = e.axes||{};
    const unscored = !e.is_anchor && (e.total == null || (e.held_axes||[]).length > 0);
    const cls = [e.is_anchor?"anchor":"", unscored?"held":""].join(" ").trim();
    const who = e.is_anchor ? esc(e.display_name)
      : (e.hf_user ? hfProfile(e.hf_user)
         : `<span title="${esc(e.display_name||"")}">${esc(e.display_name||"โ€“")}</span>`);
    const num = k => {
      const v = a[k];
      return `<td class="num">${v==null?`<span class="pill">${d.hold}</span>`:v.toFixed(1)}</td>`;
    };
    const dt = e.submitted_at ? new Date(e.submitted_at*1000).toISOString().slice(0,10) : "";
    const hk = e.hold_kind && d.holds[e.hold_kind];
    const tot = e.total==null ? `<span class="pill warn">${esc(hk || d.hold)}</span>`
              : `${e.total.toFixed(1)}<span class="sub" style="font-size:11px"> /${e.total_max||100}</span>`
                + (unscored ? ` <span class="pill warn">${esc(hk || d.hold)}</span>` : "");
    const has = (e.detail && Object.keys(e.detail).length) || (unscored && e.gate);
    return `<tr class="${cls}${has?" pick":""}"${has?` data-i="${e.candidate_id}"`:""}>
      <td class="num">${(TRK!=="all" ? e.track_rank : (DIV==="all" ? e.rank : e.div_rank)) ?? "โ€”"}</td>
      <td>${esc(e.formula||e.candidate_id||"")}${e.masked?' <span class="pill">๐Ÿ”’</span>':""}</td>
      <td>${who}</td><td>${esc(e.model_name||"")}</td><td>${dt}</td>
      ${num("oxidation")}${num("li_stability")}${num("novelty")}
      <td class="num"><b>${tot}</b></td></tr>`;
  }).join("") : `<tr><td colspan="${COLS.length}" class="sub">${d.empty}</td></tr>`;

  // ์ฑ„์  ๊ทผ๊ฑฐ๋Š” ์ด๋ฏธ ์‘๋‹ต์— ๋“ค์–ด ์žˆ๋Š”๋ฐ ํ‘œ์—๋Š” ์•ˆ ๋ณด์˜€๋‹ค. ํ–‰์„ ๋ˆ„๋ฅด๋ฉด ์•„๋ž˜๋กœ ํŽผ์นœ๋‹ค.
  const byId = {}; rows.forEach(e=>{ if(e.candidate_id) byId[e.candidate_id]=e; });
  $("#rows").querySelectorAll("tr.pick").forEach(tr=>tr.onclick=()=>{
    const nxt = tr.nextElementSibling;
    if(nxt && nxt.classList.contains("det")){ nxt.remove(); return; }
    $("#rows").querySelectorAll("tr.det").forEach(x=>x.remove());
    const e = byId[tr.dataset.i]; if(!e) return;
    const items = Object.entries(e.detail||{})
      .map(([k,v])=>`<li><b>${esc(d.cols[k]||k)}</b> โ€” ${esc(v)}</li>`).join("")
      || (e.gate ? `<li>${esc(e.gate)}</li>` : "");
    const extra = (e.notes||[]).map(n=>`<li>${esc(n)}</li>`).join("");
    const note = e.note ? `<div style="margin-top:6px">${esc(e.note)}</div>`
               : (extra ? `<ul>${extra}</ul>` : "");
    const row = document.createElement("tr");
    row.className = "det";
    row.innerHTML = `<td colspan="${COLS.length}"><b>${esc(d.detail_h)}</b><ul>${items}</ul>${note}</td>`;
    tr.after(row);
  });
}

async function load(){
  try{
    const r = await fetch(`/api/leaderboard?season=${SEASON}`);
    DATA = await r.json();
    render();
  }catch(e){
    $("#rows").innerHTML = `<tr><td colspan="${COLS.length}" class="sub">${t().fail}${esc(e)}</td></tr>`;
  }
}

document.querySelectorAll('input[name="vis"]').forEach(r=>r.onchange=()=>{
  document.querySelectorAll("#visbox label").forEach(l=>l.classList.toggle("on", l.querySelector("input").checked));
});

$("#go").onclick = async () => {
  const d = t(), m = $("#msg");
  const formula = $("#f_formula").value.trim(), name = $("#f_name").value.trim();
  if(!formula || !name){ m.className="msg bad"; m.textContent=d.need; return; }
  $("#go").disabled = true;
  try{
    const r = await fetch("/api/submit",{method:"POST",headers:{"Content-Type":"application/json"},
      body:JSON.stringify({formula, display_name:name, model_name:$("#f_model").value.trim(),
        rationale:$("#f_why").value.trim(), structure:$("#f_cif").value.trim(),
        visibility:document.querySelector('input[name="vis"]:checked').value, season:SEASON})});
    const j = await r.json();
    if(!r.ok){ m.className="msg bad"; m.textContent = j.detail || ("HTTP "+r.status); }
    else{ m.className="msg ok"; m.innerHTML = d.ok(j.candidate_id, j.queue_position);
          $("#f_formula").value=""; $("#f_cif").value=""; load(); MODELS_LOADED=false; }
  }catch(e){ m.className="msg bad"; m.textContent=String(e); }
  $("#go").disabled = false;
};

(async function boot(){
  try{
    const s = await (await fetch("/api/seasons")).json();
    SEASONS = s.seasons || [];
    const open = SEASONS.filter(x=>x.open);
    SEASON = (open.length?open:SEASONS).slice(-1)[0]?.number || 1;
  }catch(e){}
  try{ ME = await (await fetch("/api/me")).json(); }catch(e){ ME = null; }
  renderAuth();
  setLang("ko");
  showTab();
  await load();
  setInterval(load, 20000);
  setInterval(()=>{ if(TAB==="models") loadModels(); }, 600000);
})();
</script>
</body>
</html>