* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 0px;
}

.main-container {
    display: flex;
    max-width: 100%;
    margin: 0 auto;
    padding-left: 50px;
    padding-right: 50px;
    justify-content: center;
    min-width: 0; /* 允许 flex 在窄视口下收缩，避免左右滚动 */
}

/* 左侧视频播放区域：宽度随窗口动态变化，且不超出视口
 * - 窗口宽度变化：flex: 1 + min-width: 0，占据「视口 − sidebar − 边距」的剩余空间，随之变窄/变宽
 * - 窗口高度变化：max-width: calc((100vh - 0px) * 16 / 9)，高度变矮时限制宽度
 * 不再用 width: min(100%, ...)，否则 100% 相对整行导致 总宽 = 视口 + sidebar 而溢出
 */
.video-section {
    flex: 1;
    min-width: 0;
    max-width: calc((100vh - 0px) * 16 / 9);
    padding-top: 12px;
    margin-left: 16px;
    padding-right: 16px;
}

/* 视频播放器父容器 - 16:9 比例，在 video-section 内水平居中 */
.video-player-container {
    width: min(100%, calc((100vh - 0px) * 16 / 9));
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: calc(100vh - 0px);
    margin-left: auto;
    margin-right: auto;
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

#ad-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#ad-container .ad-loading {
    position: absolute;
    inset: 0;
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    z-index: 1;
    color: #fff;
}

#ad-container .ad-loading.is-active {
    display: flex;
}

#ad-container .ad-loading .loading-spinner {
    display: block;
    width: 48px;
    height: 48px;
    border-width: 4px;
}

#ad-container .ad-loading-text {
    font-size: 16px;
    color: #fff;
}

/* 视频播放器 - 9:16 比例，高度撑满父容器 */
.video-player {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

/* 模糊背景画布：铺满容器，位于视频下方 */
#video-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.video-player video,
.video-player .video-placeholder {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    aspect-ratio: 9 / 16;
}

/* 覆盖 TCPlayer 在 #video-player 元素上添加的类 - 这是关键！ */
/* TCPlayer 默认设置 video-js { width: 300px; height: 150px; } */
/* TCPlayer 默认设置 video-player-dimensions { width: 56.25px; height: 100px; } */
/* 我们需要覆盖这些固定尺寸，让它使用 100% 和 aspect-ratio */
#video-player,
#video-player.video-js,
#video-player.video-player-dimensions,
#video-player.video-js.video-player-dimensions,
#video-player.tcplayer,
#video-player.tcplayer.video-js,
#video-player.tcplayer.video-player-dimensions,
#video-player.tcplayer.video-js.video-player-dimensions {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 9/16 !important;
    display: block !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    /* 覆盖 TCPlayer 默认的 300x150 和 56.25x100 尺寸 */
    min-width: 0 !important;
    min-height: 0 !important;
}

/* 覆盖 TCPlayer 的 fluid 和尺寸类 */
#video-player.video-js.vjs-16-9,
#video-player.video-js.vjs-4-3,
#video-player.video-js.vjs-fluid,
#video-player.video-player-dimensions.vjs-16-9,
#video-player.video-player-dimensions.vjs-4-3,
#video-player.video-player-dimensions.vjs-fluid,
#video-player.tcplayer.vjs-16-9,
#video-player.tcplayer.vjs-4-3,
#video-player.tcplayer.vjs-fluid {
    width: 100% !important;
    height: 100% !important;
    padding-top: 0 !important;
    aspect-ratio: 9/16 !important;
}

/* 覆盖 TCPlayer 可能设置的固定高度 */
#video-player.video-js[style*="height"],
#video-player.video-player-dimensions[style*="height"] {
    height: 100% !important;
}

/* 覆盖 TCPlayer 可能设置的固定宽度 */
#video-player.video-js[style*="width"],
#video-player.video-player-dimensions[style*="width"] {
    width: 100% !important;
}

/* TCPlayer 容器样式 */
#player-container {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1; /* 确保视频在模糊背景上方 */
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 9/16;
}

/* 桌面端：宽度自动，高度撑满，最大宽度限制 */
@media (min-width: 769px) {
    #player-container {
        aspect-ratio: 9/16;
        width: auto;
        height: 100%;
        max-width: 56.25vh; /* 9/16 * 100vh */
    }
}

/* 移动端：宽度和高度都撑满 */
@media (max-width: 768px) {
    #player-container {
        aspect-ratio: 9/16;
        width: 100%;
        height: 100%;
    }
}

