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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    position: relative;
}

.header-info {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInDelayed 0.8s ease-out 1s forwards;
}

.copyright {
    font-size: 0.7rem;
    color: #999;
    font-weight: 300;
    letter-spacing: 0.025rem;
}

.mastodon-link {
    display: flex;
    align-items: center;
    color: #999;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.25rem;
    border-radius: 4px;
}

.mastodon-link:hover {
    color: #6364ff;
    background: rgba(99, 100, 255, 0.05);
    transform: scale(1.1);
}

.mastodon-link svg {
    width: 16px;
    height: 16px;
}

header h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.3rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    opacity: 0;
    transform: translateY(-20px);
    animation: slideInDown 0.8s ease-out forwards;
}

@keyframes slideInDown {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.8s ease-out 0.3s forwards;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #1a1a1a;
    transition: width 0.3s ease;
}

.filter-btn:hover::before,
.filter-btn.active::before {
    width: 100%;
}

.filter-btn:hover,
.filter-btn.active {
    color: #1a1a1a;
    border-color: rgba(0,0,0,0.2);
}

.illust-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.nsfw-control {
    position: absolute;
    top: -20px;
    right: -10px;
    opacity: 0;
    transform: scale(0.8);
    animation: fadeInDelayed 0.8s ease-out 0.8s forwards;
}

@keyframes fadeInDelayed {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.nsfw-switch {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    font-size: 0.65rem;
    color: #999;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    font-weight: 300;
    letter-spacing: 0.025rem;
}

.nsfw-switch input[type="checkbox"] {
    display: none;
}

.slider {
    position: relative;
    width: 20px;
    height: 12px;
    background: #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.slider::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.nsfw-switch input:checked + .slider {
    background: #e74c3c;
}

.nsfw-switch input:checked + .slider::before {
    transform: translateX(8px);
}

.nsfw-switch:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nsfw-switch .label {
    user-select: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nsfw-switch input:checked ~ .label {
    color: #e74c3c;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

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

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gallery-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: filter 0.3s ease;
}

.gallery-item.illust img,
.gallery-item.vrchat img {
    object-position: center 15%;
}

.gallery-item.design img {
    object-position: center center;
}


.gallery-item.nsfw img {
    filter: blur(10px);
}

.gallery-item.nsfw:hover img {
    filter: blur(5px);
}

.nsfw-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 250px;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    font-weight: bold;
    pointer-events: none;
}

.nsfw-tag {
    background: #e74c3c;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.nsfw-tag.r18g {
    background: #8e44ad;
}

.nsfw-warning {
    font-size: 0.8rem;
    text-align: center;
    opacity: 0.9;
}

.item-info {
    padding: 1rem;
}

.item-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.item-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #ecf0f1;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #2c3e50;
    text-transform: uppercase;
    font-weight: 600;
}

.item-category.illust {
    background: #e8f5e8;
    color: #27ae60;
}

.item-category.design {
    background: #fdf2e9;
    color: #e67e22;
}

.item-category.vrchat {
    background: #eef7ff;
    color: #0066cc;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .gallery-item img {
        height: 200px;
        object-position: center top;
    }
    
    .gallery-item.illust img,
    .gallery-item.vrchat img {
        object-position: center 15%;
    }
    
    .gallery-item.design img {
        object-position: center center;
    }
    
    
    .illust-section {
        position: relative;
    }
    
    .nsfw-control {
        position: absolute;
        top: -18px;
        right: -8px;
    }
    
    .header-info {
        position: static;
        justify-content: center;
        margin-bottom: 0.5rem;
        gap: 0.5rem;
    }
    
    .copyright {
        font-size: 0.65rem;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0);
    transition: background-color 0.3s ease;
}

.modal.show {
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    max-width: 90vw;
    max-height: 90vh;
    width: fit-content;
    height: fit-content;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.show .modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.modal-content img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.close:hover {
    color: #bbb;
    transform: scale(1.1);
}

.gallery-item.fade-out {
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
}