/* 搜索页面专用样式 */

/* 强制导航栏在所有屏幕尺寸下都固定在顶部 */
[class~="header"] {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
}

/* 导航栏背景色与黑色主题保持一致 */
[class~="header"] {
    background: #222328 !important;
    /* 黑色主题的导航栏背景色 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5) !important;
}

/* 移除body的padding-top，避免影响固定导航 */
body {
    padding-top: 0;
}

/* 搜索容器使用padding-top来避开固定导航 */
[class~="search-container"] {
    padding-top: 85px;
    /* 导航栏高度55px + 额外间距30px */
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 20px;
}

[class~="search-header"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[class~="search-header"] h1 {
    font-size: 20px;
    margin: 0;
    color: #fff;
}

[class~="search-header"] [class~="keyword"] {
    color: #FFD700;
    font-weight: bold;
}

[class~="search-header"] [class~="count"] {
    color: #FFD700;
    font-weight: bold;
    font-size: 22px;
}

/* 搜索结果网格样式 */
[class~="search-results"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

/* 影片卡片样式 */
[class~="movie-card"] {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[class~="movie-card"]:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

[class~="movie-card"] a {
    display: block;
    text-decoration: none;
    color: inherit;
}

[class~="movie-poster"] {
    position: relative;
    width: 100%;
    padding-bottom: 140%;
    /* 固定宽高比 */
    overflow: hidden;
    background: #f0f0f0;
}

[class~="movie-poster"] img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

[class~="movie-overlay"] {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

[class~="movie-card"]:hover [class~="movie-overlay"] {
    opacity: 1;
}

[class~="movie-score"] {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 153, 0, 0.95);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

[class~="movie-info"] {
    padding: 10px;
    background: #fff;
}

[class~="movie-title"] {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

[class~="movie-card"]:hover [class~="movie-title"] {
    color: #FF9900;
}

[class~="movie-meta"] {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

[class~="movie-year"] {
    color: #666;
}

[class~="movie-type"] {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #666;
}

/* 无结果提示 */
[class~="no-results"] {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

[class~="no-results"] h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* 分页样式 */
[class~="pagination"] {
    text-align: center;
    margin: 40px 0;
    padding: 20px 0;
}

[class~="pagination"] a {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

[class~="pagination"] a:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-2px);
}

[class~="pagination"] [class~="current"] {
    background: #667eea;
    color: #fff;
    font-weight: bold;
}

[class~="pagination"] [class~="disabled"] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 响应式布局 */
@media (max-width: 991px) {

    /* 移除body的padding，保持导航固定 */
    body {
        padding-top: 0;
    }

    /* 调整搜索容器的padding */
    [class~="search-container"] {
        padding-top: 75px;
        /* 稍微减少移动端的顶部间距 */
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 768px) {

    /* 小屏幕调整 */
    body {
        padding-top: 0;
        /* 保持为0 */
    }

    [class~="search-results"] {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    [class~="search-container"] {
        padding-top: 70px;
        /* 使用padding-top代替margin-top */
        padding-left: 10px;
        padding-right: 10px;
    }

    [class~="search-header"] h1 {
        font-size: 16px;
    }

    [class~="search-header"] {
        padding: 15px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {

    /* 超小屏幕调整 */
    body {
        padding-top: 0;
        /* 保持为0 */
    }

    [class~="search-results"] {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    [class~="search-container"] {
        margin-top: 5px;
        padding: 8px;
    }

    [class~="movie-info"] {
        padding: 8px;
    }

    [class~="movie-title"] {
        font-size: 12px;
    }

    [class~="search-header"] {
        padding: 12px;
        margin-bottom: 15px;
    }

    [class~="search-header"] h1 {
        font-size: 14px;
    }
}
