/* Star Video Player - 前端样式 */
:root {
    --star-primary: #274eee;
    --star-primary-dark: #1c3bbd;
    --star-primary-light: #4b6df0;
    --star-bg: #ffffff;
    --star-text: #333333;
    --star-border: #e0e0e0;
    --star-disabled: #cccccc;
    --star-success: #4CAF50;
    --star-success-dark: #388E3C;
}

.star-container {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(39, 78, 238, 0.12);
    will-change: transform;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.star-video-wrapper {
    margin: 0;
    padding: 0;
    line-height: 0;
    position: relative;
    overflow: hidden;
    background-color: #000;
}

.star-iframe {
    max-width: 100%;
    border-radius: 0;
    display: block;
    height: 220px;
    width: 100%;
    border: none;
}

.star-episodes-wrapper {
    padding: 15px 12px;
    background-color: var(--star-bg);
}

.star-episodes-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    padding: 3px 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    max-height: none; /* 默认不限制高度 */
}

/* 限制显示的剧集数量 */
.star-episodes-container.limited {
    overflow-y: hidden;
    position: relative;
}

.star-episodes-container::-webkit-scrollbar {
    height: 4px;
    width: 4px;
}

.star-episodes-container::-webkit-scrollbar-thumb {
    background-color: var(--star-primary-light);
    border-radius: 10px;
}

.star-episode {
    position: relative;
    padding: 12px 8px;
    background-color: #f5f5f5;
    border: 1px solid var(--star-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
    touch-action: manipulation;
    overflow: hidden;
    min-height: 45px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.star-episode:hover {
    background-color: #eef2ff;
    border-color: var(--star-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(39, 78, 238, 0.15);
}

.star-episode-active {
    background-color: var(--star-primary);
    color: white;
    border-color: var(--star-primary);
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(39, 78, 238, 0.2);
}

.star-episode-active:hover {
    background-color: var(--star-primary-dark);
}

.star-episode-text {
    position: relative;
    z-index: 2;
    font-size: 13px;
    line-height: 1.3;
    display: block;
    width: 100%;
}

.star-episode-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 50%) scale(1);
    z-index: 0;
    max-width: 100%;
    max-height: 100%;
    opacity: 0.8;
    width: 30px;
    height: 20px;
    border-radius: 0 !important;
}

.star-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.star-prev, .star-next {
    padding: 10px 18px;
    background-color: var(--star-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    user-select: none;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(39, 78, 238, 0.2);
}

.star-prev:hover, .star-next:hover {
    background-color: var(--star-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 78, 238, 0.3);
}

.star-prev:active, .star-next:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(39, 78, 238, 0.2);
}

.star-prev:disabled, .star-next:disabled {
    background-color: var(--star-disabled);
    cursor: default;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* 分页导航 */
.star-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background-color: #f0f4ff;
    border: 1px dashed var(--star-primary-light);
    border-radius: 8px;
    padding: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
}
.star-pagination::-webkit-scrollbar {
    display: none;
}
@media (max-width: 768px) {
    .star-pagination {
        justify-content: flex-start;
}
}

.star-page-button {
    padding: 5px 10px;
    background-color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    min-width: 32px;
    text-align: center;
}

.star-page-button:hover {
    background-color: #eef2ff;
    border-color: var(--star-primary-light);
}

.star-page-button.active {
    background-color: var(--star-primary);
    color: white;
    border-color: var(--star-primary);
}

/* 媒体查询 - 移动端适配 */
@media (max-width: 480px) {
    .star-episodes-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .star-episodes-container.limited {
        grid-template-rows: repeat(4, 1fr); /* 移动端显示16集 (4x4) */
    }
    
    .star-episode {
        padding: 10px 5px;
        min-height: 40px;
    }
    
    .star-episode-text {
        font-size: 12px;
    }
    
    .star-prev, .star-next {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 平板适配 */
@media (min-width: 481px) and (max-width: 768px) {
    .star-iframe {
        height: 360px;
    }
    
    .star-episodes-container {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .star-episodes-container.limited {
        grid-template-rows: repeat(4, 1fr); /* 平板显示24集 (6x4) */
    }
}

/* 桌面适配 */
@media (min-width: 769px) {
    .star-iframe {
        height: 480px;
    }
    
    .star-episodes-container {
        grid-template-columns: repeat(10, 1fr);
    }
    
    .star-episodes-container.limited {
        grid-template-rows: repeat(3, 1fr); /* 桌面显示30集 (10x3) */
    }
    
    .star-episode {
        min-height: 50px;
    }
}

/* 大屏幕适配 */
@media (min-width: 1200px) {
    .star-iframe {
        height: 560px;
    }
}

/* 播放器覆盖层样式 */
.star-player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    background-image:url('https://img.mystar.cc/i/2025/06/03/108132.webp');
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s ease;
}

.star-player-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.star-player-overlay-content {
    text-align: center;
}

.star-play-button {
    background: #ffffff17;
    backdrop-filter: blur(10px);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ffffff17;
    transition: all 0.2s ease;
}

.star-play-button:hover {
    transform: translateY(-3px);
    border: 1px solid #ffffff3d;
}

.star-play-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* 视频容器样式修改 */
.star-video-wrapper {
    margin: 0;
    padding: 0;
    line-height: 0;
    position: relative;
    overflow: hidden;
    background-color: #000;
} 

/* 夜间适配 */
.io-black-mode .star-episodes-wrapper{
    background-color: #1b1d1f;
}
.io-black-mode .star-container {
    box-shadow: 0 3px 10px rgb(27 29 31 / 10%);
}
.io-black-mode .star-episode {
    background-color: #2c2e2f;
    border: 1px solid #414345;
}
.io-black-mode .star-episode:hover {
    background-color: #373a3c;
    border-color: #373a3c;
}
.io-black-mode .star-episode-active {
    background-color: var(--star-primary);
}
.io-black-mode .star-pagination {
    background-color: #2c2e2f;
    border: 1px dashed #414345;
}