/* --- CSS Reset & Global (黑色主题) --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background-color: #121212; 
    color: #e0e0e0;
}
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* --- Header & Nav --- */
.header { background-color: #1f1f1f; border-bottom: 1px solid #333; padding: 10px 0; }
.header .container { display: flex; align-items: center; }
.logo { font-size: 26px; font-weight: 700; letter-spacing: 1px; background: linear-gradient(45deg, #0088ff, #0056b3); -webkit-background-clip: text; color: transparent; }
.main-nav { margin-left: auto; }
.nav-list { list-style: none; display: flex; }
.nav-item a { padding: 10px 15px; display: block; font-size: 16px; font-weight: 500; letter-spacing: 1px; }
.nav-item.active a, .nav-item a:hover { color: #0088ff; }
.nav-item.has-children a { cursor: pointer; }
#sub-nav-container { padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-in-out; background-color: #1f1f1f; border-top: 1px solid #333;}
#sub-nav-container.open { max-height: 500px; }
.sub-nav-card {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}
.sub-nav-card.active,
.ad-text { 
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.sub-nav-card a,
.ad-text a {
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #2a2a2a;
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sub-nav-card a:hover,
.ad-text a:hover {
    color: #0088ff;
    border-color: #0088ff;
}

/* --- Ads & Search --- */
.ad-banner-container { padding: 15px 0; padding-bottom: 10px; }
.ad-slot { display: block; background-color: #2a2a2a; border-radius: 8px; overflow: hidden; }
.ad-slot:not(:last-child) { margin-bottom: 1px; }
.ad-slot img { width: 100%; height: auto; display: block; }
.search-section { padding: 15px 0; }
.search-form { display: flex; }
.search-input { flex-grow: 1; padding: 10px; border: 1px solid #444; font-size: 16px; border-radius: 4px 0 0 4px; background-color: #2a2a2a; color: #e0e0e0; }
.search-button { padding: 10px 20px; border: none; background-color: #007bff; color: #fff; font-size: 16px; cursor: pointer; border-radius: 0 4px 4px 0; }

/* --- Video Section (Final Perfect Version) --- */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-title { font-size: 22px; }
.section-extra { font-size: 14px; color: #fbf600; }
.lm_lb { margin-top: 15px; }
.lb_nr ul { list-style: none; display: flex; flex-wrap: wrap; margin: 0 -10px; }
.lb_nr li { width: 25%; padding: 0 10px; margin-bottom: 20px; }
.lm_lbimg {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    background-color: #2a2a2a;
    aspect-ratio: 4 / 3;
    display: block;
}
.lm_lbimg::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin-top: -16px;
    margin-left: -16px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }
.lm_lbimg img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: opacity 0.5s ease;
    position: relative;
    z-index: 0;
    opacity: 0;
    color: transparent;
    font-size: 0;
}
.lm_lbimg img.lazyloaded {
    z-index: 2;
    opacity: 1;
}
li:hover .lm_lbimg img.lazyloaded {
    transform: scale(1.05);
}
.video-title-below { 
    font-size: 14px; 
    margin-top: 8px; 
    text-align: center;
}
.video-title-below a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- New Links Section --- */
.links-section { margin-top: 30px; }
.links-section-title { font-size: 20px; color: #e0e0e0; padding-bottom: 10px; margin-bottom: 15px; border-bottom: 1px solid #333; }
.friend-links { display: flex; flex-wrap: wrap; gap: 15px; }
.friend-links a { color: #888; font-size: 14px; }
.friend-links a:hover { color: #fff; }

/* --- New Dark Footer --- */
.footer-dark { background-color: #222; color: #888; padding: 30px 0; margin-top: 30px; font-size: 14px; text-align: center; border-top: 1px solid #333; }
.footer-dark a { color: #aaa; }
.footer-dark a:hover { color: #fff; }
.contact-info { margin-bottom: 10px; }
.copyright-info { margin-bottom: 20px; }
.disclaimer-text { font-size: 12px; color: #666; line-height: 1.8; }

/* --- Popup --- */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 1000; }
.popup-overlay.show { display: flex; }
.popup-content { background-color: #2a2a2a; padding: 20px; border-radius: 8px; max-width: 500px; width: 90%; text-align: center; border: 1px solid #444; }
.popup-title { font-size: 20px; margin-bottom: 15px; color: #fff; }
.popup-body { text-align: left; margin-bottom: 20px; line-height: 1.8; color: #ccc; }
.popup-close { padding: 10px 20px; border: none; background-color: #007bff; color: #fff; border-radius: 4px; cursor: pointer; }

/* --- Final Touch: Title Box --- */
.title-box-wrapper {
    background-color: #007bff;
    color: #fff;
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}
.title-box-wrapper .detail-title-simple,
.title-box-wrapper .play-title {
    margin: 0;
    padding: 0;
    font-size: 20px;
    text-align: left;
    color: #fff;
}

/* --- Detail Page --- */
.detail-section-simple { padding: 20px 0; }
/* 移除旧的标题样式，因为已被 .title-box-wrapper 接管 */
.detail-poster-simple {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background-color: #2a2a2a;
}
.detail-poster-simple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    margin-left: -24px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}
.detail-poster-simple img {
    width: 100%;
    display: block;
    transition: opacity 0.5s ease;
    position: relative;
    z-index: 0;
    opacity: 0;
    color: transparent;
    font-size: 0;
}
.detail-poster-simple img.lazyloaded {
    z-index: 2;
    opacity: 1;
}
.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.8;
    transition: all 0.3s ease;
    z-index: 3;
    pointer-events: none;
}
.play-icon-overlay::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.9);
    margin-left: 5px;
}
.detail-poster-simple a:hover .play-icon-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}
.playlist-section-simple { margin-top: 30px; }
.playlist-buttons-simple { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.play-button-simple { display: inline-block; padding: 12px 25px; border: 1px solid #007bff; border-radius: 5px; background-color: #007bff; color: #fff; font-size: 16px; font-weight: 500; transition: all 0.2s ease; }
.play-button-simple:hover { background-color: #0056b3; border-color: #0056b3; }

/* --- Play Page --- */
.player-section { margin-bottom: 30px; }
/* 移除旧的标题样式，因为已被 .title-box-wrapper 接管 */
.player-container { position: relative; width: 100%; background-color: #000; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; }
.player-container iframe { width: 100%; height: 100%; }
.player-tips { padding: 15px; background-color: #2a2a2a; border-radius: 5px; text-align: center; margin-top: 20px; }
.tip-line-1 { font-size: 16px; color: #fff; margin-bottom: 10px; }
.tip-line-2 { font-size: 16px; color: #fbf600; font-weight: 500; }

/* --- Pagination (Final Version) --- */
.pagination { display: flex; justify-content: center; align-items: center; margin-top: 30px; gap: 8px; flex-wrap: wrap; }
.page-link { padding: 8px 12px; border: 1px solid #444; border-radius: 5px; background-color: #2a2a2a; color: #e0e0e0; font-size: 14px; transition: all 0.2s ease; white-space: nowrap; }
.page-link:hover { color: #fff; background-color: #007bff; border-color: #007bff; }
.page-link.active { color: #fff; background-color: #d9534f; border-color: #d9534f; cursor: default; }
.page-ellipsis { color: #888; padding: 0 5px; align-self: center; }
.page-jump-form { display: flex; align-items: center; margin-left: 1px; }
.page-jump-input { width: 60px; height: 35px; padding: 0 8px; border: 1px solid #444; border-radius: 5px 0 0 5px; background-color: #fff; color: #333; text-align: center; font-size: 14px; outline: none; transition: box-shadow 0.2s; }
.page-jump-input:focus { box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); }
.page-jump-button { height: 35px; padding: 0 12px; border: 1px solid #444; border-left: none; border-radius: 0 5px 5px 0; background-color: #fff; color: #333; cursor: pointer; font-size: 14px; white-space: nowrap; transition: background-color 0.2s; }
.page-jump-button:hover { background-color: #f0f0f0; }

/* --- Responsive for Mobile --- */
@media (max-width: 768px) {
    .header .container { flex-wrap: wrap; }
    .main-nav { margin-left: 0; width: 100%; order: 3; }
    .nav-list { justify-content: space-around; }
    .nav-item a { padding: 10px 5px; font-size: 15px; }
    .section-header { flex-wrap: wrap; gap: 5px; }
    .section-title { font-size: 18px; }
    .section-extra { font-size: 12px; }
    .lb_nr ul { margin: 0 -7.5px; }
    .lb_nr li { width: 50%; padding: 0 7.5px; margin-bottom: 15px; }
    .sub-nav-card.active, .ad-text { grid-template-columns: repeat(5, 1fr); gap: 8px; }
    .sub-nav-card a, .ad-text a { padding: 6px 4px; font-size: 12px; }
    .detail-title-simple { font-size: 22px; }
    .play-title { font-size: 18px; text-align: left; }
    
    /* 核心修正：移动端分页美化 */
    .pagination {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 1px 0; /* 增加上下padding，让按钮更大 */
        gap: 1px; /* 增大间距 */
        justify-content: center; /* 居中对齐 */
    }
    .pagination::-webkit-scrollbar {
        display: none;
    }
    .page-link {
        padding: 10px 14px; /* 增大按钮 */
        font-size: 14px;
        flex-shrink: 0;
    }
    .page-ellipsis {
        padding: 10px 5px;
    }
    .page-jump-input {
        width: 60px;
        height: 39px; /* 与按钮高度对齐 */
        font-size: 14px;
        flex-shrink: 0;
    }
    .page-jump-button {
        height: 39px;
        padding: 0 10px;
        font-size: 14px;
        flex-shrink: 0;
    }
}