/* Search Header (Result Info + Sort Options) */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .search-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    box-shadow: none;
}

.search-result-info {
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}

.result-text {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

:root[data-theme="dark"] .result-text {
    color: #f1f5f9;
}

/* Sort Options - Improved Design */
.sort-options {
    display: flex;
    gap: 0.75rem;
    margin: 0;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .sort-btn {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
    box-shadow: none;
}

.sort-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
}

:root[data-theme="dark"] .sort-btn:hover {
    background: #334155;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.sort-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    font-weight: 700;
    transform: translateY(-2px);
}

:root[data-theme="dark"] .sort-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.sort-icon {
    font-size: 1rem;
}

/* Recommended Keywords - Premium Design */
.recommend-keywords {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.05);
    text-align: center;
}

:root[data-theme="dark"] .recommend-keywords {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #334155;
    box-shadow: none;
}

.recommend-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 1rem;
    display: inline-block;
}

:root[data-theme="dark"] .recommend-label {
    color: #cbd5e1;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    justify-content: center;
}

.tag {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b5563;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

:root[data-theme="dark"] .tag {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
    box-shadow: none;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.25);
    border-color: transparent;
}

/* Sub-Region Filter */
.sub-region-filter {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    text-align: center;
}

:root[data-theme="dark"] .sub-region-filter {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: none;
}

.sub-region-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 1.2rem;
    display: block;
}

:root[data-theme="dark"] .sub-region-label {
    color: #cbd5e1;
}

.sub-region-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.sub-region-btn {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

:root[data-theme="dark"] .sub-region-btn {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
    box-shadow: none;
}

.sub-region-btn:hover {
    background-color: #ffffff;
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

:root[data-theme="dark"] .sub-region-btn:hover {
    background-color: #475569;
    color: #60a5fa;
    border-color: #60a5fa;
}

.sub-region-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .result-text {
        font-size: 1rem;
        width: 100%;
    }

    .filter-sort-wrapper {
        width: 100%;
        justify-content: flex-start !important;
    }

    .sort-options {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .sort-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .sort-icon {
        font-size: 0.9rem;
    }

    .recommend-keywords {
        padding: 1rem;
    }

    .keyword-tags {
        justify-content: center;
    }

    .region-filter {
        gap: 0.4rem;
    }

    .region-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .sub-region-filter {
        padding: 1rem;
    }

    .sub-region-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}