/* ============================================================
   壳层: 登录页 / 常规布局 / 沉浸式大屏壳 / 后台顶部导航壳 / 弹窗
   主题: 科技风 · 深空蓝(2026-11-12 全站 UI 重塑)
   注意: 选择器与 JS 强耦合, 只改视觉布局不改名(详见 core.js)
   ============================================================ */
/* ---------- 登录页: 左品牌视觉 + 右玻璃登录卡(全屏分栏) ---------- */
.login-body {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    min-height: 100vh;
    background: var(--bg);
    overflow: hidden;
}
.login-split { display: flex; width: 100%; min-height: 100vh; }
.login-hero {
    flex: 1.35;
    position: relative;
    padding: 56px 64px;
    display: flex; flex-direction: column; justify-content: center;
    background:
        radial-gradient(720px 440px at 30% 42%, rgba(37, 99, 235, .38), transparent 65%),
        radial-gradient(520px 320px at 82% 86%, rgba(34, 211, 238, .18), transparent 60%),
        linear-gradient(150deg, #071c34, var(--bg));
    overflow: hidden;
}
.login-hero::before {
    /* 装饰雷达环 */
    content: "";
    position: absolute; left: -6%; top: 8%;
    width: 560px; height: 560px; border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, .18);
    box-shadow:
        0 0 0 70px rgba(34, 211, 238, .05),
        0 0 0 140px rgba(34, 211, 238, .04),
        0 0 90px rgba(34, 211, 238, .12);
    pointer-events: none;
}
.login-hero .login-logo {
    width: 76px; height: 76px; margin: 0 0 22px;
}
.login-hero-en {
    font-size: 11px; letter-spacing: 5px; color: var(--primary);
    margin-bottom: 12px; text-transform: uppercase;
}
.login-hero h1 {
    font-size: 38px; letter-spacing: 4px; line-height: 1.35;
    margin: 0 0 8px; font-weight: 700;
}
.login-hero h1 .grad-text {
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-hero-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.login-hero-stats {
    position: absolute; left: 64px; right: 64px; bottom: 48px;
    display: flex; gap: 36px;
    border-top: 1px solid var(--border); padding-top: 20px;
}
.login-hero-stats .num { font-size: 26px; font-weight: 700; color: #e0f2fe; letter-spacing: .5px; }
.login-hero-stats .lbl { font-size: 11px; letter-spacing: 2px; color: var(--text-faint); margin-top: 2px; }

.login-side {
    flex: 1;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(200deg, var(--bg-2), #061629 65%);
    border-left: 1px solid var(--border);
}
.login-card {
    width: 380px; max-width: 86%;
    background: linear-gradient(165deg, rgba(13, 42, 80, .65), rgba(8, 24, 46, .8));
    border: 1px solid var(--border-2);
    border-radius: 14px;
    padding: 36px 34px;
    box-shadow: var(--shadow), var(--glow);
    position: relative;
}
.login-card::before, .login-card::after {
    content: ""; position: absolute; width: 14px; height: 14px;
    border-color: var(--primary); border-style: solid; opacity: .8;
}
.login-card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-radius: 14px 0 0 0; }
.login-card::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-radius: 0 0 14px 0; }
.login-brand { text-align: left; margin-bottom: 22px; }
.login-logo {
    display: inline-block; width: 56px; height: 56px; margin-bottom: 12px;
}
.login-logo svg { width: 100%; height: 100%; display: block; }
.login-brand h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: 2px; }
.login-brand .muted { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; }
.login-error {
    background: rgba(248, 113, 113, .13); color: var(--danger);
    border: 1px solid rgba(248, 113, 113, .35);
    padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px;
}
.login-foot { text-align: center; font-size: 11px; margin-top: 18px; letter-spacing: 1px; }

@media (max-width: 900px) {
    .login-hero { display: none; }
    .login-side { border-left: none; }
}