/* video 元素样式 */
.video-player video,
.video-player .video-placeholder,
#player-container video,
#video-player video,
#video-player .vjs-tech {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    aspect-ratio: 9 / 16 !important;
    margin: 0 auto;
    display: block;
}

/* 确保 TCPlayer 创建的 video 元素也应用样式 */
#player-container > video,
#video-player > video,
#video-player_html5_api {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 9 / 16 !important;
}

/* 覆盖 TCPlayer 内部可能添加的尺寸样式 */
.video-player.video-js .video-js-dimensions,
.video-player.video-player-dimensions .video-js-dimensions {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 9 / 16 !important;
}

/* TCPlayer 的 prism-player 容器样式 */
#player-container .prism-player {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* 覆盖 TCPlayer 可能添加的所有尺寸相关样式 */
.video-player.video-js *,
.video-player.video-player-dimensions * {
    box-sizing: border-box;
}

/* 确保 TCPlayer 不会覆盖我们的 aspect-ratio */
.video-player.video-js,
.video-player.video-player-dimensions,
.video-player.video-js.video-player-dimensions {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    /* 覆盖 TCPlayer 可能设置的固定尺寸 */
    max-width: 100vw !important;
    max-height: 100vh !important;
}

/* 覆盖 TCPlayer 的 fluid 和尺寸类 */
.video-player.video-js.vjs-16-9,
.video-player.video-js.vjs-4-3,
.video-player.video-js.vjs-fluid,
.video-player.video-player-dimensions.vjs-16-9,
.video-player.video-player-dimensions.vjs-4-3,
.video-player.video-player-dimensions.vjs-fluid {
    width: 100% !important;
    height: 100% !important;
    padding-top: 0 !important;
    aspect-ratio: 9/16 !important;
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
}

/* 视频控制栏 - 覆盖在播放器底部 */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 66px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0), transparent);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 16px 10px 16px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 当鼠标悬停在视频容器上时显示控制栏 */
.video-player-container:hover .video-controls {
    opacity: 1;
}

/* 进度条 */
.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

/* 拖拽状态 */
.progress-bar-container.dragging {
    cursor: grabbing;
}

.progress-bar-container.dragging .progress-bar-thumb {
    cursor: grabbing;
}

/* 缓冲条 */
.buffer-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 60%; /* 缓冲进度示例 */
    background: #FFFFFF;
    border-radius: 3px;
    z-index: 1;
}

/* 播放进度条 */
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%; /* 初始值为0，由JavaScript动态更新 */
    background: #FF4463;
    border-radius: 3px;
    transition: width 0.1s ease;
    z-index: 2;
}

/* 进度条滑块 */
.progress-bar-thumb {
    position: absolute;
    top: 50%;
    left: 0%; /* 初始值为0，与进度条宽度一致 */
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #FF133A;
    border-radius: 50%;
    z-index: 3;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: left 0.1s ease;
}

/* 控制按钮区域 */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    opacity: 0.8;
}

.control-btn.muted {
    opacity: 0.7;
}

.control-btn i {
    font-size: 16px;
}

.play-pause-btn {
    font-size: 20px;
}

