Files
haiguji-website-export/css/nav.css
T

311 lines
5.1 KiB
CSS

/* 导航栏样式 */
.navbar {
background: white;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
position: sticky;
top: 0;
z-index: 100;
}
.nav-container {
max-width: 1400px;
margin: 0 auto;
padding: 0 20px;
display: flex;
align-items: center;
justify-content: space-between;
height: 70px;
}
.logo-section {
display: flex;
align-items: center;
cursor: pointer;
transition: opacity 0.3s;
}
.logo-section:hover {
opacity: 0.8;
}
.logo {
height: 50px;
width: auto;
}
.nav-menu {
display: flex;
list-style: none;
gap: 0;
flex: 1;
margin-left: 40px;
}
.nav-item {
position: relative;
}
.nav-link {
display: flex;
align-items: center;
padding: 10px 15px;
color: #333;
text-decoration: none;
font-size: 0.95rem;
font-weight: 500;
transition: color 0.3s;
cursor: pointer;
}
.nav-link:hover {
color: #6a2c91;
}
.nav-link.active {
color: #6a2c91;
background: rgba(106, 44, 145, 0.08);
border-radius: 6px;
}
.arrow {
font-size: 0.7rem;
margin-left: 5px;
transition: transform 0.3s;
}
.nav-item:hover .arrow {
transform: rotateX(180deg);
}
/* 下拉菜单 */
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
background: white;
min-width: 200px;
border-radius: 5px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
opacity: 0;
visibility: hidden;
transform: translateY(-10px);
transition: all 0.3s;
margin-top: 0;
z-index: 200;
}
.nav-item:hover .dropdown-menu {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.dropdown-menu a {
display: block;
padding: 12px 20px;
color: #333;
text-decoration: none;
transition: all 0.3s;
font-size: 0.9rem;
}
.dropdown-menu a:first-child {
border-radius: 5px 5px 0 0;
}
.dropdown-menu a:last-child {
border-radius: 0 0 5px 5px;
}
.dropdown-menu a:hover {
background: #f5f5f5;
padding-left: 25px;
color: #6a2c91;
}
.dropdown-menu a.active,
.submenu-trigger.active > a {
color: #6a2c91;
background: #f3eef8;
}
.submenu-trigger {
position: relative;
}
.submenu-trigger > a {
display: flex;
justify-content: space-between;
align-items: center;
}
.submenu-menu {
position: absolute;
left: 100%;
top: 0;
min-width: 230px;
background: white;
border-radius: 5px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
opacity: 0;
visibility: hidden;
transform: translateX(-8px);
transition: all 0.25s;
}
.submenu-trigger:hover .submenu-menu {
opacity: 1;
visibility: visible;
transform: translateX(0);
}
/* 二维码容器 */
.qrcode-container {
padding: 20px;
text-align: center;
min-width: 180px;
}
.qrcode-container p {
margin-bottom: 10px;
font-size: 0.9rem;
color: #333;
}
.qrcode {
width: 150px;
height: 150px;
border-radius: 5px;
}
.qr-empty {
display: flex;
align-items: center;
justify-content: center;
border: 1px dashed #bbb;
background: #f8fafc;
color: #777;
font-size: 0.85rem;
}
/* 右侧导航 */
.nav-right {
display: flex;
align-items: center;
gap: 12px;
}
.nav-icon {
display: flex;
align-items: center;
justify-content: center;
width: 35px;
height: 35px;
font-size: 1.2rem;
cursor: pointer;
transition: transform 0.3s;
color: #1e3c72;
text-decoration: none;
border-radius: 50%;
}
.nav-icon:hover {
transform: scale(1.1);
background: rgba(106, 44, 145, 0.08);
}
.customer-service-link {
display: flex;
align-items: center;
justify-content: center;
width: 35px;
height: 35px;
color: #1e3c72;
text-decoration: none;
border-radius: 50%;
font-size: 1rem;
transition: all 0.3s;
}
.customer-service-link:hover {
color: #6a2c91;
background: rgba(106, 44, 145, 0.08);
transform: translateY(-1px);
}
.btn-contact {
background: linear-gradient(135deg, #1e3c72 0%, #6a2c91 100%);
color: white;
border: none;
padding: 10px 25px;
border-radius: 25px;
cursor: pointer;
font-size: 0.9rem;
font-weight: 600;
transition: all 0.3s;
text-decoration: none;
}
.btn-contact:hover {
transform: translateY(-2px);
box-shadow: 0 6px 15px rgba(106, 44, 145, 0.3);
}
/* 响应式导航 */
@media (max-width: 768px) {
.nav-container {
height: 60px;
padding: 0 15px;
}
.logo {
height: 40px;
}
.nav-menu {
margin-left: 20px;
gap: 5px;
}
.nav-link {
padding: 8px 10px;
font-size: 0.85rem;
}
.dropdown-menu {
min-width: 150px;
}
.btn-contact {
padding: 8px 15px;
font-size: 0.8rem;
}
.nav-right {
gap: 10px;
}
}
@media (max-width: 480px) {
.nav-menu {
display: none;
}
.nav-right {
gap: 8px;
}
.btn-contact {
padding: 6px 12px;
font-size: 0.75rem;
}
.nav-icon {
width: 30px;
height: 30px;
font-size: 1rem;
}
}