File size: 21,745 Bytes
479b257
 
 
21d20c7
 
 
 
 
 
 
479b257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8d65b61
479b257
 
8d65b61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479b257
 
ae31891
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479b257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae31891
479b257
 
8d65b61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1995f8f
8d65b61
 
 
 
 
 
 
 
 
 
 
 
 
 
479b257
 
 
ae31891
 
 
 
 
 
 
 
 
8d65b61
ae31891
8d65b61
 
 
 
ae31891
8d65b61
 
ae31891
8d65b61
 
 
 
1995f8f
8d65b61
 
c7e9f96
8d65b61
 
ae31891
 
 
 
 
 
479b257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae31891
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479b257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d234e06
 
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
<!DOCTYPE html>
<html lang="ko">
<head>
    <script type="text/javascript">
        (function(c,l,a,r,i,t,y){
            c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
            t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
            y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
        })(window, document, "clarity", "script", "ujskfvh0bu");
    </script>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ν”„λ‘¬ν”„νŠΈ 관리 - SOY NV AI</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: #f5f5f5;
            color: #202124;
            line-height: 1.6;
        }

        .header {
            background: #ffffff;
            border-bottom: 1px solid #dadce0;
            padding: 16px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        }

        .header-title {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 18px;
            font-weight: 500;
        }

                .header-actions {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: wrap;
        }

        /* λ“œλ‘­λ‹€μš΄ 메뉴 μŠ€νƒ€μΌ */
        .dropdown {
            position: relative;
            display: inline-block;
        }

        /* λ²„νŠΌκ³Ό 메뉴 사이 'ν‹ˆ'μ—μ„œ hoverκ°€ 끊겨 메뉴가 λ‹«νžˆλŠ” ν˜„μƒ λ°©μ§€ */
        .dropdown::after {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            top: 100%;
            height: 8px;
        }

        .dropdown-toggle {
            padding: 8px 16px;
            background: #f1f3f4;
            color: #202124;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .dropdown-toggle:hover {
            background: #e8eaed;
        }

        .dropdown-toggle::after {
            content: 'β–Ό';
            font-size: 10px;
            transition: transform 0.2s;
        }

        .dropdown:hover .dropdown-toggle::after {
            transform: rotate(180deg);
        }

        .dropdown-menu {
            position: absolute;
            top: calc(100% + 4px);
            left: 0;
            margin-top: 0;
            background: white;
            border: 1px solid #dadce0;
            border-radius: 6px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            min-width: 200px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-8px);
            transition: all 0.2s ease;
            z-index: 10000;
            padding: 4px 0;
            pointer-events: none;
        }

        .dropdown:hover .dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
            pointer-events: auto;
        }

        

        .dropdown-item {
            display: block;
            padding: 10px 16px;
            color: #202124;
            text-decoration: none;
            font-size: 14px;
            transition: background 0.2s;
        }

        .dropdown-item:hover {
            background: #f8f9fa;
        }

        .dropdown-item:first-child {
            border-top-left-radius: 6px;
            border-top-right-radius: 6px;
        }

        .dropdown-item:last-child {
            border-bottom-left-radius: 6px;
            border-bottom-right-radius: 6px;
        }

        .menu-toggle {
            display: none;
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            padding: 8px;
            color: #202124;
        }

        .mobile-menu {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
        }

        .mobile-menu.active {
            display: block;
        }

        .mobile-menu-content {
            position: fixed;
            top: 0;
            right: -100%;
            width: 280px;
            max-width: 80%;
            height: 100%;
            background: white;
            box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
            transition: right 0.3s ease;
            overflow-y: auto;
            z-index: 1001;
        }

        .mobile-menu.active .mobile-menu-content {
            right: 0;
        }

        .mobile-menu-header {
            padding: 16px 20px;
            border-bottom: 1px solid #dadce0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: white;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .mobile-menu-title {
            font-size: 18px;
            font-weight: 500;
        }

        .mobile-menu-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #202124;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .mobile-menu-items {
            padding: 8px 0;
        }

        .mobile-menu-item {
            display: block;
            padding: 12px 20px;
            color: #202124;
            text-decoration: none;
            border-bottom: 1px solid #f1f3f4;
            transition: background 0.2s;
        }

        .mobile-menu-item:hover {
            background: #f8f9fa;
        }

        .mobile-menu-user {
            padding: 16px 20px;
            border-bottom: 1px solid #dadce0;
            color: #5f6368;
            font-size: 14px;
        }

        @media (max-width: 768px) {
            .header {
                padding: 12px 16px;
            }

            .header-title {
                font-size: 18px;
            }

            .header-title span:first-child {
                display: none;
            }

            .menu-toggle {
                display: block;
            }

            .header-actions {
                display: none;
            }
        }

        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            text-decoration: none;
            display: inline-block;
            transition: background-color 0.2s;
        }

        .btn-primary {
            background: #1a73e8;
            color: white;
        }

        .btn-primary:hover {
            background: #1557b0;
        }

        .btn-secondary {
            background: #f1f3f4;
            color: #202124;
        }

        .btn-secondary:hover {
            background: #e8eaed;
        }

        .btn-success {
            background: #34a853;
            color: white;
        }

        .btn-success:hover {
            background: #2d8e47;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 24px;
        }

        .page-header {
            margin-bottom: 24px;
        }

        .page-header h1 {
            font-size: 24px;
            margin-bottom: 8px;
        }

        .page-header p {
            color: #5f6368;
        }

        .prompt-editor {
            background: white;
            border-radius: 8px;
            padding: 24px;
            box-shadow: 0 1px 2px rgba(0,0,0,0.1);
            margin-bottom: 24px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #202124;
        }

        .form-group textarea {
            width: 100%;
            min-height: 300px;
            padding: 12px;
            border: 1px solid #dadce0;
            border-radius: 4px;
            font-size: 14px;
            font-family: 'Consolas', 'Monaco', monospace;
            resize: vertical;
            line-height: 1.5;
        }

        .form-group textarea:focus {
            outline: none;
            border-color: #1a73e8;
            box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
        }

        .form-help {
            margin-top: 8px;
            font-size: 12px;
            color: #5f6368;
        }

        .alert {
            padding: 12px 16px;
            border-radius: 4px;
            margin-bottom: 16px;
            display: none;
        }

        .alert.success {
            background: #e8f5e9;
            color: #137333;
            border: 1px solid #34a853;
        }

        .alert.error {
            background: #fce8e6;
            color: #c5221f;
            border: 1px solid #ea4335;
        }

        .alert.show {
            display: block;
        }

        .button-group {
            display: flex;
            gap: 12px;
            margin-top: 24px;
        }

        .prompt-info {
            background: #f8f9fa;
            border-left: 4px solid #1a73e8;
            padding: 16px;
            border-radius: 4px;
            margin-bottom: 24px;
        }

        .prompt-info h3 {
            margin-bottom: 8px;
            font-size: 16px;
        }

        .prompt-info p {
            margin-bottom: 4px;
            font-size: 14px;
            color: #5f6368;
        }
    </style>
