﻿/* 搜索结果容器 */
.side_commend {
    width: 100%;
    margin-top: 10px;
    padding: 10px 10px 5px;
    background: #ffffff;
}

.side_commend .title {
    display: flex;
    align-items: center;
    flex-flow: wrap;
    width: 100% !important;
    font-weight: 700;
    color: #555;
    font-size: 1.1em;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}

/* 搜索结果区域 - 修复布局 */
.flex {
    display: block !important; /* 改为块级布局 */
    width: 100%;
    margin-bottom: 20px;
}

/* 单个搜索结果条目 */
.searchresult {
    width: 100% !important;
    display: flex !important; /* 保持flex布局但调整为单列 */
    flex-direction: row;
    margin: 0 0 20px 0 !important; /* 调整边距 */
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    line-height: 1.7em;
}

/* 最后一个搜索结果去除底部边框 */
.searchresult:last-child {
    border-bottom: none;
}

/* 图片容器 */
.img_span {
    position: relative;
    margin-right: 20px;
    flex-shrink: 0; /* 防止图片被压缩 */
}

.img_span a {
    width: 100px;
    height: 133px;
    overflow: hidden;
    display: block;
}

/* 图片标签（连载/全本） */
.img_span span {
    width: 100px;
    height: 25px;
    background: rgba(0, 0, 0, .4);
    display: flex;
    position: absolute;
    top: 108px;
    color: #fff;
    justify-content: center;
    align-items: center;
    font-size: 12px;
}

/* 全本图标特殊样式 */
span[class=full] {
    background: rgba(191, 44, 36, .75);
}

/* 搜索结果内容区域 */
.searchresult > div:last-child {
    flex: 1; /* 占据剩余空间 */
    margin-top: 0;
    min-height: 133px; /* 设置最小高度与封面一致 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 搜索结果标题 */
.searchresult h3 {
    font-size: 1.2em;
    display: block;
    height: auto !important; /* 移除固定高度限制 */
    line-height: 1.4em;
    margin-bottom: 8px;
    overflow: visible;
}

/* 高亮关键词 */
.hot {
    color: #ed4259;
}

/* 作者和元信息 */
.searchresult p {
    height: auto !important; /* 移除固定高度限制 */
    line-height: 1.6em;
    margin-bottom: 8px;
    overflow: visible;
}

.fa-user-circle-o {
    color: #666;
}

/* 灰色文字（字数、更新时间） */
.s_gray {
    color: #969ba3;
    font-size: 12px;
}

/* 搜索结果描述 - 核心修改：控制显示行数 */
.searchresult_p {
    height: 3.2em !important; /* 控制高度为3.2行（约51px） */
    line-height: 1.6em !important;
    overflow: hidden !important;
    margin: 10px 0 15px 0 !important;
    color: #666;
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制显示2行 */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

/* 最新章节链接 */
.searchresult a[href*="/xiaoshuo/"] {
    color: #1a1a1a;
    text-decoration: none;
    display: block;
    margin-top: auto; /* 自动靠下，确保与封面底部对齐 */
}

.searchresult a[href*="/xiaoshuo/"]:hover {
    color: #ed4259;
    text-decoration: underline;
}

/* 搜索结果中的图片 */
.searchresult img {
    width: 100px;
    height: 133px;
    transition: transform .4s ease-out;
}

.searchresult img:hover {
    transform: scale(1.1);
}

/* 响应式设计 - 手机屏幕适配 */
@media screen and (max-width: 767px) {
    /* 手机端保持左右布局，不改为垂直排列 */
    .searchresult {
        flex-direction: row; /* 保持水平排列 */
        padding: 12px 0; /* 调整内边距 */
    }
    
    /* 调整图片尺寸，适应手机屏幕 */
    .img_span {
        margin-right: 15px;
    }
    
    .img_span a {
        width: 90px; /* 稍微缩小封面尺寸 */
        height: 120px; /* 按比例调整高度 */
    }
    
    .img_span span {
        width: 90px; /* 标签宽度与封面一致 */
        top: 95px; /* 调整标签位置 */
    }
    
    .searchresult img {
        width: 90px;
        height: 120px;
    }
    
    /* 调整右侧内容区域，使其与封面高度一致 */
    .searchresult > div:last-child {
        min-height: 120px; /* 与封面新高度一致 */
    }
    
    /* 手机端简介显示调整为2行，确保与封面高度匹配 */
    .searchresult_p {
        height: 3.2em !important; /* 约2行高度 */
        -webkit-line-clamp: 2; /* 显示2行 */
        line-height: 1.6em !important;
        margin: 5px 0 10px 0 !important;
    }
    
    /* 调整标题和作者信息的大小和间距 */
    .searchresult h3 {
        font-size: 1.1em;
        line-height: 1.3em;
        margin-bottom: 6px;
    }
    
    .searchresult p {
        font-size: 0.9em;
        line-height: 1.5em;
        margin-bottom: 6px;
    }
    
    .s_gray {
        font-size: 11px;
    }
    
    /* 最新章节链接调整 */
    .searchresult a[href*="/xiaoshuo/"] {
        font-size: 0.9em;
    }
}

/* 响应式设计 - 更小的手机屏幕 */
@media screen and (max-width: 479px) {
    .searchresult {
        padding: 10px 0;
    }
    
    .img_span a {
        width: 80px; /* 进一步缩小封面尺寸 */
        height: 106px; /* 按比例调整高度 */
    }
    
    .img_span span {
        width: 80px; /* 标签宽度与封面一致 */
        top: 81px; /* 调整标签位置 */
    }
    
    .searchresult img {
        width: 80px;
        height: 106px;
    }
    
    .searchresult > div:last-child {
        min-height: 106px; /* 与封面新高度一致 */
    }
    
    /* 进一步调整简介显示 */
    .searchresult_p {
        height: 2.8em !important; /* 约2行高度，稍微压缩 */
        -webkit-line-clamp: 2; /* 显示2行 */
        line-height: 1.4em !important;
        margin: 4px 0 8px 0 !important;
    }
    
    .searchresult h3 {
        font-size: 1em;
    }
    
    .img_span {
        margin-right: 12px;
    }
}

/* 注意提示文字 */
.tc {
    text-align: center;
    color: #969ba3;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}