/* ================================
   SWF 展示平台 - 簡潔圖標風格
   ================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #1a1a1a;
    --bg-card: #2d2d2d;
    --bg-hover: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --accent: #4a9eff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 40px 20px;
}

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 60px;
}

.logo {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    max-width: 2200px;
    margin: 0 auto;
    gap: 32px;
    padding: 40px;
}

@media (min-width: 2200px) {
    .gallery-grid {
        grid-template-columns: repeat(10, 1fr);
    }
}

/* Card */
.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    padding: 24px 24px 16px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    transition: background 0.2s ease;
}

.card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.card-icon {
    width: 180px;
    height: 180px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: background 0.2s ease;
}

.card:hover .card-icon {
    background: #f0f0f0;
}

.card-icon img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.card-icon-placeholder {
    font-size: 5rem;
}

.card-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    font-weight: 400;
    transition: color 0.2s ease;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card:hover .card-title {
    color: #ff9800;
}

/* Loading */
.loading {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-card);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-text {
    font-size: 1rem;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #3a8eef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

/* RWD */
@media (max-width: 768px) {
    body {
        padding: 30px 15px;
    }

    .header {
        margin-bottom: 40px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 20px;
        padding: 10px;
    }

    .card-icon {
        width: 80px;
        height: 80px;
    }

    .card-icon img {
        width: 50px;
        height: 50px;
    }

    .card-icon-placeholder {
        font-size: 2.5rem;
    }

    .card-title {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 15px;
    }

    .card-icon {
        width: 70px;
        height: 70px;
    }

    .card-icon img {
        width: 45px;
        height: 45px;
    }

    .card-icon-placeholder {
        font-size: 2rem;
    }
}