* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
    --glass-blur: 8px;
    --bg-brightness: 0.3;
}

body {
    font-family: monospace, "Microsoft YaHei", sans-serif;
    background-color: #05050a; color: #fff;
    overflow-x: hidden; overscroll-behavior-y: none; min-height: 100vh;
}

body::before {
    content: ""; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: url('bg.jpg'); 
    background-size: cover; background-position: center; background-attachment: fixed;
    filter: brightness(var(--bg-brightness)) contrast(1.1); z-index: -1; 
}

#particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; }

.visitor-badge {
    position: fixed; top: 20px; right: 20px; z-index: 1000;
    border: 1px solid rgba(0, 255, 255, 0.3); padding: 6px 12px;
    font-size: 0.8em; color: #0ff; background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(12px); border-radius: 20px;
}

section { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 60px 20px; }
.hero { text-align: center; }

.glitch { font-size: 4.5em; font-weight: bold; letter-spacing: 10px; color: #fff; position: relative; text-shadow: 0 0 20px rgba(0, 255, 255, 0.8), 0 0 40px rgba(0, 255, 255, 0.4); }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; }
.glitch::before { left: 3px; text-shadow: -3px 0 #ff00ff; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim 5s infinite linear alternate-reverse; }
.glitch::after { left: -3px; text-shadow: -3px 0 #00ffff; clip: rect(44px, 450px, 56px, 0); animation: glitch-anim2 5s infinite linear alternate-reverse; }
@keyframes glitch-anim { 0% { clip: rect(12px, 9999px, 58px, 0); } 20% { clip: rect(72px, 9999px, 18px, 0); } 40% { clip: rect(34px, 9999px, 90px, 0); } 60% { clip: rect(98px, 9999px, 40px, 0); } 80% { clip: rect(50px, 9999px, 76px, 0); } 100% { clip: rect(20px, 9999px, 30px, 0); } }

.subtitle { color: #ccc; margin: 20px 0 40px; letter-spacing: 4px; font-size: 0.9em; text-shadow: 0 2px 4px #000; }

.scroll-btn {
    display: inline-block; padding: 15px 40px; border: 1px solid rgba(0, 255, 255, 0.4); color: #0ff;
    text-decoration: none; font-size: 1.1em; transition: all 0.3s; background: rgba(0, 255, 255, 0.05); border-radius: 12px;
    backdrop-filter: blur(10px); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 255, 255, 0.1);
    font-family: inherit; cursor: pointer;
}
.scroll-btn:hover { background: rgba(0, 255, 255, 0.15); box-shadow: 0 0 30px rgba(0, 255, 255, 0.3); transform: translateY(-3px); }

.arcade { background: transparent; align-items: stretch; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { font-size: 2.2em; margin-bottom: 10px; color: #fff; text-shadow: 0 0 10px #0ff, 0 2px 10px #000; }
.section-header p { color: #ddd; font-size: 0.9em; text-shadow: 0 1px 3px #000; }

.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; max-width: 1000px; width: 100%; margin: 0 auto; }

.game-card {
    background: rgba(255, 255, 255, 0.02); 
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(255, 255, 255, 0.1); 
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    padding: 30px; text-decoration: none; color: #fff;
    display: flex; flex-direction: column; justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative; overflow: hidden; border-radius: 16px !important; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}
.game-card:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4); border-color: rgba(0, 255, 255, 0.6); background: rgba(255, 255, 255, 0.06); }

.card-info { position: relative; z-index: 1; margin-bottom: 20px; }
.card-info h3 { font-size: 1.4em; margin-bottom: 10px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.card-info p { color: #ddd; font-size: 0.85em; line-height: 1.5; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.card-tag { position: relative; z-index: 1; align-self: flex-start; font-size: 0.75em; padding: 6px 14px; border: 1px solid currentColor; color: #888; border-radius: 30px; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); }

.theme-pink { border-left: 4px solid #ff6b9d; } .theme-pink:hover { border-color: #ff6b9d; box-shadow: 0 15px 30px rgba(255, 107, 157, 0.2); }
.theme-red { border-left: 4px solid #ff2222; } .theme-red:hover { border-color: #ff2222; box-shadow: 0 15px 30px rgba(255, 34, 34, 0.2); }
.theme-green { border-left: 4px solid #44ff88; } .theme-green:hover { border-color: #44ff88; box-shadow: 0 15px 30px rgba(68, 255, 136, 0.2); }
.theme-cyan { border-left: 4px solid #0ff; } .theme-cyan:hover { border-color: #0ff; box-shadow: 0 15px 30px rgba(0, 255, 255, 0.2); }

footer { text-align: center; padding: 30px; color: #aaa; font-size: 0.8em; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(10px); border-top: 1px solid rgba(255,255,255,0.1); }

/* 左下角悬浮按钮 */
.floating-btn {
    position: fixed; bottom: 30px; left: 30px; z-index: 1000;
    padding: 12px 20px; border-radius: 12px; font-family: inherit; font-size: 1em;
    background: rgba(0, 0, 0, 0.5); border: 1px solid #0ff; color: #0ff;
    backdrop-filter: blur(10px); cursor: pointer; transition: 0.3s;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}
.floating-btn:hover { background: rgba(0, 255, 255, 0.2); transform: translateY(-3px); }

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

/* 弹窗玻璃面板 */
.glass-panel {
    background: rgba(15, 15, 25, 0.7); border: 1px solid rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 16px; width: 90%; max-width: 600px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,255,255,0.1);
    transform: translateY(20px); transition: transform 0.3s ease;
    max-height: 80vh; display: flex; flex-direction: column;
}
.modal-overlay.active .glass-panel { transform: translateY(0); }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.modal-header h2 { font-size: 1.4em; }
.close-btn {
    background: none; border: none; color: #888; font-size: 1.5em; cursor: pointer; transition: 0.3s;
}
.close-btn:hover { color: #ff2222; transform: scale(1.1); }

.modal-body { padding: 20px; overflow-y: auto; text-align: left; }
.log-item {
    background: rgba(0, 0, 0, 0.3); border-left: 4px solid #0ff;
    padding: 15px; border-radius: 4px; margin-bottom: 15px;
}
.log-item h3 { font-size: 1.1em; margin-bottom: 10px; }
.log-item ul { margin-left: 20px; color: #bbb; font-size: 0.9em; line-height: 1.8; }

/* 悬浮控制面板样式 */
.settings-panel {
    position: fixed; top: 50%; right: -350px; transform: translateY(-50%);
    width: 300px; background: rgba(15, 15, 25, 0.85); border: 1px solid rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(20px); border-radius: 16px 0 0 16px; z-index: 2000;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5); transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 20px; color: #fff;
}
.settings-panel.open { right: 0; }
.settings-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 20px; }
.settings-header h3 { color: #0ff; font-size: 1.1em; }
#closePanelBtn { background: none; border: none; color: #888; font-size: 1.2em; cursor: pointer; }
#closePanelBtn:hover { color: #fff; }
.control-group { margin-bottom: 20px; }
.control-group label { display: block; font-size: 0.85em; color: #aaa; margin-bottom: 10px; }
.control-group input[type="range"] { width: 100%; cursor: pointer; accent-color: #0ff; }

@media (max-width: 600px) {
    .glitch { font-size: 3em; } .game-card { padding: 20px; }
    .settings-panel { width: 260px; right: -260px; padding: 15px; }
    .floating-btn { bottom: 20px; left: 20px; padding: 10px 15px; font-size: 0.9em; }
}