/* 菜单遮罩层（相对手机容器定位，不超出手机宽度） */
.msmenu_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none; /* 默认隐藏 */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.msmenu_overlay.active {
    display: block;
    opacity: 1;
}

/* 下拉菜单容器（相对手机容器定位，紧靠手机右上角） */
.msmenu_container {
    position: absolute;
    top: 54px; /* 兜底值，实际位置由 JS 按标题栏高度计算 */
    right: 0;
    width: 176px; /* 菜单宽度（容纳 7 字菜单项，留足余量防换行） */
    background-color: #ffffff;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transform: translateY(-100%); /* 默认向上收起隐藏 */
    opacity: 0;

    /* 关键：收起时必须彻底退出命中测试。
       仅用 opacity:0 的元素仍然会拦截鼠标点击，
       会盖住右上角汉堡按钮导致其无法触发。 */
    visibility: hidden;
    pointer-events: none;

    transition: transform 0.3s ease, opacity 0.3s ease,
                visibility 0s linear 0.3s;
    border-bottom-left-radius: 8px;
    overflow: hidden;
}

.msmenu_container.active {
    transform: translateY(0); /* 下拉显示 */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.3s ease, opacity 0.3s ease,
                visibility 0s;
}

/* 菜单项 */
.msmenu_item {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    transition: background-color 0.2s;
}

.msmenu_item:last-child {
    border-bottom: none;
}

.msmenu_item:active {
    background-color: #f9f9f9;
}

/* 当前所在页高亮 */
.msmenu_item.msmenu_item_current {
    color: #c00000;
    background-color: #fdf2f2;
    font-weight: 600;
}