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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
    /* パフォーマンス最適化 */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: bold;
}

.header nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.header nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Feed Container */
.feed-container {
    margin-top: 80px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

/* Image Feed */
.image-feed {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.image-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease-out;
    /* GPU アクセラレーション */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.image-item:hover {
    transform: translateY(-4px) translateZ(0);
}

.image-content {
    position: relative;
}

.image-content img,
.gallery-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    /* パフォーマンス最適化 */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 2rem 1rem 1rem;
}

.image-info {
    padding: 1rem;
}

.image-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.image-caption {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.image-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.like-button {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.like-button:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.like-button.liked {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.like-count {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.hidden {
    display: none;
}

/* Advertisement */
.ad-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    opacity: 0.8;
    margin: 1rem 0;
}

.ad-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* DLsite Advertisement Styles */
.dlsite-ad {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dlsite-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 100, 200, 0.2);
}

.dlsite-ad::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(30deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(30deg); }
}

.dlsite-ad a {
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dlsite-ad a:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .dlsite-ad {
        padding: 1rem !important;
    }
    
    .dlsite-ad a {
        padding: 0.7rem 1.2rem !important;
        font-size: 0.9rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .feed-container {
        margin-top: 70px;
        padding: 0 0.5rem;
    }
    
    .image-feed {
        gap: 1.5rem;
    }
    
    .image-overlay {
        padding: 1.5rem 1rem 1rem;
    }
}