<?php
// ========== 代理商链接识别 ==========
// 必须在任何输出之前，放在最顶部
if (isset($_GET['agent']) && isset($_GET['app'])) {
    require_once 'config.php';
    $agent_id = intval($_GET['agent']);
    $app_id = intval($_GET['app']);
    
    // 验证代理商和应用是否有效
    $agent_app = $db->fetchOne("
        SELECT * FROM agent_apps 
        WHERE agent_id = $agent_id AND app_id = $app_id AND status = 1
    ");
    
    if ($agent_app) {
        // 保存到会话，用于后续购买
        session_start();
        $_SESSION['agent_id'] = $agent_id;
        $_SESSION['agent_app_id'] = $app_id;
        $_SESSION['agent_price'] = $agent_app['agent_price'];
        
        // 跳转到购买页面
        header('Location: /modules/home/buy.php?app=' . $app_id);
        exit;
    }
}

// 识别短链接（code参数）
if (isset($_GET['code'])) {
    require_once 'config.php';
    $code = base64_decode($_GET['code']);
    if ($code && strpos($code, '|') !== false) {
        list($agent_id, $app_id) = explode('|', $code);
        if ($agent_id && $app_id) {
            session_start();
            $_SESSION['agent_id'] = $agent_id;
            $_SESSION['agent_app_id'] = $app_id;
            header('Location: /modules/home/buy.php?app=' . $app_id);
            exit;
        }
    }
}
// ========== 代理商链接识别结束 ==========

// 安装检测
if (!file_exists(__DIR__ . '/install.lock') && basename($_SERVER['PHP_SELF']) !== 'install.php') {
    header('Location: install.php');
    exit;
}

require_once 'config.php';

$current_user = currentUser();
$site_name = getSiteConfig('site_name') ?? '麟泓授权系统';
$site_keywords = getSiteConfig('site_keywords') ?? '';
$site_copyright = getSiteConfig('site_copyright') ?? '';
$headerLinks = getHeaderLinks();
$friendLinks = getFriendLinks();

// 获取统计信息
$apps_count = $db->fetchOne("SELECT COUNT(*) as cnt FROM apps WHERE status = 1")['cnt'] ?? 0;
$licenses_count = $db->fetchOne("SELECT COUNT(*) as cnt FROM licenses")['cnt'] ?? 0;
$users_count = $db->fetchOne("SELECT COUNT(*) as cnt FROM users WHERE role = 'user'")['cnt'] ?? 0;

// ========== SVG 图标配置（自行替换链接） ==========
$svg_icons = [
    // 功能图标
    'security'    => 'https://api.iconify.design/mdi:shield-check.svg?color=%2344a574',      // 安全可靠
    'speed'       => 'https://api.iconify.design/mdi:flash.svg?color=%23e67e22',            // 快速验证
    'payment'     => 'https://api.iconify.design/mdi:credit-card.svg?color=%233498db',      // 在线支付
    'domain'      => 'https://api.iconify.design/mdi:web.svg?color=%239b59b6',              // 多域名绑定
    'monitor'     => 'https://api.iconify.design/mdi:chart-line.svg?color=%232ecc71',       // 实时监控
    'code'        => 'https://api.iconify.design/mdi:code-tags.svg?color=%23e74c3c',        // 极简接入
    // 评价图标
    'avatar1'     => 'https://api.iconify.design/mdi:account-circle.svg?color=%23667eea',
    'avatar2'     => 'https://api.iconify.design/mdi:account-tie.svg?color=%23764ba2',
    'avatar3'     => 'https://api.iconify.design/mdi:account-star.svg?color=%23f39c12',
    // 品牌图标
    'brand1'      => 'https://api.iconify.design/mdi:star.svg?color=%23f1c40f',
    'brand2'      => 'https://api.iconify.design/mdi:laptop.svg?color=%233498db',
    'brand3'      => 'https://api.iconify.design/mdi:cellphone.svg?color=%232ecc71',
    'brand4'      => 'https://api.iconify.design/mdi:gamepad-variant.svg?color=%23e74c3c',
    'brand5'      => 'https://api.iconify.design/mdi:github.svg?color=%23333',
    // 轮播图标
    'slide1'      => 'https://api.iconify.design/mdi:shield-key.svg?color=white',
    'slide2'      => 'https://api.iconify.design/mdi:web-sync.svg?color=white',
    'slide3'      => 'https://api.iconify.design/mdi:headset.svg?color=white',
    'slide4'      => 'https://api.iconify.design/mdi:database-lock.svg?color=white',
    'slide5'      => 'https://api.iconify.design/mdi:rocket-launch.svg?color=white',
];
?>
<?php include 'modules/home/header.php'; ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
    <title><?php echo htmlspecialchars($site_name); ?></title>
    <meta name="keywords" content="<?php echo htmlspecialchars($site_keywords); ?>">
    <meta name="msvalidate.01" content="F6723FACEF0A7027B60FFEB8D5DB7E58" />
    <meta name="description" content="<?php echo htmlspecialchars($site_name); ?>提供专业的软件授权管理服务，支持支付宝、微信支付，安全可靠、快速验证。">
    <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>
        /* ========== 全屏加载动画样式 ========== */
        .loader-fullscreen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 999;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }
        
        .loader-fullscreen.hide {
            opacity: 0;
            visibility: hidden;
        }
        
        .loader-fullscreen img {
            max-width: 80%;
            max-height: 80%;
            object-fit: contain;
            animation: fadeInScale 0.5s ease;
        }
        
        @keyframes fadeInScale {
            from {
                opacity: 0;
                transform: scale(0.9);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }
        
        /* ========== Hero 区域样式 ========== */
.hero-section {
    position: relative;
    min-height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    margin-bottom: 40px;
    z-index: 1;  /* 降低 */
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
     z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 80px 20px 120px;
    max-width: 900px;
    margin: 0 auto;
}

.hero-icon {
    margin-bottom: 24px;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 16px;
    color: white;
}

.gradient-text {
    background: linear-gradient(135deg, #fff 0%, #f0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 20px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    background: rgba(255,255,255,0.15);
    padding: 8px 20px;
    border-radius: 40px;
    backdrop-filter: blur(5px);
}

.hero-feature img {
    width: 20px;
    height: 20px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    border-radius: 60px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.hero-btn img {
    width: 24px;
    height: 24px;
}

.hero-btn-primary {
    background: #3498DB;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.hero-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.hero-btn-outline {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.hero-btn-outline:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}

.hero-wave {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    z-index: 2;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero-section {
        min-height: 450px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .hero-content {
        padding: 60px 20px 100px;
    }
    
    .hero-btn {
        padding: 14px 28px;
        font-size: 16px;
    }
}
        
        /* ========== 功能卡片样式 ========== */
        .features {
            max-width: 1200px;
            margin: 60px auto;
            padding: 0 20px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 30px;
        }
        
        .feature-card {
            background: var(--bg-primary);
            border-radius: 24px;
            padding: 32px 24px;
            text-align: center;
            box-shadow: var(--shadow-sm);
            transition: all 0.3s ease;
            border: 1px solid var(--border-color);
        }
        
        .feature-card:hover {
            transform: translateY(-8px);
            box-shadow: var(--shadow-lg);
            border-color: transparent;
        }
        
        .feature-card .feature-icon {
            width: 64px;
            height: 64px;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .feature-card .feature-icon img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
        
        .feature-card h3 {
            font-size: 20px;
            margin-bottom: 12px;
            color: var(--text-primary);
        }
        
        .feature-card p {
            color: var(--text-secondary);
            line-height: 1.6;
            font-size: 15px;
        }
        
        /* ========== 统计区域 ========== */
        .stats-section {
            background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-primary) 100%);
            padding: 60px 20px;
            margin: 40px 0;
        }
        
        .stats-grid {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 30px;
            text-align: center;
        }
        
        .stat-item {
            padding: 20px;
        }
        
        .stat-number {
            font-size: 48px;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 10px;
        }
        
        .stat-label {
            font-size: 16px;
            color: var(--text-secondary);
        }
        
        /* ========== CTA 区域 ========== */
        .cta-section {
            text-align: center;
            padding: 60px 20px;
            background: var(--bg-primary);
            border-radius: 30px;
            margin: 40px 20px;
            box-shadow: var(--shadow-md);
        }
        
        .cta-section h2 {
            font-size: 32px;
            margin-bottom: 20px;
        }
        
        .cta-section p {
            color: var(--text-secondary);
            margin-bottom: 30px;
            font-size: 18px;
        }
        
        .btn-contact {
            padding: 12px 32px;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s;
            display: inline-block;
        }
        
        .btn-contact.primary {
            background: var(--primary-color);
            color: white;
        }
        
        .btn-contact.primary:hover {
            background: var(--primary-hover);
            transform: translateY(-2px);
        }
        
        .btn-contact.secondary {
            border: 2px solid var(--primary-color);
            color: var(--primary-color);
            margin-left: 15px;
        }
        
        .btn-contact.secondary:hover {
            background: var(--primary-color);
            color: white;
            transform: translateY(-2px);
        }
        
        /* ========== 用户评价 ========== */
        .testimonial-section {
            padding: 60px 20px;
            background: var(--bg-secondary);
        }
        
        .testimonial-grid {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
        }
        
        .testimonial-card {
            background: var(--bg-primary);
            border-radius: 20px;
            padding: 30px;
            text-align: center;
            box-shadow: var(--shadow-sm);
            transition: transform 0.3s;
        }
        
        .testimonial-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-md);
        }
        
        .testimonial-card .testimonial-avatar {
            width: 80px;
            height: 80px;
            margin: 0 auto 20px;
        }
        
        .testimonial-card .testimonial-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .testimonial-text {
            font-style: italic;
            color: var(--text-secondary);
            margin-bottom: 15px;
            line-height: 1.6;
        }
        
        .testimonial-name {
            font-weight: 600;
            color: var(--text-primary);
        }
        
        /* ========== FAQ ========== */
        .faq-section {
            max-width: 800px;
            margin: 60px auto;
            padding: 0 20px;
        }
        
        .faq-item {
            background: var(--bg-primary);
            border-radius: 12px;
            margin-bottom: 16px;
            overflow: hidden;
            border: 1px solid var(--border-color);
        }
        
        .faq-question {
            padding: 18px 24px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: background 0.3s;
        }
        
        .faq-question:hover { background: var(--bg-secondary); }
        
        .faq-question .icon {
            font-size: 20px;
            transition: transform 0.3s;
        }
        
        .faq-question.active .icon { transform: rotate(180deg); }
        
        .faq-answer {
            padding: 0 24px;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
            color: var(--text-secondary);
            line-height: 1.6;
        }
        
        .faq-answer.show {
            padding: 0 24px 18px 24px;
            max-height: 200px;
        }
        
        /* ========== 合作伙伴 ========== */
        .partner-section {
            padding: 40px 20px;
            text-align: center;
            border-top: 1px solid var(--border-color);
        }
        
        .partner-logos {
            display: flex;
            justify-content: center;
            gap: 40px;
            flex-wrap: wrap;
            margin-top: 30px;
        }
        
        .partner-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }
        
        .partner-item img {
            width: 48px;
            height: 48px;
            opacity: 0.7;
            transition: opacity 0.3s;
        }
        
        .partner-item:hover img { opacity: 1; }
        
        .partner-item span {
            font-size: 14px;
            color: var(--text-muted);
        }
        
        @media (max-width: 768px) {
            .carousel-slides { height: 400px; }
            .carousel-content h1 { font-size: 32px; }
            .carousel-content h2 { font-size: 24px; }
            .carousel-content p { font-size: 14px; }
            .carousel-btn { width: 38px; height: 38px; font-size: 20px; }
            .stat-number { font-size: 32px; }
            .cta-section h2 { font-size: 24px; }
            .cta-section p { font-size: 16px; }
            .btn-contact.secondary { margin-left: 0; margin-top: 15px; }
            .features { grid-template-columns: 1fr; }
        }
    </style>
</head>
<body>
    <!-- 全屏加载动画 -->
    <div class="loader-fullscreen" id="loader">
        <img src="/assets/uploads/load.png" alt="Loading">
    </div>

   <!-- Hero 区域 - 替换幻灯片 -->
<div class="hero-section">
    <div class="hero-particles" id="heroParticles"></div>
    <div class="hero-content">
        <div class="hero-icon">
            <img src="https://api.iconify.design/mdi:shield-check.svg?color=white" alt="授权" style="width:80px;height:80px;">
        </div>
        <h1 class="hero-title">
            <span class="gradient-text">麟泓授权系统</span>
        </h1>
        <p class="hero-subtitle">专业软件授权管理 · 安全 · 稳定 · 高效</p>
        <div class="hero-features">
            <span class="hero-feature">
                <img src="https://api.iconify.design/mdi:check-circle.svg?color=%2310b981" alt="">
                一键授权
            </span>
            <span class="hero-feature">
                <img src="https://api.iconify.design/mdi:check-circle.svg?color=%2310b981" alt="">
                在线支付
            </span>
            <span class="hero-feature">
                <img src="https://api.iconify.design/mdi:check-circle.svg?color=%2310b981" alt="">
                自动发货
            </span>
        </div>
        <div class="hero-buttons">
            <a href="/modules/home/buy.php" class="hero-btn hero-btn-primary">
                <img src="https://api.iconify.design/mdi:rocket-launch.svg?color=white" alt="">
                立即体验
            </a>
            <a href="/docs.php" class="hero-btn hero-btn-outline">
                <img src="https://api.iconify.design/mdi:book-open.svg?color=white" alt="">
                查看文档
            </a>
        </div>
    </div>
    <div class="hero-wave">
        <svg viewBox="0 0 1200 120" preserveAspectRatio="none">
            <path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25" fill="white"></path>
            <path d="M0,0V15.81C13,21.11,27.64,22.31,42.34,19.8,75.65,14.16,108.43,4.8,142.53,1.28,192.14-3.56,241.33,10.48,290.56,19.8c59.41,11.22,118.67,20.16,178.74,14.76,41.11-3.67,80.61-16.78,121-26.16C643.4,1.26,699.27-7.44,752.9,6.65c41.29,10.86,79.7,30.56,120.5,40.7,51.1,12.68,103.8,15.83,155.6,3.79,27.93-6.46,54.94-18.74,83.08-26.17C1141.76,15.16,1176.08,20.24,1200,30.66V0Z" opacity=".5" fill="white"></path>
            <path d="M0,0V5.63C23.64,12.72,48.23,14.44,72.9,11.22,107.16,6.69,140.1-1.24,174.2.24c43.23,1.88,83.21,16.33,124.84,22.28,50.53,7.21,101.12,5.78,151.79.88,41.11-4,80.61-15.78,121-23.16C631.37-6.14,687.27-12.88,740.9,1.21c41.29,10.86,79.7,28.56,120.5,38.7,51.1,12.68,103.8,15.83,155.6,3.79,27.93-6.46,54.94-18.74,83.08-26.17,30.16-7.94,64.5-2.86,99.92,5.21V0Z" fill="white"></path>
        </svg>
    </div>
</div>

            <!-- 统计数据区域 -->
            <section class="stats-section">
                <div class="stats-grid">
                    <div class="stat-item">
                        <div class="stat-number"><?php echo number_format($apps_count); ?></div>
                        <div class="stat-label">可授权应用</div>
                    </div>
                    <div class="stat-item">
                        <div class="stat-number"><?php echo number_format($licenses_count); ?></div>
                        <div class="stat-label">已发放授权码</div>
                    </div>
                    <div class="stat-item">
                        <div class="stat-number"><?php echo number_format($users_count); ?></div>
                        <div class="stat-label">服务用户数</div>
                    </div>
                    <div class="stat-item">
                        <div class="stat-number">99.9%</div>
                        <div class="stat-label">服务可用性</div>
                    </div>
                </div>
            </section>

            <!-- 特色功能区域 -->
            <section class="features">
                <div class="feature-card">
                    <div class="feature-icon">
                        <img src="<?php echo $svg_icons['security']; ?>" alt="安全">
                    </div>
                    <h3>安全可靠</h3>
                    <p>高强度加密算法，防止篡改与破解，授权记录全程留痕，安全可追溯。</p>
                </div>
                <div class="feature-card">
                    <div class="feature-icon">
                        <img src="<?php echo $svg_icons['speed']; ?>" alt="快速">
                    </div>
                    <h3>快速验证</h3>
                    <p>毫秒级授权验证响应，支持高并发场景，稳定可靠。</p>
                </div>
                <div class="feature-card">
                    <div class="feature-icon">
                        <img src="<?php echo $svg_icons['payment']; ?>" alt="支付">
                    </div>
                    <h3>在线支付</h3>
                    <p>支持支付宝、微信支付，一键购买，自动发货。</p>
                </div>
                <div class="feature-card">
                    <div class="feature-icon">
                        <img src="<?php echo $svg_icons['domain']; ?>" alt="域名">
                    </div>
                    <h3>多域名绑定</h3>
                    <p>支持单授权多域名、泛域名绑定，防止盗用与非法分发。</p>
                </div>
                <div class="feature-card">
                    <div class="feature-icon">
                        <img src="<?php echo $svg_icons['monitor']; ?>" alt="监控">
                    </div>
                    <h3>实时监控</h3>
                    <p>服务器状态、授权使用情况实时展示，异常自动预警。</p>
                </div>
                <div class="feature-card">
                    <div class="feature-icon">
                        <img src="<?php echo $svg_icons['code']; ?>" alt="接入">
                    </div>
                    <h3>极简接入</h3>
                    <p>API 简洁清晰，一行代码接入，支持 PHP、Python、Java 等多种环境。</p>
                </div>
            </section>

            <!-- CTA 区域 -->
            <div class="cta-section">
                <h2>开始保护您的软件资产</h2>
                <p>加入 <?php echo htmlspecialchars($site_name); ?>，让您的软件授权管理更简单、更安全</p>
                <div class="hero-buttons">
                    <?php if ($current_user): ?>
                        <a href="/admin.php" class="btn-contact primary">进入控制台</a>
                    <?php else: ?>
                        <a href="/modules/home/register.php" class="btn-contact primary">免费注册</a>
                        <a href="/modules/home/login.php" class="btn-contact secondary">已有账号？登录</a>
                    <?php endif; ?>
                </div>
            </div>

            <!-- 用户评价区域 -->
            <section class="testimonial-section">
                <h2 style="text-align: center; margin-bottom: 40px;">用户评价</h2>
                <div class="testimonial-grid">
                    <div class="testimonial-card">
                        <div class="testimonial-avatar">
                            <img src="<?php echo $svg_icons['avatar1']; ?>" alt="用户">
                        </div>
                        <div class="testimonial-text">"接入非常简单，几分钟就完成了授权集成。系统稳定，客服响应及时！"</div>
                        <div class="testimonial-name">—— 开发者李工</div>
                    </div>
                    <div class="testimonial-card">
                        <div class="testimonial-avatar">
                            <img src="<?php echo $svg_icons['avatar2']; ?>" alt="用户">
                        </div>
                        <div class="testimonial-text">"授权管理功能强大，多域名绑定完美解决了我们的需求，推荐！"</div>
                        <div class="testimonial-name">—— 科技公司 CTO</div>
                    </div>
                    <div class="testimonial-card">
                        <div class="testimonial-avatar">
                            <img src="<?php echo $svg_icons['avatar3']; ?>" alt="用户">
                        </div>
                        <div class="testimonial-text">"界面美观，操作流畅，支付也很方便，客户反馈体验很好。"</div>
                        <div class="testimonial-name">—— 独立开发者小王</div>
                    </div>
                </div>
            </section>

            <!-- FAQ 区域 -->
            <section class="faq-section">
                <h2 style="text-align: center; margin-bottom: 40px;">常见问题</h2>
                <div class="faq-item">
                    <div class="faq-question" onclick="toggleFAQ(this)">
                        <span>授权码如何获取？</span>
                        <span class="icon">▼</span>
                    </div>
                    <div class="faq-answer">
                        购买应用后，系统会自动生成唯一授权码，您可以在用户后台的"授权码管理"中查看和复制。
                    </div>
                </div>
                <div class="faq-item">
                    <div class="faq-question" onclick="toggleFAQ(this)">
                        <span>授权码可以绑定多个域名吗？</span>
                        <span class="icon">▼</span>
                    </div>
                    <div class="faq-answer">
                        支持，每个授权码可以绑定一个主域名。如需更换域名，可以在后台解绑后重新绑定。
                    </div>
                </div>
                <div class="faq-item">
                    <div class="faq-question" onclick="toggleFAQ(this)">
                        <span>支付方式有哪些？</span>
                        <span class="icon">▼</span>
                    </div>
                    <div class="faq-answer">
                        支持支付宝和微信支付，支付成功后自动生成授权码，无需人工干预。
                    </div>
                </div>
                <div class="faq-item">
                    <div class="faq-question" onclick="toggleFAQ(this)">
                        <span>授权过期后可以续费吗？</span>
                        <span class="icon">▼</span>
                    </div>
                    <div class="faq-answer">
                        可以，您可以在用户后台购买新的授权或联系客服进行续费处理。
                    </div>
                </div>
            </section>

            <!-- 合作伙伴区域 -->
            <section class="partner-section">
                <p style="color: var(--text-muted);">已为以下品牌提供授权服务</p>
                <div class="partner-logos">
                    <div class="partner-item">
                        <img src="<?php echo $svg_icons['brand1']; ?>" alt="品牌">
                        <span>科技公司</span>
                    </div>
                    <div class="partner-item">
                        <img src="<?php echo $svg_icons['brand2']; ?>" alt="品牌">
                        <span>软件工作室</span>
                    </div>
                    <div class="partner-item">
                        <img src="<?php echo $svg_icons['brand3']; ?>" alt="品牌">
                        <span>移动应用</span>
                    </div>
                    <div class="partner-item">
                        <img src="<?php echo $svg_icons['brand4']; ?>" alt="品牌">
                        <span>游戏开发</span>
                    </div>
                    <div class="partner-item">
                        <img src="<?php echo $svg_icons['brand5']; ?>" alt="品牌">
                        <span>开源项目</span>
                    </div>
                </div>
            </section>

            <!-- 底部 -->
            <footer class="footer">
                <div class="footer-logo">
                    <img src="<?php echo htmlspecialchars(getSiteConfig('site_logo') ?? '/assets/uploads/logo.png'); ?>" alt="Logo">
                </div>
                <div class="footer-links">
                    <?php foreach ($friendLinks as $link): ?>
                        <a href="<?php echo htmlspecialchars($link['url']); ?>" target="_blank"><?php echo htmlspecialchars($link['name']); ?></a>
                    <?php endforeach; ?>
                </div>
                <div class="footer-copyright">
                    <?php echo htmlspecialchars($site_copyright); ?>
                    <?php if (!empty(getSiteConfig('site_icp'))): ?>
                        <a href="https://beian.miit.gov.cn/" target="_blank"><?php echo htmlspecialchars(getSiteConfig('site_icp')); ?></a>
                    <?php endif; ?>
                </div>
            </footer>
        </main>
    </div>

    <script>
        // 全屏加载动画隐藏
        window.addEventListener('load', function() {
            const loader = document.getElementById('loader');
            if (loader) {
                setTimeout(function() {
                    loader.classList.add('hide');
                    setTimeout(function() {
                        loader.style.display = 'none';
                    }, 500);
                }, 1500);
            }
        });
        
        // 幻灯片轮播功能
        let currentSlide = 0;
        const slides = document.querySelectorAll('.carousel-slide');
        const dotsContainer = document.getElementById('carouselDots');
        let autoPlayInterval;
        const slideCount = slides.length;
        
        if (dotsContainer && slideCount > 0) {
            for (let i = 0; i < slideCount; i++) {
                const dot = document.createElement('div');
                dot.classList.add('carousel-dot');
                if (i === 0) dot.classList.add('active');
                dot.addEventListener('click', () => goToSlide(i));
                dotsContainer.appendChild(dot);
            }
        }
        
        const dots = document.querySelectorAll('.carousel-dot');
        
        function goToSlide(index) {
            slides[currentSlide].classList.remove('active');
            if (dots.length > 0) dots[currentSlide].classList.remove('active');
            currentSlide = index;
            slides[currentSlide].classList.add('active');
            if (dots.length > 0) dots[currentSlide].classList.add('active');
        }
        
        function nextSlide() {
            let next = (currentSlide + 1) % slideCount;
            goToSlide(next);
        }
        
        function prevSlide() {
            let prev = (currentSlide - 1 + slideCount) % slideCount;
            goToSlide(prev);
        }
        
        const carouselPrev = document.getElementById('carouselPrev');
        const carouselNext = document.getElementById('carouselNext');
        
        if (carouselPrev) {
            carouselPrev.addEventListener('click', () => {
                prevSlide();
                resetAutoPlay();
            });
        }
        
        if (carouselNext) {
            carouselNext.addEventListener('click', () => {
                nextSlide();
                resetAutoPlay();
            });
        }
        
        function startAutoPlay() {
            if (autoPlayInterval) clearInterval(autoPlayInterval);
            autoPlayInterval = setInterval(() => nextSlide(), 5000);
        }
        
        function resetAutoPlay() {
            clearInterval(autoPlayInterval);
            startAutoPlay();
        }
        
        const carousel = document.querySelector('.carousel-container');
        if (carousel) {
            carousel.addEventListener('mouseenter', () => clearInterval(autoPlayInterval));
            carousel.addEventListener('mouseleave', () => startAutoPlay());
        }
        
        if (slideCount > 0) startAutoPlay();
        
        function toggleFAQ(element) {
            element.classList.toggle('active');
            const answer = element.nextElementSibling;
            answer.classList.toggle('show');
        }
    </script>
    <script>
// 粒子动画
(function() {
    const container = document.getElementById('heroParticles');
    if (!container) return;
    
    const particleCount = 50;
    
    for (let i = 0; i < particleCount; i++) {
        const particle = document.createElement('div');
        particle.style.cssText = `
            position: absolute;
            width: ${Math.random() * 6 + 2}px;
            height: ${Math.random() * 6 + 2}px;
            background: rgba(255,255,255,${Math.random() * 0.3 + 0.1});
            border-radius: 50%;
            left: ${Math.random() * 100}%;
            top: ${Math.random() * 100}%;
            animation: floatParticle ${Math.random() * 10 + 15}s linear infinite;
            animation-delay: ${Math.random() * -20}s;
        `;
        container.appendChild(particle);
    }
    
    const style = document.createElement('style');
    style.textContent = `
        @keyframes floatParticle {
            0% { transform: translateY(0) rotate(0deg); opacity: 0; }
            10% { opacity: 1; }
            90% { opacity: 1; }
            100% { transform: translateY(-400px) rotate(360deg); opacity: 0; }
        }
    `;
    document.head.appendChild(style);
})();
</script>
</body>
</html>