/* ######### Drop Down DIVs CSS ######### */

.ddsubmenustyle, .ddsubmenustyle div{ /*topmost and sub DIVs, respectively*/
    font: normal 13px Verdana;
    margin: 0;
    padding: 0;
    position: absolute;
    left: 0;
    top: 0;
    list-style-type: none;
    background: white;
    border: 1px solid black;
    border-bottom-width: 0;
    visibility: hidden;
    z-index: 100;
}

.ddsubmenustyle ul{
    margin: 0;
    padding: 0;
    position: absolute;
    left: 0;
    top: 0;
    list-style-type: none;
    border: 0px none;
}

.ddsubmenustyle ul li{
    margin:0;
}

.ddsubmenustyle li a{
    display: block;
    width: 150px; /*width of menu (not including side paddings)*/
    color: black;
    background-color: lightyellow;
    text-decoration: none;
    padding: 4px 5px;
    border-bottom: 1px solid black;
}

* html .ddsubmenustyle li{ /*IE6 CSS hack*/
    display: inline-block;
    width: 100px; /*width of menu (include side paddings of LI A*/
}

.ddsubmenustyle li a:hover{
    background-color: black;
    color: white;
}

/* ######### Neutral CSS  ######### */

.downarrowpointer{ /*CSS for "down" arrow image added to top menu items*/
    margin-left: 5px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.dropdown:hover .downarrowpointer {
    transform: rotate(180deg);
}

.rightarrowpointer{ /*CSS for "right" arrow image added to drop down menu items*/
    position: absolute;
    padding-top: 3px;
    left: 100px;
    border: 0;
}

.ddiframeshim{
    position: absolute;
    z-index: 500;
    background: transparent;
    border-width: 0;
    width: 0;
    height: 0;
    display: block;
}

/* 种子下拉菜单样式 */
.ddsubmenustyle {
    position: absolute;
    background: var(--nx-surface, #fff);
    border: 1px solid var(--nx-border, #ccc);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 2000;
    left: 0px;
    top: -1000px; /* 保持在屏幕外 */
    visibility: hidden; /* 初始隐藏 */
    height: 0px;
    width: 100px;
    overflow: hidden;
    opacity: 0; /* 初始透明 */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 4px;
    min-width: 150px;
}

.ddsubmenustyle ul {
    padding: 5px 0;
    margin: 0;
    list-style-type: none;
}

.ddsubmenustyle ul li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.ddsubmenustyle ul li a {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    color: var(--nx-text, #333);
    transition: background-color 0.2s;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
    border-bottom: none;
    background-color: transparent;
}

.ddsubmenustyle ul li a:hover {
    background-color: var(--nx-surface-hover, #f5f5f5);
    color: var(--nx-text, #333);
}

.ddsubmenustyle ul li:last-child a {
    border-bottom: none;
}

/* 主导航菜单样式 */
nav#nav {
    margin: 10px 0;
}

nav#nav ul.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: var(--nx-surface-alt, #f5f5f5);
    border-radius: var(--nx-radius-lg, 5px);
}

nav#nav ul.menu li {
    margin: 0;
    padding: 0;
    position: relative;
}

nav#nav ul.menu li a {
    display: block;
    padding: 12px 5px;
    text-decoration: none;
    color: var(--nx-text, #333);
    font-weight: normal;
    transition: all 0.3s ease;
}

nav#nav ul.menu li a:hover {
    background: var(--nx-primary-soft, #e0e0e0);
    border-radius: var(--nx-radius-lg, 5px);
}

/* 图标样式 */
nav#nav ul.menu li a i {
    margin-right: 5px;
    width: 10px;
    text-align: center;
}

/* 子菜单图标样式 */
.ddsubmenustyle ul li a i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* 下拉菜单显示状态 */
.ddsubmenustyle.visible {
    visibility: visible;
    opacity: 1;
    height: auto;
    overflow: visible;
}

/* 选中状态的菜单项 */
nav#nav ul.menu li.selected a {
    background: #e0e0e0;
    font-weight: bold;
}

/* 下拉菜单显示效果 */
.dropdown:hover .ddsubmenustyle {
    visibility: visible;
    opacity: 1;
    height: auto;
    overflow: visible;
    top: 100%;
}

/* ===== 导航二级下拉抽屉（种子 / 游戏…共用 .nx-menu-drawer：运行时提升到 body，position:fixed 视口定位） ===== */
/* 为什么必须提升到 body：nav 被 begin_main_frame() 包在 <table class="main"> 里，
   而 table.main 带 overflow:hidden（裁剪）+ backdrop-filter（层叠上下文），
   抽屉留在里面会被裁掉、并被同级的 #info_block 盖住。
   提升到 body 直系 + position:fixed（视口坐标）即可彻底摆脱裁剪与层叠陷阱。 */
.nx-menu-drawer {
    position: fixed !important;      /* 视口定位，坐标由 JS 按按钮 rect 写入 */
    top: 0;
    left: 0;
    margin: 0 !important;
    width: auto !important;
    min-width: 180px;
    height: auto !important;         /* 覆盖全局 .ddsubmenustyle 的 height:0，避免内容被裁掉 */
    overflow: visible !important;
    visibility: visible !important;  /* 覆盖全局 .ddsubmenustyle 的 visibility:hidden（显隐改由 opacity 控制） */
    z-index: 9999 !important;        /* 高于 #nav_block(200) 与页面内容，确保不被遮挡 */
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity var(--nx-dur-fast, 0.18s) var(--nx-ease-out, ease),
                transform var(--nx-dur-fast, 0.18s) var(--nx-ease-out, ease);
}

/* JS 悬停/聚焦时加 .is-open（含 140ms 容错，够鼠标从按钮滑入菜单） */
.nx-menu-drawer.is-open {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

/* 🔴 内层 ul 必须回到正常流：本文件第 18 行那份 ddlevelsmenu 老基底把
   `.ddsubmenustyle ul` 写成 position:absolute + left/top:0 —— 它当年是给
   「JS 自己算坐标的多级菜单」用的。抽屉现在靠自身盒子画背景/圆角，绝对定位的
   ul 不贡献高度，于是 div 塌成 padding+border 那 10px 一条白带子盖在列表上沿，
   ul 又按 shrink-to-fit 比盒子窄 → 看着就是「错位白条 + 子项和父项没对齐」。 */
.nx-menu-drawer > ul {
    position: static;
    width: auto;
    top: auto;
    left: auto;
}

/* 清除浮动 */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 可见元素 */
.visible {
    display: block !important;
}