.time-display {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.speed-control {
    font-size: 14px;
    cursor: pointer;
}

/* 倍速菜单样式 */
.playback-rate-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 4px;
    padding: 8px 0;
    margin-bottom: 8px;
    min-width: 80px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.playback-rate-menu.show {
    display: block;
}

.playback-rate-item {
    padding: 8px 16px;
    cursor: pointer;
    color: #fff;
    text-align: center;
    transition: background 0.2s;
}

.playback-rate-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.playback-rate-item.active {
    background: rgba(255, 68, 99, 0.3);
    color: #FF4463;
}

.volume-control {
    font-size: 18px;
}

.fullscreen-btn {
    font-size: 16px;
}

/* 视频信息区域 */
.video-info {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.episode-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    flex: 1;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    background: #25D366;
    color: #fff;
    padding: 0px 10px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.whatsapp-btn:hover {
    background: #20BA5A;
}

.whatsapp-icon {
    width: 12px;
    height: 12px;
}

/* 广告横幅 */
.ad-banner {
    position: absolute;
    z-index: 1;
    width: 100%;
    background: #fff;
    color: #000;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 24px;
}

.ad-banner .ad-title {
    font-size: 32px;
    margin-bottom: 8px;
}

.ad-banner .ad-subtitle {
    font-size: 14px;
    color: #666;
}

.ad-banner-slot {
    min-height: 100px;
}

/* 右侧边栏 */
.sidebar {
    width: 418px;
    flex-shrink: 0;
    padding-right: 16px;
    padding-top: 12px;
    position: relative;
}

.sidebar-banner {
    flex-shrink: 0;
    position: relative;
}

/* 侧栏主内容：剧集 + 推荐垂直排列，与广告区顶部对齐；margin-top: 300px 留出顶部给广告覆盖 */
.sidebar-main {
    margin-top: 310px;
    display: flex;
    flex-direction: column;
}

/* 广告横幅：覆盖在 abc 上方，顶部与 abc 对齐，占 300px 高 */
.sidebar-ad-zone {
    position: absolute;
    top: 12px; /* 与 sidebar 内容区顶部对齐（padding-top: 12px） */
    left: 0;
    right: 16px; /* 与 sidebar 内容区右对齐（padding-right: 16px） */
    min-height: 300px;
    z-index: 1;
}

.sidebar-ad {
    margin-bottom: 20px;
}

.sidebar-ad-slot {
    min-height: 300px;
    position: relative;
}

/* 剧集选择区域 */
.episodes-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fff;
}

/* 分页按钮 */
.episode-pagination {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 6px 12px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.page-btn:hover {
    opacity: 0.8;
}

.page-btn.active {
    color: #FF4463;
}

/* 选中状态的下划线 */
.page-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 2px;
    background: #FF4463;
}

/* 剧集网格 */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.episode-btn {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    /* border: 1px solid rgba(255, 255, 255, 0.2); */
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.episode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.episode-btn.active {
    background: #FF4463;
    border-color: #FF4463;
    color: #fff;
    position: relative;
}

/* 播放动画 - 三条竖线 */
.episode-btn .equalizer {
    display: none;
}

.episode-btn.active .equalizer {
    display: flex;
    position: absolute;
    bottom: 4px;
    left: 4px;
    align-items: flex-end;
    gap: 2px;
    width: 16px;
    height: 12px;
}

.equalizer-bar {
    width: 3px;
    background: #fff;
    border-radius: 1px;
    animation: equalizer 1s ease-in-out infinite;
}

.equalizer-bar:nth-child(1) {
    animation-delay: 0s;
}

.equalizer-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.equalizer-bar:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes equalizer {
    0%, 100% {
        height: 40%;
    }
    50% {
        height: 100%;
    }
}

/* 推荐视频区域 */
.recommended-section {
    margin-top: 24px;
}

.recommended-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommended-item {
    display: flex;
    gap: 12px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.recommended-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.recommended-thumbnail {
    width: 162px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 背景图片通过 JS 动态设置 background-image */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* 毛玻璃效果层 - 使用伪元素实现 */
.recommended-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3); /* 半透明黑色遮罩，增强毛玻璃效果 */
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-radius: 8px;
    z-index: 1;
}

/* 封面图片样式 - 显示在毛玻璃层之上 */
.recommended-thumbnail img {
    width: 110px;               /* 固定宽度 110px */
    height: auto;               /* 高度自适应，超过 90px 的部分上下被裁剪 */
    display: block;
    object-fit: cover;          /* 纵横比异常时仍然尽量填满宽度 */
    object-position: center center; /* 居中显示 */
    position: relative;         /* 确保 z-index 生效 */
    z-index: 2;                 /* 显示在毛玻璃层（z-index: 1）之上 */
}

.recommended-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recommended-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    color: #fff;
    line-height: 1.4;
}

.recommended-episode {
    font-size: 12px;
    color: #999;
}

/* 推荐列表加载更多容器 */
.loading-container {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}

/* Loading 动画 */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #FF4463;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none; /* 默认隐藏 */
}

.loading-container.loading .loading-spinner {
    display: block; /* 加载时显示 */
}

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

/* 暂停按钮样式 - 覆盖在播放器上居中显示 */
.custom-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 101;
}

.custom-play-button .play-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.custom-play-button .play-icon:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.custom-play-button .play-icon i {
    font-size: 24px;
    color: #fff;
    margin-left: 4px; /* 微调播放图标位置，让它看起来更居中 */
}

/* 确保自定义播放按钮在播放器容器中完美居中 */
#player-container .custom-play-button {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 101 !important;
}

/* 字幕容器样式 */
.subtitle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 不阻挡视频点击事件 */
    z-index: 100; /* 高于视频，低于播放按钮 */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 20px 80px 20px; /* 距离底部 80px，左右各 20px 边距 */
    box-sizing: border-box;
}

