/* 搜索框样式 */
.search-container {
    position: relative;
    max-width: 700px;
    margin: 20px auto;
    padding: 0 15px;
    height: 50px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-wrapper {
    flex: 1;
    position: relative;
}

#searchInput {
    width: 100%;
    height: 50px;
    padding: 0 50px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background-color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

#searchInput:focus {
    border-color: #4a90e2;
    box-shadow: 0 3px 15px rgba(74, 144, 226, 0.2);
}

.search-icon {
    background: url("../img/search.png") no-repeat center / contain;
    position: absolute;
    left: 15px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2;
}

.search-clear {
    background: url("../img/clear.png") no-repeat center / contain;
    position: absolute;
    right: 15px;
    top: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.2s ease, filter 0.2s ease;
    z-index: 2;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
.search-clear.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.search-clear:hover {
    filter: brightness(0.85);
}

/* 星星过滤按钮 */
#starFilter {
    background: url("../img/star.png") no-repeat center / contain;
    min-width: 42px;
    min-height: 42px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
    border: 2px solid #f7d046;
    border-radius: 8px;
    padding: 5px;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
#starFilter:hover {
    opacity: 0.8;
    transform: scale(1.05);
}
#starFilter.active {
    opacity: 1;
    background-color: rgba(247, 208, 70, 0.2);
    border-color: #ffc107;
    box-shadow: 0 0 8px rgba(247, 208, 70, 0.4);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(247, 208, 70, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(247, 208, 70, 0); }
    100% { box-shadow: 0 0 0 0 rgba(247, 208, 70, 0); }
}

/* 搜索结果容器 */
.search-results-container {
    max-width: 1200px;
    margin: 15px auto;
    display: none;
    box-sizing: border-box;
}

.search-result-count {
    text-align: center;
    color: #444;
    margin: 0 0 15px;
    font-size: 14px;
    font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .search-container {
        margin: 15px auto;
        padding: 0 10px;
        height: 45px;
        gap: 8px;
    }

    #searchInput {
        height: 45px;
        padding: 0 45px;
        font-size: 15px;
    }

    .search-icon {
        left: 12px;
    }

    .search-clear {
        right: 12px;
    }

    #starFilter {
        min-width: 36px;
        min-height: 36px;
    }

    .search-results-container {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .search-container {
        padding: 0 5px;
        height: 42px;
        gap: 6px;
    }

    #searchInput {
        height: 42px;
        padding: 0 40px;
        font-size: 14px;
    }

    .search-icon {
        left: 10px;
    }

    .search-clear {
        right: 10px;
    }

    #starFilter {
        min-width: 34px;
        min-height: 34px;
        border-radius: 6px;
        padding: 4px;
    }

    .search-results-container {
        padding: 0 5px;
    }
}
