/* ============================================
   影视采集插件样式 vod.css
   适配 Weui 主题框架（max-width: 588px）
   z-index 层级：详情页 9999 / 源切换面板 100
   ============================================ */

/* 1. 密码验证界面 */
.vod-password-screen {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 588px;
    margin: 0 auto;
    z-index: 9999;
    background-color: #f7f7f7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.vod-password-card {
    width: 100%;
    max-width: 320px;
    background-color: #fff;
    border-radius: 12px;
    padding: 30px 20px;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.vod-password-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin: 0 0 24px 0;
}

.vod-password-input {
    width: 100%;
    height: 44px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 15px;
    color: #333;
    background-color: #fff;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}

.vod-password-input:focus {
    border-color: #07c160;
}

.vod-password-btn {
    width: 100%;
    height: 44px;
    background-color: #07c160;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    margin-top: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.vod-password-btn:active {
    background-color: #06ad56;
}

.vod-password-error {
    color: #fa5151;
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 18px;
    line-height: 1.4;
}

/* 2. 影视大厅主容器 */
.vod-app {
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 588px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
    min-height: 100%;
}

/* 3. 顶部导航栏 */
.vod-header {
    position: relative;
    height: 44px;
    background-color: #fff;
    border-bottom: 0.5px solid #e5e5e5;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    z-index: 10;
    flex: 0 0 auto;
}

.vod-back-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #333;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}

.vod-header-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 6px;
}

.vod-source-btn {
    flex: 0 0 auto;
    height: 44px;
    line-height: 44px;
    padding: 0 14px;
    font-size: 14px;
    color: #07c160;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* 4. 源切换面板 */
.vod-source-panel {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: #fff;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.vod-source-panel.open {
    max-height: 500px;
    overflow-y: auto;
}

.vod-source-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    box-sizing: border-box;
}

.vod-source-item {
    flex: 1 1 auto;
    min-width: 80px;
    max-width: 120px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    color: #333;
    background-color: #fff;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.vod-source-item.active {
    border-color: #07c160;
    background-color: #07c160;
    color: #fff;
}

/* 5. 搜索栏 */
.vod-search-bar {
    background-color: #fff;
    padding: 8px 12px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.vod-search-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.vod-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #999;
    font-size: 14px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vod-search-input {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 18px;
    background-color: #f0f0f0;
    padding: 0 12px 0 34px;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
}

.vod-search-btn {
    flex: 0 0 auto;
    margin-left: 8px;
    height: 36px;
    line-height: 36px;
    padding: 0 14px;
    color: #07c160;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.vod-search-bar.hidden {
    display: none;
}

/* 6. 分类标签栏（横向滚动） */
.vod-category-bar {
    background-color: #fff;
    border-bottom: 0.5px solid #e5e5e5;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 0 0 auto;
    display: flex;
    flex-wrap: nowrap;
    padding: 8px 10px;
    gap: 8px;
    box-sizing: border-box;
}

.vod-category-bar::-webkit-scrollbar {
    display: none;
}

.vod-category-item {
    flex: 0 0 auto;
    padding: 6px 14px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    white-space: nowrap;
    border-radius: 16px;
    transition: background-color 0.15s, color 0.15s;
}

.vod-category-item.active {
    color: #fff;
    background-color: #07c160;
    font-weight: 500;
}

/* 7. 影视列表网格 */
.vod-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
    box-sizing: border-box;
}

@media (min-width: 400px) {
    .vod-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 8. 影视卡片 */
.vod-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 桌面端 hover 上浮效果（触屏设备不触发） */
@media (hover: hover) {
    .vod-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }
}

.vod-card-pic {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    background-color: #f0f0f0;
    overflow: hidden;
}

.vod-card-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vod-card-pic.loaded img {
    opacity: 1;
}

