/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    touch-action: none;
}

/* 短视频页：页面底色（护眼深灰蓝），与中间纯黑播放区区分 */
body.is-short-mode {
    background: #1a2030;
    background: linear-gradient(165deg, #1e2433 0%, #181d28 42%, #141820 100%);
}

.is-short-mode .vp-main-short {
    flex: 1;
    min-height: 100vh;
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: transparent;
}

.is-short-mode #short-player {
    width: 100%;
    max-width: 450px;
    min-height: 100vh;
    margin: 0 auto;
}

/* ========== 视频容器（由 JS 挂载并添加此类名） ========== */
.short-video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-width: 450px;
    margin: 0 auto;
    background: #000;
    overflow: hidden;
    cursor: grab;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 12px 40px rgba(0, 0, 0, 0.35);
}

/* ========== 单个视频项 ========== */
.video-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-item video,
.video-item .short-video-iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    display: block;
    pointer-events: none;
}

/* iframe 模式：隐藏外层暂停按钮，底部只保留 mini 进度条 */
.video-item.is-iframe-mode .center-play-btn {
    display: none !important;
}

.video-item.is-iframe-mode .short-mini-progress {
    opacity: 1;
}

/* 底部 mini 进度条（橙红高亮） */
.short-mini-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    z-index: 12;
    background: rgba(255, 255, 255, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.short-mini-progress__fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ff9f43 0%, #ff5722 55%, #ff2d55 100%);
    box-shadow: 0 0 8px rgba(255, 87, 34, 0.75);
    transition: width 0.12s linear;
}

/* 透明手势层：接收滑动/点击，不阻挡右侧按钮 */
.swipe-layer {
    position: absolute;
    inset: 0;
    z-index: 8;
    background: transparent;
    pointer-events: auto;
    touch-action: none;
}
.video-item .video-info {
    pointer-events: none; /* 信息层不阻止点击 */
}
/* ========== 视频信息覆盖层 ========== */
.video-info {
    position: absolute;
    bottom: 80px;
    left: 20px;
    right: 60px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 10;
}

.video-info .title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.video-info .author {
    font-size: 14px;
    opacity: 0.85;
}

.video-info .desc {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-info .desc a {
    pointer-events: auto !important;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 11;
}

/* ========== 右侧操作按钮 ========== */
.action-buttons {
    position: absolute;
    right: 16px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 20;
    pointer-events: none;
}

.action-buttons .btn {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.action-buttons .btn:active {
    transform: scale(0.85);
}

.action-buttons .btn .icon {
    font-size: 32px;
    line-height: 1;
}

.action-buttons .btn .label {
    font-size: 12px;
    margin-top: 2px;
}

.action-buttons .btn .count {
    font-size: 12px;
    margin-top: 2px;
    opacity: 0.9;
}

/* ========== 加载状态 ========== */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 20px;
    display: none;
    pointer-events: none;
}
.action-stack {
    display: grid;
    place-items: center;
    gap: 4px;
    color: #fff;
    font-size: 12px
}
/* ========== 上滑提示（首次进入） ========== */
.swipe-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    z-index: 5;
    animation: bounceUp 1.5s ease-in-out infinite;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

@keyframes bounceUp {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    opacity: 0.5;
}

    50% {
        transform: translateX(-50%) translateY(-10px);
    opacity: 1;
}
}

/* ========== 底部进度条 ========== */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
    pointer-events: none;
}

.progress-bar .fill {
    height: 100%;
    width: 0%;
    background: #ff2d55;
    transition: width 0.1s linear;
}

/* ========== 响应式 ========== */
@media (max-width: 450px) {
.video-info .title {
        font-size: 16px;
    }

.action-buttons .btn .icon {
        font-size: 28px;
    }

.action-buttons {
        right: 12px;
        gap: 16px;
    }
}

.short-logo-ad {
    overflow: hidden;
    padding: 0;
    background: #0e1320
}
/* ========== 视频加载占位 ========== */
.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.video-placeholder .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff2d55;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== 修复：让视频不拦截点击 ========== */
.video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    display: block;
    pointer-events: none !important; /* ✅ 关键：让点击穿透到按钮 */
    position: relative;
    z-index: 2;
}

/* ========== 修复：按钮可点击 ========== */
.action-buttons {
    position: absolute;
    right: 16px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 9999 !important;
    pointer-events: auto !important;
}

.short-action {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    text-decoration: none;
    position: relative;
    z-index: 9999 !important;
    pointer-events: auto !important;
}

/* ========== 视频封面和占位图不拦截点击 ========== */
.video-cover,
.video-placeholder {
    pointer-events: none !important;
}

/* ========== 视频信息不拦截点击 ========== */
.video-info {
    pointer-events: none !important;
}

/* ==========================================
   中央播放/暂停按钮
   ========================================== */
.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    backdrop-filter: blur(4px);
}

.center-play-btn svg {
    width: 48px;
    height: 48px;
    fill: white;
    stroke: white;
    stroke-width: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* 暂停时显示 */
.center-play-btn.show {
    opacity: 1;
}

/* 播放时隐藏 */
.center-play-btn.hide {
    opacity: 0;
}

/* 点击动画 */
.center-play-btn.animate {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/*
视频封面
*/
.video-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 3;
    background: #1a1a1a;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
/**
占位图（加载动画
 */
.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
