/* ==================== 搜索页样式 ==================== */

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

/* 搜索框区域 */
.search-box-container {
    position: relative;
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: var(--white);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-50%) scale(1.05);
}

/* 搜索历史 */
.search-history {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--white);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-history.show {
    display: block;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.clear-history-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.clear-history-btn:hover {
    color: var(--primary-color);
}

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

.history-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-item:hover {
    background-color: var(--background-color);
}

.history-icon {
    font-size: 16px;
    color: #999;
}

.history-text {
    flex: 1;
    font-size: 15px;
    color: var(--text-color);
}

.history-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 搜索结果 */
.search-results {
    margin-top: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-count {
    font-size: 16px;
    color: #666;
}

.results-count strong {
    color: var(--primary-color);
    font-weight: 600;
}

.sort-select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 结果网格 */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.result-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.result-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.result-image-container {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background-color: var(--background-color);
}

.result-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    padding: 16px;
}

.result-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.result-icon {
    font-size: 14px;
    color: var(--primary-color);
}

.result-time {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* 空状态 */
.empty-results {
    text-align: center;
    padding: 60px 20px;
}

.empty-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-results-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.empty-results-description {
    font-size: 15px;
    color: #666;
}

/* 搜索提示 */
.search-tips {
    background-color: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-top: 30px;
}

.tips-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
}

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

.tips-item {
    padding: 10px 0;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tips-item::before {
    content: "💡";
    font-size: 16px;
}

/* 加载状态 */
.loading-results {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {
    .search-container {
        padding: 16px;
    }

    .search-input {
        padding: 14px 45px 14px 16px;
        font-size: 15px;
    }

    .search-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .result-info {
        padding: 12px;
    }

    .result-name {
        font-size: 15px;
    }

    .result-detail {
        font-size: 13px;
    }

    .empty-results {
        padding: 40px 20px;
    }

    .empty-results-icon {
        font-size: 60px;
    }

    .empty-results-title {
        font-size: 18px;
    }

    .search-tips {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}