Files
dukang_official/src/components/Nav.css
T
2026-08-11 01:44:32 +08:00

431 lines
8.3 KiB
CSS

.topnav {
position: sticky;
top: 0;
z-index: 1000;
height: var(--nav-h);
backdrop-filter: blur(12px);
background: rgba(247, 242, 234, 0.86);
border-bottom: 1px solid transparent;
transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.topnav.has-drawer-open {
z-index: 1001;
}
.theme-tech .topnav {
background: rgba(18, 16, 20, 0.9);
}
.topnav.is-scrolled {
border-bottom-color: rgba(166, 28, 32, 0.12);
background: rgba(247, 242, 234, 0.95);
}
.theme-tech .topnav.is-scrolled {
border-bottom-color: rgba(196, 163, 90, 0.22);
background: rgba(18, 16, 20, 0.96);
}
.theme-tech .nav-links a {
color: rgba(243, 236, 228, 0.72);
}
.theme-tech .nav-links a:hover,
.theme-tech .nav-links a.is-active {
color: var(--gold);
}
.theme-tech .nav-links a.is-active::after {
background: var(--gold);
}
.theme-tech .mobile-drawer {
background: rgba(18, 16, 20, 0.98);
}
.theme-tech .mobile-drawer a {
color: #f3ece4;
border-bottom-color: rgba(196, 163, 90, 0.15);
}
.topnav-inner {
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
}
.brand {
display: inline-flex;
align-items: center;
gap: 0.65rem;
min-height: 2.75rem;
}
.brand-logo {
width: 2.2rem;
height: 2.2rem;
object-fit: contain;
}
.brand-text {
font-size: 1.15rem;
color: var(--brand);
letter-spacing: 0.08em;
}
.nav-links {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 0.15rem 0.85rem;
max-width: 58rem;
}
.nav-links a {
position: relative;
font-size: 0.86rem;
color: var(--ink-soft);
padding: 0.35rem 0;
transition: color 0.25s var(--ease);
}
.nav-links a:hover,
.nav-links a.is-active {
color: var(--brand);
}
.nav-links a.is-active::after {
content: '';
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 1px;
background: var(--brand);
transform-origin: left;
animation: lineGrow 0.45s var(--ease) both;
}
.menu-toggle {
position: relative;
z-index: 1002;
width: 2.75rem;
height: 2.75rem;
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 0.35rem;
}
.menu-toggle span {
width: 1.35rem;
height: 1.5px;
background: var(--brand);
transition: transform 0.3s var(--ease);
}
.mobile-drawer {
position: fixed;
inset: var(--nav-h) 0 0 0;
z-index: 1001;
background: rgba(247, 242, 234, 0.98);
backdrop-filter: blur(16px);
padding: 1.5rem 1.25rem 2rem;
transform: translateX(100%);
transition: transform 0.4s var(--ease);
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.mobile-drawer.is-open {
transform: translateX(0);
}
.mobile-drawer a {
display: flex;
align-items: center;
min-height: 2.75rem;
border-bottom: 1px solid rgba(166, 28, 32, 0.1);
font-size: 1.05rem;
color: var(--ink);
}
.mobile-drawer a:hover {
color: var(--brand);
}
.nav-groups {
display: flex;
align-items: stretch;
gap: 0.35rem 1.1rem;
height: 100%;
}
.nav-group {
position: relative;
display: flex;
align-items: center;
height: 100%;
}
.nav-group-title {
display: inline-flex;
align-items: center;
gap: 0.35rem;
min-height: 2.75rem;
font-size: 0.92rem;
color: var(--ink-soft);
letter-spacing: 0.06em;
transition: color 0.25s var(--ease);
}
.nav-chevron {
width: 0.4rem;
height: 0.4rem;
border-right: 1.5px solid currentColor;
border-bottom: 1.5px solid currentColor;
transform: rotate(45deg) translateY(-0.1rem);
opacity: 0.55;
transition: transform 0.3s var(--ease), opacity 0.25s var(--ease);
}
.nav-group:hover .nav-group-title,
.nav-group.is-current .nav-group-title,
.nav-group.is-open .nav-group-title {
color: var(--brand);
}
.nav-group:hover .nav-chevron,
.nav-group.is-open .nav-chevron {
opacity: 1;
transform: rotate(225deg) translateY(-0.05rem);
}
.nav-dropdown {
position: absolute;
top: calc(100% - 0.1rem);
left: 50%;
transform: translateX(-50%) translateY(0.55rem) scale(0.98);
min-width: 13.5rem;
padding: 0.85rem 0.75rem 0.9rem;
background: var(--paper);
border: 1px solid rgba(166, 28, 32, 0.12);
border-radius: 0.2rem;
box-shadow: 0 1.1rem 2.4rem rgba(26, 21, 18, 0.12);
opacity: 0;
visibility: hidden;
pointer-events: none;
transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
z-index: 50;
}
.nav-dropdown::before {
content: '';
position: absolute;
left: 0.85rem;
right: 0.85rem;
top: 0;
height: 2px;
background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.nav-dropdown.is-wide {
min-width: 22rem;
left: 50%;
}
.nav-group:hover .nav-dropdown,
.nav-group.is-open .nav-dropdown {
opacity: 1;
visibility: visible;
pointer-events: auto;
transform: translateX(-50%) translateY(0) scale(1);
}
.nav-drop-section + .nav-drop-section {
margin-top: 0.7rem;
padding-top: 0.7rem;
border-top: 1px solid rgba(166, 28, 32, 0.1);
}
.nav-drop-label {
margin: 0 0.35rem 0.4rem;
font-size: 0.72rem;
letter-spacing: 0.18em;
color: var(--gold);
text-transform: none;
}
.nav-drop-list.is-cols {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.1rem 0.35rem;
}
.nav-drop-item {
--i: 0;
position: relative;
display: flex;
align-items: center;
min-height: 2.35rem;
padding: 0 0.85rem 0 1.05rem;
font-size: 0.88rem;
color: var(--ink-soft);
white-space: nowrap;
border-radius: 0.12rem;
opacity: 0;
transform: translateY(0.35rem);
transition: color 0.22s var(--ease), background 0.22s var(--ease), transform 0.22s var(--ease);
}
.nav-group:hover .nav-drop-item,
.nav-group.is-open .nav-drop-item {
opacity: 1;
transform: translateY(0);
transition-delay: calc(var(--i) * 35ms);
}
.nav-drop-item::before {
content: '';
position: absolute;
left: 0.25rem;
top: 50%;
width: 2px;
height: 0;
background: var(--brand);
transform: translateY(-50%);
transition: height 0.22s var(--ease);
}
.nav-drop-item:hover,
.nav-drop-item.is-active {
color: var(--brand);
background: var(--brand-soft);
transform: translateX(0.15rem);
}
.nav-drop-item:hover::before,
.nav-drop-item.is-active::before {
height: 1.05rem;
}
.nav-drop-item.deep {
font-size: 0.84rem;
}
.stage-links {
max-width: 70rem;
justify-content: flex-end;
}
.mobile-group-title {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
min-height: 2.9rem;
border-bottom: 1px solid rgba(166, 28, 32, 0.1);
color: var(--ink);
font-size: 1.05rem;
}
.mobile-chevron {
width: 0.55rem;
height: 0.55rem;
border-right: 1.5px solid var(--brand);
border-bottom: 1.5px solid var(--brand);
transform: rotate(45deg);
transition: transform 0.3s var(--ease);
}
.mobile-group.is-open .mobile-chevron {
transform: rotate(225deg);
}
.mobile-group-panel {
max-height: 0;
overflow: hidden;
opacity: 0;
padding: 0 0 0 0.75rem;
border-left: 2px solid transparent;
transition: max-height 0.35s var(--ease), opacity 0.28s var(--ease), padding 0.28s var(--ease), border-color 0.28s;
}
.mobile-group.is-open .mobile-group-panel {
max-height: 40rem;
opacity: 1;
padding: 0.35rem 0 0.85rem 0.85rem;
border-left-color: rgba(166, 28, 32, 0.22);
}
.mobile-drop-label {
margin: 0.55rem 0 0.2rem;
font-size: 0.72rem;
letter-spacing: 0.16em;
color: var(--gold);
}
.mobile-group-panel a {
font-size: 0.95rem;
color: var(--ink-soft);
border-bottom-color: rgba(166, 28, 32, 0.06);
}
.mobile-group-panel a.is-deep {
font-size: 0.9rem;
padding-left: 0.35rem;
}
.theme-tech .nav-group-title,
.theme-tech .nav-drop-item {
color: rgba(243, 236, 228, 0.72);
}
.theme-tech .nav-group:hover .nav-group-title,
.theme-tech .nav-group.is-current .nav-group-title,
.theme-tech .nav-drop-item:hover,
.theme-tech .nav-drop-item.is-active {
color: var(--gold);
}
.theme-tech .nav-dropdown {
background: rgba(28, 25, 31, 0.98);
border-color: var(--tech-line);
}
.theme-tech .nav-drop-item::before {
background: var(--gold);
}
.theme-tech .nav-drop-item:hover,
.theme-tech .nav-drop-item.is-active {
background: rgba(196, 163, 90, 0.1);
}
.theme-tech .nav-drop-section + .nav-drop-section {
border-top-color: rgba(196, 163, 90, 0.18);
}
@media (max-width: 64rem) and (min-width: 48.0625rem) {
.nav-links {
gap: 0.1rem 0.55rem;
}
.nav-links a,
.nav-group-title {
font-size: 0.78rem;
}
.nav-groups {
gap: 0.25rem 0.65rem;
}
.nav-dropdown.is-wide {
min-width: 18rem;
}
}