/* 搜索页面样式 */
.search {
    padding: 8px 0;
    min-height: 600px;
    background: var(--light-bg);
}

/* 使用网站主题变量 */
:root {
    --primary-color: #4cad46;
    --primary-dark: #3a8f35;
    --secondary-color: #3498db;
    --text-color: #333;
    --light-text: #fff;
    --bg-dark: #2c3e50;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

.search_box {
    margin: 0;
}

/* 筛选区域 */
.search_filter {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filter_title {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.filter_group {
    margin-bottom: 25px;
}

.filter_label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

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

.filter_list li {
    margin-bottom: 8px;
}

.filter_list li a {
    display: block;
    padding: 8px 12px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
}

.filter_list li a:hover {
    background: var(--primary-color);
    color: white;
}

.filter_list li.active a {
    background: var(--primary-color);
    color: white;
}

/* 搜索结果区域 */
.search_results {
    padding-left: 0px;
}

.search_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 20px;
    background: white;
    border: 1px solid rgba(76, 175, 80, 0.1);
    box-shadow: var(--shadow);
    border-radius: 8px;
}

.search_info h1 {
    font-size: 24px;
    color: var(--text-color);
    margin: 0 0 8px 0;
    font-weight: 600;
}

.keyword {
    color: var(--primary-color);
    font-weight: bold;
    background: rgba(76, 175, 80, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.result_count {
    color: var(--text-color);
    font-size: 14px;
    margin: 0;
    opacity: 0.8;
}

.search_sort {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search_sort span {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

.sort_select {
    padding: 8px 12px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 6px;
    background: white;
    color: var(--text-color);
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
}

.sort_select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* 搜索结果列表 */
.search_list {
    margin-bottom: 30px;
}

.search_item {
    background: white;
    border: 1px solid rgba(76, 175, 80, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
}

.search_item:hover {
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.15);
    transform: translateY(-2px);
}

.item_content {
    display: flex;
    width: 100%;
    gap: 24px;
}

.item_cover {
    flex-shrink: 0;
}

.cover_img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.search_item:hover .cover_img {
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.item_details {
    flex: 1;
    min-width: 0;
}

/* 关键词高亮样式 */
.highlight {
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.item_title {
    margin: 0 0 16px 0;
}

.item_title a {
    font-size: 20px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    line-height: 1.4;
    transition: var(--transition);
}

.item_title a:hover {
    color: var(--primary-color);
}

.item_meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.8;
}

.item_meta span {
    display: inline-flex;
    align-items: center;
}

.item_desc {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

.item_stats {
    display: flex;
    gap: 24px;
    font-size: 14px;
    color: var(--text-color);
    opacity: 0.7;
}

.item_stats .stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.item_stats .stat:hover {
    color: var(--primary-color);
    opacity: 1;
}

/* 无结果样式 */
.no_results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-color);
    opacity: 0.7;
}

.no_result_icon {
    font-size: 64px;
    margin-bottom: 24px;
    color: var(--primary-color);
    opacity: 0.5;
}

.no_results h3 {
    font-size: 24px;
    margin: 0 0 16px 0;
    color: var(--text-color);
    font-weight: 600;
}

.no_results p {
    font-size: 16px;
    margin: 0;
    line-height: 1.6;
}

/* 分页样式 */
.search_pagination {
    text-align: center;
    padding: 20px 0;
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 768px) {
    .search {
        padding: 15px 0;
        min-height: 400px;
    }
    
    /* 移动端隐藏搜索筛选 */
    .search_filter {
        display: none;
    }
    
    .search_results {
        padding-left: 15px;
        width: 100%;
    }
    
    .search_header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        margin-bottom: 15px;
        padding: 12px;
        background: white;
        border: 1px solid rgba(76, 175, 80, 0.1);
        box-shadow: var(--shadow);
        border-radius: 8px;
    }
    
    .search_info {
        flex: 1;
        min-width: 0;
    }
    
    .search_info h1 {
        font-size: 16px;
        margin: 0 0 5px 0;
        line-height: 1.3;
        display: block;
        color: var(--text-color);
    }
    
    .result_count {
        display: block;
        margin: 0;
        font-size: 12px;
        color: var(--text-color);
        opacity: 0.8;
    }
    
    .search_sort {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .search_sort span {
        font-size: 12px;
        color: var(--text-color);
    }
    
    .sort_select {
        flex: 1;
        max-width: 120px;
        margin-left: 8px;
        padding: 5px 8px;
        font-size: 12px;
        border: 1px solid rgba(76, 175, 80, 0.3);
        border-radius: 4px;
        color: var(--text-color);
    }
    
    .search_item {
        padding: 15px;
        margin-bottom: 15px;
        border: 1px solid rgba(76, 175, 80, 0.1);
    }
    
    .item_content {
        flex-direction: row;
        gap: 15px;
        align-items: flex-start;
    }
    
    .item_cover {
        float: right;
        width: 120px;
        height: 160px;
    }
    
    .cover_img {
        width: 120px;
        height: 160px;
        object-fit: cover;
        object-position: center;
        border-radius: 8px;
        background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .item_details {
        width: calc(100% - 135px);
        box-sizing: border-box;
        padding-right: 15px;
    }
    
    .item_title a {
        font-size: 16px;
        color: var(--text-color);
    }
    
    .item_meta {
        flex-direction: column;
        gap: 6px;
        margin-bottom: 12px;
        font-size: 12px;
        color: var(--text-color);
        opacity: 0.8;
    }
    
    .item_desc {
        font-size: 13px;
        margin-bottom: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.4;
        color: var(--text-color);
        opacity: 0.9;
    }
    
    /* 移动端隐藏描述 */
    .item_desc {
        display: none;
    }
    
    .item_stats {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        font-size: 12px;
        flex-wrap: wrap;
        color: var(--text-color);
        opacity: 0.7;
    }
    
    .item_stats .stat {
        flex: 1;
        min-width: 0;
        text-align: center;
        white-space: nowrap;
    }
    
    .no_results {
        padding: 40px 15px;
        color: var(--text-color);
    }
    
    .no_result_icon {
        font-size: 36px;
        margin-bottom: 15px;
        color: var(--primary-color);
        opacity: 0.5;
    }
    
    .no_results h3 {
        font-size: 18px;
        color: var(--text-color);
    }
}

/* 超小屏幕设备优化 */
@media (max-width: 480px) {
    .search {
        padding: 10px 0;
    }
    
    .search_header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        padding: 10px;
        margin-bottom: 12px;
        background: #fff;
        border: 1px solid #e8e8e8;
        box-shadow: 0 0 10px rgba(0,0,0,0.08);
        border-radius: 8px;
    }
    
    .search_info {
        flex: 1;
        min-width: 0;
    }
    
    .search_info h1 {
        font-size: 15px;
        margin: 0 0 3px 0;
        line-height: 1.3;
        display: block;
    }
    
    .result_count {
        display: block;
        margin: 0;
        font-size: 11px;
        color: #666;
    }
    
    .search_sort {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .search_sort span {
        font-size: 11px;
    }
    
    .sort_select {
        font-size: 11px;
        padding: 4px 6px;
        max-width: 100px;
        margin-left: 6px;
    }
    
    .search_item {
        padding: 12px;
    }
    
    .item_content {
        flex-direction: row;
        gap: 12px;
    }
    
    .item_cover {
        float: right;
        width: 120px;
        height: 160px;
    }
    
    .cover_img {
        width: 120px;
        height: 160px;
        object-fit: cover;
        object-position: center;
        border-radius: 8px;
        background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .item_details {
        width: calc(100% - 135px);
        box-sizing: border-box;
        padding-right: 15px;
    }
    
    .item_title a {
        font-size: 15px;
    }
    
    .item_meta {
        font-size: 11px;
    }
    
    .item_desc {
        font-size: 12px;
        -webkit-line-clamp: 3;
    }
    
    .item_stats {
        font-size: 11px;
        justify-content: space-around;
    }
    
    .item_stats .stat {
        flex: none;
    }
}

/* 加载指示器样式 */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    text-align: center;
    padding: 60px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(76, 175, 80, 0.1);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(76, 175, 80, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    color: var(--text-color);
    font-size: 16px;
    margin: 0;
    opacity: 0.8;
}

/* 屏幕阅读器专用样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 图片懒加载优化 - 减少闪动 */
.lazyload {
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.lazyloaded {
    opacity: 1;
}

/* 防止页面加载时的布局偏移 */
.cover_img {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    display: block;
}

/* 优化页面加载动画 */
.search_item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 交错动画延迟 */
.search_item:nth-child(1) { animation-delay: 0.1s; }
.search_item:nth-child(2) { animation-delay: 0.2s; }
.search_item:nth-child(3) { animation-delay: 0.3s; }
.search_item:nth-child(4) { animation-delay: 0.4s; }
.search_item:nth-child(5) { animation-delay: 0.5s; }
.search_item:nth-child(n+6) { animation-delay: 0.6s; }

/* 减少动画对性能的影响 */
@media (prefers-reduced-motion: reduce) {
    .search_item {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .lazyload {
        transition: none;
    }
}

/* 搜索性能优化 */
.search_item {
    will-change: transform, box-shadow;
}

/* 图标样式 */
.icon-eye:before {
    content: "👁️";
    margin-right: 4px;
}

.icon-heart:before {
    content: "❤️";
    margin-right: 4px;
}

.icon-comment:before {
    content: "💬";
    margin-right: 4px;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .search_item:hover {
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    .filter_list li a:hover {
        background: transparent;
        color: #666;
    }
    
    .filter_list li.active a {
        background: var(--primary-color);
        color: white;
    }
}

/* 减少动画对性能的影响 */
@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
        border-top-color: var(--primary-color);
    }
    
    .search_item {
        transition: none;
    }
    
    .filter_list li a {
        transition: none;
    }
}
