.player-container {
    position: relative !important;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    /* 隐藏滚动条 */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
    display: flex;
    flex-direction: row;
    z-index: 1 !important;
}

/* 视频元素设置默认光标 */
#player,
video {
    cursor: default !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* 悬浮按钮必须脱离文档流并赋予极高z-index */
.floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2147483647; /* 最大合法值 */
    background-color: #007BFF;
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s;
}


/* 右键菜单样式 */
.context-menu {
    position: fixed;
    background: rgba(26, 26, 32, 0.96);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    padding: 6px 0;
    min-width: 200px;
    z-index: 2147483647; /* 使用最大z-index确保在最上层 */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation; /* 移动端触摸优化 */
    -webkit-touch-callout: default; /* iOS允许长按弹出菜单 */
    user-select: none;
    -webkit-user-select: none;
}

.context-menu.show {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.context-menu-item {
    padding: 12px 16px;
    color: #e8e8e8;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease, color 0.15s ease;
    margin: 0 4px;
    border-radius: 6px;
}

.context-menu-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(118, 75, 162, 0.15));
    color: #fff;
}

.context-menu-item-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.context-menu-item:hover .context-menu-item-icon {
    opacity: 1;
}

.context-menu-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    margin: 6px 10px;
}

.player-content {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-content.hidden {
    opacity: 0;
    pointer-events: none;
}

#player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-appearance: none;
    appearance: none;
    -webkit-media-controls: none;
    /* 确保点击可以正常工作 */
    pointer-events: auto;
    cursor: pointer;
}

/* 隐藏移动端原生视频播放按钮 */
#player::-webkit-media-controls {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#player::-webkit-media-controls-enclosure {
    display: none !important;
    opacity: 0 !important;
}

#player::-webkit-media-controls-panel {
    display: none !important;
    opacity: 0 !important;
}

#player::-webkit-media-controls-play-button {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

#player::-webkit-media-controls-start-playback-button {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* iOS 特定 */
#player::-webkit-media-controls-overlay-play-button {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

video::-webkit-media-controls-overlay-play-button {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Android Chrome 特定 */
#player::-webkit-media-controls-overlay-enclosure {
    display: none !important;
    opacity: 0 !important;
}

.player-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.title-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    pointer-events: none;
    transition: opacity 0.3s;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.big-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease, opacity 0.3s ease;
    z-index: 10;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.big-play-btn:hover,
.big-play-btn:active,
.big-play-btn:focus,
.big-play-btn:visited {
    box-shadow: none !important;
    outline: none !important;
}

.big-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

/* 滑动进度条 */
.swipe-progress-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 8px;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.swipe-progress-container.show {
    opacity: 1;
}

.swipe-progress-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.swipe-progress-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    width: 0%;
}

.swipe-progress-time {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 10;
}

.player-container.loading .loading-spinner {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 12px 20px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.controls-overlay.visible,
.controls-overlay.always-visible {
    opacity: 1;
    pointer-events: auto;
}

.progress-bar-container {
    position: relative;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: height 0.2s ease;
    touch-action: none;
}

.progress-bar-container:hover {
    height: 6px;
}

/* 增加触摸区域 */
.progress-bar-container::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    bottom: -15px;
    background: transparent;
}

/* 拖动时的视觉反馈 */
.progress-bar-container.dragging {
    height: 8px !important;
}

.progress-bar-container.dragging .progress-bar::after {
    transform: translate(50%, -50%) scale(1.2);
    box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.buffered-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.05s linear;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.15);
    opacity: 0;
    transition: all 0.2s ease;
}

.progress-bar-container:hover .progress-bar::after {
    opacity: 1;
    transform: translate(50%, -50%) scale(1.1);
}

/* 移动端始终显示进度条手柄 */
@media (max-width: 768px) {
    .progress-bar::after {
        opacity: 1;
        width: 18px;
        height: 18px;
    }
}

.progress-bar-container:hover .progress-bar {
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.7);
}

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    width: 36px;
    height: 36px;
    background: transparent !important;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    flex-shrink: 0;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
}

.control-btn:hover,
.control-btn:active,
.control-btn:focus,
.control-btn:visited {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.control-btn:hover {
    opacity: 0.7;
}

.control-btn.active {
    opacity: 0.5;
}

/* 更多按钮样式 */
#moreBtn {
    font-size: 18px;
    line-height: 1;
}

