/* 仅作用于 BY 展区。随全站加载以兼容 PJAX，尺寸不依赖初始化脚本。 */
.h-content.by-content {
    padding: 0;
}

.by-page .single-content {
    overflow-x: auto;
    overflow-y: hidden;
}

.by-content ul.by-gallery {
    display: flex;
    align-items: center;
    width: max-content;
    height: 100vh;
    margin: 0;
    padding: 0;
    list-style: none;
}

.by-content ul.by-gallery > li {
    display: flex;
    align-items: center;
    position: relative;
    width: auto;
    height: 100vh;
    min-width: 0;
    padding: 0;
}

.by-gallery .by-item {
    position: relative;
    min-width: 0;
    flex: 0 0 auto;
    padding: 0 calc(var(--size2) + var(--space3));
}

.by-gallery .by-item:nth-child(2) {
    order: 2;
}

.by-gallery .by-artwork {
    display: block;
    position: relative;
    width: auto;
    height: 70vh;
    aspect-ratio: 1.65;
    color: inherit;
    text-decoration: none;
}

.by-gallery a.by-artwork:focus-visible {
    outline: 2px solid #1600ff;
    outline-offset: 6px;
}

.by-content .by-artwork img.by-main-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.by-content .by-artwork img.by-corner-image {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20%;
    height: 42%;
    object-fit: contain;
    object-position: right bottom;
    pointer-events: none;
}

.by-gallery .by-decorations {
    position: relative;
    order: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1vw;
    width: 8vw;
    height: 21vh;
    flex: 0 0 auto;
    transform: translateY(24.5vh);
    pointer-events: none;
}

.by-content .by-decorations img {
    display: block;
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    flex: 1 1 0;
}

/* 未配置新主图时保留旧媒体，逐条替换即可。 */
.by-content .by-legacy-media > img,
.by-content .by-legacy-media > video {
    display: block;
    width: auto;
    height: 70vh;
}

@media (max-width: 700px) {
    .by-page .single-content {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .h-content.by-content {
        padding: calc(var(--size) + var(--space3)) 8vw 12vh;
    }

    .by-content ul.by-gallery {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        gap: 10vh;
        width: 100%;
        height: auto;
    }

    .by-content ul.by-gallery > li {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10vh;
        width: 100%;
        height: auto;
    }

    .by-gallery .by-item {
        padding: 0;
    }

    .by-gallery .by-artwork {
        width: 100%;
        height: auto;
    }

    .by-content .by-legacy-media > img,
    .by-content .by-legacy-media > video {
        width: 100%;
        height: auto;
    }

    .by-content ul.by-gallery > li:not(:has(.by-item)) {
        display: none;
    }

    .by-gallery .by-decorations {
        display: none;
    }
}
