/* ================= 全局重置 ================= */
:root {
    --primary-color: #e63946;
    --bg-color: #030304;
    --glass-bg: rgba(20, 20, 20, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #888888;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif; 
    background-color: transparent; 
    color: var(--text-main); 
    overflow-x: hidden; 
}

/* === 全局 CRT 扫描线滤镜 (不影响点击) === */
body::after {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.1) 50%,
        rgba(0,0,0,0.1)
    );
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.6;
}

/* 背景 Canvas */
#bg-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--bg-color); z-index: -1; pointer-events: none; }

/* 侧边栏 (桌面端) */
#main-header { position: fixed; top: 0; left: 0; height: 100%; width: 70px; background: rgba(5, 5, 5, 0.7); backdrop-filter: blur(15px); border-right: 1px solid var(--glass-border); transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 1000; display: flex; flex-direction: column; align-items: center; padding-top: 30px; overflow: hidden; box-shadow: 5px 0 20px rgba(0,0,0,0.5); }
#main-header:hover { width: 240px; }

/* Logo */
#nav-logo { width: 100%; height: 60px; display: flex; justify-content: flex-start; margin-bottom: 20px; }
.logo-container { position: relative; display: flex; align-items: center; height: 100%; width: 100%; font-family: 'Arial Black', sans-serif; font-weight: 900; }
.logo-z { display: flex; justify-content: center; align-items: center; width: 70px; flex-shrink: 0; font-size: 2rem; color: var(--primary-color); z-index: 2; background: transparent; }
.logo-rest { font-size: 1.5rem; color: #fff; opacity: 0; transform: translateX(-20px); transition: all 0.3s ease 0.1s; white-space: nowrap; }
#main-header:hover .logo-rest { opacity: 1; transform: translateX(0); }

/* 导航链接 */
nav { width: 100%; padding: 0 12px; }
.nav-link { display: flex; align-items: center; padding: 12px 14px; margin-bottom: 8px; border-radius: 12px; color: var(--text-muted); text-decoration: none; transition: all 0.3s ease; position: relative; height: 52px; white-space: nowrap; overflow: hidden; }
.nav-link svg { width: 24px; height: 24px; min-width: 24px; stroke: currentColor; stroke-width: 2; fill: none; margin-right: 20px; transition: transform 0.3s; }
.nav-link span { opacity: 0; transform: translateX(-10px); transition: all 0.3s ease; }
#main-header:hover .nav-link span { opacity: 1; transform: translateX(0); }
.nav-link:hover, .nav-link.active { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-link:hover svg { stroke: var(--primary-color); transform: scale(1.1); }

/* 主内容 */
#main-content { margin-left: 70px; transition: margin-left 0.4s ease; position: relative; z-index: 1; }
#main-header:hover ~ #main-content { margin-left: 240px; }

/* Hero */
.hero { 
    position: relative; width: 100%; 
    height: 100dvh; 
    min-height: 600px;
    display: flex; justify-content: center; align-items: center; overflow: hidden; 
}
#text-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; }
.hero-overlay { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); text-align: center; z-index: 3; pointer-events: none; }
.scroll-icon { width: 20px; height: 30px; border: 2px solid rgba(255,255,255,0.3); border-radius: 10px; margin: 0 auto; position: relative; }
.scroll-icon::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: #fff; border-radius: 50%; animation: scrollDown 1.5s infinite; }
@keyframes scrollDown { 0% { opacity: 1; top: 6px; } 100% { opacity: 0; top: 18px; } }

/* 3D 全息投影容器 */
.hologram-divider {
    width: 100%; height: 350px; position: relative; 
    background: radial-gradient(circle at center, rgba(10,10,30,0.4), transparent 70%);
    overflow: visible; margin: 0 auto; display: flex; justify-content: center; align-items: center;
    cursor: grab; touch-action: none;
    /* ★ 新增：最大宽度限制，防止全息球太散 */
    max-width: 1600px;
}
.hologram-divider:active { cursor: grabbing; }
.holo-canvas { width: 100%; height: 100%; display: block; }

/* ★ 更新：内容区域增加最大宽度限制和居中 */
.content { 
    padding: 100px 8%; 
    position: relative; 
    z-index: 1; 
    max-width: 1600px; /* 限制最大宽度 */
    margin-left: auto; /* 居中 */
    margin-right: auto; /* 居中 */
}
.section-title { font-size: 2rem; margin-bottom: 40px; font-weight: 800; letter-spacing: -1px; background: linear-gradient(120deg, #fff 0%, #666 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; border-left: 4px solid var(--primary-color); padding-left: 20px; }

/* ======== 游戏卡片 (Spotlight 边框光效) ======== */
/* ★ 修复：使用 1fr 让 Steam 游戏能撑满整行，配合 max-width 限制单卡片过宽 */
.game-card-list { 
    display: grid; 
    /* 恢复 1fr，让列宽自动填充剩余空间 */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 30px; 
    perspective: 1000px; 
}

.game-card { 
    position: relative; 
    border-radius: 20px; 
    cursor: pointer; 
    transform-style: preserve-3d; 
    transform: perspective(1000px); 
    width: 100%;
    /* 关键：给卡片本体加最大宽度限制，并居中 */
    max-width: 550px; 
    margin: 0 auto;   
}

.game-card-inner {
    background: rgba(15, 15, 20, 0.8); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-radius: 20px; overflow: hidden;
    transition: transform 0.1s ease-out; transform-style: preserve-3d;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4); 
    position: relative;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.game-card-inner::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: 20px;
    padding: 1.5px;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.7), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0; transition: opacity 0.4s; pointer-events: none; z-index: 10;
}

.shine { 
    position: absolute; inset: 0; 
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.15), transparent 40%);
    opacity: 0; transition: opacity 0.4s; pointer-events: none; z-index: 11;
}

