.search-page {
    padding: var(--section-top) 0;
    background-color: #f2f3f4;
    min-height: calc(100vh - var(--header-height, 80px) - var(--footer-height, 200px));
}

.search-banner {
    background: #fff;
    padding: max(1.6vw, 20px) 0;
    margin-bottom: max(2.4vw, 30px);
    border-bottom: 1px solid #eee;
}

.search-banner h1 {
    font-size: var(--widget-title-p-1-fs);
    color: var(--theme-p-color);
    margin: 0;
    font-weight: 600;
}

.search-count {
    color: #666;
    margin: 10px 0 0;
    font-size: var(--widget-title-p-3-fs);
}

.search-content {
    display: grid;
    grid-template-columns: max(250px, 15vw) 1fr;
    gap: max(2vw, 20px);
    align-items: start;
    min-height: 100vh;
}

/* 左侧锚点导航 */
.search-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: max(1.6vw, 20px);
    height: fit-content;
    max-height: calc(100vh - var(--header-height, 80px) - 40px);
    overflow-y: auto;
    align-self: flex-start;
}

.search-nav h3 {
    font-size: var(--widget-title-p-2-fs);
    color: var(--theme-p-color);
    margin-bottom: max(1.2vw, 16px);
    padding-bottom: max(0.8vw, 10px);
    border-bottom: 1px solid #eee;
    font-weight: 600;
    position: relative;
}

.search-nav h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 40px;
    height: 3px;
    background-color: var(--theme-color);
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li {
    margin-bottom: 12px;
}

.nav-list li:last-child {
    margin-bottom: 0;
}

.nav-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-radius: 4px;
    color: var(--theme-p-color);
    text-decoration: none;
    transition: all var(--animation-duration) ease;
    font-size: var(--widget-title-p-3-fs);
    font-weight: 500;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--theme-color);
    transform: translateX(5px);
}

/* 右侧搜索结果 */
.search-main {
    background: #fff;
    border-radius: 8px;
    padding: max(1.6vw, 20px);
}

.search-section {
    margin-bottom: max(3vw, 40px);
    padding-bottom: max(2vw, 30px);
    border-bottom: 1px solid #eee;
}

.search-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-title {
    font-size: var(--widget-title-p-1-fs);
    color: var(--theme-p-color);
    margin-bottom: max(1.6vw, 20px);
    padding-bottom: max(0.8vw, 10px);
    border-bottom: 1px solid #eee;
    font-weight: 600;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 60px;
    height: 3px;
    background-color: var(--theme-color);
}

.category-block {
    margin-bottom: max(2vw, 30px);
    padding-bottom: max(1.6vw, 20px);
    border-bottom: 1px dashed #eee;
}

.category-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.category-title {
    font-size: var(--widget-title-p-2-fs);
    color: var(--theme-p-color);
    margin-bottom: max(1.2vw, 15px);
    font-weight: 600;
}

.subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: max(1.6vw, 20px);
}

.subcategory-tag {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    color: var(--theme-p-color);
    text-decoration: none;
    font-size: var(--widget-title-p-4-fs);
    transition: all var(--animation-duration) ease;
}

.subcategory-tag:hover {
    background: var(--theme-color);
    color: #fff;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.blog-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.search-result-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--animation-duration) ease;
    height: 100%;
}

.search-result-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--animation-duration) ease;
}

.search-result-item:hover .result-image img {
    transform: scale(1.05);
}

.result-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.result-content h4 {
    font-size: var(--widget-title-p-2-fs);
    margin: 0 0 10px;
    font-weight: 600;
    line-height: 1.4;
}

.result-content h4 a {
    color: var(--theme-p-color);
    text-decoration: none;
    transition: color var(--animation-duration) ease;
}

.result-content h4 a:hover {
    color: var(--theme-color);
}

.result-content p {
    color: #666;
    font-size: var(--widget-title-p-4-fs);
    margin: 0;
    line-height: 1.6;
    flex-grow: 1;
}

.post-card {
    border: 1px solid #eee;
}

.view-more-wrapper {
    text-align: center;
    margin-top: max(1.6vw, 20px);
}

.view-more-btn {
    display: inline-block;
    padding: 8px 20px;
    background: var(--theme-color);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: var(--widget-title-p-3-fs);
    transition: background var(--animation-duration) ease;
}

.view-more-btn:hover {
    background: #005fa3;
}

.no-results {
    text-align: center;
    padding: max(4vw, 50px) 0;
}

.no-results h2 {
    font-size: var(--widget-title-h2-fs);
    color: var(--theme-p-color);
    margin-bottom: max(1.6vw, 20px);
}

.no-results p {
    color: #666;
    font-size: var(--widget-title-p-3-fs);
    max-width: 600px;
    margin: 0 auto;
}

/* 导航父项样式 */
.nav-parent {
    position: relative;
    font-weight: 600 !important;
    padding-right: 30px !important; /* 为箭头留出空间 */
}

.nav-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-arrow::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--animation-duration) ease;
}

.nav-item.active .nav-arrow::after {
    transform: rotate(-135deg);
}

/* 子导航样式 */
.subnav-list {
    list-style: none;
    padding: 0 0 0 15px;
    margin: 8px 0 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--animation-duration) ease;
}

.nav-item.active .subnav-list {
    max-height: 500px; /* 足够大的高度以容纳所有子项 */
}

.subnav-list li {
    margin-bottom: 8px;
}

.subnav-list a {
    padding: 6px 12px;
    font-size: var(--widget-title-p-4-fs);
    color: var(--theme-p-color);
    font-weight: normal;
}

.subnav-list a:hover,
.subnav-list a.active {
    color: var(--theme-color);
}

/* 响应式布局 */
@media (max-width: 991px) {
    .search-content {
        grid-template-columns: 1fr;
    }

    .search-sidebar {
        position: static;
        margin-bottom: max(2.4vw, 30px);
        max-height: none;
    }
    
    .nav-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-list li {
        margin-bottom: 0;
    }
    
    .nav-list a {
        padding: 8px 15px;
    }

    .subnav-list {
        padding: 0;
        margin: 10px 0 0;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-item {
        width: 100%;
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .search-results-grid {
        grid-template-columns: 1fr;
    }
}

/* Add solution grid styles */
.solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: max(2vw, 20px);
    margin-top: max(1.6vw, 20px);
}

@media (max-width: 768px) {
    .solution-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 576px) {
    .solution-grid {
        grid-template-columns: 1fr;
    }
}

/* 分页控件样式 */
.category-pagination {
    margin-top: 20px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.prev-page,
.next-page {
    padding: 8px 15px;
    background: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--widget-title-p-4-fs);
    transition: all var(--animation-duration) ease;
}

.prev-page:hover,
.next-page:hover {
    background: #005fa3;
}

.prev-page:disabled,
.next-page:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.page-indicator {
    font-size: var(--widget-title-p-3-fs);
    color: #666;
}

.current-page {
    font-weight: bold;
    color: var(--theme-color);
} 