.ugc-gallery-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.ugc-gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 25px;
}

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

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

.ugc-block {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.ugc-block img,
.ugc-block video {
    width: 100%;
    border-radius: 6px;
    display: block;
}

.ugc-carousel .swiper-slide {
    width: 100% !important;
    height: auto !important;
}

.ugc-carousel .swiper-slide img,
.ugc-block .ugc-carousel video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.ugc-carousel {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.swiper-pagination {
    position: static;
}

.swiper-pagination.swiper-pagination-lock {
    display: inline-block !important;
    opacity: 1 !important;
}

.swiper-pagination-bullet:only-child {
    display: inline-block !important;
}

.ugc-meta-row {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ugc-buy-btn {
    margin-top: 1em;
    display: inline-block;
    background: var(--mirai-color-black-10);
    padding: 5px;
    border-radius: 6px;
    font-size: 12px;
}

.ugc-buy-btn:hover {
    text-decoration: none;
}

.ugc-category {
    font-size: 13px;
    color: #666;
    margin: 6px 0 0;
}

.ugc-filter-wrap {
    margin-bottom: 1em;
    text-align: right;
}

.ugc-load-more {
    align-self: center;
    justify-self: start;
    height: auto;
}


/* Popup */
.ugc-popup.hidden {
    display: none;
}

.ugc-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ugc-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.ugc-popup-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: hidden;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
    z-index: 999999;
}

.ugc-popup-left {
    flex: 1;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60%;
}

.ugc-popup-swiper {
    width: 100%;
    max-height: 80vh;
}

.ugc-popup-swiper .swiper-slide {
    width: 100%;
    aspect-ratio: 3/4;
    max-height: 80vh;
    background: #f5f5f5;
}

.ugc-popup-swiper img,
.ugc-popup-swiper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Right side */
.ugc-popup-right {
    flex: 1;
    margin-top: 2em;

    max-height: calc(90vh - 40px);
    overflow-y: auto;
    padding-right: 8px;
}

.ugc-popup-close {
    all: unset;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 1001;
}

#ugc-popup-comment {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.ugc-popup-note {
    font-size: 10px;
    color: var(--mirai-color-black-60);
}

.ugc-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    border-radius: 50%;
    border: 4px solid #ccc;
    border-top-color: #0073aa;
    animation: ugc-spin 0.8s linear infinite;
    z-index: 9999999;
}

.hidden {
    display: none !important;
}

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

@media (max-width: 1024px) {
    .ugc-popup-content {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
    }

    .ugc-popup-left {
        width: 100%;
    }
}

.ugc-display-name.ugc-slide-click,
.ugc-partial-comment.ugc-slide-click {
    cursor: pointer;
}

.ugc-display-name.ugc-slide-click:hover,
.ugc-partial-comment.ugc-slide-click:hover {
    text-decoration: none;
    opacity: 0.8;
}

.ugc-partial-comment {
    height: 3em;
    line-height: 1.5em;
    overflow: hidden;
    font-size: 13px;
    color: #666;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}