/* 主导航栏样式 */ .main-nav { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); position: sticky; top: 0; z-index: 99; } .nav-container { width: 100%; margin: 0 auto; } .nav-menu { display: flex; width: 100%; margin: 0; padding: 0; list-style: none; /* 去除默认列表样式 */ } .nav-item { flex: 1; text-align: center; /* padding: 18px 0; */ font-size: 16px; color: #000; cursor: pointer; transition: all 0.3s ease; position: relative; background-color: #ffffff; } /* 关键:让文字和图标分布在两侧 */ .nav-item a { /* display: flex; */ display: block; align-items: center; justify-content: space-around; color: inherit; text-decoration: none; width: 100%; padding: 0 10px; /* margin: 18px 0; */ height: 56px; line-height: 56px; } .nav-icon{ margin-right: 15px; } .nav-item + .nav-item { border-left: 1px solid #e5e5e5; } .nav-item.active { color: #fff; font-weight: 600; background-color: #e60012; border-left-color: rgba(255, 255, 255, 0.35); } .nav-item.active::before { content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid #e60012; } /* 导航图标样式 */ .nav-icon { width: 20px; height: 20px; object-fit: contain; } /* .nav-item::after { content: ""; position: absolute; bottom: 0; left: 0; width: 0; height: 3px; background-color: #fff; transition: width 0.3s ease; } */ .nav-item:hover::after, .nav-item.active::after { width: 100%; } @media screen and (max-width: 768px) { .nav-item a { flex-direction: column; justify-content: center; gap: 4px; padding: 0 0; } .nav-icon{ width: 16px; height: 16px; } .nav-item .nav-icon { order: -1; margin-right: 0px; } .nav-item{ font-size: 12px; } .cuxiao_tit{ width: 100%; text-align: center; } }