
.detail-page-body .controls {
    display: none;
}

.detail-layout {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: min(1000px, 90vw);
    margin: 42px auto 60px;
    overflow: visible;
}

.detail-return-row {
    position: absolute;
    top: -30px;
    right: 0;
    z-index: 8;
    line-height: 1.4;
}

.detail-close {
    color: #6b6f3f;
    text-decoration: none;
    font-size: 13px;
}

/* 图片区域 */
.detail-media {
    position: relative;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: min(547.5px, calc((90vw - 270px) * .75));
    overflow: hidden;
}

.detail-layout.is-fragment .detail-media {
    flex: 0 1 auto;
    width: max-content;
    max-width: calc(100% - 270px);
}

.detail-static-gallery {
    width: max-content;
    max-width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.detail-static-gallery::-webkit-scrollbar {
    display: none;
}

.detail-photo {
    display: flex;
    width: max-content;
    max-width: 100%;
    height: auto;
    min-height: 0;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.detail-photo img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, calc(90vw - 270px));
    max-height: 547.5px;
    object-fit: contain;
    background-position: center;
    background-size: cover;
}

/* Series 图片预览 */
.series-preview-container {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.series-preview-container[hidden] {
    display: none;
}

.series-preview-grid {
    display: grid;
    flex: 1 1 0;
    width: 0;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
    gap: 12px;
    overflow-y: hidden;
    overflow-x: hidden;
    scrollbar-width: none;
}

.series-preview-grid.is-scrollable {
    overflow-y: auto;
}

.series-preview-grid::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.series-preview-scrollbar {
    position: relative;
    display: none;
    flex: 0 0 0;
    width: 5px;
    height: 100%;
    background: #f8f8f8;
    touch-action: none;
}

.series-preview-container.is-scrollable .series-preview-scrollbar {
    display: block;
    flex-basis: 6px;
}

.series-preview-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 20px;
    background: #bfc1ab;
    border-radius: 0;
    cursor: grab;
    touch-action: none;
}

.series-preview-scrollbar-thumb:active {
    cursor: grabbing;
}

.series-preview-scrollbar-thumb:focus-visible {
    outline: 1px solid #6b6f3f;
    outline-offset: 1px;
}

.series-preview-grid .detail-photo {
    display: block;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    line-height: 0;
}

.series-preview-grid .detail-photo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
}

.series-preview-grid .detail-photo:hover {
    opacity: .92;
}

/* 大图浏览 */
.detail-viewer {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y;
}

.detail-viewer[hidden],
.series-preview-grid[hidden],
.detail-static-gallery[hidden] {
    display: none;
}

.detail-active-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.detail-layout.is-fragment .detail-viewer {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
}

.detail-page.is-browsing .detail-layout.is-fragment .detail-static-gallery {
    visibility: hidden;
}

/* 图片浏览控制 */
.detail-viewer-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.detail-arrow {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 60px;
    padding: 0;
    border: 0;
    background: none;
    color: #6b6f3f;
    opacity: 0;
    z-index: 6;
    cursor: pointer;
    pointer-events: auto;
    transform: translateY(-50%);
    transition: opacity .15s ease;
}

.detail-prev {
    left: 18px;
}

.detail-next {
    right: 18px;
}

.detail-viewer:hover .detail-arrow {
    opacity: 1;
}

.detail-arrow span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 13px;
    height: 13px;
    border-top: 3px solid #6b6f3f;
    border-right: 3px solid #6b6f3f;
}

.detail-prev span {
    transform: translate(-35%, -50%) rotate(-135deg);
}

.detail-next span {
    transform: translate(-65%, -50%) rotate(45deg);
}

.detail-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    display: flex;
    justify-content: center;
    z-index: 6;
    pointer-events: auto;
}

.detail-dots > * + * {
    margin-left: 7px;
}

.detail-dots button {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(220, 220, 220, .3);
    cursor: pointer;
}

.detail-dots button.active {
    background: rgba(220, 220, 220, 1);
}

.detail-counter {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    display: flex;
    justify-content: center;
    z-index: 6;
    font-size: 12px;
    color: rgba(220, 220, 220, .7);
}

.series-return-zone {
    position: absolute;
    top: 20%;
    bottom: 25%;
    left: 37.5%;
    width: 25%;
    padding: 0;
    border: 0;
    background: transparent;
    z-index: 4;
    cursor: pointer;
    pointer-events: auto;
}

