<?php
require_once '../../config.php';

$contact_info = getSiteConfig('contact_info') ?? '暂无联系方式';
$site_name = getSiteConfig('site_name') ?? '万能授权系统';
$site_logo = getSiteConfig('site_logo') ?? '/assets/uploads/logo.png';
?>
        <?php include 'header.php'; ?>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>联系我们 - <?php echo htmlspecialchars($site_name); ?></title>
    <link rel="stylesheet" href="/assets/css/style.css">
    <link rel="stylesheet" href="/assets/css/dark.css" id="dark-theme" disabled>
    <script src="/assets/js/main.js" defer></script>
    <style>
        .contact-container {
            min-height: 60vh;
            padding: 60px 20px;
            background: var(--bg-secondary);
        }
        .contact-wrapper {
            max-width: 1200px;
            margin: 0 auto;
        }
        .contact-header {
            text-align: center;
            margin-bottom: 50px;
        }
        .contact-header h1 {
            font-size: 36px;
            margin-bottom: 15px;
            color: var(--text-primary);
        }
        .contact-header p {
            color: var(--text-secondary);
            font-size: 18px;
        }
        .contact-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
            margin-bottom: 50px;
        }
        .contact-card {
            background: var(--bg-primary);
            border-radius: 20px;
            padding: 30px;
            text-align: center;
            transition: transform 0.3s, box-shadow 0.3s;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-sm);
        }
        .contact-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-lg);
        }
        .contact-icon {
            width: 70px;
            height: 70px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
            font-size: 32px;
            color: white;
        }
        .contact-card h3 {
            font-size: 22px;
            margin-bottom: 15px;
            color: var(--text-primary);
        }
        .contact-card .content {
            color: var(--text-secondary);
            line-height: 1.6;
        }
        .contact-card .content a {
            color: var(--primary-color);
            text-decoration: none;
        }
        .contact-card .content a:hover {
            text-decoration: underline;
        }
        .qr-code {
            margin: 15px auto;
            width: 150px;
            height: 150px;
            background: #f5f5f5;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        .qr-code img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .qr-code-placeholder {
            text-align: center;
            color: var(--text-muted);
            font-size: 12px;
        }
        .qr-code-placeholder span {
            font-size: 48px;
            display: block;
            margin-bottom: 10px;
        }
        .qq-group {
            font-size: 24px;
            font-weight: bold;
            color: var(--primary-color);
            margin: 10px 0;
        }
        .copy-btn {
            background: var(--primary-light);
            border: 1px solid var(--primary-color);
            padding: 6px 16px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 12px;
            margin-top: 10px;
            transition: all 0.2s;
        }
        .copy-btn:hover {
            background: var(--primary-color);
            color: white;
        }
        .contact-info-section {
            background: var(--bg-primary);
            border-radius: 20px;
            padding: 30px;
            margin-top: 30px;
            border: 1px solid var(--border-color);
        }
        .contact-info-section h3 {
            margin-bottom: 20px;
            text-align: center;
        }
        .info-list {
            display: flex;
            justify-content: center;
            gap: 40px;
            flex-wrap: wrap;
        }
        .info-item {
            display: flex;
            align-items: center;
            gap: 12px;
            color: var(--text-secondary);
        }
        .info-item .label {
            font-weight: 600;
            color: var(--text-primary);
        }
        .business-hours {
            text-align: center;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid var(--border-color);
            color: var(--text-muted);
            font-size: 13px;
        }
        @media (max-width: 768px) {
            .contact-grid {
                grid-template-columns: 1fr;
            }
            .info-list {
                flex-direction: column;
                align-items: center;
                gap: 15px;
            }
        }
    </style>
</head>
<body>
    <div class="front-container">

        
        <main class="front-main">
            <div class="contact-container">
                <div class="contact-wrapper">
                    <div class="contact-header">
                        <h1>联系我们</h1>
                        <p>有任何问题，欢迎随时与我们取得联系，我们将尽快为您解答</p>
                    </div>

                    <div class="contact-grid">
                        <!-- 公众号二维码 -->
                        <div class="contact-card">
                            <div class="contact-icon">📱</div>
                            <h3>官方公众号</h3>
                            <div class="qr-code" id="wechatQrCode">
                                <img src="/assets/uploads/wechat.jpg" alt="微信公众号二维码" onerror="this.onerror=null; this.parentElement.innerHTML='<div class=\'qr-code-placeholder\'><span>📱</span><br>请上传公众号二维码图片<br>到 /assets/uploads/wechat.jpg</div>'">
                            </div>
                            <div class="content">
                                <p>微信扫一扫关注公众号<br>获取最新资讯和技术支持</p>
                            </div>
                        </div>

                        <!-- QQ群 -->
                        <div class="contact-card">
                            <div class="contact-icon">🐧</div>
                            <h3>官方QQ群</h3>
                            <div class="content">
                                <div class="qq-group" id="qqGroup">709503830</div>
                                <button class="copy-btn" onclick="copyToClipboard('709503830', 'QQ群号已复制')">复制群号</button>
                                <p style="margin-top: 15px;">点击复制群号，打开QQ添加<br>加入官方交流群，与开发者互动</p>
                            </div>
                        </div>

                        <!-- 邮箱 -->
                        <div class="contact-card">
                            <div class="contact-icon">📧</div>
                            <h3>官方邮箱</h3>
                            <div class="content">
                                <div class="qq-group" id="emailAddress">admin@lhwks.top</div>
                                <button class="copy-btn" onclick="copyToClipboard('admin@lhwks.top', '邮箱地址已复制')">复制邮箱</button>
                                <p style="margin-top: 15px;">商务合作、问题反馈请发送邮件<br>我们会在24小时内回复</p>
                            </div>
                        </div>
                    </div>

                    <!-- 额外联系信息 -->
                    <div class="contact-info-section">
                        <h3>其他联系方式</h3>
                        <div class="info-list">
                            
                            <div class="info-item">
                                <span class="label">⏰ 服务时间：</span>
                                <span>周一至周五 9:00-18:00</span>
                            </div>
                            <div class="info-item">
                                <span class="label">🏢 公司地址：</span>
                                <span>中国 · 江苏</span>
                            </div>
                        </div>
                        <div class="business-hours">
                            <p>💡 温馨提示：非工作时间提交的问题，我们会在下一个工作日第一时间处理</p>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        
        <?php include 'footer.php'; ?>
    </div>

    <script>
        // 复制到剪贴板
        function copyToClipboard(text, message) {
            navigator.clipboard.writeText(text).then(() => {
                if (window.showToast) {
                    window.showToast(message || '复制成功', 'success');
                } else {
                    alert(message || '复制成功');
                }
            }).catch(() => {
                const ta = document.createElement('textarea');
                ta.value = text;
                document.body.appendChild(ta);
                ta.select();
                document.execCommand('copy');
                document.body.removeChild(ta);
                if (window.showToast) {
                    window.showToast(message || '复制成功', 'success');
                } else {
                    alert(message || '复制成功');
                }
            });
        }
    </script>
</body>
</html>