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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    padding: 1rem 0;
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 4px;
    object-fit: cover;
}

.brand-name {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.2);
}

.admin-link {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hero-image img {
    width: 100%;
    border-radius: 12px;
}

/* Sections */
.featured,
.categories,
.stats,
.download {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: #1a202c;
}

.section-description {
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.game-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.game-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(45deg, #e2e8f0, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 500;
    font-size: 1rem;
}

.game-info {
    padding: 1.5rem;
}

.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.game-description {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.category-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1a202c;
    font-weight: 700;
}

.category-card p {
    color: #6b7280;
}

/* Statistics */
.stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Download Section */
.download {
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.download::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.download .container {
    position: relative;
    z-index: 1;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.download-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.download-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.download-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.2);
}

.download-card:hover::before {
    transform: scaleX(1);
}

.download-card.windows::before {
    background: linear-gradient(90deg, #0078d7, #2d9fd9);
}

.download-card.macos::before {
    background: linear-gradient(90deg, #000000, #444444);
}

.download-card.linux::before {
    background: linear-gradient(90deg, #fcc624, #f9a825);
}

.download-card.android::before {
    background: linear-gradient(90deg, #3ddc84, #00b480);
}

.download-card.ios::before {
    background: linear-gradient(90deg, #000000, #444444);
}

.download-icon {
    font-size: 3rem;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    border-radius: 24px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.download-card:hover .download-icon {
    transform: scale(1.1);
}

.download-icon.android {
    color: #3ddc84;
    background: rgba(61, 220, 132, 0.1);
}

.download-icon.windows {
    color: #0078d7;
    background: rgba(0, 120, 215, 0.1);
}

.download-icon.macos {
    color: #000000;
    background: rgba(0, 0, 0, 0.1);
}

.download-icon.linux {
    color: #fcc624;
    background: rgba(252, 198, 36, 0.1);
}

.download-icon.ios {
    color: #000000;
    background: rgba(0, 0, 0, 0.1);
}

.download-card h4 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: #1a202c;
    font-weight: 700;
}

.download-card p {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.download-meta {
    margin-bottom: 1.5rem;
}

.file-size {
    background: #f1f5f9;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.download-card.coming-soon .file-size {
    background: #e2e8f0;
    color: #718096;
}

.download-card .btn {
    width: 100%;
    padding: 12px;
    font-weight: 600;
    border-radius: 10px;
}

.download-card.windows .btn {
    background: linear-gradient(135deg, #0078d7 0%, #2d9fd9 100%);
    box-shadow: 0 10px 20px rgba(0, 120, 215, 0.3);
}

.download-card.macos .btn {
    background: linear-gradient(135deg, #000000 0%, #444444 100%);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.download-card.linux .btn {
    background: linear-gradient(135deg, #fcc624 0%, #f9a825 100%);
    box-shadow: 0 10px 20px rgba(252, 198, 36, 0.3);
}

.download-card.android .btn {
    background: linear-gradient(135deg, #3ddc84 0%, #00b480 100%);
    box-shadow: 0 10px 20px rgba(61, 220, 132, 0.3);
}

.download-card.ios .btn {
    background: linear-gradient(135deg, #000000 0%, #444444 100%);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.download-card.windows .btn:hover {
    box-shadow: 0 15px 30px rgba(0, 120, 215, 0.4);
}

.download-card.macos .btn:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.download-card.linux .btn:hover {
    box-shadow: 0 15px 30px rgba(252, 198, 36, 0.4);
}

.download-card.android .btn:hover {
    box-shadow: 0 15px 30px rgba(61, 220, 132, 0.4);
}

.download-card.ios .btn:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

/* Footer */
.footer {
    background: #1a202c;
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-section h5 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #f7fafc;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #667eea;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    transition: background 0.3s;
}

.social-link:hover {
    background: rgba(255,255,255,0.2);
}

.footer-bottom {
    border-top: 1px solid #2d3748;
    padding-top: 1rem;
    text-align: center;
    color: #a0aec0;
}

/* About Page */
.main {
    padding: 4rem 0;
    min-height: 60vh;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.about-content h2 {
    color: #1a202c;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.about-content h3 {
    color: #2d3748;
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.about-content p {
    color: #4a5568;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.about-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
}

.about-content li {
    color: #4a5568;
    margin-bottom: 0.5rem;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

/* Coming Soon Modal */
.coming-soon-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.coming-soon-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.coming-soon-content h3 {
    margin-bottom: 1rem;
    color: #1a202c;
}

.coming-soon-content p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

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

    .hero-title {
        font-size: 2rem;
    }

    .nav-menu {
        display: none;
    }

    .games-grid,
    .categories-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .download-grid {
        max-width: 100%;
        padding: 0 1rem;
    }

    .download-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .download-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .download-info {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .download-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Chip Selector Styles - 保留以防其他地方使用 */
.chip-selector {
    margin-bottom: 1.2rem;
}

.chip-selector select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image:
        linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%),
        url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 12px center;
    background-size: cover, 20px;
    padding-right: 45px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chip-selector select:focus {
    outline: none;
    border-color: #6366f1;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    box-shadow:
        0 0 0 4px rgba(99, 102, 241, 0.12),
        0 4px 16px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.chip-selector select:hover {
    border-color: #9ca3af;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.chip-selector select:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 以下为旧的 macOS 特定样式，现已不再使用，但保留以防兼容性问题 */
.download-card.macos .chip-selector select {
    border-color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(10px);
}

.download-card.macos:hover .chip-selector select {
    border-color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
}

.download-card.macos .chip-selector select:focus {
    border-color: #6366f1;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    backdrop-filter: blur(15px);
}

/* Add subtle animation */
@keyframes chipSelectorPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    50% {
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    }
}

.chip-selector select:focus {
    animation: chipSelectorPulse 2s infinite;
}

/* macOS Chip Selector Modal */
.chip-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.chip-modal.show {
    display: flex;
}

.chip-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.chip-modal-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: scale(0.9);
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.chip-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 0 32px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.chip-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.chip-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chip-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.chip-modal-body {
    padding: 0 32px 32px 32px;
}

.chip-modal-body > p {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
}

.chip-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.chip-option {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    position: relative;
    overflow: hidden;
}

.chip-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.chip-option:hover::before {
    left: 100%;
}

.chip-option:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow:
        0 12px 24px rgba(99, 102, 241, 0.15),
        0 0 0 1px rgba(99, 102, 241, 0.1);
}

.chip-option:active {
    transform: translateY(0);
}

.chip-option-icon {
    font-size: 2rem;
    margin-right: 16px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}

.chip-option:hover .chip-option-icon {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: #c7d2fe;
}

.chip-option-content {
    flex: 1;
}

.chip-option-content h4 {
    margin: 0 0 4px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
}

.chip-option-content p {
    margin: 0 0 8px 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.chip-option-size {
    display: inline-block;
    background: #f3f4f6;
    color: #374151;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.chip-option:hover .chip-option-size {
    background: #eef2ff;
    color: #6366f1;
}

.chip-option-arrow {
    font-size: 1.5rem;
    color: #9ca3af;
    margin-left: 16px;
    transition: all 0.3s ease;
}

.chip-option:hover .chip-option-arrow {
    color: #6366f1;
    transform: translateX(4px);
}

.chip-modal-help {
    background: linear-gradient(135deg, #fef7ff 0%, #f3e8ff 100%);
    border: 1px solid #e9d5ff;
    border-radius: 12px;
    padding: 16px;
}

.chip-modal-help p {
    margin: 0;
    color: #7c3aed;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chip-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
        max-width: none;
    }

    .chip-modal-header,
    .chip-modal-body {
        padding-left: 20px;
        padding-right: 20px;
    }

    .chip-option {
        padding: 16px;
    }

    .chip-option-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-right: 12px;
    }

    .chip-option-content h4 {
        font-size: 1.1rem;
    }

    .chip-option-content p {
        font-size: 0.9rem;
    }
}