.control-btn svg {
    fill: currentColor;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.volume-slider {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    appearance: none;
    cursor: pointer;
}

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

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.time-display {
    color: #fff;
    font-size: 12px;
    font-family: monospace;
    min-width: 80px;
    text-align: center;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.speed-control {
    position: relative;
}

/* 悬浮时显示倍速菜单 - 仅在PC端 */
@media (min-width: 769px) {
    .speed-control:hover .speed-menu {
        display: block;
        animation: speedMenuFadeIn 0.2s ease;
    }
}

/* 移动端只通过点击打开菜单，不响应hover */
/* 移动端只显示：0.75x、正常(1.0x)、2.0x 和自定义倍速 */
@media (max-width: 768px) {
    .speed-menu {
        display: none;
    }
    
    .speed-menu.open {
        display: block;
        animation: speedMenuFadeIn 0.2s ease;
    }
    
    /* 移动端只显示需要的速度选项，排除自定义菜单项 */
    .speed-menu .speed-option[data-speed="0.5"]:not(.speed-option-custom),
    .speed-menu .speed-option[data-speed="1.25"]:not(.speed-option-custom),
    .speed-menu .speed-option[data-speed="1.5"]:not(.speed-option-custom),
    .speed-menu .speed-option[data-speed="3.0"]:not(.speed-option-custom) {
        display: none;
    }
    
    /* 确保自定义倍速菜单项始终显示 */
    .speed-menu .speed-option.speed-option-custom {
        display: flex !important;
    }
}

/* 完全禁止播放器控制栏所有文本选中 */
.controls-overlay,
.controls-overlay *,
.speed-btn,
.speed-btn span,
.speed-option,
.speed-option span,
.time-display,
.control-btn,
.control-btn * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -webkit-touch-callout: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* 按钮保持手型光标 */
.speed-btn,
.control-btn,
.speed-option {
    cursor: pointer !important;
}

/* 文本标签保持默认光标 */
.time-display {
    cursor: default !important;
}

.speed-btn,
.speed-btn span,
.speed-option,
.speed-option span {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.speed-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent !important;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
}

.speed-btn:hover,
.speed-btn:active,
.speed-btn:focus,
.speed-btn:visited {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.speed-btn:hover {
    opacity: 0.7;
}

.speed-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 4px;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 6px 0;
    display: none;
    min-width: 130px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    /* 添加上下padding使悬浮区域更宽 */
    padding-top: 8px;
    margin-top: -8px;
}

/* 伪元素连接按钮和菜单，防止悬浮区域断开 */
.speed-control::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

.speed-menu.open {
    display: block;
    animation: speedMenuFadeIn 0.2s ease;
}

@keyframes speedMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.speed-menu-header {
    padding: 8px 14px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
}

.speed-menu-title {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.speed-option {
    padding: 9px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.speed-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.speed-option.active {
    background: linear-gradient(90deg, rgba(124, 77, 255, 0.25) 0%, rgba(168, 85, 247, 0.15) 100%);
    color: #fff;
    border-left: 3px solid #7c4dff;
    padding-left: 13px;
}

/* 自定义速度选项 */
.speed-custom-option {
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
}

.speed-custom-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-custom-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 77, 255, 0.2);
    border: 1px solid rgba(124, 77, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.speed-custom-btn:hover {
    background: rgba(124, 77, 255, 0.4);
    transform: scale(1.05);
}

.speed-custom-btn:active {
    transform: scale(0.95);
}

.speed-custom-input {
    flex: 1;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    outline: none;
    text-align: center;
    min-width: 0;
}

.speed-custom-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.speed-custom-input:focus {
    border-color: #7c4dff;
    background: rgba(124, 77, 255, 0.1);
}

.speed-option-check {
    width: 16px;
    height: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.speed-option.active .speed-option-check {
    opacity: 1;
}

.speed-option-check svg {
    width: 100%;
    height: 100%;
    fill: #7c4dff;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

.menu-icon span {
    width: 16px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.gesture-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 16px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
}

.gesture-hint.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.resume-hint {
    position: absolute;
    bottom: 80px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.resume-hint.show {
    opacity: 1;
    transform: translateY(0);
}

.player-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
}

.episodes-panel {
    position: relative;
    width: 320px;
    height: 100%;
    background: #000;
    border-left: 1px solid #333;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    opacity: 1;
}


@media (max-width: 768px) {
  /* 默认隐藏 */
  .episodes-panel {
    display: none !important;
    transition: none !important;
    animation: none !important;
  }

  /* 激活显示时：恢复高度 + 允许滚动 */
  .episodes-panel.active,
  .episodes-panel:not(.hidden) {
    display: block !important;
    max-height: 80vh !important;   /* 关键：给高度限制 */
    overflow-y: auto !important;    /* 关键：开启纵向滚动 */
    -webkit-overflow-scrolling: touch !important; /* 移动端流畅滚动 */
  }
}


.episodes-panel.hidden {
    width: 0;
    min-width: 0;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    border-left: none;
}

.episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #000;
    border-bottom: 1px solid #333;
}

.episodes-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: normal;
}

.episodes-close {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.episodes-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.movie-detail-section {
    padding: 15px;
    border-bottom: 1px solid #333;
}

.movie-detail-poster {
    float: left;
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
}

.movie-detail-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.movie-detail-remarks-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.movie-detail-remarks {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 8px;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.movie-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.movie-detail-meta span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.movie-detail-meta span::before {
    content: '·';
    margin-right: 8px;
}

.movie-detail-meta span:first-child::before {
    display: none;
}

.movie-detail-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.5;
    margin-top: 10px;
    max-height: 80px;
    overflow-y: auto;
    padding: 10px 5px 0;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.movie-detail-desc::-webkit-scrollbar {
    width: 4px;
}

.movie-detail-desc::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.movie-detail-desc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.movie-detail-desc::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.sources-container {
    padding: 12px 15px;
    border-bottom: none;
    position: relative;
}

.sources-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.sources-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin-bottom: 8px;
}

.sources-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.source-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.source-btn:hover,
.source-btn:active,
.source-btn:focus,
.source-btn:visited {
    box-shadow: none !important;
    outline: none !important;
}

.source-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.source-btn.active {
    background: linear-gradient(135deg, #7c4dff 0%, #a855f7 100%);
    color: #fff;
    position: relative;
}

.source-btn.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 15%;
    right: 15%;
    height: 2px;
    background: linear-gradient(90deg, #7c4dff 0%, #a855f7 100%);
    border-radius: 1px;
}

.episodes-tabs-container {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.episodes-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.episodes-tabs button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.episodes-tabs button:hover,
.episodes-tabs button:active,
.episodes-tabs button:focus,
.episodes-tabs button:visited {
    box-shadow: none !important;
    outline: none !important;
}

.episodes-tabs button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.episodes-tabs button.active {
    background: linear-gradient(135deg, #7c4dff 0%, #a855f7 100%);
    color: #fff;
    position: relative;
}

.episodes-tabs button.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 15%;
    right: 15%;
    height: 2px;
    background: linear-gradient(90deg, #7c4dff 0%, #a855f7 100%);
    border-radius: 1px;
}

.episodes-tabs button.has-playing {
    border-color: #007bff;
    border-width: 1px;
    border-style: solid;
}

.episodes-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
}

.episodes-list::-webkit-scrollbar {
    width: 6px;
}

.episodes-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
}

.episodes-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.episodes-list::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 77, 255, 0.4);
}

.episodes-empty {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    text-align: center;
    padding: 40px 0;
}

.episodes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.episode-item {
    width: calc(33.33% - 4px);
    height: 36px;
    line-height: 36px;
    padding: 0 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.episode-item:hover,
.episode-item:active,
.episode-item:focus,
.episode-item:visited {
    box-shadow: none !important;
    outline: none !important;
}

.episode-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(124, 77, 255, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}

.episode-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(124, 77, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.episode-item:hover::before {
    opacity: 1;
}

.episode-item.active {
    background: linear-gradient(135deg, #7c4dff 0%, #a855f7 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.4) !important;
    transform: translateY(-1px);
}

.settings-panel {
    position: absolute;
    bottom: 85px;
    right: 20px;
    width: 240px;
    min-width: 240px;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.settings-panel.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #333;
}

.settings-header h4 {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: normal;
}

.settings-close {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none !important;
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.settings-close:hover,
.settings-close:active,
.settings-close:focus,
.settings-close:visited {
    box-shadow: none !important;
    outline: none !important;
}

.settings-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.settings-content {
    padding: 15px;
}

.settings-item {
    margin-bottom: 15px;
}

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 8px;
}

.settings-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.settings-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 24px;
}

.settings-input-group input {
    width: 60px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    text-align: center;
    outline: none;
}

.settings-input-group span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.ad-detection-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 14px;
    border-radius: 8px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}

/* 移动端浮动按钮已移至 player.php */

.ad-icon {
    margin-right: 8px;
}

@media (max-width: 768px) {
    .player-container {
        flex-direction: column;
    }
    
    .player-content {
        position: relative;
        flex: 1;
        min-width: 0;
        height: 100%;
        z-index: 5;
    }
    
    .player-content.hidden {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        pointer-events: none;
        z-index: 1;
    }
    
    .episodes-panel {
        width: 100%;
        height: calc(100% - 56px);
        background: #000;
        border-left: none;
        border-top: 1px solid #333;
        position: absolute;
        top: 56px;
        left: 0;
        z-index: 10;
        transform: translateY(0);
        transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .episodes-panel.hidden {
        width: 100%;
        transform: translateY(100%);
        opacity: 0;
        pointer-events: none;
        border-top: none;
    }
    
    .controls-overlay {
        padding: 8px 12px;
        gap: 8px;
    }
    
    /* 移动端进度条优化 */
    .progress-bar-container {
        height: 6px;
        margin-bottom: 16px;
    }
    
    .progress-bar-container:hover {
        height: 8px;
    }
    
    .progress-bar-container::before {
        top: -20px;
        bottom: -20px;
    }
    
    /* 移动端拖动时的视觉反馈 */
    .progress-bar-container.dragging {
        height: 10px !important;
    }
    
    .progress-bar-container.dragging .progress-bar::after {
        transform: translate(50%, -50%) scale(1.25);
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.35), 0 4px 14px rgba(0, 0, 0, 0.45);
    }
    
    .controls-left,
    .controls-right {
        gap: 6px;
    }
    
   
    
    .control-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .volume-control {
        display: none !important;
    }
    
    .controls-left #prevBtn,
    .controls-left #nextBtn {
        display: none !important;
    }
    
    .controls-left #playBtn {
        display: none !important;
    }
    
    .time-display {
        font-size: 11px;
        min-width: 70px;
    }
    
    .speed-btn {
        width: 28px;
        height: 28px;
        padding: 0;
        font-size: 14px;
    }
    
    .big-play-btn {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }
    
    .title-overlay {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .float-episodes-btn {
        top: 10px;
        right: 10px;
        width: 52px;
        height: 52px;
    }
    
    .settings-panel {
        bottom: 75px;
        left: 12px;
        right: 12px;
        width: auto;
        min-width: auto;
    }
    
    .resume-hint {
        bottom: 70px;
        left: 12px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    /* 移动端隐藏原始的画中画、投屏按钮 */
    #pipBtn,
    #castBtn,
    .volume-control {
        display: none !important;
    }
    
    /* 显示更多按钮 */
    #moreBtn {
        display: inline-flex;
    }
}

/* 桌面端显示原始的剧集、画中画、投屏按钮 */
@media (min-width: 769px) {
    #episodesBtn,
    #pipBtn,
    #castBtn,
    .volume-control {
        display: inline-flex;
    }
    
    #moreBtn {
        display: inline-flex;
    }
}

/* 更多菜单样式 */
.more-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    pointer-events: none;
}

.more-menu.show {
    display: block;
}

.more-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: auto;
}

.more-menu.show .more-menu-overlay {
    opacity: 1;
}

.more-menu-content {
    position: absolute;
    bottom: 70px;
    right: 10px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.2s;
    pointer-events: auto;
}

.more-menu.show .more-menu-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.more-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.more-menu-item:active {
    background: rgba(255, 255, 255, 0.15);
}

.more-menu-icon {
    font-size: 16px;
    min-width: 24px;
    text-align: center;
}

.more-menu-value {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.more-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.more-speed-item.active {
    background: rgba(124, 77, 255, 0.3) !important;
}

.more-speed-item.active .more-menu-icon {
    color: #fff;
    font-weight: bold;
}

/* 桌面端显示更多按钮 */
#moreBtn {
    display: inline-flex;
}

#playerIframe{
  /* 保留视频交互，仅让上层按钮区域穿透 */
  pointer-events:auto;
}