/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #667eea;
}

.nav-brand i {
    font-size: 2rem;
}

.nav-brand h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #667eea;
}

/* 主要内容区域 */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

/* 搜索区域 */
.search-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.search-container {
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    color: #667eea;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    padding: 0.75rem 0;
    outline: none;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.search-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.filter-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-weight: 500;
    color: #555;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: #667eea;
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.view-btn:hover,
.view-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* 电影区域 */
.movies-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

.results-info {
    color: #666;
    font-size: 0.9rem;
}

/* 电影网格布局 */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* 电影卡片样式 */
.movie-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.movie-poster {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.movie-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.movie-card:hover .movie-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.movie-card:hover .overlay-content {
    transform: translateY(0);
}

.overlay-content i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

.overlay-content span {
    font-size: 1.1rem;
    font-weight: 600;
}

.movie-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.movie-info {
    padding: 1.5rem;
}

.movie-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.4;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.movie-year {
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
}

.movie-genre {
    color: #667eea;
    font-weight: 500;
}

.movie-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 列表视图样式 */
.movies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.movies-list .movie-card {
    display: flex;
    height: 200px;
}

.movies-list .movie-poster {
    width: 150px;
    height: 200px;
    flex-shrink: 0;
}

.movies-list .movie-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 加载和空状态 */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: #667eea;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #555;
}

/* 分页样式 */
.pagination-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn:hover:not(:disabled) {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-number {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.page-number:hover,
.page-number.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* 页脚样式 */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .header .container {
        position: relative;
    }

    .nav-brand h1 {
        font-size: 1.5rem;
    }

    .search-section {
        padding: 1.5rem;
    }

    .search-box {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        border-radius: 15px;
    }

    .search-btn {
        margin-left: 0;
        width: 100%;
    }

    .filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .sort-options {
        justify-content: center;
    }

    .view-options {
        justify-content: center;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .movies-section {
        padding: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }

    .pagination {
        flex-direction: column;
        gap: 1rem;
    }

    .page-numbers {
        justify-content: center;
        flex-wrap: wrap;
    }

    .movies-list .movie-card {
        flex-direction: column;
        height: auto;
    }

    .movies-list .movie-poster {
        width: 100%;
        height: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .main {
        padding: 1rem 0;
    }

    .search-section,
    .movies-section,
    .pagination-section {
        margin-bottom: 1rem;
        padding: 1rem;
    }

    .movies-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .movie-poster {
        height: 350px;
    }

    .nav-brand i {
        font-size: 1.5rem;
    }

    .nav-brand h1 {
        font-size: 1.3rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-card {
    animation: fadeIn 0.5s ease-out;
}

/* 电影详情页样式 */
.back-navigation {
    margin-bottom: 2rem;
}

.back-btn {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.movie-detail {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.movie-detail-content {
    padding: 0;
}

/* 电影主要信息区域 */
.movie-hero {
    display: flex;
    gap: 3rem;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.movie-hero-poster {
    flex-shrink: 0;
    width: 300px;
}

.movie-hero-poster img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.movie-hero-poster img:hover {
    transform: scale(1.02);
}

.movie-hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.movie-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
    margin: 0;
}

.movie-detail-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.movie-detail-meta .movie-year,
.movie-detail-meta .movie-duration {
    background: #f0f0f0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.movie-detail-meta .movie-genre {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.movie-rating-section {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.movie-rating-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffd700;
    color: #333;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.movie-rating-score i {
    font-size: 1.2rem;
}

.rating-number {
    font-size: 1.3rem;
    font-weight: 700;
}

.rating-text {
    font-size: 0.9rem;
}

.movie-popularity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ff6b6b;
    font-weight: 600;
}

.movie-popularity i {
    font-size: 1.2rem;
}

.movie-basic-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: #555;
    min-width: 80px;
}

.info-value {
    color: #333;
}

.movie-short-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* 详情页各个区域 */
.movie-plot-section,
.movie-cast-section,
.movie-reviews-section {
    padding: 3rem;
    border-top: 1px solid #e2e8f0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 2rem;
}

.section-title i {
    color: #667eea;
    font-size: 1.5rem;
}

/* 剧情介绍样式 */
.movie-plot {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
    border-left: 4px solid #667eea;
}

.movie-plot p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin: 0;
    text-align: justify;
}

/* 演员阵容样式 */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.cast-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.cast-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.cast-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.cast-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

/* 评论区域样式 */
.reviews-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.review-card:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reviewer-avatar {
    color: #667eea;
    font-size: 1.8rem;
}

.reviewer-name {
    font-weight: 600;
    color: #333;
}

.review-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-rating i {
    color: #ffd700;
    font-size: 0.9rem;
}

.review-score {
    font-weight: 600;
    color: #333;
    margin-left: 0.25rem;
}

.review-comment {
    color: #666;
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

/* 详情页响应式设计 */
@media (max-width: 768px) {
    .movie-hero {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem;
    }

    .movie-hero-poster {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .movie-detail-title {
        font-size: 2rem;
        text-align: center;
    }

    .movie-rating-section {
        justify-content: center;
        flex-wrap: wrap;
    }

    .movie-basic-info {
        grid-template-columns: 1fr;
    }

    .movie-plot-section,
    .movie-cast-section,
    .movie-reviews-section {
        padding: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
        justify-content: center;
        text-align: center;
    }

    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }

    .cast-card {
        padding: 1rem;
    }

    .cast-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .movie-hero {
        padding: 1.5rem;
    }

    .movie-detail-title {
        font-size: 1.8rem;
    }

    .movie-plot-section,
    .movie-cast-section,
    .movie-reviews-section {
        padding: 1.5rem;
    }

    .movie-plot {
        padding: 1.5rem;
    }

    .cast-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .back-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a67d8;
}