:root {
--primary-color: #003366;
--secondary-color: #ffcc00;
--accent-color: #004080;
--light-color: #f8f9fa;
--dark-color: #212529;
--gray-color: #6c757d;
--success-color: #28a745;
--font-main: 'Roboto', 'Microsoft YaHei', sans-serif;
--box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
--transition: all 0.3s ease;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: var(--font-main);
color: var(--dark-color);
line-height: 1.6;
background-color: #f9f9f9;
overflow-x: hidden;
}
a {
text-decoration: none;
color: inherit;
}
ul {
list-style: none;
}
.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}
/* 顶部信息栏 */
.top-info-bar {
background-color: var(--primary-color);
color: white;
padding: 8px 0;
font-size: 14px;
}
.top-info-content {
display: flex;
justify-content: space-between;
align-items: center;
}
.top-contact-info span {
margin-right: 20px;
}
.top-contact-info i {
margin-right: 5px;
color: var(--secondary-color);
}
.social-links a {
margin-left: 15px;
color: white;
transition: var(--transition);
}
.social-links a:hover {
color: var(--secondary-color);
}
/* 导航栏 */
header {
background-color: white;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
position: sticky;
top: 0;
z-index: 1000;
}
.header-content {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0;
}
.logo {
display: flex;
align-items: center;
}
.logo-img {
width: 70px;
height: 70px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 10px;
color: white;
font-weight: bold;
font-size: 12px;
}
.logo-text h2 {
font-size: 18px;
font-weight: 700;
color: var(--primary-color);
line-height: 1.2;
}
.logo-text .subtitle {
font-size: 13px;
color: var(--gray-color);
}
nav ul {
display: flex;
}
nav ul li {
position: relative;
}
nav ul li a {
display: block;
padding: 10px 18px;
font-weight: 500;
color: var(--dark-color);
transition: var(--transition);
position: relative;
}
nav ul li a:after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 3px;
background-color: var(--secondary-color);
transition: var(--transition);
transform: translateX(-50%);
}
nav ul li a:hover, nav ul li a.active {
color: var(--primary-color);
}
nav ul li a:hover:after, nav ul li a.active:after {
width: 80%;
}
.nav-cta {
margin-left: 20px;
}
/* 移动端菜单按钮 */
.mobile-menu-btn {
display: none;
flex-direction: column;
justify-content: space-around;
width: 30px;
height: 25px;
background: transparent;
border: none;
cursor: pointer;
padding: 0;
}
.mobile-menu-btn span {
width: 30px;
height: 3px;
background-color: var(--primary-color);
border-radius: 2px;
transition: var(--transition);
}
/* 页面标题区域 */
.page-title {
background-color: var(--primary-color);
color: white;
padding: 40px 0;
position: relative;
}
.page-title-content {
position: relative;
z-index: 2;
}
.page-title h1 {
font-size: 2.2rem;
margin-bottom: 10px;
}
.breadcrumbs {
display: flex;
font-size: 14px;
opacity: 0.9;
}
.breadcrumbs a:hover {
color: var(--secondary-color);
}
.breadcrumbs span {
margin: 0 8px;
}
.breadcrumbs .current {
color: var(--secondary-color);
}
/* 面包屑导航 */
.breadcrumb {
padding: 15px 0;
background-color: var(--light-color);
font-size: 14px;
}
.breadcrumb-content {
display: flex;
flex-wrap: wrap;
}
.breadcrumb-item {
color: var(--gray-color);
}
.breadcrumb-item:not(:last-child):after {
content: '/';
margin: 0 10px;
color: var(--gray-color);
}
.breadcrumb-item a:hover {
color: var(--primary-color);
}
.breadcrumb-item.active {
color: var(--primary-color);
font-weight: 500;
}
/* 新闻列表区域 */
.news-page {
padding: 60px 0;
}
.news-container {
display: grid;
grid-template-columns: 280px 1fr;
gap: 30px;
}
/* 筛选侧边栏 */
.filter-sidebar {
background-color: white;
border-radius: 8px;
padding: 25px;
box-shadow: var(--box-shadow);
height: fit-content;
}
.filter-section {
margin-bottom: 30px;
}
.filter-title {
font-size: 1.2rem;
color: var(--primary-color);
margin-bottom: 15px;
padding-bottom: 8px;
border-bottom: 2px solid var(--secondary-color);
}
.search-box {
position: relative;
margin-bottom: 30px;
}
.search-input {
width: 100%;
padding: 12px 15px 12px 40px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
}
.search-icon {
position: absolute;
left: 15px;
top: 50%;
transform: translateY(-50%);
color: var(--gray-color);
}
.filter-checkbox {
margin-bottom: 12px;
}
.filter-checkbox input {
margin-right: 8px;
}
.filter-checkbox label {
cursor: pointer;
transition: var(--transition);
}
.filter-checkbox label:hover {
color: var(--primary-color);
}
.filter-btn {
background-color: var(--primary-color);
color: white;
border: none;
padding: 10px 15px;
border-radius: 4px;
cursor: pointer;
width: 100%;
margin-top: 10px;
transition: var(--transition);
}
.filter-btn:hover {
background-color: var(--accent-color);
}
.reset-btn {
background-color: transparent;
color: var(--gray-color);
border: 1px solid var(--gray-color);
margin-top: 10px;
}
.reset-btn:hover {
background-color: #f1f1f1;
color: var(--dark-color);
}
/* 热门新闻 */
.popular-news {
margin-top: 40px;
}
.popular-news-item {
display: flex;
margin-bottom: 15px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.popular-news-item:last-child {
border-bottom: none;
}
.popular-news-img {
width: 80px;
height: 80px;
background-color: #e9ecef;
margin-right: 15px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
color: var(--primary-color);
font-size: 12px;
}
.popular-news-content h4 {
font-size: 14px;
margin-bottom: 5px;
transition: var(--transition);
}
.popular-news-content h4:hover {
color: var(--primary-color);
}
.popular-news-date {
font-size: 12px;
color: var(--gray-color);
}
/* 新闻排序和视图切换 */
.news-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 25px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.sort-options {
display: flex;
align-items: center;
}
.sort-label {
margin-right: 10px;
color: var(--gray-color);
}
.sort-select {
padding: 8px 15px;
border: 1px solid #ddd;
border-radius: 4px;
background-color: white;
cursor: pointer;
}
.view-options {
display: flex;
}
.view-btn {
background-color: white;
border: 1px solid #ddd;
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: var(--transition);
}
.view-btn:first-child {
border-radius: 4px 0 0 4px;
}
.view-btn:last-child {
border-radius: 0 4px 4px 0;
}
.view-btn.active, .view-btn:hover {
background-color: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
/* 新闻网格 */
.news-grid {
display: grid;
/*grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));*/
gap: 30px;
margin-bottom: 40px;
}
.news-card {
background-color: white;
border-radius: 8px;
overflow: hidden;
transition: var(--transition);
box-shadow: var(--box-shadow);
display: flex;
flex-direction: column;
}
.news-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}
.news-img-container {
position: relative;
height: 180px;
background-color: #e9ecef;
display: flex;
align-items: center;
justify-content: center;
color: var(--primary-color);
font-weight: bold;
}
.news-img {
max-width: 100%;
max-height: 100%;
object-fit: cover;
}
.news-tag {
position: absolute;
top: 15px;
left: 15px;
background-color: var(--secondary-color);
color: var(--primary-color);
padding: 3px 10px;
border-radius: 4px;
font-size: 12px;
font-weight: 500;
}
.news-content {
padding: 20px;
flex: 1;
display: flex;
flex-direction: column;
}
.news-meta {
display: flex;
justify-content: space-between;
font-size: 13px;
color: var(--gray-color);
margin-bottom: 10px;
}
.news-content h3 {
font-size: 0.9rem;
margin-bottom: 10px;
color: var(--primary-color);
flex: 1;
transition: var(--transition);
}
.news-content h3:hover {
color: var(--accent-color);
}
.news-excerpt {
color: var(--gray-color);
font-size: 14px;
margin-bottom: 15px;
line-height: 1.5;
flex: 1;
}
.read-more {
display: inline-block;
color: var(--primary-color);
font-weight: 500;
font-size: 14px;
transition: var(--transition);
align-self: flex-start;
}
.read-more:hover {
color: var(--accent-color);
padding-left: 5px;
}
.read-more i {
margin-left: 5px;
transition: var(--transition);
}
.read-more:hover i {
transform: translateX(3px);
}
/* 列表视图样式 */
.news-list {
display: none;
flex-direction: column;
gap: 30px;
margin-bottom: 40px;
}
.news-list .news-card {
flex-direction: row;
}
.news-list .news-img-container {
width: 300px;
height: 200px;
flex-shrink: 0;
}
.news-list .news-content {
flex: 1;
}
.news-list .news-excerpt {
margin-bottom: 20px;
}
/* 分页 */
.pagination {
display: flex;
justify-content: center;
align-items: center;
gap: 5px;
}
.page-btn {
width: 40px;
height: 40px;
border-radius: 4px;
border: 1px solid #ddd;
background-color: white;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: var(--transition);
}
.page-btn:hover {
border-color: var(--primary-color);
color: var(--primary-color);
}
.page-btn.active {
background-color: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
.page-btn.disabled {
opacity: 0.5;
cursor: not-allowed;
}
.page-btn.disabled:hover {
border-color: #ddd;
color: inherit;
}
/* 页脚 */
footer {
background-color: var(--primary-color);
color: white;
padding: 60px 0 20px;
}
.footer-content {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 40px;
margin-bottom: 40px;
}
.footer-column h3 {
font-size: 1.3rem;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-column p {
margin-bottom: 15px;
opacity: 0.8;
}
.footer-column ul li {
margin-bottom: 10px;
}
.footer-column ul li a {
opacity: 0.8;
transition: var(--transition);
}
.footer-column ul li a:hover {
opacity: 1;
color: var(--secondary-color);
padding-left: 5px;
}
.footer-bottom {
text-align: center;
padding-top: 20px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
font-size: 14px;
opacity: 0.8;
}
/* 分页样式 */
.fanye { clear: both;padding: 20px 0 0; font-size: 14px;text-align: center; overflow: hidden;text-indent: 0em;}
.fanye > span { margin: auto 16px; }
.fanye .page-numbar { margin: auto 0; }
.fanye .page-numbar .page-num,
.fanye .page-index,
.fanye .page-pre,
.fanye .page-next,
.fanye .page-last { display: inline-block; margin: auto 4px; padding: 4px 15px; /*border: 1px solid #EEE; */border-radius: 2px; }
.fanye .page-numbar .page-num-current,
.fanye .page-numbar .page-num:hover { border-color:#18506D; background:#3a4e71; color: #fff; }
/* 响应式设计 */
@media (max-width: 992px) {
.news-container {
grid-template-columns: 1fr;
}
.filter-sidebar {
margin-bottom: 30px;
}
nav ul {
display: none;
flex-direction: column;
position: absolute;
top: 100%;
left: 0;
right: 0;
background-color: white;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
padding: 20px;
}
nav ul.show {
display: flex;
}
.mobile-menu-btn {
display: flex;
}
.fanye .page-numbar { display: none; }
}
@media (max-width: 768px) {
.news-header {
flex-direction: column;
align-items: flex-start;
gap: 15px;
}
.news-list .news-card {
flex-direction: column;
}
.news-list .news-img-container {
width: 100%;
height: 200px;
}
.top-info-content {
flex-direction: column;
gap: 10px;
text-align: center;
}
.page-title h1 {
font-size: 1.8rem;
}
}
@media (max-width: 576px) {
.news-grid {
grid-template-columns: 1fr;
}
.pagination {
flex-wrap: wrap;
}
}
/* 动画效果 */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.fade-in {
animation: fadeIn 0.5s ease forwards;
}