/* ============================================================
   凡游 后台通用样式
   主题色：teal #16baaa  深色侧栏：#1f2330
   ============================================================ */
html, body { height: 100%; }
body {
    background: #eef1f6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 登录 / 注册 / 找回 ---------- */
.login-wrap {
    position: fixed; inset: 0;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.login-box {
    width: 380px; max-width: 100%; background: #fff; border-radius: 14px;
    padding: 38px 34px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
.login-box h1 { font-size: 23px; text-align: center; margin-bottom: 4px; color: #1e3c72; letter-spacing: 1px; }
.login-box .sub { text-align: center; color: #9aa3b2; font-size: 13px; margin-bottom: 26px; }
.login-box .layui-form-item { margin-bottom: 18px; }
.login-box .layui-input { height: 44px; line-height: 44px; border-radius: 8px; }
.login-box .layui-btn-fluid { height: 44px; line-height: 44px; border-radius: 8px; background: #16baaa; }
.login-box .layui-btn-fluid:hover { background: #13a99a; }
.login-links {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; margin: 14px 0 0; padding: 0 2px;
}
.login-links a {
    font-size: 13px; text-decoration: none; line-height: 1; white-space: nowrap;
}
.login-links .link-register { color: #16baaa; }
.login-links .link-register:hover { color: #13a99a; }
.login-links .link-forgot { color: #9aa3b2; }
.login-links .link-forgot:hover { color: #6b7280; }
.login-tip { color: #e54d42; font-size: 12px; min-height: 18px; margin-bottom: 6px; }
.login-foot { text-align: center; color: #b6bdc8; font-size: 12px; margin-top: 18px; }

/* ---------- 管理框架 ---------- */
.layui-layout-admin .layui-header {
    background: #1f2330;
    box-shadow: 0 1px 0 rgba(255,255,255,.04);
    height: 60px;
    padding: 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    width: 100%;
}
.admin-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 200px;
    flex-shrink: 0;
    height: 60px;
    color: #fff !important;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .5px;
    background: #181b26;
}
.admin-logo i { color: #16baaa; font-size: 20px; flex-shrink: 0; }
.admin-logo .logo-text { white-space: nowrap; }

/* 顶部右侧工具区 */
.header-tools {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
    padding-right: 6px;
}
.header-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: rgba(255,255,255,.78);
    border-radius: 8px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.header-tool:hover { color: #fff; background: rgba(255,255,255,.08); }
.header-tool .layui-icon { font-size: 18px; }
.header-tool.nav-toggle { display: none; }

.header-user-nav {
    position: relative;
    background: transparent !important;
    padding: 0;
    margin: 0;
}
.header-user-nav .layui-nav-item { line-height: normal; }
.header-user-nav .layui-nav-item > a { padding: 0 !important; height: auto; line-height: normal; }

/* 用户区：用 flex + nowrap，彻底避免文字竖排 */
.admin-user {
    display: inline-flex !important; align-items: center; gap: 8px;
    white-space: nowrap; padding: 0 20px;
}
.admin-user .u-name { color: #fff; font-size: 14px; }
.admin-user .u-tag {
    display: inline-block; white-space: nowrap;
    height: 22px; line-height: 22px; padding: 0 10px;
    border-radius: 11px; font-size: 12px;
    background: rgba(22,186,170,.2); color: #43d6c6;
}
.admin-user .u-tag.staff { background: rgba(255,255,255,.14); color: #cdd3df; }
.layui-layout-admin .layui-nav .layui-nav-more { display: none; }

/* 侧栏 */
.layui-layout-admin .layui-side { background: #1f2330; top: 60px; width: 200px; box-shadow: 2px 0 6px rgba(0,0,0,.06); }
.layui-side-scroll { width: 200px; }
.layui-nav-tree { background: transparent; width: 200px; }
.layui-nav-tree .layui-nav-item a { color: rgba(255,255,255,.72); height: 46px; line-height: 46px; }
.layui-nav-tree .layui-nav-item a:hover { background: rgba(255,255,255,.04); color: #fff; }
.layui-nav-tree .layui-nav-item a cite { font-size: 14px; }
.layui-nav-tree .layui-nav-item a .layui-icon { font-size: 16px; }
/* 一级分组标题 */
.layui-nav-tree .layui-nav-itemed > a { color: #fff !important; background: rgba(0,0,0,.16) !important; }
/* 选中态：teal 左条 */
.layui-nav-tree .layui-this > a,
.layui-nav-tree .layui-this > a:hover {
    background: linear-gradient(90deg, rgba(22,186,170,.22), rgba(22,186,170,0)) !important;
    color: #fff !important;
    border-left: 3px solid #16baaa;
}
.layui-nav-tree .layui-nav-bar { background: #16baaa; }
/* 子菜单背景略深 */
.layui-nav-tree .layui-nav-child a { background: rgba(0,0,0,.16); padding-left: 46px; height: 42px; line-height: 42px; }
.layui-nav-tree .layui-nav-child a:hover { background: rgba(0,0,0,.28); }

/* 内容区 */
.admin-body-iframe { position: absolute; inset: 60px 0 0 200px; background: #eef1f6; }
.admin-body-iframe.full { left: 0; }
.admin-body-iframe iframe { width: 100%; height: 100%; border: 0; display: block; }

/* 侧栏滚动条 */
.layui-side-scroll::-webkit-scrollbar { width: 6px; }
.layui-side-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 3px; }

/* ---------- 内容页通用 ---------- */
.page-wrap { padding: 16px; }
.toolbar {
    margin-bottom: 14px; background: #fff; border-radius: 8px;
    padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.toolbar .layui-btn { border-radius: 6px; }
.search-form .layui-form-item { margin-bottom: 10px; }

/* 表格卡片化 */
.layui-table-view { border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.05); border: 0; }
.layui-table-tool, .layui-table-page { background: #fff; }

/* 主按钮统一品牌色 */
.layui-btn-normal { background-color: #16baaa; }
.layui-btn-normal:hover { background-color: #13a99a; }

/* ---------- 移动端自适应 ---------- */
@media screen and (max-width: 768px) {
    .admin-body-iframe { left: 0; }
    .layui-layout-admin .layui-side { left: -200px; transition: left .2s; z-index: 1100; }
    .layui-layout-admin.side-show .layui-side { left: 0; }
    .admin-mask { display: none; position: fixed; inset: 60px 0 0 0; background: rgba(0,0,0,.4); z-index: 1050; }
    .layui-layout-admin.side-show .admin-mask { display: block; }

    /* 手机顶栏：仅 Logo 图标 + 工具按钮，避免文字重叠 */
    .header-inner { padding: 0 4px 0 0; }
    .admin-logo {
        width: auto;
        justify-content: flex-start;
        padding: 0 12px;
        background: transparent;
    }
    .admin-logo .logo-text { display: none !important; }
    .header-tool.nav-toggle { display: inline-flex; }
    .header-tools { gap: 2px; padding-right: 2px; }
    .header-tool {
        width: 38px;
        height: 38px;
    }
    .admin-user {
        padding: 0 6px !important;
        gap: 4px;
    }
    .admin-user .u-name { display: none !important; }
    .admin-user .u-tag {
        padding: 0 7px;
        font-size: 11px;
        height: 20px;
        line-height: 20px;
    }

    /* 手机端弹窗：左右留白 + 高度随内容（位置由 JS 一次性计算，避免闪动） */
    .layui-layer.layer-mobile-fit {
        left: 3% !important;
        right: 3% !important;
        width: auto !important;
        max-width: none;
        margin-left: 0 !important;
        max-height: 88vh;
        transform: none !important;
    }
    .layui-layer.layer-mobile-fit .layui-layer-content {
        height: auto !important;
        max-height: 72vh;
        overflow-y: auto;
    }
    .layui-layer.layer-mobile-fit iframe {
        display: block;
    }
}
@media screen and (min-width: 769px) {
    .admin-mask { display: none; }
    .nav-toggle { display: none !important; }
}
