/** * 搜索结果页面样式 * Search Results Page Styles */ /* 搜索结果区域 */ .search-results-section { padding: 40px 0; background: #f8f9fa; min-height: 60vh; } .search-results-section .container { max-width: 1300px; margin: 0 auto; padding: 0 20px; } .search-results-header { text-align: center; margin-bottom: 40px; padding-bottom: 20px; border-bottom: 2px solid #e9ecef; } .search-results-header h2 { font-size: 2rem; color: #333; margin-bottom: 10px; font-weight: 600; } .search-results-header p { color: #666; font-size: 1rem; margin: 0; } /* 文章网格布局 */ .posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; margin-bottom: 40px; } /* 文章卡片样式 */ .post-card { background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); transition: all 0.3s ease; overflow: hidden; border: 1px solid #e9ecef; } .post-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); border-color: #126594; } /* 文章缩略图 */ .post-thumbnail { position: relative; height: 400px; overflow: hidden; } .post-thumbnail a { display: block; width: 100%; height: 100%; } .post-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; } .post-thumbnail:hover img { transform: scale(1.05); } /* 无图片占位符 */ .no-image-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); color: #666; height: 100%; width: 100%; transition: all 0.3s ease; } .post-card:hover .no-image-placeholder { background: linear-gradient(135deg, #126594 0%, #1e7e34 100%); color: white; } .no-image-placeholder i { font-size: 2.5rem; margin-bottom: 8px; opacity: 0.7; } .no-image-placeholder span { font-size: 0.9rem; font-weight: 500; } /* 文章内容 */ .post-content { padding: 20px; } .post-title { margin: 0 0 15px 0; font-size: 1.25rem; line-height: 1.4; font-weight: 600; } .post-title a { color: #333; text-decoration: none; transition: color 0.3s ease; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .post-title a:hover { color: #126594; } /* 文章元信息 */ .post-meta { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 15px; font-size: 0.875rem; color: #666; } .post-meta span { display: flex; align-items: center; gap: 5px; } .post-meta i { font-size: 0.8rem; opacity: 0.8; } .post-category a { color: #666; text-decoration: none; transition: color 0.3s ease; } .post-category a:hover { color: #126594; } /* 文章摘要 */ .post-excerpt { color: #666; font-size: 0.95rem; line-height: 1.6; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; } /* 无结果提示 */ .no-posts { text-align: center; background: white; padding: 60px 40px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); max-width: 600px; margin: 0 auto; } .no-posts h3 { color: #333; font-size: 1.5rem; margin-bottom: 15px; font-weight: 600; } .no-posts p { color: #666; margin-bottom: 20px; line-height: 1.6; } .no-posts ul { text-align: left; color: #666; line-height: 1.8; margin: 0; padding-left: 20px; } .no-posts li { margin-bottom: 8px; } /* 分页样式增强 */ .search-results-section .pagination { margin-top: 50px; text-align: center; padding-top: 30px; border-top: 1px solid #e9ecef; } .search-results-section .pagination .page-numbers { display: inline-block; padding: 10px 15px; margin: 0 5px; border-radius: 8px; background: white; color: #333; text-decoration: none; transition: all 0.3s ease; border: 1px solid #e9ecef; font-weight: 500; } .search-results-section .pagination .page-numbers.current { background: #126594; color: white; border-color: #126594; } .search-results-section .pagination .page-numbers:hover:not(.current) { background: #f8f9fa; border-color: #126594; color: #126594; transform: translateY(-2px); } /* 响应式设计 */ @media screen and (max-width: 1024px) { .posts-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; } } @media screen and (max-width: 768px) { .search-results-section { padding: 30px 0; } .posts-grid { grid-template-columns: 1fr; gap: 20px; } .search-results-header h2 { font-size: 1.5rem; } .post-content { padding: 15px; } .post-meta { gap: 10px; font-size: 0.8rem; } .no-posts { padding: 40px 20px; margin: 0 15px; } /* 移动端分页优化:三行布局 */ .search-results-section .pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 30px; padding-top: 20px; } .search-results-section .pagination .page-numbers { display: inline-flex; padding: 8px 12px; margin: 0 2px; font-size: 14px; line-height: 1.2; border: 1px solid #eee; border-radius: 4px; background: #fff; } /* 上一页按钮:独占一行,放在最上面 */ .search-results-section .pagination .prev { width: 100%; order: 1; justify-content: center; margin-bottom: 5px; padding: 10px; background: #fff; border: 1px solid #ddd; } /* 页码:放在中间 */ .search-results-section .pagination .page-numbers:not(.prev):not(.next) { order: 2; } /* 下一页按钮:独占一行,放在最下面 */ .search-results-section .pagination .next { width: 100%; order: 3; justify-content: center; margin-top: 5px; padding: 10px; background: #fff; border: 1px solid #ddd; flex-shrink: 0; } } @media screen and (max-width: 480px) { .post-thumbnail { height: 180px; } .post-title { font-size: 1.1rem; } .search-results-header { margin-bottom: 30px; } .search-results-header h2 { font-size: 1.3rem; } }