/* 菜单栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999998;
    background: transparent;
    transition: background-color 0.3s ease;
    padding: 0;
    /* 性能优化 */
    will-change: background-color;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 0 auto;
    z-index: 999997;
}

.navbar-logo {
    position: relative;
    z-index: 999999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 性能优化 */
    will-change: transform, left, width;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.navbar-logo img {
    height: 80px;
    width: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 999999;
    transform: scale(1) translateZ(0);
    filter: drop-shadow(0 0 0px rgba(255, 255, 255, 0));
    /* 性能优化 */
    will-change: transform, filter;
    backface-visibility: hidden;
}

/* 菜单打开时logo居中样式 */
.navbar.menu-open .navbar-logo {
    position: fixed;
    left: 0;
    width: 30vw;
    display: flex;
    justify-content: center;
    z-index: 999999;
    top: 15px;
    transform: translateX(calc(17.5vw - 50%));
}

.navbar.menu-open .navbar-logo img {
    transform: scale(1.1);
}

/* 菜单打开时保持菜单按钮在右边 */
.navbar.menu-open .navbar-menu-btn {
    position: fixed;
    right: 20px;
    top: 39px;
    z-index: 999999;
}

.navbar-menu-btn {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999999;
    position: relative;
    /* 性能优化 */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.navbar-menu-btn span {
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
    /* 性能优化 */
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.navbar-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 7px);
}

.navbar-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.navbar-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -7px);
}

.dropdown-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh; /* 动态视口高度，优先级更高 */
    width: 30vw;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    /* 性能优化 */
    will-change: transform, opacity, visibility;
    transform: translateZ(0);
    backface-visibility: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) translateZ(0);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, height 0.3s ease;
    overflow-y: auto;
    z-index: 999996;
    border-radius: 0 0 50px 0;
    padding-top: 75px;
    padding-bottom: 20px;
    box-sizing: border-box;
    /* 隐藏滚动条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    /* 滚动性能优化 */
    -webkit-overflow-scrolling: touch;
    contain: layout style paint;
}

/* 搜索框容器样式 */
.menu-search-container {
    position: relative;
    margin: 10px 15px 0px 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

/* 搜索框样式 */
.menu-search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.menu-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.menu-search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

/* 搜索图标样式 */
.menu-search-icon {
    position: absolute;
    right: 15px;
    top: 32%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    pointer-events: none;
}

/* 搜索清除按钮样式 */
.menu-search-clear {
    position: absolute;
    right: 17px;
    top: 20%;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: none;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10;
    line-height: 1;
}

.menu-search-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: scale(1.1);
}

.menu-search-clear:active {
    transform: scale(0.95);
}

/* 菜单顶部深蓝色遮罩 */
.menu-top-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 30vw;
    height: 75px;
    background: rgba(0, 0, 0, 0.6); /* 深蓝色不透明 */
    backdrop-filter: blur(10px);
    z-index: 999997;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, height 0.3s ease;
}

.menu-top-mask.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 隐藏 Webkit 浏览器的滚动条 */
.dropdown-menu::-webkit-scrollbar {
    display: none;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) translateZ(0);
}

/* 菜单遮罩样式 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 30vw;
    right: 0;
    height: 100vh;
    height: 100dvh; /* 动态视口高度，优先级更高 */
    background: rgba(2, 0, 30, 0.5);
    border-radius: 0 0 0 50px;
    z-index: 999995;
    opacity: 0;
    visibility: hidden;
    transform: scaleX(0);
    transform-origin: left;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 性能优化 */
    will-change: transform, opacity, visibility;
    backface-visibility: hidden;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
    transform: scaleX(1);
}

.menu-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item a,
.menu-title {
    display: block;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.menu-item a:hover,
.menu-title:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #007bff;
}

.has-submenu .menu-title {
    position: relative;
}

