268 lines
4.9 KiB
CSS
268 lines
4.9 KiB
CSS
/* 三级导航菜单样式 - 阿里云风格两栏布局 */
|
||
|
||
/* 导航容器 - 深色主题配色 */
|
||
.nav-cont {
|
||
position: absolute;
|
||
top: 100%;
|
||
left: 0;
|
||
width: 100%;
|
||
background: rgba(15, 23, 42, 0.98);
|
||
backdrop-filter: blur(20px);
|
||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
||
border-top: 1px solid rgba(56, 189, 248, 0.15);
|
||
z-index: 1000;
|
||
overflow: hidden;
|
||
transition: height 0.3s ease-out;
|
||
height: 0;
|
||
}
|
||
|
||
/* Mega Menu 两栏布局 */
|
||
.nav-cont-menu.mega-menu {
|
||
display: none;
|
||
height: 100%;
|
||
}
|
||
|
||
.nav-content {
|
||
display: flex;
|
||
max-width: 1400px;
|
||
margin: 0 auto;
|
||
height: 100%;
|
||
min-height: 400px;
|
||
padding: 0;
|
||
}
|
||
|
||
/* 左侧二级菜单栏 - 深色背景 */
|
||
.nav-left-sidebar {
|
||
width: 200px;
|
||
background: rgba(30, 41, 59, 0.8);
|
||
border-right: 1px solid rgba(56, 189, 248, 0.15);
|
||
flex-shrink: 0;
|
||
height: 100%;
|
||
}
|
||
|
||
/* 二级菜单项 - 深色主题 */
|
||
.nav-category-item {
|
||
position: relative;
|
||
display: block;
|
||
padding: 16px 20px;
|
||
color: #E5E7EB;
|
||
font-size: 14px;
|
||
text-decoration: none;
|
||
border-left: 3px solid transparent;
|
||
transition: all 0.2s ease;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.nav-category-item:hover,
|
||
.nav-category-item.active {
|
||
background: rgba(56, 189, 248, 0.1);
|
||
border-left-color: #38BDF8;
|
||
color: #38BDF8;
|
||
}
|
||
|
||
.nav-category-item .category-icon {
|
||
display: inline-block;
|
||
width: 20px;
|
||
height: 20px;
|
||
margin-right: 8px;
|
||
vertical-align: middle;
|
||
}
|
||
|
||
.nav-category-item .category-icon img {
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: contain;
|
||
}
|
||
|
||
.nav-category-name {
|
||
font-weight: 500;
|
||
}
|
||
|
||
.nav-category-desc {
|
||
font-size: 12px;
|
||
color: #94A3B8;
|
||
margin-top: 2px;
|
||
display: block;
|
||
}
|
||
|
||
/* 右侧三级菜单区域 - 深色背景 */
|
||
.nav-right-content {
|
||
flex: 1;
|
||
padding: 16px 24px;
|
||
background: rgba(15, 23, 42, 0.6);
|
||
overflow-y: auto;
|
||
max-height: none;
|
||
height: 100%;
|
||
}
|
||
|
||
/* 三级菜单容器 */
|
||
.nav-third-panel {
|
||
display: none;
|
||
}
|
||
|
||
.nav-third-panel.active {
|
||
display: block;
|
||
animation: fadeInRight 0.3s ease;
|
||
}
|
||
|
||
/* 三级菜单标题 - 浅色 */
|
||
.nav-third-title {
|
||
font-size: 16px;
|
||
font-weight: 600;
|
||
color: #E5E7EB;
|
||
margin-bottom: 16px;
|
||
padding-bottom: 12px;
|
||
border-bottom: 2px solid #38BDF8;
|
||
display: inline-block;
|
||
}
|
||
|
||
/* 三级菜单网格布局 */
|
||
.nav-third-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(3, 1fr);
|
||
gap: 12px 24px;
|
||
margin-top: 20px;
|
||
}
|
||
|
||
/* 三级菜单项 - 提高选择器优先级 */
|
||
.nav-cont-menu .nav-third-item {
|
||
margin: 0;
|
||
padding: 0;
|
||
min-width: 0;
|
||
}
|
||
|
||
.nav-cont-menu .nav-third-grid .nav-third-link,
|
||
.nav-third-panel .nav-third-link {
|
||
display: block;
|
||
width: 100%;
|
||
padding: 10px 12px 10px 24px;
|
||
border-radius: 4px;
|
||
background: rgba(30, 41, 59, 0.4);
|
||
color: #E5E7EB;
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
text-decoration: none;
|
||
transition: all 0.2s ease;
|
||
border: 1px solid rgba(56, 189, 248, 0.15);
|
||
box-sizing: border-box;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
position: relative;
|
||
}
|
||
|
||
.nav-cont-menu .nav-third-grid .nav-third-link::before,
|
||
.nav-third-panel .nav-third-link::before {
|
||
content: '›';
|
||
position: absolute;
|
||
left: 8px;
|
||
top: 50%;
|
||
transform: translateY(-50%);
|
||
color: #38BDF8;
|
||
font-size: 16px;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.nav-cont-menu .nav-third-grid .nav-third-link:hover,
|
||
.nav-third-panel .nav-third-link:hover {
|
||
background: rgba(56, 189, 248, 0.2);
|
||
border-color: #38BDF8;
|
||
color: #38BDF8;
|
||
padding-left: 28px;
|
||
box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
|
||
}
|
||
|
||
.nav-cont-menu .nav-third-grid .nav-third-link:hover::before,
|
||
.nav-third-panel .nav-third-link:hover::before {
|
||
left: 12px;
|
||
}
|
||
|
||
/* 空状态 */
|
||
.nav-right-empty {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
height: 300px;
|
||
color: #999;
|
||
font-size: 14px;
|
||
}
|
||
|
||
/* 旧版二级菜单样式(无三级菜单时使用) */
|
||
.nav-item-box {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
padding: 16px 20px;
|
||
transition: all 0.2s ease;
|
||
text-decoration: none;
|
||
color: #333;
|
||
border-left: 3px solid transparent;
|
||
}
|
||
|
||
.nav-item-box:hover {
|
||
background: #fff;
|
||
border-left-color: #1890ff;
|
||
color: #1890ff;
|
||
}
|
||
|
||
.nav-item-box img {
|
||
width: 20px;
|
||
height: 20px;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.item-box-title .title {
|
||
font-size: 14px;
|
||
font-weight: 500;
|
||
margin-bottom: 2px;
|
||
}
|
||
|
||
.item-box-title .desc {
|
||
font-size: 12px;
|
||
color: #999;
|
||
}
|
||
|
||
/* 空菜单占位 */
|
||
.nav-cont-menu.nav-cont-empty {
|
||
display: none;
|
||
}
|
||
|
||
/* 动画效果 */
|
||
@keyframes fadeInRight {
|
||
from {
|
||
opacity: 0;
|
||
transform: translateX(10px);
|
||
}
|
||
|
||
to {
|
||
opacity: 1;
|
||
transform: translateX(0);
|
||
}
|
||
}
|
||
|
||
/* 响应式调整 */
|
||
@media (max-width: 768px) {
|
||
.nav-cont {
|
||
display: none !important;
|
||
}
|
||
|
||
.nav-content {
|
||
flex-direction: column;
|
||
min-height: auto;
|
||
}
|
||
|
||
.nav-left-sidebar {
|
||
width: 100%;
|
||
border-right: none;
|
||
border-bottom: 1px solid #e8e8e8;
|
||
}
|
||
|
||
.nav-right-content {
|
||
padding: 16px;
|
||
max-height: none;
|
||
}
|
||
|
||
.nav-third-grid {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
} |