.vpp-video-wrapper {
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.vpp-video-player {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.vpp-player-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    aspect-ratio: 16/9;
    max-height: 80vh;
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
    .vpp-player-container {
        aspect-ratio: 16/9;
        max-height: 50vh;
        border-radius: 4px;
    }
    
    .vpp-video-wrapper {
        margin: 10px 0;
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    .vpp-player-container {
        max-height: 40vh;
        border-radius: 3px;
    }
}

/* HTML5 视频播放器样式 */
.vpp-html5-player {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    object-fit: contain;
}

.vpp-html5-player-container {
    position: relative;
    background: #000;
    width: 100%;
    height: 100%;
}

/* 大播放按钮样式 */
.vpp-large-play-button {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.4);
    z-index: 50;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.vpp-large-play-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 51;
    transition: transform 0.2s ease;
}

.vpp-large-play-btn:hover {
    transform: scale(1.05);
}

.vpp-play-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.vpp-play-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.vpp-play-text-line1 {
    color: white;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 5px;
}

.vpp-play-text-line2 {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    opacity: 0.9;
}

.vpp-poster-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.vpp-poster-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #333, #555);
    z-index: -1;
}

/* 加载指示器 */
.vpp-loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 60;
}

.vpp-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: vpp-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes vpp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.vpp-loading-text {
    color: #fff;
    font-size: 14px;
    text-align: center;
}

/* YouTube/Vimeo 播放器容器 */
.vpp-youtube-player,
.vpp-vimeo-player {
    position: relative;
    width: 100%;
    height: 100%;
}

.vpp-youtube-player iframe,
.vpp-vimeo-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 广告容器样式 - 彻底修复显示问题 */
.vpp-ad-container {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.98) !important;
    z-index: 10000 !important;
    display: none !important;
    justify-content: center !important;
    align-items: center !important;
    flex-direction: column !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.vpp-ad-container[style*="display: flex"] {
    visibility: visible !important;
    opacity: 1 !important;
}

.vpp-ad-wrapper {
    width: 100%;
    height: 100%;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.vpp-ad-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: calc(100% - 80px);
    overflow: hidden;
}

.vpp-ad-content {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    text-align: center !important;
    position: relative !important;
}

/* 广告内容支持HTML和JS - 强制样式 */
.vpp-ad-content * {
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
}

/* 确保广告内容居中 */
.vpp-ad-content > * {
    margin: 0 auto !important;
    text-align: center !important;
}

/* 图片广告样式 */
.vpp-ad-content img {
    max-width: 100% !important;
    max-height: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* iframe广告样式 */
.vpp-ad-content iframe {
    border: none !important;
    display: block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Google Adsense 样式 */
.vpp-ad-content ins.adsbygoogle {
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
    background: transparent !important;
}

/* 脚本生成的广告容器 */
.vpp-ad-content div[id*="google_ads"] {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
}

.vpp-ad-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 10001 !important;
}

.vpp-ad-skip,
.vpp-ad-close {
    background: #ff4444 !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
    z-index: 10002 !important;
    min-width: 120px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    display: block !important;
    visibility: visible !important;
}

.vpp-ad-skip:hover,
.vpp-ad-close:hover {
    background: #cc0000 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}

.vpp-ad-skip:disabled {
    background: #666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* 视频描述 */
.vpp-video-description {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    text-align: left;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

/* 错误消息 */
.vpp-error-message {
    background: #ffe5e5;
    color: #a00;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 10px;
    border-left: 4px solid #dc3232;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.vpp-retry-button {
    background: #ff4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    font-weight: bold;
    transition: background 0.3s;
}

.vpp-retry-button:hover {
    background: #cc0000;
}

/* 浏览器投屏按钮样式 */
.vpp-browser-cast-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 70;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.vpp-browser-cast-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.05);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .vpp-ad-wrapper {
        padding: 15px;
    }
    
    .vpp-ad-content-wrapper {
        height: calc(100% - 70px);
    }
    
    .vpp-ad-controls {
        bottom: 15px;
        gap: 10px;
        padding: 0 15px;
    }
    
    .vpp-ad-skip,
    .vpp-ad-close {
        padding: 8px 16px !important;
        font-size: 13px !important;
        min-width: 100px !important;
    }
    
    .vpp-play-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .vpp-play-text-line1 {
        font-size: 16px;
    }
    
    .vpp-play-text-line2 {
        font-size: 12px;
    }
    
    .vpp-browser-cast-btn {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .vpp-video-description {
        padding: 12px;
        font-size: 13px;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .vpp-ad-wrapper {
        padding: 10px;
    }
    
    .vpp-ad-content-wrapper {
        height: calc(100% - 60px);
    }
    
    .vpp-ad-controls {
        bottom: 10px;
        gap: 8px;
        padding: 0 10px;
        flex-direction: column;
    }
    
    .vpp-ad-skip,
    .vpp-ad-close {
        padding: 6px 12px !important;
        font-size: 12px !important;
        min-width: 90px !important;
        width: 100% !important;
        max-width: 150px !important;
    }
    
    .vpp-play-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 8px;
    }
    
    .vpp-play-text-line1 {
        font-size: 14px;
    }
    
    .vpp-play-text-line2 {
        font-size: 11px;
    }
    
    .vpp-loading-spinner {
        width: 30px;
        height: 30px;
        margin-bottom: 10px;
    }
    
    .vpp-loading-text {
        font-size: 12px;
    }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .vpp-player-container {
        max-height: 85vh;
    }
    
    .vpp-ad-content-wrapper {
        height: calc(100% - 50px);
    }
    
    .vpp-ad-controls {
        bottom: 10px;
    }
    
    .vpp-play-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 5px;
    }
    
    .vpp-play-text-line1 {
        font-size: 14px;
    }
    
    .vpp-play-text-line2 {
        font-size: 10px;
    }
}

/* 支持不支持aspect-ratio的浏览器 */
@supports not (aspect-ratio: 16/9) {
    .vpp-player-container {
        height: 0;
        padding-bottom: 56.25%;
    }
    
    .vpp-html5-player-container,
    .vpp-youtube-player,
    .vpp-vimeo-player,
    .vpp-ad-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    .vpp-loading-spinner {
        animation: none;
    }
    
    .vpp-large-play-btn,
    .vpp-browser-cast-btn,
    .vpp-ad-skip,
    .vpp-ad-close {
        transition: none;
    }
    
    .vpp-large-play-btn:hover,
    .vpp-browser-cast-btn:hover,
    .vpp-ad-skip:hover,
    .vpp-ad-close:hover {
        transform: none;
    }
}