/* 搜索功能模块 CSS - 从homepage.css中提取 */

/* 搜索区域 */
.homepage-search-section {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 80px 0;
    /* margin: 60px 0; */
    margin: 0px 0;
    position: relative;
    overflow: hidden;
}

.homepage-search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}

.homepage-search-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.homepage-search-title {
    color: white;
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.homepage-search-subtitle {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* 搜索框 */
.homepage-search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.homepage-search-box:hover {
    transform: translateY(-2px);
}

.homepage-search-input {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    outline: none;
}

.homepage-search-input:focus {
    box-shadow: 0 6px 25px rgba(82, 0, 73, 0.15);
    transform: translateY(-2px);
}

.homepage-search-input::placeholder {
    color: #999;
}

.homepage-search-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 20px 40px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.homepage-search-button:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.homepage-search-categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.homepage-search-category {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    transition: background 0.3s;
    backdrop-filter: blur(10px);
}

.homepage-search-category:hover {
    background: rgba(255,255,255,0.3);
    color: white;
    text-decoration: none;
}

/* 搜索结果覆盖层 */
.search-results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-results-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* 搜索结果容器 */
.search-results-container {
    position: absolute;
    width: 90%;
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    max-height: 1500px;
    overflow: hidden;
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

/* 动态计算搜索框位置 */
.search-results-container.positioned {
    top: var(--search-top);
}

/* 搜索结果头部 */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 15px 15px 0 0;
}

.search-results-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.close-search-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #999;
    font-size: 16px;
    transition: color 0.3s ease;
}

.close-search-btn:hover {
    color: #520049;
}

/* 搜索结果列表 */
.search-results-list {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: #f8f9fa;
}

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

.search-result-title {
    font-weight: 600;
    color: #520049;
    margin-bottom: 5px;
    font-size: 16px;
}

.search-result-description {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-no-results {
    padding: 30px 20px;
    text-align: center;
    color: #999;
}

.search-no-results i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 高亮样式 */
.keyword-highlight {
    background-color: #ffeaa7;
    font-weight: bold;
    padding: 0 2px;
}

/* Hero Section 固定高度样式 - 搜索激活时 */
.hero-section.search-active {
    height: var(--hero-fixed-height);
    overflow: hidden;
    transition: none; /* 禁用过渡动画避免闪烁 */
}

.overview-container.search-active {
    height: var(--overview-fixed-height);
    overflow: hidden;
    transition: none;
}

/* 动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .homepage-search-title {
        font-size: 2.5rem;
    }
    
    .homepage-search-subtitle {
        font-size: 1.1rem;
    }
    
    .search-results-container {
        width: 95%;
        margin-top: 10px;
        border-radius: 10px;
    }
    
    .search-results-header {
        border-radius: 10px 10px 0 0;
    }
    
    .homepage-search-category {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .homepage-search-title {
        font-size: 2rem;
    }
    
    .homepage-search-section {
        padding: 50px 0;
    }
    
    .homepage-search-categories {
        gap: 5px;
    }
    
    .homepage-search-category {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
} 