<?php
/**
 * 钉钉数字化办公平台 - 下载跳转页面
 * 根据platform参数跳转到对应下载页面
 */

$platform = isset($_GET['platform']) ? $_GET['platform'] : '';

// 钉钉官方下载地址（备用）
$downloadUrls = [
    'windows' => 'https://dtapp-pub.dingtalk.com/dingtalk-desktop/win_64bit/',
    'mac' => 'https://dtapp-pub.dingtalk.com/dingtalk-desktop/mac_64bit/',
    'ios' => 'https://apps.apple.com/cn/app/ding-ding/id930368978',
    'android' => 'https://mobile-appdownload.dingtalk.com/',
];

// 如果有有效的platform参数，跳转到对应下载页面
if (!empty($platform) && isset($downloadUrls[$platform])) {
    header('Location: ' . $downloadUrls[$platform]);
    exit;
}

// 没有参数或无效参数，跳回下载页面
header('Location: download.html');
exit;
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>正在跳转...</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            background: linear-gradient(135deg, #F8F7FF 0%, #EEF0FF 100%);
        }
        .container {
            text-align: center;
            padding: 40px;
        }
        .logo {
            width: 64px;
            height: 64px;
            margin-bottom: 24px;
        }
        h1 {
            color: #1a1a1a;
            font-size: 24px;
            margin-bottom: 12px;
        }
        p {
            color: #666;
            font-size: 16px;
            margin-bottom: 24px;
        }
        .btn {
            display: inline-block;
            background: linear-gradient(135deg, #7B68EE 0%, #4361EE 100%);
            color: #fff;
            padding: 12px 32px;
            border-radius: 24px;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s;
        }
        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(123, 104, 238, 0.4);
        }
    </style>
</head>
<body>
    <div class="container">
        <svg class="logo" viewBox="0 0 64 64" fill="none">
            <defs>
                <linearGradient id="bgGrad" x1="0" y1="0" x2="64" y2="64">
                    <stop offset="0%" stop-color="#7B68EE"/>
                    <stop offset="100%" stop-color="#4361EE"/>
                </linearGradient>
            </defs>
            <circle cx="32" cy="32" r="32" fill="url(#bgGrad)"/>
            <path d="M32 12L40 28L56 31L44 44L46 60L32 52L18 60L20 44L8 31L24 28L32 12Z" fill="#fff"/>
        </svg>
        <h1>正在跳转到下载页面...</h1>
        <p>如果页面没有自动跳转，请点击下方按钮</p>
        <a href="download.html" class="btn">返回下载页面</a>
    </div>
</body>
</html>
