/* 
    Design System: Cyber Premium
    Colors: Deep Purple, Ocean Blue, Neon Glow
*/

:root {
    --bg-dark: #05070a;
    --bg-card: rgba(15, 18, 25, 0.7);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #0ea5e9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #f43f5e;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

body {
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    width: 100%;
}

#app-container {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 5;
    /* 内容层 */
}

#page-slider {
    display: flex;
    width: 200vw;
    height: 100vh;
    transition: transform 1s cubic-bezier(0.7, 0, 0.3, 1);
    background: transparent;
    will-change: transform;
    /* 开启 GPU 加速 */
}

.page {
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background: transparent;
}

/* 隐藏滚动条但保留功能 (Chrome/Safari) */
.page::-webkit-scrollbar {
    width: 6px;
}

.page::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 10px;
}

/* Slide Buttons */
.slide-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2000;
    cursor: pointer;
    transition: var(--transition);
    width: fit-content;
    /* 核心修复：防止容器撑满全屏遮挡交互 */
}

#slide-arrow-right {
    right: 2rem;
}

#slide-arrow-left {
    left: 2rem;
}

.btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-main);
    transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s;
    overflow: hidden;
    position: relative;
    padding: 0;
}

.slide-btn:hover .btn-inner {
    width: 140px;
    border-radius: 100px;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.slide-btn .hint {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    position: absolute;
    white-space: nowrap;
    transition: var(--transition);
    pointer-events: none;
}

#slide-arrow-right .hint {
    right: 45px;
}

#slide-arrow-left .hint {
    left: 45px;
}

.slide-btn:hover .hint {
    opacity: 1;
}

.slide-btn i {
    font-size: 1.5rem;
}

.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden;
}

/* Showcase Page Styling */
#showcase-page {
    display: flex;
    align-items: flex-start;
    /* 关键修复：从 center 改为 flex-start，防止内容在手机端被推离视口 */
    justify-content: center;
    background: radial-gradient(circle at 70% 30%, #1e1b4b 0%, #05070a 100%);
}

#trail-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* 位于 wrapper 内容之下，背景之上 */
}

.coming-soon {
    text-align: center;
}

.coming-soon h2 {
    font-size: 4rem;
    font-family: var(--font-heading);
    margin-bottom: 1.5rem;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin: 2rem auto;
    border-radius: 10px;
    overflow: hidden;
}

.loading-progress {
    width: 60%;
    height: 100%;
    background: var(--primary);
    animation: loading 2s ease-in-out infinite alternate;
}

@keyframes loading {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

/* Cursor Glow Effect */
#cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    will-change: transform;
    transition: width 0.3s, height 0.3s;
}

#cursor-glow.glow-expand {
    width: 800px;
    height: 800px;
}

/* Background Magic */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #05070a 100%);
    z-index: 1;
    /* 最底层 */
}

.bg-gradient::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite alternate;
    /* 改为呼吸动画 */
    z-index: -1;
    will-change: transform;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.1);
    }
}

/* Glassmorphism Utility - 性能优化版 */
.glass {
    background: rgba(15, 18, 25, 0.95);
    /* 提高不透明度，移除模糊，彻底解放 GPU */
    border: 1px solid var(--glass-border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* 仅在导航栏保留毛玻璃效果，作为视觉核心 */
#navbar.glass {
    background: rgba(15, 18, 25, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Navbar */
nav {
    position: sticky;
    /* 关键：相对于 .page 滚动容器固定 */
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: var(--transition);
    margin-bottom: -80px;
    /* 让出高度，不占位 */
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    /* 增加顶部间距给导航栏 */
    position: relative;
}

.hero .container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 10px 20px -10px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 30px -10px var(--primary-glow);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition);
    margin-left: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-main);
}

/* Hero Visual Card */
.visual-card {
    position: relative;
    padding: 2.5rem;
    border-radius: 24px;
    transform: rotate3d(1, 1, 1, 5deg);
    transition: var(--transition);
}

.visual-card:hover {
    transform: rotate3d(0, 0, 0, 0deg) scale(1.05);
}

.visual-card code {
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
}

/* Terminal Styles */
.terminal-card {
    width: 100%;
    max-width: 500px;
    height: 320px;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    font-family: 'Fira Code', 'Courier New', monospace;
    position: relative;
    backdrop-filter: blur(10px);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
    flex-grow: 1;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-right: 30px;
}

.terminal-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: #e0e0e0;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
}

.terminal-body::-webkit-scrollbar {
    display: none;
}

.terminal-line {
    margin-bottom: 6px;
    line-height: 1.5;
    word-break: break-all;
}

.command-output {
    color: #61afef;
    opacity: 0.9;
    margin-left: 5px;
}

.error {
    color: #e06c75;
    margin-left: 5px;
}

.input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.prompt {
    color: #98c379;
    font-weight: bold;
}

.terminal-input {
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-family: inherit;
    font-size: inherit;
    outline: none !important;
    flex-grow: 1;
    padding: 0;
}

