* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6fb;
  color: #1f2430;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: #1f2a44;
  color: #fff;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.topbar nav a {
  color: #c7d0e6;
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
}
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.14); color: #fff; }

.container { max-width: 960px; margin: 0 auto; padding: 22px; }
.sub { color: #6b7280; font-size: 14px; margin: 4px 0 18px; }

.calib-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.btn-calib {
  background: #1f2a44; color: #fff; border: none;
  padding: 9px 16px; border-radius: 9px; font-size: 13px; cursor: pointer;
}
.btn-calib:disabled { opacity: .6; cursor: default; }
.calib-hint { font-size: 13px; color: #6b7280; }
.calib-hint.ok { color: #16a34a; }
.calib-hint.err { color: #dc2626; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.empty { color: #888; padding: 30px 0; }
.empty a { color: #2f6df6; }

.emp-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(20,30,60,.08);
  transition: transform .12s ease, box-shadow .12s ease;
  user-select: none;
}
.emp-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(20,30,60,.16); }
.emp-avatar {
  width: 52px; height: 52px; line-height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg,#3b82f6,#1f2a44);
  color: #fff; font-size: 22px; font-weight: 700;
  margin: 0 auto 10px;
}
.emp-name { font-size: 17px; font-weight: 700; }
.emp-meta { font-size: 12px; color: #9aa3b2; margin-top: 6px; }

/* 弹窗 */
.mask {
  position: fixed; inset: 0;
  background: rgba(10,14,25,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
/* 关键：hidden 属性必须能隐藏弹窗（否则 .mask 的 display:flex 会盖掉默认 [hidden]{display:none}，导致页面一打开就显示预览且关不掉） */
.mask[hidden] { display: none; }
.modal {
  position: relative;
  background: #2a2f3a;
  border-radius: 16px;
  padding: 22px 22px 18px;
  width: 300px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: #cfd6e4;
  font-size: 24px; cursor: pointer; line-height: 1;
}
.modal-title { color: #fff; font-size: 15px; margin: 0 0 12px; text-align: center; font-weight: 600; }

.label-preview {
  width: 220px;
  margin: 6px auto 14px;
  background: #fff;
  color: #111;
  border-radius: 10px;
  padding: 16px 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.lp-qr { width: 200px; margin: 4px auto 12px; }
.lp-qr img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.lp-logo { width: 64px; height: auto; margin: 2px auto 10px; }
.lp-qr-empty { color: #c0392b; font-size: 13px; text-align: center; padding: 30px 0; }
.lp-emp-name { font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 10px; letter-spacing: 1px; }
.lp-tip { font-size: 14px; text-align: center; color: #333; }

.modal-actions { display: flex; justify-content: center; }
.btn-print {
  background: #3b82f6; color: #fff; border: none;
  padding: 11px 26px; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-print:disabled { opacity: .6; cursor: default; }
.modal-hint { color: #cfd6e4; font-size: 13px; text-align: center; margin: 12px 0 0; min-height: 18px; }
.modal-hint.ok { color: #4ade80; }
.modal-hint.err { color: #f87171; }
