<!DOCTYPE html>
<html lang="zh-CN" data-theme="light">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统设置 - {siteTitle}</title>

  <script src="/js/browser@4.js"></script>
    <link href="/css/daisyui@5.css" rel="stylesheet" type="text/css" />
    <link href="/css/themes.css" rel="stylesheet" type="text/css" />
    
    <script defer src="/js/alpine.min.js"></script>
</head>
<body class="min-h-screen bg-base-200">
    <!-- Navigation -->
    <div class="navbar bg-base-100 shadow-lg">
        <div class="flex-1">
            <a href="/admin" class="btn btn-ghost">← 返回</a>
            <span class="text-xl font-bold ml-2">系统设置</span>
        </div>
    </div>

    <div class="container mx-auto px-4 py-8">
        <div class="card bg-base-100 shadow-xl max-w-2xl mx-auto">
            <div class="card-body">
                <form action="/admin/settings" method="post">
                    <!-- 网站设置 -->
                    <h3 class="text-lg font-semibold mb-4 border-b pb-2">网站设置</h3>
                    
                    <div class="form-control mb-4">
                        <label class="label"><span class="label-text">网站标题</span></label>
                        <input type="text" name="site_title" value="{config.get('site_title')}" 
                               class="input input-bordered" />
                    </div>
                    
                    <div class="form-control mb-4">
                        <label class="label"><span class="label-text">网站副标题</span></label>
                        <input type="text" name="site_subtitle" value="{config.get('site_subtitle')}" 
                               class="input input-bordered" />
                    </div>
                    
                    <div class="form-control mb-4">
                        <label class="label"><span class="label-text">页脚文本</span></label>
                        <input type="text" name="footer_text" value="{config.get('footer_text')}" 
                               class="input input-bordered" />
                    </div>

                    <!-- 主题设置 -->
                    <h3 class="text-lg font-semibold mb-4 border-b pb-2 mt-8">主题设置</h3>
                    
                    <div class="form-control mb-4">
                        <label class="label"><span class="label-text">主题</span></label>
                        <select name="theme" class="select select-bordered">
                            <option value="light" {#if config.get('theme') == 'light'}selected{/if}>浅色 (Light)</option>
                            <option value="dark" {#if config.get('theme') == 'dark'}selected{/if}>深色 (Dark)</option>
                            <option value="cupcake" {#if config.get('theme') == 'cupcake'}selected{/if}>Cupcake</option>
                            <option value="bumblebee" {#if config.get('theme') == 'bumblebee'}selected{/if}>Bumblebee</option>
                            <option value="emerald" {#if config.get('theme') == 'emerald'}selected{/if}>Emerald</option>
                            <option value="corporate" {#if config.get('theme') == 'corporate'}selected{/if}>Corporate</option>
                            <option value="synthwave" {#if config.get('theme') == 'synthwave'}selected{/if}>Synthwave</option>
                            <option value="retro" {#if config.get('theme') == 'retro'}selected{/if}>Retro</option>
                            <option value="cyberpunk" {#if config.get('theme') == 'cyberpunk'}selected{/if}>Cyberpunk</option>
                            <option value="valentine" {#if config.get('theme') == 'valentine'}selected{/if}>Valentine</option>
                            <option value="halloween" {#if config.get('theme') == 'halloween'}selected{/if}>Halloween</option>
                            <option value="garden" {#if config.get('theme') == 'garden'}selected{/if}>Garden</option>
                            <option value="forest" {#if config.get('theme') == 'forest'}selected{/if}>Forest</option>
                            <option value="aqua" {#if config.get('theme') == 'aqua'}selected{/if}>Aqua</option>
                            <option value="lofi" {#if config.get('theme') == 'lofi'}selected{/if}>Lo-Fi</option>
                            <option value="pastel" {#if config.get('theme') == 'pastel'}selected{/if}>Pastel</option>
                            <option value="fantasy" {#if config.get('theme') == 'fantasy'}selected{/if}>Fantasy</option>
                            <option value="wireframe" {#if config.get('theme') == 'wireframe'}selected{/if}>Wireframe</option>
                            <option value="black" {#if config.get('theme') == 'black'}selected{/if}>Black</option>
                            <option value="luxury" {#if config.get('theme') == 'luxury'}selected{/if}>Luxury</option>
                            <option value="dracula" {#if config.get('theme') == 'dracula'}selected{/if}>Dracula</option>
                            <option value="cmyk" {#if config.get('theme') == 'cmyk'}selected{/if}>CMYK</option>
                            <option value="autumn" {#if config.get('theme') == 'autumn'}selected{/if}>Autumn</option>
                            <option value="business" {#if config.get('theme') == 'business'}selected{/if}>Business</option>
                            <option value="acid" {#if config.get('theme') == 'acid'}selected{/if}>Acid</option>
                            <option value="lemonade" {#if config.get('theme') == 'lemonade'}selected{/if}>Lemonade</option>
                            <option value="night" {#if config.get('theme') == 'night'}selected{/if}>Night</option>
                            <option value="coffee" {#if config.get('theme') == 'coffee'}selected{/if}>Coffee</option>
                            <option value="winter" {#if config.get('theme') == 'winter'}selected{/if}>Winter</option>
                        </select>
                    </div>

                    <!-- 搜索设置 -->
                    <h3 class="text-lg font-semibold mb-4 border-b pb-2 mt-8">搜索设置</h3>
                    
                    <div class="form-control mb-4">
                        <label class="label cursor-pointer">
                            <span class="label-text">显示搜索框</span>
                            <input type="checkbox" name="show_search" value="true" 
                                   class="checkbox" {#if config.get('show_search') == 'true'}checked{/if} />
                        </label>
                    </div>
                    
                    <div class="form-control mb-4">
                        <label class="label"><span class="label-text">搜索引擎 URL</span></label>
                        <input type="text" name="search_engine" value="{config.get('search_engine')}" 
                               class="input input-bordered" placeholder="https://www.google.com/search?q=" />
                        <label class="label">
                            <span class="label-text-alt text-base-content/60">搜索关键词会追加到此 URL 后面</span>
                        </label>
                    </div>

                    <!-- 常用搜索引擎 -->
                    <div class="text-sm text-base-content/60 mb-6">
                        <p class="font-medium mb-2">常用搜索引擎：</p>
                        <ul class="list-disc list-inside space-y-1">
                            <li>Google: https://www.google.com/search?q=</li>
                            <li>Bing: https://www.bing.com/search?q=</li>
                            <li>Baidu: https://www.baidu.com/s?wd=</li>
                            <li>DuckDuckGo: https://duckduckgo.com/?q=</li>
                        </ul>
                    </div>

                    <div class="form-control mt-6">
                        <button type="submit" class="btn btn-primary">保存设置</button>
                    </div>
                </form>
            </div>
        </div>
    </div>


</body>
</html>
