/* 搜索功能样式 */

#search-container {
    margin-bottom: 20px;
    position: relative;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

#search-input {
    width: 100%;
    padding: 12px 45px 12px 40px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fff;
}

#search-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    font-size: 18px;
    color: #999;
    pointer-events: none;
}

.search-shortcut {
    position: absolute;
    right: 15px;
    padding: 2px 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    pointer-events: none;
}

/* 搜索历史 */
#search-history {
    margin-top: 10px;
}

.search-history {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    margin-top: 8px;
}

.search-history-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-history {
    color: #999;
    cursor: pointer;
    font-size: 12px;
}

.clear-history:hover {
    color: #e74c3c;
}

.search-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.history-tag:hover {
    background-color: #4a90e2;
    color: #fff;
    border-color: #4a90e2;
}

/* 搜索结果 */
#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
}

.search-results-list {
    padding: 15px;
}

.search-results-count {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.search-result-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-size: 15px;
    margin-bottom: 5px;
}

.search-result-title a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
}

.search-result-title a:hover {
    color: #4a90e2;
}

.search-result-title .search-burl {
    color: #999;
    margin-left: 5px;
    font-size: 13px;
}

.search-result-title .search-burl:hover {
    color: #4a90e2;
}

.search-result-desc {
    font-size: 13px;
    color: #666;
    margin: 5px 0;
    line-height: 1.5;
}

.search-result-url {
    font-size: 12px;
    color: #28a745;
    margin: 5px 0;
    word-break: break-all;
    font-family: monospace;
}

.search-result-meta {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.search-category {
    color: #4a90e2;
}

.search-subcategory {
    color: #666;
}

/* 高亮样式 */
.search-result-item mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* 无结果 */
.search-no-results {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #search-container {
        margin-bottom: 15px;
    }
    
    #search-input {
        padding: 10px 40px 10px 35px;
        font-size: 15px;
    }
    
    .search-shortcut {
        display: none;
    }
    
    #search-results {
        max-height: 400px;
        border-radius: 8px;
    }
    
    .search-results-list {
        padding: 10px;
    }
}
