/* ============================================================
 * 企业综合管理系统 · 后台管理端
 * 设计系统：超级动态 UI · 液态玻璃（Liquid Glass）
 * 冷色氛围底 + 缓慢漂浮光斑 + 磨砂玻璃面板 + 单一深蓝强调（#2452E0）
 * 克制、专业、准原生的 Apple 质感；无霓虹、无彩虹渐变堆叠
 * ============================================================ */

:root {
    /* —— 基础 tokens —— */
    --bg: #EEF1F6;
    --surface: #FFFFFF;
    --surface-2: #F7F9FC;
    --line: #E4E7EB;
    --line-strong: #D3D8DE;
    --line-soft: #EEF0F3;
    --ink: #1B1F27;
    --ink-2: #5A6472;
    --ink-3: #98A0AB;
    --accent: #2452E0;
    --accent-2: #7C5CFF;
    --accent-deep: #1E45C4;
    --accent-soft: rgba(36, 82, 224, .08);
    --shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-2: 0 4px 16px rgba(16, 24, 40, .08);
    --shadow-3: 0 18px 44px rgba(16, 24, 40, .14);

    /* —— 兼容层：保留原变量名（指向新体系） —— */
    --glass-bg: rgba(255, 255, 255, .62);
    --glass-bg-strong: rgba(255, 255, 255, .82);
    --glass-border: rgba(255, 255, 255, .62);
    --glass-shadow: var(--shadow-1);
    --glass-shadow-hover: var(--shadow-2);
    --primary: #2452E0;
    --primary-2: #1E45C4;
    --primary-grad: #2452E0;
    --pri: var(--accent);
    --text-main: #1B1F27;
    --text-sub: #5A6472;
    --text-light: #98A0AB;
    --danger: #D92D20;
    --success: #0E9F6E;
    --warning: #B45309;
    --radius: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--ink);
    /* 氛围底：冷色纵向渐变 + 两处极淡光晕（固定，滚动时保持稳定） */
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 620px at 6% -8%, rgba(36, 82, 224, .10), transparent 62%),
        radial-gradient(900px 540px at 102% 4%, rgba(124, 92, 255, .08), transparent 64%),
        linear-gradient(180deg, #F8FAFD 0%, #EDF1F7 58%, #E9EEF6 100%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}

/* 缓慢漂浮的光斑：为玻璃面板提供可折射的背景层次 */
body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(64px);
    pointer-events: none;
}
body::before {
    width: 560px; height: 560px; left: -150px; top: -190px;
    background: radial-gradient(circle at 34% 34%, rgba(36, 82, 224, .30), transparent 70%);
    animation: emsOrbA 30s ease-in-out infinite alternate;
}
body::after {
    width: 620px; height: 620px; right: -190px; bottom: -230px;
    background: radial-gradient(circle at 58% 42%, rgba(124, 92, 255, .24), transparent 70%);
    animation: emsOrbB 36s ease-in-out infinite alternate;
}

/* ---------- 面板卡片（液态玻璃） ---------- */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow:
        var(--shadow-1),
        0 0 0 1px rgba(27, 31, 39, .035),
        inset 0 1px 0 rgba(255, 255, 255, .70);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}