</head>
<body>
    <div class="header">
        <div class="header-title">
            <span>πŸ“</span>
            <span>ν”„λ‘¬ν”„νŠΈ 관리</span>
        </div>
        <button class="menu-toggle" onclick="toggleMobileMenu()" aria-label="메뉴 μ—΄κΈ°">☰</button>
        <div class="header-actions">
            <span style="margin-right: 12px; color: #5f6368;">{{ current_user.nickname or current_user.username }}</span>
            
            {# μ‚¬μ΄νŠΈ 관리 #}
            <div class="dropdown">
                <button type="button" class="dropdown-toggle">μ‚¬μ΄νŠΈ 관리</button>
                <div class="dropdown-menu">
                    <a href="{{ url_for('main.admin') }}" class="dropdown-item">μ‚¬μš©μž 관리</a>
                    <a href="{{ url_for('main.admin_tokens') }}" class="dropdown-item">토큰 톡계</a>
                </div>
            </div>
            
            {# μ›Ήμ†Œμ„€ 관리 #}
            <div class="dropdown">
                <button type="button" class="dropdown-toggle">μ›Ήμ†Œμ„€ 관리</button>
                <div class="dropdown-menu">
                    <a href="{{ url_for('main.admin_webnovels') }}" class="dropdown-item">μ›Ήμ†Œμ„€ μ—…λ‘œλ“œ 및 관리</a>
                    <a href="{{ url_for('main.admin_messages') }}" class="dropdown-item">λ©”μ‹œμ§€ 확인</a>
                </div>
            </div>
            
            {# AI μ„€μ • #}
            <div class="dropdown">
                <button type="button" class="dropdown-toggle">AI μ„€μ •</button>
                <div class="dropdown-menu">
                    <a href="{{ url_for('main.admin_settings') }}" class="dropdown-item">AI μ„€μ •</a>
                    <a href="{{ url_for('main.admin_prompts') }}" class="dropdown-item">ν”„λ‘¬ν”„νŠΈ 관리</a>
                </div>
            </div>
            
            {# 챗봇 #}
            <div class="dropdown">
                <button type="button" class="dropdown-toggle">챗봇</button>
                <div class="dropdown-menu">
                    <a href="{{ url_for('main.admin_tags') }}" class="dropdown-item">νƒœκ·Έ/ν”„λ‘¬ν”„νŠΈ</a>
                    <a href="{{ url_for('main.admin_chatbot_prompts') }}" class="dropdown-item">챗봇 ν”„λ‘¬ν”„νŠΈ</a>
                </div>
            </div>
            
            {# 편의기λŠ₯ #}
            <div class="dropdown">
                <button type="button" class="dropdown-toggle">편의기λŠ₯</button>
                <div class="dropdown-menu">
                    <a href="{{ url_for('main.admin_utils') }}" class="dropdown-item">μœ ν‹Έ</a>
                </div>
            </div>
            
            {# λ©”μΈμœΌλ‘œ #}
            <a href="{{ url_for('main.index') }}" class="btn btn-secondary" style="padding: 8px 16px; font-size: 14px; margin-right: 4px;">λ©”μΈμœΌλ‘œ</a>
            <a href="{{ url_for('main.logout') }}" class="btn btn-secondary" style="padding: 8px 16px; font-size: 14px;">λ‘œκ·Έμ•„μ›ƒ</a>
        </div>
    </div>

    <!-- λͺ¨λ°”일 메뉴 -->
    <div class="mobile-menu" id="mobileMenu" onclick="closeMobileMenuOnBackdrop(event)">
        <div class="mobile-menu-content" onclick="event.stopPropagation()">
            <div class="mobile-menu-header">
                <div class="mobile-menu-title">메뉴</div>
                <button class="mobile-menu-close" onclick="toggleMobileMenu()" aria-label="메뉴 λ‹«κΈ°">&times;</button>
            </div>
            <div class="mobile-menu-user">{{ current_user.nickname or current_user.username }}</div>
            <div class="mobile-menu-items">
                <div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4;">μ‚¬μ΄νŠΈ 관리</div>
                <a href="{{ url_for('main.admin') }}" class="mobile-menu-item" onclick="closeMobileMenu()">μ‚¬μš©μž 관리</a>
                <a href="{{ url_for('main.admin_tokens') }}" class="mobile-menu-item" onclick="closeMobileMenu()">토큰 톡계</a>
                
                <div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">μ›Ήμ†Œμ„€ 관리</div>
                <a href="{{ url_for('main.admin_webnovels') }}" class="mobile-menu-item" onclick="closeMobileMenu()">μ›Ήμ†Œμ„€ μ—…λ‘œλ“œ 및 관리</a>
                <a href="{{ url_for('main.admin_messages') }}" class="mobile-menu-item" onclick="closeMobileMenu()">λ©”μ‹œμ§€ 확인</a>
                
                <div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">AI μ„€μ •</div>
                <a href="{{ url_for('main.admin_settings') }}" class="mobile-menu-item" onclick="closeMobileMenu()">AI μ„€μ •</a>
                <a href="{{ url_for('main.admin_prompts') }}" class="mobile-menu-item" onclick="closeMobileMenu()">ν”„λ‘¬ν”„νŠΈ 관리</a>
                
                <div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">챗봇</div>
                <a href="{{ url_for('main.admin_tags') }}" class="mobile-menu-item" onclick="closeMobileMenu()">νƒœκ·Έ/ν”„λ‘¬ν”„νŠΈ</a>
                <a href="{{ url_for('main.admin_chatbot_prompts') }}" class="mobile-menu-item" onclick="closeMobileMenu()">챗봇 ν”„λ‘¬ν”„νŠΈ</a>
                
                <div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">편의기λŠ₯</div>
                <a href="{{ url_for('main.admin_utils') }}" class="mobile-menu-item" onclick="closeMobileMenu()">μœ ν‹Έ</a>
                
                <div style="padding: 8px 20px; font-size: 11px; font-weight: 600; color: #5f6368; text-transform: uppercase; border-bottom: 1px solid #f1f3f4; margin-top: 8px;">기타</div>
                <a href="{{ url_for('main.index') }}" class="mobile-menu-item" onclick="closeMobileMenu()">λ©”μΈμœΌλ‘œ</a>
                <a href="{{ url_for('main.logout') }}" class="mobile-menu-item" onclick="closeMobileMenu()">λ‘œκ·Έμ•„μ›ƒ</a>
            </div>
        </div>
    </div>

    <div class="container">
        <div class="page-header">
            <h1>μ‹œμŠ€ν…œ ν”„λ‘¬ν”„νŠΈ 관리</h1>
            <p>μ§ˆλ¬Έν•  λ•Œ μžλ™μœΌλ‘œ λΆ™μ΄λŠ” ν”„λ‘¬ν”„νŠΈλ₯Ό μ„€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이 ν”„λ‘¬ν”„νŠΈλŠ” λŒ€ν™” λ©”μ‹œμ§€μ—λŠ” ν‘œμ‹œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.</p>
        </div>

        <div class="alert" id="alert"></div>

        <div class="prompt-info">
            <h3>πŸ’‘ ν”„λ‘¬ν”„νŠΈ μ‚¬μš© 방법</h3>
            <p>β€’ μ„€μ •ν•œ ν”„λ‘¬ν”„νŠΈλŠ” λͺ¨λ“  질문 μ•žμ— μžλ™μœΌλ‘œ λΆ™μ–΄μ„œ AIμ—κ²Œ μ „λ‹¬λ©λ‹ˆλ‹€.</p>
            <p>β€’ ν”„λ‘¬ν”„νŠΈλŠ” μ‚¬μš©μžμ—κ²ŒλŠ” 보이지 μ•ŠμœΌλ©°, AI 응닡 ν’ˆμ§ˆ ν–₯상을 μœ„ν•΄ μ‚¬μš©λ©λ‹ˆλ‹€.</p>
            <p>β€’ 예: "항상 μ •μ€‘ν•˜κ²Œ λ‹΅λ³€ν•˜μ„Έμš”." λ˜λŠ” "μ›Ήμ†Œμ„€μ˜ λ§₯락을 κ³ λ €ν•˜μ—¬ λ‹΅λ³€ν•˜μ„Έμš”."</p>
        </div>

        <div class="prompt-editor">
            <div class="form-group">
                <label for="promptContent">μ‹œμŠ€ν…œ ν”„λ‘¬ν”„νŠΈ</label>
                <textarea id="promptContent" placeholder="예: 항상 μ •μ€‘ν•˜κ³  μƒμ„Έν•˜κ²Œ λ‹΅λ³€ν•˜μ„Έμš”. μ›Ήμ†Œμ„€μ˜ λ§₯락을 κ³ λ €ν•˜μ—¬ 일관성 μžˆλŠ” 닡변을 μ œκ³΅ν•˜μ„Έμš”."></textarea>
                <div class="form-help">
                    질문 μ•žμ— μžλ™μœΌλ‘œ 좔가될 ν”„λ‘¬ν”„νŠΈλ₯Ό μž…λ ₯ν•˜μ„Έμš”. λΉ„μ›Œλ‘λ©΄ ν”„λ‘¬ν”„νŠΈλ₯Ό μ‚¬μš©ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
                </div>
            </div>

            <div class="button-group">
                <button class="btn btn-primary" onclick="savePrompt()">μ €μž₯</button>
                <button class="btn btn-secondary" onclick="loadPrompt()">μƒˆλ‘œκ³ μΉ¨</button>
                <button class="btn btn-secondary" onclick="clearPrompt()">μ΄ˆκΈ°ν™”</button>
            </div>
        </div>
    </div>

    <script>
        function toggleMobileMenu() {
            const menu = document.getElementById('mobileMenu');
            menu.classList.toggle('active');
            document.body.style.overflow = menu.classList.contains('active') ? 'hidden' : '';
        }

        function closeMobileMenu() {
            const menu = document.getElementById('mobileMenu');
            menu.classList.remove('active');
            document.body.style.overflow = '';
        }

        function closeMobileMenuOnBackdrop(event) {
            if (event.target.id === 'mobileMenu') {
                closeMobileMenu();
            }
        }

        // νŽ˜μ΄μ§€ λ‘œλ“œ μ‹œ ν”„λ‘¬ν”„νŠΈ 뢈러였기
        window.addEventListener('DOMContentLoaded', () => {
            loadPrompt();
        });

        // ν”„λ‘¬ν”„νŠΈ 뢈러였기
        async function loadPrompt() {
            try {
                const response = await fetch('/api/admin/prompts', {
                    credentials: 'include'
                });
                const data = await response.json();
                
                if (response.ok) {
                    document.getElementById('promptContent').value = data.prompt || '';
                } else {
                    showAlert('ν”„λ‘¬ν”„νŠΈλ₯Ό λΆˆλŸ¬μ˜€λŠ” 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: ' + (data.error || 'μ•Œ 수 μ—†λŠ” 였λ₯˜'), 'error');
                }
            } catch (error) {
                showAlert('ν”„λ‘¬ν”„νŠΈλ₯Ό λΆˆλŸ¬μ˜€λŠ” 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: ' + error.message, 'error');
                console.error('ν”„λ‘¬ν”„νŠΈ 뢈러였기 였λ₯˜:', error);
            }
        }

        // ν”„λ‘¬ν”„νŠΈ μ €μž₯
        async function savePrompt() {
            const promptContent = document.getElementById('promptContent').value.trim();
            
            try {
                const response = await fetch('/api/admin/prompts', {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    credentials: 'include',
                    body: JSON.stringify({
                        prompt: promptContent
                    })
                });
                
                const data = await response.json();
                
                if (response.ok) {
                    showAlert('ν”„λ‘¬ν”„νŠΈκ°€ μ„±κ³΅μ μœΌλ‘œ μ €μž₯λ˜μ—ˆμŠ΅λ‹ˆλ‹€.', 'success');
                } else {
                    showAlert('ν”„λ‘¬ν”„νŠΈ μ €μž₯ 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: ' + (data.error || 'μ•Œ 수 μ—†λŠ” 였λ₯˜'), 'error');
                }
            } catch (error) {
                showAlert('ν”„λ‘¬ν”„νŠΈ μ €μž₯ 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€: ' + error.message, 'error');
                console.error('ν”„λ‘¬ν”„νŠΈ μ €μž₯ 였λ₯˜:', error);
            }
        }

        // ν”„λ‘¬ν”„νŠΈ μ΄ˆκΈ°ν™”
        function clearPrompt() {
            if (confirm('ν”„λ‘¬ν”„νŠΈλ₯Ό μ΄ˆκΈ°ν™”ν•˜μ‹œκ² μŠ΅λ‹ˆκΉŒ?')) {
                document.getElementById('promptContent').value = '';
            }
        }

        // μ•Œλ¦Ό ν‘œμ‹œ
        function showAlert(message, type) {
            const alert = document.getElementById('alert');
            alert.textContent = message;
            alert.className = `alert ${type} show`;
            
            setTimeout(() => {
                alert.classList.remove('show');
            }, 5000);
        }
    </script>
</body>
</html>