.tm-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--tm-header-height);
    z-index: 1000;
    background-color: transparent;
    transition: var(--tm-transition-smooth);
    border-bottom: 1px solid transparent;
}

.tm-header.scrolled {
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--tm-color-border);
}

.tm-header-container {
    max-width: var(--tm-max-width);
    margin: 0 auto;
    padding: 0 var(--tm-spacing-lg);
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tm-logo {
    display: flex;
    align-items: center;
    height: 40px; /* Logo 容器高度 */
    text-decoration: none;
}

.tm-logo-img {
    height: 100%;
    width: auto;
    display: block;
}

.tm-nav-list {
    display: flex;
    gap: clamp(1rem, 1.5vw, var(--tm-spacing-lg));
}

.tm-nav-list a {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--tm-color-primary);
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 4px;
}

.tm-nav-list a:hover {
    color: var(--tm-color-text);
}

.tm-nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--tm-color-accent);
    transition: var(--tm-transition-fast);
}

.tm-nav-list a:hover::after {
    width: 100%;
}

/* ============================================================
   Shared Full-Width Mega Menu
   ============================================================ */

/* The mega menu panel sits directly below the header bar */
.tm-mega-menu {
    position: absolute;
    top: var(--tm-header-height);
    left: 0;
    width: 100%;
    background-color: rgba(12, 12, 12, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--tm-color-border);
    border-bottom: 1px solid var(--tm-color-border);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 999;
}

/* JS will add .open class to show it */
.tm-mega-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Inner: 6 equal columns taking full width */
.tm-mega-inner {
    display: flex;
    width: 100%;
}

/* Each column: equal width, separated by subtle border */
.tm-mega-col {
    flex: 1;
    padding: 28px 24px;
    border-right: 1px solid var(--tm-color-border);
    min-height: 180px;
    transition: background-color 0.2s ease;
    cursor: default;
}

.tm-mega-col:last-child {
    border-right: none;
}

/* Active / highlighted column (set by JS on nav hover) */
.tm-mega-col.active {
    background-color: var(--tm-color-accent);
}

.tm-mega-col h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--tm-color-text);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tm-color-border);
    transition: color 0.2s, border-bottom-color 0.2s;
}

.tm-mega-col.active h4 {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

/* Links inside columns */
.tm-mega-col a,
.tm-mega-col button {
    display: block;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--tm-color-text-muted);
    padding: 5px 0;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    background: none;
    border: none;
    font-family: inherit;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: color 0.15s, padding-left 0.15s;
}

/* Suppress global underline pseudo-element on these links */
.tm-mega-col a::after {
    display: none !important;
}

.tm-mega-col a:hover {
    color: var(--tm-color-text);
    padding-left: 5px;
}

.tm-mega-col.active a,
.tm-mega-col.active button {
    color: rgba(255, 255, 255, 0.85);
}

.tm-mega-col.active a:hover,
.tm-mega-col.active button:hover {
    color: #fff;
    padding-left: 5px;
}

/* Language option active state */
.tm-lang-option.active {
    color: var(--tm-color-accent);
    font-weight: 600;
}

.tm-mega-col.active .tm-lang-option.active {
    color: #fff;
    font-weight: 700;
}

/* LANGUAGE nav button arrow */
.tm-lang-arrow {
    font-size: 0.65rem;
    margin-left: 3px;
    transition: transform 0.2s;
    display: inline-block;
}

/* When mega menu is open, rotate the arrow of the active nav item */
.tm-nav-list li.mega-active>a .tm-lang-arrow {
    transform: rotate(180deg);
}

/* tm-lang-switcher no longer used */
.tm-lang-switcher {
    display: none;
}



/* Hamburger toggle button */
.tm-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    z-index: 1001;
}

.tm-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--tm-color-text);
    border-radius: 2px;
    transition: var(--tm-transition-fast);
}

.tm-hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.tm-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.tm-hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hide mobile-only elements on desktop */
.tm-mobile-lang {
    display: none;
}

@media (max-width: 768px) {
    .tm-mega-menu {
        display: none !important;
        /* Never show mega menu on mobile */
    }
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
    .tm-hamburger {
        display: flex;
    }

    .tm-lang-switcher {
        display: none;
    }

    .tm-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
    }

    .tm-nav.open {
        opacity: 1;
        visibility: visible;
    }

    .tm-nav-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 32px;
    }

    .tm-nav-list a {
        font-size: 1.3rem;
        letter-spacing: 2px;
    }

    .tm-nav-list li[data-mega-col="5"] a {
        pointer-events: none;
        color: var(--tm-color-text-muted);
        opacity: 0.8;
    }

    /* Mobile language selector inside menu */
    .tm-mobile-lang {
        display: block;
        margin-top: 40px;
        text-align: center;
    }

    .tm-mobile-lang-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 24px;
        border: 1px solid var(--tm-color-border);
        border-radius: 24px;
        color: var(--tm-color-text-muted);
        font-size: 0.9rem;
        cursor: pointer;
        transition: var(--tm-transition-fast);
        background: transparent;
    }

    .tm-mobile-lang-toggle:hover {
        border-color: var(--tm-color-text);
        color: var(--tm-color-text);
    }

    .tm-mobile-lang-toggle .arrow {
        font-size: 0.6rem;
        transition: transform 0.2s ease;
    }

    .tm-mobile-lang-toggle.expanded .arrow {
        transform: rotate(180deg);
    }

    .tm-mobile-lang-options {
        display: none;
        flex-direction: column;
        gap: 0;
        margin-top: 12px;
        overflow: hidden;
    }

    .tm-mobile-lang-options.show {
        display: flex;
    }

    .tm-mobile-lang-options button {
        background: transparent;
        border: none;
        color: var(--tm-color-text-muted);
        font-size: 1rem;
        padding: 12px 20px;
        cursor: pointer;
        transition: var(--tm-transition-fast);
        letter-spacing: 1px;
    }

    .tm-mobile-lang-options button:hover,
    .tm-mobile-lang-options button.active {
        color: var(--tm-color-accent);
    }
}