/* 响应式设计 */

/* 平板设备 */
@media (max-width: 1024px) {
    .main-container {
        gap: 1rem;
        padding: 1rem;
    }
    
    .sidebar {
        width: 240px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
}

/* 移动设备 */
@media (max-width: 768px) {
    /* Header 移动端样式 */
    .mobile-menu-btn {
        display: flex;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.9);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .nav.active {
        display: flex;
    }
    
    .header-container {
        flex-wrap: wrap;
        position: relative;
    }
    
    .search-input {
        width: 150px;
    }
    
    /* Main Container 移动端样式 */
    .main-container {
        flex-direction: column;
        padding: 1rem 0.5rem;
    }
    
    /* Sidebar 移动端样式 */
    .sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        z-index: 200;
        transition: right 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar.active {
        right: 0;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar-header h2 {
        display: block;
    }
    
    /* Welcome Section 移动端样式 */
    .welcome-section h1 {
        font-size: 2rem;
    }
    
    .welcome-section p {
        font-size: 1rem;
    }
    
    /* Games Grid 移动端样式 */
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .game-image {
        height: 180px;
    }
    
    /* Footer 移动端样式 */
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 小屏幕移动设备 */
@media (max-width: 480px) {
    .header-container {
        padding: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .search-input {
        width: 120px;
        font-size: 0.9rem;
    }
    
    .welcome-section {
        margin-bottom: 2rem;
    }
    
    .welcome-section h1 {
        font-size: 1.8rem;
    }
    
    .welcome-section p {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .game-image {
        height: 160px;
        font-size: 0.9rem;
    }
    
    .game-info {
        padding: 0.75rem;
    }
    
    .game-name {
        font-size: 1rem;
    }
    
    .game-description {
        font-size: 0.85rem;
    }
    
    .sidebar {
        width: 100%;
        right: -100%;
    }
    
    .footer-container {
        padding: 0 0.5rem;
    }
    
    .footer-logo h2 {
        font-size: 1.2rem;
        padding: 0.4rem 0.8rem;
    }
    
    .footer-link {
        font-size: 0.85rem;
    }
    
    .footer-copyright {
        font-size: 0.8rem;
    }
}

/* 超小屏幕设备 */
@media (max-width: 320px) {
    .header-container {
        padding: 0.25rem;
    }
    
    .logo {
        padding: 0.25rem 0.5rem;
    }
    
    .logo h1 {
        font-size: 0.9rem;
    }
    
    .search-input {
        width: 100px;
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .search-btn, .search-toggle {
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .welcome-section h1 {
        font-size: 1.5rem;
    }
    
    .welcome-section p {
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .game-image {
        height: 140px;
        font-size: 0.8rem;
    }
    
    .category-btn {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .welcome-section {
        margin-bottom: 1.5rem;
    }
    
    .welcome-section h1 {
        font-size: 1.8rem;
    }
    
    .welcome-section p {
        font-size: 0.9rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .game-image {
        height: 140px;
    }
    
    .sidebar {
        width: 250px;
    }
}

/* 高分辨率屏幕优化 */
@media (min-width: 1200px) {
    .main-container {
        max-width: 1400px;
    }
    
    .header-container {
        max-width: 1400px;
    }
    
    .footer-container {
        max-width: 1400px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

/* 打印样式 */
@media print {
    .header, .sidebar, .footer {
        display: none;
    }
    
    .main-container {
        flex-direction: column;
        max-width: 100%;
    }
    
    .main-content {
        width: 100%;
    }
    
    .game-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .game-card, .welcome-section {
        border: 1px solid #ccc;
        background: white;
        color: black;
    }
}

