/* ==========================================================================
   🎨 基础全盘重置及主色调设定
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #0c0c0c;
    color: #ffffff;
    padding-bottom: 60px;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   📡 顶栏导航组件
   ========================================================================== */
.navbar {
    background-color: rgba(20, 20, 20, 0.95);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #222;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: #e50914;
    cursor: pointer;
    letter-spacing: 1px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #222;
    border-radius: 30px;
    padding: 5px 15px;
    width: 40%;
    border: 1px solid transparent;
    transition: 0.3s;
}

.search-box:focus-within {
    border-color: #e50914;
    background: #111;
}

.search-box input {
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    width: 100%;
    outline: none;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.lang-btn {
    background: #e50914;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.lang-btn:hover {
    background: #b80710;
}

/* ==========================================================================
   🗂️ 走马灯分类筛选栏
   ========================================================================== */
.genres-container {
    background: #141414;
    border-bottom: 1px solid #222;
    padding: 12px 0;
}

.genres-list {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 8px 20px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
}

.genres-list::-webkit-scrollbar {
    height: 5px;
}
.genres-list::-webkit-scrollbar-track {
    background: #141414;
}
.genres-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}
.genres-list::-webkit-scrollbar-thumb:hover {
    background: #e50914;
}

.genre-item {
    background: #222;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
    border: 1px solid #333;
}

.genre-item:hover, .genre-item.active {
    background: #e50914;
    color: #fff;
    border-color: #e50914;
}

/* ==========================================================================
   🏠 首页板块布局：固定每行6张卡片
   ========================================================================== */
.home-section {
    margin-top: 30px;
    margin-bottom: 40px;
}

.sub-block-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
    border-left: 4px solid #e50914;
    padding-left: 10px;
}

/* ==========================================================================
   🖼️ 电影网格：固定6列，每行6部
   ========================================================================== */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 25px;
}

.movie-card {
    background: #181818;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.4);
}

.movie-img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: #222;
    display: block;
}

.movie-info {
    padding: 12px;
}

.movie-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.score {
    color: #ffc107;
    font-weight: bold;
}

/* ==========================================================================
   📄 影视详情页样式
   ========================================================================== */
.detail-backdrop {
    width: 100%;
    height: 450px;
    background-size: cover;
    background-position: center top;
    position: relative;
}

.backdrop-mask {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(12,12,12,0.2) 0%, rgba(12,12,12,1) 100%);
}

.detail-container {
    position: relative;
    margin-top: -180px;
    z-index: 5;
}

.detail-main {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.detail-img {
    width: 300px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    flex-shrink: 0;
    align-self: flex-start;
}

.detail-info {
    padding-top: 40px;
}

.detail-title {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 8px;
}

.detail-tagline {
    font-size: 18px;
    font-style: italic;
    color: #bbb;
    margin-bottom: 20px;
}

.detail-genres {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.detail-genres span {
    background: rgba(229, 9, 20, 0.2);
    border: 1px solid #e50914;
    color: #fff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 13px;
}

.detail-meta-top {
    font-size: 15px;
    color: #ccc;
    margin-bottom: 25px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.block-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 5px;
}

.block-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 40px; height: 3px;
    background: #e50914;
}

.detail-overview {
    font-size: 16px;
    line-height: 1.6;
    color: #ddd;
    margin-bottom: 30px;
    max-width: 900px;
}

.watch-btn {
    display: inline-block;
    background: #e50914;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    transition: 0.2s;
}

.watch-btn:hover {
    background: #b80710;
    transform: scale(1.05);
}

/* 详情页分栏布局 */
.detail-content-layout {
    display: flex;
    gap: 40px;
}

.content-left {
    flex: 1;
    overflow: hidden;
}

.content-right {
    width: 320px;
    flex-shrink: 0;
}

/* 👥 局部横向演员卡片流 */
.detail-cast {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
}

.detail-cast::-webkit-scrollbar {
    height: 5px;
}
.detail-cast::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

.cast-card {
    background: #181818;
    width: 130px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.cast-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #222;
}

.cast-info {
    padding: 8px;
}

.cast-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cast-character {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 📊 侧边栏 Facts 盒子 */
.meta-box, .keywords-box {
    background: #141414;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.meta-box h3, .keywords-box h3 {
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.meta-item {
    margin-bottom: 12px;
}

.meta-lbl {
    display: block;
    font-size: 12px;
    color: #999;
}

.meta-val {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-top: 2px;
}

.detail-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-keywords span {
    background: #252525;
    border: 1px solid #3a3a3a;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    color: #ccc;
}

/* ==========================================================================
   👤 演员主页独立样式
   ========================================================================== */
.actor-container {
    display: flex;
    gap: 5px;
    padding-top: 40px;
}

.actor-left {
    width: 300px;
    flex-shrink: 0;
}

.actor-left img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.actor-facts {
    background: #141414;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.actor-facts h3 {
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.fact-item {
    margin-bottom: 12px;
    font-size: 14px;
}

.fact-item b {
    color: #999;
    font-size: 12px;
    display: block;
}

.actor-right {
    flex: 1;
    padding-left: 20px;
}

.actor-biography {
    font-size: 15px;
    line-height: 1.6;
    color: #ddd;
    white-space: pre-line;
}

/* ==========================================================================
   📟 分页控制器组件
   ========================================================================== */
.pagination-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}

.page-btn {
    background: #222;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

.page-btn:hover:not(:disabled) {
    background: #e50914;
    border-color: #e50914;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-num {
    font-size: 16px;
    font-weight: 700;
}

/* ==========================================================================
   📱 移动端适配：小屏幕自动减少列数
   ========================================================================== */
@media (max-width: 1400px) {
    .movie-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
@media (max-width: 1100px) {
    .movie-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 800px) {
    .movie-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 550px) {
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 900px) {
    .detail-main { flex-direction: column; gap: 20px; }
    .detail-img { width: 200px; margin: 0 auto; }
    .detail-info { padding-top: 0; text-align: center; }
    .detail-genres, .detail-meta-top { justify-content: center; }
    .detail-content-layout { flex-direction: column; }
    .content-right { width: 100%; }
    .actor-container { flex-direction: column; }
    .actor-left { width: 100%; text-align: center; }
    .actor-left img { width: 200px; }
    .search-box { width: 60%; }
}
/* 新增：标题预隐藏防闪现 */
.sub-block-title {
    visibility: hidden;
    transition: visibility 0.06s linear;
}
.home-section[style*="display: block"] .sub-block-title {
    visibility: visible;
}
/* ===================== 新增：长尾专题观影标签区块（SEO专题入口） ===================== */
.topic-section {
    max-width: 1400px;
    margin: 32px auto;
    padding: 0 20px;
}

.topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.topic-tag {
    padding: 9px 18px;
    background-color: #222;
    border: 1px solid #333;
    color: #ffffff;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.topic-tag:hover {
    background-color: #e50914;
    border-color: #e50914;
}

/* 移动端适配专题栏 */
@media (max-width: 550px) {
    .topic-list {
        gap: 8px;
    }
    .topic-tag {
        padding: 7px 12px;
        font-size: 12px;
    }
}