/* ---------- 布局: 顶部两行(行1: 品牌+面包屑+账号操作; 行2: 通栏横排导航) ---------- */
.topbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    height: auto; min-height: 52px;
    padding: 8px 18px 0;
    background: linear-gradient(180deg, rgba(10, 34, 66, .92), rgba(7, 26, 48, .82));
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
    backdrop-filter: blur(8px);
}
.topbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .55), transparent);
}
.topbar .brand { font-weight: 700; font-size: 14px; color: var(--text); letter-spacing: 1px; white-space: nowrap; }
.topbar .brand small { color: var(--text-faint); font-weight: 400; margin-left: 6px; letter-spacing: 2px; }
.topbar .brand .brand-badge { width: 22px; height: 22px; display: inline-block; vertical-align: -5px; margin-right: 7px; }
/* 顶栏第二行通栏导航(#nav 由 core.js 动态填充): 分组成簇, 组间细分隔线; 空间不足时自身横滑 */
.topbar nav {
    display: flex; align-items: center; gap: 2px;
    flex: 1 1 100%; min-width: 0;
    margin: 2px -18px 0; padding: 4px 18px 8px;
    border-top: 1px solid rgba(56, 189, 248, .14);
    overflow-x: auto; scrollbar-width: none;
}
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav .nav-group { display: flex; align-items: center; gap: 2px; flex: none; }
.topbar nav .nav-group > div:not(.nav-group-title) { display: flex; align-items: center; gap: 2px; }   /* 组内链接容器(core.js 无 class 的 box); 排除组标题 */
.topbar nav .nav-group + .nav-group { margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--border-2); }
.topbar nav .nav-group-title { display: none; }   /* 横排下组名以分隔线表达, 竖排(已废弃)/抽屉里曾显示 */
#nav a {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: 8px;
    color: var(--text-faint); font-size: 12.5px; letter-spacing: 1px;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}
#nav a:hover { background: rgba(34, 211, 238, .1); color: var(--text); }
#nav a.active {
    background: rgba(34, 211, 238, .14); color: var(--primary); font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .35), 0 0 14px rgba(34, 211, 238, .1);
}
/* 导航图标: SVG mask + currentColor(图标位在文字左侧) */
#nav a::before {
    content: "";
    width: 16px; height: 16px; display: block; flex: none;
    background: currentColor;
    -webkit-mask: var(--nav-icon, none) center / 16px 16px no-repeat;
    mask: var(--nav-icon, none) center / 16px 16px no-repeat;
}.topbar .user-info { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 10px; }

.container { padding: 16px 20px; max-width: 1560px; margin: 0 auto; }

/* ---------- 大屏壳 ---------- */
body.mode-dash { overflow: hidden; }
#dash-shell {
    position: relative; height: 100vh;
    background:
        radial-gradient(1000px 420px at 80% -10%, rgba(37, 99, 235, .18), transparent 60%),
        linear-gradient(165deg, #051224, var(--bg));
}
#dash-shell[hidden], #admin-shell[hidden] { display: none; }
.dash-view { position: absolute; inset: 0; }

/* 大屏 HUD 顶栏: 品牌左 · 标签中 · 状态右(通栏) */
#dash-chrome {
    position: fixed; top: 0; left: 0; right: 0; z-index: 70;
    display: flex; align-items: center; gap: 18px;
    min-height: 58px; padding: 6px 18px;
    background: linear-gradient(180deg, rgba(10, 34, 66, .95), rgba(7, 26, 48, .78));
    border-bottom: 1px solid var(--border);
    transition: opacity .5s, transform .5s;
    pointer-events: none;
}
#dash-chrome::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .65), transparent);
}
#dash-chrome > * { pointer-events: auto; }
.dash-top-row { display: flex; align-items: center; gap: 8px; }

/* 大屏平台名(科技徽标+名称): HUD 左侧 */
.dash-brand {
    position: static; transform: none;
    display: flex; align-items: center; gap: 10px;
    background: none; border: none; border-radius: 0; padding: 0;
    box-shadow: none;
    color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: 2px;
    white-space: nowrap; pointer-events: none; z-index: 1;
}
.dash-brand svg { width: 30px; height: 30px; display: block; flex: none; }

