/* 全局重置 + 卡通风格背景 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', 'Chalkboard SE', '幼圆', 'Yuanti SC', 'Segoe UI', cursive, sans-serif;
}

body {
    background: #ffefc0;
    background-image: radial-gradient(circle at 20% 30%, #ffe9a7 0%, #ffd98c 60%, #ffc46b 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.2rem 2.5rem 3rem;
    position: relative;
    overflow-x: hidden;
}

/* 漂浮装饰 */
body::before {
    content: "☁️";
    position: fixed;
    top: 20px;
    left: 25px;
    font-size: 7rem;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    animation: float 8s infinite alternate ease-in-out;
}

body::after {
    content: "🌟";
    position: fixed;
    bottom: 20px;
    right: 25px;
    font-size: 6.5rem;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
    animation: float 11s infinite alternate-reverse;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-22px) rotate(5deg); }
}

/* 页面主标题 */
.page-title {
    font-size: 3.8rem;
    font-weight: 900;
    color: #ff6b9d;
    text-shadow: 6px 6px 0 #ffe16b, 8px 8px 0 rgba(0, 0, 0, 0.08);
    margin-bottom: 2.6rem;
    text-align: center;
    letter-spacing: 3px;
    -webkit-text-stroke: 2.5px #fff3c9;
    position: relative;
    z-index: 2;
}

/* 视频网格容器 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem 1.8rem;
    width: 100%;
    max-width: 100%;
    padding: 0 0.5rem;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* 单个视频卡片 */
.video-card {
    background: #ffffff;
    border-radius: 36px;
    overflow: hidden;
    box-shadow: 0 9px 0 #c29b6b, 0 15px 22px -9px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 6px solid #fff8e0;
    outline: none;
    position: relative;
}

.video-card:nth-child(odd) {
    transform: rotate(0.5deg);
}

.video-card:nth-child(even) {
    transform: rotate(-0.5deg);
}

/* 聚焦状态 */
.video-card:focus,
.video-card:focus-visible {
    transform: scale(1.05) rotate(0deg);
    border-color: #ffd966;
    box-shadow: 0 0 0 7px #ffb347, 0 0 0 14px #fff3b0, 0 22px 35px -7px #a57c4b;
    transition: all 0.1s ease;
    z-index: 10;
}

/* 正在播放的卡片高亮 */
.video-card.playing-now {
    border-color: #5d9eff;
    box-shadow: 0 0 0 7px #5d9eff, 0 0 0 14px #b3d4ff, 0 22px 35px -7px #3b6ea5;
    animation: cardGlow 2s infinite;
}