.glass-hover:hover {
    border-color: rgba(255, 255, 255, .88);
    box-shadow:
        var(--shadow-2),
        0 0 0 1px rgba(27, 31, 39, .045),
        inset 0 1px 0 rgba(255, 255, 255, .80);
    transform: translateY(-1px);
}

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 236px;
    margin: 12px 0 12px 12px;
    padding: 16px 10px;
    border-radius: 18px;
    position: sticky;
    top: 12px;
    height: calc(100vh - 24px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: rgba(255, 255, 255, .58);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(27, 31, 39, .14); border-radius: 3px; }

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; }
.brand .logo {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(145deg, #4C79FF 0%, #2452E0 58%, #1E45C4 100%);
    box-shadow: 0 6px 16px rgba(36, 82, 224, .30), inset 0 1px 0 rgba(255, 255, 255, .45);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 17px;
}
.brand .title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.brand .sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.nav { flex: 1; }
.nav-group { margin-bottom: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin: 2px 0;
    border-radius: var(--radius-sm);
    color: var(--ink-2); font-size: 13.5px; cursor: pointer;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
    position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .78); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.nav-item.active {
    background: linear-gradient(180deg, rgba(36, 82, 224, .14), rgba(36, 82, 224, .09));
    color: var(--accent); font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 1px 2px rgba(36, 82, 224, .10);
}
.nav-item.active::after {
    content: ''; position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 16px; border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #4C79FF, #1E45C4);
}
.nav-item .ico { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-parent {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px; margin-top: 6px;
    font-size: 12px; font-weight: 600; color: var(--ink-3);
    letter-spacing: .06em; cursor: pointer; border-radius: var(--radius-sm);
    transition: background-color .18s ease, color .18s ease;
}
.nav-parent:hover { color: var(--ink); background: rgba(255, 255, 255, .70); }
.nav-parent .arrow { transition: transform .22s cubic-bezier(.22, .9, .28, 1); font-size: 10px; }
.nav-group.collapsed .nav-children { display: none; }
.nav-group.collapsed .arrow { transform: rotate(-90deg); }
.nav-children { overflow: hidden; }

/* ---------- 主区域 ---------- */
.main { flex: 1; min-width: 0; padding: 12px 16px 24px 12px; display: flex; flex-direction: column; gap: 12px; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-radius: 16px; gap: 14px;
    position: sticky; top: 12px; z-index: 50;
    background: rgba(255, 255, 255, .70);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--shadow-1), 0 0 0 1px rgba(27, 31, 39, .035), inset 0 1px 0 rgba(255, 255, 255, .75);
}
.page-title { font-size: 16px; font-weight: 700; }
.page-title .crumb { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 8px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(150deg, rgba(36, 82, 224, .16), rgba(124, 92, 255, .14));
    color: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 0 0 1px rgba(36, 82, 224, .12);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
    flex-shrink: 0;
}
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox .uname { font-size: 13px; font-weight: 600; }
.userbox .udept { font-size: 11px; color: var(--ink-3); }

/* ---------- 内容卡片 ---------- */
.card { padding: 18px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.card-hd h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-hd h3::before {
    content: ''; width: 3px; height: 14px; border-radius: 2px;
    background: linear-gradient(180deg, #4C79FF, #1E45C4); display: inline-block;
    box-shadow: 0 0 6px rgba(36, 82, 224, .35);
}
.card-hd .tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat {
    padding: 16px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    animation: emsRise .5s cubic-bezier(.22, .9, .28, 1) backwards;
}
.stat:nth-child(1) { animation-delay: .02s; }
.stat:nth-child(2) { animation-delay: .06s; }
.stat:nth-child(3) { animation-delay: .10s; }
.stat:nth-child(4) { animation-delay: .14s; }
.stat:nth-child(5) { animation-delay: .18s; }
.stat:nth-child(6) { animation-delay: .22s; }
.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2), 0 0 0 1px rgba(27, 31, 39, .045), inset 0 1px 0 rgba(255, 255, 255, .80);
}
.stat .s-label { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.stat .s-value { font-size: 26px; font-weight: 700; margin: 8px 0 2px; letter-spacing: -.02em; }
.stat .s-value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.stat .s-foot { font-size: 11.5px; color: var(--ink-3); }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px; justify-content: center;
    padding: 7px 14px; cursor: pointer; outline: none;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; font-family: inherit;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease;
    color: var(--ink);
    background-color: rgba(255, 255, 255, .82);
    border: 1px solid var(--line-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
    white-space: nowrap;
}
.btn:hover { background-color: #FFFFFF; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), var(--shadow-1); }
.btn:active { background-color: var(--line-soft); transform: translateY(1px) scale(.99); }
.btn-primary {
    background-color: var(--accent); color: #fff; border-color: var(--accent);
    background-image: linear-gradient(145deg, #4C79FF 0%, #2452E0 58%, #1E45C4 100%);
    box-shadow: 0 4px 14px rgba(36, 82, 224, .30), inset 0 1px 0 rgba(255, 255, 255, .30);
}
.btn-primary:hover {
    background-color: var(--accent-deep);
    background-image: linear-gradient(145deg, #5A84FF 0%, #2A5AEE 58%, #1F49CE 100%);
    border-color: var(--accent-deep);
    box-shadow: 0 8px 22px rgba(36, 82, 224, .34), inset 0 1px 0 rgba(255, 255, 255, .34);
}
.btn-primary:active {
    background-color: #1A3DC0;
    background-image: linear-gradient(145deg, #3F6BF0 0%, #1E45C4 100%);
    box-shadow: 0 2px 8px rgba(36, 82, 224, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
    transform: translateY(1px) scale(.99);
}
.btn-danger {
    background-color: var(--danger); color: #fff; border-color: var(--danger);
    background-image: linear-gradient(145deg, #F0574A 0%, #D92D20 62%, #B42318 100%);
    box-shadow: 0 4px 14px rgba(217, 45, 32, .26), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-danger:hover {
    background-color: #B42318; border-color: #B42318;
    background-image: linear-gradient(145deg, #F26355 0%, #C4281C 100%);
    box-shadow: 0 8px 22px rgba(217, 45, 32, .30), inset 0 1px 0 rgba(255, 255, 255, .30);
}
.btn-success {
    background-color: var(--success); color: #fff; border-color: var(--success);
    background-image: linear-gradient(145deg, #2BBE8B 0%, #0E9F6E 62%, #0B8A5E 100%);
    box-shadow: 0 4px 14px rgba(14, 159, 110, .24), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-success:hover {
    background-color: #0B8A5E; border-color: #0B8A5E;
    background-image: linear-gradient(145deg, #33C795 0%, #0C8B60 100%);
    box-shadow: 0 8px 22px rgba(14, 159, 110, .28), inset 0 1px 0 rgba(255, 255, 255, .30);
}
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.btn-ghost {
    background-color: rgba(255, 255, 255, .55);
    border-color: rgba(36, 82, 224, .32); color: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.btn-ghost:hover {
    background-color: var(--accent-soft); border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(36, 82, 224, .12), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.field label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
    width: 100%; padding: 8px 12px; font-size: 13.5px; font-family: inherit;
    color: var(--ink);
    background-color: rgba(255, 255, 255, .78);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 2px rgba(16, 24, 40, .03);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
    -webkit-appearance: none;
    appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
    background-color: #FFFFFF;
    border-color: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 0 0 4px var(--accent-soft);
}
.textarea { min-height: 84px; resize: vertical; }
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6472' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 34px;
}

/* ---------- 自定义下拉框（.seldd） ----------
 * 原生 <select> 的候选层由浏览器/系统单独绘制，在带 backdrop-filter 的毛玻璃弹窗
 * 内可能被合成层遮挡而不弹出；该组件用纯 DOM 实现外观一致的下拉，点击必定展开。
 * 选中值写入容器内 <input type="hidden" data-key="...">，取值方式同原生 select。 */
.seldd { position: relative; }
.seldd-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; padding: 8px 12px; text-align: left; font-size: 13.5px; font-family: inherit;
    color: var(--ink);
    background-color: rgba(255, 255, 255, .78);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 2px rgba(16, 24, 40, .03);
    cursor: pointer; outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.seldd-btn:hover { background-color: rgba(255, 255, 255, .92); }
.seldd.open .seldd-btn,
.seldd-btn:focus {
    background-color: #FFFFFF; border-color: var(--accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 0 0 4px var(--accent-soft);
}
.seldd-txt { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seldd-txt.ph { color: var(--ink-3); }
.seldd-arrow {
    flex: none; width: 9px; height: 9px; margin-right: 3px;
    border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
    transform: translateY(-2px) rotate(45deg);
    transition: transform .18s ease;
}
.seldd.open .seldd-arrow { transform: translateY(2px) rotate(225deg); }
.seldd-pop {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
    display: none; max-height: 216px; overflow-y: auto; padding: 4px;
    background: #FFFFFF; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-3);
}
.seldd.open .seldd-pop { display: block; }
.seldd.up .seldd-pop { top: auto; bottom: calc(100% + 6px); }
.seldd-opt {
    padding: 7px 10px; font-size: 13.5px; color: var(--ink); border-radius: 7px; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seldd-opt:hover { background: var(--accent-soft); }
.seldd-opt.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tbl thead th {
    text-align: left; padding: 10px 14px;
    font-size: 12px; font-weight: 700; color: var(--ink-2);
    background: rgba(255, 255, 255, .55);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    backdrop-filter: blur(8px);
}
table.tbl thead th:first-child { border-radius: 8px 0 0 0; }
table.tbl thead th:last-child { border-radius: 0 8px 0 0; }
table.tbl tbody td {
    padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
table.tbl tbody tr { transition: background-color .18s ease; }
table.tbl tbody tr:hover { background: rgba(36, 82, 224, .045); }
table.tbl tbody tr:last-child td { border-bottom: none; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 标签 ---------- */
.tag {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; line-height: 1.6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}
.tag-blue { background: rgba(36, 82, 224, .08); color: #2452E0; }
.tag-green { background: rgba(14, 159, 110, .10); color: #0E9F6E; }
.tag-red { background: rgba(217, 45, 32, .08); color: #D92D20; }
.tag-orange { background: rgba(180, 83, 9, .10); color: #B45309; }
.tag-gray { background: rgba(27, 31, 39, .05); color: #5A6472; }
.tag-purple { background: rgba(105, 65, 198, .08); color: #6941C6; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager .pinfo { font-size: 12px; color: var(--ink-3); margin-right: auto; }
.pager button {
    min-width: 32px; height: 32px; border-radius: 10px;
    border: 1px solid var(--line);
    background-color: rgba(255, 255, 255, .78);
    cursor: pointer; font-size: 12.5px; color: var(--ink-2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
    transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}
.pager button:hover {
    color: var(--accent); border-color: var(--accent);
    background-color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(36, 82, 224, .14), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.pager button:active { transform: translateY(1px) scale(.98); }
.pager button.on {
    background-color: var(--accent); color: #fff; border-color: var(--accent);
    background-image: linear-gradient(145deg, #4C79FF 0%, #2452E0 60%, #1E45C4 100%);
    box-shadow: 0 4px 14px rgba(36, 82, 224, .30), inset 0 1px 0 rgba(255, 255, 255, .30);
}

/* ---------- 弹窗 ---------- */
.mask {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(17, 24, 39, .38);
    -webkit-backdrop-filter: blur(6px) saturate(140%);
    backdrop-filter: blur(6px) saturate(140%);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.mask.show { opacity: 1; pointer-events: auto; }
.modal {
    width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
    padding: 20px; border-radius: 20px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(255, 255, 255, .70);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    box-shadow: var(--shadow-3), 0 0 0 1px rgba(27, 31, 39, .04), inset 0 1px 0 rgba(255, 255, 255, .80);
    opacity: 0;
    transform: translateY(14px) scale(.97);
    transition: transform .3s cubic-bezier(.22, 1.04, .36, 1), opacity .2s ease;
}
.modal.wide { max-width: 1120px; }
.mask.show .modal { opacity: 1; transform: translateY(0) scale(1); }
.modal-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-hd h3 { font-size: 16px; font-weight: 700; }
.modal-close { cursor: pointer; font-size: 20px; color: var(--ink-3); line-height: 1; padding: 4px; transition: color .15s, background-color .15s; background: none; border: none; border-radius: 8px; }
.modal-close:hover { color: var(--ink); background: rgba(27, 31, 39, .05); }
.modal-ft { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- 提示 ---------- */
#toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none;
}
.toast-item {
    padding: 9px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
    background: rgba(22, 27, 37, .80); color: #fff;
    border: 1px solid rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 14px 34px rgba(16, 24, 40, .28), inset 0 1px 0 rgba(255, 255, 255, .16);
    animation: toastIn .28s cubic-bezier(.22, 1.1, .36, 1);
    display: flex; align-items: center; gap: 8px;
}
.toast-item.ok { color: #8FE3BA; }
.toast-item.err { color: #FFB0A6; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; }
.login-wrap::before,
.login-wrap::after {
    content: ''; position: fixed; z-index: 0; border-radius: 50%;
    filter: blur(72px); pointer-events: none;
}
.login-wrap::before {
    width: 620px; height: 620px; left: 50%; top: -280px; margin-left: -310px;
    background: radial-gradient(circle at 50% 55%, rgba(36, 82, 224, .26), transparent 70%);
    animation: emsOrbA 28s ease-in-out infinite alternate;
}
.login-wrap::after {
    width: 540px; height: 540px; right: -140px; bottom: -200px;
    background: radial-gradient(circle at 45% 45%, rgba(124, 92, 255, .24), transparent 70%);
    animation: emsOrbB 34s ease-in-out infinite alternate;
}
.login-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 420px; padding: 36px 32px; border-radius: 24px;
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    box-shadow: var(--shadow-3), 0 0 0 1px rgba(27, 31, 39, .04), inset 0 1px 0 rgba(255, 255, 255, .82);
    animation: emsRise .6s cubic-bezier(.22, .9, .28, 1) backwards;
}
.login-card .brand-lg { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-card .brand-lg .logo {
    width: 64px; height: 64px; border-radius: 20px; font-size: 26px;
    background: linear-gradient(145deg, #5A84FF 0%, #2452E0 58%, #1E45C4 100%);
    color: #fff;
    box-shadow: 0 12px 30px rgba(36, 82, 224, .34), inset 0 1px 0 rgba(255, 255, 255, .45);
    display: flex; align-items: center; justify-content: center; font-weight: 700;
    animation: emsFloat 6s ease-in-out infinite;
}
.login-card h1 { font-size: 20px; font-weight: 700; text-align: center; }
.login-card .sub { font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* ---------- 进度 ---------- */
.bar { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .05); }
.bar > i {
    display: block; height: 100%; border-radius: 3px;
    background-image: linear-gradient(90deg, #4C79FF, #2452E0);
    box-shadow: 0 0 8px rgba(36, 82, 224, .35);
    transition: width .45s cubic-bezier(.22, .9, .28, 1);
}

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); font-size: 13px; }
.empty .ico { font-size: 40px; display: block; margin-bottom: 10px; opacity: .5; }

/* ---------- 工具类 ---------- */
.flex { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.mb8 { margin-bottom: 8px; }
.muted { color: var(--ink-3); font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.loading { text-align: center; padding: 30px; color: var(--ink-3); font-size: 13px; }
.hide { display: none !important; }

/* ---------- 动效 ---------- */
@keyframes emsRise {
    from { opacity: 0; transform: translateY(10px) scale(.995); }
    to { opacity: 1; transform: none; }
}
@keyframes emsFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
@keyframes emsOrbA {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(90px, 70px, 0) scale(1.12); }
}
@keyframes emsOrbB {
    from { transform: translate3d(0, 0, 0) scale(1.06); }
    to { transform: translate3d(-110px, -80px, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    body::before, body::after,
    .login-wrap::before, .login-wrap::after,
    .login-card, .login-card .brand-lg .logo, .stat, .toast-item {
        animation: none !important;
    }
}

@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { width: auto; height: auto; position: static; margin: 10px 10px 0; }
    .main { padding: 10px; }
    .grid2, .grid3, .grid4, .form-grid { grid-template-columns: 1fr; }
    .topbar { position: static; }
}


/* ---------------- 勾选组（权限选择等） ---------------- */
.checks { border: 1px solid rgba(148,163,184,.28); border-radius: 10px; padding: 8px 10px; max-height: 340px; overflow: auto; background: rgba(255,255,255,.55); }
.chk-group { margin: 6px 0 2px; }
.chk-group-hd { display: block; padding: 4px 2px; font-size: 13px; cursor: pointer; border-bottom: 1px dashed rgba(148,163,184,.35); }
.chk-group-hd .muted { font-size: 12px; margin-left: 6px; }
.chk-items { padding: 6px 0 4px 18px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; min-width: 132px; }
.chk input { width: 15px; height: 15px; }
.chk-bar { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 13px; }
.chk-bar a { color: #2452E0; text-decoration: none; }
.chk-bar a:hover { text-decoration: underline; }
