* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html,
body,
#video {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

body {
    position: relative;
    color: #fff;
}

.ff-hit-layer {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: transparent;
}

.dplayer {
    width: 100% !important;
    height: 100% !important;
    background: #000 !important;
}

.dplayer-video-wrap video {
    object-fit: contain;
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    transition: transform 0.22s ease;
    pointer-events: none;
}

.dplayer-video-wrap {
    pointer-events: none;
}

.dplayer-video-wrap video::-webkit-media-controls,
.dplayer-video-wrap video::-webkit-media-controls-panel,
.dplayer-video-wrap video::-webkit-media-controls-start-playback-button,
.dplayer-video-wrap video::-webkit-media-controls-play-button,
.dplayer-video-wrap video::-webkit-media-controls-overlay-play-button {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
}

body.video-rotated .dplayer-video-wrap video {
    width: 100vh;
    height: 100vw;
}

.dplayer-controller,
.dplayer-menu,
.dplayer-setting,
.dplayer-mobile-play,
.dplayer-mobile-fullscreen,
.dplayer-icons-right,
.dplayer-icons-left .dplayer-volume,
.dplayer-camare-icon,
.dplayer-comment,
.dplayer-full-in-icon,
.dplayer-full-icon,
.dplayer-notice {
    display: none !important;
}

.dplayer-logo {
    top: calc(env(safe-area-inset-top) + 18px) !important;
    right: 18px !important;
    left: auto !important;
    max-width: 110px !important;
    max-height: 44px !important;
}

.ff-overlay {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 30;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

body.controls-show .ff-overlay {
    opacity: 1;
}

.ff-top {
    top: 0;
    padding: calc(env(safe-area-inset-top) + 14px) 16px 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}

.ff-top-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ff-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ff-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
}

.ff-bottom {
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    min-height: 92px;
    padding: 10px 16px calc(env(safe-area-inset-bottom) + 12px);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
}

.ff-progress-wrap {
    position: relative;
    pointer-events: auto;
}

.ff-seek-toast {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.96);
    background: rgba(18, 18, 18, 0.72);
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.ff-seek-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.ff-progress {
    position: relative;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
    cursor: pointer;
}

.ff-buffered,
.ff-played {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: inherit;
}

.ff-buffered {
    width: 0;
    background: rgba(255, 255, 255, 0.35);
}

.ff-played {
    width: 0;
    background: linear-gradient(90deg, #00a1d6, #40c5ff);
}

.ff-progress-time {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.86);
    text-align: right;
    white-space: nowrap;
}

.ff-controls,
.ff-left,
.ff-right {
    display: flex;
    align-items: center;
}

.ff-controls {
    justify-content: space-between;
    gap: 12px;
}

.ff-left,
.ff-right {
    gap: 10px;
    pointer-events: auto;
}

.ff-btn,
.ff-chip,
.ff-center-play {
    border: 0;
    outline: 0;
    color: #fff;
    background: rgba(18, 18, 18, 0.48);
    backdrop-filter: blur(12px);
}

.ff-btn,
.ff-center-play {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
}

.ff-btn:before,
.ff-btn:after,
.ff-center-play:before,
.ff-center-play:after {
    content: "";
    position: absolute;
}

.ff-btn-play:before,
.ff-center-play:before {
    left: 16px;
    top: 11px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid #fff;
}

