/* ============================================================
   登录页
   ============================================================ */
.login{
  position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;
  padding:24px;background:linear-gradient(135deg,#eef2f7 0%,#e2eaf3 100%);
}
.login-card{
  display:flex;width:100%;max-width:860px;min-height:420px;
  background:#fff;border-radius:16px;overflow:hidden;
  box-shadow:0 18px 50px rgba(20,45,80,.14),0 2px 8px rgba(20,45,80,.06);
}
.login-brand{
  flex:0 0 46%;padding:44px 40px;color:#fff;
  background:linear-gradient(150deg,#2196f3 0%,#1976d2 55%,#1565c0 100%);
  display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden;
}
.login-brand::after{      /* 右上角装饰圆，纯几何不喧宾夺主 */
  content:'';position:absolute;right:-60px;top:-60px;width:200px;height:200px;
  border-radius:50%;background:rgba(255,255,255,.08);
}
.login-brand::before{
  content:'';position:absolute;right:20px;bottom:-80px;width:160px;height:160px;
  border-radius:50%;background:rgba(255,255,255,.06);
}
.lb-logo{font-size:40px;line-height:1;margin-bottom:18px;position:relative;z-index:1}
.lb-hi{font-size:27px;font-weight:700;margin:0 0 6px;letter-spacing:.5px;position:relative;z-index:1}
.lb-sub{font-size:14px;margin:0 0 26px;opacity:.9;position:relative;z-index:1}
.lb-feats{list-style:none;padding:0;margin:0;position:relative;z-index:1}
.lb-feats li{
  font-size:13px;opacity:.9;padding-left:20px;position:relative;margin-bottom:11px;line-height:1.5;
}
.lb-feats li::before{
  content:'✓';position:absolute;left:0;font-weight:700;
}

.login-form{flex:1 1 auto;padding:44px 42px;display:flex;flex-direction:column;justify-content:center}
.lf-head{margin-bottom:26px}
.lf-head h2{font-size:23px;margin:0 0 6px;font-weight:700;letter-spacing:.5px}
.lf-head p{font-size:13.5px;color:var(--muted);margin:0}
.lf-field{display:block;margin-bottom:16px}
.lf-field>span:first-child{
  display:block;font-size:12.5px;color:var(--muted);font-weight:600;margin-bottom:6px;
}
.lf-tip{font-weight:400;font-size:12px}
.lf-field input{
  width:100%;height:46px;padding:0 14px;font-size:15px;
  border:1px solid #d3dde8;border-radius:9px;background:#f7f9fc;
  font-family:inherit;color:var(--ink);transition:.15s;
}
.lf-field input:focus{
  outline:0;background:#fff;border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(30,136,229,.13);
}
.lf-pw{position:relative;display:block}
.lf-pw input{padding-right:46px}
.lf-eye{
  position:absolute;right:0;top:0;width:46px;height:46px;border:0;background:transparent;
  cursor:pointer;font-size:16px;opacity:.45;transition:.15s;border-radius:0 9px 9px 0;
}
.lf-eye:hover,.lf-eye.on{opacity:1}
.lf-err{
  background:#fdecea;color:#c62828;font-size:13px;padding:9px 12px;
  border-radius:8px;margin:0 0 14px;border-left:3px solid #c62828;
}
.lf-btn{
  width:100%;height:47px;border:0;border-radius:9px;background:#f4511e;color:#fff;
  font-size:15.5px;font-weight:600;cursor:pointer;font-family:inherit;
  transition:.15s;margin-top:4px;box-shadow:0 2px 8px rgba(244,81,30,.28);
}
.lf-btn:hover{background:#e64510;box-shadow:0 4px 14px rgba(244,81,30,.34)}
.lf-btn:active{transform:translateY(1px)}
.lf-btn:disabled{background:#b9c4d0;box-shadow:none;cursor:not-allowed;transform:none}
.lf-foot{font-size:12.5px;color:var(--muted);text-align:center;margin:16px 0 0}

/* ============================================================
   账号权限管理
   ============================================================ */
.adm{
  display:grid;grid-template-columns:1fr 1.3fr;gap:0;min-height:400px;
  background:#f4f7fb;
}
.adm-col{display:flex;flex-direction:column;min-width:0;background:#fff}
.adm-col:first-child{border-right:1px solid #e3eaf2}

.adm-col-hd{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:14px 18px;border-bottom:1px solid #e8eef5;background:#fff;
  position:sticky;top:0;z-index:2;
}
.adm-col-hd h4{
  margin:0;font-size:14px;font-weight:700;display:flex;align-items:baseline;gap:7px;color:#1b2733;
}
.adm-col-hd h4::before{
  content:'';width:3px;height:14px;border-radius:2px;background:#1e88e5;
}
.adm-col-hd h4 small{font-weight:500;color:#8496a8;font-size:11.5px}
.adm-list{flex:1;overflow-y:auto;padding:10px;max-height:440px}

/* 账号搜索框 */
.adm-search{padding:0 10px 2px;background:#fff;position:sticky;top:51px;z-index:2}
.adm-search input{
  width:100%;height:34px;padding:0 12px;font-size:12.5px;
  border:1px solid #e3eaf2;border-radius:8px;background:#f7fafd;
  font-family:inherit;color:#1b2733;transition:.14s;
}
.adm-search input:focus{
  outline:0;background:#fff;border-color:#1e88e5;box-shadow:0 0 0 3px rgba(30,136,229,.12);
}
.adm-search input::-webkit-search-cancel-button{cursor:pointer}

/* 列表项 */
.adm-empty{text-align:center;color:#9aabbd;font-size:12.5px;padding:40px 10px;margin:0}
.adm-item{
  display:flex;align-items:center;gap:11px;padding:11px 12px;border-radius:10px;
  background:#fff;border:1px solid #e8eef5;margin-bottom:8px;transition:.15s;
}
.adm-item:hover{border-color:#b6d4f0;box-shadow:0 2px 8px rgba(30,136,229,.08);transform:translateY(-1px)}
.adm-item.off{opacity:.5;background:#fafbfc}
.adm-item:last-child{margin-bottom:0}

.ai-avatar{
  flex:0 0 36px;width:36px;height:36px;border-radius:10px;
  background:linear-gradient(135deg,#64b5f6,#1e88e5);color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-size:15px;font-weight:600;box-shadow:0 2px 6px rgba(30,136,229,.24);
}
.ai-main{flex:1 1 auto;min-width:0;overflow:hidden}
/* 标题行：inline-flex 让标签像文字一样内联排列。
   用 flex + wrap 会被 stretch 拉成竖条（多行布局的经典坑）。 */
.ai-t{
  font-size:13.5px;font-weight:600;color:#1b2733;
  display:inline-flex;align-items:center;gap:5px;
  line-height:18px;flex-wrap:nowrap;max-width:100%;
}
.ai-t .ai-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.ai-s{
  font-size:11.5px;color:#8496a8;margin-top:3px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
/* 状态标签
   坑：父级是 flex 容器时，子元素默认 align-self:stretch，
   高度会被拉成整行（表现为一条竖长色带）。
   解法三条一起上：align-self / height / max-height 全部锁死。 */
.ai-tag{
  font-size:10.5px;font-weight:600;padding:0 6px;
  border-radius:4px;background:#eef3f8;color:#5b7c9d;letter-spacing:.3px;
  display:inline-block!important;vertical-align:middle;
  flex:0 0 auto;align-self:center!important;
  height:17px!important;max-height:17px!important;min-height:17px;
  line-height:17px;white-space:nowrap;
  overflow:hidden;
}
.ai-tag.adm{background:#fff1e0;color:#e65100}
.ai-tag.off{background:#ffebee;color:#c62828}
.ai-tag.me{background:#e4f7e9;color:#2e7d32}
.ai-ops{display:flex;gap:5px;flex:0 0 auto}
.ai-btn{
  border:1px solid #d7e2ec;background:#fff;color:#5b7c9d;
  font-size:11.5px;padding:5px 10px;border-radius:7px;cursor:pointer;
  font-family:inherit;transition:.13s;white-space:nowrap;
}
.ai-btn:hover{background:#1e88e5;color:#fff;border-color:#1e88e5;box-shadow:0 2px 6px rgba(30,136,229,.22)}
.ai-btn[data-a="del"]:hover{background:#e53935;border-color:#e53935;box-shadow:0 2px 6px rgba(229,57,53,.22)}

/* 权限矩阵 —— 顶部信息区
   用独立的 pt-* 类名，避开 style.css 里 .f / .chk 的横排布局干扰 */
.perm-top{
  margin-bottom:14px;padding:14px 16px;
  background:#f7fafd;border-radius:10px;border:1px solid #e3eaf2;
}
.pt-row{display:grid;grid-template-columns:1fr 1.7fr;gap:14px;align-items:start}
.pt-f{display:block;min-width:0}
.pt-f>span{
  display:block;font-size:12px;color:#5b7c9d;font-weight:600;margin:0 0 5px;
}
.pt-f>input{
  display:block;width:100%;max-width:none;height:38px;padding:0 12px;font-size:13px;
  border:1px solid #d7e2ec;border-radius:8px;background:#fff;
  font-family:inherit;color:#1b2733;transition:.14s;
}
.pt-f>input:focus{
  outline:0;border-color:#1e88e5;box-shadow:0 0 0 3px rgba(30,136,229,.12);
}
.pt-all{
  display:flex;align-items:center;gap:8px;margin-top:12px;cursor:pointer;
  background:#fff;border:1px solid #dde6ef;border-radius:8px;
  padding:9px 12px;font-size:12.5px;color:#5b7c9d;user-select:none;transition:.14s;
}
.pt-all:hover{border-color:#1e88e5;color:#1e88e5}
.pt-all input{
  width:16px;height:16px;accent-color:#1e88e5;cursor:pointer;margin:0;flex:0 0 16px;
}

.perm-matrix{overflow-x:auto;border:1px solid #e3eaf2;border-radius:10px;background:#fff}
table.pm{width:100%;border-collapse:collapse;font-size:12.5px;min-width:560px}
table.pm th,table.pm td{border-bottom:1px solid #eef3f8;border-right:1px solid #f4f8fc;padding:0}
table.pm thead th{
  background:linear-gradient(180deg,#f5f9fd,#eef4fa);font-weight:600;color:#5b7c9d;
  padding:10px 4px;font-size:12px;position:sticky;top:0;z-index:1;
  border-bottom:1px solid #e3eaf2;
}
table.pm th:first-child,table.pm td:first-child{text-align:left;padding-left:14px}
table.pm tbody tr{transition:.1s}
table.pm tbody tr:hover{background:#f8fbfe}
table.pm tbody tr:last-child td{border-bottom:0}
table.pm th:last-child,table.pm td:last-child{border-right:0;background:#fafcfe}
table.pm td{text-align:center;padding:3px 0}
table.pm .pm-c1{font-weight:600;color:#1b2733;white-space:nowrap;font-size:13px}
table.pm td.pm-c1{line-height:44px}

.pm-chk{display:inline-flex;cursor:pointer;position:relative}
.pm-chk input{position:absolute;opacity:0;width:0;height:0}
.pm-chk i{
  width:20px;height:20px;border:1.5px solid #c8d6e3;border-radius:5px;background:#fff;
  display:block;transition:.14s;position:relative;
}
.pm-chk.sm i{width:17px;height:17px}
.pm-chk:hover i{border-color:#1e88e5;background:#f0f7ff}
.pm-chk.on i{background:linear-gradient(135deg,#42a5f5,#1e88e5);border-color:#1e88e5;box-shadow:0 1px 4px rgba(30,136,229,.3)}
.pm-chk.on i::after{
  content:'';position:absolute;left:7px;top:3px;width:5px;height:10px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);
}
.pm-chk.sm.on i::after{left:5.5px;top:2px;width:4px;height:8px}
.pm-chk input:disabled + i{opacity:.45;cursor:not-allowed}
.pm-chk input:focus-visible + i{box-shadow:0 0 0 3px rgba(30,136,229,.25)}

/* 权限预设快捷条 */
.perm-presets{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.preset-btn{
  font-size:11.5px;padding:4px 10px;border-radius:14px;cursor:pointer;
  border:1px solid #d7e2ec;background:#fff;color:#5b7c9d;transition:.13s;font-family:inherit;
}
.preset-btn:hover{border-color:#1e88e5;color:#1e88e5;background:#f0f7ff}

/* modal-bd 是 display:flex;flex-direction:column（style.css），
   子元素默认 flex-shrink:1 会被压缩并叠在一起导致点不到。
   这里统一 flex-shrink:0 + 显式块级布局。 */
#modalPerm .modal-bd{gap:0;display:block;flex:1 1 auto;min-height:0}
/* 兜底：任何祖先 flex 容器都不许压缩权限弹窗的内容块 */
#modalPerm .modal-bd>*{flex:0 0 auto;width:100%;min-width:0}
#modalPerm .perm-top{margin-bottom:14px}
#modalPerm .perm-matrix{margin-bottom:0}

.perm-sys{
  margin-top:16px;padding:14px 16px;background:#f7fafd;
  border-radius:10px;border:1px solid #e3eaf2;
}
.perm-sys-hd{font-size:12px;color:#5b7c9d;font-weight:600;margin-bottom:10px;display:flex;align-items:center;gap:6px}
.perm-sys-hd::before{content:'';width:3px;height:12px;border-radius:2px;background:#42a5f5}
.perm-sys-list{display:flex;flex-wrap:wrap;gap:9px}
.pm-sys{
  display:inline-flex;align-items:center;gap:8px;cursor:pointer;
  padding:8px 14px;border:1px solid #dde6ef;border-radius:8px;background:#fff;
  font-size:12.5px;transition:.14s;user-select:none;
}
.pm-sys:hover{border-color:#1e88e5;box-shadow:0 1px 6px rgba(30,136,229,.12)}
.pm-sys.on{background:linear-gradient(135deg,#e8f4fe,#dbeafe);border-color:#1e88e5;color:#1565c0;font-weight:600}
.pm-sys input{position:absolute;opacity:0;width:0;height:0}
.pm-sys i{
  width:16px;height:16px;border:1.5px solid #c8d6e3;border-radius:4px;
  background:#fff;position:relative;transition:.14s;flex:0 0 16px;
}
.pm-sys.on i{background:#1e88e5;border-color:#1e88e5}
.pm-sys.on i::after{
  content:'';position:absolute;left:5px;top:2px;width:4px;height:8px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);
}
.pm-sys input:focus-visible + i{box-shadow:0 0 0 3px rgba(30,136,229,.25)}

/* ---------- 权限矩阵 ---------- */
.perm-top{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
.perm-top .f{align-items:center}
.perm-top .f>span{width:76px;flex:0 0 76px;font-size:12.5px;color:var(--muted);font-weight:600}
.perm-top .f>input{flex:1}
.perm-top .chk{margin:0}

.perm-matrix{overflow-x:auto;border:1px solid var(--line2);border-radius:9px}
table.pm{width:100%;border-collapse:collapse;font-size:12.5px;min-width:520px}
table.pm th,table.pm td{border-bottom:1px solid var(--line2);border-right:1px solid #eef3f8;padding:0}
table.pm thead th{
  background:#f2f6fa;font-weight:600;color:#5b7c9d;padding:8px 4px;font-size:12px;
  position:sticky;top:0;z-index:1;
}
table.pm th:first-child,table.pm td:first-child{text-align:left;padding-left:12px}
table.pm .pm-c1{font-weight:600;color:var(--ink);white-space:nowrap}
table.pm tbody tr:last-child td{border-bottom:0}
table.pm th:last-child,table.pm td:last-child{border-right:0;background:#fafcfe}
table.pm td{text-align:center;padding:4px}

.pm-chk{display:inline-flex;cursor:pointer;position:relative}
.pm-chk input{position:absolute;opacity:0;width:0;height:0}
.pm-chk i{
  width:18px;height:18px;border:1.5px solid #c3d0dd;border-radius:4px;background:#fff;
  display:block;transition:.12s;position:relative;
}
.pm-chk.sm i{width:16px;height:16px}
.pm-chk:hover i{border-color:#1e88e5}
.pm-chk.on i{background:#1e88e5;border-color:#1e88e5}
.pm-chk.on i::after{
  content:'';position:absolute;left:5.5px;top:2px;width:4px;height:9px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);
}
.pm-chk.sm.on i::after{left:4.5px;top:1.5px;width:3.5px;height:8px}
.pm-chk input:disabled + i{opacity:.5}

.perm-sys{margin-top:16px;padding:12px;background:#f7fafd;border-radius:9px;border:1px solid var(--line2)}
.perm-sys-hd{font-size:12px;color:var(--muted);font-weight:600;margin-bottom:9px}
.perm-sys-list{display:flex;flex-wrap:wrap;gap:9px}
.pm-sys{
  display:inline-flex;align-items:center;gap:7px;cursor:pointer;
  padding:6px 12px;border:1px solid #d8e2ec;border-radius:7px;background:#fff;
  font-size:12.5px;transition:.12s;user-select:none;
}
.pm-sys:hover{border-color:#1e88e5}
.pm-sys.on{background:#e3f2fd;border-color:#1e88e5;color:#1565c0;font-weight:600}
.pm-sys input{position:absolute;opacity:0;width:0;height:0}
.pm-sys i{
  width:15px;height:15px;border:1.5px solid #c3d0dd;border-radius:3.5px;
  background:#fff;position:relative;transition:.12s;flex:0 0 15px;
}
.pm-sys.on i{background:#1e88e5;border-color:#1e88e5}
.pm-sys.on i::after{
  content:'';position:absolute;left:4.5px;top:1.5px;width:3.5px;height:8px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);
}

/* ---------- 当前用户 ---------- */
.sb-who{flex:1 1 auto;min-width:0;line-height:1.3}
.sb-who b{display:block;font-size:12.5px;color:#fff;font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sb-who span{display:block;font-size:10.5px;color:#8fa8c0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sb-avatar{
  flex:0 0 26px;width:26px;height:26px;border-radius:50%;
  background:linear-gradient(135deg,#42a5f5,#1e88e5);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;
}
.sb-logout{
  border:0;background:transparent;color:#8fa8c0;cursor:pointer;font-size:13px;
  padding:2px 5px;border-radius:4px;transition:.12s;font-family:inherit;flex:0 0 auto;
}
.sb-logout:hover{background:rgba(255,255,255,.14);color:#fff}


/* 侧栏当前用户条 */
.sb-user{
  display:flex;align-items:center;gap:9px;padding:9px 14px;
  background:rgba(0,0,0,.16);border-bottom:1px solid rgba(255,255,255,.07);
  cursor:pointer;transition:.13s;
}
.sb-user:hover{background:rgba(0,0,0,.26)}

/* 只读提示条 */
#readonlyTip{
  background:#fff8e1;color:#8d6e63;font-size:12px;padding:6px 16px;
  border-bottom:1px solid #ffe082;display:flex;align-items:center;gap:6px;
}

body.sb-collapsed .sb-user{padding:8px 6px;justify-content:center}
body.sb-collapsed .sb-who,body.sb-collapsed .sb-logout{display:none}

/* ============================================================
   手机端专属设计
   原则：拇指可达、层级清晰、一次只做一件事
   ============================================================ */

/* 手机端新增按钮：默认隐藏，仅窄屏媒体查询里开启。
   display:none 必须写在基础规则上 —— 若只写在媒体查询里，
   后面加载的基础规则会把它覆盖回 none。 */
#btnMobileAdd{
  display:none;align-items:center;justify-content:center;gap:5px;
  position:absolute;right:12px;top:50%;transform:translateY(-50%);
  height:44px;padding:0 18px;border:0;border-radius:22px;background:#f4511e;color:#fff;
  font-size:14.5px;font-weight:600;box-shadow:0 3px 12px rgba(244,81,30,.4);
  font-family:inherit;cursor:pointer;z-index:25;
}
#btnMobileAdd:active{transform:translateY(-50%) scale(.95)}

/* 顶部：标题 + 计数压缩，操作下沉到底部 */
@media (max-width:820px){
  .topbar{
    padding:9px 12px;gap:9px;position:sticky;top:0;z-index:20;
    background:linear-gradient(135deg,#1e88e5,#1565c0);border-bottom:0;
    box-shadow:0 2px 8px rgba(21,101,192,.22);
  }
  .topbar .tb-left h1{font-size:17px;color:#fff;letter-spacing:.3px}
  .topbar .tb-left .sub{color:rgba(255,255,255,.8);font-size:12px}
  .topbar .counter{background:rgba(255,255,255,.2);color:#fff;border-color:transparent}
  .menu-btn{color:#fff;background:rgba(255,255,255,.16);border-color:transparent}

  /* 顶栏新增按钮在手机端隐藏，改用底部悬浮按钮 */
  #btnAdd{display:none}
  #btnMobileAdd{display:flex}
}

/* ---------- 底部 Tab 栏 ---------- */
.mtab{
  display:none;position:fixed;left:0;right:0;bottom:0;z-index:40;
  background:rgba(255,255,255,.97);backdrop-filter:blur(12px);
  border-top:1px solid var(--line2);
  padding-bottom:env(safe-area-inset-bottom);
  box-shadow:0 -2px 12px rgba(20,45,80,.08);
}
.mtab-in{display:flex;align-items:stretch}
.mtab-btn{
  flex:1;min-width:0;height:54px;border:0;background:transparent;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  font-family:inherit;color:#8ba0b5;transition:.13s;position:relative;padding:0;
}
.mtab-btn i{font-size:19px;font-style:normal;line-height:1}
.mtab-btn b{font-size:10.5px;font-weight:600;letter-spacing:.2px}
.mtab-btn .bdg{
  position:absolute;top:6px;left:50%;margin-left:5px;
  min-width:15px;height:15px;padding:0 3px;border-radius:8px;background:#ef5350;
  color:#fff;font-size:9.5px;font-weight:700;line-height:15px;text-align:center;
}
.mtab-btn.active{color:#1e88e5}
.mtab-btn.active b{font-weight:700}
.mtab-btn:active{background:#f0f6fc}

/* ---------- 手机端卡片 ---------- */
@media (max-width:820px){
  .table-wrap{padding-bottom:64px}   /* 给固定状态栏 + 底部 Tab 让位 */
  .mcard-list{padding-bottom:4px}

  /* 筛选面板：改成从底部滑出的抽屉 */
  .toolbar{padding:0;background:transparent}
  .toolbar .foldbtn{
    width:100%;border-radius:0;padding:11px 12px;background:#fff;
    border-bottom:1px solid var(--line2);justify-content:center;
    font-size:13.5px;color:#5b7c9d;
  }
  /* 顶栏已含计数，筛选条不再重复占位 */
  .topbar+.toolbar{margin-top:0}
  .toolbar .filters{
    position:fixed;left:0;right:0;bottom:0;top:auto;z-index:120;
    background:#fff;border-radius:16px 16px 0 0;
    box-shadow:0 -6px 30px rgba(20,45,80,.2);
    padding:18px 16px calc(18px + env(safe-area-inset-bottom));
    max-height:78vh;overflow-y:auto;
    transform:translateY(100%);transition:transform .26s cubic-bezier(.4,0,.2,1);
    display:block;margin:0;border:0;
  }
  body.drawer-open .toolbar .filters{transform:translateY(0)}
  .toolbar .filters .f{display:flex;align-items:center;margin-bottom:12px}
  .toolbar .filters .f>span{flex:0 0 76px;font-size:13px}
  .toolbar .filters .f select,.toolbar .filters .f input{
    flex:1;height:44px;font-size:15px;   /* ≥44px 触摸目标 */
  }
  .toolbar .filters .btn{width:100%;height:46px;font-size:15px;margin-top:6px}
  .toolbar .filters .chk{margin:4px 0 10px;min-height:44px;align-items:center}

  /* 抽屉把手 */
  .toolbar .filters::before{
    content:'';display:block;width:38px;height:4px;border-radius:2px;
    background:#d5dee8;margin:-8px auto 14px;
  }
  body.drawer-open::after{
    content:'';position:fixed;inset:0;background:rgba(15,35,60,.42);z-index:110;
  }

  /* 操作按钮组：横向滚动条，不再换行占屏 */
  .actions{
    padding:8px 10px;gap:7px;flex-wrap:nowrap;overflow-x:auto;
    -webkit-overflow-scrolling:touch;scrollbar-width:none;
    background:#f4f8fc;border-bottom:1px solid var(--line2);
  }
  .actions::-webkit-scrollbar{display:none}
  .actions .act-group{flex-wrap:nowrap;gap:7px}
  .actions .btn{
    flex:0 0 auto;height:38px;padding:0 14px;font-size:13.5px;border-radius:19px;white-space:nowrap;
  }
  .actions .act-group.right{margin-left:auto}

  /* 卡片：加大留白与字号，明确主次 */
  .mcard{
    background:#fff;border-radius:12px;padding:13px 14px;margin:9px 10px;
    box-shadow:0 1px 4px rgba(20,45,80,.08);border:1px solid #eaf0f6;
    position:relative;transition:.12s;
  }
  .mcard:active{background:#f7fafd;transform:scale(.995)}
  .mc-top{display:flex;align-items:flex-start;gap:9px;margin-bottom:10px}
  .mc-plate{
    font-size:17px;font-weight:700;letter-spacing:.6px;flex:1;min-width:0;
    line-height:1.3;word-break:break-all;
  }
  .mc-chk{flex:0 0 44px;width:44px;height:44px;display:flex;align-items:center;justify-content:center;margin:-4px 0}
  .mc-chk input{width:20px;height:20px}
  .mc-tags{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:9px}
  .mc-tag{
    font-size:11.5px;padding:3px 8px;border-radius:5px;font-weight:600;
    display:inline-flex;align-items:center;gap:3px;
  }
  .mc-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px 12px}
  .mc-f{min-width:0}
  .mc-f>span{display:block;font-size:10.5px;color:var(--muted);margin-bottom:1px}
  .mc-f>b{font-size:13px;font-weight:600;display:block;line-height:1.35;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mc-ops{
    display:flex;gap:7px;margin-top:11px;padding-top:10px;border-top:1px solid #f0f4f8;
  }
  .mc-ops button{
    flex:1;min-height:44px;height:44px;border:1px solid var(--line2);background:#fff;color:#5b7c9d;
    font-size:13px;border-radius:8px;cursor:pointer;font-family:inherit;
    display:flex;align-items:center;justify-content:center;gap:4px;transition:.12s;
  }
  .mc-ops button:active{background:#f0f6fc}
  .mc-ops button.danger{color:#c62828;border-color:#ffcdd2}
  .mc-ops button.primary{background:#1e88e5;color:#fff;border-color:#1e88e5;font-weight:600}

  /* 状态栏上移，避开底部 Tab */
  .statusbar{
    position:fixed;left:0;right:0;bottom:calc(54px + env(safe-area-inset-bottom));
    z-index:39;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);
    font-size:11.5px;padding:5px 12px;border-top:1px solid var(--line2);
    display:flex;gap:10px;align-items:center;justify-content:space-between;
    white-space:nowrap;overflow:hidden;
  }
  .statusbar span{overflow:hidden;text-overflow:ellipsis;min-width:0}
  .statusbar #statLeft{flex:0 1 auto}
  .statusbar #statRight{flex:0 0 auto;font-size:11px;color:var(--muted)}

  /* 表格列表模式：行更高更好点 */
  table#grid tbody tr{height:52px}
  table#grid td{padding:9px 8px}

  /* 弹窗：底部全屏式，手指操作更顺 */
  .modal{padding:0;align-items:flex-end}
  .modal-box{
    width:100%;max-width:100%;max-height:92vh;border-radius:16px 16px 0 0;
    animation:slideUp .24s cubic-bezier(.4,0,.2,1);
  }
  @keyframes slideUp{from{transform:translateY(30px);opacity:.5}to{transform:translateY(0);opacity:1}}
  .modal-hd{padding:14px 16px}
  .modal-hd h3{font-size:16px}
  .modal-bd{padding:14px 16px}
  .modal-ft{
    padding:11px 14px calc(11px + env(safe-area-inset-bottom));gap:8px;
  }
  .modal-ft .btn{flex:1;height:46px;font-size:15px}
  .dt-lb{font-size:12px}
  .dt-vl input,.dt-vl select{height:46px;font-size:16px}   /* 16px 防止 iOS 自动放大 */
  .dt-vl .cell{height:46px!important;font-size:16px}
  .dt-plate .dt-vl>input.cell{font-size:17px!important;height:48px!important}

  /* 账号管理：手机端单列 */
  .adm{grid-template-columns:1fr;min-height:0}
  .adm-col{border-right:0;border-bottom:1px solid var(--line2)}
  .adm-col:last-child{border-bottom:0}
  .adm-list{max-height:none}
  .perm-top .f{flex-direction:column;align-items:stretch;gap:4px}
  .perm-top .f>span{width:auto;flex:none}

  /* 登录页：手机端去掉品牌区 */
  .login{padding:0;background:#fff}
  .login-card{flex-direction:column;max-width:100%;min-height:100vh;border-radius:0;box-shadow:none}
  .login-brand{display:none}
  .login-form{padding:36px 24px;justify-content:flex-start;padding-top:14vh}
  .lf-head h2{font-size:21px}
  .lf-field input{height:50px}
  .lf-btn{height:50px}
  /* 登录页独立滚动（body 默认 overflow:hidden） */
  .login{overflow-y:auto}

  /* 底部 Tab 显示 */
  .mtab{display:block}
  .app{padding-bottom:calc(54px + env(safe-area-inset-bottom))}
}

/* 大屏不显示移动悬浮按钮 */
@media (min-width:821px){
  #btnMobileAdd{display:none}
  .mtab{display:none!important}
}

/* 权限隐藏兜底：[hidden] 在部分 flex 容器里会被覆盖 */
.mtab-btn[hidden],.sb-item[hidden],[hidden]{display:none!important}

/* ============================================================
   UI 优化：编辑态下拉框与表格标签共用同一套淡色语言
   ============================================================ */
.dt-edit .dt-vl>select.cell[style*="--tag-bg"]{
  background-image:none;
  background-color:var(--tag-bg,#eef2f6);
  box-shadow:inset 0 0 0 999px rgba(255,255,255,.5);
  font-weight:500;color:#243447;
}
.dt-edit .dt-vl>select.cell{
  border-radius:8px;padding:0 10px;
  transition:box-shadow .15s,border-color .15s;
}
.dt-edit .dt-vl>select.cell:hover{box-shadow:inset 0 0 0 999px rgba(255,255,255,.35)}

/* ============================================================
   UI 优化：顶栏信息层级
   ============================================================ */
@media (min-width:821px){
  .topbar{padding:11px 20px;gap:14px}
  .topbar .tb-left h1{
    font-size:19px;font-weight:700;letter-spacing:.3px;color:#12263f;line-height:1.3;
  }
  /* 副标题紧跟标题，弱化 */
  .topbar .tb-left .sub{font-size:12px;color:var(--muted);margin-top:1px}
  /* 计数做成有视觉重量的胶囊 */
  .topbar .counter{
    background:linear-gradient(135deg,#1e88e5,#1565c0);color:#fff;border:none;
    padding:5px 13px;border-radius:15px;font-size:13px;font-weight:600;
    letter-spacing:.2px;box-shadow:0 2px 8px rgba(21,101,192,.26);
  }
  .topbar .btn.primary{
    background:linear-gradient(135deg,#ff7043,#f4511e);border:none;color:#fff;
    padding:0 18px;height:38px;border-radius:19px;font-weight:600;
    box-shadow:0 2px 10px rgba(244,81,30,.3);transition:.15s;
  }
  .topbar .btn.primary:hover{box-shadow:0 4px 14px rgba(244,81,30,.4);transform:translateY(-1px)}
  .topbar .btn.primary:active{transform:translateY(0)}
}

/* ============================================================
   UI 优化：筛选区网格对齐
   ============================================================ */
@media (min-width:821px){
  .toolbar{padding:11px 20px;background:#fff;border-bottom:1px solid var(--line2)}
  /* 筛选区：显式两行网格。
     auto-fit + minmax 会因容器宽度变化把字段挤到不可预期的位置，
     这里锁定列数，第一行筛选、第二行动作，行末自动留空。 */
  .toolbar .filters{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:9px 10px;align-items:center;
  }
  .toolbar .filters .f{margin:0;gap:8px}
  .toolbar .filters .f>span{
    font-size:12.5px;color:var(--muted);font-weight:600;flex:0 0 auto;
  }
  /* 字段分配：多选行占 2 列，搜索占 2 列，复选框与清空按钮靠右 */
  .toolbar .filters .f.grow{grid-column:span 2;min-width:0}
  #multiRow{grid-column:span 2}
  /* 第二行：复选框占3 列靠左，清空按钮只占 1 列贴右，不额外拉宽 */
  #filterStock .chk{grid-column:span 3;justify-self:start}
  #filterStock .btn{grid-column:span 2;justify-self:end;width:auto;padding:0 20px}
  .toolbar .filters .f select,
  .toolbar .filters .f input{
    height:34px;border-radius:8px;border:1px solid #d7e2ec;background:#fafcfe;
    padding:0 10px;font-size:13px;transition:.14s;
  }
  .toolbar .filters .f select:focus,
  .toolbar .filters .f input:focus{
    outline:0;border-color:var(--blue);background:#fff;
    box-shadow:0 0 0 3px rgba(30,136,229,.12);
  }
  .toolbar .filters .chk{margin:0;font-size:13px;white-space:nowrap}
  .toolbar .filters .btn{height:34px;border-radius:8px;padding:0 14px;font-size:13px}
  /* 总表筛选字段少，4 列更均衡 */
  #filterMaster{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px 10px;align-items:center}
  #filterMaster .f.grow{grid-column:span 1}
  #filterMaster .btn{grid-column:span 1}

  /* 折叠按钮与筛选内容对齐 */
  .toolbar .foldbtn{height:34px;padding:0 14px;border-radius:8px;font-size:13px}
}

/* ============================================================
   UI 优化：操作栏按钮层级
   ============================================================ */
@media (min-width:821px){
  .actions{
    padding:11px 20px;gap:8px;background:#FAFCFE;
    border-bottom:1px solid var(--line2);
  }
  .actions .act-group{gap:8px}
  .actions .btn{
    height:34px;padding:0 15px;border-radius:8px;font-size:13px;
    transition:.14s;border:1px solid #d7e2ec;background:#fff;color:#42576B;
  }
  .actions .btn:hover{border-color:var(--blue);color:var(--blue);background:#f5faff}
  .actions .btn:active{transform:translateY(1px)}
  /* 主操作加重 */
  .actions .act-group:first-child .btn:first-child{
    background:linear-gradient(135deg,#42a5f5,#1e88e5);color:#fff;border-color:transparent;
    font-weight:600;box-shadow:0 2px 8px rgba(30,136,229,.24);
  }
  .actions .act-group:first-child .btn:first-child:hover{
    box-shadow:0 4px 12px rgba(30,136,229,.34);color:#fff;background:linear-gradient(135deg,#1e88e5,#1565c0);
  }
  /* 危险操作加重警示 */
  #btnDelSelected,#btnMDel{color:#c62828}
  #btnDelSelected:hover,#btnMDel:hover{background:#fdecea;border-color:#ffcdd2;color:#b71c1c}
  /* 视图切换做成小分段控件 */
  .view-toggle{
    display:inline-flex;align-items:center;gap:5px;
    background:#EEF3F8!important;border:1px solid #d7e2ec!important;border-radius:8px!important;
    padding:0 4px!important;color:#5b7c9d!important;
  }
  .view-toggle.on{background:#dbeafe!important;border-color:#93c5fd!important;color:#1565c0!important}
}

/* ============================================================
   UI 优化：手机端卡片标签同样淡化
   手机卡片本身已有柔和底色，标签再叠一层饱和色会显得脏。
   ============================================================ */
@media (max-width:820px){
  .mc-tag{
    background:var(--tag-bg,#eef2f6);
    box-shadow:inset 0 0 0 999px rgba(255,255,255,.5);
    color:#26313d;font-weight:600;border-radius:6px;
    padding:3px 8px;font-size:11.5px;line-height:1.45;
  }
  /* 闲置天数这类"状态型"标签保留纯色底以示区别 */
  .mc-tag[style*="#E8F5E9"],.mc-tag[style*="#FFE0B2"],.mc-tag[style*="#FFCDD2"]{
    box-shadow:none;color:#37474f;
  }
}

/* ============================================================
   UI 优化：手机端详情必须回到单列
   桌面用了 grid-template-columns:1fr 1fr，媒体查询里只改了
   flex-direction 是不够的 —— grid 的列定义依然生效。
   ============================================================ */
@media (max-width:820px){
  #rowBody .dt-grid{
    display:flex!important;flex-direction:column!important;gap:0;
    grid-template-columns:none;   /* 回到 flex 后清掉残留的列定义 */
  }
  #rowBody .dt-row{
    flex-direction:row!important;align-items:flex-start;gap:10px;
    padding:11px 16px;border-bottom:1px solid #f2f5f8;
  }
  #rowBody .dt-grid .dt-row:nth-child(odd){background:transparent}
  #rowBody .dt-lb{flex:0 0 76px;min-width:76px;font-size:12.5px}
  #rowBody .dt-vl{flex:1 1 auto;font-size:14px}
  /* 车牌行：手机端标签在上、值在下，更符合单手阅读 */
  #rowBody .dt-row.dt-plate{
    flex-direction:column!important;align-items:flex-start;gap:2px;
    padding:14px 16px 12px;background:linear-gradient(180deg,#F4F8FC,#FBFCFE);
    border-bottom:1px solid #E3EBF2;
  }
  #rowBody .dt-row.dt-plate .dt-lb{flex:none;font-size:12px}
  #rowBody .dt-row.dt-plate .dt-vl{font-size:19px;font-weight:800;letter-spacing:.8px}
}

/* ============================================================
   线性图标：统一 20×20 视框、1.6 描边、currentColor 跟随主题
   ============================================================ */
.sb-item .ic,
.mtab-btn i,
.mtab-btn i svg{display:inline-flex;align-items:center;justify-content:center}
.sb-item .ic svg{width:17px;height:17px;display:block}
.sb-item:hover .ic svg,.sb-item.active .ic svg{stroke-width:1.8}

/* 手机端 Tab 图标 */
.mtab-btn i svg{width:21px;height:21px;display:block}
.mtab-btn.active i svg{stroke-width:1.9}
.mtab-btn i{font-style:normal;line-height:1}

/* 工具栏按钮里的线性图标 */
.btn svg,.dlg-btn svg{
  width:15px;height:15px;display:inline-block;
  vertical-align:-2px;margin-right:3px;flex:0 0 15px;
}
.btn.primary svg,.btn.accent svg{stroke:#fff}

/* 弹窗底部按钮（生成并下载 / 导出）图标 */
.modal-ft .btn svg{width:15px;height:15px;vertical-align:-2px;margin-right:4px}

/* 侧栏 Logo 用 emoji 时也保持视觉平衡 */
.sb-logo{font-size:19px;line-height:1;display:flex;align-items:center;justify-content:center}
.sb-logo.has-img img{width:22px;height:22px;object-fit:cover;border-radius:5px;display:block}

/* 菜单折叠态（只有图标）时确保居中 */
body.sb-collapsed .sb-item .ic svg{width:18px;height:18px}

/* 行内 / 卡片操作按钮里的线性图标 */
.c-ops button svg,.mc-ops button svg{
  width:14px;height:14px;display:inline-block;vertical-align:-2px;margin-right:2px;
}
.c-ops button.del svg{stroke:#c62828}
.mc-ops button.danger svg{stroke:#c62828}
.mc-ops button.primary svg{stroke:#fff}
/* 桌面端图标按钮（只有图标没有文字）时稍微放大一点 */
.c-ops button svg:only-child{width:15px;height:15px;margin:0}
