﻿/* 搜索弹窗样式保持不变 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 1001;
    display: none;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding-bottom: 100px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-header {
    position: sticky;
    top: 0;
    z-index: 1002;
    padding: 25px 20px 15px;
    background-color: #f8f9fa;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #eaeaea;
}

.search-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #2ecc71;
}

.search-header h2 i {
    font-size: 1.6rem;
}

.search-header p {
    font-size: 0.95rem;
    color: #666;
    text-align: center;
}

.close-search {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(46, 204, 113, 0.1);
    border: none;
    color: #2ecc71;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-search:hover {
    background: rgba(46, 204, 113, 0.2);
    transform: rotate(90deg);
}

.search-main {
    flex: 1;
    padding: 15px 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    margin-top: 20px;
}

.search-input-container {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.search-input-container:focus-within {
    border-color: #2ecc71;
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.2);
}

.search-input {
    flex: 1;
    border: none;
    padding: 20px 25px;
    font-size: 1.1rem;
    border-radius: 50px;
    outline: none;
    background: transparent;
    color: #333;
}

.search-input::placeholder {
    color: #aaa;
}

.search-submit {
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    margin-left: 5px;
}

.search-submit:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.search-submit:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.search-submit i {
    font-size: 1rem;
}

.recent-searches {
    margin-top: 25px;
    padding: 20px;
    background: #fff;
    border-radius: 15px;
    border: 1px solid #eaeaea;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.recent-searches h3 {
    color: #2ecc71;
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-searches h3 i {
    font-size: 1rem;
}

.recent-searches-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style-type: none;
}

.recent-search-item {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.recent-search-item:hover {
    background: #2ecc71;
    color: white;
    border-color: #2ecc71;
    transform: translateY(-2px);
}

.recent-search-text {
    font-size: 0.95rem;
    color: #333;
}

.recent-search-item:hover .recent-search-text {
    color: white;
}

.no-recent-searches {
    color: #95a5a6;
    font-style: italic;
    padding: 10px 0;
    text-align: center;
    width: 100%;
}

.popular-articles {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 4px solid #2ecc71;
}

.popular-articles h3 {
    color: #2ecc71;
    font-size: 1.3rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popular-articles h3 i {
    font-size: 1.1rem;
}

.popular-articles-list {
    list-style-type: none;
}

.popular-article-item {
    padding: 12px 0;
    border-bottom: 1px dashed #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.popular-article-item:hover {
    background-color: #f0f8ff;
    padding-left: 10px;
    border-radius: 8px;
}

.popular-article-item:last-child {
    border-bottom: none;
}

.popular-article-item i {
    color: #2ecc71;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.popular-article-link {
    color: #333;
    text-decoration: none;
    flex: 1;
    transition: color 0.2s ease;
    font-size: 1rem;
    line-height: 1.4;
}

.popular-article-link:hover {
    color: #2ecc71;
}

.loading-item {
    text-align: center;
    justify-content: center;
}

.error-item {
    color: #e74c3c;
    justify-content: center;
}

.no-articles-item {
    color: #7f8c8d;
    justify-content: center;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-header {
        padding: 20px 15px 12px;
    }
    
    .search-main {
        margin-top: 15px;
        padding: 12px 15px;
    }
    
    .search-input-container {
        flex-direction: column;
        border-radius: 20px;
        padding: 0;
        overflow: hidden;
    }
    
    .search-input {
        width: 100%;
        border-radius: 0;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
    }
    
    .search-submit {
        width: 100%;
        border-radius: 0;
        padding: 15px;
        justify-content: center;
        margin-left: 0;
    }
    
    .recent-searches {
        padding: 18px;
        margin-top: 20px;
    }
    
    .recent-searches h3 {
        font-size: 1.1rem;
    }
    
    .recent-search-item {
        padding: 7px 12px;
    }
    
    .recent-search-text {
        font-size: 0.9rem;
    }
    
    .popular-articles {
        padding: 20px;
        margin-top: 25px;
    }
    
    .popular-articles h3 {
        font-size: 1.2rem;
    }
    
    .popular-article-item {
        padding: 10px 0;
    }
    
    .popular-article-link {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .search-header {
        padding: 18px 12px 10px;
    }
    
    .search-header h2 {
        font-size: 1.5rem;
    }
    
    .search-main {
        margin-top: 12px;
        padding: 10px 12px;
    }
    
    .recent-searches {
        padding: 15px;
        margin-top: 18px;
    }
    
    .recent-searches-list {
        gap: 8px;
    }
    
    .popular-articles {
        padding: 18px;
        margin-top: 20px;
    }
    
    .popular-article-item {
        padding: 10px 0;
    }
    
    .popular-article-link {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .search-header {
        padding: 15px 10px 8px;
    }
    
    .search-header h2 {
        font-size: 1.3rem;
    }
    
    .close-search {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }
    
    .search-main {
        margin-top: 10px;
        padding: 8px 10px;
    }
    
    .recent-searches {
        padding: 12px;
        margin-top: 15px;
    }
    
    .recent-searches h3 {
        font-size: 1rem;
    }
    
    .recent-searches-list {
        gap: 6px;
    }
    
    .recent-search-item {
        padding: 6px 10px;
    }
    
    .recent-search-text {
        font-size: 0.85rem;
    }
    
    .popular-articles {
        padding: 15px;
        margin-top: 15px;
    }
    
    .popular-articles h3 {
        font-size: 1.1rem;
    }
    
    .popular-article-item {
        padding: 8px 0;
    }
    
    .popular-article-link {
        font-size: 0.9rem;
    }
}