#post-style-5-player {
    --bukids-caption-control-offset: 52px;
    --bukids-menu-max-height: 320px;
}

#post-style-5-player video::cue {
    background: rgba(5, 7, 10, 0.72);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(18px, 2.15vw, 30px);
    font-weight: 600;
    line-height: 1.45;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1), 0 0 6px rgba(0, 0, 0, 0.92);
}

#post-style-5-player.bukids-subtitle-size-small video::cue {
    font-size: clamp(14px, 1.7vw, 23px);
}

#post-style-5-player.bukids-subtitle-size-large video::cue {
    font-size: clamp(21px, 2.7vw, 35px);
}

#post-style-5-player .bukids-b2-caption-overlay {
    align-items: flex-end;
    bottom: calc(var(--bukids-caption-control-offset, 52px) + env(safe-area-inset-bottom, 0px));
    display: none;
    justify-content: center;
    left: calc(5% + env(safe-area-inset-left, 0px));
    pointer-events: none;
    position: absolute;
    right: calc(5% + env(safe-area-inset-right, 0px));
    text-align: center;
    z-index: 5;
}

#post-style-5-player .bukids-b2-caption-overlay.is-visible {
    display: flex;
}

#post-style-5-player .bukids-b2-caption-overlay-text {
    background: rgba(5, 7, 10, 0.78);
    border-radius: 3px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: clamp(18px, 2.15vw, 30px);
    font-weight: 600;
    line-height: 1.45;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 3px 8px 4px;
    text-wrap: balance;
    white-space: pre-wrap;
    word-break: break-word;
}

#post-style-5-player.bukids-subtitle-size-small .bukids-b2-caption-overlay-text {
    font-size: clamp(14px, 1.7vw, 23px);
}

#post-style-5-player.bukids-subtitle-size-large .bukids-b2-caption-overlay-text {
    font-size: clamp(21px, 2.7vw, 35px);
}

#post-style-5-player .dplayer.dplayer-hide-controller .bukids-b2-caption-overlay {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

#post-style-5-player .bukids-b2-subtitle-control {
    align-items: center;
    display: inline-flex;
    height: 100%;
    position: relative;
    vertical-align: top;
    z-index: 6;
}

#post-style-5-player .bukids-b2-subtitle-trigger {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 750;
    height: 100%;
    justify-content: center;
    line-height: 1;
    min-width: 42px;
    opacity: 1;
    padding: 0 6px;
    touch-action: manipulation;
    transition: background-color 0.12s ease, color 0.12s ease;
}

#post-style-5-player .bukids-b2-subtitle-trigger:hover,
#post-style-5-player .bukids-b2-subtitle-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    opacity: 1;
    outline: none;
}

#post-style-5-player .bukids-b2-subtitle-trigger:active {
    background: rgba(255, 255, 255, 0.16);
}

#post-style-5-player .bukids-b2-subtitle-trigger-text {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    box-sizing: border-box;
    display: inline-flex;
    height: 22px;
    justify-content: center;
    letter-spacing: 0.025em;
    line-height: 1;
    min-width: 30px;
    padding: 0 5px;
    text-align: center;
}

#post-style-5-player .bukids-b2-subtitle-trigger.is-active .bukids-b2-subtitle-trigger-text {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: none;
}

#post-style-5-player .bukids-b2-subtitle-menu {
    background: #15171c;
    border: 1px solid #30343d;
    border-radius: 8px;
    bottom: calc(46px + env(safe-area-inset-bottom, 0px));
    box-shadow: none;
    box-sizing: border-box;
    display: none;
    height: auto !important;
    max-height: var(--bukids-menu-max-height, 320px);
    min-height: 0 !important;
    min-width: 188px;
    overscroll-behavior: contain;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 6px;
    position: absolute;
    right: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
    z-index: 100;
}

#post-style-5-player .bukids-b2-subtitle-menu::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
}

#post-style-5-player .bukids-b2-subtitle-control.is-open .bukids-b2-subtitle-menu {
    display: block;
}

#post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode] {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 5px;
    box-shadow: none;
    box-sizing: border-box;
    color: #f4f4f5;
    cursor: pointer;
    display: flex !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px;
    font-weight: 500;
    height: 38px !important;
    line-height: 1 !important;
    margin: 0 !important;
    max-height: 38px !important;
    min-height: 38px !important;
    padding: 0 36px 0 11px !important;
    position: relative;
    text-align: left;
    touch-action: manipulation;
    width: 100%;
}

