/* ============================================================
   Emoji 禁用规则（强制，详见 docs/页面模块创建规范.md）
   空白字体接管 U+1F000-1FAFF emoji 区段（📖🏠🎬🔥 等），与 style.css 中规则保持一致；
   ✓ ✗ ❌ ✅ ★ 等普通符号不在覆盖区段内，不受影响。
   ============================================================ */
@font-face { font-family: 'XD Emoji Block'; src: url('../fonts/emoji-blank.woff2') format('woff2'); font-display: block; unicode-range: U+1F000-1FAFF; }
@font-face { font-family: 'Apple Color Emoji'; src: url('../fonts/emoji-blank.woff2') format('woff2'); font-display: block; unicode-range: U+1F000-1FAFF; }
@font-face { font-family: 'Segoe UI Emoji'; src: url('../fonts/emoji-blank.woff2') format('woff2'); font-display: block; unicode-range: U+1F000-1FAFF; }
@font-face { font-family: 'Noto Color Emoji'; src: url('../fonts/emoji-blank.woff2') format('woff2'); font-display: block; unicode-range: U+1F000-1FAFF; }

/* ============================================================
   X-Dream CMS - 短视频板块专用样式
   模拟快手沉浸式竖屏视频流
   ============================================================ */

/* ========== 短视频列表页 - 瀑布流网格布局 ========== */
.video-page {
    background: var(--video-bg, #0f0f1a);
    min-height: 100vh;
}
.video-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* PC端一行6列 */
    gap: 12px;
    padding: 12px;
    max-width: 1400px;
    margin: 0 auto;
}
.video-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a2e;
    cursor: pointer;
    transition: transform .2s;
    /* 扑克牌比例约束（宽:高 = 1 : 1.4，竖版卡片） */
    aspect-ratio: 1 / 1.4;
}
.video-card:active {
    transform: scale(0.98);
}
.video-card-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
}
.video-card-thumb img,
.video-card-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.video-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 8px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
}
.video-card-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
}
.video-card-author {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
}
.video-card-author img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.video-card-author span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60px;
}
.video-card-stats {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.video-card-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}
.video-card-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
}

/* 加载更多 */
.video-load-more {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 14px;
}

/* 沉浸式播放器 */
.video-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--video-bg, #000);
    z-index: 9999;
    overflow: hidden;
    touch-action: pan-y;
}
.video-player-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.video-slide-track {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform .3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.video-slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.video-slide-item video {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    object-fit: contain;
    display: block;
}

/* 播放控制 */
.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    /* 隐藏态彻底退出命中测试与渲染合成：
       修复播放中按钮卡在视频中央造成的点击拦截与播放卡顿 */
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s, visibility .2s;
}
.video-play-btn.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 右侧操作栏 */
.video-actions {
    position: absolute;
    right: 12px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 20;
}
.video-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.video-action-btn .icon {
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    backdrop-filter: blur(4px);
}
.video-action-btn.liked .icon {
    background: rgba(231, 76, 60, 0.5);
}
/* 评论按钮是 <a>（点击跳转动态详情）：必须显式锁定白色与无下划线。
   全局 style.css 的 a{color:var(--primary)} / a:hover{color:var(--primary-dark)}
   会把它和它的内联子元素染色成主题紫，与点赞/分享/播放次数/音量的白色图标
   不一致（且深色视频背景上对比度明显偏低）。此处优先级(0,3,1)高于 a:hover(0,1,1)。 */
.video-actions a.video-action-btn,
.video-actions a.video-action-btn:hover {
    color: #fff;
    text-decoration: none;
}

/* 底部信息 */
.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 16px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    z-index: 20;
}
.video-info-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}
.video-info-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-info-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.video-info-author img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}

/* 顶部导航 */
.video-player-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 30;
    background: linear-gradient(rgba(0,0,0,0.4), transparent);
}
.video-player-header .back-btn {
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.2);
}
.video-player-header .title {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

/* 进度条 */
.video-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.2);
    z-index: 25;
}
.video-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width .1s linear;
}

/* 滑动提示 */
.video-swipe-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
    z-index: 40;
}
.video-swipe-hint.show {
    opacity: 1;
}

/* 空状态 */
.video-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}
.video-empty p {
    font-size: 15px;
    margin-bottom: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
    .video-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }
    .video-card {
        border-radius: 6px;
    }
    .video-card-title {
        font-size: 11px;
    }
    .video-card-meta {
        font-size: 10px;
    }
    .video-card-play-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .video-card-overlay {
        padding: 30px 6px 6px;
    }
    .video-actions {
        right: 8px;
        bottom: 80px;
        gap: 12px;
    }
    .video-action-btn .icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .video-info {
        padding: 40px 12px 16px;
    }
    .video-info-title {
        font-size: 15px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .video-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px;
    }
}

/* 矮视口（横屏手机 / 小窗）：右侧操作栏为「点赞/评论/分享/播放次数/音量」5 键竖排，
   默认尺寸下总高约 340px，底边距 80px，横屏（视口高 ~375px）会顶出视口上沿；
   统一压缩圆底尺寸、间距与文字后总高约 280px，完整可见且仍与其它按钮对齐。 */
@media (max-height: 480px) {
    .video-actions {
        bottom: 62px;
        gap: 8px;
    }
    .video-action-btn {
        font-size: 11px;
    }
    .video-action-btn .icon {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }
}

/* 未付费蒙版左上角：当前视频累计销售额度（数值来自服务端 getTargetSalesMap 聚合的
   total_sales，前端不写死）。外观（胶囊底/金色数字）统一由全站 style.css 的
   .token-sales-badge 提供，这里只负责本页面的定位。
   注意：蒙版铺满整屏，其几何左上角被顶部导航占用（.video-player-header 为
   z-index:30，返回键占 top:12~48px / left:16~52px），故徽标下移到导航栏之下
   （top:58px），仍处于蒙版左上区域且不被返回键遮挡。 */
.video-token-sales {
    position: absolute;
    top: 58px;
    left: 10px;
}

/* 矮视口（横屏手机 / 小窗）：上移销售额度徽标，避免与顶部导航争高 */
@media (max-height: 480px) {
    .video-token-sales {
        top: 54px;
        left: 8px;
    }
}

/* 点赞动画 */
@keyframes heartBurst {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.video-action-btn.like-anim .icon {
    animation: heartBurst .3s ease;
}
