/* ============================================================
 * 企业综合管理系统 · 后台管理端
 * 设计系统：超级动态 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;
    overflow: hidden;
}
.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); }

/* ---------- 顶栏左侧（汉堡按钮 + 页面标题） ---------- */
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left .page-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 移动端抽屉侧边栏：汉堡按钮 / 遮罩 ---------- */
.hamburger {
    display: none;
    width: 34px; height: 34px; padding: 0;
    align-items: center; justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, .82);
    color: var(--ink);
    font-size: 16px; line-height: 1; cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
    flex-shrink: 0;
    transition: background-color .16s ease, transform .12s ease;
}
.hamburger:active { background: var(--line-soft); transform: translateY(1px) scale(.99); }
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 80;
    background: rgba(17, 24, 39, .38);
    -webkit-backdrop-filter: blur(4px) saturate(140%);
    backdrop-filter: blur(4px) saturate(140%);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

/* ---------- 内容卡片 ---------- */
.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; min-width: 0; }
.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.row-click { cursor: pointer; }
/* 分组标题行（列表配置 groupBy 时，按字段把同值行聚拢） */
table.tbl tbody tr.tbl-group { background: transparent; }
table.tbl tbody tr.tbl-group:hover { background: transparent; }
table.tbl tbody tr.tbl-group > td {
    padding: 8px 14px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 12px; font-weight: 700;
    border-bottom: 1px solid var(--line);
}
table.tbl tbody tr.tbl-group .gcount { margin-left: 8px; font-weight: 400; color: var(--ink-3); }
/* 点整行展开的申请人名单（可就地通过/驳回） */
table.tbl tbody tr.sub-row { cursor: default; }
table.tbl tbody tr.sub-row:hover { background: transparent; }
table.tbl tbody tr.sub-row > td {
    padding: 0;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--line);
}
.sub-row .sub-wrap { padding: 12px 16px 14px 30px; }
.sub-row .sub-hd {
    font-size: 13px; font-weight: 600; color: var(--ink-2);
    margin-bottom: 8px;
}
.sub-row .apply-line {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 12px; margin-bottom: 8px;
    background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.sub-row .apply-line:last-child { margin-bottom: 0; }
.sub-row .apply-info {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    min-width: 0; font-size: 13px; color: var(--ink-3);
}
.sub-row .apply-info b { color: var(--ink); }
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; }
/* 栅格子项默认 min-width:auto，内部一旦出现不可折行的长文本（如文件名全路径），
   列会被撑得比弹窗还宽 → 右列被裁掉并出现横向滚动条。显式归零，让内容自行折行/省略。 */
.form-grid > * { min-width: 0; }
/* 文件域下方回显的已选文件（全路径，无空格可断，必须允许任意位置折行） */
.file-val { overflow-wrap: anywhere; word-break: break-all; }
/* 预览弹层（EMS.previewModal）里的独立整页：预览页自带排版样式，这里只给容器定尺寸 */
.preview-frame { display: block; width: 100%; height: 70vh; border: 0; border-radius: 12px; background: #fff; }
/* 图片灯箱：缩略图点击看大图（可叠加在详情 / 预览弹层之上） */
.img-lb { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 94vw; }
.img-lb img { display: block; max-width: 94vw; max-height: 82vh; border-radius: 12px; background: #fff; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.img-lb-bar { display: flex; gap: 10px; }

/* ---------- 提示 ---------- */
#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;
    overflow: hidden;
}
.brand .logo img, .login-card .brand-lg .logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.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) {
    /* 侧边栏改为抽屉：默认移出屏外，点汉堡滑入 */
    .hamburger { display: inline-flex; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        width: 268px; height: 100vh; margin: 0;
        border-radius: 0 18px 18px 0;
        transform: translateX(-105%);
        transition: transform .28s cubic-bezier(.22, .9, .28, 1);
        z-index: 90;
        box-shadow: var(--shadow-3);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop { display: block; }
    .main { padding: 10px; }
    .topbar { position: sticky; gap: 10px; }
    .grid2, .grid3, .grid4, .form-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    /* 弹窗 / 卡片 / 表格移动端响应式 */
    .mask { padding: 12px; }
    .modal { max-width: 100%; border-radius: 16px; }
    .card { padding: 14px; }
    .topbar-right .btn-sm { padding: 4px 8px; }
}


/* ---------------- 勾选组（权限选择等） ---------------- */
.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; }

/* ---------------- 聊天记录（im_manage 列表 + 会话弹窗） ---------------- */
/* 列表「最后一条」摘要：单行省略 */
.imlog-pv {
    display: inline-block; max-width: 380px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    vertical-align: bottom;
}
/* 弹窗标题栏：会话信息 + 左右双方说明 */
.imlog-chat-hd {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
    margin-bottom: 10px;
}
/* 会话列表 ⇄ 对话记录 的返回链接 */
.imlog-back { color: var(--accent); text-decoration: none; white-space: nowrap; }
.imlog-back:hover { text-decoration: underline; }
/* 对话区：左 = 对话对象/群成员，右 = 发起人 */
.imlog-msgs {
    max-height: 460px; overflow-y: auto;
    padding: 14px 14px 6px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
    background: rgba(148, 163, 184, .07);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.imlog-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 76%; }
