/* =========================================================================
   kopsoft WMS — 现代简洁风格样式 (Modern Minimal UI)
   与 app.js / table.js 的真实 class 对齐
   ========================================================================= */
:root {
  /* 中性色 */
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #ededf0;
  --border-strong: #e2e5ea;
  --text: #1f2733;
  --text-2: #5b6675;
  --text-3: #97a0b0;

  /* 品牌色 */
  --primary: #3b82f6;
  --primary-600: #2563eb;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --success: #10b981;
  --success-600: #0a8a52;
  --danger: #ef4444;
  --danger-600: #d12d2d;
  --warning: #f59e0b;
  --warning-600: #c2690f;

  /* 圆角 / 阴影 */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 6px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .14);

  --sidebar-w: 232px;
  --header-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
/* 模板中 body 直接包含 #sidebarMask / .sidebar / .main，因此由 body 承担横向布局 */
html, body { min-height: 100%; }
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6dbe2; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c3c9d3; }

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
/* 侧边栏品牌区：<span>产品名<small>副标题</small></span> */
.brand {
  height: var(--header-h);
  display: flex; align-items: center; padding: 0 20px;
  font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: .3px;
  border-bottom: 1px solid var(--border);
}
.brand span { display: inline-flex; align-items: baseline; gap: 8px; }
.brand small { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }

.nav { flex: 1; overflow-y: auto; padding: 12px; }

/* 大板块（可折叠） */
.nav-sec { margin-bottom: 6px; }
.nav-group {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 10px 11px 12px; margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: background .15s, color .15s;
}
.nav-group:hover { background: var(--surface-2); color: var(--primary-600); }
.nav-group .arrow {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px;
  border-radius: 6px; color: var(--text-3);
  transition: background .15s, color .15s;
}
.nav-group .arrow::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.nav-group:hover .arrow { background: var(--primary-100); color: var(--primary-600); }
.nav-sec.collapsed .nav-group .arrow::before { transform: rotate(-45deg); }
.nav-items { overflow: hidden; }
.nav-sec.collapsed .nav-items { display: none; }
.nav-group:focus-visible { outline: 2px solid var(--primary-100); outline-offset: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav a .ico { width: 18px; text-align: center; font-size: 15px; opacity: .85; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.nav a.active .ico { opacity: 1; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 16px; font-weight: 600; color: var(--text); }
.topbar .spacer { flex: 1; }
.hamburger {
  display: none; background: transparent; border: none; cursor: pointer;
  font-size: 20px; color: var(--text-2); line-height: 1;
}
.user-menu { position: relative; }
.user-menu .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; cursor: pointer; user-select: none;
}
.dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  min-width: 160px; padding: 6px; z-index: 30; display: none;
}
.dropdown.show { display: block; animation: pop .14s ease; }
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: none;
  background: transparent; border-radius: 6px; color: var(--text-2); font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--text); }

.content { padding: 24px; }
.content.fade-in { animation: fade .25s ease; }

/* ===================== 卡片 / 工具栏 ===================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
}
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.toolbar input[type="text"], .toolbar input[type="date"], .toolbar select { height: 36px; }

/* ===================== 表单控件 ===================== */
input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; padding: 9px 12px; font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
textarea { resize: vertical; min-height: 70px; line-height: 1.6; }
::placeholder { color: var(--text-3); }

/* ===================== 按钮 ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; font-size: 14px; font-family: inherit; font-weight: 500;
  color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: #d4d9e0; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 1px 2px rgba(59,130,246,.35); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-success { color: #fff; background: var(--success); border-color: var(--success); box-shadow: 0 1px 2px rgba(16,185,129,.35); }
.btn-success:hover { background: var(--success-600); }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); box-shadow: 0 1px 2px rgba(239,68,68,.35); }
.btn-danger:hover { background: var(--danger-600); }
.btn-cancel { color: var(--text-2); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ===================== 表格 (table.js → .tbl) ===================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.tbl thead th {
  position: sticky; top: 0; background: var(--surface-2); color: var(--text-2);
  font-weight: 600; text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--primary-50); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.empty, table.tbl .empty { text-align: center; color: var(--text-3); padding: 44px 0; }

/* 分页 (table.js → .pager) */
.pager { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.pager .info { color: var(--text-3); font-size: 13px; }
.pager .page-no { color: var(--text-2); font-size: 13px; }
.pager .spacer { flex: 1; }
.pager button {
  min-width: 34px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); font-size: 13px; transition: all .15s;
}
.pager button:hover { border-color: var(--primary); color: var(--primary-600); }

