/* 影片信息区域 - 左右布局 */
.nf-movie-header {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 30px;
}

.nf-movie-poster {
    flex-shrink: 0;
    width: 200px;
}

.nf-movie-poster img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.nf-movie-details {
    flex: 1;
    min-width: 0;
}

.nf-movie-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px 0;
}

.nf-movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--nf-text);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.nf-movie-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nf-movie-meta .score {
    color: #ffd700;
    font-weight: 600;
}

/* 播放器专用样式增强 */
.nf-player-section {
    background: #000;
    padding: 20px 0;
}

.nf-player-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    /* Fallback for browsers without aspect-ratio support */
    min-height: 0;
    padding-top: 56.25%;
    /* 16:9 ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

/* Position iframe and loading absolutely within container */
.nf-player-container iframe,
.nf-player-container .loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.nf-player-container iframe {
    border: none;
    z-index: 1;
    /* 确保iframe可以正常加载内容 */
    allow: accelerometer;
    autoplay;
    clipboard-write;
    encrypted-media;
    gyroscope;
    picture-in-picture;
    webkitallowfullscreen: true;
    mozallowfullscreen: true;
    allowfullscreen: true;
}

.nf-player-container .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-size: 1.5rem;
    z-index: 2;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Hide loading when player is active */
.nf-player-container .loading[style*="visibility: hidden"],
.nf-player-container .loading[style*="display: none"] {
    opacity: 0;
    pointer-events: none;
}

.nf-player-container .loading i {
    font-size: 3rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* 播放源和选集 */
.nf-play-sources {
    display: flex;
    gap: 10px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.nf-source-tab {
    padding: 12px 24px;
    background: #2f2f2f;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.nf-source-tab:hover,
.nf-source-tab.active {
    background: #e50914;
    border-color: #e50914;
}

.nf-play-episodes {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.nf-episodes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nf-episode-btn {
    padding: 10px 18px;
    background: #2f2f2f;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.nf-episode-btn:hover,
.nf-episode-btn.active {
    background: #e50914;
    border-color: #e50914;
}

/* FAQ 区块 */
.nf-faq {
    background: #181818;
    border-radius: 8px;
    padding: 30px;
    margin: 30px 0;
}

.nf-faq-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}

.nf-faq-item {
    border-bottom: 1px solid #333;
    padding: 15px 0;
}

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

.nf-faq-q {
    font-weight: 600;
    color: #e5e5e5;
    margin-bottom: 8px;
}

.nf-faq-a {
    color: #8c8c8c;
    line-height: 1.6;
}

/* 影片别名 */
.nf-movie-alias {
    color: #808080;
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 15px;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .nf-movie-header {
        flex-direction: column;
        gap: 20px;
    }

    .nf-movie-poster {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .nf-movie-title {
        font-size: 1.4rem;
        text-align: center;
    }

    .nf-movie-meta {
        justify-content: center;
    }

    .nf-movie-details>div[style*="flex"] {
        justify-content: center;
    }
}

/* ===== 两栏布局：主内容+侧边栏 ===== */
.nf-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

.nf-main {
    min-width: 0;
}

.nf-aside {
    position: sticky;
    top: 88px;
}

/* 侧边栏卡片 */
.nf-sidebar {
    background: #181818;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.nf-sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.nf-rank-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: #222;
    border-radius: 6px;
    transition: all 0.3s;
}

.nf-rank-item:hover {
    background: #333;
    transform: translateX(5px);
}

.nf-rank-item .rank-num {
    width: 24px;
    height: 24px;
    background: #e50914;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.nf-rank-item .rank-info {
    flex: 1;
    min-width: 0;
}

.nf-rank-item .rank-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.nf-rank-item .rank-meta {
    font-size: 0.75rem;
    color: #888;
}

/* 响应式：平板及以下单列布局 */
@media (max-width: 1024px) {
    .nf-layout {
        grid-template-columns: 1fr;
    }

    .nf-aside {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .nf-sidebar {
        margin-bottom: 0;
    }
}

@media (max-width: 576px) {
    .nf-aside {
        grid-template-columns: 1fr;
    }
}

/* ===== 强制覆盖 Bootstrap 列宽以支持自定义 Grid ===== */
.movie-grid {
    display: grid !important;
    gap: 15px;
}

.movie-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.movie-grid .pic-list {
    display: contents !important;
}

.movie-grid li,
.movie-grid li[class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    padding: 0 !important;
}

/* 卡片样式优化 */
.movie-grid li .pic-img {
    display: block;
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    border-radius: 6px;
}

.movie-grid li .pic-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-grid li .name,
.movie-grid li h3 {
    font-size: 0.85rem;
    margin: 8px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-grid li .score {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(229, 9, 20, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.movie-grid li .tips {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.movie-grid li .title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 20px 8px 8px;
    font-size: 0.8rem;
}

/* 响应式卡片网格 */
@media (max-width: 768px) {
    .movie-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ===== 收藏按钮样式 ===== */
.btn-fav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.btn-fav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-fav.active {
    background: #e50914;
    border-color: #e50914;
}

.btn-fav.active i {
    color: #fff;
}

.btn-fav i {
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.btn-fav:hover i {
    transform: scale(1.15);
}

/* Toast 提示 */
.fav-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.fav-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
