/* Header 浮动导航栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 74px;
    background-color: var(--mainColor);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.header-logo {
    height: 50px;
    flex-shrink: 0;
}

.header-logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.header-nav {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 1;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    height: 48px;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.nav-item {
    height: 48px;
    display: flex;
    align-items: center;
}

.nav-item:last-child {
    border-right: none;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 48px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: #d9b574;
    font-weight: bold;
}

.nav-link.active,
.nav-link:active {
    color: #d9b574;
    font-weight: bold;
}

.nav-link.has-submenu::after {
    content: '';
    width: 7px;
    height: 6px;
    background-image: url('../image/icon_1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-link.has-submenu::after {
    transform: rotate(180deg);
}

.submenu-container {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    background-color: rgba(0, 0, 0, .5);
    padding: 10px 0;
    overflow-x: auto;

    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.submenu-container::-webkit-scrollbar {
    height: 3px;
}

.submenu-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 10px;
}

.submenu-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.submenu-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.submenu-container::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.7);
}

.submenu-container::-webkit-scrollbar-corner {
    background: transparent;
}

.nav-item:hover .submenu-container {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: row;
    border-radius: 4px;
}

.submenu-item {
    display: flex;
    align-items: center;
}

.submenu-link {
    display: block;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    white-space: nowrap;
}

.submenu-item:last-child .submenu-link {
    border-right: none;
}

.submenu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.submenu-item:last-child .submenu-link {
    border-right: none;
}

.submenu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.header-search {
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.header-search:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(5deg);
}

.header-search img {
    width: 30px;
    height: 25px;
    transition: all 0.3s ease;
}

.header-search:hover img {
    transform: scale(1.1);
}

.mobile-icons {
    display: none;
    align-items: center;
    gap: 15px;
}

.mobile-menu-toggle {
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background-color: #fff;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mobile-nav.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav.active .mobile-nav-overlay {
    opacity: 1;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background-color: var(--mainColor);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
}

.mobile-nav.active .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, var(--mainColor) 0%, #8B0513 100%);
}

.mobile-nav-header h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: all 0.3s ease;
}

.mobile-nav-close:hover {
    transform: rotate(90deg);
    opacity: 0.8;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 20px 0;
}

.mobile-nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 30px;
}

.mobile-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background-color: #fff;
}

.mobile-nav-item.has-submenu .mobile-nav-link::after {
    content: '▶';
    font-size: 12px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.mobile-nav-item.has-submenu.expanded .mobile-nav-link::after {
    transform: rotate(90deg);
}

.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

.mobile-nav-item.has-submenu.expanded .mobile-submenu {
    max-height: 200px;
    padding: 10px 0;
}

.mobile-submenu li {
    flex: 1;
    min-width: 33.33%;
}

.mobile-submenu-link {
    display: block;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 2px;
}

.mobile-submenu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .header-search {
        display: none;
    }

    .mobile-icons {
        display: flex;
    }

    .mobile-icons .header-search {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-icons .header-search img {
        width: 30px;
        height: 25px;
    }

    .header {
        justify-content: space-between;
    }

    .header-logo {
        width: 40px;
        height: 40px;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .mobile-nav-content {
        width: 100%;
    }

    .mobile-submenu li {
        min-width: 33%;
    }
}