/* ===================== 徽章 ===================== */
.badge { display: inline-block; padding: 3px 11px; font-size: 12px; font-weight: 600; border-radius: 999px; line-height: 1.5; }
.badge-gray   { background: #f1f3f5; color: #5b6675; }
.badge-green  { background: #e7f7ef; color: var(--success-600); }
.badge-red    { background: #fdecec; color: var(--danger-600); }
.badge-blue   { background: var(--primary-50); color: var(--primary-600); }
.badge-orange { background: #fff3e6; color: var(--warning-600); }

/* ===================== 表单网格（弹窗内） ===================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.form-grid .req { color: var(--danger); }

/* ===================== 弹窗 (app.js → .modal-mask / .modal-box) ===================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal-mask.show { display: flex; animation: fade .15s ease; }
.modal-mask.closing { animation: fadeOut .18s ease forwards; }
.modal-box {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 640px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column;
  animation: pop .18s cubic-bezier(.2, .8, .3, 1);
}
.modal-box.closing { animation: popOut .18s ease forwards; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 16px; font-weight: 600; color: var(--text); }
.modal-head .close {
  width: 30px; height: 30px; border: none; background: transparent; font-size: 22px; line-height: 1;
  color: var(--text-3); cursor: pointer; border-radius: 8px; transition: background .15s, color .15s;
}
.modal-head .close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* 确认框（如后续启用自定义 confirm，保留样式，当前 confirm 走原生） */
.confirm-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 400px; max-width: 100%; padding: 24px; animation: pop .18s cubic-bezier(.2,.8,.3,1); }
.confirm-box .c-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.confirm-box .c-title .q { color: var(--warning); font-size: 20px; }
.confirm-box .c-msg { color: var(--text-2); font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.confirm-box .c-foot { display: flex; justify-content: flex-end; gap: 10px; }

/* ===================== Toast (app.js → .toast-wrap / .toast) ===================== */
.toast-wrap { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--radius-sm);
  background: #1f2733; color: #fff; font-size: 14px; box-shadow: var(--shadow-md); animation: toastIn .25s ease;
}
.toast.toast-success { background: var(--success-600); }
.toast.toast-error { background: var(--danger-600); }
.toast.toast-info { background: #334155; }

/* ===================== 登录页 ===================== */
.login-page {
  /* body 是 flex 容器，登录/错误页作为唯一子项需撑满宽度，否则会收缩到卡片宽度而靠左 */
  flex: 1;
  width: 100%;
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  position: relative; overflow: hidden;
  /* 现代渐变背景：品牌蓝 → 靛蓝柔和过渡 */
  background: linear-gradient(135deg, #eef4ff 0%, #e8efff 35%, #eef2ff 65%, #f2f7ff 100%);
}
/* 漂浮光斑装饰（大圆 + 高斯模糊，缓慢游动） */
.login-page::before, .login-page::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: .6; pointer-events: none;
  animation: loginFloat 16s ease-in-out infinite alternate;
}
.login-page::before { width: 520px; height: 520px; background: #93c5fd; top: -140px; right: -120px; }
.login-page::after { width: 460px; height: 460px; background: #a5b4fc; bottom: -150px; left: -120px; animation-delay: -8s; }
@keyframes loginFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(50px, 36px) scale(1.1); }
}

/* ---------- 仓储场景：货架剪影 + PDA 扫码 + 格网 + 货位标签 ---------- */

/* ===== 上半部分：悬挂库位指示牌 + 扫描波纹 ===== */
/* 悬挂横杆（顶部通道吊牌架） */
.login-hanger {
  position: absolute; top: 4%; left: 50%; transform: translateX(-50%);
  width: min(760px, 92%); pointer-events: none; z-index: 0;
}
.login-hanger .rod { height: 3px; border-radius: 2px; background: rgba(100, 116, 139, .35); }
/* 吊牌容器 */
.login-hanger .signs { display: flex; justify-content: space-around; margin-top: 0; }
.login-sign {
  position: relative; transform-origin: top center;
  animation: signSwing 5s ease-in-out infinite;
}
.login-sign:nth-child(1) { animation-delay: 0s; }
.login-sign:nth-child(2) { animation-delay: -1.2s; }
.login-sign:nth-child(3) { animation-delay: -2.4s; }
.login-sign:nth-child(4) { animation-delay: -3.6s; }
/* 悬挂线 */
.login-sign::before {
  content: ""; display: block; width: 1.5px; height: 22px; margin: 0 auto;
  background: rgba(100, 116, 139, .4);
}
/* 牌体：带颜色的库位标识 */
.login-sign .plate {
  display: flex; align-items: center; justify-content: center;
  min-width: 64px; height: 40px; padding: 0 12px; border-radius: 9px;
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 1px;
  box-shadow: 0 8px 16px -6px rgba(30, 41, 59, .28);
}
.login-sign .zone { font-size: 9px; font-weight: 600; opacity: .85; margin-top: 2px; letter-spacing: .5px; }
.login-sign.s1 .plate { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.login-sign.s2 .plate { background: linear-gradient(135deg, #10b981, #059669); }
.login-sign.s3 .plate { background: linear-gradient(135deg, #f59e0b, #d97706); }
.login-sign.s4 .plate { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
@keyframes signSwing {
  0%, 100% { transform: rotate(-3.2deg); }
  50% { transform: rotate(3.2deg); }
}

/* 扫描波纹：从顶部向四周扩散的脉冲环，呼应扫码动作 */
.login-pulse {
  position: absolute; pointer-events: none; z-index: 0;
}
.login-pulse i {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; border: 2px solid rgba(59, 130, 246, .5);
  animation: pulseWave 4.5s ease-out infinite;
}
.login-pulse i:nth-child(2) { animation-delay: 1.5s; }
.login-pulse i:nth-child(3) { animation-delay: 3s; }
.login-pulse.p1 { top: 12%; left: 16%; }
.login-pulse.p2 { top: 18%; right: 14%; }
.login-pulse.p2 i { border-color: rgba(139, 92, 246, .45); animation-duration: 5.5s; }
@keyframes pulseWave {
  0% { width: 8px; height: 8px; opacity: .9; }
  100% { width: 130px; height: 130px; opacity: 0; }
}

/* 库位格网：细线方格模拟库区平面图，中心淡四周略深 */
.login-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(59, 130, 246, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, .07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, transparent 18%, #000 85%);
  mask-image: radial-gradient(circle at 50% 46%, transparent 18%, #000 85%);
}
/* 地面渐隐：货架下方加深，增强“仓库地面”纵深感 */
.login-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 240px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(100, 116, 139, .14));
}
/* 底部货架剪影（深蓝灰，半透明，贴地） */
.login-shelf {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(1040px, 96%); pointer-events: none;
  opacity: .55;
}
.login-shelf svg { display: block; width: 100%; height: auto; }
/* 货架上的货箱：错落轻微摆动（沿用顶部 signSwing 关键帧，各箱错相） */
.login-shelf .box {
  transform-box: fill-box; transform-origin: bottom center;
  animation: signSwing 5.5s ease-in-out infinite;
}
.login-shelf .box:nth-of-type(4) { animation-delay: 0s; animation-duration: 5s; }
.login-shelf .box:nth-of-type(5) { animation-delay: -1.3s; animation-duration: 5.6s; }
.login-shelf .box:nth-of-type(6) { animation-delay: -2.1s; animation-duration: 4.7s; }
.login-shelf .box:nth-of-type(7) { animation-delay: -2.9s; animation-duration: 5.9s; }
.login-shelf .box:nth-of-type(8) { animation-delay: -3.7s; animation-duration: 5.2s; }
.login-shelf .box:nth-of-type(9) { animation-delay: -1.8s; animation-duration: 5.4s; }
.login-shelf .box:nth-of-type(10) { animation-delay: -2.6s; animation-duration: 4.9s; }
.login-shelf .box:nth-of-type(11) { animation-delay: -0.7s; animation-duration: 5.7s; }
.login-shelf .box:nth-of-type(12) { animation-delay: -3.3s; animation-duration: 5.1s; }
.login-shelf .box:nth-of-type(13) { animation-delay: -2.3s; animation-duration: 5.5s; }
.login-shelf .box:nth-of-type(14) { animation-delay: -1.5s; animation-duration: 4.8s; }
.login-shelf .box:nth-of-type(15) { animation-delay: -3.9s; animation-duration: 5.8s; }
.login-shelf .box:nth-of-type(16) { animation-delay: -0.4s; animation-duration: 5.3s; }
.login-shelf .box:nth-of-type(17) { animation-delay: -2.7s; animation-duration: 5s; }
.login-shelf .box:nth-of-type(18) { animation-delay: -3.1s; animation-duration: 5.6s; }
.login-shelf .box:nth-of-type(19) { animation-delay: -1.1s; animation-duration: 4.9s; }
.login-shelf .box:nth-of-type(20) { animation-delay: -2.5s; animation-duration: 5.4s; }
/* 手持 PDA（左下，悬浮 + 轻微摇摆，与顶部呼应） */
.login-pda {
  position: absolute; left: 6%; bottom: 12%; width: 120px; pointer-events: none;
  filter: drop-shadow(0 16px 20px rgba(30, 41, 59, .28));
  transform-origin: top center;
  animation: pdaFloat 7s ease-in-out infinite alternate, signSwing 6s ease-in-out infinite;
}
/* PDA 激光：红光束，循环发射 */
.login-pda .laser {
  position: absolute; left: 100%; top: 12px; height: 4px; width: 0;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0), rgba(239, 68, 68, .9));
  border-radius: 2px; transform: rotate(-16deg); transform-origin: left center;
  animation: pdaLaser 2.8s ease-in-out infinite;
}
/* 被扫的条码贴（PDA 右上方）：常驻轻摆，激光命中瞬间闪点 */
.login-scan-tag {
  position: absolute; left: 30%; bottom: 20%; pointer-events: none;
  padding: 7px 10px 5px; border-radius: 6px; background: #fff;
  border: 1px solid rgba(148, 163, 184, .4); box-shadow: 0 6px 14px -4px rgba(30,41,59,.2);
  transform-origin: top center;
  animation: signSwing 4.6s ease-in-out infinite;
  animation-delay: -1.5s;
}
.login-scan-tag .bars { display: flex; align-items: flex-end; gap: 1.5px; height: 18px; }
.login-scan-tag .bars i { display: block; width: 2px; height: 100%; background: #1f2937; border-radius: 1px; }
.login-scan-tag .bars i:nth-child(2n) { width: 3px; }
.login-scan-tag .bars i:nth-child(3n) { height: 70%; }
.login-scan-tag .bars i:nth-child(5n) { width: 1px; }
/* 激光命中时的闪点 */
.login-scan-tag::after {
  content: ""; position: absolute; right: -4px; top: -4px; width: 10px; height: 10px;
  border-radius: 50%; background: #ef4444; opacity: 0; box-shadow: 0 0 10px 3px rgba(239,68,68,.6);
  animation: scanBlink 2.8s ease-in-out infinite;
}
/* 货位标签（右下，贴地面）：轻微摇摆 */
.login-barcode {
  position: absolute; right: 5%; bottom: 7%; z-index: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 13px 7px; border-radius: 8px;
  background: rgba(255, 255, 255, .82); border: 1px solid rgba(148, 163, 184, .35);
  box-shadow: 0 8px 18px -8px rgba(30, 41, 59, .25);
  transform-origin: top center;
  animation: signSwing 5.8s ease-in-out infinite;
  animation-delay: -2.2s;
}
.login-barcode .bars { display: flex; align-items: flex-end; gap: 2px; height: 24px; }
.login-barcode .bars i { display: block; width: 2px; height: 100%; background: #334155; border-radius: 1px; }
.login-barcode .bars i:nth-child(2n) { width: 4px; }
.login-barcode .bars i:nth-child(3n) { height: 72%; }
.login-barcode .bars i:nth-child(5n) { width: 1px; }
.login-barcode .bars i:nth-child(7n) { width: 5px; }
.login-barcode .no { font-size: 10px; letter-spacing: 2px; color: #64748b; font-family: "Consolas", monospace; }

@keyframes pdaFloat {
  from { transform: translateY(-8px) rotate(-2deg); }
  to { transform: translateY(8px) rotate(1.5deg); }
}
@keyframes pdaLaser {
  0%, 62%, 100% { width: 0; opacity: 0; }
  66% { width: 0; opacity: 1; }
  84% { width: 190px; opacity: 1; }
  96% { width: 190px; opacity: 0; }
}
@keyframes scanBlink {
  0%, 80%, 100% { opacity: 0; }
  86%, 94% { opacity: 1; }
}

/* 入场动画：淡入 + 上移 */
@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
.login-card {
  position: relative; z-index: 1;
  width: 400px; max-width: 100%;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 20px;
  box-shadow: 0 24px 60px -18px rgba(37, 99, 235, .25), var(--shadow-lg);
  padding: 40px 34px 30px;
  animation: loginFadeUp .6s cubic-bezier(.22, 1, .36, 1) both;
}
/* 品牌图标（居中） */
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px -8px rgba(59, 130, 246, .55);
  animation: loginFadeUp .6s .05s cubic-bezier(.22, 1, .36, 1) both;
}
.login-card h1 { font-size: 24px; margin: 0; font-weight: 800; letter-spacing: .5px; text-align: center; }
.login-card .sub { color: var(--text-3); font-size: 13px; margin: 6px 0 26px; text-align: center; }
/* 表单元素错落入场 */
.login-card .field:nth-of-type(1) { animation: loginFadeUp .5s .12s cubic-bezier(.22, 1, .36, 1) both; }
.login-card .field:nth-of-type(2) { animation: loginFadeUp .5s .2s cubic-bezier(.22, 1, .36, 1) both; }
.login-card #loginErr { animation: loginFadeUp .5s .26s cubic-bezier(.22, 1, .36, 1) both; }
.login-card #btnLogin { animation: loginFadeUp .5s .3s cubic-bezier(.22, 1, .36, 1) both; }
.login-card .tip { animation: loginFadeUp .5s .4s cubic-bezier(.22, 1, .36, 1) both; }
.login-card .field { margin-bottom: 18px; }
.login-card .field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.login-card .field .input-line { position: relative; }
.login-card .field .input-line .lead { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.login-card .field input { height: 44px; font-size: 14px; }
.login-card .field .input-line input { padding-left: 38px; }

/* 行内错误提示条（隐藏时完全不占位，展开时动画入场） */
.login-card .login-err {
  display: none;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca;
}
.login-card .login-err.show {
  display: block; margin-bottom: 12px;
  animation: loginFadeUp .3s cubic-bezier(.22, 1, .36, 1) both;
}

/* 登录按钮 + loading 转圈 */
.login-card .btn-block, .login-card #btnLogin {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; margin-top: 8px; font-size: 15px;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.login-card #btnLogin:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(59, 130, 246, .5); }
.login-card #btnLogin:active { transform: translateY(0); }
.login-card #btnLogin.loading { filter: saturate(.7); pointer-events: none; }
#btnLogin .spinner {
  display: none; width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  animation: loginSpin .7s linear infinite;
}
#btnLogin.loading .spinner { display: inline-block; }
@keyframes loginSpin { to { transform: rotate(360deg); } }

.login-card .tip { margin-top: 18px; font-size: 12px; color: var(--text-3); text-align: center; }

/* 弱化动效偏好：全部关闭动画 */
@media (prefers-reduced-motion: reduce) {
  .login-page::before, .login-page::after,
  .login-card, .login-card *, .login-pda, .login-pda .laser, .login-scan-tag::after,
  .login-sign, .login-pulse i, .login-shelf .box, .login-scan-tag, .login-barcode { animation: none !important; }
}

/* ===================== 首页 / 卡片头 ===================== */
.card-head { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.card-body { color: var(--text-2); }

/* home 统计网格（模板真实 class） */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px; transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .label { font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; }

/* 备用：dash-grid / panel-title / hot-list（自定义仪表盘用） */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .dash-grid { grid-template-columns: 1fr; } }
.panel-title { font-size: 15px; font-weight: 600; margin: 0 0 14px; color: var(--text); }
.hot-list { list-style: none; margin: 0; padding: 0; }
.hot-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.hot-list li:last-child { border-bottom: none; }
.hot-list .muted { color: var(--text-3); }

/* 信息展示网格（如 user/info） */
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px; }
.info-grid .row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-grid .row .k { color: var(--text-3); min-width: 84px; }
.info-grid .row .v { color: var(--text); font-weight: 500; }

/* ===================== 错误页 ===================== */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.error-page .code { font-size: 72px; font-weight: 800; color: var(--primary); }
.error-page .msg { color: var(--text-2); margin: 8px 0 20px; }

/* ===================== 移动端侧栏 ===================== */
.sidebar-mask { display: none; position: fixed; inset: 0; background: rgba(17,24,39,.4); z-index: 40; }
.sidebar-mask.show { display: block; }
@media (max-width: 992px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.show { transform: none; }
  .hamburger { display: inline-flex; }
  .content { padding: 16px; }
  .form-grid, .info-grid, .stat-grid { grid-template-columns: 1fr; }
}
#btnMenu { display: none; margin-right: 14px; cursor: pointer; font-size: 20px; color: var(--text-2); }

/* ===================== 动画 ===================== */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