.subtitle-text {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        -1px -1px 2px rgba(0, 0, 0, 0.8),
        1px 1px 2px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    max-width: 100%;
    display: none; /* 默认隐藏，有内容时显示 */
}

.subtitle-text.show {
    display: block;
}

/* 出场字幕容器样式 */
.desc-subtitle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 不阻挡视频点击事件 */
    z-index: 99; /* 低于对话字幕，高于视频 */
}

.desc-subtitle-text {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        -1px -1px 2px rgba(0, 0, 0, 0.8),
        1px 1px 2px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    max-width: 100%;
    white-space: pre-line; /* 支持换行 */
}

/* ============== 评论列表样式 ============== */

/* 评论区域容器 */
.comments-section {
    width: 100%;
    position: absolute;
    margin-top: 132px;
    padding: 0;
}

/* 评论顶部区域 */
.comments-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.comments-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.comments-sort {
    position: relative;
    display: flex;
    align-items: center;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    /* background: rgba(255, 255, 255, 0.1); */
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sort-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 排序下拉菜单 */
.sort-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background-color: #191717;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    padding: 8px 0;
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sort-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 在上方显示时的样式 */
.sort-dropdown.show-top {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateY(8px);
}

.sort-dropdown.show-top.show {
    transform: translateY(0);
}

.sort-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sort-option:hover,
.sort-option.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.sort-option-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.sort-option-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* 添加评论区域 */
.add-comment-section {
    position: relative;
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    align-items: start;
    justify-content: center;
}

.comment-avatar {
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.avatar-placeholder img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.avatar-placeholder #user-avatar-text {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-avatar img {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-input-wrapper {
    flex: 1;
}

.comment-input {
    width: 100%;
    padding: 0px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.3s ease;
    min-height: 30px;              /* 约一行的高度（含内边距） */
    resize: none;                  /* 由 JS 自动控制高度，不允许手动拖拽 */
    overflow-x: hidden;            /* 禁止横向滚动 */
    overflow-y: hidden;            /* 由 JS 调整高度，不出现纵向滚动条 */
    white-space: pre-wrap;         /* 保留换行并自动换行 */
    word-break: break-word;        /* 单词过长时换行 */
}

.comment-input:focus {
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

/* 评论输入框占位符（未登录时显示） */
.comment-input-placeholder {
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.comment-input-placeholder:hover {
    border-bottom-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
}

/* 登录提示弹窗 */
.login-prompt-modal {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    max-width: 240px;
    min-width: 188px;
    background-color: #191717;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-prompt-modal.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.login-prompt-content {
    padding: 24px;
    text-align: center;
}

.login-prompt-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
}

.login-prompt-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.login-prompt-btn {
    width: 100%;
    height: 36px;
    background-color: #FF4463;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: inherit;
}

.login-prompt-btn:hover {
    background-color: #ff3352;
}

/* 评论操作按钮栏 */
.comment-actions-bar {
    display: none;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
    padding-right: 4px;
}

.comment-actions-bar.show {
    display: flex;
}

.comment-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.comment-action-btn.cancel-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
}

.comment-action-btn.cancel-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.comment-action-btn.submit-btn {
    background: rgba(255, 68, 99, 0.3);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

.comment-action-btn.submit-btn:not(:disabled) {
    background: #FF4463;
    color: #fff;
    cursor: pointer;
}

.comment-action-btn.submit-btn:not(:disabled):hover {
    background: #ff3352;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 68, 99, 0.3);
}

.comment-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 评论列表 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 评论项 */
.comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-item .comment-avatar {
    flex-shrink: 0;
}

.comment-item .comment-avatar .avatar-placeholder {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.comment-item .comment-avatar img {
    width: 40px;
    height: 40px;
}

.comment-content-wrapper {
    flex: 1;
    min-width: 0;
}

.comment-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    position: relative; /* 作为更多菜单的定位参考 */
}

.comment-username {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
}

.comment-username:hover {
    text-decoration: underline;
}

.comment-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* 评论更多操作下拉菜单 */
.comment-more-menu {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
    display: none; /* 默认隐藏，由 JS 控制显示 */
}

.comment-more-menu i {
    font-size: 16px;
}

.comment-more-menu:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.comment-more-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 96px;
    background: #191717;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding: 4px 0;
    z-index: 100;
    display: none;
}

.comment-more-dropdown.show {
    display: block;
    box-shadow: 0 0 4px 4px rgba(255, 255, 255, 0.2);
}

.comment-more-item {
    width: 100%;
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
}

.comment-more-item:hover {
    /* background: rgba(255, 255, 255, 0.08); */
    color: #FF4463;
}

.comment-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    word-wrap: break-word;
    margin-bottom: 12px;
}

