/* 全局变量 */
:root {
    --primary-color: #e50914;
}

/* 基础样式 */
body {
    background: linear-gradient(180deg, #ffffff 0%, #f0f2f5 100%);
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.navbar-toggler {
    border-color: rgba(229, 9, 20, 0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28229, 9, 20, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-link {
    color: #555 !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* 搜索框 */
.search-container {
    position: relative;
    max-width: 400px;
    margin: 0 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.15);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #c7070e;
    transform: translateY(-50%) scale(1.05);
}

/* 页面头部 */
.page-header {
    margin: 2rem 0 2rem;
    padding: 10px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.page-title {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(90deg, rgba(229, 9, 20, 0.05) 0%, transparent 100%);
    border-radius: 4px;
}

.breadcrumb {
    background: transparent;
    padding: 10px 0;
    margin: 5px 0 0;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--primary-color);
}

/* 内容详情区域 */
.content-detail {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.poster-large {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.movie-title-large {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.movie-year {
    color: #666;
    font-size: 1.2rem;
    margin-left: 1rem;
}

.info-label {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 80px;
    display: inline-block;
}

.info-row {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.rating-large {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-left: 1rem;
}

/* 播放器区域 */
.player-section {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

/* 资源来源区域 */
.source-section {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.source-group {
    margin-bottom: 2rem;
}

.source-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.source-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.source-link {
    padding: 0.6rem 1.5rem;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.source-link:hover,
.source-link.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(229, 9, 20, 0.2);
}

/* 筛选功能 */
.filter-section {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 600;
    color: #333;
    min-width: 60px;
    margin-right: 1rem;
    font-size: 0.95rem;
    padding-top: 0.4rem;
    flex-shrink: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.filter-option {
    padding: 0.4rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.filter-option:hover {
    background: #fff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-option.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* 排序功能 */
.sort-section {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.sort-label {
    font-weight: 600;
    color: #333;
    margin-right: 1rem;
    font-size: 0.95rem;
}

.sort-options {
    display: flex;
    gap: 0.5rem;
}

.sort-option {
    padding: 0.4rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sort-option:hover {
    background: #fff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sort-option.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* 章节标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3rem 0 1.5rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
    padding: 0.5rem 1rem;
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(90deg, rgba(229, 9, 20, 0.05) 0%, transparent 100%);
    border-radius: 4px;
}

.more-link {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.more-link:hover {
    background: rgba(229, 9, 20, 0.1);
    transform: translateX(3px);
}

/* 电影卡片链接 */
.movie-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* 电影卡片 */
.movie-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.movie-card-link:hover .movie-card {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(229, 9, 20, 0.15);
    border-color: var(--primary-color);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.movie-poster::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: brightness(0.7);
    z-index: 1;
}

.movie-card-link:hover .movie-poster::before {
    opacity: 1;
}

/* 海报图片样式 */
.poster-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

/* 懒加载样式 */
.poster-image.lazy {
    opacity: 1;
    transition: opacity 0.4s ease-in;
}

.poster-image.lazy-loaded {
    opacity: 1;
}

/* 懒加载占位背景 */
.movie-poster:has(.lazy) {
    background: #f0f2f5;
}

.play-icon {
    position: absolute;
    font-size: 4rem;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    z-index: 2;
}

.movie-card-link:hover .play-icon {
    opacity: 1;
    transform: scale(1);
}

.movie-info {
    padding: 1rem;
}

.movie-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.movie-meta {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.rating {
    color: #ffd700;
    font-weight: bold;
}

/* 海报渐变色 */
.poster-gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.poster-gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.poster-gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.poster-gradient-4 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.poster-gradient-5 { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.poster-gradient-6 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.poster-gradient-7 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.poster-gradient-8 { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.poster-gradient-9 { background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%); }
.poster-gradient-10 { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }

/* 分页 */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
}

.pagination {
    background: rgba(255, 255, 255, 0.98);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.pagination .page-item {
    margin: 0 0.25rem;
}

.pagination .page-link {
    border: none;
    color: #555;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: rgba(229, 9, 20, 0.1);
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(229, 9, 20, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: #ccc;
    background: transparent;
}

/* 页脚 */
.footer {
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #e0e0e0;
    padding: 2rem 0;
    margin-top: 4rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content {
    text-align: center;
    color: #666;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-link {
    color: #555;
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color);
}

.footer-copyright {
    font-size: 0.9rem;
    color: #999;
    margin-top: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
        margin: 1rem 0;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .movie-title-large {
        font-size: 1.3rem;
    }

    .movie-year {
        font-size: 1rem;
    }

    .rating-large {
        font-size: 1rem;
        padding: 0.4rem 1rem;
    }

    .poster-large {
        font-size: 4rem;
    }

    .pagination {
        padding: 0.75rem 1rem;
    }

    .pagination .page-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.9rem;
    }

    .filter-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-label {
        margin-bottom: 0.5rem;
    }

    .sort-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-label {
        margin-bottom: 0.5rem;
    }
}