/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #000000;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.nav-brand:hover {
    color: #53ff8a;
    text-decoration: none;
    transform: translateY(-1px);
}

.logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.brand-text {
    color: white;
    font-weight: bold;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    position: relative;
}

.nav-link:hover {
    color: white;
}

.nav-link.active {
    color: white;
    border-bottom-color: white;
}

.demo-link {
    color: #53ff8a !important;
    font-weight: bold !important;
}

.demo-link:hover {
    color: #53ff8a !important;
    text-shadow: 0 0 8px rgba(83, 255, 138, 0.3);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background-color: white;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    padding-top: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gameCanvas {
    width: 100%;
    height: calc(100vh - 280px);
    display: block;
    background-color: #000000;
    cursor: crosshair;
}

/* 响应式显示控制 */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* 移动端首页样式 */
.mobile-hero {
    min-height: calc(100vh - 160px);
    background: linear-gradient(135deg, #000000 0%, #111111 100%);
    position: relative;
    overflow: hidden;
    padding: 2rem 0;
}

.hero-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 10;
}

/* 移动端像素标题 */
.pixel-title-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.mobile-pixel-canvas {
    display: block;
    margin: 0 auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 移动端主标题区域 */
.hero-text {
    text-align: center;
    margin-bottom: 3rem;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #53ff8a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.02em;
}

.main-subtitle {
    font-size: 1.1rem;
    color: #9ca3af;
    font-weight: 300;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
}

.tagline {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* 快捷导航 - 田字格布局 */
.quick-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 5rem;
    padding: 1rem;
    max-width: 350px;
    margin-left: auto;
    margin-right: auto;
}

.quick-nav-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem 1rem;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    backdrop-filter: blur(15px);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    /* 确保移动端链接可点击 */
    -webkit-tap-highlight-color: rgba(170, 119, 255, 0.2);
    touch-action: manipulation;
    user-select: none;
    /* 确保链接层级最高 */
    z-index: 10;
    /* 防止快速点击时的双击缩放 */
    -ms-touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    /* 确保整个区域都可点击 */
    cursor: pointer;
}

.quick-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(170, 119, 255, 0.15) 0%, rgba(170, 119, 255, 0.05) 50%, transparent 100%);
    opacity: 0.6;
    transition: all 0.4s ease;
}

.quick-nav-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(170, 119, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.quick-nav-item:hover,
.quick-nav-item:active,
.quick-nav-item:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(170, 119, 255, 0.3);
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 40px rgba(170, 119, 255, 0.15);
}

.quick-nav-item:hover::before,
.quick-nav-item:active::before {
    opacity: 1;
}

.quick-nav-item:hover::after,
.quick-nav-item:active::after {
    width: 120%;
    height: 120%;
}

/* 数字编号样式 */
.nav-number {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: rgba(170, 119, 255, 0.9);
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 12;
    text-shadow: 0 2px 10px rgba(170, 119, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.02em;
    /* 确保数字不会阻挡点击 */
    pointer-events: none;
}

.nav-text {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    display: block;
    line-height: 1.2;
    z-index: 12;
    position: relative;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    /* 确保文字不会阻挡点击 */
    pointer-events: none;
}

/* 悬停效果 */
.quick-nav-item:hover .nav-number,
.quick-nav-item:active .nav-number {
    color: rgba(170, 119, 255, 1);
    transform: scale(1.1);
    text-shadow: 0 4px 20px rgba(170, 119, 255, 0.5);
}

.quick-nav-item:hover .nav-text,
.quick-nav-item:active .nav-text {
    color: #ffffff;
    transform: translateY(-2px);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* 简介区域样式已删除，因为HTML中已无此元素 */

/* 装饰性粒子动画 */
.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(83, 255, 138, 0.6);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.particle-2 {
    top: 60%;
    right: 15%;
    animation-delay: 1.5s;
    background: rgba(0, 212, 255, 0.6);
}

.particle-3 {
    top: 40%;
    left: 80%;
    animation-delay: 3s;
}

.particle-4 {
    top: 80%;
    left: 20%;
    animation-delay: 4.5s;
    background: rgba(170, 119, 255, 0.6);
}

.particle-5 {
    top: 10%;
    right: 30%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-20px);
        opacity: 1;
    }
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .main-subtitle {
        font-size: 1rem;
    }
    
    .tagline {
        font-size: 0.85rem;
    }
    
    .quick-nav {
        gap: 1.2rem;
        padding: 0.5rem;
        max-width: 300px;
    }
    
    .quick-nav-item {
        padding: 1.6rem 0.8rem;
    }
    
    .nav-number {
        font-size: 1.8rem;
        margin-bottom: 0.6rem;
    }
    
    .nav-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-container {
        padding: 0 1rem;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .main-subtitle {
        font-size: 0.9rem;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    .quick-nav {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 1rem;
        max-width: 280px;
    }
    
    .quick-nav-item {
        padding: 1.4rem 0.6rem;
        aspect-ratio: 1;
    }
    
    .nav-number {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }
    
    .nav-text {
        font-size: 0.85rem;
    }
    
    .pixel-title-section {
        margin-bottom: 1.5rem;
    }
    
    .hero-text {
        margin-bottom: 2rem;
    }
}

/* 页脚样式 */
.footer {
    background-color: #000000;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
}

.footer-divider {
    width: 100%;
    height: 1px;
    background-color: #4b5563;
    margin: 0 0 1.5rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.footer-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-item p {
    color: #d1d5db;
    text-align: center;
    line-height: 1.5;
}

.footer-copyright {
    text-align: center;
    color: #9ca3af;
    font-size: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #4b5563;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        padding: 2rem 0;
        gap: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .footer-item {
        justify-content: center;
    }

    #gameCanvas {
        height: calc(100vh - 320px);
    }

    .nav-container {
        padding: 1rem;
    }

    .brand-text {
        font-size: 1.1rem;
    }

    .logo {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        font-size: 0.8rem;
    }

    .footer-item p {
        padding: 0 1rem;
    }

    #gameCanvas {
        height: calc(100vh - 350px);
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: fadeIn 0.8s ease-out;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}