/* 大屏导航: HUD 中部胶囊标签组 */
.dash-menu {
    display: flex; align-items: center; gap: 8px;
    height: 42px; padding: 0 8px;
    background: rgba(4, 16, 31, .5);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: none; min-width: 0;
}
.dash-sep { width: 1px; height: 18px; background: var(--border-2); flex: none; margin: 0 4px; }
.dash-tab {
    border: 1px solid transparent; background: transparent; color: var(--text-dim);
    padding: 7px 18px; border-radius: 9px; cursor: pointer; font-size: 13px;
    letter-spacing: 2px; white-space: nowrap; transition: background .15s, color .15s;
}
.dash-tab:hover { color: var(--text); background: rgba(34, 211, 238, .1); }
.dash-tab.active {
    background: var(--grad); color: #fff; font-weight: 600;
    box-shadow: 0 4px 16px rgba(37, 99, 235, .4); border-color: transparent;
}
.dash-status-line {
    display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text);
    min-width: 0; flex: 0 1 auto;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: rgba(4, 16, 31, .45); border: 1px solid var(--border);
    border-radius: 9px; padding: 5px 12px;
}
.dash-status-line .st-rate { color: var(--text-dim); font-weight: 400; }
.dash-status-line .st-ok, .dash-status-line .st-stale, .dash-status-line .st-off { color: var(--text); }
.dash-status-line .dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    margin-right: 4px; vertical-align: -1px;
}
.dash-status-line b, .dash-menu .sit-status b { color: var(--primary); font-weight: 700; margin-left: 2px; }
.dash-menu .sit-status {
    font-size: 12px; color: var(--text-dim); letter-spacing: 1px;
    min-width: 0; flex: none; padding-right: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 大屏 HUD 右侧后台入口: 文字按钮, margin-left:auto 推至最右 */
.admin-entry-btn {
    margin-left: auto;
    padding: 7px 18px; border-radius: 9px;
    border: 1px solid rgba(34, 211, 238, .5); background: var(--grad);
    color: #fff; font-size: 13px; letter-spacing: 2px; cursor: pointer; flex: none;
    white-space: nowrap;
    transition: box-shadow .15s, filter .15s;
}
.admin-entry-btn:hover { box-shadow: 0 0 18px rgba(34, 211, 238, .45); filter: brightness(1.12); }

/* 大屏告警横幅: HUD 下方 */
body.mode-dash .alert-banner { top: 58px; }

/* 设备状态颜色 */
.st-ok { color: var(--safe); }
.st-stale { color: var(--orange); }
.st-off { color: var(--text-faint); }

/* 异常状态点(橙色闪烁) */
.dot-stale { background: var(--orange); box-shadow: 0 0 6px var(--orange); animation: dotBlink 1.2s ease-in-out infinite; }
@keyframes dotBlink { 50% { opacity: .3; } }
.badge-stale { background: rgba(251, 146, 60, .18); color: var(--orange); }
.dev-row.stale { border-left-color: var(--orange); }

/* ---------- 后台壳: 顶部细条(品牌 + 横排导航 + 面包屑 + 账号操作) ---------- */
.admin-body { min-height: calc(100vh - var(--topbar-h)); }
/* 导轨图标定义: SVG mask 变量, 渲染样式见上方 #nav a::before */
#nav a[data-view="device"]    { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='6' y='2.5' width='12' height='19' rx='2.5' fill='none' stroke='black' stroke-width='1.8'/><path d='M10 18.5 H14' stroke='black' stroke-width='1.8' stroke-linecap='round'/></svg>"); }
#nav a[data-view="records"]   { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='8.6' fill='none' stroke='black' stroke-width='1.8'/><path d='M12 7 V12 L15.5 14' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/></svg>"); }
#nav a[data-view="uom"]       { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='11' cy='11' r='6.6' fill='none' stroke='black' stroke-width='1.8'/><path d='M16 16 L21 21' stroke='black' stroke-width='1.8' stroke-linecap='round'/></svg>"); }
#nav a[data-view="whitelist"] { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2.8 L20 6 V12 C20 17 16.4 20.6 12 22 C7.6 20.6 4 17 4 12 V6 Z' fill='none' stroke='black' stroke-width='1.8'/><path d='M8.6 12 L11 14.4 L15.4 9.6' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/></svg>"); }
#nav a[data-view="pilots"]    { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='8' r='3.6' fill='none' stroke='black' stroke-width='1.8'/><path d='M4.5 20.5 C4.5 16.8 8 14.5 12 14.5 C16 14.5 19.5 16.8 19.5 20.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/></svg>"); }
#nav a[data-view="models"]    { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='2.2' fill='black'/><path d='M12 9.6 V5 M12 14.4 V19 M9.6 12 H5 M14.4 12 H19' stroke='black' stroke-width='1.8' stroke-linecap='round'/><circle cx='5.2' cy='5.2' r='2' fill='none' stroke='black' stroke-width='1.6'/><circle cx='18.8' cy='5.2' r='2' fill='none' stroke='black' stroke-width='1.6'/><circle cx='5.2' cy='18.8' r='2' fill='none' stroke='black' stroke-width='1.6'/><circle cx='18.8' cy='18.8' r='2' fill='none' stroke='black' stroke-width='1.6'/></svg>"); }
#nav a[data-view="alarm"]     { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 10 C6 6.5 8.7 4 12 4 C15.3 4 18 6.5 18 10 V15 L20 18 H4 L6 15 Z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/><path d='M10 18 C10 19.2 10.9 20 12 20 C13.1 20 14 19.2 14 18' fill='none' stroke='black' stroke-width='1.8'/></svg>"); }
#nav a[data-view="ota"]       { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 16 V4 M7 9 L12 4 L17 9' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/><path d='M4 16 V19 C4 20 4.8 21 6 21 H18 C19.2 21 20 20 20 19 V16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/></svg>"); }
#nav a[data-view="logs"]      { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 3 H15 L20 8 V21 H6 Z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/><path d='M15 3 V8 H20' fill='none' stroke='black' stroke-width='1.8'/><path d='M9 12 H17 M9 16 H17' stroke='black' stroke-width='1.8' stroke-linecap='round'/></svg>"); }
#nav a[data-view="password"]  { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='5' y='11' width='14' height='10' rx='2' fill='none' stroke='black' stroke-width='1.8'/><path d='M8 11 V8 C8 5.8 9.8 4 12 4 C14.2 4 16 5.8 16 8 V11' fill='none' stroke='black' stroke-width='1.8'/></svg>"); }
#nav a[data-view="users"]     { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='9' cy='8.5' r='3.2' fill='none' stroke='black' stroke-width='1.8'/><path d='M3.5 20 C3.5 16.6 6 14.6 9 14.6 C12 14.6 14.5 16.6 14.5 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/><circle cx='17' cy='9.5' r='2.6' fill='none' stroke='black' stroke-width='1.6'/><path d='M15.2 14.8 C17.8 14.8 20.5 16.6 20.5 19.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/></svg>"); }
#nav a[data-view="assign"]    { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='3' y='5' width='8' height='14' rx='2' fill='none' stroke='black' stroke-width='1.7'/><rect x='13' y='5' width='8' height='14' rx='2' fill='none' stroke='black' stroke-width='1.7'/><path d='M8 12 H16 M13 9 L16 12 L13 15' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
#nav a[data-view="shares"]    { --nav-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='6' cy='12' r='2.4' fill='none' stroke='black' stroke-width='1.7'/><circle cx='18' cy='6' r='2.4' fill='none' stroke='black' stroke-width='1.7'/><circle cx='18' cy='18' r='2.4' fill='none' stroke='black' stroke-width='1.7'/><path d='M8.2 11 L15.8 7.2 M8.2 13 L15.8 16.8' stroke='black' stroke-width='1.7'/></svg>"); }

.admin-body .container { flex: 1; min-width: 0; max-width: none; }
.admin-body .container::after { content: ''; display: block; height: 12px; }

/* 顶栏面包屑(替代原页内大标题) */
.crumb { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--text-faint); font-size: 12px; min-width: 0; letter-spacing: 2px; }
.crumb h2 {
    font-size: 15px; margin: 0; color: var(--text); font-weight: 700; letter-spacing: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    position: relative; padding-left: 12px;
}
.crumb h2::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 15px; border-radius: 2px; background: var(--grad);
}
#view-title { margin: 0; }   /* 原 .container 内 h2 已移入面包屑 */