.vod-card-remarks {
    position: absolute;
    right: 4px;
    bottom: 4px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.2;
    max-width: calc(100% - 8px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.vod-card-info {
    padding: 6px 8px;
}

.vod-card-name {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.vod-card-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* 9. 加载状态 */
.vod-loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 13px;
}

.vod-loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #e0e0e0;
    border-top-color: #07c160;
    border-radius: 50%;
    margin: 0 auto 10px;
    animation: vod-spin 0.8s linear infinite;
    box-sizing: border-box;
}

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

/* 9.1 骨架屏加载态 */
.vod-skeleton {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.vod-skeleton-pic {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: vod-skeleton-shimmer 1.2s ease-in-out infinite;
}

.vod-skeleton-line {
    height: 12px;
    margin: 8px;
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: vod-skeleton-shimmer 1.2s ease-in-out infinite;
    border-radius: 4px;
}

.vod-skeleton-line.short {
    width: 60%;
}

@keyframes vod-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 10. 空状态 */
.vod-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
    line-height: 1.6;
}

.vod-empty-icon {
    margin-bottom: 12px;
}

.vod-empty-icon svg {
    width: 56px;
    height: 56px;
    fill: #d0d0d0;
}

/* 11. 加载更多 */
.vod-load-more {
    text-align: center;
    padding: 12px;
    color: #07c160;
    font-size: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.vod-load-more:active {
    opacity: 0.7;
}

/* 12. 影视详情页 */
.vod-detail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 588px;
    margin: 0 auto;
    z-index: 9999;
    background-color: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.vod-player-wrap {
    position: relative;
    width: 100%;
    background-color: #000;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

#vodPlayer {
    width: 100%;
    height: 100%;
}

/* 播放器错误提示（showPlayerError 使用） */
.vod-player-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #fff;
    background-color: #000;
    text-align: center;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    box-sizing: border-box;
}

/* iframe 解析播放样式 */
.vod-player-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.vod-detail-back {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    z-index: 30;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
}

.vod-detail-back:active {
    background-color: rgba(255, 255, 255, 0.85);
}

.vod-detail-info {
    padding: 12px 15px;
}

.vod-detail-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
}

.vod-detail-meta {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    line-height: 1.4;
}

.vod-detail-content {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-top: 10px;
}

.vod-detail-pic {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.vod-detail-pic img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

.vod-detail-remarks,
.vod-detail-actor,
.vod-detail-director {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-top: 6px;
}

/* 播放线路切换 */
.vod-play-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 15px 4px;
    box-sizing: border-box;
}

.vod-play-flag {
    padding: 6px 14px;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    transition: all .15s;
}

.vod-play-flag:active {
    background-color: #f5f5f5;
}

.vod-play-flag.active {
    background-color: #07c160;
    color: #fff;
    border-color: #07c160;
}

.vod-episodes-title {
    padding: 12px 15px 8px;
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

.vod-episodes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    padding: 0 15px 15px;
    box-sizing: border-box;
}

.vod-episode {
    padding: 8px;
    text-align: center;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.vod-episode:active {
    background-color: #f5f5f5;
}

.vod-episode.active {
    background-color: #07c160;
    color: #fff;
    border-color: #07c160;
}

/* 13. 播放记录提示 */
.vod-history-tip {
    background-color: #fff8e1;
    padding: 10px 15px;
    font-size: 13px;
    color: #f57c00;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.vod-history-tip-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.vod-history-resume {
    flex: 0 0 auto;
    color: #07c160;
    font-size: 13px;
    margin-left: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.vod-history-resume:active {
    opacity: 0.7;
}

/* 14. 响应式适配
   手机端与电脑端均限制在 588px 主题框架宽度内。
   固定定位的覆盖层使用 max-width: 588px + margin: 0 auto 居中，
   保证在桌面端 #app-main 框架内对齐显示。 */
.vod-app,
.vod-detail,
.vod-password-screen {
    max-width: 588px;
    margin-left: auto;
    margin-right: auto;
}

/* 15. 图片懒加载占位
   样式已合并到第 8 节 .vod-card-pic img / .vod-card-pic.loaded img */

/* 16. 详情加载错误提示 */
.vod-detail-error {
    padding: 40px 20px;
    text-align: center;
    color: #fa5151;
    font-size: 14px;
    line-height: 1.6;
}
