<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tracking Information</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }
        header, footer {
            text-align: center;
            padding: 10px;
            background-color: #f1f1f1;
        }
        .tracking-info {
            text-align: center;
            margin: 50px;
        }
        .tracking-info h1 {
            font-size: 2rem;
        }
        .tracking-info div {
            margin-top: 20px;
        }
        .error {
            color: red;
            font-size: 1.5rem;
            margin-top: 20px;
        }
        .updates {
            margin-top: 30px;
            font-size: 1rem;
        }
    </style>
</head>
<body>
    <header>
        <h1>Tracking Information</h1>
    </header>
    
    <div id="trackingInfoContainer"></div> <!-- Placeholder for tracking info or error message -->
    
    <footer id="footer"></footer>
    
    <script>
        // Function to get the 'code' query parameter from the URL
        function getTrackingCode() {
            const urlParams = new URLSearchParams(window.location.search);
            return urlParams.get('code');
        }

        // Function to display tracking info based on the code
        function displayTrackingInfo(code) {
            const trackingInfoContainer = document.getElementById('trackingInfoContainer');
            
            if (code === 'XJF939f') {
                // Display the tracking info
                trackingInfoContainer.innerHTML = `
                    <div class="tracking-info" id="trackingInfo">
                        <h1>Package Status</h1>
                        <div>
                            <p>状态: 已发货 / Status: Delayed</p>
                            <p>位置: 北京, 中国 / Location: Beijing, China</p>
                            <p>预计送达: 2024年12月10日 / Expected Delivery: Jan 15, 2025</p>
                            <div class="updates">
                                <h2>最新动态 / Recent Updates:</h2>
                                <ul>
                                    <li>Dec 24, 2024: Due to Holiday demand and increased presence of US customs, shipping for this package has been delayed.</li>
                                    <li>Dec 12, 2024: Due to Holiday demand, shipping for this package delayed.</li>
                                    <li>Dec 12, 2024: Package processed at Beijing sorting center</li>
                                    <li>Dec 8, 2024: Package dispatched from warehouse</li>
                                    <li>Dec 7, 2024: Shipping label created</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                `;
            } else {
                // Display error message if tracking code is invalid
                trackingInfoContainer.innerHTML = `
                    <p class="error">无效的追踪码 / Invalid Shipping Code</p>
                `;
            }
        }

        // Run the script to check the code and display appropriate content
        const trackingCode = getTrackingCode();
        displayTrackingInfo(trackingCode);
    </script>
</body>
</html>
