Files
server/static/css/style.css
T

429 lines
9.6 KiB
CSS

body {
margin: 0;
font-family: "Microsoft YaHei", Arial, Helvetica, sans-serif;
/* 添加线性渐变背景 */
background: linear-gradient(180deg, #E6F0FC, #D5E5F8);
}
.logo {
width: 60px;
height: 60px;
margin-right: 20px;
margin-top: -10px;
}
.flex {
display: flex;
align-items: center;
}
.top-header {
background: #c62828;
color: #fff;
padding: 20px 0;
height: 120px;
display: flex;
align-items: center;
justify-content: space-around;
}
.header-container {
/*width: 100%;*/
/*margin: 0 auto;*/
line-height: 1.0em;
max-width: 1200px;
min-width: 840px;
}
.header-nav {
/*margin: 0 auto;*/
line-height: 1.0em;
display: block;
max-width: 1200px;
}
.nav-main {
background: #1e3a8a;
/*margin: -50px auto 0;*/
text-align: center;
display: flex;
align-items: center;
justify-content: space-around;
}
.nav-main ul {
display: flex;
list-style: none;
padding: 0;
}
.nav-main li {
padding: 15px 20px;
border-left: #c62828 solid 1px;
border-right: #c62828 solid 1px;
}
.nav-main li:hover {
padding: 15px 20px;
background-color: #092268;
}
.nav-main a {
color: #fff;
text-decoration: none;
display: block; /* 确保点击区域填满 li */
}
/* ✅ 新增:激活状态 (Active) */
.nav-main li.active {
background-color: #0d3bac; /* 比 hover 更深,或者用红色 #c62828 突出 */
font-weight: bold; /* 加粗文字 */
position: relative;
}
.banner {
margin-top: -20px;
}
.banner img {
width: 100%;
/*min-width: 1140px;*/
height: 300px;
object-fit: fill;
}
.main {
position: relative; /* 确保 .content 是相对于最近的定位上下文定位 */
background: #ffffff;
max-width: 1200px;
padding-top: 20px;
margin: -50px auto 0 auto;
border: #fff solid 5px;
z-index: 99;
min-height: 800px;
}
.date-bar {
background-color: #c62828;
height: 50px;
/*min-width: 992px;*/
width: 100%;
color: #ffffff;
display: flex;
align-items: center;
/*margin-left: -10px;*/
justify-content: space-between;
margin: 0 0 30px;
}
.search-wrapper {
display: flex;
align-items: center;
background: #ffffff68;
border: 0 solid #ddd; /* 外边框颜色 */
border-radius: 50px; /* 大圆角,形成胶囊效果 */
overflow: hidden; /* 确保内部元素不溢出圆角 */
transition: border-color 0.3s, box-shadow 0.3s;
max-width: 400px; /* 限制最大宽度 */
min-width: 200px; /* 限制最小宽度 */
width: 100%;
padding: 0 10px;
}
/* 聚焦时的效果 */
.search-wrapper:focus-within {
border-color: #1e3a8a; /* 聚焦时变为主题色 (深蓝) */
box-shadow: 0 0 8px rgba(30, 58, 138, 0.2);
}
/* 输入框:去掉默认边框和圆角,让它融入容器 */
.search-input {
flex: 1; /* 占据剩余空间 */
border: none;
outline: none;
padding: 6px;
font-size: 13px;
background: transparent;
color: #333;
}
.search-input::placeholder {
color: #999;
}
/* 按钮:去掉默认样式,固定大小,背景透明或浅色 */
.search-btn {
border: none;
background: transparent; /* 按钮背景色,可与白色区分 */
width: 16px; /* 固定宽度 */
height: 16px; /* 固定高度,与输入框高度匹配 */
border-radius: 50%; /* 按钮自身也是圆的 */
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.3s;
margin-right: 2px; /* 稍微留点缝隙,更有层次感 */
}
.search-btn:hover {
background: #1e3a8a; /* 悬停时变为主题色 */
color: #fff; /* 图标变白 */
}
/* 如果使用的是 FontAwesome 等图标库,确保图标大小合适 */
.search-btn i {
font-size: 18px;
}
.user-icons {
display: flex;
align-items: center;
justify-content: space-evenly;
width: 500px;
}
.swiper-item {
object-fit: fill;
width: 100%;
height: 300px;
}
.main-section {
padding: 0;
/*margin: 0 -15px !important;*/
}
.section {
background: #fff;
padding: 20px;
margin: 20px 0;
}
/*.card {*/
/* flex: 1;*/
/* margin-right: 20px;*/
/* background: #fff;*/
/* padding: 20px;*/
/*}*/
/* --- 自定义新闻卡片样式开始 --- */
/* --- 卡片容器 --- */
.news-card {
border: none;
/*border-radius: 8px; !* 圆角稍微小一点,更干练 *!*/
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
overflow: hidden;
background: #fff;
/*max-width: 800px;*/
height: 300px;
width: 100%;
/*margin: 20px auto;*/
}
/* --- Tab 栏区域 (关键修改) --- */
.custom-tabs-header {
/* 1. 体现 Tab 栏背景颜色:浅蓝色 */
background-color: #e3f2fd;
/* 左右留白 */
/*padding: 10px 15px 0;*/
/* 2. 体现下方的强调线:深蓝色粗线 */
border-bottom: 3px solid #0d2c5e;
position: relative;
}
.nav-tabs {
border-bottom: none; /* 去掉 Bootstrap 默认的底边 */
}
.nav-tabs .nav-item {
margin-bottom: -3px; /* 负边距,让 Tab 沉下去盖住强调线 */
margin-right: 5px;
}
.nav-tabs .nav-link {
border: none;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
/* 4. 字体大小修正 */
font-size: 15px;
font-weight: 600; /* 加粗 */
color: #555; /* 未选中时的文字颜色 */
/*padding: 8px 20px;*/
transition: all 0.2s;
background: transparent;
}
.nav-tabs .nav-link:hover {
color: #0d2c5e;
background-color: rgba(255, 255, 255, 0.5);
border-color: transparent;
}
/* 激活状态 */
.nav-tabs .nav-link.active {
/* 选中背景:深蓝色 */
background-color: #0d2c5e !important;
color: #fff !important;
border-bottom-color: #0d2c5e !important; /* 盖住底部的强调线 */
z-index: 2; /* 确保层级最高 */
}
.tabs-header-wrapper {
display: flex; /* 启用 Flexbox */
justify-content: space-between; /* 关键:两端对齐 */
align-items: flex-end; /* 底部对齐,让 Tab 和“更多”在视觉上处于同一基线 */
height: 100%;
}
/* “更多”链接独立样式 */
.more-link-standalone {
font-size: 14px;
font-weight: 600;
color: #0d2c5e;
text-decoration: none;
padding: 10px 15px; /* 与 Tab 的高度视觉对齐 */
white-space: nowrap;
transition: color 0.2s;
display: inline-block;
}
.more-link-standalone:hover {
color: #c0392b;
text-decoration: underline;
}
/* --- 列表内容区域 --- */
.news-list-body {
padding: 15px 20px;
}
.news-item {
display: flex;
justify-content: space-between;
align-items: center;
/* 3. 去除虚线,改用 padding 控制间距 */
padding: 7px 0;
border-bottom: none; /* 确保无底线 */
width: 100%;
transition: background 0.2s;
}
/* 鼠标悬停整行微变色,提升交互感 */
.news-item:hover {
background-color: #f8f9fa;
padding-left: 5px; /* 轻微位移 */
padding-right: 5px;
border-radius: 4px;
}
.news-title-wrapper {
flex: 1;
display: flex;
align-items: center;
overflow: hidden;
margin-right: 15px;
}
/* 小圆点 */
.bullet-point {
width: 6px;
height: 6px;
background-color: #0d2c5e; /* 圆点直接用主题色 */
border-radius: 50%;
margin-right: 10px;
flex-shrink: 0;
}
.news-title-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
/* 4. 字体大小修正 */
font-size: 14px;
color: #333;
line-height: 1.4;
cursor: pointer;
}
.news-date {
/* 4. 字体大小修正 */
font-size: 12px;
color: #999;
white-space: nowrap;
flex-shrink: 0;
font-family: Arial, sans-serif;
}
/* --- 自定义样式结束 --- */
.ad-banner {
display: flex;
justify-content: space-between;
padding: 30px 0 15px 0;
}
.ad-item {
width: 280px;
height: 120px;
}
.grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
.service {
background: #e3f2fd;
padding: 20px;
text-align: center;
}
.sidebar {
width: 250px;
margin-right: 20px;
}
.footer {
/* 1. 启用 Flex 布局 */
display: flex;
/* 2. 设置主轴方向为垂直(从上到下) */
flex-direction: column;
/* 3. 关键:让子元素在交叉轴(这里是垂直方向)上对齐到底部 */
justify-content: flex-end;
width: 100%;
}
.footer-info {
/* 可选:如果 footer 有固定高度或最小高度,这个属性才生效明显 */
/* min-height: 150px; <-- 如果你的 footer 没有设高度,可以加上这个测试效果 */
background: #1e3a8a;
color: #fff;
text-align: center;
padding: 20px 0 10px 0;
width: 100% !important;
/*min-width: 1140px;*/
margin: auto;
overflow: hidden;
}
.col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto, .col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-auto, .col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-auto, .col-sm, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-auto, .col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-auto {
position: relative;
width: 100%;
padding-right: 5px !important;
padding-left: 5px !important;
}