/* ---------- 设备分配页 ---------- */
.asg { display: flex; flex-direction: column; gap: 14px; }
.asg .card { margin-bottom: 0; }

.asg-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; padding: 14px 18px;
}
.asg-head-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.asg-user { display: flex; align-items: center; gap: 10px; }
.asg-user label {
    margin: 0; color: var(--text-dim); font-size: 13px; white-space: nowrap;
}
.asg-user select { width: 240px; padding: 8px 12px; font-weight: 600; }
.asg-user-meta {
    color: var(--text-faint); font-size: 12px; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asg-head-side { display: flex; align-items: center; gap: 8px; }
.asg-head-side .badge { font-size: 12px; padding: 3px 10px; }

.asg-cols {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start;
}
@media (max-width: 980px) {
    .asg-cols { grid-template-columns: 1fr; }
    .asg-user select { width: 100%; min-width: 200px; }
}

.asg-panel { display: flex; flex-direction: column; min-height: 420px; max-height: calc(100vh - 280px); }
.asg-panel-hd {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.asg-panel-hd h3 {
    margin: 0; font-size: 14px; font-weight: 600; flex: none; letter-spacing: 1px;
}
.asg-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 20px; padding: 0 7px;
    border-radius: 10px; background: rgba(34, 211, 238, .12); color: var(--primary);
    border: 1px solid rgba(34, 211, 238, .3);
    font-size: 12px; font-weight: 600;
}
.asg-panel-hd .asg-hist-tabs { margin-left: auto; display: flex; gap: 6px; }

.asg-search { position: relative; margin-bottom: 10px; }
.asg-search input { padding: 8px 12px 8px 34px; background: rgba(4, 16, 31, .5); }
.asg-search::before {
    content: '⌕'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: var(--primary); font-size: 15px; pointer-events: none; z-index: 1;
}

.asg-toolbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 10px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.asg-toolbar .faint { font-size: 12px; margin-right: auto; }
.asg-btn-push { margin-left: 4px; }

.asg-list {
    flex: 1; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
    padding-right: 2px;
}
.asg-list-assigned { max-height: none; }

.asg-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: rgba(11, 36, 68, .55);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.asg-item:hover { border-color: var(--border-2); background: rgba(14, 44, 82, .55); }
.asg-item.is-picked { border-color: var(--primary); background: rgba(34, 211, 238, .1); }
.asg-item.is-bounded { cursor: default; border-left: 3px solid var(--safe); }
.asg-item.is-bounded:hover { border-color: transparent; border-left-color: var(--safe); background: rgba(11, 36, 68, .55); }
.asg-item input[type="checkbox"] {
    width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--primary); cursor: pointer;
}
.asg-item-body { flex: 1; min-width: 0; }
.asg-item-title {
    font-size: 13px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asg-item-title .mono { font-weight: 500; color: var(--text-dim); }
.asg-item-meta {
    margin-top: 3px; font-size: 12px; color: var(--text-faint);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.asg-item-meta .mono { color: var(--text-dim); font-size: 11px; }
.asg-item-meta .sep { opacity: .4; }
.asg-item-side { flex: none; display: flex; align-items: center; gap: 8px; }

.asg-manual {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed var(--border);
    font-size: 12px; color: var(--text-faint);
}
.asg-manual input {
    width: 160px; padding: 5px 8px; font-size: 12px;
    font-family: Consolas, Menlo, monospace;
}

.asg-empty {
    padding: 28px 16px; text-align: center; color: var(--text-faint); font-size: 13px;
    border: 1px dashed var(--border); border-radius: 8px;
}

/* 分配历史: 紧凑行列表 — 列宽必须容下 15 位 IMEI, 禁止溢出叠字 */
.asg-hist { display: flex; flex-direction: column; min-width: 0; overflow-x: auto; }
.asg-hist-row {
    display: grid;
    grid-template-columns: 64px minmax(148px, 1.4fr) minmax(110px, 1fr) minmax(90px, 0.9fr) minmax(90px, 0.9fr) 148px;
    gap: 12px; align-items: center;
    padding: 9px 6px;
    border-bottom: 1px solid rgba(56, 189, 248, .12);
    font-size: 12px;
    min-width: 720px;
}
.asg-hist-row > * {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.asg-hist-row:last-child { border-bottom: none; }
.asg-hist-row:hover { background: rgba(34, 211, 238, .05); }
.asg-hist-hd {
    color: var(--text-faint); font-weight: 600; font-size: 11px;
    border-bottom: 1px solid var(--border); background: transparent;
}
.asg-hist-hd:hover { background: transparent; }
.asg-hist .mono {
    font-size: 12px; color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}
.asg-hist-time { color: var(--text-faint); font-variant-numeric: tabular-nums; }
.asg-hist .badge { justify-self: start; }
@media (max-width: 800px) {
    .asg-hist-row { min-width: 560px; grid-template-columns: 64px minmax(140px, 1.3fr) minmax(100px, 1fr) 140px; }
    .asg-hist-row > :nth-child(4),
    .asg-hist-row > :nth-child(5) { display: none; }
}

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed; inset: 0; z-index: 90;
    display: flex; align-items: center; justify-content: center;
    background: rgba(2, 10, 22, .72); padding: 16px;
    backdrop-filter: blur(3px);
}
.modal-mask[hidden] { display: none; }
.modal-box {
    width: min(540px, 94vw); max-height: 86vh; overflow: auto;
    background: linear-gradient(165deg, rgba(13, 42, 80, .96), rgba(7, 22, 44, .98));
    border: 1px solid var(--border-2);
    border-radius: 12px; box-shadow: var(--shadow), var(--glow); padding: 18px 20px;
}
.modal-box h3 { margin: 0 0 12px; font-size: 15px; letter-spacing: 1.5px; }
.modal-box .kv {
    display: flex; justify-content: space-between; gap: 14px;
    padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.modal-box .kv .k { color: var(--text-dim); flex: none; }
.modal-box .kv .v { text-align: right; word-break: break-all; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
/* 页内确认弹窗(confirmDialog): 消息区保留换行 */
.confirm-box .confirm-msg { font-size: 13px; line-height: 1.8; white-space: pre-line; word-break: break-all; }

/* ---------- 用户管理 ---------- */
.user-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.user-toolbar h3 { margin: 0; }
.user-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-search { width: 220px; padding: 7px 10px; }
.user-actions { white-space: nowrap; }
.user-actions .btn { margin: 0 4px 4px 0; }
.user-form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.user-modal-box .field { margin-bottom: 12px; }
.user-modal-box .hint { min-height: 18px; margin: 4px 0 0; }
tr.is-self td { background: rgba(34, 211, 238, .07); }

/* 修改密码页 */
.pwd-page { max-width: 480px; }
.pwd-form .field { margin-bottom: 14px; }
.pwd-form .hint { min-height: 18px; }

@media (max-width: 640px) {
    .user-form-row { grid-template-columns: 1fr; }
    .user-search { width: 100%; }
}

/* ---------- 飞手信息登记 ---------- */
.pilot-badge {
    cursor: pointer;
    margin-left: 6px;
    vertical-align: middle;
    user-select: none;
}
.pilot-badge:hover { filter: brightness(1.15); }
.pilot-info-box .kv .v { text-align: right; }
.pilot-form-actions {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding-top: 28px;
}
.pilot-form-actions .hint { margin-top: 0; }

/* 「是否加入白名单」开关 */
.field .pl-wl {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 6px; font-size: 13px; color: var(--text);
    cursor: pointer; user-select: none;
}
.field .pl-wl.is-disabled { cursor: not-allowed; color: var(--text-dim); }
.pl-wl input { position: absolute; opacity: 0; width: 0; height: 0; }
.pl-wl-sw {
    flex: none; width: 30px; height: 16px; border-radius: 9px;
    background: rgba(4, 16, 31, .6); border: 1px solid var(--border-2); position: relative; transition: .15s;
}
.pl-wl-sw::after {
    content: ''; position: absolute; top: 1px; left: 1px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--text-dim); transition: .15s;
}
.pl-wl input:checked + .pl-wl-sw { background: var(--grad); border-color: var(--primary); }
.pl-wl input:checked + .pl-wl-sw::after { left: 15px; background: #fff; }
.pl-wl input:disabled + .pl-wl-sw { opacity: .45; }
/* 飞手列表「白名单」列: 徽章 + 一键加入/移出按钮不折行 */
.pl-wl-cell { white-space: nowrap; }
.pl-wl-cell .btn { margin-left: 4px; }
/* 中性徽章(未加入白名单) */
.badge-muted { background: rgba(125, 162, 196, .12); color: var(--text-dim); border: 1px solid rgba(125, 162, 196, .28); }
/* 白名单页操作员后的「详情」按钮 */
.wl-pilot { margin-left: 6px; padding: 1px 6px; }

/* ---------- 历史记录检索工具条(日期/RID/导出) ---------- */
.rec-toolbar input[type="date"], .rec-toolbar input[type="text"] {
    width: 132px; padding: 3px 6px; font-size: 12px;
    background: rgba(4, 16, 31, .5); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text); flex: 0 1 auto; min-width: 0;
}
.rec-toolbar .rec-export { margin-left: auto; flex: none; }


/* ---------- OTA 固件升级页 ---------- */
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; letter-spacing: .3px; }
.ota-bar {
    height: 8px; border-radius: 5px; background: rgba(4, 16, 31, .6);
    border: 1px solid var(--border); overflow: hidden; margin-bottom: 2px;
}
.ota-bar-fill { height: 100%; background: var(--grad); transition: width .6s ease; }
/* 设备表: 窄屏横向滚动 */
#ota-devices { overflow-x: auto; }
#ota-devices table { min-width: 1080px; }
#ota-devices td select { max-width: 150px; }
/* 设备列: IMEI 等宽首行 + 别名淡色次行 */
.ota-dev-alias { display: block; color: var(--text-dim); font-size: 12px; font-weight: 400; }
/* 强制升级: 开关式 checkbox */
.ota-force { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.ota-force input { position: absolute; opacity: 0; width: 0; height: 0; }
.ota-force-sw {
    flex: none; width: 30px; height: 16px; border-radius: 9px;
    background: rgba(4, 16, 31, .6); border: 1px solid var(--border-2); position: relative; transition: .15s;
}
.ota-force-sw::after {
    content: ''; position: absolute; top: 1px; left: 1px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--text-dim); transition: .15s;
}
.ota-force input:checked + .ota-force-sw { background: var(--grad); border-color: var(--primary); }
.ota-force input:checked + .ota-force-sw::after { left: 15px; background: #fff; }
/* 任务说明列: 单行省略号防撑爆 */
.ota-err {
    display: inline-block; max-width: 460px; vertical-align: bottom;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ota-ok { color: var(--safe); }
