/* 后台管理 主框架 */

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}
.layui-layout-admin .layui-body {
    overflow: hidden;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
}
.main_iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}
.layui-logo {
    font-weight: bold;
}

/* 顶部同一行：品牌、刷新、弹性选项卡、管理员区域 */
.layui-layout-admin .main_header { display: flex; align-items: stretch; padding: 0; background: #252c38; }
.layui-layout-admin .main_header .layui-logo { position: static; flex: 0 0 200px; }
.main_header .layui-layout-left, .main_header .layui-layout-right { position: static !important; flex: 0 0 auto; padding: 0; }
.main_header .layui-nav { background: transparent; }
.main_header .layui-nav-item { line-height: 40px; }
.main_header .layui-nav > .layui-nav-item > a { font-size: 13px; color: #cbd2dd; }
.main_header .layui-nav-bar { display: none; }
/* 顶栏统一使用低对比度的短分隔线 */
#refresh_page { position: relative; width: 60px; padding: 0; text-align: center; }
/* 刷新悬停反馈，不使用导航底部指示线 */
#refresh_page:hover, #refresh_page:focus-visible { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.main_header .layui-layout-left .layui-this::after { display: none; }
#refresh_page .layui-icon, .page_tab_default .layui-icon { font-size: 14px; }
#refresh_page .layui-icon { position: relative; top: 2px; }
#refresh_page::after { content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 14px; background: rgba(255, 255, 255, .16); pointer-events: none; }
.main_header .layui-nav-child { top: 40px; }
.main_header .layui-layout-right { max-width: 40%; position: relative !important; }
.main_header .layui-layout-right::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 14px; background: rgba(255, 255, 255, .16); }
.main_header .layui-layout-right > .layui-nav-item { max-width: 100%; }
.main_header .layui-layout-right > .layui-nav-item > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 选项卡总宽度随两侧内容自动变化，超出部分在当前行内滚动 */
.page_tabs { display: flex; flex: 1 1 0; min-width: 0; height: 40px; align-items: stretch; padding-top: 5px; box-sizing: border-box; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #666 transparent; }
.page_tabs::-webkit-scrollbar { height: 4px; }
.page_tabs::-webkit-scrollbar-thumb { background: #666; border-radius: 2px; }
.page_tab { display: flex; flex: 0 0 auto; align-items: center; border: 0; border-radius: 4px 4px 0 0; font-size: 13px; position: relative; min-width: 110px; box-sizing: border-box; }
.page_tab::after { content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 14px; background: rgba(255, 255, 255, .16); pointer-events: none; }
.page_tab:hover { background: rgba(255, 255, 255, .05); }
.page_tab_default { min-width: 0; width: 60px; }
.page_tab_default .tab_select { padding: 6px 0; text-align: center; }
.page_tab_active, .page_tab_active:hover { background: #fff; }
.page_tab_active::after, .page_tab:has(+ .page_tab_active)::after { opacity: 0; }
.page_tab button { border: 0; background: transparent; color: #cbd2dd; cursor: pointer; font: inherit; }
.tab_select { flex: 1; width: 100%; padding: 6px 12px; white-space: nowrap; text-align: left; }
/* 关闭按钮浮在右侧并垂直居中，隐藏时不占标题空间 */
.page_tab .tab_close { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; line-height: 22px; font-size: 18px; opacity: 0; pointer-events: none; background: #252c38; color: #a6b2c5; border-radius: 3px; }
.page_tab_active .tab_close { background: #fff; }
.page_tab:hover .tab_close, .page_tab:focus-within .tab_close { opacity: 1; pointer-events: auto; }
.page_tab_active .tab_select { color: #263445; font-weight: 500; }
.page_tab:not(.page_tab_active) .tab_select:hover { color: #fff; }
.page_tab .tab_close:hover { color: #16baaa; background: #edf2f5; }
.page_tab button:focus-visible { outline: 2px solid #16baaa; outline-offset: -2px; }

/* 每个菜单保留独立iframe，仅当前页可见 */
.page_frames { flex: 1; min-height: 0; position: relative; }

/* 顶部选项卡右键菜单 */
.tab_context_menu { position: fixed; z-index: 10000; width: 120px; padding: 5px 0; border-radius: 4px; box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
.tab_context_menu button { display: flex; align-items: center; gap: 8px; box-sizing: border-box; width: 100%; border: 0; padding: 9px 12px; background: #fff; color: #333; font-size: 13px; text-align: left; cursor: pointer; }
.tab_context_menu button:hover, .tab_context_menu button:focus-visible { background: #f2f5f7; color: #16baaa; outline: none; }
.tab_context_menu button:disabled { color: #bbb; cursor: not-allowed; background: #fff; }

.tab_context_menu .layui-icon { flex: 0 0 16px; font-size: 14px; line-height: 1; text-align: center; }
