/* ========== 搜索结果页 ========== */
.search-page-main {
    background-color: #fff;
    /* 抵消 body 的 padding-top，让背景从视口顶(0)铺开、钻到固定导航栏背后，
       消除 header 与内容之间的空隙；padding-top 把内容盒推回 y=90，与首页内容对齐 */
    margin-top: -90px;
    padding-top: 90px;
}

.search-page-container {
    padding-bottom: 60px;
}

/* 搜索首页 */

.search-home-hero {
    text-align: center;
    padding: 48px 20px 40px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 32px;
}

.search-home-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background-color: #fff8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-home-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0 0 28px;
}

.search-home-form {
    display: flex;
    align-items: center;
    max-width: 520px;
    margin: 0 auto;
    background-color: #f5f5f7;
    border-radius: 28px;
    padding: 5px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-home-form:focus-within {
    background-color: #fff;
    border-color: #ffcc80;
}

.search-home-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 12px 20px;
    font-size: 15px;
    color: #333;
    min-width: 0;
}

.search-home-input::placeholder {
    color: #aaa;
}

.search-home-btn {
    flex-shrink: 0;
    height: 42px;
    padding: 0 28px;
    background: linear-gradient(135deg, #ff9800, #e65100);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-home-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

.search-home-section {
    margin-bottom: 24px;
}

.search-history-clear {
    margin-left: auto;
    padding: 0;
    border: none;
    background: none;
    font-size: 12px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.search-history-clear:hover {
    color: #ff9800;
}

.search-history-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-history-item {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.search-history-tag {
    display: inline-block;
    padding: 8px 20px;
    font-size: 15px;
    color: #555;
    background-color: #f5f5f7;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.search-history-tag:hover {
    color: #ff9800;
    background-color: #fff8f0;
    border-color: rgba(255, 152, 0, 0.3);
}

.search-history-empty {
    padding: 20px 0;
    font-size: 18px;
    color: #bbb;
    text-align: center;
}

.search-history-delete {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    color: #999;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.search-history-delete:hover {
    color: #fff;
    background-color: #ff5722;
    border-color: #ff5722;
}

/* 搜索结果摘要 */
.search-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 0;
    margin-bottom: 16px;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.search-summary em {
    font-style: normal;
    color: #ff9800;
    font-weight: 600;
}

.search-summary .divider {
    width: 1px;
    height: 12px;
    background-color: #e0e0e0;
    margin: 0 4px;
}

.sort-tabs {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background-color: #f5f5f7;
    border-radius: 6px;
    padding: 2px;
}

.sort-tab {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    color: #888;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sort-tab:hover {
    color: #555;
}

.sort-tab.active {
    background-color: #fff;
    color: #ff9800;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 结果列表卡片 */
.search-result-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 24px;
    margin-bottom: 24px;
}

.search-pagination-card {
    padding: 16px 24px;
}

/* 搜索结果列表 */
.search-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.search-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-item-poster {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
}

.search-item-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-item-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 8px;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    text-align: center;
}

.search-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.search-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.search-item-title {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: 700;
    color: #222;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.search-item-title:hover {
    color: #ff9800;
}

.search-item-type {
    flex-shrink: 0;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #ff9800;
    background-color: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.35);
    border-radius: 12px;
    line-height: 1.6;
    white-space: nowrap;
}

.search-item-meta-cols {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
    flex: 1;
}

.search-meta-item {
    font-size: 12px;
    display: flex;
    overflow: hidden;
}

.search-meta-item .search-meta-value {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    min-width: 0;
}

.search-meta-desc .search-meta-value {
    -webkit-line-clamp: 2;
}

.search-meta-label {
    color: #999;
    flex-shrink: 0;
}

.search-meta-value {
    display: inline;
    color: #555;
}

.search-item-btn {
    display: inline-block;
    align-self: flex-start;
    margin-top: auto;
    padding: 6px 24px;
    font-size: 13px;
    color: #ff9800;
    border: 1.5px solid #ff9800;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}

.search-item-btn:hover {
    background-color: #ff9800;
    color: #fff;
}

/* 分页 */
.search-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 8px 0 0;
    flex-wrap: wrap;
}

.search-pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn,
.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    color: #555;
    background-color: #f5f5f7;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    gap: 4px;
}

.page-btn:hover,
.page-num:hover {
    background-color: #ff9800;
    color: #fff;
    transform: translateY(-1px);
}

.page-btn {
    font-weight: 500;
}

.page-btn.disabled {
    color: #ccc;
    background-color: #fafafa;
    cursor: not-allowed;
    pointer-events: none;
}

.page-btn.disabled:hover {
    background-color: #fafafa;
    color: #ccc;
    transform: none;
}

.page-num.active {
    background: linear-gradient(135deg, #ff9800, #e65100);
    color: #fff;
    cursor: default;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.page-num.active:hover {
    background: linear-gradient(135deg, #ff9800, #e65100);
    color: #fff;
    transform: none;
}

.page-btn svg {
    width: 14px;
    height: 14px;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 14px;
    color: #999;
    letter-spacing: 2px;
}

.search-pagination-jump {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
}

.search-pagination-jump em {
    font-style: normal;
    color: #ff9800;
    font-weight: 600;
}

.page-jump-input {
    width: 52px;
    height: 36px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}

.page-jump-input::-webkit-inner-spin-button,
.page-jump-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-jump-input:focus {
    border-color: #ff9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.15);
}

.page-jump-btn {
    height: 36px;
    padding: 0 16px;
    background: linear-gradient(135deg, #ff9800, #e65100);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.page-jump-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

/* 空结果卡片 */
.search-empty-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    background-color: #fff8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.search-empty-desc {
    font-size: 14px;
    color: #999;
    margin: 0 0 28px;
}

.search-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, #ff9800, #e65100);
    border: none;
    border-radius: 24px;
    text-decoration: none;
    transition: all 0.3s;
}

.search-empty-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
    color: #fff;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .search-page-main {
        margin-top: -102px;   /* 移动端 body padding-top 为 102px */
        padding-top: 102px;
    }

    .search-page-container {
        padding-bottom: 40px;
    }

    .search-result-card {
        padding: 0 !important;
        background: none;
        box-shadow: none;
    }

    .search-pagination-card {
        padding: 12px !important;
    }

    .search-item {
        padding: 12px;
        gap: 12px;
    }

    .search-item-poster {
        width: 100px;
        height: 135px;
    }

    .search-item-title {
        font-size: 15px;
    }

    .search-meta-item {
        font-size: 12px;
    }

    .search-meta-desc .search-meta-value {
        -webkit-line-clamp: 2;
    }

    .search-item-btn {
        padding: 5px 18px;
        font-size: 12px;
    }

    .search-pagination {
        flex-direction: column;
        gap: 12px;
    }

    .search-pagination-nav {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 6px;
    }

    .page-btn,
    .page-num {
        min-width: 0;
        flex: 1;
        height: 36px;
        padding: 0 4px;
        font-size: 13px;
        border-radius: 10px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }

    .page-btn {
        flex: 2;
        font-weight: 600;
    }

    .page-btn.disabled {
        background: #f5f5f7;
        color: #ccc;
        font-weight: 400;
        box-shadow: none;
    }

    .page-num.active {
        box-shadow: 0 2px 8px rgba(255, 152, 0, 0.35);
    }

    .page-ellipsis {
        width: 20px;
        height: 36px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .search-pagination-jump {
        font-size: 12px;
    }

    .page-jump-input {
        width: 44px;
        height: 32px;
        font-size: 12px;
    }

    .page-jump-btn {
        height: 32px;
        padding: 0 12px;
        font-size: 12px;
    }

    .search-empty-card {
        padding: 60px 20px;
    }

    .search-home-icon,
    .search-home-title {
        display: none;
    }

    .search-home-hero {
        padding: 16px;
        margin-bottom: 20px;
    }

    .search-home-form {
        max-width: 100%;
    }

    .search-home-input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .search-home-btn {
        height: 38px;
        padding: 0 20px;
        font-size: 14px;
    }
}