.has-submenu .menu-title:after {
    content: '▼';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.submenu {
    background: rgba(65, 65, 65, 0.8);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.has-submenu.active .submenu {
    /* 由JS动态设置max-height为内容高度，避免裁剪 */
    opacity: 1;
    transform: translateY(0);
}

.has-submenu.active .menu-title:after {
    transform: translateY(-50%) rotate(180deg);
}

.submenu-group {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 10px 0;
}

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

.submenu-title {
    padding: 8px 40px;
    font-weight: 600;
    color: #888;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.submenu-item {
    display: block;
    padding: 8px 40px 8px 60px;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease, opacity 0.2s ease, transform 0.2s ease;
    font-size: 14px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    opacity: 0;
    transform: translateX(-20px);
    animation: none;
}

.has-submenu.active .submenu-item {
    animation: slideInLeft 0.3s ease forwards;
}

.has-submenu.active .submenu-item:nth-child(1) { animation-delay: 0.1s; }
.has-submenu.active .submenu-item:nth-child(2) { animation-delay: 0.15s; }
.has-submenu.active .submenu-item:nth-child(3) { animation-delay: 0.2s; }
.has-submenu.active .submenu-item:nth-child(4) { animation-delay: 0.25s; }
.has-submenu.active .submenu-item:nth-child(5) { animation-delay: 0.3s; }
.has-submenu.active .submenu-item:nth-child(6) { animation-delay: 0.35s; }
.has-submenu.active .submenu-item:nth-child(7) { animation-delay: 0.4s; }
.has-submenu.active .submenu-item:nth-child(8) { animation-delay: 0.45s; }

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

.submenu-item:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    padding-left: 65px;
}

@media (max-width: 1024px) {
    .navbar-container {
        padding: 12px 15px;
    }
    
    .navbar-logo img {
        height: 70px;
    }

    .dropdown-menu {
        width: 35vw;
        padding-top: 64px;
        padding-bottom: 20px;
        height: 100vh;
        height: calc(100vh - env(keyboard-inset-height, 0px));
        height: 100dvh; /* 现代浏览器的动态视口高度 */
    }
    
    .menu-top-mask {
        height: 64px; /* 平板端调整遮罩高度 */
        width: 35vw;
    }
    
    .menu-overlay {
        left: 35vw;
        height: 100vh;
        height: calc(100vh - env(keyboard-inset-height, 0px));
        height: 100dvh; /* 现代浏览器的动态视口高度 */
    }
    
    /* 平板端菜单打开时logo居中 */
    .navbar.menu-open .navbar-logo {
        width: 35vw;
        top: 12px;
        transform: translateX(calc(17.5vw - 50%));
    }
    
    /* 平板端菜单打开时保持菜单按钮在右边 */
    .navbar.menu-open .navbar-menu-btn {
        right: 15px;
        top: 31px;
    }
}

/* 遮罩内容容器样式 */
.overlay-content-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    pointer-events: none;
}

.overlay-content {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    animation: overlayContentFadeIn 0.3s ease-out;
}

@keyframes overlayContentFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.overlay-header h2 {
    color: #fff;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.overlay-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.overlay-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.overlay-body {
    padding: 25px;
    color: #ddd;
    line-height: 1.6;
}

.overlay-body p {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.overlay-body p:last-child {
    margin-bottom: 0;
}

/* 节目单弹窗滚动条美化 */
#playbillOverlay .overlay-body {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(255, 255, 255, 0.35) rgba(255, 255, 255, 0.08);
}

#playbillOverlay .overlay-body::-webkit-scrollbar {
    width: 8px;
}

#playbillOverlay .overlay-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

#playbillOverlay .overlay-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.25));
    border-radius: 8px;
}

#playbillOverlay .overlay-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.35));
}

.overlay-body strong {
    color: #fff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .navbar-container {
        padding: 10px 15px;
    }
    
    .navbar-logo img {
        height: 60px;
    }
    
    .dropdown-menu {
        width: 50vw;
        padding-top: 57px;
        padding-bottom: 20px;
        height: 100vh;
        height: calc(100vh - env(keyboard-inset-height, 0px));
        height: 100dvh; /* 现代浏览器的动态视口高度 */
    }
    
    .menu-top-mask {
        height: 57px; /* 移动端调整遮罩高度 */
        width: 50vw;
    }
    
    .menu-overlay {
        left: 50vw;
        height: 100vh;
        height: calc(100vh - env(keyboard-inset-height, 0px));
        height: 100dvh; /* 现代浏览器的动态视口高度 */
    }
    
    .menu-item a,
    .menu-title {
        padding: 12px 15px;
    }
    
    .submenu-title {
        padding: 8px 30px;
    }
    
    .submenu-item {
        padding: 8px 30px 8px 45px;
    }
    
    .submenu-item:hover {
        padding-left: 50px;
    }
    
    /* 移动端菜单打开时logo居中 */
    .navbar.menu-open .navbar-logo {
        width: 50vw;
        top: 10px;
        transform: translateX(calc(24vw - 50%));
    }
    
    /* 移动端菜单打开时保持菜单按钮在右边 */
    .navbar.menu-open .navbar-menu-btn {
        right: 15px;
        top: 24px;
    }
    
    /* 移动端遮罩内容样式调整 */
    .overlay-content {
        width: 95%;
        max-width: none;
        border-radius: 15px;
    }
    
    .overlay-header {
        padding: 15px 20px;
    }
    
    .overlay-header h2 {
        font-size: 20px;
    }
    
    .overlay-body {
        padding: 20px;
    }
    
    .overlay-body p {
        font-size: 15px;
    }
}