#post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode] + button[data-bukids-subtitle-mode] {
    margin-top: 2px !important;
}

#post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode]:hover,
#post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode]:focus-visible,
#post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode].is-selected {
    background: #292d36;
    color: #fff;
    outline: none;
}

#post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode].is-selected {
    background: #2d323c;
}

#post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode].is-selected::after {
    align-items: center;
    background: #ef4444;
    border-radius: 50%;
    color: #fff;
    content: "✓";
    display: flex;
    font-size: 10px;
    font-weight: 700;
    height: 17px;
    justify-content: center;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
}

#post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode]:disabled {
    cursor: not-allowed;
    opacity: 0.36;
}

#post-style-5-player .bukids-b2-subtitle-separator {
    background: #2d3139;
    height: 1px;
    margin: 6px 4px 7px;
}

#post-style-5-player .bukids-b2-subtitle-size-section {
    padding: 1px 5px 5px;
}

#post-style-5-player .bukids-b2-subtitle-size-title {
    color: #a1a1aa;
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 18px;
    margin: 0 3px 6px;
}

#post-style-5-player .bukids-b2-subtitle-size-options {
    background: #101216;
    border: 1px solid #2d3139;
    border-radius: 5px;
    display: grid;
    gap: 3px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 3px;
}

#post-style-5-player .bukids-b2-subtitle-size-button {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    border-radius: 3px;
    box-shadow: none;
    color: #a1a1aa;
    cursor: pointer;
    display: flex !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 12px;
    font-weight: 600;
    box-sizing: border-box;
    height: 29px !important;
    line-height: 1 !important;
    margin: 0 !important;
    max-height: 29px !important;
    min-height: 29px !important;
    padding: 0 5px !important;
    justify-content: center;
    text-align: center;
    touch-action: manipulation;
}

#post-style-5-player .bukids-b2-subtitle-size-button:hover,
#post-style-5-player .bukids-b2-subtitle-size-button:focus-visible,
#post-style-5-player .bukids-b2-subtitle-size-button.is-selected {
    background: #343842;
    color: #fff;
    outline: none;
}

#post-style-5-player .bukids-b2-subtitle-size-button.is-selected {
    box-shadow: none;
}

@media (max-width: 640px) {
    #post-style-5-player video::cue {
        font-size: clamp(15px, 4.6vw, 20px);
        line-height: 1.4;
    }

    #post-style-5-player.bukids-subtitle-size-small video::cue {
        font-size: clamp(13px, 3.8vw, 17px);
    }

    #post-style-5-player.bukids-subtitle-size-large video::cue {
        font-size: clamp(18px, 5.6vw, 24px);
    }

    #post-style-5-player .bukids-b2-caption-overlay {
        bottom: calc(var(--bukids-caption-control-offset, 44px) + env(safe-area-inset-bottom, 0px));
        left: calc(4% + env(safe-area-inset-left, 0px));
        right: calc(4% + env(safe-area-inset-right, 0px));
    }

    #post-style-5-player .bukids-b2-caption-overlay-text {
        font-size: clamp(15px, 4.6vw, 20px);
        line-height: 1.4;
        padding: 2px 6px 3px;
    }

    #post-style-5-player.bukids-subtitle-size-small .bukids-b2-caption-overlay-text {
        font-size: clamp(13px, 3.8vw, 17px);
    }

    #post-style-5-player.bukids-subtitle-size-large .bukids-b2-caption-overlay-text {
        font-size: clamp(18px, 5.6vw, 24px);
    }

    #post-style-5-player .dplayer.dplayer-hide-controller .bukids-b2-caption-overlay {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }

    #post-style-5-player .bukids-b2-subtitle-trigger {
        min-width: 36px;
        padding: 0 2px;
    }

    #post-style-5-player .bukids-b2-subtitle-trigger-text {
        height: 21px;
        min-width: 28px;
    }

    #post-style-5-player .bukids-b2-subtitle-menu {
        bottom: calc(40px + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 16px);
        min-width: 156px;
        padding: 4px;
    }

    #post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode] {
        font-size: 13px;
        height: 34px !important;
        line-height: 1 !important;
        max-height: 34px !important;
        min-height: 34px !important;
        padding: 0 31px 0 9px !important;
    }

    #post-style-5-player .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode].is-selected::after {
        font-size: 9px;
        height: 16px;
        right: 9px;
        width: 16px;
    }

    #post-style-5-player .bukids-b2-subtitle-separator {
        margin: 4px 4px 5px;
    }

    #post-style-5-player .bukids-b2-subtitle-size-section {
        padding: 0 3px 3px;
    }

    #post-style-5-player .bukids-b2-subtitle-size-title {
        font-size: 10px;
        line-height: 14px;
        margin: 0 2px 3px;
    }

    #post-style-5-player .bukids-b2-subtitle-size-button {
        font-size: 11px;
        height: 27px !important;
        line-height: 1 !important;
        max-height: 27px !important;
        min-height: 27px !important;
        padding: 0 3px !important;
    }

    #post-style-5-player .dplayer-controller .dplayer-icons.dplayer-icons-right {
        right: 4px;
        white-space: nowrap;
    }

    #post-style-5-player .dplayer.dplayer-mobile .bukids-b2-subtitle-control,
    #post-style-5-player .dplayer-controller .bukids-b2-subtitle-control {
        display: inline-flex !important;
        opacity: 1;
        position: relative;
        visibility: visible !important;
        z-index: 6;
    }
}

