/* Thread media only. Keep Discuz attachment permissions and image zoom handlers. */
:is(#postlist, .viewthread) { --g1069-media-radius: 10px; }
#postlist .t_fsz > table { width: 100%; table-layout: fixed; }
:is(#postlist .t_f, .viewthread .message) { overflow-wrap: anywhere; }
:is(#postlist .t_f, .viewthread .message, .viewthread .img_one, .viewthread .post_attlist, #postlist .pattl) img {
    max-width: 100%; height: auto; box-sizing: border-box;
}
:is(#postlist .t_f, .viewthread .message, .viewthread .img_one, #postlist .pattl) img:is([id^="aimg_"], [zoomfile], [file]) {
    border-radius: var(--g1069-media-radius); vertical-align: middle; margin: 10px 0;
}
:is(#postlist .t_f, .viewthread .message) img:is([smilieid], [src*="/smiley/"], [src*="/smilies/"], [src*="/verify/"]) {
    display: inline; width: auto; height: auto; margin: 0; border-radius: 0; vertical-align: middle;
}
:is(#postlist .t_fsz, #postlist .pcbs, .viewthread .message) .media {
    display: block; width: 100% !important; max-width: 960px; height: auto !important;
    margin: 18px auto !important; padding: 0; box-sizing: border-box;
}
:is(#postlist, .viewthread) .media.g1069-video {
    max-width: min(960px, calc(72vh * var(--g1069-video-ratio, 1.777778)));
}
:is(#postlist, .viewthread) .media_container {
    width: 100%; height: auto; min-height: 0; box-sizing: border-box;
}
/* DPlayer is the container itself, not a child of media_container. */
:is(#postlist, .viewthread) .media_container.dplayer {
    width: 100%; height: auto; aspect-ratio: var(--g1069-video-ratio, 16 / 9);
    border-radius: var(--g1069-media-radius); background: #111;
}
:is(#postlist, .viewthread) .dplayer .dplayer-video-wrap { height: 100%; }
:is(#postlist, .viewthread) .dplayer video { width: 100%; height: 100%; object-fit: contain; }
:is(#postlist, .viewthread) .media_container.aplayer { margin: 0; width: 100%; }
:is(#postlist, .viewthread) .media_tips { margin: 0; padding: 8px 4px; line-height: 1.5; overflow-wrap: anywhere; }
:is(#postlist .t_f, .viewthread .message) video:not(.dplayer-video) {
    display: block; max-width: 100%; height: auto; max-height: 72vh; object-fit: contain; margin: 12px auto; background: #111;
}
:is(#postlist .t_f, .viewthread .message) audio { max-width: 100%; }
:is(#postlist .t_f, .viewthread .message) iframe {
    max-width: 100%; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0;
}
:is(#postlist, .viewthread) .media_container:is(.dplayer-full-inpage, .dplayer-fulled, :fullscreen) {
    width: 100% !important; height: 100% !important; max-width: none; max-height: none;
    aspect-ratio: auto; border-radius: 0;
}
:is(#postlist, .viewthread) video:fullscreen { width: 100% !important; height: 100% !important; max-height: none !important; }
.viewthread .plc .pi { min-width: 0; }
.viewthread .message > table { max-width: 100%; }
@media (max-width: 600px) {
    :is(#postlist .t_fsz, #postlist .pcbs, .viewthread .message) .media { margin: 14px auto !important; }
}
