/* 基础布局样式 */
.main-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    display: flex;
    gap: 20px;
    padding: 0 15px;
}

/* 播放器核心样式 - PC端自适应 */
.player-container {
    flex: 1;
    position: relative;
    width: 100%;
    /* PC端不强制比例，由视频内容决定高度 */
    min-height: 450px; /* 只设置最小高度保证基础显示 */
    background-color: #000;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
    z-index: 10;
    margin-bottom: 15px;
}

/* 播放器内部元素定位 */
.player-container video,
.MacPlayer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* 保证视频完整显示 */
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* 通用卡片样式 */
.card {
    background: #2c2c2c;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    margin-bottom: 20px;
    overflow: hidden;
}

/* 卡片标题区 */
.card__header {
    padding: 14px 15px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card__title {
    font-size: 16px;
    font-weight: bold;
    color: #f0f0f0;
    margin: 0;
}

/* 卡片内容区 */
.card__body {
    padding: 0;
}

/* 视频信息与简介通用样式 */
.card__content {
    padding: 15px;
    color: #ccc;
    font-size: 14px;
    line-height: 1.6;
}

/* 视频信息样式 */
.video-info__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.video-info__item {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
}

.video-info__label {
    color: #999;
    min-width: 65px;
    flex-shrink: 0;
}

/* 视频简介样式 */
.video-desc__title {
    font-size: 15px;
    color: #f0f0f0;
    margin-bottom: 10px;
    font-weight: 500;
}

.video-desc__content {
    line-height: 1.7;
    color: #bbb;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.video-desc__content.expanded {
    -webkit-line-clamp: none;
    height: auto;
}

.video-desc__more {
    color: #ff3a3a;
    text-decoration: none;
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    cursor: pointer;
}

.video-desc__more:hover {
    text-decoration: underline;
}

/* 播放组切换样式 */
.playgroup-tabs {
    display: flex;
    background: #333;
    border-bottom: 1px solid #444;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 5px 10px;
}

.playgroup-tabs::-webkit-scrollbar {
    display: none;
}

.playgroup-tab {
    padding: 6px 12px;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 4px;
    margin-right: 6px;
    transition: all 0.2s;
    user-select: none;
}

.playgroup-tab.active {
    background: #ff3a3a;
    color: #fff;
    box-shadow: 0 2px 5px rgba(255,58,58,0.2);
}

.playgroup-tab:hover:not(.active) {
    color: #fff;
    background: #444;
}

/* 剧集列表样式 */
.episode-list-container {
    padding: 15px;
    display: none;
}

.episode-list-container.active {
    display: block;
}

.episode-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.episode-list__item {
    background: #383838;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.episode-list__link {
    display: block;
    padding: 8px 5px;
    text-align: center;
    color: #ddd;
    text-decoration: none;
    font-size: 14px;
}

.episode-list__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    background: #404040;
}

.episode-list__item:hover .episode-list__link {
    color: #ff3a3a;
}

.episode-list__item.active {
    background: #333;
    border: 1px solid #ff3a3a;
}

.episode-list__item.active .episode-list__link {
    color: #ff3a3a;
    font-weight: 500;
}

/* 星星评分样式 */
.star-rating {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    margin-left: 5px !important;
    vertical-align: middle !important;
}

.star {
    color: #666 !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

.star.filled {
    color: #ffcc00 !important; 
}

.star.half-filled {
    position: relative !important;
    color: #666 !important;
}

.star.half-filled::after {
    content: '★' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 50% !important;
    overflow: hidden !important;
    color: #ffcc00 !important;
    z-index: 1 !important;
}

/* 公告栏样式 */
.notice-marquee {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 36px;
    line-height: 36px;
    background: rgba(0, 0, 0, 0.8);
    overflow: hidden;
    z-index: 10;
    box-sizing: border-box !important;
}

.notice-label {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 100%;
    text-align: center;
    background: #ff3a3a;
    color: #fff;
    font-weight: 500;
    z-index: 2;
}

.notice-scroll-container {
    position: relative;
    margin-left: 70px;
    margin-right: 40px;
    height: 100%;
    overflow: hidden;
}

.notice-content {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    height: 100%;
    width: max-content;
    will-change: transform;
}

.notice-original, .notice-clone {
    white-space: nowrap;
    display: inline-block;
}

.notice-gap {
    display: inline-block;
    width: 100%;
    min-width: 150px;
}

.notice-text {
    color: #ffd700;
    font-size: 14px;
}

.notice-link {
    color: #33cc99 !important;
    text-decoration: underline !important;
    margin: 0 5px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}

.notice-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-100% + var(--container-width))); }
}