.game-card:hover .game-card-inner::before,
.game-card:hover .shine { opacity: 1; }
.game-card:hover .game-card-inner { box-shadow: 0 30px 60px rgba(0,0,0,0.6); }
.game-card.is-resetting .game-card-inner { transition: transform 0.5s ease; }

.game-card-slideshow { height: 200px; position: relative; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,0.05); }
.game-card-slideshow img { width: 100%; height: 100%; object-fit: cover; position: absolute; opacity: 0; transition: opacity 1s ease; filter: grayscale(20%); transform: scale(1.05); }
.game-card:hover .game-card-slideshow img { filter: grayscale(0%); }
.game-card-slideshow img.active { opacity: 1; }
.game-card-body { padding: 20px; transform: translateZ(20px); position: relative; z-index: 6; }
.game-card h4 { font-size: 1.3rem; margin-bottom: 5px; color: #fff; }
.game-card p { font-size: 0.9rem; color: #999; margin-bottom: 15px; }
.tags span { display: inline-block; padding: 4px 10px; margin-right: 5px; background: rgba(255,255,255,0.1); border-radius: 4px; font-size: 0.75rem; color: #ccc; }

/* 招聘与联系 */
.careers-intro { margin-bottom: 40px; color: #aaa; line-height: 1.6; }
.careers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.career-card { background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border); padding: 30px; border-radius: 16px; transition: all 0.3s ease; display: flex; flex-direction: column; align-items: flex-start; }
.career-card:hover { background: rgba(255,255,255,0.05); transform: translateY(-5px); border-color: var(--primary-color); }
.c-header { font-size: 0.75rem; color: var(--primary-color); letter-spacing: 2px; margin-bottom: 15px; font-weight: 700; }
.career-card h4 { font-size: 1.2rem; margin-bottom: 10px; color: #fff; }
.career-card p { font-size: 0.9rem; color: #888; margin-bottom: 25px; flex-grow: 1; line-height: 1.5; }

/* === Cyber 按钮样式 === */
.cyber-btn {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem; 
    font-weight: 900;
    letter-spacing: 4px;
    color: #fff;
    background: linear-gradient(90deg, #e63946, #d00000);
    padding: 22px 70px;
    text-decoration: none;
    text-transform: uppercase;
    border: 2px solid transparent;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    box-shadow: 0 0 30px rgba(230, 57, 70, 0.4);
}

.cyber-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 50px rgba(230, 57, 70, 0.8), 0 0 15px rgba(255, 255, 255, 0.5);
    background: linear-gradient(90deg, #ff4d5a, #e60000);
    letter-spacing: 6px;
}

.cyber-btn:active {
    transform: scale(0.98);
}

.cyber-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -150%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    transform: skewX(-25deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.contact-card { display: flex; align-items: center; padding: 20px; background: rgba(30,30,30,0.6); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; text-decoration: none; transition: all 0.3s ease; }
.contact-card .icon { width: 40px; height: 40px; margin-right: 15px; display: flex; align-items: center; justify-content: center; color: #888; transition: 0.3s; }
.contact-card .icon svg { width: 28px; height: 28px; }
.contact-card .info { display: flex; flex-direction: column; }
.contact-card .label { font-size: 0.8rem; color: #666; text-transform: uppercase; }
.contact-card .value { font-size: 1rem; color: #fff; font-weight: 600; }
.contact-card:hover { transform: translateY(-5px); background: rgba(40,40,40,0.9); border-color: rgba(255,255,255,0.2); }
.contact-card:hover .icon { color: #fff; transform: scale(1.1); }
.c-discord:hover { border-color: #5865F2; } .c-discord:hover .icon { color: #5865F2; }
.c-youtube:hover { border-color: #FF0000; } .c-youtube:hover .icon { color: #FF0000; }
.c-twitter:hover { border-color: #1DA1F2; } .c-twitter:hover .icon { color: #1DA1F2; }
.c-bilibili:hover { border-color: #00A1D6; } .c-bilibili:hover .icon { color: #00A1D6; }

.placeholder-box { padding: 60px; border: 1px dashed rgba(255,255,255,0.2); border-radius: 20px; text-align: center; background: rgba(0,0,0,0.2); }
.glitch-text { font-size: 1.5rem; font-weight: 800; letter-spacing: 5px; color: #444; }
.reveal-text, .stagger-item { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.is-visible { opacity: 1; transform: translateY(0); }
/* ★ 更新：Footer 也限制最大宽度 */
footer { 
    padding: 40px 0; 
    text-align: center; 
    color: #444; 
    font-size: 0.8rem; 
    margin-top: 60px; 
    border-top: 1px solid rgba(255,255,255,0.05); 
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

/* ================= 移动端适配 ================= */
@media (max-width: 768px) {
    #main-header { position: fixed !important; top: auto !important; bottom: 0 !important; left: 0 !important; width: 100% !important; height: 60px !important; display: flex !important; flex-direction: row !important; justify-content: center !important; align-items: center !important; padding: 0 !important; margin: 0 !important; background: rgba(10, 10, 10, 0.98) !important; backdrop-filter: blur(20px); border-right: none !important; border-top: 1px solid rgba(255,255,255,0.1) !important; box-shadow: 0 -5px 20px rgba(0,0,0,0.5) !important; z-index: 9999 !important; }
    #main-header:hover { width: 100% !important; }
    #nav-logo { display: none !important; }
    nav { display: flex !important; flex-direction: row !important; width: 100% !important; height: 100% !important; padding: 0 !important; margin: 0 !important; }
    .nav-link { flex: 1 1 0px !important; width: 0 !important; height: 100% !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; display: flex !important; flex-direction: column !important; justify-content: center !important; align-items: center !important; background: transparent !important; }
    .nav-link svg { width: 20px !important; height: 20px !important; margin: 0 0 4px 0 !important; transform: none !important; }
    .nav-link span { opacity: 1 !important; transform: none !important; font-size: 10px !important; display: block !important; width: auto !important; line-height: 1 !important; }
    #main-content { margin-left: 0 !important; padding-bottom: 80px !important; width: 100% !important; }
    #main-header:hover ~ #main-content { margin-left: 0 !important; }
    .hologram-divider { height: 250px !important; }
    .game-card-list { grid-template-columns: 1fr !important; }
    .contact-grid { grid-template-columns: 1fr !important; }
    .logo-container { padding-left: 0 !important; }
    .cyber-btn { padding: 18px 40px; font-size: 1.1rem; }
}

/* ================= 预加载器样式 (Logo Glitch 修复版) ================= */
#preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #050505; z-index: 99999; display: flex; justify-content: center; align-items: center; transition: opacity 0.8s ease-out, visibility 0.8s ease-out; }
#preloader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-content { position: relative; text-align: center; width: 300px; }
.loader-logo { position: relative; font-family: Arial, sans-serif; font-size: 80px; font-weight: 900; color: #e63946; margin-bottom: 20px; animation: pulse 2s infinite; text-shadow: 0 0 20px rgba(230, 57, 70, 0.5); display: inline-block; }
.loader-logo::before, .loader-logo::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #050505; overflow: hidden; clip-path: inset(0 0 0 0); }
.loader-logo::before { left: 3px; text-shadow: -2px 0 #00f3ff; animation: glitch-anim-1 2.5s infinite linear alternate-reverse; }
.loader-logo::after { left: -3px; text-shadow: -2px 0 #ff00c1; animation: glitch-anim-2 3s infinite linear alternate-reverse; }
.loader-text { font-family: 'Courier New', monospace; color: #00f3ff; font-size: 14px; letter-spacing: 4px; margin-bottom: 15px; text-shadow: 0 0 10px rgba(0, 243, 255, 0.5); }
.scanner { position: absolute; top: -50px; left: 0; width: 100%; height: 2px; background: #00f3ff; box-shadow: 0 0 10px #00f3ff; animation: scan 2s ease-in-out infinite; opacity: 0.5; }
.progress-bar { width: 100%; height: 4px; background: #1a1a1a; border-radius: 2px; overflow: hidden; position: relative; }
.progress-fill { width: 0%; height: 100%; background: #e63946; box-shadow: 0 0 10px #e63946; animation: loadProgress 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(0.98); } }
@keyframes scan { 0% { top: -20px; opacity: 0; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes loadProgress { 0% { width: 0%; } 40% { width: 70%; } 80% { width: 90%; } 100% { width: 100%; } }
@keyframes glitch-anim-1 { 0% { clip-path: inset(20% 0 80% 0); } 20% { clip-path: inset(60% 0 10% 0); } 40% { clip-path: inset(40% 0 50% 0); } 60% { clip-path: inset(80% 0 5% 0); } 80% { clip-path: inset(10% 0 70% 0); } 100% { clip-path: inset(30% 0 20% 0); } }
@keyframes glitch-anim-2 { 0% { clip-path: inset(10% 0 60% 0); } 20% { clip-path: inset(80% 0 5% 0); } 40% { clip-path: inset(30% 0 20% 0); } 60% { clip-path: inset(15% 0 80% 0); } 80% { clip-path: inset(55% 0 10% 0); } 100% { clip-path: inset(40% 0 30% 0); } }