.ff-btn-play.is-pause:before,
.ff-center-play.is-pause:before {
    left: 14px;
    top: 11px;
    width: 14px;
    height: 20px;
    border: 0;
    background: linear-gradient(90deg, #fff 0 36%, transparent 36% 64%, #fff 64% 100%);
}

.ff-btn-seek {
    width: auto;
    min-width: 44px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.ff-btn-full:before {
    inset: 10px;
    border: 2px solid #fff;
    border-radius: 2px;
}

.ff-btn-volume:before {
    left: 9px;
    top: 11px;
    width: 9px;
    height: 14px;
    background: #fff;
    clip-path: polygon(0 28%, 40% 28%, 100% 0, 100% 100%, 40% 72%, 0 72%);
}

.ff-btn-volume:after {
    right: 8px;
    top: 11px;
    width: 7px;
    height: 14px;
    border-right: 2px solid #fff;
    border-radius: 0 999px 999px 0;
}

.ff-btn-volume.is-muted:after {
    width: 10px;
    height: 2px;
    top: 19px;
    right: 6px;
    border: 0;
    background: #ff6b6b;
    transform: rotate(-38deg);
    border-radius: 999px;
}

.ff-btn-rotate:before {
    left: 10px;
    top: 10px;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-right-color: transparent;
    border-radius: 50%;
}

.ff-btn-rotate:after {
    right: 8px;
    top: 8px;
    width: 0;
    height: 0;
    border-left: 6px solid #fff;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    transform: rotate(20deg);
}

.ff-rate-desktop,
.ff-speed-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ff-speed-wrap {
    display: none;
    position: relative;
}

.ff-chip {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
}

.ff-chip.active {
    background: rgba(0, 161, 214, 0.78);
}

.ff-speed-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(18, 18, 18, 0.82);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.ff-speed-wrap.show-panel .ff-speed-panel {
    opacity: 1;
    pointer-events: auto;
}

.ff-volume-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ff-volume-wrap:before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 56px;
    height: 14px;
    transform: translateX(-50%);
}

.ff-volume-panel {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 2px);
    width: 44px;
    height: 124px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(18, 18, 18, 0.78);
    backdrop-filter: blur(12px);
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.ff-volume-wrap:hover .ff-volume-panel,
.ff-volume-wrap.show-panel .ff-volume-panel {
    opacity: 1;
    pointer-events: auto;
}

.ff-volume-track {
    position: relative;
    width: 8px;
    height: 88px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    cursor: pointer;
    overflow: hidden;
}

.ff-volume-level {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60%;
    border-radius: inherit;
    background: linear-gradient(180deg, #59d7ff, #00a1d6);
}

.ff-center-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 35;
    width: 68px;
    height: 68px;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.ff-center-play.show {
    opacity: 1 !important;
}

.ff-center-play:before {
    left: 27px;
    top: 19px;
    border-top-width: 14px;
    border-bottom-width: 14px;
    border-left-width: 20px;
}

.ff-center-play.is-pause:before {
    left: 24px;
    top: 18px;
    width: 18px;
    height: 28px;
}

.ff-toast {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 40;
    transform: translate(-50%, -50%);
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.ff-toast.show {
    opacity: 1;
}

.ff-loading-text {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 34;
    transform: translate(-50%, -50%);
    width: min(42vw, 220px);
    min-width: 160px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    letter-spacing: 0.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.ff-loading-text.show {
    opacity: 1;
}

.ff-loading-label {
    display: block;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.ff-loading-bar {
    position: relative;
    display: block;
    width: 100%;
    height: 2px;
    margin-top: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.22);
}

.ff-loading-progress {
    display: block;
    height: 100%;
    width: 34%;
    border-radius: inherit;
    background: linear-gradient(90deg, #00a1d6, #59d7ff);
    animation: ff-loading-slide 1.1s ease-in-out infinite;
}

@keyframes ff-loading-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

.ff-skip-ad {
    position: absolute;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom) + 86px);
    z-index: 36;
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.64);
    color: #fff;
    font-size: 13px;
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.ff-skip-ad.show {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .ff-title { font-size: 15px; }
    .ff-bottom {
        min-height: 84px;
        padding: 8px 12px calc(env(safe-area-inset-bottom) + 10px);
    }
    .ff-volume-wrap,
    .ff-rate-desktop { display: none; }
    .ff-speed-wrap { display: flex; }
    .ff-controls {
        justify-content: space-between;
        gap: 10px;
    }
    .ff-left {
        min-width: 0;
        flex: 1;
        gap: 8px;
        flex-wrap: nowrap;
    }
    .ff-right {
        flex-shrink: 0;
        gap: 8px;
        flex-wrap: nowrap;
    }
    .ff-progress-time {
        margin-top: 7px;
        font-size: 11px;
    }
    .ff-btn,
    .ff-btn-seek,
    .ff-chip {
        height: 38px;
    }
    .ff-btn {
        width: 38px;
    }
    .ff-btn-play:before {
        left: 13px;
        top: 10px;
        border-top-width: 9px;
        border-bottom-width: 9px;
        border-left-width: 13px;
    }
    .ff-btn-play.is-pause:before {
        left: 12px;
        top: 10px;
        width: 12px;
        height: 18px;
    }
    .ff-chip {
        min-width: 44px;
        padding: 0 10px;
        font-size: 12px;
    }
    .ff-btn-seek {
        min-width: 40px;
        padding: 0 10px;
        font-size: 12px;
    }
    .ff-chip-speed {
        min-width: 50px;
    }
    .ff-speed-panel {
        gap: 10px;
        padding: 10px;
    }
    .ff-skip-ad {
        right: 12px;
        bottom: calc(env(safe-area-inset-bottom) + 76px);
        height: 34px;
        padding: 0 14px;
        font-size: 12px;
    }
}