.notice-marquee:hover .notice-content {
    animation-play-state: paused;
}

/* 移动端适配 (768px以下) - 强制16:9比例 */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column !important;
        padding: 0 15px !important;
        gap: 10px !important;
    }
    
    .sidebar {
        width: 100% !important;
    }
    
    .player-container {

        /* 移动端强制16:9比例 */
        height: 0 !important;
        padding-bottom: 56.25% !important;
        min-height: auto !important; /* 覆盖PC端最小高度 */
    }

    /* 播放器控件确保可见 */
    .player-container .controls,
    .MacPlayer > div {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 20 !important;
    }
    
    .notice-marquee {
        height: 32px;
        line-height: 32px;
        z-index: 100 !important;
    }
    
    .notice-label {
        width: 50px;
        font-size: 12px;
    }
    
    .notice-scroll-container {
        margin-left: 60px;
        margin-right: 30px;
    }
    
    .notice-text, .notice-link {
        font-size: 12px;
    }
    
    .notice-close {
        right: 10px;
        font-size: 14px;
    }
    
    .notice-gap {
        min-width: 100px;
    }

    /* 剧集列表高度控制 */
    .episode-list-container {
        max-height: 400px;
        overflow-y: auto;
    }
}

/* 小屏手机优化 */
@media (max-width: 375px) {
    .player-container {
        margin: 0 3px 10px !important;
    }
}

/* 中等屏幕适配 */
@media (max-width: 992px) {
    .player-container {
        width: 100% !important;
        flex: none !important;
    }
}


/* 热门推荐模块样式） */
.recommendations {
    padding: 10px 0;
}

.recommendations__list {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 0 10px;
    /* 新增：PC端限制列表高度，超出滚动（核心优化） */
    max-height: 280px; /* 高度可根据需求调整，确保内容不拉伸播放器 */
    overflow-y: auto;  /* 垂直方向超出时显示滚动条 */
    overflow-x: hidden; /* 禁止水平滚动，避免布局错乱 */
}

/* 新增：美化滚动条（不影响功能，仅优化PC端视觉，与原有风格统一） */
.recommendations__list::-webkit-scrollbar {
    width: 4px; /* 滚动条宽度，避免占用过多空间 */
}
.recommendations__list::-webkit-scrollbar-track {
    background: #2c2c2c; /* 滚动条轨道背景，匹配深色主题 */
    border-radius: 2px;
}
.recommendations__list::-webkit-scrollbar-thumb {
    background: #555; /* 滚动条滑块颜色 */
    border-radius: 2px;
}
.recommendations__list::-webkit-scrollbar-thumb:hover {
    background: #666; /* 鼠标悬停时滑块颜色 */
}

/* 原有样式保持不变 */
.recommendations__item {
    display: flex;
    flex-direction: column;
}

.recommendations__poster-container {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.recommendations__poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.recommendations__hits {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 1px 5px;
}

.recommendations__title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    line-height: 1.2;
}

.recommendations__more {
    text-align: center;
    padding: 10px 0;
}

.recommendations__more-link {
    color: #ff3a3a;
    font-size: 14px;
    text-decoration: none;
}

.recommendations__more-link:hover {
    text-decoration: underline;
}

/* 移动端适配（保留原有，新增滚动重置） */
@media (max-width: 768px) {
    .recommendations__list {
        gap: 8px;
        max-height: none; /* 移动端取消高度限制，内容自然展开 */
        overflow-y: visible; /* 移动端隐藏滚动条 */
    }
    
    .recommendations__title {
        font-size: 12px;
    }
}