/* ============ 新管理后台 主框架（复刻老系统 zhongsuankeji 蓝白布局） ============ */
* { box-sizing: border-box; }
/* 全局字号三档（rem 基准，所有 rem 值随档位等比缩放）：
   大 = 18px / 中 = 16px（默认） / 小 = 14px
   由 main.html 标签栏右侧的字号开关切换（html.font-lg / font-sm，localStorage 记忆） */
html { font-size: 16px; }
html.font-lg { font-size: 18px; }
html.font-sm { font-size: 14px; }
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: #f2f3f5;
    color: #333;
}

/* ---------- 顶部（蓝 #1E9FF2，对齐老系统 .ui-layout-header） ---------- */
.topbar {
    position: relative;
    z-index: 3;
    height: 3.5rem;
    background: #1E9FF2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    box-shadow: 0 0 .3rem 0 rgba(0, 0, 0, 0.4);
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
    padding-right: .5rem;
    /* 不设固定宽度：固定宽在字号放大后会把品牌文字截断（overflow:hidden 生效），
       让它按内容自然占位，flex 布局下与右侧导航/用户区互不挤压 */
}

.topbar .brand .media {
    width: 3.2rem;
    height: 3.5rem;
    display: inline-block;
    background-position: center;
    background-repeat: no-repeat;
    vertical-align: middle;
    flex-shrink: 0;
}

.topbar .brand .name {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}

