/*
Theme Name: GeneratePress Child
Template: generatepress
*/

/* ========== 电影详情页样式 ========== */

.movie-detail-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 顶部横向布局：海报占1/3宽度 */
.movie-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

/* 左侧海报 - 占宽度的三分之一 */
.movie-poster {
    flex: 1;  /* 1份 */
    min-width: 0;
}

.movie-poster img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 右侧信息区 - 占宽度的三分之二 */
.movie-header-info {
    flex: 2;  /* 2份，总宽度3份，海报占1/3 */
}

.no-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    border-radius: 8px;
}

.movie-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    color: #333;
}

.movie-rating {
    background: #f5c518;
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: bold;
    margin-bottom: 15px;
}

.movie-header-info p {
    margin: 10px 0;
    line-height: 1.6;
}

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 12px 0;
}

.info-item {
    font-size: 15px;
}

.info-item a {
    text-decoration: none;
    color: #0073aa;
}

.info-item a:hover {
    text-decoration: underline;
}

/* 下载区域 */
.download-area {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.download-btn {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.download-btn:hover {
    background: #005a87;
}

/* 剧情简介 */
.movie-plot {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #f5c518;
    margin: 30px 0;
}

.movie-plot h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
}

.movie-plot p {
    margin: 0;
    line-height: 1.8;
    color: #555;
}

/* ========== 你可能喜欢 - 四列画报墙 ========== */
.you-may-like {
    margin-top: 40px;
}

.you-may-like-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #01b4e4;
    display: inline-block;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 15px;
}

.recommend-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recommend-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.recommend-card a {
    display: block;
    text-decoration: none;
}

.recommend-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

