/* === 全局暗黑主题 === */
body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-top: 190px;
    transition: padding-top 0.3s;
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: #fff; }

/* === 1. 顶部头部 === */
.navbar {
    background-color: #1a1a1a;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px;
}
.corn-logo { font-size: 24px; margin-right: 8px; }
.navbar-brand {
    font-weight: bold; color: #ffc107 !important; font-size: 22px; margin-right: 0 !important;
}

/* --- 导航链接 (紧凑版) --- */
.nav-row {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 0 5px 10px; /* 减少左右内边距 */
    text-align: center;
    scrollbar-width: none;
}
.nav-row::-webkit-scrollbar { display: none; }

.nav-link-item {
    display: inline-block;
    /* 【修复1】减小间距，把“体育”放进来 */
    padding: 6px 10px;
    margin: 0 1px;
    color: #aaa;
    font-size: 14px;
    border-radius: 20px;
    transition: all 0.2s;
    cursor: pointer;
}
.nav-link-item:hover, .nav-link-item.active {
    color: #000; background-color: #ffc107; font-weight: bold;
}

/* --- 搜索框 --- */
.search-row {
    width: 100%;
    padding: 0 15px 5px;
    display: flex;
    justify-content: center;
}
.search-group {
    width: 100%;
    display: flex;
    align-items: stretch;
}
.search-input-group {
    background: #333; border: 1px solid #444; color: #fff;
    border-radius: 20px 0 0 20px;
    padding: 8px 15px;
    flex: 1; min-width: 0;
    outline: none; font-size: 14px;
}
.search-input-group:focus { background: #000; border-color: #ffc107; }

.search-btn-group {
    background: #ffc107; color: #000; border: none;
    padding: 0 20px;
    font-weight: bold; font-size: 14px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* === PC端 响应式布局 (>=992px) === */
@media (min-width: 992px) {
    body { padding-top: 80px; }

    .navbar {
        padding: 10px 0;
        flex-direction: row;
        align-items: center;
    }

    .navbar .container {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        max-width: 1320px;
    }

    .brand-row {
        width: auto;
        min-width: 180px;
        margin-bottom: 0;
        justify-content: flex-start;
        margin-right: 0;
        order: 1;
    }

    .search-row {
        width: auto;
        padding: 0;
        margin-bottom: 0;
        flex: 1;
        justify-content: center;
        order: 2;
    }
    .search-group { width: 400px; }

    .nav-row {
        width: auto;
        padding: 0;
        overflow: visible;
        margin-left: 20px;
        order: 3;
    }
    .nav-link-item {
        background: transparent;
        padding: 5px 10px;
        margin: 0 5px;
        font-size: 16px;
    }
    .nav-link-item.active {
        background: transparent;
        color: #ffc107;
        position: relative;
    }
    .nav-link-item.active::after {
        content: ''; position: absolute; bottom: 0; left: 5px; right: 5px; height: 2px; background: #ffc107;
    }
}

/* === 广告位 === */
.ad-banner {
    width: 100%; height: 118px;
    background: #222; border: 1px dashed #444; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    margin: 0 0 5px;
}
.ad-tag { position: absolute; top: 0; right: 0; background: #444; color: #ccc; font-size: 10px; padding: 1px 4px; }
.ad-text { text-align: center; color: #888; font-size: 14px; }

/* 【新增】左上角地区 */
.badge-area {
    position: absolute; top: 0; left: 0;
    background: rgba(0,0,0,0.6);
    color: #fff; font-size: 11px; padding: 2px 6px;
    border-bottom-right-radius: 6px;
}

/* === 筛选页样式 (List Page) === */
.filter-box {
    background: #1a1a1a;
    padding: 10px 10px; /* 减小内边距，给标签更多空间 */
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #333;
}
.filter-row {
    display: flex;
    align-items: baseline; /* 基线对齐 */
    margin-bottom: 8px;
    /* 【修复2】允许换行，这样手机端标签多了会自动到第二行 */
    flex-wrap: wrap;
    overflow: visible;
    white-space: normal;
}
.filter-row:last-child { margin-bottom: 0; }

.filter-label {
    color: #666;
    font-size: 13px;
    margin-right: 5px;
    flex-shrink: 0;
    font-weight: bold;
}
.filter-item {
    color: #aaa;
    font-size: 13px;
    padding: 3px 8px; /* 减小一点内边距 */
    margin: 0 2px 5px 0; /* 增加底部间距以适应换行 */
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
}
.filter-item:hover { color: #fff; background: #333; }
.filter-item.active {
    background: #ffc107;
    color: #000;
    font-weight: bold;
}

.pagination-box {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    padding-bottom: 20px;
}
.page-btn {
    background: #333;
    color: #fff;
    border: 1px solid #444;
    padding: 6px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}
.page-btn:hover { background: #444; }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === 其他通用样式 === */
.section-header { display: flex; justify-content: space-between; align-items: center; margin: 25px 0 15px; padding-left: 10px; border-left: 4px solid #ffc107; }
.section-title { font-size: 18px; font-weight: bold; color: #fff; margin: 0; }
.section-more { font-size: 13px; color: #666; }
.section-more:hover { color: #ffc107; }
.video-grid { --bs-gutter-x: 10px; --bs-gutter-y: 20px; }
.video-item { display: block; position: relative; transition: transform 0.2s; }
.video-item:hover { transform: translateY(-5px); z-index: 2; }
.video-item:hover .title { color: #ffc107; }
.poster { position: relative; padding-top: 140%; background: #222; border-radius: 6px; overflow: hidden; margin-bottom: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
.poster img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s; }
.badge-rate { position: absolute; top: 5px; right: 5px; background: rgba(255, 165, 0, 0.9); color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 3px; }
.badge-note { position: absolute; bottom: 0; right: 0; width: 100%; background: linear-gradient(transparent, rgba(0,0,0,0.8)); color: #ddd; font-size: 11px; padding: 20px 5px 2px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title { font-size: 14px; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; display: block; text-align: center; }
.subtitle { font-size: 12px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; text-align: center; }
@media (max-width: 768px) { .title { font-size: 12px; } .badge-note { font-size: 10px; } }
.player-wrapper { position: relative; padding-bottom: 56.25%; background: #000; border-radius: 6px; overflow: hidden; }
#dplayer, #web-player { position: absolute; top:0; left:0; width:100%; height:100%; }
.ad-right-top { width: 100%; position: relative; padding-bottom: 168.75%; background: #1e1e1e; border: 1px dashed #444; border-radius: 6px; margin-bottom: 20px; }
.ad-content { position: absolute; top:0; left:0; width:100%; height:100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
@media (max-width: 992px) { .ad-right-top { padding-bottom: 56.25%; margin-top: 15px; } }
.ad-bottom { height: 90px; margin: 20px 0; background: #222; border: 1px dashed #444; display: flex; align-items: center; justify-content: center; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
.ep-btn { background: #222; border: 1px solid #333; color: #aaa; width: 100%; font-size: 12px; }
.ep-btn.active { background: #ffc107; color: #000; border-color: #ffc107; }
.d-none-im { display: none !important; }
.clamp-box { display: flex; align-items: baseline; }
.text-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; flex: 1; }
.text-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; flex: 1; }
.text-expanded { -webkit-line-clamp: unset; display: block; }
.toggle-btn { font-size: 12px; color: #ffc107; cursor: pointer; border: none; background: transparent; padding: 0 0 0 5px; white-space: nowrap; display: none; }
.rec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.rec-item { display: block; position: relative; min-width: 0; overflow: hidden; }
.rec-poster { position: relative; padding-top: 140%; background: #333; border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.rec-poster img { position: absolute; top:0; left:0; width:100%; height:100%; object-fit: cover; }
.rec-title { font-size: 13px; color: #ddd; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 90%; margin: 0 auto; display: block; }
@media (max-width: 768px) { .rec-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; } .rec-title { font-size: 11px; } }
.hot-item { display: flex; gap: 10px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #222; }
.hot-img { width: 70px; height: 100px; object-fit: cover; background: #333; flex-shrink: 0; border-radius: 4px; }
.hot-index { width: 20px; height: 20px; background: #333; color: #fff; font-size: 12px; font-weight: bold; border-radius: 4px; margin-right: 5px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hot-item:nth-child(1) .hot-index { background: #d63031; }
.hot-item:nth-child(2) .hot-index { background: #e17055; }
.hot-item:nth-child(3) .hot-index { background: #fdcb6e; color: #000; }
.info-card { display: flex; gap: 15px; background: #1a1a1a; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.info-poster img { width: 140px; border-radius: 6px; }
@media (max-width: 768px) { .info-poster img { width: 100px; } .info-card { padding: 15px; } }
.tag-badge { background: #333; color: #ccc; padding: 0 8px; font-size: 12px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; height: 22px; }
.note-badge { background: #333; color: #ccc; font-size: 12px; padding: 0 10px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; height: 24px; min-width: 50px; border: 1px solid #444; }
.site-footer { border-top: 1px solid #222; padding: 40px 0; margin-top: 60px; text-align: center; color: #555; font-size: 13px; background: #151515; }
#back-to-top { position: fixed; bottom: 80px; right: 20px; z-index: 999; width: 40px; height: 40px; background: #ffc107; color: #000; border-radius: 50%; border: none; display: none; justify-content: center; align-items: center; font-weight: bold; cursor: pointer; }
.accordion-item { background: #1e1e1e; border-color: #333; }
.accordion-button { background: #252525; color: #ddd; font-size: 14px; }
.accordion-button:not(.collapsed) { background: #333; color: #ffc107; }
.accordion-body { font-size: 13px; color: #aaa; line-height: 1.6; }