Files
YwxAppThink/public/static/frontend/css/style.css
T

318 lines
9.6 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* =============== 全站置顶公告条(方案 A =============== */
.site-notice-bar { background: linear-gradient(90deg,#fff7e6,#fffbe6); border-bottom: 1px solid #ffe58f; font-size: 13px; }
.site-notice-bar .notice-item { max-width: 1200px; margin: 0 auto; padding: 8px 15px; display: flex; align-items: center; gap: 10px; }
.site-notice-bar .notice-badge { flex: none; background: #fa8c16; color: #fff; border-radius: 3px; padding: 1px 7px; font-size: 12px; }
.site-notice-bar .notice-type-1 .notice-badge { background: #1890ff; }
.site-notice-bar .notice-type-2 .notice-badge { background: #fa8c16; }
.site-notice-bar .notice-type-3 .notice-badge { background: #52c41a; }
.site-notice-bar .notice-type-4 .notice-badge { background: #8c8c8c; }
.site-notice-bar .notice-title { flex: 1; color: #614700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-notice-bar .notice-link { flex: none; color: #d46b08; text-decoration: none; }
.site-notice-bar .notice-link:hover { text-decoration: underline; }
.site-notice-bar .notice-close { flex: none; cursor: pointer; color: #999; font-size: 18px; line-height: 1; padding: 0 4px; }
.site-notice-bar .notice-close:hover { color: #666; }
/* =============== 站点广告位 =============== */
/* 通用广告项 */
.ad-slot { margin: 0; }
.ad-item { margin: 12px 0; line-height: 0; }
.ad-item img { max-width: 100%; height: auto; display: block; border-radius: 6px; }
.ad-text-link, .ad-text { display: inline-block; padding: 8px 14px; color: #d46b08; background: #fff7e6; border: 1px solid #ffe58f; border-radius: 4px; text-decoration: none; font-size: 14px; line-height: 1.5; }
.ad-text-link:hover { color: #ad4e00; }
/* 首页顶部横幅 */
.ad-slot-home_top { max-width: 1200px; margin: 16px auto 0; }
.ad-slot-home_top .ad-item { margin: 0 auto; text-align: center; }
/* 首页侧边浮层(固定右侧) */
.ad-slot-home_side { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); width: 160px; z-index: 50; }
.ad-slot-home_side .ad-item { margin: 10px 0; }
.ad-slot-home_side .ad-item img { border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
@media (max-width: 1100px) { .ad-slot-home_side { display: none; } }
/* 列表底部 */
.ad-slot-list_bottom { max-width: 1200px; margin: 20px auto 0; }
.ad-slot-list_bottom .ad-item { text-align: center; }
/* 全站弹窗 */
.ad-popup-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 999; align-items: center; justify-content: center; }
.ad-popup-box { position: relative; max-width: 90%; max-height: 86%; overflow: auto; background: #fff; border-radius: 8px; padding: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.ad-popup-box img { max-width: 100%; height: auto; display: block; }
.ad-popup-close { position: absolute; top: -12px; right: -12px; width: 28px; height: 28px; line-height: 26px; text-align: center; background: #fff; color: #666; border-radius: 50%; cursor: pointer; font-size: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.2); z-index: 2; }
.ad-popup-close:hover { color: #333; }
.ad-popup-item { line-height: 0; }
.ad-popup-item .ad-text-link, .ad-popup-item .ad-text { line-height: 1.5; }
/* 首页底部 */
.ad-slot-home_bottom { max-width: 1200px; margin: 24px auto 0; }
.ad-slot-home_bottom .ad-item { text-align: center; }
/* 全站悬浮角标(固定右下角,可关闭) */
.ad-float { position: fixed; right: 16px; bottom: 16px; width: 120px; z-index: 80; }
.ad-float-item { line-height: 0; }
.ad-float-item img { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.18); display: block; }
.ad-float-item .ad-text-link, .ad-float-item .ad-text { width: 100%; box-sizing: border-box; text-align: center; line-height: 1.4; }
.ad-float-close { position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; line-height: 20px; text-align: center; background: #fff; color: #666; border-radius: 50%; cursor: pointer; font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 2; }
.ad-float-close:hover { color: #333; }
@media (max-width: 768px) { .ad-float { width: 92px; right: 10px; bottom: 10px; } }
/* =============== 重构导航栏(解决重合核心) =============== */
.main-header {
background: #fff;
box-shadow: 0 2px 10px rgba(0,0,0,0.08);
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 9999;
height: 60px; /* 固定高度避免抖动 */
}
.header-container {
height: 100%;
display: flex;
align-items: center;
}
.header-inner {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
/* Logo区域:固定宽度+弹性收缩 */
.logo-box {
flex: 0 0 180px; /* 固定宽度避免挤压 */
height: 100%;
display: flex;
align-items: center;
}
.logo-link {
display: block;
font-size: 20px;
font-weight: bold;
color: #1E9FFF;
text-decoration: none;
line-height: 1;
}
.logo-text {
display: inline-block;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 导航菜单 */
.nav-menu {
display: flex;
list-style: none;
margin: 0;
padding: 0;
height: 100%;
}
.nav-item {
position: relative;
margin: 0 15px;
display: flex;
align-items: center;
}
.nav-item a {
color: #333;
font-size: 16px;
padding: 8px 0;
transition: all 0.3s;
display: block;
line-height: 1;
}
.nav-item.active a,
.nav-item:hover a {
color: #1E9FFF;
border-bottom: 2px solid #1E9FFF;
}
.nav-item.active::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 2px;
background: #1E9FFF;
transform: scaleX(0);
transform-origin: right;
transition: transform 0.3s ease;
}
.nav-item.active::after {
transform: scaleX(1);
transform-origin: left;
}
/* 二级下拉菜单(navMenus.has-child */
.nav-item.has-child > a::after {
content: '';
display: inline-block;
margin-left: 6px;
border: 4px solid transparent;
border-top-color: currentColor;
vertical-align: middle;
}
.sub-menu {
position: absolute;
top: 100%;
left: 0;
min-width: 160px;
list-style: none;
margin: 0;
padding: 6px 0;
background: #fff;
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
border-radius: 6px;
opacity: 0;
visibility: hidden;
transform: translateY(8px);
transition: all 0.25s ease;
z-index: 9999;
}
.nav-item.has-child:hover > .sub-menu {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.sub-item a {
display: block;
padding: 9px 18px;
color: #333;
font-size: 15px;
white-space: nowrap;
}
.sub-item a:hover,
.sub-item.active a {
color: #1E9FFF;
background: #f5f9ff;
}
/* 汉堡菜单(移动端专属) */
.nav-trigger {
display: none;
width: 28px;
height: 22px;
cursor: pointer;
flex-direction: column;
justify-content: space-between;
z-index: 10000;
}
.nav-trigger span {
display: block;
height: 3px;
width: 100%;
background: #333;
border-radius: 2px;
transition: all 0.3s ease;
}
.nav-trigger.active span:nth-child(1) {
transform: rotate(45deg) translate(5px, 5px);
}
.nav-trigger.active span:nth-child(2) {
opacity: 0;
}
.nav-trigger.active span:nth-child(3) {
transform: rotate(-45deg) translate(5px, -5px);
}
/* =============== 响应式断点 =============== */
@media (max-width: 992px) {
.nav-item { margin: 0 10px; }
.logo-link { font-size: 18px; }
}
@media (max-width: 768px) {
/* 显示汉堡菜单,隐藏导航 */
.nav-trigger { display: flex; }
.nav-menu {
position: fixed;
top: 60px;
right: -100%;
width: 280px;
height: calc(100vh - 60px);
background: #fff;
flex-direction: column;
padding: 30px 0;
box-shadow: -2px 0 10px rgba(0,0,0,0.1);
transition: right 0.3s ease;
z-index: 9998;
}
.nav-menu.active {
right: 0;
}
.nav-item {
margin: 0;
width: 100%;
border-bottom: 1px solid #f0f0f0;
}
.nav-item a {
padding: 15px 30px;
font-size: 18px;
text-align: left;
border-bottom: none !important;
}
.nav-item::after { display: none; }
/* Logo区域缩小 */
.logo-box { flex: 0 0 150px; }
.logo-link { font-size: 18px; }
/* 防止页面滚动时导航抖动 */
body.nav-open {
overflow: hidden;
position: fixed;
width: 100%;
}
}
@media (max-width: 480px) {
.logo-box { flex: 0 0 120px; }
.logo-link { font-size: 16px; }
.nav-item a { padding: 12px 25px; font-size: 17px; }
}
/* 顶部安全距离(避免内容被固定导航遮挡) */
.main-wrapper {
padding-top: 100px; /* 60px导航 + 40px缓冲 */
transition: padding-top 0.3s;
}
.banner-wrapper {
margin-top: 60px; /* 与导航高度一致 */
}
.banner-carousel { border-radius: 0; }
@media (max-width: 768px) {
.main-wrapper { padding-top: 80px; }
.banner-wrapper { margin-top: 60px; }
.banner-carousel { height: 220px !important; }
}
/* 返回顶部按钮样式 */
.go-top {
position: fixed;
bottom: 30px;
right: 20px;
width: 44px;
height: 44px;
line-height: 44px;
text-align: center;
background: rgba(30, 159, 255, 0.85);
color: #fff;
border-radius: 50%;
font-size: 18px;
cursor: pointer;
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
display: none;
z-index: 999;
transition: all 0.3s;
}
.go-top:hover {
background: #1E9FFF;
transform: translateY(-2px);
}
@media (max-width: 768px) {
.go-top { bottom: 20px; right: 15px; width: 40px; height: 40px; line-height: 40px; }
}