.imlog-msg.mine { align-self: flex-end; align-items: flex-end; }
.imlog-who { font-size: 11px; color: var(--ink-3); margin-bottom: 2px; padding: 0 4px; }
.imlog-bubble {
    max-width: 100%; padding: 7px 11px;
    border-radius: 12px 12px 12px 4px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .06);
    font-size: 13px; line-height: 1.65; color: var(--ink);
    white-space: pre-wrap; word-break: break-word;
}
.imlog-msg.mine .imlog-bubble {
    border-radius: 12px 12px 4px 12px;
    background: rgba(36, 82, 224, .10);
    color: var(--ink);
}
.imlog-msg.mine .imlog-meta { justify-content: flex-end; }
.imlog-msg.del .imlog-bubble { opacity: .55; text-decoration: line-through; }
.imlog-msg.del img { opacity: .55; filter: grayscale(.35); }
.imlog-img {
    width: 104px; height: 104px; object-fit: cover; display: block;
    border-radius: 8px; cursor: zoom-in;
    background: rgba(148, 163, 184, .12);
    border: 1px solid var(--line);
}
#ems-modal-body .imlog-img { width: 140px; height: 140px; }
.imlog-bubble a { color: var(--accent); word-break: break-all; text-decoration: none; }
.imlog-bubble a:hover { text-decoration: underline; }
.imlog-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    margin-top: 2px; font-size: 10.5px; color: var(--ink-3); line-height: 1.5;
}
.imlog-meta a { color: var(--accent); text-decoration: none; }
.imlog-meta a:hover { text-decoration: underline; }
/* 文件消息卡片（不是链接文字） */
.imlog-file {
    display: inline-flex; align-items: center; gap: 10px;
    max-width: 100%; padding: 9px 12px; box-sizing: border-box;
    border-radius: 10px; background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(17, 24, 39, .06);
    color: var(--ink); text-decoration: none;
    transition: border-color .16s, box-shadow .16s;
}
a.imlog-file:hover {
    border-color: rgba(36, 82, 224, .45);
    box-shadow: 0 2px 8px rgba(36, 82, 224, .16);
    text-decoration: none;
}
.imlog-file-ico {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4f7cf5, #2452e0);
    color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .4px;
}
.imlog-file-main { display: flex; flex-direction: column; min-width: 0; }
.imlog-file-name {
    font-size: 13px; line-height: 1.45; color: var(--ink);
    max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imlog-file-sub { font-size: 10.5px; color: var(--ink-3); line-height: 1.5; }
.imlog-msg.mine .imlog-file {
    background: rgba(36, 82, 224, .10);
    border-color: rgba(36, 82, 224, .18);
}
.imlog-msg.del .imlog-file { opacity: .55; }
/* 列表「会话」列：多会话合并后单行省略 */
.imlog-conv-cell {
    display: inline-block; max-width: 140px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    vertical-align: bottom;
}
/* 弹窗内多会话分隔标题 */
.imlog-conv-hd {
    width: 100%; display: flex; align-items: center; gap: 8px;
    margin: 2px 0; font-size: 10.5px; color: var(--ink-3);
}
.imlog-conv-hd::before,
.imlog-conv-hd::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.imlog-conv-hd span { white-space: nowrap; padding: 0 2px; }

/* ============================================================
 * HR 数字助手（悬浮球 + 玻璃拟态抽屉）
 * 层级低于弹窗（#ems-mask z-index:1000）
 * ============================================================ */
.asst-ball {
    position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 900;
    width: 62px; height: 62px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; cursor: grab; touch-action: none;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: opacity .32s ease, transform .32s cubic-bezier(.22, 1, .36, 1);
}
.asst-ball.dragging { cursor: grabbing; }
.asst-ball .asst-halo {
    position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
    background: conic-gradient(from 0deg,
        rgba(90, 162, 255, 0), rgba(90, 162, 255, .55), rgba(0, 184, 169, .42),
        rgba(134, 110, 255, .5), rgba(90, 162, 255, 0));
    filter: blur(7px); opacity: .7;
    animation: asst-spin 7s linear infinite;
}
.asst-ball .asst-core {
    position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 58%),
        linear-gradient(150deg, #74b2ff 0%, #2b6bff 52%, #1244c9 100%);
    box-shadow:
        0 16px 32px -10px rgba(28, 80, 220, .62),
        0 6px 12px rgba(16, 24, 40, .12),
        inset 0 1px 1px rgba(255, 255, 255, .62),
        inset 0 -8px 16px rgba(10, 40, 140, .28);
    transition: transform .24s cubic-bezier(.22, 1, .36, 1), box-shadow .24s ease;
}
.asst-ball .asst-core::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%; opacity: 0;
    background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .6) 48%, transparent 62%);
    transform: translateX(-130%);
}
.asst-ball:hover .asst-core {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 20px 40px -12px rgba(28, 80, 220, .72),
        0 8px 16px rgba(16, 24, 40, .14),
        inset 0 1px 1px rgba(255, 255, 255, .7);
}
.asst-ball:hover .asst-core::after { animation: asst-sheen .85s cubic-bezier(.3, .7, .3, 1); }
.asst-ball:active .asst-core { transform: scale(.95); }
.asst-ball:focus-visible { outline: none; }
.asst-ball:focus-visible .asst-core {
    box-shadow: 0 0 0 3px rgba(43, 107, 255, .34), 0 16px 32px -10px rgba(28, 80, 220, .62);
}
.asst-ball svg { display: block; filter: drop-shadow(0 1px 2px rgba(16, 40, 100, .2)); }
.asst-ball.idle { opacity: .55; transform: scale(.92); }
.asst-ball.idle:hover { opacity: 1; transform: none; }
.asst-ball.active { opacity: 0; transform: scale(.7); pointer-events: none; }

/* 悬浮提示 */
.asst-tip {
    position: absolute; right: calc(100% + 12px); top: 50%;
    padding: 6px 10px; border-radius: 8px; white-space: nowrap;
    background: rgba(17, 26, 45, .88); color: #fff;
    font-size: 11.5px; line-height: 1; pointer-events: none;
    opacity: 0; transform: translate(6px, -50%);
    box-shadow: 0 8px 20px -8px rgba(15, 32, 80, .6);
    transition: opacity .18s ease, transform .18s ease;
}
.asst-tip::after {
    content: ''; position: absolute; right: -3px; top: 50%; width: 8px; height: 8px;
    border-radius: 1px; background: inherit; transform: translateY(-50%) rotate(45deg);
}
.asst-ball:hover .asst-tip,
.asst-ball:focus-visible .asst-tip { opacity: 1; transform: translate(0, -50%); }