.no-poster-small {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.recommend-title {
    margin: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #333;
}

.recommend-rating {
    text-align: center;
    font-size: 12px;
    color: #f5c518;
    font-weight: bold;
    margin-bottom: 10px;
}

.no-recommend {
    grid-column: span 4;
    text-align: center;
    color: #999;
    padding: 40px;
}

/* ========== 手机自适应 ========== */
@media (max-width: 992px) {
    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .movie-detail-page {
        padding: 15px;
    }
    
    .movie-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .movie-poster {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .movie-header-info {
        text-align: center;
    }
    
    .movie-title {
        font-size: 22px;
    }
    
    .movie-rating {
        display: block;
        width: fit-content;
        margin: 0 auto 15px;
    }
    
    .info-row {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .download-buttons {
        justify-content: center;
    }
    
    .movie-plot h3 {
        font-size: 18px;
    }
    
    .you-may-like-title {
        font-size: 18px;
    }
    
    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .recommend-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .no-recommend {
        grid-column: span 1;
    }
}

/* ========== 电影列表页样式 ========== */
.movie-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.archive-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.movie-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

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

.movie-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.no-poster-card {
    background: #f0f0f0;
    aspect-ratio: 2/3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.movie-card h3 {
    margin: 12px;
    font-size: 16px;
    text-align: center;
}

.movie-card .director,
.movie-card .rating {
    margin: 0 12px 12px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

.movie-card .rating {
    color: #f5c518;
    font-weight: bold;
}

.movie-card a {
    text-decoration: none;
    color: #333;
}

/* 分页样式 */
.pagination {
    text-align: center;
    margin-top: 30px;
}

/* ========== 手机自适应 ========== */
@media (max-width: 768px) {
    /* 详情页手机布局 */
    .movie-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .movie-poster {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .movie-info h1 {
        font-size: 22px;
    }
    
    /* 列表页手机布局 */
    .movie-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .movie-card h3 {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .movie-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
        margin: 0 auto;
    }
}

/* ========== 电影列表页 - 横向卡片布局 ========== */
.movie-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.archive-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

/* 列表容器 */
.movie-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 单个电影卡片 - 横向布局 */
.movie-item {
    display: flex;
    gap: 20px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.movie-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* 左侧海报区 */
.movie-item-poster {
    flex-shrink: 0;
    width: 120px;
}

.movie-item-poster a {
    display: block;
    height: 100%;
}

.movie-item-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-poster {
    width: 120px;
    height: 180px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

/* 右侧信息区 */
.movie-item-info {
    flex: 1;
    padding: 15px 15px 15px 0;
}

.movie-item-title {
    margin: 0 0 12px 0;
    font-size: 20px;
}

.movie-item-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s;
}

.movie-item-title a:hover {
    color: #0073aa;
}

/* 导演、类型、主演样式 */
.movie-item-director,
.movie-item-genre,
.movie-item-cast {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.movie-item-director strong,
.movie-item-genre strong,
.movie-item-cast strong {
    color: #333;
}

/* 主演单独处理：可换行 */
.movie-item-cast {
    margin-bottom: 10px;
    word-wrap: break-word;
    word-break: break-word;
}

/* 底部：评分和上映日期在同一行 */
.movie-item-footer {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 5px;
}

.movie-item-rating {
    color: #f5c518;
    font-weight: bold;
    font-size: 14px;
}

.movie-item-date {
    color: #666;
    font-size: 14px;
}

/* 分页样式 */
.pagination {
    text-align: center;
    margin-top: 40px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    text-decoration: none;
    color: #0073aa;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.pagination .page-numbers:hover:not(.current) {
    background: #f0f0f0;
}

/* ========== 手机自适应 ========== */
@media (max-width: 768px) {
    .movie-archive {
        padding: 15px;
    }
    
    .archive-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .movie-item {
        gap: 12px;
    }
    
    .movie-item-poster {
        width: 100px;
    }
    
    .no-poster {
        width: 100px;
        height: 150px;
    }
    
    .movie-item-info {
        padding: 12px 12px 12px 0;
    }
    
    .movie-item-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .movie-item-director,
    .movie-item-genre,
    .movie-item-cast {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .movie-item-footer {
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .movie-item-rating,
    .movie-item-date {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .movie-item-poster {
        width: 85px;
    }
    
    .no-poster {
        width: 85px;
        height: 128px;
        font-size: 10px;
    }
    
    .movie-item-title {
        font-size: 14px;
    }
    
    .movie-item-director,
    .movie-item-genre,
    .movie-item-cast {
        font-size: 11px;
    }
    
    /* 主演换行显示更清晰 */
    .movie-item-cast {
        line-height: 1.4;
    }
    
    .movie-item-footer {
        gap: 12px;
    }
}

/* ========== 首页布局样式 ========== */

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

/* 每一行：2列网格 */
.home-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

/* 每个模块卡片 */
.home-col {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.home-col:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 模块头部：标题 + 更多链接 */
.module-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 15px 20px;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
}

.module-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.module-more {
    font-size: 13px;
    color: #0073aa;
    text-decoration: none;
}

.module-more:hover {
    text-decoration: underline;
}

/* 电影文字链接样式 - 更粗、更显眼 */
.movie-text-list li a {
    font-weight: 600;
    color: #01b4e4;
    font-size: 15px;
    transition: color 0.2s;
}

.movie-text-list li a:hover {
    color: #032541;
    text-decoration: underline;
}

/* 模块标题样式 - 参考TMDB */
.module-title {
    font-weight: 700;
    color: #032541;
    font-size: 20px;
    letter-spacing: -0.3px;
}

/* 更多链接样式 */
.module-more {
    font-weight: 500;
    color: #01b4e4;
}

/* 评分标签样式 */
.rating-badge {
    background: #01b4e4;
    color: #fff;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

/* 电影列表 */
.module-movies {
    padding: 5px 0;
}

.movie-text-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.movie-text-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}

.movie-text-list li:last-child {
    border-bottom: none;
}

.movie-text-list li:hover {
    background: #fafafa;
}

.movie-text-list li a {
    text-decoration: none;
    color: #333;
    flex: 1;
}

.movie-text-list li a:hover {
    color: #0073aa;
}

/* 评分标签 */
.rating-badge {
    font-size: 12px;
    color: #f5c518;
    background: #fff8e0;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* 暂无电影提示 */
.no-movies {
    color: #999;
    text-align: center;
    padding: 20px;
}

/* ========== 手机自适应 ========== */
@media (max-width: 768px) {
    .homepage {
        padding: 15px;
    }
    
    .home-row {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .module-header {
        padding: 12px 15px;
    }
    
    .module-title {
        font-size: 16px;
    }
    
    .movie-text-list li {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* ========== 顶部4列海报墙样式 ========== */

.featured-movies {
    margin-bottom: 50px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #01b4e4;
    display: inline-block;
    color: #032541;
}

/* 4列网格布局 */
.posters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* 单个海报卡片 */
.poster-card {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.poster-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 海报图片容器 - 保持2:3比例 */
.poster-card a {
    display: block;
    position: relative;
    overflow: hidden;
}

.poster-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

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

/* 暂无海报占位符 */
.no-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* 海报标题 */
.poster-title {
    margin: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: #333;
}

.poster-title a {
    text-decoration: none;
    color: #333;
}

.poster-title a:hover {
    color: #01b4e4;
}

/* 评分徽章 */
.poster-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #f5c518;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

/* ========== 手机自适应 ========== */
@media (max-width: 992px) {
    .posters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 20px;
    }
    
    .posters-grid {
        gap: 12px;
    }
    
    .poster-title {
        font-size: 14px;
        margin: 8px;
    }
}

@media (max-width: 480px) {
    .posters-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
        margin: 0 auto;
    }
}

/* ========== 全站搜索框样式 ========== */

.global-search-container {
    background: #f8f9fa;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

.global-search-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.global-search-form {
    max-width: 50%;           /* 总宽度为父容器的50% */
    margin: 0 auto;           /* 居中 */
    display: flex;
    gap: 8px;
    align-items: center;
}

.global-search-input {
    flex: 2;                  /* 占据更多空间 */
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
}

.global-search-input:focus {
    border-color: #0073aa;
}

.global-search-button {
    flex-shrink: 0;
    padding: 10px 18px;
    background: #0073aa;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.global-search-button:hover {
    background: #005a87;
}

.favorite-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.favorite-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
    background: #fff;
}

/* ========== 手机自适应 ========== */
@media (max-width: 768px) {
    .global-search-container {
        padding: 15px 0;
    }
    
    .global-search-form {
        max-width: 100%;      /* 手机上占满宽度 */
        flex-wrap: wrap;
    }
    
    .global-search-input {
        flex: 1;
        width: 100%;
        order: 1;
    }
    
    .global-search-button {
        flex: 1;
        order: 2;
    }
    
    .favorite-btn {
        flex: 1;
        order: 3;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .global-search-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .global-search-input,
    .global-search-button,
    .favorite-btn {
        width: 100%;
    }
}

/* 搜索结果页样式 */
.search-results-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.search-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.search-title {
    font-size: 24px;
    margin-bottom: 10px;
}

.search-result-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-result-poster {
    flex-shrink: 0;
    width: 80px;
}

.search-result-poster img {
    width: 100%;
    border-radius: 4px;
}

.search-result-info h3 {
    margin: 0 0 8px 0;
}

.search-result-info h3 a {
    text-decoration: none;
    color: #333;
}

.search-result-info p {
    margin: 5px 0;
    font-size: 14px;
}

@media (max-width: 768px) {
    .search-result-item {
        flex-direction: column;
        text-align: center;
    }
    
    .search-result-poster {
        margin: 0 auto;
    }
}