/* 搜索页面样式 */
.search-page {
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* 与Categorie页面一致的搜索区域样式 */
.product__area {
    position: relative;
}

.documentation__search {
    position: relative;
}

.documentation__search-inner {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.documentation__search-input {
    position: relative;
}

.documentation__search-input .input-group {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: stretch;
}

.documentation__search-input .flex-grow-1 {
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 10px 0 0 10px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: none;
    outline: none;
    height: 60px;
    line-height: 1.5;
}

.documentation__search-input .flex-grow-1:focus {
    border-color: #5f3afc;
    box-shadow: none;
}

/* 确保搜索按钮样式与categorie页面的m-btn样式一致 */
.documentation__search-input .m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    line-height: 1;
    padding: 0 35px;
    color: #fff;
    background: #5f3afc;
    text-align: center;
    border-radius: 0 6px 6px 0;
    font-weight: 500;
    font-size: 16px;
    text-transform: capitalize;
    position: relative;
    z-index: 1;
    border: 2px solid #5f3afc;
    border-left: none;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease-out 0s;
    margin: 0;
}

.documentation__search-input .m-btn:hover {
    color: #fff;
    box-shadow: 0 14px 20px 0 rgba(37,17,124,0.16);
}

/* 原有的搜索头部区域保持兼容性 */
.search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.search-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.search-form-container {
    position: relative;
    z-index: 2;
}

.search-input-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.search-input-main {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: none;
}

.search-input-main:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.search-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 10px;
    padding: 15px 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* 搜索结果区域 */
.search-results {
    background-color: #ffffff;
}

.search-stats {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px 20px;
    border-left: 4px solid #667eea;
}

.search-stats p {
    color: #495057;
    font-size: 14px;
    margin: 0;
}

.search-filters .filter-group {
    display: flex;
    align-items: center;
}

.search-filters .form-label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    margin-bottom: 0;
}

.search-filters .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    min-width: 150px;
}

.search-filters .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* 搜索控制区域 */
.search-controls {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.search-results-title {
    color: #343a40;
    font-weight: 700;
    margin: 0;
}

.sort-controls {
    gap: 10px;
}

.sort-controls .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.sort-controls .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#orderToggle {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    background: white;
    color: #495057;
}

#orderToggle:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* 搜索结果项目 */
.search-results-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.section-title {
    color: #343a40;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.search-result-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.search-result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.search-result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.search-result-item:hover::before {
    transform: scaleY(1);
}

.result-header {
    margin-bottom: 15px;
}

.result-title {
    margin-bottom: 10px;
}

.result-title a {
    color: #343a40;
    font-weight: 600;
    font-size: 18px;
    transition: color 0.3s ease;
}

.result-title a:hover {
    color: #667eea;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.result-meta .badge {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.meta-info {
    color: #6c757d;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-info i {
    color: #667eea;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-actions .btn {
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.result-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 空状态样式 */
.no-results, .empty-search {
    text-align: center;
    padding: 60px 20px;
}

.no-results i, .empty-search i {
    color: #dee2e6;
    margin-bottom: 20px;
}

.no-results h4, .empty-search h3 {
    color: #6c757d;
    margin-bottom: 15px;
}

.no-results p, .empty-search p {
    color: #adb5bd;
    font-size: 16px;
}

/* 热门搜索标签 */
.popular-searches {
    margin-top: 30px;
}

.popular-searches h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.search-tags .badge {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    background: white !important;
    color: #495057 !important;
    font-weight: 500;
}

.search-tags .badge:hover {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* 分页样式 */
.pagination-wrapper {
    margin-top: 40px;
}

.pagination {
    justify-content: center;
}

.page-item .page-link {
    border: 2px solid #e9ecef;
    color: #495057;
    font-weight: 600;
    border-radius: 8px;
    margin: 0 3px;
    transition: all 0.3s ease;
}

.page-item .page-link:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.page-item:first-child .page-link,
.page-item:last-child .page-link {
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .search-filters {
        margin-top: 20px;
    }
    
    .search-filters .d-flex {
        flex-direction: column;
        gap: 10px;
    }
    
    .sort-controls {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }
    
    .sort-controls .d-flex {
        flex-direction: column;
    }
    
    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .result-actions {
        justify-content: center;
    }

    .documentation__search-inner {
        padding: 15px;
    }
    
    .documentation__search-input .flex-grow-1 {
        padding: 12px 15px;
        font-size: 14px;
        height: 50px;
    }
    
    .documentation__search-input .m-btn {
        height: 50px;
        line-height: 1;
        padding: 0 25px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .search-results-container {
        padding: 20px 15px;
    }
    
    .search-result-item {
        padding: 15px;
    }
    
    .result-title a {
        font-size: 16px;
    }
    
    .search-tags {
        justify-content: flex-start;
    }

    .documentation__search-inner {
        padding: 12px;
    }
    
    .documentation__search-input .flex-grow-1 {
        padding: 10px 12px;
        font-size: 14px;
        height: 46px;
    }
    
    .documentation__search-input .m-btn {
        height: 46px;
        line-height: 1;
        padding: 0 20px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .search-stats {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .search-controls .d-flex {
        flex-direction: column;
        gap: 15px;
    }
    
    .result-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .popular-searches {
        text-align: left;
    }

    .documentation__search-input .input-group {
        flex-direction: row;
    }

    .documentation__search-input .flex-grow-1 {
        padding: 8px 12px;
        font-size: 14px;
        height: 44px;
    }

    .documentation__search-input .m-btn {
        height: 44px;
        line-height: 1;
        padding: 0 15px;
        font-size: 12px;
        margin-left: 0;
    }
}

/* 加载动画 */
.search-result-item {
    animation: fadeInUp 0.6s ease forwards;
}

.search-result-item:nth-child(1) { animation-delay: 0.1s; }
.search-result-item:nth-child(2) { animation-delay: 0.2s; }
.search-result-item:nth-child(3) { animation-delay: 0.3s; }
.search-result-item:nth-child(4) { animation-delay: 0.4s; }
.search-result-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜索输入焦点动画 */
.documentation__search-input {
    position: relative;
    overflow: hidden;
}

.documentation__search-input::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #5f3afc;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.documentation__search-input:focus-within::after {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    overflow: hidden;
}

.search-input-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.search-input-wrapper:focus-within::after {
    width: 100%;
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .search-page {
        background-color: #1a1a1a;
    }
    
    .search-results {
        background-color: #2d2d2d;
    }
    
    .search-results-container {
        background: #2d2d2d;
        color: #f8f9fa;
    }
    
    .search-result-item {
        background: #3a3a3a;
        border-color: #4a4a4a;
    }
    
    .result-title a {
        color: #f8f9fa;
    }
    
    .search-stats {
        background: #3a3a3a;
        color: #f8f9fa;
    }
    
    .search-controls {
        background: #3a3a3a;
        border-color: #4a4a4a;
    }

    .documentation__search-inner {
        background: rgba(45, 45, 45, 0.95);
        color: #f8f9fa;
    }
    
    .documentation__search-input .flex-grow-1 {
        background: #3a3a3a;
        border-color: #4a4a4a;
        color: #f8f9fa;
    }
    
    .documentation__search-input .flex-grow-1:focus {
        border-color: #5f3afc;
    }
}