/* 红点角标 */
.asst-dot {
    position: absolute; top: 2px; right: 2px; z-index: 2;
    width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff;
    background: linear-gradient(160deg, #ff8085, #ef2f3c);
    box-shadow: 0 2px 8px rgba(240, 72, 100, .55);
    opacity: 0; transform: scale(.3); pointer-events: none;
    transition: opacity .22s ease, transform .22s cubic-bezier(.2, .9, .3, 1.4);
}
.asst-dot.on { opacity: 1; transform: none; pointer-events: auto; cursor: pointer; }
.asst-dot.on::after {
    content: ''; position: absolute; inset: -3px; border-radius: 50%;
    border: 1.5px solid rgba(240, 72, 100, .55);
    animation: asst-ping 2.2s cubic-bezier(.2, .6, .3, 1) infinite;
}

/* 抽屉面板 */
.asst-panel {
    position: fixed; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 900;
    width: min(440px, calc(100vw - 28px));
    height: min(660px, calc(100vh - 44px));
    height: min(660px, calc(100dvh - 44px));
    display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .7) 55%, rgba(243, 248, 255, .8));
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .72);
    box-shadow:
        0 40px 80px -24px rgba(15, 32, 80, .42),
        0 10px 26px rgba(15, 32, 80, .1),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(20px) scale(.94);
    transform-origin: calc(100% - 40px) 100%;
    transition: opacity .26s ease, transform .44s cubic-bezier(.2, .9, .3, 1.06), visibility .3s;
}
.asst-panel.show { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }

