body {
    font-family:
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        sans-serif;
    background: #f5f5f5;
    color: #222;
    margin: 0;
    padding: 2rem;
}

.top-nav {
    margin-bottom: 1.5rem;
    padding-left: 0.25rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.back-link:hover {
    color: #0077cc;
    text-decoration: none;
    transform: translateX(-4px);
}

h1 {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 3.5rem;
    font-size: 2rem;
    font-weight: 600;
}

.summary {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.summary h2 {
    margin-top: 0;
    color: #333;
}

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

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0077cc;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .gallery {
        grid-template-columns: 1fr;
    }
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rank-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
}

.fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
    color: #888;
    text-align: center;
}

.enlarge-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s ease;
    z-index: 10;
}

.enlarge-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.card-content {
    padding: 0.75rem;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.function-name {
    margin: 0;
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

footer {
    margin-top: 4rem;
    text-align: center;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

footer a {
    color: #0077cc;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