/* 右侧文字信息 */
.detail-info {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    width: fit-content;
    max-width: 270px;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    overflow: visible;
}

.detail-title-block,
.detail-description,
.detail-meta,
.detail-tags,
.detail-ad-block {
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    background: #f8f8f8;
}

.detail-title-block {
    padding: 15px 20px 10px;
}

.detail-title-block h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.5;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.detail-description {
    padding: 15px 20px;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    max-height: min(49vh, 392px);
    overflow-y: auto;
    scrollbar-width: none;
}

.detail-description::-webkit-scrollbar {
    display: none;
}

.detail-description p {
    margin: 0;
}

.detail-description p + p {
    margin-top: 10px;
}

.detail-description a,
.detail-meta a,
.detail-tags a {
    color: inherit;
    text-decoration: none;
}

.detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 20px 15px;
    font-size: 14px;
    line-height: 1.6;
}

.detail-meta > * {
    white-space: nowrap;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 20px 15px;
    font-size: 14px;
}

.detail-tags a {
    min-height: 22px;
    box-sizing: border-box;
    padding: 2px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ecefdb;
    font-size: 12px;
    line-height: 1.5;
}

.detail-ad-block {
    padding: 8px 20px;
    color: #999;
    font-size: 11px;
    letter-spacing: 2px;
}

/* Series 布局 */
.detail-layout.is-series {
    min-height: 0;
}

.detail-layout.is-series .detail-media {
    height: min(547.5px, calc((90vw - 270px) * .75));
    min-height: 0;
}

.detail-layout.is-series .detail-viewer {
    height: 100%;
}

/* 横向大图 */
.detail-page.is-wide .detail-viewer {
    align-items: flex-start;
}

.detail-page.is-wide .detail-active-image {
    object-position: top center;
}

.series-preview-grid.is-dense {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 平板及窄屏 */
@media (max-width: 1080px) {
    .detail-layout {
        width: min(700px, 90vw);
        flex-direction: column;
        justify-content: flex-start;
        margin: 42px auto 40px;
    }

    .detail-media {
        flex: none;
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .detail-static-gallery,
    .detail-viewer {
        height: 100%;
    }

    .detail-photo {
        width: 100%;
        height: 100%;
        min-height: 100%;
    }

    .detail-photo img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 45vh;
    }

    .detail-layout.is-fragment .detail-media {
        flex: none;
        width: 100%;
        max-width: 100%;
    }

    .detail-layout.is-fragment .detail-static-gallery {
        width: 100%;
    }

    .detail-layout.is-fragment .detail-photo {
        width: 100%;
    }

    .detail-layout.is-fragment .detail-photo img {
        width: 100%;
        height: 100%;
        max-height: 45vh;
    }

    .detail-info {
        flex: none;
        width: 100%;
        max-width: 100%;
        margin-top: 16px;
    }

    .detail-title-block h2 {
        font-size: 22px;
    }

    .detail-layout.is-series {
        min-height: 0;
    }

    .detail-layout.is-series .detail-media {
        height: 55vh;
        min-height: 0;
        aspect-ratio: auto;
    }

    .detail-layout.is-series .detail-viewer {
        height: 100%;
    }

    .series-preview-grid {
        height: 100%;
        min-height: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .series-preview-grid.is-dense {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-arrow {
        opacity: .65;
    }
}

/* 手机 */
@media (max-width: 639px) {
    .detail-layout {
        width: 90vw;
        margin: 38px auto 30px;
    }

    .detail-return-row {
        top: -30px;
    }

    .detail-info {
        max-width: 100%;
    }

    .detail-media {
        aspect-ratio: 4 / 3;
    }

    .detail-title-block {
        padding: 12px 16px 13px;
    }

    .detail-title-block h2 {
        font-size: 21px;
    }

    .detail-description {
        padding: 12px 16px;
        font-size: 14px;
        line-height: 1.6;
    }

    .detail-meta {
        gap: 12px;
        padding: 10px 16px;
    }

    .detail-tags {
        gap: 7px;
        padding: 10px 16px;
    }

    .detail-arrow {
        width: 28px;
        height: 40px;
    }

    .detail-prev {
        left: 4px;
    }

    .detail-next {
        right: 4px;
    }

    .detail-viewer:hover .detail-arrow {
        opacity: .5;
    }

    .detail-layout.is-series .detail-media {
        height: 55vh;
        min-height: 0;
    }

    .series-preview-grid {
        height: 100%;
        min-height: 0;
        padding: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}
