html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #f3f6fb;
    color: #1f2937;
    font-family: "Microsoft YaHei", Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

.layui-layout-admin {
    position: fixed;
    inset: 0;
    min-width: 1024px;
    background: #f3f6fb;
    overflow: hidden;
}

.admin-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    height: 64px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .08);
}

.admin-header-inner {
    position: relative;
    display: flex;
    width: 100%;
    height: 64px;
}

.admin-header-logo {
    display: flex;
    align-items: center;
    flex: 0 0 220px;
    width: 220px;
    height: 64px;
    padding: 0 18px;
    color: #fff;
    background: linear-gradient(135deg, #1677ff, #08b5ff);
    text-decoration: none;
    overflow: hidden;
}

.admin-header-logo:hover {
    color: #fff;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-right: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .2);
    font-size: 20px;
    font-weight: 700;
}

.logo-text-block {
    display: block;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-header-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
    padding: 0 18px;
}

.hr-zone-left,
.hr-zone-right,
.hr-tabs-ops,
.hr-tools,
.hr-user {
    display: flex;
    align-items: center;
}

.hr-zone-left {
    min-width: 0;
}

.hr-zone-right {
    gap: 14px;
    margin-left: auto;
}

.fold-trigger,
.hr-tools-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    border-radius: 10px;
    color: #4b5563;
    cursor: pointer;
    transition: all .2s ease;
}

.fold-trigger:hover,
.hr-tools-item:hover {
    color: #1677ff;
    background: #edf5ff;
}

.fold-arrow {
    position: relative;
    display: block;
    width: 18px;
    height: 14px;
    border-top: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}

.fold-arrow::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
}

.hr-tools-item .badge {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #f53f3f;
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    text-align: center;
}

.hr-user {
    height: 42px;
    padding: 0 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s ease;
}

.hr-user:hover,
.hr-user.active {
    background: #f2f7ff;
}

.hr-user img {
    width: 32px;
    height: 32px;
    margin-right: 8px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}

.user-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-arrow {
    margin-left: 4px;
    font-size: 12px;
}

.admin-header-user-menu {
    position: fixed;
    z-index: 1200;
    display: none;
    min-width: 150px;
    margin: 8px 0 0;
    padding: 8px 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(15, 23, 42, .16);
}

.admin-header-user-menu.show {
    display: block;
}

.admin-header-user-menu .menu-header {
    padding: 10px 14px;
    border-bottom: 1px solid #eef2f7;
}

.admin-header-user-menu .mh-name {
    color: #111827;
    font-weight: 600;
}

.admin-header-user-menu .mh-role {
    margin-top: 3px;
    color: #8a94a6;
    font-size: 12px;
}

.admin-header-user-menu dd {
    margin: 0;
}

.admin-header-user-menu dd a {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    color: #4b5563;
    text-decoration: none;
}

.admin-header-user-menu dd a:hover {
    color: #1677ff;
    background: #f5f8ff;
}

.admin-header-user-menu dd i {
    margin-right: 8px;
}

.admin-header-user-menu .divider {
    height: 1px;
    margin: 6px 0;
    background: #eef2f7;
}

.admin-header-user-menu .danger a {
    color: #f53f3f;
}

.admin-side {
    position: fixed;
    top: 64px;
    bottom: 40px;
    left: 0;
    z-index: 900;
    width: 220px;
    background: #101827;
    box-shadow: 2px 0 12px rgba(15, 23, 42, .08);
    transition: width .25s ease, transform .25s ease;
}

.admin-side-scroll {
    width: 100%;
    height: 100%;
    padding: 10px 8px;
    overflow-x: hidden;
    overflow-y: auto;
}

.admin-side-scroll::-webkit-scrollbar {
    width: 6px;
}

.admin-side-scroll::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: rgba(255, 255, 255, .2);
}

.admin-nav-tree,
.admin-submenu {
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-nav-node {
    margin: 2px 0;
}

.admin-nav-node .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 38px 0 14px;
    border-radius: 10px;
    color: #b7c2d4;
    line-height: 42px;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s ease;
}

