.img_list .ps-live-item {
    position: relative;
    width: 25%;
    margin: 3px;
    padding: 3px;
}
.img_list .ps-live-item:only-child {
    width: 60%;
}
.img_list .ps-live-item > a.mo_img {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    touch-action: pan-y;
}
.img_list .ps-live-item > a::before {
    content: "";
    display: block;
    padding-top: 100%;
}
.ps-live-play {
    position: absolute;
    z-index: 3;
    top: 8px;
    left: 8px;
    border: 0;
    border-radius: 4px;
    background: #222;
    color: #fff;
    padding: 5px 8px;
    cursor: pointer;
}
.ps-live-item video {
    position: absolute;
    z-index: 2;
    inset: 3px;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    object-fit: cover;
    background: #000;
    pointer-events: none;
}
.ps-live-status {
    position: absolute;
    z-index: 4;
    bottom: 4px;
    left: 4px;
    color: #fff;
    background: #222;
    font-size: 12px;
}
.ps-live-status:empty {
    display: none;
}
.ps-live-controls {
    position: absolute;
    z-index: 2;
    inset: auto 2px 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}
.ps-live-controls button, .ps-live-controls span {
    border: 0;
    border-radius: 2px;
    padding: 2px 3px;
    background: #222;
    color: #fff;
    font-size: 10px;
}
.ps-live-controls button {
    cursor: pointer;
}
.ps-live-open {
    margin: 8px 0;
    padding: 6px 12px;
    cursor: pointer;
}
.ps-live-editor {
    margin: 10px 0;
    padding: 12px;
    border: 1px solid #888;
    border-radius: 6px;
    font-size: 13px;
}
.ps-live-editor[hidden], .ps-live-editor [hidden] {
    display: none !important;
}
.ps-live-editor label {
    display: block;
    margin: 8px 0;
}
.ps-live-editor p {
    margin: 6px 0;
}
.ps-live-preview {
    display: flex;
    gap: 8px;
    align-items: center;
}
.ps-live-preview img, .ps-live-preview video {
    display: block;
    width: calc(50% - 4px);
    max-height: 200px;
    object-fit: contain;
}
.ps-live-photo-preview:not([src]), .ps-live-preview video:not([src]) {
    display: none;
}
.ps-live-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ps-live-editor-actions button {
    padding: 6px 10px;
    cursor: pointer;
}
.ps-live-editor button:disabled {
    opacity: 0.55;
    cursor: wait;
}
.ps-live-editor-status {
    font-weight: 600;
}
.ps-motion-hint {
    font-size: 12px;
}
.ps-live-play:focus-visible, .ps-live-controls button:focus-visible, .ps-live-editor button:focus-visible, .ps-live-open:focus-visible {
    outline: 2px solid #368ad5;
    outline-offset: 2px;
}

/* Match the existing four-image flex arrangement without touching ordinary galleries. */
.img_list .list_inner > .ps-live-item:nth-child(2):nth-last-child(3) {
    margin-right: 30%;
}

/* The WeChat/Apple skin uses CSS grid: a live wrapper must fill its grid cell. */
body.wechat-apple .img_list .list_inner > .ps-live-item {
    width: auto;
    margin: 0 !important;
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f9;
}

body.wechat-apple .ps-live-item video {
    inset: 0;
    width: 100%;
    height: 100%;
}

body.wechat-apple .img_list .list_inner:has(> .ps-live-item:only-child) {
    display: block !important;
    max-width: 336px;
}

body.wechat-apple .img_list .list_inner > .ps-live-item:only-child {
    max-width: 336px;
    max-height: 520px;
    border-radius: 12px;
}

body.wechat-apple .img_list .ps-live-item:only-child > a::before {
    display: none;
}

body.wechat-apple .img_list .ps-live-item:only-child > a img {
    position: relative;
    display: block;
    height: auto;
}

body.wechat-apple .img_list .list_inner:has(> .ps-live-item):has(> :first-child:nth-last-child(2)),
body.wechat-apple .img_list .list_inner:has(> .ps-live-item):has(> :first-child:nth-last-child(4)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 252px;
}

@media (width <= 640px) {
    .img_list .ps-live-item {
        width: 30%;
        margin: 2px;
    }

    body.wechat-apple .img_list .list_inner:has(> .ps-live-item:only-child),
    body.wechat-apple .img_list .list_inner > .ps-live-item:only-child {
        max-width: 315px;
    }

    body.wechat-apple .img_list .list_inner:has(> .ps-live-item):has(> :first-child:nth-last-child(2)),
    body.wechat-apple .img_list .list_inner:has(> .ps-live-item):has(> :first-child:nth-last-child(4)) {
        max-width: 225px;
    }
}