.comment-text .reply-to {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.comment-text .reply-to-username {
    color: #FF4463;
    font-weight: 500;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

/* 回复输入框区域 */
.comment-reply-input-wrapper {
    margin-top: 12px;
}

.comment-reply-input-wrapper .comment-input {
    width: 100%;
    padding: 0px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.3s ease;
    min-height: 36px;
    resize: none;
    overflow-x: hidden;
    overflow-y: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-reply-input-wrapper .comment-input:focus {
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.comment-reply-input-wrapper .comment-actions-bar {
    display: none;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
    padding-right: 4px;
}

.comment-reply-input-wrapper .comment-input:focus ~ .comment-actions-bar,
.comment-reply-input-wrapper .comment-actions-bar.show {
    display: flex;
}

.comment-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 15px;
    transition: all 0.2s ease;
}

.comment-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.comment-action-btn i {
    font-size: 14px;
}

.comment-action-btn.liked {
    color: #FF4463;
}

.comment-action-btn.disliked {
    color: #FF4463;
}

.comment-more-menu {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-more-menu:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.comment-more-menu i {
    font-size: 16px;
}

/* 回复信息 */
.comment-replies-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: fit-content;
}

.comment-replies-info:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.comment-replies-info i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.comment-replies-info.expanded i {
    transform: rotate(180deg);
}

/* 回复列表加载状态 */
.replies-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
}

.replies-loading i {
    font-size: 14px;
}

.replies-load-more {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* 回复前缀样式 */
.reply-to-prefix {
    color: rgba(255, 255, 255, 0.7);
}

.reply-to-nickname {
    color: #065fd4;
    font-weight: 500;
}

/* 回复列表 */
.comment-replies {
    margin-top: 16px;
    /* margin-left: 52px; 头像宽度40px + gap 12px */
    /* padding-left: 16px; */
    /* border-left: 2px solid rgba(255, 255, 255, 0.1); */
    display: block;
}

.comment-replies .comment-item {
    margin-bottom: 16px;
}

.comment-replies .comment-item:last-child {
    margin-bottom: 0;
}

/* 回复列表的头像更小 */
.comment-replies .comment-item .comment-avatar .avatar-placeholder {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.comment-replies .comment-item .comment-avatar img {
    width: 32px;
    height: 32px;
}


/* 空状态 */
.comments-list.empty {
    text-align: center;
    padding: 40px 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* 解锁弹窗样式 */
.unlock-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    /*pointer-events: none; !* 允许触摸事件穿透到底层，不影响滑动 *!*/
}

.unlock-modal-content {
    background: #272727;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    position: relative;
    pointer-events: auto; /* 内容区域可以接收点击事件 */
}

.unlock-icon-container {
    margin-bottom: 20px;
    position: relative;
}

.unlock-video-icon {
    height: 100px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unlock-video-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ad-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #FF4463;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 1;
}

.unlock-text {
    margin-bottom: 25px;
}

.unlock-title {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.unlock-subtitle {
    color: white;
    font-size: 16px;
    margin-bottom: 2px;
}

.unlock-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.unlock-buttons .unlock-btn {
    flex: 1; /* 让两个按钮平分宽度 */
    max-width: 120px; /* 设置最大宽度 */
}

.unlock-btn {
    padding: 8px 0px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.cancel-btn {
    background: #FF4463;
    color: white;
}

.cancel-btn:hover {
    background: #e63950;
    transform: translateY(-1px);
}

.view-ad-btn {
    background: #FF4463;
    color: white;
}

.view-ad-btn:hover {
    background: #e63950;
    transform: translateY(-1px);
}

/* ==================== RTL（阿拉伯语）适配 ====================*/
[dir="rtl"] body,
[lang="ar"] body {
    direction: rtl;
    text-align: right;
}

/* 进度条 - RTL适配 */
[dir="rtl"] .progress-bar-thumb,
[lang="ar"] .progress-bar-thumb {
    left: auto;
    right: 0%; /* 初始值为0，与进度条宽度一致 */
}

[dir="rtl"] .progress-bar,
[lang="ar"] .progress-bar {
    right: 0;
}
