* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #f0f2f5; color: #333; overflow: hidden;
}
/* 手机端样式另见 mobile.css（由 mobile.js 打 body.is-mobile 状态类激活） */
.app-wrapper { display: flex; height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
    width: 220px; background: linear-gradient(180deg, #2b2f3a 0%, #1f232e 100%);
    color: #fff; display: flex; flex-direction: column;
    transition: width .28s ease; flex-shrink: 0;
}
.sidebar.collapsed { width: 64px; }
.logo {
    height: 50px; display: flex; align-items: center; gap: 10px;
    padding: 0 16px; font-size: 16px; font-weight: bold;
    background: rgba(0,0,0,.25); white-space: nowrap; overflow: hidden;
}
.logo .ico { font-size: 20px; }
.sidebar.collapsed .logo { justify-content: center; padding: 0; }
.sidebar.collapsed .logo .txt { display: none; }
.menu { flex: 1; overflow-y: auto; padding: 8px 0; }
/* 一级菜单（分组）：图标 + 名称 + 展开箭头 */
.menu-parent {
    display: flex; align-items: center; gap: 10px; padding: 11px 18px;
    cursor: pointer; color: #c8cbd2; font-size: 14px; white-space: nowrap;
    transition: background .15s;
}
.menu-parent:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-parent .mi-ico { width: 18px; text-align: center; flex-shrink: 0; font-size: 16px; }
.menu-parent .mp-text { flex: 1; }
.menu-parent .mp-arrow {
    width: 9px; height: 9px; flex-shrink: 0; margin-right: 2px;
    border-right: 2px solid #909399; border-bottom: 2px solid #909399;
    transform: rotate(45deg); transition: transform .2s;
}
.menu-parent:hover .mp-arrow { border-color: #fff; }
.menu-group.open > .menu-parent .mp-arrow { transform: rotate(-135deg); }

/* 二级菜单（报表项）：默认收起，.open 时展开 */
.menu-children { display: none; overflow: hidden; }
.menu-group.open > .menu-children { display: block; }
.menu-item {
    display: flex; align-items: center; padding: 10px 18px 10px 46px;
    cursor: pointer; color: #a8acb5; font-size: 13px; white-space: nowrap;
    border-left: 3px solid transparent; transition: background .15s;
}
.menu-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.menu-item.active { background: #1890ff; color: #fff; border-left-color: #69c0ff; }
.menu-item .mi-name { flex: 1; }

/* 折叠态 rail：整组一个图标，展开时隐藏，仅收起后显示 */
.menu-rail { display: none; }
.sidebar.collapsed .menu-parent,
.sidebar.collapsed .menu-children { display: none; }
.sidebar.collapsed .menu-rail {
    display: flex; align-items: center; justify-content: center;
    padding: 13px 0; margin: 2px 0; cursor: pointer; color: #c8cbd2;
    border-left: 3px solid transparent; transition: background .15s;
}
.sidebar.collapsed .menu-rail:hover { background: rgba(255,255,255,.08); color: #fff; border-left-color: #69c0ff; }
.sidebar.collapsed .menu-rail .mi-ico { width: auto; font-size: 18px; }

/* 折叠态悬停子菜单浮层（position:fixed，不受 .menu overflow 裁剪） */
.menu-flyout {
    position: fixed; z-index: 1500; display: none; min-width: 168px;
    background: #2b2f3a; color: #fff; border-radius: 0 4px 4px 0;
    padding: 6px 0; box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.flyout-title {
    padding: 8px 18px 6px; color: #8a8f99; font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 4px;
}
.flyout-item {
    padding: 10px 18px; cursor: pointer; font-size: 14px; color: #c8cbd2; white-space: nowrap;
}
.flyout-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.flyout-item.active { background: #1890ff; color: #fff; }

/* 滚动条 */
.menu::-webkit-scrollbar, .content::-webkit-scrollbar { width: 6px; }
.menu::-webkit-scrollbar-thumb, .content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.2); border-radius: 3px;
}

/* ---------- 主区域 ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.navbar {
    height: 50px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08);
    display: flex; align-items: center; padding: 0 16px; flex-shrink: 0; z-index: 5;
}
.navbar .toggle { font-size: 20px; cursor: pointer; color: #5a5a5a; padding: 4px 8px; }
.navbar .toggle:hover { color: #1890ff; }
.navbar .breadcrumb { font-size: 14px; color: #666; margin-left: 6px; }
.navbar .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.navbar .btn {
    border: 1px solid #d9d9d9; background: #fff; color: #555; cursor: pointer;
    padding: 5px 12px; border-radius: 4px; font-size: 13px;
}
.navbar .btn:hover { color: #1890ff; border-color: #1890ff; }
.navbar .user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #555; cursor: pointer; }
.navbar .avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: #1890ff; color: #fff; display: flex; align-items: center;
    justify-content: center; font-size: 13px;
}

/* ---------- 标签栏 ---------- */
/* 后台管理通用做法：标签栏可横向滚动，但隐藏滚动条（避免多标签时出现难看的原生条），
   改用鼠标滚轮横向滚动 —— 见 app.js 里的 wheel 监听 */
.tags-view {
    height: 40px; background: #fff; border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #e8e8e8; display: flex; align-items: center;
    padding: 0 10px; gap: 6px; overflow-x: auto; overflow-y: hidden;
    flex-shrink: 0;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* 旧版 Edge / IE */
}
.tags-view::-webkit-scrollbar { display: none; }   /* Chrome / Safari / 新版 Edge */
.tag {
    display: flex; align-items: center; gap: 6px; padding: 5px 10px;
    background: #f4f4f5; color: #555; border-radius: 3px; font-size: 13px;
    cursor: pointer; white-space: nowrap; border: 1px solid transparent;
}
.tag.active { background: #1890ff; color: #fff; }
.tag .close { font-size: 12px; opacity: .7; }
.tag .close:hover { opacity: 1; }

/* ---------- 内容 ---------- */
/* 定位一律写满 top/right/bottom/left，不用 inset 简写：
   旧内核（微信/QQ 内置 X5 等）不认 inset，auto 偏移会让绝对定位元素塌成内容尺寸
   （iframe 的 height:100% 就变成 0），手机上报表就会看不见。 */
.content { flex: 1; position: relative; background: #f0f2f5; overflow: hidden; }
.tab-pane { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; background: #f0f2f5; }
.tab-pane.active { display: block; }
.tab-pane iframe { width: 100%; height: 100%; border: none; background: #fff; }
.empty-tip {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; color: #999; gap: 10px;
}
.empty-tip .big { font-size: 56px; opacity: .35; }

/* PB 原生窗口占位（真实 PB 子窗口会覆盖在本区域之上） */
.pb-ph {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex;
    align-items: center; justify-content: center; color: #bbb; font-size: 14px;
}

/* ---------- 报表设计器浮层（全屏） ---------- */
.designer-overlay {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1000; background: #f0f2f5;
    display: none; /* JS 控制显示 */
}
.designer-overlay iframe {
    width: 100%; height: 100%; border: none; background: #f0f2f5; display: block;
}

/* ---------- 打印全屏浮层 ---------- */
/* 打印预览（h5dw PrintDialog）在报表 iframe 内打开；把该 iframe 放大铺满主页面，
   打印框即"显示在主页面之上并可铺满全屏"，与设计器浮层同一交互心智。 */
.tab-pane iframe.floating {
    position: fixed !important;
    left: 0; top: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1200;
    background: #f0f2f5;
}
