    top = mainInfoRect.bottom + padding;
            }

            // Á°Æ‰øù‰∏çË∂ÖÂá∫ÂÆπÂô®ËæπÁïå
            top = Math.max(
                containerRect.top + padding,
                Math.min(
                    top,
                    containerRect.bottom - popupHeight - padding
                )
            );

            popup.style.left = `${left - containerRect.left}px`;
            popup.style.top = `${top - containerRect.top}px`;
            popup.classList.add