.c-1 {
    color: #c678dd;
}

/* const */
.c-2 {
    color: #e5c07b;
}

/* var name */
.c-3 {
    color: #61afef;
}

/* property */
.c-4 {
    color: #98c379;
}

/* string */

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 10;
}

.scroll-indicator.hidden {
    opacity: 0;
    visibility: hidden;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
}

/* Sections */
.section {
    padding: 100px 0;
}

.section-title h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
}

.section-title span {
    color: var(--primary);
}

.section-title .line {
    width: 80px;
    height: 4px;
    background: var(--primary);
    margin-top: 1rem;
    border-radius: 2px;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.personal-info {
    margin-top: 2rem;
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
}

.info-item i {
    color: var(--primary);
    font-size: 1.2rem;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.stat-card {
    padding: 2rem;
    text-align: center;
    border-radius: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.skill-group {
    padding: 2.5rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
}

.skill-group:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(99, 102, 241, 0.1);
}

.skill-group h3 {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.skill-items {
    display: grid;
    gap: 1.5rem;
}

.skill-item span {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.project-card {
    border-radius: 24px;
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-img {
    height: 220px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-img img {
    transform: scale(1.1);
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    margin-bottom: 1rem;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tags span {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--primary);
}

.project-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--primary);
    gap: 0.8rem;
}

/* Contact Section */
.contact-card {
    padding: 4rem;
    border-radius: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
}

.contact-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-text p {
    color: var(--text-muted);
    max-width: 500px;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
}

.contact-item {
    padding: 1.2rem 2rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.contact-item:hover {
    background: var(--primary);
    transform: translateY(-5px);
    border-color: var(--primary);
}

.contact-item i {
    font-size: 1.8rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        order: 2;
    }

    .hero-visual {
        order: 1;
        max-width: 400px;
        margin: 0 auto;
    }

    h1 {
        font-size: 3rem;
    }

    .lead {
        margin: 0 auto 2.5rem;
    }

    .nav-links {
        display: none;
    }

    .about-grid,
    .skills-grid,
    .about-stats {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-card {
        flex-direction: column;
        padding: 2rem;
        text-align: center;
    }

    .contact-links {
        width: 100%;
        justify-content: center;
    }
}

/* Animations - Reveal on Scroll */
.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

/* Delay for Hero Content */
#home .hero-content {
    transition-delay: 0.2s;
}

#home .hero-visual {
    transition-delay: 0.4s;
}

/* ============================================================
   Showcase Page (炫技空间) - 实验室风格
   ============================================================ */

.showcase-wrapper {
    padding: 120px 5% 60px;
    min-height: 100vh;
}

.showcase-header {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    width: 100%;
}

.showcase-header h2 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    letter-spacing: -2px;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.showcase-header .subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    letter-spacing: 2px;
}

/* 地球英雄区 - 炫技页的门面 */
.galaxy-container {
    position: relative;
    width: 100%;
    height: 100vh;
    /* 占满首屏 */
    overflow: hidden;
    background: transparent;
    /* 彻底透明 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 120px;
    /* 增加底部留白，防止遮挡下方内容 */
}

.galaxy-container canvas {
    display: block;
}

/* 炫技页包裹层 */
.showcase-wrapper {
    position: relative;
    width: 100%;
}

/* 展厅布局 */
.showcase-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 3rem;
    perspective: 1200px;
}

/* 实验室卡片 (3D 悬浮效果) */
.lab-card {
    position: relative;
    height: 450px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out, border-color 0.3s;
}

.lab-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

.lab-card .card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: transform 0.5s, opacity 0.5s;
    z-index: 0;
}

.lab-card:hover .card-image {
    opacity: 0.8;
    transform: scale(1.1);
}

.lab-card .card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #05070a 10%, transparent 60%);
    z-index: 1;
}

.lab-card .card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem;
    z-index: 2;
    transform: translateZ(50px);
    /* 关键：文字悬浮在卡片上方 */
}

.lab-card .card-info h3 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: #fff;
}

.lab-card .card-info p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 加载状态指示器 */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 0;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .showcase-wrapper {
        padding: 80px 20px;
    }

    .showcase-header h2 {
        font-size: 2.5rem;
    }
}

/* --- 炫技页专用样式 (已隔离) --- */
/* --- 炫技页专用样式 (优化响应式) --- */
body .galaxy-container .showcase-header {
    position: absolute;
    top: 5%;
    /* 从 25% 调优至 15%，提升视觉重心 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    color: white;
    pointer-events: none;
    width: 90%;
    /* 手机端宽度适配 */
}