@keyframes cardGlow {
    0% { box-shadow: 0 0 0 7px #5d9eff, 0 0 0 14px #b3d4ff, 0 22px 35px -7px #3b6ea5; }
    50% { box-shadow: 0 0 0 7px #7eb8ff, 0 0 0 18px #d6e8ff, 0 22px 35px -7px #3b6ea5; }
    100% { box-shadow: 0 0 0 7px #5d9eff, 0 0 0 14px #b3d4ff, 0 22px 35px -7px #3b6ea5; }
}

/* 缩略图区域 */
.thumbnail {
    position: relative;
    background: #b1e6ff;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 6px solid #ffd966;
    overflow: hidden;
}

.thumbnail::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #a1d6ff, #ffb3d1, #ffdd9a);
    opacity: 0.9;
    z-index: 0;
}

/* 播放图标 */
.play-icon {
    position: relative;
    z-index: 3;
    width: 84px;
    height: 84px;
    background: #fff6d5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 0 #b38b5b, 0 9px 18px rgba(0, 0, 0, 0.2);
    transition: background 0.2s, box-shadow 0.2s;
    border: 4.5px solid #ffffff;
}

.play-icon::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-top: 19px solid transparent;
    border-bottom: 19px solid transparent;
    border-left: 30px solid #ff6b9d;
    margin-left: 7px;
    filter: drop-shadow(1.5px 1.5px 0 #c44b7a);
}

.video-card:focus .play-icon {
    background: #fff3b0;
    box-shadow: 0 0 0 6px #ffe16b, 0 9px 18px #a57c4b;
    transform: scale(1.05);
}

.video-card.playing-now .play-icon::after {
    border-left-color: #5d9eff;
    animation: speakerPulse 0.8s infinite alternate;
}

@keyframes speakerPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

/* 视频标题 */
.video-title {
    padding: 1rem 1.2rem 1.3rem;
    background: #fffef7;
    font-size: 1.65rem;
    font-weight: 700;
    color: #d14b7e;
    line-height: 1.3;
    text-align: center;
    text-shadow: 1.5px 1.5px 0 #ffe9a7;
    border-top: 4.5px solid #ffd966;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 全屏播放层 ---------- */
.fullscreen-player {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-player.active {
    display: flex;
    opacity: 1;
}

.fullscreen-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    outline: none;
}

.fullscreen-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.8rem 3rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-player:hover .fullscreen-header,
.fullscreen-player.show-header .fullscreen-header {
    opacity: 1;
}

.fullscreen-title {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 3px 3px 0 #d14b7e, 6px 6px 12px rgba(0, 0, 0, 0.8);
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.fullscreen-close {
    background: #ff6b6b;
    color: white;
    font-size: 2.7rem;
    font-weight: 900;
    width: 81px;
    height: 81px;
    border-radius: 50%;
    border: 6px solid #fff3c9;
    box-shadow: 0 7.5px 0 #b33b3b, 0 10px 27px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, box-shadow 0.1s;
    pointer-events: auto;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    z-index: 2200;
    flex-shrink: 0;
}

.fullscreen-close:active {
    transform: translateY(4.5px);
    box-shadow: 0 3px 0 #b33b3b, 0 10px 27px rgba(0, 0, 0, 0.5);
}

.fullscreen-close:focus-visible {
    outline: 6px solid #ffd966;
}

.fullscreen-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.7rem 3rem 3.3rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 2100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-player:hover .fullscreen-footer,
.fullscreen-player.show-header .fullscreen-footer {
    opacity: 1;
}

.fullscreen-next-hint {
    font-size: 2.1rem;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 179, 71, 0.95);
    padding: 1rem 2.7rem;
    border-radius: 90px;
    border: 6px solid #fff6d5;
    box-shadow: 0 7.5px 0 #b36b1e, 0 12px 30px rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    gap: 0.9rem;
    pointer-events: none;
    text-shadow: 1.5px 1.5px 0 #b36b1e;
}

.fullscreen-next-hint.show {
    display: flex;
    animation: bounceIn 0.4s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.countdown-num {
    display: inline-block;
    background: #ff6b9d;
    color: white;
    width: 3.3rem;
    height: 3.3rem;
    line-height: 3.3rem;
    text-align: center;
    border-radius: 50%;
    font-weight: 900;
    font-size: 1.95rem;
    box-shadow: 0 4.5px 0 #b33b6b;
    margin: 0 0.3rem;
}

.fullscreen-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 6rem;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.5);
    width: 165px;
    height: 165px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2150;
    border: 7.5px solid rgba(255, 255, 255, 0.3);
}

.fullscreen-status.show {
    opacity: 1;
}

/* ---------- 大屏适配：1920px以上一行显示更多 ---------- */
@media (min-width: 1920px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
        gap: 1.8rem 1.8rem;
    }
    .video-title {
        font-size: 1.5rem;
        padding: 0.75rem 0.75rem 1rem;
    }
    .play-icon {
        width: 72px;
        height: 72px;
    }
    .play-icon::after {
        border-top: 16.5px solid transparent;
        border-bottom: 16.5px solid transparent;
        border-left: 25.5px solid #ff6b9d;
        margin-left: 6px;
    }
    .page-title {
        font-size: 3.6rem;
        margin-bottom: 2.1rem;
    }
    body {
        padding: 1.5rem 2.2rem 2.2rem;
    }
}

/* 超宽屏 (2560px以上) */
@media (min-width: 2560px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2.1rem;
    }
    .video-title {
        font-size: 1.72rem;
        padding: 1rem 1.2rem 1.3rem;
    }
    .play-icon {
        width: 84px;
        height: 84px;
    }
    .play-icon::after {
        border-top: 19px solid transparent;
        border-bottom: 19px solid transparent;
        border-left: 30px solid #ff6b9d;
        margin-left: 7px;
    }
}

/* 小屏适配 */
@media (max-width: 800px) {
    body {
        padding: 1.5rem 1.5rem 2.2rem;
    }
    .page-title {
        font-size: 3rem;
        margin-bottom: 1.8rem;
    }
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
        gap: 1.35rem;
    }
    .play-icon {
        width: 66px;
        height: 66px;
    }
    .play-icon::after {
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        border-left: 22.5px solid #ff6b9d;
        margin-left: 6px;
    }
    .video-title {
        font-size: 1.35rem;
        padding: 0.75rem 0.75rem 1rem;
    }
    .fullscreen-close {
        width: 69px;
        height: 69px;
        font-size: 2.25rem;
    }
    .fullscreen-title {
        font-size: 1.65rem;
    }
    .fullscreen-next-hint {
        font-size: 1.5rem;
        padding: 0.6rem 1.5rem;
    }
    .fullscreen-status {
        width: 120px;
        height: 120px;
        font-size: 4.2rem;
    }
}

.video-card:active {
    transform: scale(0.98);
}

.video-card {
    -webkit-tap-highlight-color: transparent;
}