/* 面板内部氛围光 */
.asst-aurora { position: absolute; inset: -30%; z-index: -1; pointer-events: none; filter: blur(42px); opacity: .55; }
.asst-aurora i { position: absolute; display: block; border-radius: 50%; }
.asst-aurora i:nth-child(1) {
    width: 62%; padding-bottom: 62%; left: -8%; top: -12%;
    background: radial-gradient(circle, #8dbcff, transparent 68%);
    animation: asst-float1 17s ease-in-out infinite;
}
.asst-aurora i:nth-child(2) {
    width: 54%; padding-bottom: 54%; right: -10%; top: 18%;
    background: radial-gradient(circle, #9ef0e2, transparent 68%);
    animation: asst-float2 21s ease-in-out infinite;
}
.asst-aurora i:nth-child(3) {
    width: 58%; padding-bottom: 58%; left: 12%; bottom: -14%;
    background: radial-gradient(circle, #c7b6ff, transparent 68%);
    animation: asst-float3 19s ease-in-out infinite;
}
/* 面板关闭时暂停氛围光与光环，避免空转耗电；闲置时暂停悬浮球光环 */
.asst-panel:not(.show) .asst-aurora i { animation-play-state: paused; }
.asst-ball.idle .asst-halo { animation-play-state: paused; }

/* 标题栏 */
.asst-hd {
    position: relative; z-index: 1; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 13px 10px 13px 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .68), rgba(255, 255, 255, .16));
    border-bottom: 1px solid rgba(255, 255, 255, .62);
    box-shadow: 0 1px 0 rgba(15, 32, 80, .04);
}
.asst-logo {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #5b9dff, #2b6bff 58%, #1546c9);
    box-shadow: 0 6px 14px -6px rgba(43, 107, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.asst-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-left: 2px; }
.asst-title { font-size: 13.5px; font-weight: 650; color: #14203a; line-height: 1.25; white-space: nowrap; letter-spacing: .2px; }
.asst-sub { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: #7d8aa0; line-height: 1.2; white-space: nowrap; }
.asst-live {
    width: 6px; height: 6px; border-radius: 50%; background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
    animation: asst-live 2.4s ease-out infinite;
}
.asst-hd-act { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
.asst-hd-line { width: 1px; height: 16px; margin: 0 3px; background: rgba(20, 32, 58, .12); }
.asst-ibtn {
    width: 28px; height: 28px; padding: 0; border: 0; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; color: #64748b; cursor: pointer;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.asst-ibtn:hover { background: rgba(43, 107, 255, .1); color: #2b6bff; }
.asst-ibtn:active { transform: scale(.92); }
.asst-ibtn.on { background: rgba(43, 107, 255, .14); color: #2b6bff; }
.asst-ibtn.busy { animation: asst-breathe 1s ease-in-out infinite; }
.asst-close:hover { background: rgba(240, 72, 100, .12); color: #f04864; }

/* 弹层：会话历史 / 设置 */
.asst-pop {
    position: absolute; top: 62px; right: 12px; z-index: 6;
    width: 244px; padding: 8px; border-radius: 16px;
    background: rgba(255, 255, 255, .93);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .95);
    box-shadow: 0 22px 48px -16px rgba(15, 32, 80, .38), 0 2px 8px rgba(15, 32, 80, .06);
    transform-origin: top right;
    animation: asst-pop-in .22s cubic-bezier(.2, .9, .3, 1.05);
}
.asst-pop[hidden] { display: none; }
.asst-pop-hd { padding: 4px 8px 8px; font-size: 11px; font-weight: 600; color: #8b97ab; letter-spacing: .4px; }
.asst-hist-list { max-height: 246px; overflow-y: auto; overscroll-behavior: contain; }
.asst-hist-item {
    width: 100%; display: flex; align-items: center; gap: 8px;
    padding: 8px; border: 0; border-radius: 10px; background: transparent;
    font: inherit; font-size: 12.5px; color: #24304a; text-align: left; cursor: pointer;
    transition: background .14s ease;
}
.asst-hist-item:hover { background: rgba(43, 107, 255, .09); }
.asst-hist-num {
    flex: 0 0 auto; width: 18px; height: 18px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600; color: #2b6bff; background: rgba(43, 107, 255, .12);
}
.asst-hist-q { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-pop-empty { padding: 18px 8px; text-align: center; font-size: 12px; color: #98a2b3; }
.asst-set-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 9px 8px; border-radius: 10px; font-size: 12.5px; color: #24304a; cursor: pointer;
}
.asst-set-row:hover { background: rgba(43, 107, 255, .07); }
.asst-sw {
    appearance: none; -webkit-appearance: none; flex: 0 0 auto;
    width: 34px; height: 20px; margin: 0; border-radius: 999px; outline: none;
    background: rgba(120, 135, 160, .3); position: relative; cursor: pointer;
    transition: background .2s ease;
}
.asst-sw::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .32);
    transition: transform .22s cubic-bezier(.2, .9, .3, 1.15);
}
.asst-sw:checked { background: linear-gradient(135deg, #4d90ff, #2b6bff); }
.asst-sw:checked::after { transform: translateX(14px); }
.asst-set-clear {
    width: 100%; margin-top: 4px; padding: 8px; border: 0; border-radius: 10px;
    background: rgba(240, 72, 100, .09); color: #e0304a;
    font: inherit; font-size: 12.5px; cursor: pointer;
    transition: background .16s ease;
}
.asst-set-clear:hover { background: rgba(240, 72, 100, .16); }
.asst-set-note { margin: 8px 8px 2px; font-size: 10.5px; line-height: 1.5; color: #98a2b3; }

/* 对话区 */
.asst-body {
    position: relative; z-index: 1;
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 16px 14px 4px; display: flex; flex-direction: column; gap: 14px;
}
.asst-body::-webkit-scrollbar { width: 6px; }
.asst-body::-webkit-scrollbar-track { background: transparent; }
.asst-body::-webkit-scrollbar-thumb { background: rgba(120, 135, 160, .3); border-radius: 3px; }
.asst-body::-webkit-scrollbar-thumb:hover { background: rgba(120, 135, 160, .5); }
.asst-msg {
    display: flex; flex-direction: column; align-items: flex-start; max-width: 100%;
    animation: asst-msg-in .4s cubic-bezier(.2, .9, .3, 1.04) both;
}
.asst-msg.user { align-items: flex-end; }
.asst-msg.asst-flash .asst-bubble { animation: asst-flash .9s ease-out; }
.asst-bubble {
    max-width: 90%; padding: 9px 13px; border-radius: 14px;
    font-size: 13px; line-height: 1.7; color: #1c2740;
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .92);
    box-shadow: 0 8px 20px -14px rgba(15, 32, 80, .5);
    white-space: pre-wrap; word-break: break-word;
}
.asst-bubble strong { font-weight: 650; color: #101a30; }
.asst-msg.user .asst-bubble {
    background: linear-gradient(135deg, #4d90ff, #2b6bff 58%, #1e5ff0);
    border-color: rgba(255, 255, 255, .34); color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 10px 22px -12px rgba(43, 107, 255, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.asst-msg.user .asst-bubble strong { color: #fff; }
.asst-msg.bot .asst-bubble { border-bottom-left-radius: 5px; }
/* 已提交图片的缩略图 */
.asst-msg-imgs {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; max-width: 90%;
    animation: asst-msg-in .3s cubic-bezier(.2, .9, .3, 1.04) both;
}
.asst-msg-imgs img {
    width: 64px; height: 64px; object-fit: cover; display: block; border-radius: 10px;
    background: rgba(255, 255, 255, .8);
    box-shadow: 0 6px 16px -10px rgba(15, 32, 80, .8), 0 0 0 1px rgba(255, 255, 255, .9);
}
/* 多行回答逐行渐入 */
.asst-seg { display: block; animation: asst-seg-in .42s cubic-bezier(.2, .9, .3, 1.04) both; }

.asst-typing .asst-bubble { color: #6b7684; }
.asst-dots { display: inline-flex; gap: 3px; margin-right: 5px; vertical-align: middle; }
.asst-dots i {
    width: 4px; height: 4px; border-radius: 50%; background: #7d8aa0;
    animation: asst-blink 1.2s infinite ease-in-out;
}
.asst-dots i:nth-child(2) { animation-delay: .18s; }
.asst-dots i:nth-child(3) { animation-delay: .36s; }

/* 结果卡片（表格 / 图表） */
.asst-card {
    width: 100%; margin-top: 8px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .95); border-radius: 13px;
    background: rgba(255, 255, 255, .8);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 26px -18px rgba(15, 32, 80, .65);
    animation: asst-msg-in .45s cubic-bezier(.2, .9, .3, 1.04) both;
}
.asst-card-hd {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px; font-size: 12px; font-weight: 600; color: #1c2740;
    background: rgba(255, 255, 255, .5);
    border-bottom: 1px solid rgba(20, 32, 58, .06);
}
.asst-card-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-dlgrp { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; }
.asst-dlgrp .asst-dl { padding: 0 7px; }
.asst-dl {
    flex: 0 0 auto; height: 22px; padding: 0 9px; border-radius: 7px;
    border: 1px solid rgba(43, 107, 255, .22); background: rgba(255, 255, 255, .7);
    color: #2b6bff; font-size: 11px; line-height: 1; cursor: pointer;
    transition: background .16s ease, box-shadow .16s ease;
}
.asst-dl:hover { background: #fff; box-shadow: 0 2px 8px -2px rgba(43, 107, 255, .5); }
.asst-dl:disabled { opacity: .6; cursor: default; }
.asst-card-empty { padding: 14px 10px; font-size: 12px; color: #98a2b3; text-align: center; }
.asst-table-wrap { overflow-x: auto; }
.asst-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.asst-table th,
.asst-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid rgba(20, 32, 58, .06); }
.asst-table th { color: #6b7684; font-weight: 600; background: rgba(246, 249, 255, .8); }
.asst-table tbody tr:last-child td { border-bottom: 0; }
.asst-table tbody tr:hover td { background: rgba(43, 107, 255, .06); }
.asst-chart-body { padding: 6px 8px 8px; background: rgba(255, 255, 255, .92); }
.asst-chart-body svg { display: block; width: 100%; height: auto; }
/* 结果跳转链接 */
.asst-links {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
    animation: asst-msg-in .45s cubic-bezier(.2, .9, .3, 1.04) both;
}
.asst-link {
    display: inline-flex; align-items: center; gap: 4px;
    height: 24px; padding: 0 10px; border-radius: 8px;
    font-size: 11.5px; line-height: 1; text-decoration: none; white-space: nowrap;
    color: #2b6bff; background: rgba(255, 255, 255, .8);
    border: 1px solid rgba(43, 107, 255, .26);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.asst-link:hover {
    background: #fff; transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(43, 107, 255, .55);
}
.asst-link:active { transform: none; }
.asst-link::after { content: '›'; font-size: 13px; line-height: 1; opacity: .75; }

/* 组合看板（趋势 + 环形占比） */
.asst-combo {
    background: linear-gradient(168deg, rgba(255, 255, 255, .96), rgba(244, 249, 255, .88));
    border-color: rgba(255, 255, 255, .98);
}
.asst-combo .asst-card-hd { background: transparent; }
.asst-combo .asst-card-title { flex: 1 1 auto; }
.asst-combo .asst-dlgrp { margin-left: auto; flex: 0 0 auto; }
.asst-combo-sub {
    flex: 0 0 auto; margin-left: 7px; padding: 1px 7px; border-radius: 999px;
    font-size: 10px; font-weight: 500; line-height: 16px; white-space: nowrap;
    color: #3f6aa8;
    background: linear-gradient(135deg, rgba(43, 107, 255, .13), rgba(0, 184, 169, .13));
    border: 1px solid rgba(43, 107, 255, .1);
}
.asst-combo-kpis {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
    padding: 8px 10px 2px;
}
.asst-kpi {
    position: relative; overflow: hidden; min-width: 0;
    padding: 6px 8px 7px; border-radius: 10px;
    background: linear-gradient(150deg, #ffffff, #f3f8ff);
    border: 1px solid rgba(43, 107, 255, .1);
    box-shadow: 0 5px 12px -10px rgba(23, 50, 110, .55);
}
.asst-kpi::after {
    content: ''; position: absolute; right: -12px; top: -14px; width: 38px; height: 38px;
    border-radius: 50%; background: radial-gradient(circle, rgba(43, 107, 255, .18), transparent 70%);
    pointer-events: none;
}
.asst-kpi-k {
    display: block; font-size: 9.5px; color: #8b97ab;
    letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asst-kpi-v {
    display: inline-block; margin-top: 2px; font-size: 15px; line-height: 1.15;
    font-weight: 700; color: #1c2a44; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
    vertical-align: bottom;
}
.asst-kpi-u { margin-left: 2px; font-size: 9px; font-style: normal; color: #8b97ab; }
.asst-combo-body { padding: 4px 8px 8px; background: transparent; }
.asst-combo-body svg {
    display: block; width: 100%; height: auto; border-radius: 14px;
    box-shadow: 0 8px 22px -18px rgba(20, 45, 100, .6);
}

@media (max-width: 380px) {
    .asst-kpi-v { font-size: 13px; }
    .asst-combo-sub { display: none; }
}

/* 快捷指令（横向滚动） */
.asst-chips-wrap {
    position: relative; z-index: 1; flex: 0 0 auto;
    padding: 6px 12px 0;
}
.asst-chips {
    display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 9px;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
}
.asst-chips::-webkit-scrollbar { display: none; }
.asst-chip {
    flex: 0 0 auto; scroll-snap-align: start;
    border: 1px solid rgba(43, 107, 255, .18);
    background: rgba(255, 255, 255, .66);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #2b6bff; border-radius: 999px; cursor: pointer;
    font-size: 11.5px; line-height: 1.4; padding: 6px 12px; white-space: nowrap;
    box-shadow: 0 4px 12px -10px rgba(15, 32, 80, .8);
    transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.asst-chip:hover {
    background: #fff; border-color: rgba(43, 107, 255, .4); transform: translateY(-1px);
    box-shadow: 0 8px 18px -12px rgba(43, 107, 255, .9);
}
.asst-chip:active { transform: scale(.97); }

/* 输入区 */
.asst-ft {
    position: relative; z-index: 1; flex: 0 0 auto;
    display: flex; align-items: flex-end; gap: 8px;
    padding: 6px 12px 14px;
}
.asst-field {
    flex: 1 1 auto; min-width: 0;
    display: flex; align-items: flex-end; gap: 6px;
    padding: 5px 5px 5px 12px; border-radius: 17px;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .95);
    box-shadow: 0 10px 24px -18px rgba(15, 32, 80, .9), inset 0 1px 0 rgba(255, 255, 255, .9);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.asst-field:focus-within {
    border-color: rgba(43, 107, 255, .45);
    box-shadow: 0 0 0 3px rgba(43, 107, 255, .13), 0 12px 26px -18px rgba(43, 107, 255, .9);
}
.asst-input {
    flex: 1 1 auto; min-width: 0; resize: none; max-height: 96px;
    padding: 7px 0 6px; border: 0; background: transparent; outline: none;
    font: inherit; font-size: 13px; line-height: 1.5; color: #1c2740;
}
.asst-input::placeholder { color: #a3aebe; }
.asst-send {
    flex: 0 0 auto; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(140deg, #4d90ff, #2b6bff 62%, #1b57e6);
    color: #fff; cursor: pointer;
    box-shadow: 0 6px 16px -8px rgba(43, 107, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .4);
    transition: transform .18s cubic-bezier(.22, 1, .36, 1), opacity .16s ease, box-shadow .18s ease;
}
.asst-send:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 10px 20px -8px rgba(43, 107, 255, 1); }
.asst-send:active { transform: scale(.94); }
.asst-send:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.asst-send.busy svg { animation: asst-breathe .9s ease-in-out infinite; }
.asst-tool {
    flex: 0 0 auto; width: 34px; height: 34px; padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .62);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #64748b; cursor: pointer;
    box-shadow: 0 8px 18px -14px rgba(15, 32, 80, .9);
    transition: color .16s ease, background .16s ease, transform .16s ease;
}
.asst-tool:hover { color: #2b6bff; background: #fff; transform: translateY(-1px); }
.asst-tool:active { transform: scale(.94); }

/* 输入框上方的待解析图片 */
.asst-attach {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px 0;
}
.asst-attach[hidden] { display: none; }
.asst-attach-list { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.asst-attach-item {
    position: relative; flex: 0 0 auto; width: 46px; height: 46px;
    border-radius: 10px; overflow: hidden; background: #eef2f8;
    box-shadow: 0 0 0 1px rgba(43, 107, 255, .2), 0 4px 10px -8px rgba(15, 32, 80, .8);
    animation: asst-msg-in .24s ease both;
}
.asst-attach-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asst-attach-item.up::after {
    content: ''; position: absolute; inset: 0; box-sizing: border-box;
    background: rgba(255, 255, 255, .58);
    border: 2px solid rgba(43, 107, 255, .18); border-top-color: #2b6bff; border-radius: 10px;
    animation: asst-spin .8s linear infinite;
}
.asst-attach-item.err { box-shadow: 0 0 0 1px rgba(240, 72, 100, .8); }
.asst-attach-item.err::after {
    content: '!'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px; font-weight: 700; background: rgba(240, 72, 100, .62);
}
.asst-attach-del {
    position: absolute; top: 2px; right: 2px; width: 17px; height: 17px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: rgba(17, 24, 39, .6); color: #fff;
    font-size: 13px; line-height: 1; cursor: pointer; transition: background .16s ease;
}
.asst-attach-del:hover { background: #f04864; }
.asst-attach-hint { flex: 0 0 auto; color: #98a2b3; font-size: 11px; }
@keyframes asst-spin { to { transform: rotate(360deg); } }

/* 深色模式（仅助手面板，不影响站点其他区域） */
.asst-panel.asst-dark {
    color-scheme: dark;
    color: #dce5f5;
    background: linear-gradient(155deg, rgba(24, 33, 52, .94), rgba(15, 22, 38, .9) 55%, rgba(20, 30, 52, .92));
    border-color: rgba(255, 255, 255, .1);
    box-shadow:
        0 40px 80px -24px rgba(0, 0, 0, .72),
        0 10px 26px rgba(0, 0, 0, .34),
        inset 0 1px 0 rgba(255, 255, 255, .08);
}
.asst-panel.asst-dark .asst-aurora { opacity: .28; }
.asst-panel.asst-dark .asst-hd {
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .01));
    border-bottom-color: rgba(255, 255, 255, .08);
    box-shadow: none;
}
.asst-panel.asst-dark .asst-title { color: #e9eefb; }
.asst-panel.asst-dark .asst-sub { color: #93a2bc; }
.asst-panel.asst-dark .asst-hd-line { background: rgba(255, 255, 255, .14); }
.asst-panel.asst-dark .asst-ibtn { color: #9aa9c2; }
.asst-panel.asst-dark .asst-ibtn:hover,
.asst-panel.asst-dark .asst-ibtn.on { background: rgba(90, 162, 255, .16); color: #8fc0ff; }
.asst-panel.asst-dark .asst-close:hover { background: rgba(240, 72, 100, .18); color: #ff8a9c; }

.asst-panel.asst-dark .asst-pop {
    background: rgba(26, 35, 54, .97);
    border-color: rgba(255, 255, 255, .1);
    box-shadow: 0 22px 48px -16px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .3);
}
.asst-panel.asst-dark .asst-pop-hd { color: #93a2bc; }
.asst-panel.asst-dark .asst-hist-item { color: #d7e0f0; }
.asst-panel.asst-dark .asst-hist-item:hover { background: rgba(90, 162, 255, .13); }
.asst-panel.asst-dark .asst-hist-num { color: #9fc4ff; background: rgba(90, 162, 255, .16); }
.asst-panel.asst-dark .asst-pop-empty,
.asst-panel.asst-dark .asst-set-note,
.asst-panel.asst-dark .asst-card-empty { color: #8896ae; }
.asst-panel.asst-dark .asst-set-row { color: #d7e0f0; }
.asst-panel.asst-dark .asst-set-row:hover { background: rgba(90, 162, 255, .1); }
.asst-panel.asst-dark .asst-sw { background: rgba(255, 255, 255, .2); }
.asst-panel.asst-dark .asst-sw:checked { background: linear-gradient(135deg, #4d90ff, #2b6bff); }
.asst-panel.asst-dark .asst-set-clear { background: rgba(240, 72, 100, .14); color: #ff8a9c; }
.asst-panel.asst-dark .asst-set-clear:hover { background: rgba(240, 72, 100, .22); }

.asst-panel.asst-dark .asst-body::-webkit-scrollbar-thumb { background: rgba(160, 180, 210, .28); }
.asst-panel.asst-dark .asst-body::-webkit-scrollbar-thumb:hover { background: rgba(160, 180, 210, .45); }
.asst-panel.asst-dark .asst-bubble {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .09);
    color: #dce5f5;
    box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .8);
}
.asst-panel.asst-dark .asst-bubble strong { color: #fff; }
.asst-panel.asst-dark .asst-msg.user .asst-bubble {
    background: linear-gradient(135deg, #3f82f5, #245fdc 58%, #1a4fc4);
    border-color: rgba(255, 255, 255, .18);
    color: #fff;
}
.asst-panel.asst-dark .asst-typing .asst-bubble { color: #93a2bc; }
.asst-panel.asst-dark .asst-dots i { background: #93a2bc; }
.asst-panel.asst-dark .asst-msg-imgs img {
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .12);
}

.asst-panel.asst-dark .asst-card {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .09);
    box-shadow: 0 12px 26px -18px rgba(0, 0, 0, .8);
}
.asst-panel.asst-dark .asst-card-hd {
    background: rgba(255, 255, 255, .04);
    border-bottom-color: rgba(255, 255, 255, .07);
    color: #e3eafa;
}
.asst-panel.asst-dark .asst-dl {
    background: rgba(90, 162, 255, .12);
    border-color: rgba(90, 162, 255, .35);
    color: #9fc4ff;
}
.asst-panel.asst-dark .asst-dl:hover { background: rgba(90, 162, 255, .22); box-shadow: none; }
.asst-panel.asst-dark .asst-table { color: #cfdbee; }
.asst-panel.asst-dark .asst-table th,
.asst-panel.asst-dark .asst-table td { border-bottom-color: rgba(255, 255, 255, .07); }
.asst-panel.asst-dark .asst-table th { color: #93a2bc; background: rgba(255, 255, 255, .05); }
.asst-panel.asst-dark .asst-table tbody tr:hover td { background: rgba(90, 162, 255, .1); }
/* 图表 SVG 自带白底，保持浅色容器以免边缘突兀 */
.asst-panel.asst-dark .asst-chart-body { background: #fff; }
.asst-panel.asst-dark .asst-combo {
    background: linear-gradient(168deg, rgba(34, 46, 68, .94), rgba(25, 35, 54, .9));
    border-color: rgba(255, 255, 255, .1);
}
.asst-panel.asst-dark .asst-combo .asst-card-hd { background: transparent; }
.asst-panel.asst-dark .asst-combo-body { background: transparent; }
.asst-panel.asst-dark .asst-kpi {
    background: linear-gradient(150deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
    border-color: rgba(255, 255, 255, .11);
    box-shadow: 0 6px 14px -12px rgba(0, 0, 0, .9);
}
.asst-panel.asst-dark .asst-kpi-v { color: #eef3ff; }
.asst-panel.asst-dark .asst-kpi-k,
.asst-panel.asst-dark .asst-kpi-u { color: #8a99b3; }
.asst-panel.asst-dark .asst-link {
    background: rgba(90, 162, 255, .12);
    border-color: rgba(90, 162, 255, .32);
    color: #9fc4ff;
}
.asst-panel.asst-dark .asst-link:hover {
    background: rgba(90, 162, 255, .22);
    border-color: rgba(90, 162, 255, .5);
    box-shadow: none;
}

.asst-panel.asst-dark .asst-chip {
    background: rgba(90, 162, 255, .12);
    border-color: rgba(90, 162, 255, .28);
    color: #9fc4ff;
    box-shadow: none;
}
.asst-panel.asst-dark .asst-chip:hover {
    background: rgba(90, 162, 255, .22);
    border-color: rgba(90, 162, 255, .5);
    box-shadow: none;
}
.asst-panel.asst-dark .asst-field {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.asst-panel.asst-dark .asst-field:focus-within {
    border-color: rgba(90, 162, 255, .55);
    box-shadow: 0 0 0 3px rgba(90, 162, 255, .16);
}
.asst-panel.asst-dark .asst-input { color: #e6edfa; }
.asst-panel.asst-dark .asst-input::placeholder { color: #7f8ea8; }
.asst-panel.asst-dark .asst-tool {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .1);
    color: #9aa9c2;
    box-shadow: none;
}
.asst-panel.asst-dark .asst-tool:hover { background: rgba(90, 162, 255, .16); color: #9fc4ff; }

/* 待解析图片（深色） */
.asst-panel.asst-dark .asst-attach-item {
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 1px rgba(90, 162, 255, .3), 0 4px 10px -8px rgba(0, 0, 0, .9);
}
.asst-panel.asst-dark .asst-attach-item.up::after {
    background: rgba(20, 30, 50, .55);
    border-color: rgba(90, 162, 255, .22);
    border-top-color: #8fc0ff;
}
.asst-panel.asst-dark .asst-attach-item.err { box-shadow: 0 0 0 1px rgba(240, 72, 100, .75); }
.asst-panel.asst-dark .asst-attach-del { background: rgba(6, 12, 24, .72); }
.asst-panel.asst-dark .asst-attach-del:hover { background: #f04864; }
.asst-panel.asst-dark .asst-attach-hint { color: #8896ae; }

/* 动效关闭 */
.asst-panel.no-anim,
.asst-panel.no-anim * { animation: none !important; transition: none !important; }

/* 键盘焦点可见性 */
.asst-panel button:focus-visible,
.asst-panel input:focus-visible {
    outline: 2px solid rgba(43, 107, 255, .55);
    outline-offset: 2px;
}
.asst-send:focus-visible,
.asst-tool:focus-visible { outline-offset: 3px; }

/* 关键帧 */
@keyframes asst-spin { to { transform: rotate(360deg); } }
@keyframes asst-sheen {
    0% { transform: translateX(-130%); opacity: 0; }
    35% { opacity: .9; }
    100% { transform: translateX(130%); opacity: 0; }
}
@keyframes asst-ping {
    0% { transform: scale(.9); opacity: .8; }
    70%, 100% { transform: scale(1.9); opacity: 0; }
}
@keyframes asst-float1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(12px, 18px, 0) scale(1.08); }
}
@keyframes asst-float2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-16px, -10px, 0) scale(1.06); }
}
@keyframes asst-float3 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(10px, -16px, 0) scale(1.05); }
}
@keyframes asst-msg-in {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to { opacity: 1; transform: none; }
}
@keyframes asst-seg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
@keyframes asst-pop-in {
    from { opacity: 0; transform: translateY(-6px) scale(.97); }
    to { opacity: 1; transform: none; }
}
@keyframes asst-blink {
    0%, 60%, 100% { opacity: .28; }
    30% { opacity: 1; }
}
@keyframes asst-flash {
    0% { box-shadow: 0 0 0 0 rgba(43, 107, 255, .45); }
    100% { box-shadow: 0 0 0 12px rgba(43, 107, 255, 0); }
}
@keyframes asst-breathe {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}
@keyframes asst-live {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
    70%, 100% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .asst-panel { background: #f7f9fd; }
    .asst-pop { background: #fff; }
    .asst-panel.asst-dark { background: #121a2b; }
    .asst-panel.asst-dark .asst-pop { background: #1a2336; }
}

@media (max-width: 640px) {
    .asst-ball { width: 54px; height: 54px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .asst-panel {
        right: 8px; left: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto;
        height: calc(100vh - 16px); max-height: calc(100vh - 16px);
        height: calc(100dvh - 16px); max-height: calc(100dvh - 16px);
        border-radius: 18px;
    }
    .asst-bubble { max-width: 94%; }
    .asst-body { padding: 14px 12px 2px; }
    .asst-tip { display: none; }
    .asst-pop { right: 8px; width: min(244px, calc(100vw - 40px)); }
}

@media (prefers-reduced-motion: reduce) {
    .asst-ball, .asst-panel, .asst-panel * {
        animation-duration: .001ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .asst-panel { transform: none; }
}

/* ============================================================
 * 工作台（dashboard）
 * 时间维度切换 · KPI · 待办/财务/人事/考勤/风险/健康
 * ============================================================ */

/* —— 色调变量：供 KPI、财务瓦片、标签复用 —— */
.tone-blue { --tone: #2452E0; --tone-soft: rgba(36, 82, 224, .08); }
.tone-orange { --tone: #B45309; --tone-soft: rgba(180, 83, 9, .10); }
.tone-red { --tone: #D92D20; --tone-soft: rgba(217, 45, 32, .08); }
.tone-green { --tone: #0E9F6E; --tone-soft: rgba(14, 159, 110, .10); }
.tone-purple { --tone: #6941C6; --tone-soft: rgba(105, 65, 198, .08); }
.tone-gray { --tone: #5A6472; --tone-soft: rgba(27, 31, 39, .05); }

/* —— 顶部问候 + 时间维度 —— */
.dash-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
    margin-bottom: 14px;
    border-radius: 18px;
}
.dash-hello-hi { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.dash-hello-sub { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
.dash-hello-sub b { color: var(--accent); font-weight: 600; }
.dash-range {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .66);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.dash-range button {
    border: 0;
    background: transparent;
    padding: 6px 15px;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    color: var(--ink-2);
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.dash-range button:hover { color: var(--accent); }
.dash-range button.on {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(36, 82, 224, .24);
}
.dash-range button.on:hover { color: #fff; }

/* —— KPI —— */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.kpi {
    position: relative;
    display: block;
    padding: 14px 16px 13px 18px;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.kpi::before {
    content: '';
    position: absolute;
    left: 0; top: 12px; bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: var(--tone, #2452E0);
    opacity: .8;
}
.kpi:hover { border-color: rgba(255, 255, 255, .9); box-shadow: var(--shadow-2); }
.kpi-hd {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 12.5px; color: var(--ink-2);
}
.kpi-delta { font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; }
.kpi-delta.up { color: #D92D20; background: rgba(217, 45, 32, .08); }
.kpi-delta.down { color: #0E9F6E; background: rgba(14, 159, 110, .10); }
.kpi-val {
    margin: 7px 0 3px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
}
.kpi-val small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.kpi-money { font-size: 20px; }
.kpi-foot { font-size: 11.5px; color: var(--ink-3); }

/* —— 两栏布局 —— */
.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dash-card { padding: 16px 18px; }
.dash-card .card-hd { margin-bottom: 10px; }
.dash-more { font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.dash-more:hover { text-decoration: underline; }

/* —— 列表行 —— */
.drows { display: flex; flex-direction: column; }
.drow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin: 0 -4px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background-color .15s ease;
}
.drow:hover { background: rgba(36, 82, 224, .05); }
.drow + .drow { border-top: 1px solid var(--line-soft); }
.drow-ico {
    flex: none;
    width: 26px; height: 26px;
    border-radius: 8px;
    display: grid; place-items: center;
    font-size: 12px; font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent);
}
.drow-ico.sm { width: 22px; height: 22px; font-size: 11px; border-radius: 7px; }
.drow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drow-main b {
    font-size: 13.5px; font-weight: 600; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drow-main i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.drow-amt { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.drow-date { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.drow-go { color: var(--ink-3); font-size: 15px; line-height: 1; }

/* —— 快捷入口 —— */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 8px; }
.sc-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(247, 249, 252, .74);
    text-decoration: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .12s ease;
}
.sc-item:hover {
    background: #fff;
    border-color: rgba(36, 82, 224, .18);
    transform: translateY(-1px);
}
.sc-badge {
    flex: none;
    width: 28px; height: 28px;
    border-radius: 9px;
    display: grid; place-items: center;
    font-size: 12px; font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent);
}
.sc-ai .sc-badge { background: linear-gradient(135deg, #2452E0, #7C5CFF); color: #fff; font-size: 11px; }
.sc-txt { display: flex; flex-direction: column; min-width: 0; }
.sc-txt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-txt i { font-style: normal; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* —— 财务瓦片 —— */
.f-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.f-tile {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--tone-soft);
    text-decoration: none;
    color: inherit;
    transition: transform .12s ease, box-shadow .15s ease;
}
.f-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.f-label { font-size: 11.5px; color: var(--ink-2); }
.f-val { font-size: 18px; font-weight: 700; color: var(--tone); line-height: 1.3; }
.f-val small { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }
.f-sub { font-size: 11px; color: var(--ink-3); }

/* —— 统计小标签 —— */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    background: var(--tone-soft);
    color: var(--tone);
}

/* —— 系统健康 —— */
.hstat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.hstat-i {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 6px;
    border-radius: 10px;
    background: rgba(247, 249, 252, .76);
    text-align: center;
}
.hstat-i span { font-size: 11px; color: var(--ink-3); }
.hstat-i b { font-size: 14px; font-weight: 700; color: var(--ink); }
.hstat-i b.warn { color: #D92D20; }
.hrow { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 12px; color: var(--ink-2); }
.hrow .bar { flex: 1; height: 5px; }
.hissues {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(217, 45, 32, .05);
    color: #B42318;
    font-size: 12px;
    line-height: 1.6;
}

/* —— 打卡趋势 —— */
.trend-wrap { margin-top: 2px; }
.trend-svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }

/* —— 空态与小组件 —— */
.dash-empty { padding: 22px 10px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.dash-empty span { display: block; font-size: 22px; opacity: .45; margin-bottom: 4px; }
.dash-sub-hd { margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.dash-sub-hd b { color: var(--accent); }
.dash-line { padding: 4px 2px; font-size: 12px; }
.mt12 { margin-top: 12px; }
#dash-body.is-loading { opacity: .55; transition: opacity .15s ease; }

@media (max-width: 1080px) {
    .dash-grid { grid-template-columns: 1fr; }
    .hstat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .dash-top { padding: 14px 16px; }
    .dash-hello-hi { font-size: 17px; }
    .dash-range { width: 100%; }
    .dash-range button { flex: 1; padding: 7px 0; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 12px 14px 11px 16px; }
    .kpi-val { font-size: 22px; }
    .kpi-money { font-size: 17px; }
    .dash-card { padding: 14px; }
    .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .drow-amt, .drow-date { font-size: 11.5px; }
}
