/* ===== 在线播放页面 - 蔚蓝意式风格 ===== */

/* 页面容器 */
.player-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* 英雄区域 */
.player-hero {
    padding-top: 60px;
    text-align: center;
}

.player-title {
    font-family: var(--font-wenkai, 'LXGW WenKai Lite', 'Noto Serif SC', Georgia, serif);
    font-size: 40px;
    font-weight: 400;
    color: var(--nordic-primary, #4A8DB7);
    margin: 0 0 12px;
    letter-spacing: 2px;
}

.player-subtitle {
    font-size: 15px;
    color: var(--nordic-text-light, #6B7D8E);
    margin: 0 0 32px;
    font-weight: 300;
}

/* 输入框区域 */
.player-input-box {
    display: flex;
    max-width: 650px;
    margin: 0 auto;
    border-radius: 28px;
    border: 2px solid var(--nordic-primary, #4A8DB7);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 20px rgba(74, 141, 183, 0.15);
    transition: box-shadow 0.3s ease;
}

.player-input-box:focus-within {
    box-shadow: 0 6px 30px rgba(74, 141, 183, 0.25);
}

.player-input-box input {
    flex-grow: 1;
    border: none;
    padding: 14px 24px;
    font-size: 15px;
    outline: none;
    background: transparent;
    color: var(--nordic-text, #1A2B3C);
}

.player-input-box input::placeholder {
    color: #9ab;
}

.player-parse-btn {
    background: linear-gradient(135deg, var(--nordic-primary, #4A8DB7), var(--nordic-primary-light, #6BAED6));
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.player-parse-btn:hover {
    background: linear-gradient(135deg, #3D7DA3, #5A9DC5);
    box-shadow: -4px 0 15px rgba(74, 141, 183, 0.3);
}

/* 解析线路切换 */
.player-apis {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.player-api-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--nordic-border, #DCE5EE);
    background: #fff;
    color: var(--nordic-text-light, #6B7D8E);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-api-btn:hover {
    border-color: var(--nordic-primary-light, #6BAED6);
    color: var(--nordic-primary, #4A8DB7);
}

.player-api-btn.active {
    background: linear-gradient(135deg, var(--nordic-primary, #4A8DB7), var(--nordic-primary-light, #6BAED6));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(74, 141, 183, 0.3);
}

/* 播放区域 */
.player-viewport {
    margin-top: 32px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    background: #fff;
}

.player-viewport-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(74, 141, 183, 0.08), rgba(74, 141, 183, 0.04));
    border-bottom: 1px solid var(--nordic-border, #DCE5EE);
}

.player-viewport-title {
    font-size: 14px;
    color: var(--nordic-text, #1A2B3C);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 50px);
}

.player-viewport-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--nordic-text-light, #6B7D8E);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.player-viewport-close:hover {
    background: rgba(74, 141, 183, 0.1);
    color: var(--nordic-primary, #4A8DB7);
}

.player-iframe-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* IE11 降级 - 16:9 比例 */
    height: 0;
    overflow: hidden;
    background: #000;
}

/* 现代浏览器覆盖 */
@supports (aspect-ratio: 16 / 9) {
    .player-iframe-wrap {
        aspect-ratio: 16 / 9;
        padding-bottom: 0;
        height: auto;
    }
}

.player-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 历史记录 */
.player-history {
    margin-top: 48px;
}

.player-section-title {
    font-family: var(--font-wenkai, 'LXGW WenKai Lite', 'Noto Serif SC', Georgia, serif);
    font-size: 20px;
    font-weight: 400;
    color: var(--nordic-text, #1A2B3C);
    margin: 0 0 20px;
    padding-left: 14px;
    border-left: 3px solid var(--nordic-primary, #4A8DB7);
    letter-spacing: 1px;
}

.player-history-list {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--nordic-border, #DCE5EE);
    overflow: hidden;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--nordic-border, #DCE5EE);
    gap: 12px;
    transition: background 0.2s ease;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: rgba(74, 141, 183, 0.04);
}

.history-title {
    flex: 1;
    font-size: 14px;
    color: var(--nordic-text, #1A2B3C);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.history-title:hover {
    color: var(--nordic-primary, #4A8DB7);
}

.history-source {
    font-size: 12px;
    padding: 3px 10px;
    background: rgba(74, 141, 183, 0.1);
    color: var(--nordic-primary, #4A8DB7);
    border-radius: 12px;
    white-space: nowrap;
}

.history-date {
    font-size: 12px;
    color: var(--nordic-text-light, #6B7D8E);
    white-space: nowrap;
}

.history-play-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--nordic-primary, #4A8DB7);
    color: var(--nordic-primary, #4A8DB7);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-play-btn:hover {
    background: var(--nordic-primary, #4A8DB7);
    color: #fff;
}

.player-history-clear {
    margin-top: 16px;
    padding: 8px 18px;
    background: transparent;
    border: 1px solid var(--nordic-border, #DCE5EE);
    color: var(--nordic-text-light, #6B7D8E);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-history-clear:hover {
    border-color: #dc3232;
    color: #dc3232;
}

/* 热门推荐 */
.player-recommendations {
    margin-top: 48px;
}

.player-rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.player-rec-card {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--nordic-border, #DCE5EE);
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-rec-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.rec-cover {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* IE11 降级 - 16:9 比例 */
    height: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--nordic-bg, #F6F9FC), var(--nordic-bg-warm, #F0F5FA));
}

/* 现代浏览器覆盖 */
@supports (aspect-ratio: 16 / 9) {
    .rec-cover {
        aspect-ratio: 16 / 9;
        padding-bottom: 0;
        height: auto;
    }
}

.rec-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.player-rec-card:hover .rec-cover img {
    transform: scale(1.05);
}

.rec-cover-default {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nordic-text-light, #6B7D8E);
}

.rec-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(74, 141, 183, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.rec-play-overlay svg {
    margin-left: 4px;
}

.player-rec-card:hover .rec-play-overlay {
    opacity: 1;
}

.rec-info {
    padding: 14px 16px;
}

.rec-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--nordic-text, #1A2B3C);
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-desc {
    font-size: 12px;
    color: var(--nordic-text-light, #6B7D8E);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .player-page {
        padding: 0 16px 40px;
    }
    
    .player-hero {
        padding-top: 40px;
    }
    
    .player-title {
        font-size: 28px;
    }
    
    .player-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .player-input-box {
        flex-direction: column;
        border-radius: 16px;
    }
    
    .player-input-box input {
        padding: 14px 18px;
    }
    
    .player-parse-btn {
        padding: 12px;
        border-radius: 0 0 14px 14px;
    }
    
    .player-apis {
        gap: 6px;
    }
    
    .player-api-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
    
    .player-viewport {
        border-radius: 12px;
        margin-top: 24px;
    }
    
    .player-viewport-header {
        padding: 10px 14px;
    }
    
    .player-viewport-title {
        font-size: 13px;
    }
    
    .player-history {
        margin-top: 36px;
    }
    
    .player-section-title {
        font-size: 18px;
    }
    
    .history-item {
        flex-wrap: wrap;
        padding: 12px 14px;
    }
    
    .history-title {
        width: 100%;
        margin-bottom: 6px;
    }
    
    .player-recommendations {
        margin-top: 36px;
    }
    
    .player-rec-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .player-rec-card {
        display: flex;
    }
    
    .rec-cover {
        width: 140px;
        flex-shrink: 0;
        padding-bottom: 0;
        height: 78.75px; /* IE11 降级 - 140px * 9/16 */
    }
    
    /* 现代浏览器覆盖 */
    @supports (aspect-ratio: 16 / 9) {
        .rec-cover {
            aspect-ratio: 16 / 9;
            height: auto;
        }
    }
    
    .rec-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .player-title {
        font-size: 24px;
    }
    
    .rec-cover {
        width: 120px;
    }
    
    .rec-title {
        font-size: 13px;
    }
    
    .rec-desc {
        font-size: 11px;
    }
}