.admin-nav-node .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.admin-nav-node.is-active > .nav-link {
    color: #fff;
    background: linear-gradient(135deg, #1677ff, #08b5ff);
    box-shadow: 0 6px 14px rgba(22, 119, 255, .24);
}

.admin-nav-node .iconfont,
.admin-nav-node .layui-icon {
    flex: 0 0 18px;
    width: 18px;
    margin-right: 10px;
    text-align: center;
    font-size: 16px;
}

.admin-nav-node cite {
    display: block;
    flex: 1;
    min-width: 0;
    font-style: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-arrow {
    position: absolute;
    top: 0;
    right: 12px;
    height: 42px;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 42px;
    transition: transform .2s ease;
}

.admin-nav-node.is-spread > .nav-link .nav-arrow {
    transform: rotate(180deg);
}

.admin-submenu-wrap {
    display: none;
    padding: 4px 0 6px 14px;
}

.admin-nav-node.is-spread > .admin-submenu-wrap {
    display: block;
}

.admin-submenu .nav-link {
    min-height: 36px;
    padding-left: 14px;
    line-height: 36px;
    font-size: 13px;
}

.admin-submenu .nav-arrow {
    height: 36px;
    line-height: 36px;
}

.admin-body {
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 40px;
    left: 220px;
    z-index: 100;
    padding: 14px;
    overflow: hidden;
    transition: left .25s ease;
}

.admin-tabs {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.admin-tabs-header {
    height: 44px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
    overflow: hidden;
}

.admin-tabs-title {
    width: 100%;
    height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
}

.admin-tabs-title-inner {
    display: flex;
    align-items: center;
    min-width: max-content;
    height: 44px;
    padding: 0 8px;
}

.admin-tab-item {
    display: inline-flex;
    align-items: center;
    height: 32px;
    margin-right: 6px;
    padding: 0 10px;
    border-radius: 9px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    transition: all .2s ease;
}

.admin-tab-item:hover {
    color: #1677ff;
    background: #edf5ff;
}

.admin-tab-item.active {
    color: #1677ff;
    background: #e8f2ff;
    font-weight: 600;
}

.admin-tab-item .tab-icon {
    margin-right: 5px;
}

.admin-tab-item .tab-close {
    margin-left: 8px;
    border-radius: 50%;
    font-size: 12px;
}

.admin-tab-item .tab-close:hover {
    color: #fff;
    background: #f53f3f;
}

.admin-tabs-content {
    position: absolute;
    top: 56px;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 14px rgba(15, 23, 42, .06);
    overflow: hidden;
}

.admin-tabs-content iframe {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.admin-tabs-content iframe.active {
    display: block;
}

.admin-tab-contextmenu {
    position: fixed;
    z-index: 1300;
    display: none;
    width: 150px;
    padding: 6px 0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
}

.admin-tab-contextmenu.show {
    display: block;
}

.admin-tab-contextmenu dd {
    display: flex;
    align-items: center;
    height: 34px;
    margin: 0;
    padding: 0 12px;
    color: #4b5563;
    cursor: pointer;
}

.admin-tab-contextmenu dd:hover {
    color: #1677ff;
    background: #f5f8ff;
}

.admin-tab-contextmenu dd i {
    margin-right: 8px;
}

.admin-tab-contextmenu dd.danger {
    color: #f53f3f;
}

.admin-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 220px;
    z-index: 800;
    height: 40px;
    padding: 0 18px;
    color: #7b8496;
    background: #fff;
    line-height: 40px;
    box-shadow: 0 -2px 10px rgba(15, 23, 42, .05);
    transition: left .25s ease;
}

.admin-footer a {
    color: #1677ff;
}

.footer-divider {
    margin: 0 10px;
    color: #d1d5db;
}

.admin-mask {
    display: none;
}

.admin-side-collapsed .admin-header-logo,
.admin-side-collapsed .admin-side {
    width: 64px;
    flex-basis: 64px;
}

.admin-side-collapsed .logo-text-block,
.admin-side-collapsed .admin-nav-node cite,
.admin-side-collapsed .admin-nav-node .nav-arrow {
    display: none;
}

.admin-side-collapsed .logo-mark {
    margin-right: 0;
}

.admin-side-collapsed .admin-header-logo {
    justify-content: center;
    padding: 0;
}

.admin-side-collapsed .admin-nav-node .nav-link {
    justify-content: center;
    padding: 0;
}

.admin-side-collapsed .admin-nav-node .iconfont,
.admin-side-collapsed .admin-nav-node .layui-icon {
    margin-right: 0;
}

.admin-side-collapsed .admin-submenu-wrap {
    display: none !important;
}

.admin-side-collapsed .admin-body,
.admin-side-collapsed .admin-footer {
    left: 64px;
}

@media (max-width: 768px) {
    .layui-layout-admin {
        min-width: 0;
    }

    .admin-header-logo {
        flex-basis: 180px;
        width: 180px;
    }

    .hr-tabs-ops,
    .hr-tools {
        display: none;
    }

    .admin-side {
        transform: translateX(-100%);
    }

    .admin-side-open .admin-side {
        transform: translateX(0);
    }

    .admin-body,
    .admin-footer {
        left: 0;
    }

    .admin-mask {
        position: fixed;
        inset: 64px 0 0;
        z-index: 850;
        background: rgba(15, 23, 42, .45);
    }

    .admin-side-open .admin-mask {
        display: block;
    }
}