body .galaxy-container .showcase-header h2 {
    font-size: clamp(2rem, 10vw, 4.5rem);
    /* 使用响应式字号 */
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: 4px;
    background: linear-gradient(to bottom, #ffffff, #6366f1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 50px rgba(99, 102, 241, 0.3);
    white-space: normal;
    /* 手机端允许换行 */
}

body .galaxy-container .showcase-header .subtitle {
    font-size: clamp(0.9rem, 4vw, 1.4rem);
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: clamp(4px, 2vw, 12px);
    font-weight: 300;
    display: block;
    margin-top: 10px;
    white-space: normal;
    /* 手机端允许换行 */
}

/* --- Game Section: Starship Defender --- */
.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: rgba(10, 12, 18, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    margin-top: 40px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

@keyframes shake {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(5px, 5px);
    }

    50% {
        transform: translate(-5px, -5px);
    }

    75% {
        transform: translate(5px, -5px);
    }

    100% {
        transform: translate(0, 0);
    }
}

.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #05070a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
}

.btn-quit {
    background: rgba(255, 45, 85, 0.1);
    border: 1px solid rgba(255, 45, 85, 0.4);
    color: #ff2d55;
    padding: 2px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.btn-quit:hover {
    background: #ff2d55;
    color: #fff;
    box-shadow: 0 0 15px #ff2d55;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 10, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: opacity 0.5s ease;
}

.game-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    padding: 40px;
}

.overlay-content h2 {
    font-size: clamp(32px, 5vw, 48px);
    margin-bottom: 10px;
    color: #ff2d55;
    text-shadow: 0 0 20px rgba(255, 45, 85, 0.5);
    font-weight: 800;
}

.overlay-content p {
    color: #94a3b8;
    margin-bottom: 30px;
}

.btn-game {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 15px 40px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-game:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 30px var(--primary-color);
}

.controls-hint {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
    color: #64748b;
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
    }

    20% {
        clip: rect(62px, 9999px, 42px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 78px, 0);
    }

    60% {
        clip: rect(85px, 9999px, 13px, 0);
    }

    80% {
        clip: rect(54px, 9999px, 22px, 0);
    }

    100% {
        clip: rect(91px, 9999px, 3px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(12px, 9999px, 55px, 0);
    }

    40% {
        clip: rect(78px, 9999px, 21px, 0);
    }

    60% {
        clip: rect(33px, 9999px, 89px, 0);
    }

    80% {
        clip: rect(5px, 9999px, 47px, 0);
    }

    100% {
        clip: rect(98px, 9999px, 14px, 0);
    }
}

.game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background: #0a0c12;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.game-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(5, 7, 10, 0.8), transparent);
    z-index: 10;
    pointer-events: none;
}

.game-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.game-stats {
    display: flex;
    align-items: center;
    gap: 25px;
    pointer-events: auto;
    font-family: 'Fira Code', monospace;
    font-size: 16px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#game-score {
    letter-spacing: 1px;
}

/* 游戏血条矩阵 - 独立定位到左下角 */
.health-matrix {
    position: absolute;
    bottom: 30px;
    left: 30px;
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 11;
    pointer-events: none;
}

.shield-bars, .hull-bars {
    display: flex;
    gap: 4px;
}

.bar {
    width: 26px;
    height: 6px;
    border-radius: 1px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar.shield {
    background: #00fff9;
    box-shadow: 0 0 15px rgba(0, 255, 249, 0.4);
}

.bar.hull {
    background: #fbbf24;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}

.bar.depleted {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
    filter: brightness(0.2);
}

.health-matrix::after {
    content: 'CORE STATUS';
    position: absolute;
    bottom: -15px; /* 移动到血条下方 */
    left: 0;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1.5px;
}

@media (max-width: 768px) {
    .game-container {
        height: 400px;
    }

    .game-stats {
        font-size: 14px;
        gap: 15px;
    }
}

/* ============================================
   成就系统样式 (Achievement System)
   ============================================ */
#achievement-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.achievement-card {
    min-width: 320px;
    padding: 16px 20px;
    background: rgba(15, 18, 25, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 255, 249, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 18px;
    color: #fff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 
                inset 0 0 20px rgba(0, 255, 249, 0.05);
    transform: translateX(130%);
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: all;
    overflow: hidden;
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
}

.achievement-card.show {
    transform: translateX(0);
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: skewX(-30deg);
}

.achievement-card.show::before {
    animation: achievement-shimmer 3s infinite;
}

@keyframes achievement-shimmer {
    0% { left: -150%; }
    100% { left: 250%; }
}

.achievement-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #00fff9, #6366f1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(0, 255, 249, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.achievement-content {
    flex-grow: 1;
}

.achievement-title {
    font-size: 13px;
    font-weight: 800;
    color: #00fff9;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.achievement-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    font-weight: 300;
}

.achievement-close {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
    padding: 5px;
}

.achievement-close:hover {
    color: #ff2d55;
    transform: scale(1.1);
}

/* Toast & Modal System */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px var(--primary-glow);
    z-index: 10000;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    font-weight: 600;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    max-width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.qr-image {
    width: 250px;
    height: 250px;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: white; 
    object-fit: cover;
}

.close-modal {
    margin-top: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--primary);
}