/**
 * 视频播放器样式
 * 
 * 符合视频教程站标准规范：
 * - PC端最大宽度1280px，居中显示
 * - 移动端最大宽度95%
 * - 16:9标准比例
 * - 响应式适配
 *
 * @package Xuhuan
 * @since 2.0.0
 */

/* 播放器容器 */
.tah-video-player {
    background: var(--card-bg, #1a1a2e);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    /* PC端标准：最大宽度1280px，居中显示 */
    max-width: 1280px;
    margin: 20px auto;
}

/* 懒加载状态 */
.tah-video-player.lazy-video .video-element {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tah-video-player.video-loaded .video-element {
    opacity: 1;
}

.tah-video-player-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted, #8b8b9e);
    background: var(--card-bg, #1a1a2e);
    border-radius: var(--radius-lg, 12px);
}

/* 视频容器 */
.tah-video-player .video-container {
    position: relative;
    background: #000;
    width: 100%;
}

.tah-video-player .video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 加载状态 */
.tah-video-player .video-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    gap: 12px;
    z-index: 10;
}

.tah-video-player .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-color, #6366f1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 浏览器兼容性错误 */
.tah-video-player .video-compat-error {
    padding: 60px 40px;
    text-align: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}

.tah-video-player .compat-error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: #ef4444;
}

.tah-video-player .compat-error-icon svg {
    width: 100%;
    height: 100%;
}

.tah-video-player .compat-error-text {
    font-size: 16px;
    color: var(--text-primary, #fff);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

/* 错误提示 */
.tah-video-player .video-error,
.tah-video-player .video-timeout {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    gap: 16px;
    z-index: 20;
}

.tah-video-player .error-icon,
.tah-video-player .timeout-icon {
    width: 56px;
    height: 56px;
    color: #ef4444;
}

.tah-video-player .timeout-icon {
    color: #f59e0b;
}

.tah-video-player .error-icon svg,
.tah-video-player .timeout-icon svg {
    width: 100%;
    height: 100%;
}

.tah-video-player .error-message,
.tah-video-player .timeout-message {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    max-width: 300px;
}

.tah-video-player .error-retry-btn,
.tah-video-player .timeout-retry-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color, #6366f1);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.tah-video-player .error-retry-btn:hover,
.tah-video-player .timeout-retry-btn:hover {
    background: var(--primary-hover, #4f46e5);
    transform: translateY(-1px);
}

/* 进度恢复提示 */
.tah-video-player .video-progress-restore {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    z-index: 25;
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.tah-video-player .progress-restore-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.tah-video-player .restore-time {
    color: var(--primary-color, #6366f1);
    font-weight: 600;
}

.tah-video-player .progress-restore-btn,
.tah-video-player .progress-dismiss-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tah-video-player .progress-restore-btn {
    background: var(--primary-color, #6366f1);
    color: #fff;
}

.tah-video-player .progress-restore-btn:hover {
    background: var(--primary-hover, #4f46e5);
}

.tah-video-player .progress-dismiss-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.tah-video-player .progress-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 视频后备文本 */
.tah-video-player .video-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted, #8b8b9e);
    font-size: 14px;
}

/* 播放按钮覆盖层 */
.tah-video-player .video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 5;
}

.tah-video-player .video-play-overlay:hover {
    background: rgba(0, 0, 0, 0.4);
}

.tah-video-player .video-play-overlay.hidden {
    display: none;
}

.tah-video-player .play-button {
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color, #6366f1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tah-video-player .play-button:hover {
    transform: scale(1.1);
    background: #fff;
}

.tah-video-player .play-button svg {
    width: 32px;
    height: 32px;
    margin-left: 4px; /* 视觉居中调整 */
}

/* 控制栏 */
.tah-video-player .video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 15;
}

.tah-video-player .video-container:hover .video-controls,
.tah-video-player .video-controls:hover {
    opacity: 1;
}

.tah-video-player .video-controls.always-show {
    opacity: 1;
}

.tah-video-player .controls-left,
.tah-video-player .controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tah-video-player .controls-center {
    flex: 1;
    padding: 0 16px;
}

/* 控制按钮 */
.tah-video-player .control-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tah-video-player .control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tah-video-player .control-btn svg {
    width: 20px;
    height: 20px;
}

/* 时间显示 */
.tah-video-player .time-display {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tah-video-player .time-separator {
    margin: 0 4px;
    opacity: 0.6;
}

/* 进度条 */
.tah-video-player .progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.2s ease;
}

.tah-video-player .progress-bar:hover {
    height: 6px;
}

.tah-video-player .progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.tah-video-player .progress-played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary-color, #6366f1);
    border-radius: 2px;
}

.tah-video-player .progress-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* 音量控制 */
.tah-video-player .volume-control {
    position: relative;
    display: flex;
    align-items: center;
}

.tah-video-player .volume-slider-container {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.tah-video-player .volume-control:hover .volume-slider-container {
    width: 80px;
    padding-left: 8px;
}

.tah-video-player .volume-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
}

.tah-video-player .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* 播放速度按钮 */
.tah-video-player .btn-speed {
    width: auto;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
}

/* 视频列表 - 横向滚动布局 */
.tah-video-player .video-playlist {
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    background: var(--bg-secondary, rgba(0, 0, 0, 0.2));
    border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
}

.tah-video-player .playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-tertiary, rgba(0, 0, 0, 0.15));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
}

.tah-video-player .playlist-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tah-video-player .playlist-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary-color, #6366f1);
    border-radius: 2px;
}

