* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    display: flex;
    flex-direction: column; /* 改为纵向排列 */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: Arial, sans-serif;
}

.page-title {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: normal;
    letter-spacing: 2px;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 750px; /* 限制最大宽度，模拟H5常见宽度 */
    aspect-ratio: 16 / 9; /* 保持视频比例 */
    background-color: #000;
    overflow: hidden;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 封面遮罩层 */
.video-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
    display: flex; /* 用于居中播放按钮 */
    justify-content: center;
    align-items: center;
    background-color: #000;
}

.cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8; /* 稍微暗一点，突显按钮 */
}

/* 播放按钮容器 */
.play-btn-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: transform 0.2s ease;
    z-index: 20;
}

/* 纯CSS绘制三角形播放图标 */
.play-btn {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #fff;
    margin-left: 5px; /* 光学调整居中视觉 */
}

.video-cover:active .play-btn-wrapper {
    transform: scale(0.95);
    background-color: rgba(0, 0, 0, 0.8);
}

/* 当视频开始播放后隐藏封面 */
.video-cover.hidden {
    display: none;
}

/* 强制横屏模式 (CSS Fallback) */
.video-container.landscape-force {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vh;
    height: 100vw;
    z-index: 9999;
    background: #000;
    /* 使用 translate3d 开启 GPU 加速，减少闪烁 */
    transform: translate3d(-50%, -50%, 0) rotate(90deg);
    max-width: none; /* 取消最大宽度限制 */
    aspect-ratio: auto; /* 取消比例限制，填满屏幕 */
}
/* 解决横屏下视频拉伸问题，保持比例居中 */
.video-container.landscape-force .video-player {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 保持比例，黑边填充 */
}

/* 横屏切换按钮 */
.landscape-control-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    font-size: 20px;
    border-radius: 50%;
    z-index: 30;
    cursor: pointer;
    display: flex; /* 默认显示 */
    justify-content: center;
    align-items: center;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.landscape-control-btn:active {
    background-color: rgba(0,0,0,0.8);
    transform: scale(0.9);
}

/* --- 新增：微信场景模拟样式 --- */
.wechat-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Fallback */
    bottom: 0; /* Ensures full height avoiding 100vh issues on mobile */
    background-color: #ededed;
    z-index: 100000; /* Ensure this is above everything including video player */
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.wechat-scene.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.wx-header {
    height: 44px;
    background-color: #ededed;
    border-bottom: 1px solid #dcdcdc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    color: #000;
    font-size: 16px;
    font-weight: 500;
    box-sizing: content-box; /* 修复 header 高度塌陷可能 */
    padding-top: 20px; /* Legacy padding */
    padding-top: max(20px, env(safe-area-inset-top)); /* 适配刘海屏 */
}

.wx-chat-area {
    flex: 1;
    padding: 20px 12px;
    overflow-y: hidden;
}

.wx-time {
    text-align: center;
    color: #cfcfcf;
    font-size: 12px;
    margin-bottom: 20px;
}

.wx-msg-row {
    display: flex;
    margin-bottom: 20px;
    opacity: 0; /* 初始隐藏，用于动画 */
    transform: translateY(20px);
}

.wx-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-color: #ccc;
    font-size: 12px;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.wx-content {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.wx-name {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.wx-bubble {
    background-color: #fff;
    border-radius: 6px;
    position: relative;
    font-size: 15px;
    line-height: 1.4;
    color: #000;
    padding: 10px;
    word-break: break-word; /* 防止长文本撑破布局 */
}
.wx-bubble::before {
    content: '';
    position: absolute;
    top: 14px;
    left: -6px;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #fff;
}

.wx-bubble.text {
    padding: 10px 12px;
}

.wx-bubble.video {
    padding: 0;
    background-color: transparent;
    overflow: hidden;
    width: 140px;
    height: 100px; /* 视频比例 */
    border-radius: 6px;
    position: relative;
    border: 1px solid #ccc;
}
.wx-bubble.video::before { display: none; } /* 视频气泡不需要小三角覆盖图片 */

.wx-video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wx-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    border: 1px solid #fff;
}
.wx-play-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-30%, -50%);
    border-left: 10px solid #fff;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* 消息出现动画 */
.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0; /* 默认隐藏，防止闪烁 */
}

/* 0.5秒出现第一条 */
.delay-1 { animation-delay: 0.5s; }

/* 1.5秒出现视频 (间隔1秒) */
.delay-2 { animation-delay: 1.5s; }

/* 3.0秒出现舅舅的消息 (间隔1.5秒，模拟看完视频缩略图后的回复) */
.delay-3 { animation-delay: 3.0s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 手指动画 */
.hand-cursor {
    position: absolute;
    font-size: 40px;
    left: 50%;
    top: 100%; /* 初始在屏幕外 */
    opacity: 0;
    pointer-events: none;
    z-index: 100001;
    transition: transform 0.2s ease;
    will-change: left, top, transform, opacity; /* 性能优化 */
}

/* 之前定义的 keyframes handMoveAndClick 未被使用，JS 接管了动画控制，故删除以避免混淆 */
