/* 多级下拉导航样式 */
.navigation ul.main-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.navigation ul.main-menu > li {
    position: relative;
}

.navigation ul.main-menu > li > a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}

.navigation ul.main-menu > li > a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #D4AF37, #fff); /* 修改为金色渐变 */
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.navigation ul.main-menu > li:hover > a {
    background-color: rgba(212, 175, 55, 0.075) !important; /* 使用金色的透明背景 */
    color: #D4AF37; /* 修改为金色文字 */
}

.navigation ul.main-menu > li:hover > a::before {
    transform: scaleX(1);
}

.navigation ul.main-menu > li > a:focus {
    background-color: rgba(212, 175, 55, 0.055) !important; /* 使用金色的透明背景 */
    color: #D4AF37; /* 修改为金色文字 */
    outline: 2px solid #D4AF37; /* 金色轮廓 */
    outline-offset: 2px;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: transparent !important;
    border: none !important;
    border-radius: 8px;
    list-style: none;
    margin: 10px 0 0 0;
    padding: 10px 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: none;
}

.submenu-level-2 {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.submenu-level-3 {
    left: 0;
    top: 0;
    background: rgba(210, 210, 210, 0.1) !important; /* Slightly lighter gray with transparency */
    margin-left: 20px;
    position: static; /* Prevent going off-screen */
    box-shadow: none;
    width: calc(100% - 20px); /* Adjust width to account for margin-left */
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li {
    position: relative;
    border-bottom: none !important;
}

.submenu li:last-child {
    border-bottom: none;
}

.submenu a {
    display: block;
    padding: 12px 20px;
    color: #fff !important;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    text-decoration: none;
    background: transparent !important;
}

.submenu a:hover,
.submenu a:focus {
    background-color: rgba(74, 158, 255, 0.2) !important;
    color: #fff !important;
    border-left: 3px solid #4a9eff;
    padding-left: 25px;
}

.has-submenu > a::after {
    content: '\25BC'; /* 下箭头符号 */
    font-size: 10px;
    margin-left: 8px;
    transition: transform 0.3s ease;
    float: right;
}

.has-submenu:hover > a::after {
    transform: rotate(180deg);
}

.has-submenu .has-submenu > a::after {
    content: '\25B6'; /* 右箭头符号 */
}

/* 激活状态 */
.menu-item.active > a {
    background-color: rgba(74, 158, 255, 0.2);
    color: #4a9eff;
}

/* 焦点状态 */
.menu-item > a:focus,
.submenu a:focus {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .navigation ul.main-menu {
        flex-direction: column;
    }

    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(200, 200, 200, 0.1) !important; /* Light gray with transparency */
        border: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: none;
        backdrop-filter: blur(10px);
        margin: 0;
        padding: 0;
        width: 100%; /* Ensure submenu stays within navigation width */
    }

    .menu-item-has-children.active .submenu {
        max-height: 500px;
    }

    .submenu-level-2,
    .submenu-level-3 {
        position: static; /* Prevent going off-screen */
        box-shadow: none;
        width: 100%; /* Full width for consistency */
        left: 0;
        background: rgba(200, 200, 200, 0.1) !important;
    }
    
    .submenu-level-3 {
        margin-left: 20px;
        width: calc(100% - 20px); /* Adjust width to account for margin-left */
    }
    
    .mobile-menu-open .navigation ul.main-menu {
        display: flex;
        flex-direction: column;
        background: rgba(200, 200, 200, 0.15) !important; /* Light gray with transparency for main menu */
    }
    
    .submenu a:hover {
        padding-left: 20px;
        border-left: 3px solid transparent;
    }
    
    .submenu .menu-item a {
        padding: 12px 40px;
        font-size: 13px;
        background: transparent !important; /* Keep submenu items transparent */
        width: 100%; /* Ensure submenu items stay within navigation width */
        box-sizing: border-box; /* Account for padding in width calculation */
    }
}

/* 页面加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* 动画类 */
.animate-fade-up {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-left {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fade-right {
    animation: fadeInRight 0.8s ease forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* 渐变背景增强 */
.hero-section {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 50%, #DaA520 100%); /* 替换为金色主题渐变 */
    position: relative;
    overflow: hidden;
}

/* 全局动画和过渡效果 */
* {
    transition: all 0.3s ease;
}
