/* 全局搜索样式 */

/* 搜索模态框 */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8vh;
    backdrop-filter: blur(5px);
}

.search-overlay {
    width: 100%;
    max-width: 800px;
    margin: 0 20px;
}

.search-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: searchModalSlide 0.3s ease-out;
}

@keyframes searchModalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜索头部 */
.search-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 18px;
    padding: 12px 0;
    background: transparent;
    color: #333;
}

.search-input::placeholder {
    color: #888;
}

.search-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    margin-left: 15px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* 搜索结果区域 */
.search-results {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
}

/* 搜索提示 */
.search-tips {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.search-tips p {
    font-size: 16px;
    margin-bottom: 20px;
}

.search-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.suggestion-tag {
    background: #f0f0f0;
    color: #666;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* 搜索结果 */
.results-header {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.search-result-item {
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.search-result-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
    transform: translateY(-1px);
}

.result-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.result-content {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-url {
    font-size: 12px;
    color: var(--primary-color);
    font-family: monospace;
}

/* 高亮显示 */
mark {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* 无结果状态 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results p {
    font-size: 16px;
    margin-bottom: 10px;
}

.no-results-tips {
    font-size: 14px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-modal {
        padding-top: 5vh;
        align-items: flex-start;
    }
    
    .search-overlay {
        margin: 0 10px;
    }
    
    .search-header {
        padding: 15px;
    }
    
    .search-input {
        font-size: 16px;
    }
    
    .search-results {
        padding: 15px;
        max-height: 70vh;
    }
    
    .search-result-item {
        padding: 12px;
    }
    
    .result-title {
        font-size: 16px;
    }
    
    .search-suggestions {
        gap: 8px;
    }
    
    .suggestion-tag {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .search-modal {
        padding-top: 2vh;
    }
    
    .search-overlay {
        margin: 0 5px;
    }
    
    .search-container {
        border-radius: 8px;
    }
    
    .search-header {
        padding: 12px;
    }
    
    .search-results {
        padding: 12px;
        max-height: 75vh;
    }
}