@media (max-width: 380px) {
    #post-style-5-player .bukids-b2-subtitle-trigger {
        min-width: 33px;
    }

    #post-style-5-player .bukids-b2-subtitle-menu {
        min-width: 148px;
        right: -2px;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    #post-style-5-player video::cue {
        font-size: clamp(16px, 2.7vw, 22px);
    }

    #post-style-5-player.bukids-subtitle-size-small video::cue {
        font-size: clamp(14px, 2.25vw, 18px);
    }

    #post-style-5-player.bukids-subtitle-size-large video::cue {
        font-size: clamp(19px, 3.3vw, 27px);
    }

    #post-style-5-player .bukids-b2-caption-overlay-text {
        font-size: clamp(16px, 2.7vw, 22px);
    }

    #post-style-5-player.bukids-subtitle-size-small .bukids-b2-caption-overlay-text {
        font-size: clamp(14px, 2.25vw, 18px);
    }

    #post-style-5-player.bukids-subtitle-size-large .bukids-b2-caption-overlay-text {
        font-size: clamp(19px, 3.3vw, 27px);
    }

    #post-style-5-player .bukids-b2-subtitle-menu {
        max-height: calc(100vh - 58px);
        overflow-y: auto;
    }
}

/* Player-size classes provide the same layout inside narrow columns and embeds. */
#post-style-5-player.bukids-player-compact video::cue {
    font-size: clamp(15px, 4.6vw, 20px);
    line-height: 1.4;
}

#post-style-5-player.bukids-player-compact.bukids-subtitle-size-small video::cue {
    font-size: clamp(13px, 3.8vw, 17px);
}

#post-style-5-player.bukids-player-compact.bukids-subtitle-size-large video::cue {
    font-size: clamp(18px, 5.6vw, 24px);
}

#post-style-5-player.bukids-player-compact .bukids-b2-caption-overlay {
    left: calc(4% + env(safe-area-inset-left, 0px));
    right: calc(4% + env(safe-area-inset-right, 0px));
}

#post-style-5-player.bukids-player-compact .bukids-b2-caption-overlay-text {
    font-size: clamp(15px, 4.6vw, 20px);
    line-height: 1.4;
    padding: 2px 6px 3px;
}

#post-style-5-player.bukids-player-compact.bukids-subtitle-size-small .bukids-b2-caption-overlay-text {
    font-size: clamp(13px, 3.8vw, 17px);
}

#post-style-5-player.bukids-player-compact.bukids-subtitle-size-large .bukids-b2-caption-overlay-text {
    font-size: clamp(18px, 5.6vw, 24px);
}

#post-style-5-player.bukids-player-compact .bukids-b2-subtitle-trigger {
    min-width: 36px;
    padding: 0 2px;
}

#post-style-5-player.bukids-player-compact .bukids-b2-subtitle-trigger-text {
    height: 21px;
    min-width: 28px;
}

