/* SEOFilm - 影视网站模板 */

/* ============ 0. CSS变量 ============ */
:root {
    /* 颜色变量 */
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg-white: #fff;
    --bg-light: #f5f5f5;
    --border-color: #ddd;
    --border-light: #eee;
    --highlight-color: #ff6700;
    --footer-bg: #2c3e50;
    --footer-text: rgba(255,255,255,0.7);
    --footer-link: rgba(255,255,255,0.6);
    
    /* 阴影变量 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 15px rgba(0,0,0,0.1);
    
    /* 过渡变量 */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    
    /* 圆角变量 */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 18px;
}

/* ============ 1. 字体优化 ============ */
@font-face {
    font-family: 'Chinese Sans';
    font-display: swap;
    src: local('PingFang SC'), local('Microsoft YaHei'), local('SimHei');
}

/* ============ 2. 基础样式 ============ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Chinese Sans', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-light);
    overflow: hidden scroll;
    width: 100%;
    position: relative;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 文本元素共有样式 */
h1, h2, h3, h4, h5, h6, .nav-link, .movie-name, .player-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Chinese Sans', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

/* 特殊元素权重样式 */
.nav-link, .player-title {
    font-weight: 500;
}

.movie-name {
    font-weight: 700;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

ul, li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 图片基础样式 */
img {
    max-width: 100%;
    height: auto;
    transition: opacity 0.3s ease-in-out;
}

/* 懒加载图片样式 */
.lazyload {
    opacity: 0;
}

.lazyloaded {
    opacity: 1;
}

/* 清除浮动 */
.clearfix:after {
    content: "";
    display: table;
    clear: both;
}

/* ============ 3. 布局样式 ============ */
/* 统一宽度设置 */
.container,
.footer-text,
.player-box,
.section,
.filter-box {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.container {
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

[class*='col-'] {
    padding: 0 8px;
}

.col-md-3 {width: 25%;}
.col-md-4 {width: 33.333%;}
.col-md-6 {width: 50%;}
.col-md-8 {width: 66.666%;}
.col-md-9 {width: 75%;}
.col-md-12 {width: 100%;}

.main-container {
    margin-top: 10px;
}

/* 播放器样式 */
.player-iframe iframe,
.responsive-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ============ 4. 现代化导航栏 ============ */
.modern-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

/* Logo区域 */
.logo-section {
    display: flex;
    align-items: center;
}

.logo-link {
    display: block;
    line-height: 0;
}

.logo-link img {
    display: block;
    height: 35px;
    width: auto;
    object-fit: contain;
}

/* 主导航 */
.main-nav {
    flex: 1;
    margin: 0 40px;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 6px;
}

.nav-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.nav-link.current {
    background: #3b82f6;
    color: #fff;
}

.nav-text {
    display: block;
}

/* 二级菜单样式 */
.nav-item.dropdown {
    position: relative;
}

.nav-item.dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    margin: 0;
    display: none;
    z-index: 1001;
}

.nav-item.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #374151;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

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

.dropdown-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.dropdown-item.active {
    background: #3b82f6;
    color: #fff;
}

/* 搜索区域 */
.search-section {
    flex-shrink: 0;
}

.search-form {
    position: relative;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 240px;
    height: 35px;
    padding: 0 40px 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 17px;
    background: #f9fafb;
    font-size: 14px;
    color: #374151;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    border: none;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-button:hover {
    background: #2563eb;
}

.search-icon {
    fill: currentColor;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 35px;
    padding: 0 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    gap: 5px;
}

.mobile-menu-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-line {
    width: 14px;
    height: 2px;
    background: #374151;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.menu-text {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
    line-height: 1;
}

/* 移动端菜单样式 */
.mobile-menu {
    position: fixed;
    top: 56px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 56px);
    background: #fff;
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

.mobile-nav {
    padding: 20px;
}

.mobile-nav-link {
    display: block;
    padding: 12px 0;
    color: #374151;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: color 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.current {
    color: #3b82f6;
}

.mobile-nav-item {
    border-bottom: 1px solid #f3f4f6;
}

.mobile-submenu {
    padding: 12px;
    background: #f9fafb;
    margin-top: 8px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mobile-submenu-link {
    display: block;
    padding: 8px 12px;
    color: #6b7280;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 6px;
    text-align: center;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.mobile-submenu-link:hover,
.mobile-submenu-link.active {
    color: #3b82f6;
    border-color: #3b82f6;
    background: #eff6ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-inner {
        height: 56px;
    }
    
    .main-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
        order: 2;
    }
    
    .search-section {
        order: 3;
    }
    
    .search-input {
        width: 200px;
        height: 35px;
        font-size: 13px;
        padding: 0 35px 0 14px;
    }
    
    .search-button {
        width: 25px;
        height: 25px;
        right: 5px;
    }
    
    .logo-link img {
        height: 35px;
    }
}

@media (max-width: 480px) {
    .search-input {
        width: 160px;
    }
}

/* ============ 5. 内容区域 ============ */
.section {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 15px;
    margin-bottom: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    margin: 0;
}

.more {
    color: var(--text-muted);
    font-size: 14px;
}

.more:hover {
    color: var(--highlight-color);
}

/* ============ 6. 影片卡片样式 ============ */
.movie-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
    padding-top: 8px;
}

.grid-item {
    width: 25%;
    padding: 0 8px;
    margin-bottom: 16px;
}

.movie-card {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
    will-change: transform;
    backface-visibility: hidden;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.movie-poster {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
    padding-top: 56.25%; /* 16:9比例 */
    background: #f0f0f0;
}

.movie-poster::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
    opacity: 0.8;
    transition: opacity 0.3s;
    pointer-events: none;
}

.movie-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.movie-card:hover .movie-poster img {
    transform: scale(1.05);
}

/* 影片标签组合样式 */
.movie-remarks,
.movie-score,
.movie-pan {
    position: absolute;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 2px;
    z-index: 2;
}

.movie-remarks {
    top: 10px;
    left: 10px;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
}

.movie-pan {
    bottom: 10px;
    left: 10px;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-score {
    top: 10px;
    right: 10px;
    background-color: var(--highlight-color);
    color: #fff;
}

.movie-duration {
    position: absolute;
    right: 5px;
    bottom: 5px;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 2;
}

.movie-info {
    padding: 5px;
}

.movie-name {
    font-size: 12px;
    margin: 0 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-actor {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============ 7. 分页样式 ============ */
.mac_pages {
    text-align: center;
    padding: 30px 0;
}

.page_info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.page_link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-white);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-md);
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s ease;
}

.page_link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--bg-white);
}