/* 顶部一级模块横向导航（对应老系统 #app_main_nav） */
.topbar .group-nav {
    display: flex;
    align-items: stretch;
    height: 3.5rem;
    margin-left: .5rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.topbar .group-nav::-webkit-scrollbar { display: none; }

.topbar .group-nav .group-item {
    display: flex;
    align-items: center;
    height: 3.5rem;
    padding: 0 1.1rem;
    color: #fff;
    font-size: .92rem;
    line-height: 3.5rem;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background .2s;
}
.topbar .group-nav .group-item:hover { background: rgba(255, 255, 255, 0.12); }
.topbar .group-nav .group-item.active { background: rgba(255, 255, 255, 0.18); }

.topbar .user-area {
    display: flex;
    align-items: center;
    gap: .8rem;
    flex-shrink: 0;
    font-size: .88rem;
    color: #fff;
}

.topbar .user-area .btn-logout {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    border-radius: 4px;
    padding: .25rem .7rem;
    cursor: pointer;
    font-size: .8rem;
    line-height: 1.2;
}
.topbar .user-area .btn-logout:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- 主体 ---------- */
.layout { display: flex; height: calc(100% - 3.5rem); }

/* 左侧功能菜单栏（白底，对应老系统 .ui-layout-side） */
.sidebar {
    width: 13rem;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    border-right: 1px solid #e8e8e8;
}

.sidebar .side-head {
    height: 2.7rem;
    line-height: 2.7rem;
    border-bottom: 1px solid #f3f3f3;
    padding: 0 .75rem;
    font-size: .78rem;
    color: #bbb;
    letter-spacing: 1px;
}

/* 菜单组（每点一个顶部模块，显示对应组） */
.sidebar .menu-group { display: none; }
.sidebar .menu-group.active { display: block; }

/* 一级菜单项 */
.sidebar .menu-item {
    position: relative;
    display: flex;
    align-items: center;
    line-height: 2.4rem;
    padding: 0 .6rem 0 .8rem;
    color: #333;
    font-size: .86rem;
    cursor: pointer;
    text-decoration: none;
    transition: padding-left .2s;
    /* ★2026-10-22 防折行：个别浏览器内核/插件会把悬停项收缩成内容宽，cite 文字被挤折行
       （实测「设备管理」悬停变「设备管/理」两行）。菜单文字强制单行，从根上杜绝。 */
    white-space: nowrap;
}
.sidebar .menu-item:hover { padding-left: 1rem; color: #1E9FF2; }
.sidebar .menu-item .icon {
    width: 1.1rem;
    margin-right: .45rem;
    text-align: center;
    color: #999;
    flex-shrink: 0;
    line-height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sidebar .menu-item:hover .icon { color: #1E9FF2; }
/* ★2026-10-22 cite 是斜体标签，中文斜体为强制倾斜、观感发歪 → 覆盖为正体 */
.sidebar .menu-item cite { flex: 1; font-style: normal; }
.sidebar .menu-item .arrow {
    width: 1rem;
    text-align: center;
    color: #bbb;
    font-size: .7rem;
    flex-shrink: 0;
    transition: transform .2s;
}
.sidebar .menu-item.open .arrow { transform: rotate(90deg); }
.sidebar .menu-item.active,
.sidebar .menu-item.open {
    color: #1E9FF2;
    background: rgba(30, 159, 242, 0.08);
}
.sidebar .menu-item.active::before,
.sidebar .menu-item.open::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: .15rem;
    background: rgba(30, 159, 242, 0.6);
}
.sidebar .menu-item.active .icon,
.sidebar .menu-item.open .icon { color: #1E9FF2; }

/* 二级子菜单 */
.sidebar .menu-sub {
    display: none;
    overflow: hidden;
}
.sidebar .menu-sub.open { display: block; }

.sidebar .menu-sub .sub-item {
    display: flex;
    align-items: center;
    line-height: 2.2rem;
    padding: 0 .6rem 0 2.2rem;
    color: #555;
    font-size: .8rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.sidebar .menu-sub .sub-item:hover { color: #1E9FF2; background: #f7fbff; }
.sidebar .menu-sub .sub-item.active {
    color: #1E9FF2;
    font-weight: bold;
}

/* ---------- 内容区（标签栏 + iframe 上下布局） ---------- */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f2f3f5;
}

/* 标签栏：左标签区（可横向滚动）+ 右字号切换（大/中/小） */
.tabbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    height: 2.6rem;
    padding: 0 .5rem;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}
.tabbar-tabs {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabbar-tabs::-webkit-scrollbar { height: 0; }

/* 字号切换开关 */
.font-switch {
    display: flex;
    align-items: center;
    gap: .2rem;
    flex-shrink: 0;
    padding-left: .5rem;
    border-left: 1px solid #eee;
}
.font-switch .fs-label {
    font-size: .72rem;
    color: #999;
    margin-right: .15rem;
}
.font-switch .fs-btn {
    height: 1.55rem;
    padding: 0 .55rem;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    background: #fff;
    color: #666;
    font-size: .74rem;
    font-family: inherit;
    cursor: pointer;
    line-height: 1;
    transition: color .15s, border-color .15s, background .15s;
}
.font-switch .fs-btn:hover { color: #1E9FF2; border-color: #1E9FF2; }
.font-switch .fs-btn.active {
    background: #1E9FF2;
    border-color: #1E9FF2;
    color: #fff;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    height: 1.95rem;
    padding: 0 .7rem;
    border: 1px solid #e3e6ec;
    border-radius: 3px;
    background: #fafbfc;
    color: #666;
    font-size: .8rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color .15s, border-color .15s, background .15s;
}
.tab:hover { color: #1E9FF2; border-color: #b8dcf7; }
.tab.active {
    background: #1E9FF2;
    border-color: #1E9FF2;
    color: #fff;
}
.tab .tab-dot {
    width: .35rem;
    height: .35rem;
    border-radius: 50%;
    background: #c4c8d0;
    flex-shrink: 0;
}
.tab.active .tab-dot { background: #fff; }
.tab .tab-close {
    margin-left: .1rem;
    width: .95rem;
    height: .95rem;
    line-height: .88rem;
    text-align: center;
    border-radius: 50%;
    font-size: .82rem;
    opacity: .55;
}
.tab .tab-close:hover { background: rgba(0, 0, 0, 0.1); opacity: 1; }
.tab.active .tab-close:hover { background: rgba(255, 255, 255, 0.25); }

/* 双击刷新反馈 */
@keyframes tab-flash {
    0%   { opacity: 1; }
    35%  { opacity: .35; }
    100% { opacity: 1; }
}
.tab.flash { animation: tab-flash .45s ease; }

/* 标签容器区：撑满剩余空间 */
.pane-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
}
/* 每个标签一个独立容器：内部独立滚动，切标签只做显示/隐藏，状态一直保留 */
.pane-wrap .tab-pane {
    height: 100%;
    overflow: auto;
    padding: 1rem;
    background: #f2f3f5;
}

.card {
    background: #fff;
    border-radius: 4px;
    padding: 1.4rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    max-width: 880px;
}

.card h4 { margin: 0 0 .8rem; font-weight: 600; }
.card p { color: #666; font-size: .85rem; line-height: 1.8; margin: .4rem 0; }
.card a { color: #1E9FF2; }
.muted { color: #999; font-size: .72rem; }