.tah-video-player .playlist-count {
    font-size: 12px;
    color: var(--text-muted, #8b8b9e);
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
    padding: 4px 10px;
    border-radius: 12px;
}

.tah-video-player .playlist-items {
    display: flex;
    flex-direction: row;
    gap: 14px;
    padding: 16px 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color, #6366f1) transparent;
}

/* 自定义滚动条样式 */
.tah-video-player .playlist-items::-webkit-scrollbar {
    height: 4px;
}

.tah-video-player .playlist-items::-webkit-scrollbar-track {
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
    border-radius: 2px;
}

.tah-video-player .playlist-items::-webkit-scrollbar-thumb {
    background: var(--primary-color, #6366f1);
    border-radius: 2px;
}

.tah-video-player .playlist-items::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-hover, #818cf8);
}

.tah-video-player .playlist-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 200px;
    max-width: 260px;
    padding: 14px 16px;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--card-bg, rgba(255, 255, 255, 0.04));
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.tah-video-player .playlist-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.25s ease;
}

.tah-video-player .playlist-item:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
    border-color: var(--border-color-hover, rgba(255, 255, 255, 0.12));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tah-video-player .playlist-item.active {
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb, 99, 102, 241), 0.15) 0%, 
        rgba(var(--primary-rgb, 99, 102, 241), 0.08) 100%);
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb, 99, 102, 241), 0.2);
}

.tah-video-player .playlist-item.active::before {
    background: var(--primary-color, #6366f1);
}

.tah-video-player .playlist-item .item-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tah-video-player .item-index {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 6px);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary, #aaa);
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.tah-video-player .playlist-item.active .item-index {
    background: var(--primary-color, #6366f1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb, 99, 102, 241), 0.4);
}

.tah-video-player .item-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.tah-video-player .item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #fff);
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tah-video-player .item-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted, #8b8b9e);
    margin-top: 6px;
}

.tah-video-player .item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-hover, rgba(255, 255, 255, 0.06));
    border-radius: 4px;
}

.tah-video-player .item-playing {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    color: var(--primary-color, #6366f1);
    opacity: 0;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.tah-video-player .playlist-item.active .item-playing {
    opacity: 1;
    animation: playingPulse 1.2s ease-in-out infinite;
}

@keyframes playingPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(0.9);
    }
}

/* 浏览器内最大化模式 */
.tah-video-player.maximized {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    max-width: none;
    background: var(--bg-primary, #0f0f23);
}

.tah-video-player.maximized .video-container {
    height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
}

.tah-video-player.maximized .video-playlist {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 120px;
    background: var(--bg-secondary, rgba(0, 0, 0, 0.95));
    border-radius: 0;
}

.tah-video-player.maximized .playlist-items {
    padding: 12px 16px;
}

.tah-video-player.maximized .playlist-item {
    min-width: 160px;
    max-width: 200px;
    padding: 10px 12px;
}

/* 遮罩层 */
.tah-video-player-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9998;
    backdrop-filter: blur(4px);
}

.tah-video-player-overlay.active {
    display: block;
}

/* 真正的全屏模式（兼容旧代码） */
.tah-video-player.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    border-radius: 0;
}

.tah-video-player.fullscreen .video-container {
    height: 100vh;
}

.tah-video-player.fullscreen .video-playlist {
    display: none;
}

/* 响应式 - 平板 */
@media (max-width: 1024px) {
    .tah-video-player {
        max-width: 100%;
        margin: 16px auto;
        border-radius: var(--radius-md, 8px);
    }
}