.page_link.page_now {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-white);
}

.page_link.disabled {
    background: var(--bg-light);
    border-color: #e0e0e0;
    color: var(--text-muted);
    cursor: not-allowed;
    pointer-events: none;
}

/* ============ 8. 页脚样式 ============ */
.footer {
    background-color: var(--footer-bg);
    color: #fff;
    padding: 30px 0;
}

.footer-text {
    text-align: center;
    color: var(--footer-text);
    font-size: 14px;
    max-width: 1000px;
    margin: 0 auto 20px;
}

.footer-text p {
    margin-bottom: 10px;
}

.seo-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 15px 0;
}

.seo-footer-links a {
    margin: 0 15px 10px;
    color: var(--footer-link);
    font-size: 14px;
    transition: color var(--transition-fast);
    position: relative;
}

.seo-footer-links a:hover {
    color: #fff;
}

.seo-footer-links a:not(:last-child):after {
    content: '|';
    position: absolute;
    right: -15px;
    color: rgba(255,255,255,0.3);
}

/* ============ 9. 播放器样式 ============ */
.player-box {
    background-color: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
}

.player-title {
    font-size: 16px;
    margin: 0;
    font-weight: normal;
    color: var(--text-color);
    line-height: 1.4;
}

.player-controls {
    display: flex;
    align-items: center;
}

/* 按钮通用样式 */
.prev-btn,
.next-btn,
.detail-btn {
    display: inline-block;
    padding: 4px 12px;
    margin-left: 8px;
    background-color: #f8f9fa;
    border-radius: var(--radius-md);
    color: var(--text-color);
    font-size: 13px;
}

.prev-btn:hover,
.next-btn:hover,
.detail-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.player-container {
    position: relative;
    width: 100%;
    background: #000;
}

.player-iframe {
    position: relative;
    width: 100%;
    height: 600px; /* 设置一个初始高度 */
}

.embed-responsive {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ============ 10. 工具类 ============ */
.text-center {text-align: center;}
.text-right {text-align: right;}
.mb-10 {margin-bottom: 10px;}
.mt-10 {margin-top: 10px;}
.hidden {display: none;}

/* ============ 11. 返回顶部按钮 ============ */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: var(--radius-md);
    background-color: rgba(0, 123, 255, 0.6);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: none;
}

.back-to-top:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* ============ 12. 响应式适配 ============ */
@media (max-width: 992px) {
    .container,
    .footer-text,
    .player-box,
    .section,
    .filter-box {
        max-width: 100%;
    }
    
    .container {
        padding: 0 10px;
        overflow-x: hidden;
    }
    
    .row {
        margin: 0 -6px;
    }
    
    [class*='col-'] {
        padding: 0 6px;
    }
    
    
    /* 播放器调整 */
    .player-iframe {
        height: 500px;
    }
}

@media (max-width: 680px) {

    .grid-item {
        width: 50%;
    }
    
    /* 分页样式调整 */
    .mac_pages {
        padding: 20px 0 15px;
    }
    
    .page_info {
        gap: 6px;
    }
    
    .page_link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
    
    /* 播放器调整 */
    .player-iframe {
        height: 400px;
    }

    .player-header {
        padding: 8px 12px;
    }

    .player-title {
        font-size: 14px;
        line-height: 1.3;
    }

    .prev-btn,
    .next-btn,
    .detail-btn {
        padding: 3px 10px;
        font-size: 12px;
        margin-left: 6px;
    }
    
}

@media (max-width: 576px) {
    /* 分页样式调整 */
    .mac_pages {
        padding: 15px 0;
    }
    
    .page_info {
        gap: 4px;
    }
    
    .page_link {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }
}

/* ============ 13. 跑马灯样式 ============ */
.scroll-text {
    padding: 10px 0;
    width: 100%;
    max-width: 970px;
    margin: 0 auto;
    overflow: hidden;
}

.scroll-text marquee {
    width: 100%;
}

.scroll-text a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.scroll-text a:hover {
    color: var(--primary-color);
}

/* ============ 14. 通用组件样式 ============ */
.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* ============ SVG图标样式 ============ */
.section-title svg {
    vertical-align: middle;
    margin-right: 8px;
    color: #3b82f6;
}

.more svg {
    vertical-align: middle;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.more:hover svg {
    transform: translateX(2px);
}
