﻿/* play.css - 优化后的完整样式 */
/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    color: #fff;
    width: 100%;
    height: 100%;
}

/* ========== 主容器 ========== */
.short-video-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 420px;
    max-height: 880px;
    background: #0a0a0a;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -8px rgba(0, 0, 0, 0.8);
    aspect-ratio: 9/16;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .short-video-container {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        aspect-ratio: auto;
        height: 100vh;
        height: 100dvh;
        width: 100vw;
    }
}

/* ========== 视频卡片 ========== */
.video-slide {
    position: absolute;
    inset: 0;
    background: #000;
}

    .video-slide video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        background: #000;
    }

/* ========== 顶部菜单 ========== */
.top-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, transparent 100%);
}

.logo {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    font-weight:bold;
}

    .nav-menu a {
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        transition: color 0.2s;
        white-space: nowrap;
    }

.active {
    color: #fff;
}

        .nav-menu a.active span,
        .nav-menu a:hover span {
            color: #fff;
            font-weight: 700;
            position: relative;
        }

            .nav-menu a.active span::after {
                content: '';
                position: absolute;
                bottom: -4px;
                left: 0;
                right: 0;
                height: 2px;
                background: #00d4ff;
                border-radius: 2px;
                box-shadow: 0 0 8px #00d4ff;
            }

/* ========== 右侧互动栏（点赞 / 收藏） ========== */
.action-bar {
    position: absolute;
    right: 10px;
    bottom: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s;
    gap: 2px;
}

    .action-item:active {
        transform: scale(0.9);
    }

.action-icon {
    font-size: 30px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.action-count {
    font-size: 12px;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.3px;
}

/* ========== 底部信息 ========== */
.video-info {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 20px 14px calc(24px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.video-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.3;
}

.video-desc {
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 92%;
}

.bottom-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    flex-wrap: wrap;
}

.episode-select {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

    .episode-select:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .episode-select .menu-icon {
        font-size: 16px;
        opacity: 0.9;
    }

.episode-count {
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 2px;
}

/* ========== 播放按钮（居中） ========== */
.play-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 8;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

    .play-center.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .play-center::after {
        content: '▶';
        font-size: 28px;
        color: #fff;
        margin-left: 4px;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

/* ========== 进度条（快进） ========== */
.progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 0 calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 25;
    cursor: pointer;
    touch-action: none;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    transition: height 0.2s;
    border-radius: 2px;
}

.progress-container:hover .progress-bar,
.progress-container.dragging .progress-bar {
    height: 5px;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #00d4ff;
    border-radius: 2px;
    box-shadow: 0 0 8px #00d4ff;
    pointer-events: none;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: #00d4ff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.2s;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.8);
    pointer-events: none;
    border: 2px solid #fff;
}

.progress-container:hover .progress-thumb,
.progress-container.dragging .progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

.time-tooltip {
    position: absolute;
    top: -28px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.progress-container:hover .time-tooltip,
.progress-container.dragging .time-tooltip {
    opacity: 1;
}

/* ========== 加载动画 ========== */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 0.9s infinite;
    z-index: 100;
    display: none;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ========== 轻提示 ========== */
.auto-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 40px;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    max-width: 80%;
    text-align: center;
}

    .auto-toast.show {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

/* ========== 倍速按钮（选集右侧） ========== */
.speed-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 12px;
    height: 28px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.15);
    outline: none;
    font-family: inherit;
    flex-shrink: 0;
}

    .speed-btn:active {
        transform: scale(0.94);
        background: rgba(255, 255, 255, 0.25);
    }

/* ========== 选集弹窗 ========== */
.episode-popup {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #1a1a1a;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px calc(30px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    max-height: 60vh;
    max-height: 60dvh;
    display: flex;
    flex-direction: column;
}

    .episode-popup.show {
        transform: translateY(0);
    }

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.popup-header-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.popup-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.popup-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    user-select: none;
}

    .popup-close:active {
        background: rgba(255, 255, 255, 0.1);
    }

.episode-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

.episode-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
    border-radius: 10px;
    background: #2a2a2a;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

    .episode-item.active {
        background: #00d4ff;
        color: #000;
        font-weight: 700;
    }

    .episode-item.locked {
        color: rgba(255, 255, 255, 0.35);
        background: #222;
    }

        .episode-item.locked::after {
            content: '🔒';
            position: absolute;
            top: 3px;
            right: 4px;
            font-size: 11px;
            opacity: 0.8;
        }

.popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
}

    .popup-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

/* ========== 解锁弹窗（播完自动弹出） ========== */
.unlock-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
}

    .unlock-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

.unlock-popup {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}

.unlock-close {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top, 0px));
    right: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    user-select: none;
    line-height: 1;
}

    .unlock-close:active {
        background: rgba(255, 255, 255, 0.1);
    }

.unlock-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    max-width: 340px;
}

/* 钻石造型 */
.unlock-diamond {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.diamond-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 200, 80, 0.5) 0%, rgba(255, 200, 80, 0.15) 40%, transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    animation: pulseGlow 2.4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        opacity: 0.85;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.diamond-shape {
    position: relative;
    width: 120px;
    height: 110px;
    background: linear-gradient(135deg, #ffd66b 0%, #f5a623 45%, #c77b1a 100%);
    clip-path: polygon(20% 0%, 80% 0%, 100% 35%, 50% 100%, 0% 35%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(245, 166, 35, 0.45), inset 0 0 30px rgba(255, 255, 255, 0.3);
}

    .diamond-shape::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, transparent 35%);
        clip-path: polygon(20% 0%, 80% 0%, 100% 35%, 50% 100%, 0% 35%);
    }

    .diamond-shape::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 30%;
        height: 2px;
        background: rgba(0, 0, 0, 0.15);
        transform: translate(-50%, -50%) rotate(-15deg);
        border-radius: 50%;
        opacity: 0.5;
    }

.diamond-v {
    position: relative;
    z-index: 2;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 22px 0 22px 34px;
    border-color: transparent transparent transparent #3a2412;
    filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.4));
    transform: rotate(-3deg);
}

.unlock-title {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(180deg, #ffe08a 0%, #ffb43c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.3;
    margin-top: 6px;
    filter: drop-shadow(0 2px 8px rgba(255, 180, 60, 0.4));
}

.unlock-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 2px;
    text-align: center;
    margin-top: 2px;
}

.unlock-btn {
    margin-top: 30px;
    width: 78%;
    max-width: 300px;
    padding: 15px 0;
    border-radius: 40px;
    border: none;
    background: linear-gradient(90deg, #ffb43c 0%, #ff9a1e 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 154, 30, 0.4);
    transition: transform 0.15s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
}

    .unlock-btn:active {
        transform: scale(0.96);
        box-shadow: 0 6px 20px rgba(255, 154, 30, 0.5);
    }


/* ========== 解锁弹窗 VIP 图片 ========== */
.unlock-vip-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(255, 200, 80, 0.5));
    animation: pulseGlow 2.4s ease-in-out infinite;
}

/* 移动端小屏适配 */
@media (max-width: 380px) {
    .unlock-vip-img {
        width: 120px;
        height: 120px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .unlock-vip-img {
        width: 100px;
        height: 100px;
    }
}

/* ========== 解锁按钮改为链接 ========== */
.unlock-btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    width: 78%;
    max-width: 300px;
    padding: 15px 0;
    border-radius: 40px;
    border: none;
    background: linear-gradient(90deg, #ffb43c 0%, #ff9a1e 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(255, 154, 30, 0.4);
    transition: transform 0.15s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

    .unlock-btn-link:active {
        transform: scale(0.96);
        box-shadow: 0 6px 20px rgba(255, 154, 30, 0.5);
    }

/* 小屏适配 */
@media (max-width: 380px) {
    .unlock-btn-link {
        font-size: 15px;
        padding: 12px 0;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .unlock-btn-link {
        margin-top: 16px;
        padding: 10px 0;
        font-size: 14px;
    }
}

/* ========== 播放器移动端宽度优化 ========== */
/* 移动端默认占满宽度，不裁切画面 */
@media (max-width: 600px) {
    .short-video-container {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        aspect-ratio: auto;
        height: 100vh;
        height: 100dvh;
        width: 100vw;
        margin: 0;
    }
}

/* 桌面端保持居中卡片样式 */
@media (min-width: 601px) {
    .short-video-container {
        max-width: 420px;
        max-height: 880px;
        border-radius: 24px;
        aspect-ratio: 9/16;
        margin: 0 auto;
    }
}