#post-style-5-player.bukids-player-compact .bukids-b2-subtitle-menu {
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    min-width: 156px;
    padding: 4px;
}

#post-style-5-player.bukids-player-compact .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode] {
    font-size: 13px;
    height: 34px !important;
    line-height: 1 !important;
    max-height: 34px !important;
    min-height: 34px !important;
    padding: 0 31px 0 9px !important;
}

#post-style-5-player.bukids-player-compact .bukids-b2-subtitle-menu > button[data-bukids-subtitle-mode].is-selected::after {
    font-size: 9px;
    height: 16px;
    right: 9px;
    width: 16px;
}

#post-style-5-player.bukids-player-compact .bukids-b2-subtitle-separator {
    margin: 4px 4px 5px;
}

#post-style-5-player.bukids-player-compact .bukids-b2-subtitle-size-section {
    padding: 0 3px 3px;
}

#post-style-5-player.bukids-player-compact .bukids-b2-subtitle-size-title {
    font-size: 10px;
    line-height: 14px;
    margin: 0 2px 3px;
}

#post-style-5-player.bukids-player-compact .bukids-b2-subtitle-size-button {
    font-size: 11px;
    height: 27px !important;
    line-height: 1 !important;
    max-height: 27px !important;
    min-height: 27px !important;
    padding: 0 3px !important;
}

#post-style-5-player.bukids-player-compact .dplayer-controller .dplayer-icons.dplayer-icons-right {
    right: max(4px, env(safe-area-inset-right, 0px));
    white-space: nowrap;
}

#post-style-5-player.bukids-player-compact .dplayer.dplayer-mobile .bukids-b2-subtitle-control,
#post-style-5-player.bukids-player-compact .dplayer-controller .bukids-b2-subtitle-control {
    display: inline-flex !important;
    opacity: 1;
    position: relative;
    visibility: visible !important;
    z-index: 6;
}

#post-style-5-player.bukids-player-narrow .bukids-b2-subtitle-trigger {
    min-width: 33px;
}

#post-style-5-player.bukids-player-narrow .bukids-b2-subtitle-menu {
    min-width: 148px;
    right: -2px;
}

#post-style-5-player.bukids-player-landscape video::cue,
#post-style-5-player.bukids-player-short video::cue {
    font-size: clamp(16px, 2.7vw, 22px);
}

#post-style-5-player.bukids-player-landscape.bukids-subtitle-size-small video::cue,
#post-style-5-player.bukids-player-short.bukids-subtitle-size-small video::cue {
    font-size: clamp(14px, 2.25vw, 18px);
}

#post-style-5-player.bukids-player-landscape.bukids-subtitle-size-large video::cue,
#post-style-5-player.bukids-player-short.bukids-subtitle-size-large video::cue {
    font-size: clamp(19px, 3.3vw, 27px);
}

#post-style-5-player.bukids-player-landscape .bukids-b2-caption-overlay-text,
#post-style-5-player.bukids-player-short .bukids-b2-caption-overlay-text {
    font-size: clamp(16px, 2.7vw, 22px);
}

#post-style-5-player.bukids-player-landscape.bukids-subtitle-size-small .bukids-b2-caption-overlay-text,
#post-style-5-player.bukids-player-short.bukids-subtitle-size-small .bukids-b2-caption-overlay-text {
    font-size: clamp(14px, 2.25vw, 18px);
}

#post-style-5-player.bukids-player-landscape.bukids-subtitle-size-large .bukids-b2-caption-overlay-text,
#post-style-5-player.bukids-player-short.bukids-subtitle-size-large .bukids-b2-caption-overlay-text {
    font-size: clamp(19px, 3.3vw, 27px);
}

#post-style-5-player.bukids-player-landscape .bukids-b2-subtitle-menu,
#post-style-5-player.bukids-player-short .bukids-b2-subtitle-menu {
    overflow-y: auto;
}

@media (prefers-contrast: more) {
    #post-style-5-player video::cue {
        background: rgba(0, 0, 0, 0.9);
        text-shadow: 0 1px 2px #000, 0 0 8px #000;
    }

    #post-style-5-player .bukids-b2-subtitle-menu {
        background: #0f1115;
        border-color: #71717a;
    }
}

@media (prefers-reduced-motion: reduce) {
    #post-style-5-player .bukids-b2-subtitle-trigger {
        transition: none;
    }
}