/* 响应式 - 移动端 */
@media (max-width: 768px) {
    .tah-video-player {
        /* 移动端：最大宽度95%，贴近屏幕边缘 */
        max-width: 95%;
        margin: 12px auto;
        border-radius: var(--radius-sm, 6px);
    }
    
    /* 移动端16:9比例调整为62.5%（更适合竖屏） */
    .tah-video-player .video-container {
        aspect-ratio: 16 / 10;
    }
    
    .tah-video-player .video-controls {
        padding: 8px 12px;
        /* 移动端控制栏始终显示 */
        opacity: 1;
    }
    
    .tah-video-player .control-btn {
        width: 36px;
        height: 36px;
        /* 增大触摸区域 */
        min-width: 44px;
        min-height: 44px;
    }
    
    .tah-video-player .control-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .tah-video-player .time-display {
        font-size: 12px;
    }
    
    .tah-video-player .controls-center {
        padding: 0 8px;
    }
    
    /* 移动端音量滑块默认展开 */
    .tah-video-player .volume-slider-container {
        width: 60px;
        padding-left: 8px;
    }
    
    .tah-video-player .play-button {
        width: 60px;
        height: 60px;
    }
    
    .tah-video-player .play-button svg {
        width: 24px;
        height: 24px;
    }
    
    /* 进度恢复提示移动端适配 */
    .tah-video-player .video-progress-restore {
        bottom: 70px;
        padding: 10px 16px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 90%;
    }
    
    .tah-video-player .progress-restore-text {
        font-size: 13px;
        width: 100%;
        text-align: center;
    }
    
    .tah-video-player .progress-restore-btn,
    .tah-video-player .progress-dismiss-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    /* 错误提示移动端适配 */
    .tah-video-player .error-icon,
    .tah-video-player .timeout-icon {
        width: 48px;
        height: 48px;
    }
    
    .tah-video-player .error-message,
    .tah-video-player .timeout-message {
        font-size: 14px;
        padding: 0 20px;
    }
    
    /* 播放列表移动端适配 - 横向滚动 */
    .tah-video-player .playlist-items {
        gap: 8px;
        padding: 10px 12px;
    }
    
    .tah-video-player .playlist-item {
        min-width: 160px;
        max-width: 200px;
        padding: 8px 10px;
    }
    
    .tah-video-player .item-index {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .tah-video-player .item-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .tah-video-player .item-meta {
        font-size: 10px;
    }
    
    /* 移动端最大化模式 */
    .tah-video-player.maximized {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
    }
    
    .tah-video-player.maximized .video-container {
        height: calc(100vh - 100px);
        height: calc(100dvh - 100px);  /* 动态视口高度，适配移动端浏览器 */
    }
    
    .tah-video-player.maximized .video-playlist {
        max-height: 100px;
    }
    
    .tah-video-player.maximized .playlist-header {
        padding: 8px 12px;
    }
    
    .tah-video-player.maximized .playlist-items {
        padding: 8px 12px;
    }
    
    .tah-video-player.maximized .playlist-item {
        min-width: 140px;
        max-width: 180px;
        padding: 8px 10px;
    }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
    .tah-video-player {
        max-width: 100%;
        margin: 8px 0;
        border-radius: 0;
    }
    
    .tah-video-player .video-controls {
        padding: 6px 8px;
    }
    
    .tah-video-player .controls-left,
    .tah-video-player .controls-right {
        gap: 4px;
    }
    
    /* 隐藏部分控制按钮节省空间 */
    .tah-video-player .btn-prev,
    .tah-video-player .btn-next {
        display: none;
    }
    
    .tah-video-player .time-display {
        font-size: 11px;
    }
    
    .tah-video-player .btn-speed {
        font-size: 11px;
        padding: 0 6px;
    }
}

/* ============================================================
 * 视频付费锁定层
 * ============================================================ */
.tah-video-player .video-paywall,
.tah-video-player .video-preview-ended {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(30, 30, 50, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    backdrop-filter: blur(8px);
}

.tah-video-player .paywall-content,
.tah-video-player .preview-ended-content {
    text-align: center;
    padding: 24px;
    max-width: 320px;
}

.tah-video-player .paywall-icon,
.tah-video-player .preview-ended-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tah-video-player .paywall-icon svg,
.tah-video-player .preview-ended-icon svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

.tah-video-player .paywall-title,
.tah-video-player .preview-ended-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.tah-video-player .preview-ended-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.tah-video-player .paywall-options,
.tah-video-player .preview-ended-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.tah-video-player .paywall-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.tah-video-player .paywall-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.tah-video-player .paywall-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tah-video-player .paywall-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
}

.tah-video-player .paywall-btn-primary:hover:not(.disabled):not(.loading) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.tah-video-player .paywall-btn-vip {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.tah-video-player .paywall-btn-vip:hover:not(.disabled):not(.loading) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.tah-video-player .paywall-btn-points {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.tah-video-player .paywall-btn-points:hover:not(.disabled):not(.loading) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.tah-video-player .paywall-btn .btn-price {
    font-weight: 600;
}

.tah-video-player .paywall-login {
    margin-top: 20px;
}

.tah-video-player .paywall-login-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
    font-size: 14px;
    transition: color 0.2s;
}

.tah-video-player .paywall-login-link:hover {
    color: #fff;
}

/* 播放列表项付费标识 */
.tah-video-player .item-pricing {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.tah-video-player .item-pricing.free {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.tah-video-player .item-pricing.paid {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.tah-video-player .item-pricing.preview {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.tah-video-player .item-pricing.vip-free {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.tah-video-player .item-pricing.purchased {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.tah-video-player .item-lock {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.tah-video-player .playlist-item {
    position: relative;
}

.tah-video-player .playlist-item.paid .item-lock,
.tah-video-player .playlist-item.preview .item-lock,
.tah-video-player .playlist-item.vip-free .item-lock {
    display: block;
}

/* 深色模式适配 */
[data-theme="dark"] .tah-video-player .item-pricing.free {
    background: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .tah-video-player .item-pricing.paid {
    background: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .tah-video-player .item-pricing.preview {
    background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .tah-video-player .item-pricing.vip-free {
    background: rgba(236, 72, 153, 0.2);
}

/* 响应式适配 */
@media (max-width: 480px) {
    .tah-video-player .paywall-content,
    .tah-video-player .preview-ended-content {
        padding: 16px;
    }
    
    .tah-video-player .paywall-icon,
    .tah-video-player .preview-ended-icon {
        width: 48px;
        height: 48px;
    }
    
    .tah-video-player .paywall-icon svg,
    .tah-video-player .preview-ended-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .tah-video-player .paywall-title,
    .tah-video-player .preview-ended-title {
        font-size: 16px;
    }
    
    .tah-video-player .paywall-btn {
        padding: 10px 20px;
        font-size: 13px;
        min-width: 180px;
    }
}

/* ===== 亮色模式适配 ===== */
[data-theme="light"] .tah-video-player .video-playlist {
    background: var(--bg-secondary, #f8fafc);
    border-top-color: var(--border-color, #e2e8f0);
}

[data-theme="light"] .tah-video-player .playlist-header {
    background: var(--bg-tertiary, #f1f5f9);
    border-bottom-color: var(--border-color, #e2e8f0);
}

[data-theme="light"] .tah-video-player .playlist-count {
    background: var(--bg-hover, rgba(0, 0, 0, 0.05));
}

[data-theme="light"] .tah-video-player .playlist-items {
    scrollbar-color: var(--primary-color, #6366f1) rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .tah-video-player .playlist-items::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .tah-video-player .playlist-item {
    background: var(--card-bg, #fff);
    border-color: var(--border-color, #e2e8f0);
}

[data-theme="light"] .tah-video-player .playlist-item:hover {
    background: var(--bg-hover, #f1f5f9);
    border-color: var(--border-color-hover, #cbd5e1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tah-video-player .playlist-item.active {
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb, 99, 102, 241), 0.1) 0%, 
        rgba(var(--primary-rgb, 99, 102, 241), 0.05) 100%);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb, 99, 102, 241), 0.15);
}

[data-theme="light"] .tah-video-player .item-index {
    background: var(--bg-hover, rgba(0, 0, 0, 0.05));
    color: var(--text-secondary, #64748b);
}

[data-theme="light"] .tah-video-player .item-title {
    color: var(--text-primary, #1e293b);
}

[data-theme="light"] .tah-video-player .item-meta span {
    background: var(--bg-hover, rgba(0, 0, 0, 0.04));
    color: var(--text-muted, #64748b);
}

[data-theme="light"] .tah-video-player.maximized {
    background: var(--bg-primary, #fff);
}

[data-theme="light"] .tah-video-player.maximized .video-playlist {
    background: var(--bg-secondary, rgba(248, 250, 252, 0.98));
}

[data-theme="light"] .tah-video-player-overlay {
    background: rgba(0, 0, 0, 0.6);
}
