/* ============================================================
   薪酬结算管理系统 - 基础样式（无外部依赖，可离线使用）
   ============================================================ */
:root {
  --c-primary: #2f6feb;
  --c-primary-dark: #1f56c4;
  --c-primary-soft: #eef3fe;
  --c-bg: #f5f6f8;
  --c-panel: #ffffff;
  --c-border: #e5e7eb;
  --c-border-strong: #d3d7de;
  --c-text: #1f2329;
  --c-text-2: #5b6472;
  --c-text-3: #8a93a2;
  --c-success: #16a34a;
  --c-success-soft: #e8f7ee;
  --c-danger: #dc2626;
  --c-danger-soft: #fdecec;
  --c-warning: #d97706;
  --c-warning-soft: #fef4e6;
  --c-info: #0891b2;
  --c-info-soft: #e6f6fa;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 4px 16px rgba(16, 24, 40, .08);
  --sidebar-w: 216px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--c-border);
}
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f6feb, #5b8df5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex: 0 0 32px;
}
.brand-text { font-size: 14px; font-weight: 600; line-height: 1.3; }
.brand-text small { display: block; color: var(--c-text-3); font-weight: 400; font-size: 11px; }

/* 自定义站点 LOGO：上传后替换默认色块文字 */
.logo-img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: inherit; }
.brand-logo.has-img, .login-logo.has-img { background: transparent; padding: 0; overflow: hidden; }
.brand-logo.has-img { border-radius: 8px; }
.login-logo.has-img { border-radius: 11px; }
.slip-logo { display: inline-flex; width: 22px; height: 22px; border-radius: 5px; background: #fff;
  overflow: hidden; vertical-align: -5px; margin-right: 6px; }
.slip-logo-img { width: 100%; height: 100%; object-fit: contain; display: block; }

.nav { padding: 10px 8px 24px; flex: 1; }
.nav-group { margin-bottom: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--c-text-2);
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.nav-item:hover { background: #f3f5f9; color: var(--c-text); }
.nav-item.active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }
.nav-item .ico { width: 16px; height: 16px; flex: 0 0 16px; opacity: .85; }
.nav-item .arrow { margin-left: auto; font-size: 10px; color: var(--c-text-3); transition: transform .18s; }
.nav-group.open > .nav-item .arrow { transform: rotate(90deg); }
.nav-sub { display: none; padding: 2px 0 4px 0; }
.nav-group.open > .nav-sub { display: block; }
.nav-sub .nav-item { padding-left: 35px; font-size: 13px; }
.nav-sub .nav-item::before {
  content: ''; position: absolute; left: 21px; top: 50%;
  width: 4px; height: 4px; border-radius: 50%; background: #c3c9d4; transform: translateY(-50%);
}
.nav-sub .nav-item.active::before { background: var(--c-primary); }

.sidebar-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-text-3);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---- 全站页脚（版权 / 备案）---- */
.app-foot {
  padding: 16px 18px 20px; text-align: center;
  font-size: 12px; line-height: 1.95; color: var(--c-text-3);
  border-top: 1px solid var(--c-border);
  background: var(--c-panel);
}
.app-foot-row + .app-foot-row { margin-top: 2px; }
.app-foot a { color: var(--c-text-2); text-decoration: none; }
.app-foot a:hover { color: var(--c-primary); text-decoration: underline; }
.app-foot img { max-height: 18px; vertical-align: middle; }

/* ---- 返回顶部 ---- */
.back-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 80;
  width: 42px; height: 42px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  border: 1px solid var(--c-border); background: var(--c-panel); color: var(--c-text-2);
  font-size: 17px; line-height: 1; cursor: pointer;
  box-shadow: 0 8px 22px rgba(16, 32, 60, .16);
  transition: color .16s, border-color .16s, transform .16s, opacity .16s;
}
.back-top.show { display: flex; }
.back-top:hover { color: var(--c-primary); border-color: var(--c-primary); transform: translateY(-2px); }
.back-top:active { transform: translateY(0); }

.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-text-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-primary-soft); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.avatar-btn { position: relative; }
.dropdown {
  position: absolute; right: 0; top: 40px; min-width: 150px;
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; display: none; z-index: 50;
}
.dropdown.open { display: block; }
.dropdown a {
  display: block; padding: 7px 10px; border-radius: 5px; color: var(--c-text-2); font-size: 13px;
}
.dropdown a:hover { background: #f3f5f9; color: var(--c-text); }

.content { padding: 20px; flex: 1; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
}
.card-head h3 { font-size: 14.5px; }
.card-head .sub { color: var(--c-text-3); font-size: 12.5px; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: 6px; border: 1px solid var(--c-border-strong);
  background: #fff; color: var(--c-text);
  cursor: pointer; font-size: 13.5px; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: #b9c0cc; background: #fafbfc; color: var(--c-text); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); border-color: var(--c-primary-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #f0b4b4; color: var(--c-danger); }
.btn-danger:hover { background: var(--c-danger-soft); color: var(--c-danger); }
.btn-success { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.btn-success:hover { filter: brightness(.94); color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 5px; }
.btn-link { border: none; background: none; color: var(--c-primary); padding: 0 4px; height: auto; cursor: pointer; }
.btn-link:hover { text-decoration: underline; background: none; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.col-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.col-1 { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field > label { font-size: 13px; color: var(--c-text-2); font-weight: 500; }
.field > label .req { color: var(--c-danger); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--c-text-3); }
.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--c-border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--c-text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 76px; padding: 8px 11px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 235, .12);
}
.input[disabled], .input[readonly] { background: #f7f8fa; color: var(--c-text-2); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

.checkbox { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13.5px; color: var(--c-text-2); }
.checkbox input { width: 15px; height: 15px; accent-color: var(--c-primary); cursor: pointer; }

.form-actions {
  display: flex; gap: 10px; padding: 14px 18px;
  border-top: 1px solid var(--c-border); background: #fcfcfd;
}

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
.table { font-size: 13.5px; min-width: 100%; }
.table th {
  text-align: left; font-weight: 600; color: var(--c-text-2);
  background: #fafbfc; padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--c-border); font-size: 13px;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; }
.table tbody tr:hover { background: #fafbfd; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .center { text-align: center; }
.table .nowrap { white-space: nowrap; }
.table-foot td { background: #fafbfc; font-weight: 600; border-top: 1px solid var(--c-border); }
.table.compact th, .table.compact td { padding: 7px 10px; }
.empty { padding: 42px 20px; text-align: center; color: var(--c-text-3); font-size: 13.5px; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 12px; line-height: 19px; background: #f0f1f4; color: var(--c-text-2);
  white-space: nowrap;
}
.tag-success { background: var(--c-success-soft); color: var(--c-success); }
.tag-danger  { background: var(--c-danger-soft);  color: var(--c-danger); }
.tag-warning { background: var(--c-warning-soft); color: var(--c-warning); }
.tag-info    { background: var(--c-info-soft);    color: var(--c-info); }
.tag-primary { background: var(--c-primary-soft); color: var(--c-primary); }
.tag-muted   { background: #f0f1f4; color: var(--c-text-3); }

/* ---------------- 工具栏 ---------------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--c-border); background: #fff;
}
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; height: 34px; }
.toolbar .spacer { margin-left: auto; }
.toolbar form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------------- 统计卡 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 12.5px; color: var(--c-text-3); }
.stat .value { font-size: 23px; font-weight: 600; margin-top: 5px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.stat .value small { font-size: 13px; font-weight: 400; color: var(--c-text-3); margin-left: 3px; }
.stat .foot { font-size: 12px; color: var(--c-text-3); margin-top: 6px; }

/* ---------------- 提示 ---------------- */
.alert {
  display: block; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius);
  font-size: 13.5px; line-height: 1.85; margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert-success { background: var(--c-success-soft); color: #146c33; border-color: #bfe8cd; }
.alert-error   { background: var(--c-danger-soft);  color: #9b1c1c; border-color: #f5c2c2; }
.alert-info    { background: var(--c-info-soft);    color: #0b5e73; border-color: #bfe4ee; }
.alert-warning { background: var(--c-warning-soft); color: #8a4b04; border-color: #f5dcb7; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 6px; padding: 13px 18px; flex-wrap: wrap; }
.pager-info { color: var(--c-text-3); font-size: 12.5px; margin-right: 6px; }
.pager-btn {
  min-width: 30px; height: 30px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border-strong); border-radius: 5px;
  background: #fff; color: var(--c-text-2); font-size: 13px;
}
.pager-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pager-btn.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pager-btn.disabled { opacity: .45; pointer-events: none; }
.pager-dot { color: var(--c-text-3); }

/* ---------------- 树形 ---------------- */
.tree-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #f0f1f4; }
.tree-row:hover { background: #fafbfd; }
.tree-indent { display: inline-block; }
.tree-toggle {
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-text-3); cursor: pointer; font-size: 10px; flex: 0 0 16px;
}
.tree-branch.hidden { display: none; }

/* ---------------- 弹层 ---------------- */
dialog.modal {
  border: none; border-radius: var(--radius-lg); padding: 0;
  box-shadow: 0 20px 60px rgba(16,24,40,.18);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
}
dialog.modal::backdrop { background: rgba(16, 24, 40, .38); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--c-border); }
.modal-head h3 { font-size: 15px; }
.modal-head .close { margin-left: auto; cursor: pointer; color: var(--c-text-3); font-size: 18px; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; max-height: 62vh; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--c-border); background: #fcfcfd; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #eef3fe 0%, #f7f8fb 45%, #eaf1fd 100%);
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 380px; background: #fff; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(20, 35, 70, .1); padding: 32px 30px 26px;
  border: 1px solid var(--c-border);
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-logo {
  width: 42px; height: 42px; border-radius: 11px; margin: 0 auto 12px;
  background: linear-gradient(135deg, #2f6feb, #5b8df5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.login-box h2 { font-size: 19px; margin-bottom: 0; }
.login-box .sub { color: var(--c-text-3); font-size: 13px; margin-bottom: 22px; }
.login-box .field { margin-bottom: 14px; }
.login-box .btn { width: 100%; height: 38px; }

/* ---------------- 移动端工资条 ---------------- */
.mobile-page { max-width: 460px; margin: 0 auto; padding: 16px 14px 40px; min-height: 100vh; background: var(--c-bg); }
.slip-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--c-border); }
.slip-head {
  padding: 20px 18px 18px;
  background: linear-gradient(135deg, #2f6feb, #4f83f0);
  color: #fff;
}
.slip-head .company { font-size: 13px; opacity: .88; }
.slip-head .name { font-size: 18px; font-weight: 600; margin-top: 4px; }
.slip-head .meta { font-size: 12px; opacity: .85; margin-top: 3px; }
.slip-amount { padding: 18px; text-align: center; border-bottom: 1px dashed var(--c-border); }
.slip-amount .label { font-size: 12.5px; color: var(--c-text-3); }
.slip-amount .value { font-size: 32px; font-weight: 700; color: var(--c-text); letter-spacing: -.5px; line-height: 1.2; }
.slip-amount .rmb { font-size: 12px; color: var(--c-text-3); margin-top: 4px; }
.slip-section { padding: 6px 18px 14px; }
.slip-section h4 {
  font-size: 12.5px; color: var(--c-text-3); font-weight: 500;
  padding: 12px 0 8px; display: flex; align-items: center; gap: 6px;
}
.slip-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; }
.slip-line .k { color: var(--c-text-2); }
.slip-line .v { font-variant-numeric: tabular-nums; }
.slip-line.total { border-top: 1px solid var(--c-border); margin-top: 6px; padding-top: 9px; font-weight: 600; }
.slip-foot { padding: 12px 18px 16px; font-size: 11.5px; color: var(--c-text-3); text-align: center; }
.period-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; }
.period-tabs a {
  padding: 5px 12px; border-radius: 20px; background: #fff; border: 1px solid var(--c-border);
  font-size: 12.5px; color: var(--c-text-2); white-space: nowrap;
}
.period-tabs a.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* ---------------- 其他 ---------------- */
.muted { color: var(--c-text-3); }
.text-danger { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-right { text-align: right; }
.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px; }
.flex { display: flex; align-items: center; gap: 8px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mb-0 { margin-bottom: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h2 { font-size: 17px; }
.page-head .spacer { margin-left: auto; }
.divider { height: 1px; background: var(--c-border); margin: 16px 0; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; background: #fff; border: 1px solid var(--c-border); border-radius: 8px; }
.qr-box img, .qr-box canvas { display: block; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); margin-bottom: 16px; }
.tabs a { padding: 9px 14px; color: var(--c-text-2); font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }

/* 权限树 */
.perm-tree { max-height: 60vh; overflow-y: auto; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 12px 14px; }
.perm-node { padding: 6px 0; }
.perm-node .node-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.perm-children { padding-left: 24px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.perm-children .checkbox { font-size: 13px; }

/* 响应式 */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 100; transform: translateX(-100%);
    transition: transform .2s; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 14px; }
  .form-grid, .form-grid.col-3 { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .topbar { padding: 0 14px; }
  .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--c-border); border-radius: 6px; background: #fff; cursor: pointer; }

@media print {
  .sidebar, .topbar, .toolbar, .btn, .pager, .form-actions { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: none; }
}

/* ---------- 登录页第三方登录 ---------- */
.login-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 14px; color: var(--c-text-3); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--c-border); }
.login-sso { display: flex; gap: 16px; justify-content: center; align-items: center; }
.sso-round { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; border: none; text-decoration: none;
  transition: box-shadow .15s, transform .15s, filter .15s; }
.sso-round:hover { transform: translateY(-1px); filter: brightness(1.06); }
.sso-round.sso-wechat { background: #07c160; }
.sso-round.sso-alipay { background: #1677ff; }
.sso-round.sso-dingtalk { background: #0089ff; }
.sso-round.sso-qq { background: #12b7f5; }
.sso-round.sso-wechat:hover { box-shadow: 0 4px 14px rgba(7, 193, 96, .4); }
.sso-round.sso-alipay:hover { box-shadow: 0 4px 14px rgba(22, 119, 255, .4); }
.sso-round.sso-dingtalk:hover { box-shadow: 0 4px 14px rgba(0, 137, 255, .4); }
.sso-round.sso-qq:hover { box-shadow: 0 4px 14px rgba(18, 183, 245, .4); }
.sso-logo { width: 27px; height: 27px; display: block; }
.sso-logo-sm { width: 20px; height: 20px; display: block; flex: none; }
.sso-logo-img { border-radius: 50%; object-fit: cover; }
.sso-round.sso-has-img { background: transparent; }
.sso-round .sso-logo-img { width: 100%; height: 100%; box-shadow: none; }
.sso-round.sso-has-img:hover { filter: none; box-shadow: 0 4px 14px rgba(31, 35, 41, .18); }

/* 后台：第三方登录图标管理 */
.icon-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.icon-admin-item { display: flex; align-items: center; gap: 14px; padding: 14px;
  border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-panel); }
.icon-admin-preview { flex: none; }
.icon-admin-meta { flex: 1; min-width: 0; }
.icon-admin-name { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.icon-admin-file { font-size: 12px; color: var(--c-text-2); line-height: 1.6; word-break: break-all; }
.icon-admin-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.icon-admin-actions .btn { padding: 0 10px; height: 28px; line-height: 28px; font-size: 12.5px; }
.sso-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px;
  border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-panel); color: var(--c-text-1);
  font-size: 13.5px; text-decoration: none; transition: border-color .15s, color .15s; }
.sso-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.sso-ico { width: 18px; height: 18px; }
.sso-wechat:hover { border-color: #07c160; color: #07c160; }
.sso-alipay:hover { border-color: #1677ff; color: #1677ff; }
.sso-dingtalk:hover { border-color: #0089ff; color: #0089ff; }
/* 登录页页脚：双排版权 / 备案信息（内容后台可改，支持 HTML） */
.login-footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--c-border);
  text-align: center; font-size: 12px; line-height: 1.9; color: var(--c-text-3); word-break: break-word; }
.login-footer-row + .login-footer-row { margin-top: 2px; }
.login-footer a { color: var(--c-text-3); text-decoration: none; }
.login-footer a:hover { color: var(--c-primary); text-decoration: underline; }
.login-footer img { max-height: 16px; vertical-align: -3px; margin-right: 3px; }

/* 首次登录绑定引导 */
.bind-first-tip { background: #fff7e6; border: 1px solid #ffd591; color: #ad6800;
  border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.7; margin-bottom: 14px; }
.bind-channel-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; width: 100%;
  border-radius: 8px; border: 1px solid var(--c-border); background: #fff; color: var(--c-text-1);
  font-size: 14px; text-decoration: none; margin-bottom: 10px; }
.bind-channel-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }

/* ============================================================
   主题外观（颜色由后台「系统参数 → 主题外观」注入 CSS 变量控制）
   变量在 :root 中给出默认值，页面 <head> 内的内联 <style> 会覆盖
   ============================================================ */
:root {
  --c-sidebar: #0b1729;
  --c-sidebar-2: #081120;
  --c-sidebar-text: #a7b6cc;
  --c-sidebar-text-2: #7f8ea8;
  --c-sidebar-strong: #eef4ff;
  --c-sidebar-hover: rgba(255, 255, 255, .07);
  --c-sidebar-active: #17304f;
  --c-sidebar-line: rgba(255, 255, 255, .08);
  --c-sidebar-dot: rgba(255, 255, 255, .22);
  --c-login-bg: #071022;
  --c-login-card: #101d33;
  --c-login-text: #eaf1fb;
  --c-login-muted: #93a5c1;
  --c-login-line: rgba(255, 255, 255, .12);
  --c-login-input: rgba(255, 255, 255, .06);
  --c-login-inbd: rgba(255, 255, 255, .16);
  --c-login-shadow: 0 24px 60px rgba(2, 10, 26, .55);
}

body { background: var(--c-bg); }

/* ---- 侧栏：颜色全部取自变量，深底浅底都自适应 ---- */
.sidebar {
  background: linear-gradient(180deg, var(--c-sidebar) 0%, var(--c-sidebar-2) 100%);
  border-right: 1px solid var(--c-sidebar-line);
}
.brand { border-bottom-color: var(--c-sidebar-line); }
.brand-text { color: var(--c-sidebar-strong); }
.brand-text small { color: var(--c-sidebar-text-2); }
.nav-item { color: var(--c-sidebar-text); }
.nav-item:hover { background: var(--c-sidebar-hover); color: var(--c-sidebar-strong); }
.nav-item.active {
  background: var(--c-sidebar-active);
  color: var(--c-sidebar-strong);
  font-weight: 500;
  box-shadow: inset 3px 0 0 var(--c-primary);
}
.nav-item .arrow { color: var(--c-sidebar-text-2); }
.nav-sub .nav-item::before { background: var(--c-sidebar-dot); }
.nav-sub .nav-item.active::before { background: var(--c-primary); }
.sidebar-foot { border-top-color: var(--c-sidebar-line); color: var(--c-sidebar-text-2); }
.sidebar-foot a { color: var(--c-sidebar-text); }

/* ---- 顶栏 / 内容区 ---- */
.topbar { background: var(--c-panel); border-bottom-color: var(--c-border); }
.dropdown { background: var(--c-panel); border-color: var(--c-border); }
.dropdown a:hover { background: var(--c-primary-soft); color: var(--c-text); }
.card { background: var(--c-panel); }
.form-actions { background: rgba(0, 0, 0, .015); }

/* ---- 按钮 / 表单 / 表格 ---- */
/* :not(.btn-primary) 是为了不让下面的覆盖把主按钮刷回底色 */
.btn:not(.btn-primary) { background: var(--c-panel); }
.btn:not(.btn-primary):hover { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-text); }
.btn-danger { background: var(--c-panel); }
.input, .select, .textarea { background: var(--c-panel); }
.input[disabled], .input[readonly] { background: rgba(0, 0, 0, .03); }
.table th { background: rgba(0, 0, 0, .025); }
.table td { border-bottom-color: var(--c-border); }
.table tbody tr:hover { background: rgba(0, 0, 0, .02); }
.table-foot td { background: rgba(0, 0, 0, .025); }
.tag { background: rgba(0, 0, 0, .05); }

/* ---- 登录页：深色主视觉 ---- */
.login-wrap {
  background:
    radial-gradient(900px 520px at 12% -12%, rgba(255, 255, 255, .10), transparent 62%),
    radial-gradient(820px 500px at 108% 112%, rgba(255, 255, 255, .07), transparent 58%),
    var(--c-login-bg);
}
.login-box {
  background: var(--c-login-card);
  border-color: var(--c-login-line);
  box-shadow: var(--c-login-shadow);
  color: var(--c-login-text);
}
.login-box h2 { color: var(--c-login-text); }
.login-box .sub { color: var(--c-login-muted); }
.login-box .input,
.login-box .select {
  background: var(--c-login-input);
  border-color: var(--c-login-inbd);
  color: var(--c-login-text);
}
.login-box .input::placeholder { color: var(--c-login-muted); }
.login-box .input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 1px var(--c-primary);
}
.login-box .checkbox { color: var(--c-login-muted); }
.login-divider { color: var(--c-login-muted); }
.login-divider::before, .login-divider::after { background: var(--c-login-line); }
.login-footer { border-top-color: var(--c-login-line); color: var(--c-login-muted); }
.login-footer a { color: var(--c-login-muted); }
.login-footer a:hover { color: var(--c-login-text); }
.login-logo { box-shadow: 0 8px 22px rgba(0, 0, 0, .35); }

/* ---- 员工端（手机版） ---- */
.mobile-page { background: var(--c-bg); }
.slip-card { background: var(--c-panel); border-color: var(--c-border); }
.slip-head { background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary)); }
.bind-channel-btn { background: var(--c-panel); color: var(--c-text); }

/* ---- 后台「主题外观」配置区 ---- */
.color-row { display: flex; align-items: center; gap: 8px; }
.color-pick { width: 40px; height: 34px; padding: 0; border: 1px solid var(--c-border);
  border-radius: 6px; background: var(--c-panel); cursor: pointer; flex: none; }
.color-pick::-webkit-color-swatch-wrapper { padding: 3px; }
.color-pick::-webkit-color-swatch { border: none; border-radius: 4px; }
.color-pick::-moz-color-swatch { border: none; border-radius: 4px; }
.color-text { flex: 1; min-width: 0; }

.theme-presets { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.theme-presets-label { font-size: 12.5px; color: var(--c-text-2); }
.theme-preset { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--c-border); border-radius: 20px; background: var(--c-panel);
  color: var(--c-text); font-size: 13px; cursor: pointer; transition: border-color .15s, transform .12s; }
.theme-preset:hover { border-color: var(--c-primary); transform: translateY(-1px); }
.theme-preset-dots { display: inline-flex; gap: 3px; }
.theme-preset-dots i { width: 11px; height: 11px; border-radius: 50%; display: block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }

.theme-preview-wrap { display: flex; gap: 18px; align-items: stretch; flex-wrap: wrap; margin-bottom: 18px;
  padding: 16px; border: 1px dashed var(--c-border-strong); border-radius: 10px; background: rgba(0, 0, 0, .015); }
.theme-login-preview { flex: none; width: 260px; padding: 18px; border-radius: 12px;
  background: var(--c-login-bg); display: flex; align-items: center; justify-content: center; }
.tlp-card { width: 100%; padding: 18px 16px; border-radius: 12px; background: var(--c-login-card);
  border: 1px solid var(--c-login-line); box-shadow: var(--c-login-shadow); color: var(--c-login-text); }
.tlp-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--c-login-text); }
.tlp-input { height: 32px; line-height: 32px; padding: 0 10px; margin-bottom: 8px; border-radius: 6px;
  font-size: 12px; color: var(--c-login-muted); background: var(--c-login-input);
  border: 1px solid var(--c-login-inbd); }
.tlp-btn { height: 34px; line-height: 34px; text-align: center; border-radius: 6px; font-size: 13px;
  font-weight: 500; color: #fff; background: var(--c-primary); margin-top: 10px; }
.tlp-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--c-login-line);
  font-size: 10.5px; color: var(--c-login-muted); text-align: center; }
.theme-preview-tip { flex: 1; min-width: 240px; font-size: 12.5px; line-height: 1.95; color: var(--c-text-2); }
.theme-preview-tip b { color: var(--c-text); display: block; margin-bottom: 4px; }

@media (max-width: 720px) {
  .theme-login-preview { width: 100%; }
  .color-text { font-size: 13px; }
}

/* ---- 单设备登录：异地登录警告框 ---- */
.kick-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(6, 12, 24, .62); backdrop-filter: blur(2px); }
.kick-box { width: 100%; max-width: 400px; background: var(--c-panel); color: var(--c-text);
  border-radius: 14px; padding: 26px 24px 20px; text-align: center;
  box-shadow: 0 24px 60px rgba(2, 10, 26, .45); border: 1px solid var(--c-border);
  animation: kickIn .18s ease-out; }
@keyframes kickIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.kick-icon { width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: #fff;
  background: var(--c-danger, #dc2626); }
.kick-box h3 { font-size: 15.5px; line-height: 1.6; margin: 0 0 8px; color: var(--c-text); }
.kick-sub { font-size: 12.5px; line-height: 1.8; color: var(--c-text-2); margin: 0 0 18px; }
.kick-box .btn { width: 100%; }

/* ---- 系统参数页：分区标题 + 锚点导航 ---- */
.cfg-nav { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 10px 0; background: var(--c-bg); border-bottom: 1px solid var(--c-border); }
.cfg-nav a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 16px;
  font-size: 12.5px; color: var(--c-text-2); text-decoration: none; border: 1px solid var(--c-border);
  background: var(--c-panel); white-space: nowrap; }
.cfg-nav a:hover { color: var(--c-primary); border-color: var(--c-primary); }
.cfg-nav a.active { color: #fff; background: var(--c-primary); border-color: var(--c-primary); }

/* 导航按钮改名（折叠面板） */
.cfg-nav-edit { margin: -8px 0 16px; font-size: 13px; }
.cfg-nav-edit summary { display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: 14px; border: 1px dashed var(--c-border-strong); color: var(--c-text-3);
  cursor: pointer; user-select: none; font-size: 12.5px; list-style: none; }
.cfg-nav-edit summary::-webkit-details-marker { display: none; }
.cfg-nav-edit summary:hover { color: var(--c-primary); border-color: var(--c-primary); }
.cfg-nav-edit-form { margin-top: 10px; padding: 14px 16px; }
.cfg-nav-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.cfg-nav-edit-grid .field span { display: block; font-size: 12px; color: var(--c-text-3); margin-bottom: 4px; }

.cfg-sec { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 26px 0 12px; padding-left: 2px; scroll-margin-top: 64px; }
.cfg-sec:first-of-type { margin-top: 6px; }
.cfg-sec-no { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--c-primary); color: #fff; font-size: 12px; flex: none;
  transform: translateY(1px); }
.cfg-sec h2 { font-size: 15px; margin: 0; color: var(--c-text); }
.cfg-sec-desc { font-size: 12.5px; color: var(--c-text-3); }
.cfg-preview-label { font-size: 12.5px; color: var(--c-text-2); margin-bottom: 8px; }

/* ==================================================================
   工作证（工牌）：横版 86×54mm / 竖版 54×86mm
   设计尺寸按 540×340 / 340×540 px，打印时整体 zoom 到真实毫米
   注意：下方几何值需与 assets/js/badge.js 的 LAYOUT 保持一致
   ================================================================== */
.badge-page { min-height: 100vh; background: var(--c-bg); padding-bottom: 42px; }

.badge-appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; background: var(--c-panel); border-bottom: 1px solid var(--c-border); }
.badge-back { font-size: 13px; color: var(--c-text-2); text-decoration: none; }
.badge-back:hover { color: var(--c-primary); }
.badge-appbar-title { font-size: 14.5px; font-weight: 600; color: var(--c-text); }
.badge-appbar-ops { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge-appbar-ops .btn { height: 30px; padding: 0 12px; font-size: 12.5px; text-decoration: none; }

.badge-stage { padding: 28px 18px 6px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.badge-stage-hint { font-size: 12px; color: var(--c-text-3); text-align: center; }
.badge-tip { font-size: 11.5px; line-height: 1.95; color: var(--c-text-3); text-align: center; max-width: 520px; }

/* ---- 工牌本体 ---- */
.badge { position: relative; flex: none; overflow: hidden; background: #fff; color: #101a2b;
  border-radius: 16px; box-shadow: 0 18px 46px rgba(16, 32, 60, .18); }
.badge-h { width: 540px; height: 340px; }
.badge-v { width: 340px; height: 540px; }

.bd-bar { height: 8px; background: linear-gradient(90deg, var(--c-primary) 0%, var(--c-primary-dark) 100%); }
.badge-h .bd-body { height: 332px; padding: 16px 22px 0; display: flex; flex-direction: column; }
.badge-v .bd-body { height: 532px; padding: 14px 18px 0; display: flex; flex-direction: column; }

.bd-head { display: flex; align-items: center; gap: 10px; flex: none; }
.badge-v .bd-head { gap: 8px; }
.bd-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; flex: none; display: block; }
.badge-v .bd-logo { width: 26px; height: 26px; border-radius: 7px; }
.bd-logo-txt { display: grid; place-items: center; background: var(--c-primary); color: #fff;
  font-size: 15px; font-weight: 700; }
.badge-v .bd-logo-txt { font-size: 13px; }
.bd-corp { min-width: 0; }
.bd-corp b { display: block; font-size: 14.5px; line-height: 1.25; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.badge-v .bd-corp b { font-size: 12.5px; max-width: 210px; }
.bd-corp i { display: block; font-style: normal; font-size: 8px; letter-spacing: 1.3px;
  color: #8b96a8; margin-top: 2px; }
.bd-flag { margin-left: auto; flex: none; font-size: 10.5px; line-height: 1; padding: 5px 8px;
  border-radius: 20px; color: var(--c-primary); background: var(--c-primary-soft);
  border: 1px solid color-mix(in srgb, var(--c-primary) 30%, transparent); }
.bd-flag.off { color: #8b96a8; background: #f1f4f9; border-color: #e2e8f1; }

/* 横版：照片 | 信息 | 二维码 */
.badge-h .bd-main { flex: 1; display: flex; align-items: center; gap: 18px; padding: 8px 0 0; min-height: 0; }
.badge-h .bd-photo { width: 116px; height: 148px; border-radius: 10px; overflow: hidden;
  background: #eef2f8; flex: none; display: grid; place-items: center; }
.badge-h .bd-meta { flex: 1; min-width: 0; }
.badge-h .bd-name { font-size: 31px; font-weight: 700; line-height: 1.12; letter-spacing: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-h .bd-eno { font-size: 12px; letter-spacing: 1.1px; color: #6b7a91; margin-top: 5px;
  font-family: ui-monospace, Menlo, Consolas, monospace; }
.badge-h .bd-dept { font-size: 12.5px; color: #48566b; margin-top: 9px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge-h .bd-qr { width: 92px; height: 92px; flex: none; align-self: flex-end; }
.badge-h .bd-foot { height: 26px; flex: none; display: flex; align-items: center; gap: 6px;
  border-top: 1px solid #eef1f6; font-size: 9.5px; letter-spacing: .4px; color: #93a0b4; }

/* 竖版：照片在上，信息居中，二维码在下 */
.badge-v .bd-main { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; padding: 12px 0 0; min-height: 0; }
.badge-v .bd-photo { width: 156px; height: 200px; border-radius: 12px; overflow: hidden;
  background: #eef2f8; flex: none; display: grid; place-items: center; }
.badge-v .bd-meta { text-align: center; width: 100%; }
.badge-v .bd-name { font-size: 27px; font-weight: 700; letter-spacing: 1px; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-v .bd-eno { font-size: 11.5px; letter-spacing: 1.1px; color: #6b7a91; margin-top: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace; }
.badge-v .bd-dept { font-size: 12px; color: #48566b; margin-top: 8px; line-height: 1.5;
  padding: 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge-v .bd-qr { width: 84px; height: 84px; flex: none; }
.badge-v .bd-foot { height: 24px; flex: none; display: flex; justify-content: center; align-items: center;
  gap: 6px; border-top: 1px solid #eef1f6; font-size: 9px; letter-spacing: .3px; color: #93a0b4; }

.bd-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd-photo-empty { font-size: 46px; font-weight: 700; color: #b9c5d8; }
.badge-v .bd-photo-empty { font-size: 56px; }
.bd-qr svg { width: 100%; height: 100%; display: block; }

/* ---- 照片上传区 ---- */
.badge-panel { width: 100%; max-width: 700px; margin: 20px auto 0; padding: 20px;
  background: var(--c-panel); border: 1px solid var(--c-border); border-radius: 12px; }
.badge-panel-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.badge-panel-head h3 { font-size: 14px; margin: 0; color: var(--c-text); }
.badge-panel-sub { font-size: 12px; color: var(--c-text-3); }
.badge-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge-file { position: relative; flex: 1; min-width: 200px; display: flex; align-items: center;
  height: 38px; padding: 0 12px; border: 1px dashed var(--c-border-strong); border-radius: 8px;
  background: var(--c-bg); cursor: pointer; font-size: 12.5px; color: var(--c-text-2); }
.badge-file:hover { border-color: var(--c-primary); color: var(--c-primary); }
.badge-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.badge-panel-note { margin-top: 12px; font-size: 11.5px; line-height: 1.9; color: var(--c-text-3); }
.badge-panel-note code { background: var(--c-bg); padding: 1px 5px; border-radius: 4px;
  font-size: 11px; color: var(--c-text-2); }

/* ---- 身份卡落地页 ---- */
.idcard-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 28px 16px; background: var(--c-login-bg); }
.idcard { width: 100%; max-width: 320px; background: var(--c-login-card); color: var(--c-login-text);
  border-radius: 18px; padding: 22px 20px 18px; text-align: center;
  border: 1px solid var(--c-login-line); box-shadow: var(--c-login-shadow); }
.idcard-brand { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 18px; }
.idcard-logo { width: 26px; height: 26px; border-radius: 7px; object-fit: contain; }
.idcard-logo-txt { display: grid; place-items: center; background: var(--c-primary); color: #fff;
  font-size: 13px; font-weight: 700; }
.idcard-brand-txt { text-align: left; }
.idcard-brand-txt b { display: block; font-size: 12.5px; color: var(--c-login-text); line-height: 1.2; }
.idcard-brand-txt span { display: block; font-size: 9.5px; color: var(--c-login-muted); letter-spacing: 1px; margin-top: 2px; }
.idcard-photo { width: 118px; height: 152px; margin: 0 auto 14px; border-radius: 12px; overflow: hidden;
  background: var(--c-login-input); display: grid; place-items: center; border: 1px solid var(--c-login-line); }
.idcard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idcard-photo span { font-size: 44px; font-weight: 700; color: var(--c-login-muted); }
.idcard-name { font-size: 21px; font-weight: 700; letter-spacing: 1px; color: var(--c-login-text); }
.idcard-sub { font-size: 12px; color: var(--c-login-muted); margin-top: 6px; }
.idcard-no { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .8px; }
.idcard-dot { margin: 0 5px; }
.idcard-rows { margin-top: 16px; border-top: 1px solid var(--c-login-line); }
.idcard-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--c-login-line); font-size: 12.5px; }
.idcard-row span { color: var(--c-login-muted); }
.idcard-row b { color: var(--c-login-text); font-weight: 500; }
.idcard-row b.ok { color: #34d399; }
.idcard-row b.off { color: var(--c-login-muted); }
.idcard-foot { margin-top: 14px; font-size: 10.5px; line-height: 1.8; color: var(--c-login-muted); }
.idcard-empty { max-width: 340px; }
.idcard-empty-icon { width: 44px; height: 44px; margin: 6px auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
  background: rgba(220, 38, 38, .16); color: #f87171; }
.idcard-empty h2 { font-size: 16px; margin: 0 0 8px; color: var(--c-login-text); }
.idcard-empty p { font-size: 12.5px; line-height: 1.85; color: var(--c-login-muted); margin: 0; }
.idcard-empty-tip { margin-top: 14px !important; font-size: 11.5px !important; }

@media (max-width: 620px) {
  .badge-h { width: 100%; max-width: 540px; height: auto; aspect-ratio: 540 / 340; }
  .badge-v { width: 300px; height: 476px; }
}

/* ---- 打印：按真实毫米输出，只留工牌 ---- */
@media print {
  .badge-appbar, .badge-panel, .badge-stage-hint, .badge-tip { display: none !important; }
  body, .badge-page { background: #fff !important; }
  .badge-stage { padding: 0; display: block; }
  .badge { box-shadow: none; zoom: .602; }
  .badge-v { zoom: .6; }
  .badge-h { break-inside: avoid; }
}

/* ==================================================================
   手机版适配（≤720px）
   1) 列表表格（data-cards）→ 简略卡片：每行一张卡，纵向排齐；
      点卡片空白处进入该行第一个链接（详情页）。
   2) 树形列表（菜单 / 部门）→ 同样卡片化，字段带 data-lb 标签。
   ================================================================== */
@media (max-width: 720px) {
  /* 页头：标题独占一行不再被按钮挤成竖排，按钮换行放第二行 */
  .page-head { flex-wrap: wrap; row-gap: 10px; }
  .page-head h2 { flex: 1 1 100%; word-break: break-word; }
  .page-head .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }

  /* ---- 表格 → 卡片 ---- */
  .table[data-cards] thead { display: none; }
  .table[data-cards] tbody { display: block; }
  .table[data-cards] tr {
    display: block; background: var(--c-panel);
    border: 1px solid var(--c-border); border-radius: 10px;
    padding: 4px 14px; margin: 0 0 10px;
    box-shadow: 0 1px 2px rgba(16, 32, 60, .05);
  }
  .table[data-cards] tr[data-href] { cursor: pointer; }
  .table[data-cards] tr:hover { background: var(--c-panel); }
  .table[data-cards] td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    border-bottom: none; padding: 7px 0; text-align: right;
    font-size: 13.5px; line-height: 1.5; word-break: break-word;
  }
  .table[data-cards] td::before {
    content: attr(data-label); flex: none; max-width: 42%;
    color: var(--c-text-3); font-size: 12.5px; text-align: left;
  }
  .table[data-cards] td:first-child { padding-top: 10px; font-weight: 600; }
  .table[data-cards] td:last-child { padding-bottom: 10px; }
  /* 操作列：所有按钮排在一行，紧凑排布保证删除按钮也显示得下 */
  .table[data-cards] td.nowrap {
    white-space: nowrap; flex-wrap: nowrap; overflow-x: auto;
    font-size: 12px; gap: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .table[data-cards] td.nowrap::-webkit-scrollbar { display: none; }
  .table[data-cards] td .btn-link { margin-left: 8px; }
  .table[data-cards] td.sm-hide { display: none; }
  /* 空态行恢复普通显示 */
  .table[data-cards] tr td[colspan] { display: block; text-align: center; padding: 18px 0; }
  .table[data-cards] tr td[colspan]::before { content: none; }
  /* 金额列保持数字对齐感 */
  .table[data-cards] td.num { justify-content: space-between; font-variant-numeric: tabular-nums; }
  /* 日期 / 金额 / 单号等值不断行（2026-09、¥80,625.00、E1001 整体显示） */
  .table[data-cards] td.mono, .table[data-cards] td.num { white-space: nowrap; }

  /* ---- 树形行（菜单 / 部门）→ 卡片 ---- */
  .tree-row { flex-wrap: wrap; row-gap: 2px; padding: 8px 14px !important; }
  .tree-row.tree-head { display: none; }
  .tree-row > span.tree-toggle { display: none; }
  .tree-row > div { width: auto !important; flex: 1 1 100%; display: flex; align-items: center;
    justify-content: space-between; gap: 10px; padding: 4px 0; min-width: 0; }
  .tree-row > div[data-lb]::before { content: attr(data-lb); flex: none;
    color: var(--c-text-3); font-size: 12.5px; }
  /* 名称行是卡片标题：保持行内排版，不拆成左右两栏 */
  .tree-row > div:nth-child(2) { display: block; font-weight: 600; }
  .tree-row > div:nth-child(2)::before { content: none; }
  .tree-row > div.nowrap { white-space: normal; flex-wrap: wrap; }
}

/* 页脚与返回顶部：手机与打印适配 */
@media (max-width: 720px) {
  .app-foot { padding: 14px 12px 18px; font-size: 11.5px; }
  .back-top { right: 12px; bottom: 14px; width: 38px; height: 38px; font-size: 15px; }
}
@media print {
  .app-foot, .back-top { display: none !important; }
}

/* v1.12.5：手机版工具栏一行排列 + 档案信息表卡片化 */
@media (max-width: 720px) {
  /* 工具栏：筛控件压成一行，按钮也尽量一行（显示完整文字前提下缩小） */
  .toolbar { padding: 10px 8px; gap: 6px; }
  .toolbar form { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; gap: 4px;
    overflow-x: auto; scrollbar-width: none; }
  .toolbar form::-webkit-scrollbar { display: none; }
  .toolbar .input, .toolbar .select {
    flex: 1 1 0; min-width: 0; width: auto; height: 32px; font-size: 12px; padding: 0 6px;
  }
  .toolbar .btn { height: 30px; padding: 0 8px; font-size: 12px; white-space: nowrap; flex: none; }
  .toolbar .spacer { display: none; }

  /* 档案信息这类「标签+值」双列表格：整行一张卡，标签在上、值在下 */
  .table.info-table { display: block; }
  .table.info-table tbody { display: block; }
  .table.info-table tr {
    display: block; background: var(--c-panel);
    border: 1px solid var(--c-border); border-radius: 10px;
    padding: 2px 14px 6px; margin: 0 0 10px;
    box-shadow: 0 1px 2px rgba(16, 32, 60, .05);
  }
  .table.info-table th {
    display: block; width: auto !important; background: none; border: none;
    padding: 8px 0 0; font-size: 12px; font-weight: 400; color: var(--c-text-3); text-align: left;
  }
  .table.info-table td {
    display: block; border: none; padding: 1px 0 4px;
    font-size: 13.5px; word-break: break-all; text-align: left;
  }
}

/* v1.12.6：手机版内容边距收紧 + 账期下拉完整显示 */
@media (max-width: 720px) {
  /* 内容区左右边距收窄，把空间还给表格 */
  .content { padding: 10px 8px; }
  .page-head { margin-bottom: 12px; }

  /* 账期下拉保持自然宽度（完整显示「2026-09 · 草稿」），其余控件伸缩填空 */
  .toolbar form select:first-of-type { flex: 0 0 auto; width: auto; }

  /* 员工详情 / 工资明细的双栏布局手机上改单栏 */
  .detail-grid, .detail-split { grid-template-columns: 1fr !important; }
}

/* v1.12.7：卡片模式下隐藏空单元格与 0.00 数值列（合计行不再产生空行） */
@media (max-width: 720px) {
  .table[data-cards] td.sm-zero { display: none !important; }
}

/* v1.12.8：工资条手写签名画板 + 手机签名展示 */
.sign-pad-mask {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(15, 23, 42, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.sign-pad-mask[hidden] { display: none; }
.sign-pad {
  background: var(--c-panel, #fff); width: 100%; max-width: 520px;
  border-radius: 14px 14px 0 0; padding: 14px 14px 18px;
  box-shadow: 0 -8px 30px rgba(0,0,0,.18);
}
.sign-pad-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 600; margin-bottom: 10px;
}
.sign-pad-close {
  border: none; background: none; font-size: 18px; line-height: 1;
  color: var(--c-text-3, #888); cursor: pointer; padding: 4px 8px;
}
.sign-pad-board { position: relative; }
.sign-pad-board canvas {
  width: 100%; height: 200px; display: block; touch-action: none;
  border: 1.5px dashed var(--c-border, #cfd4db); border-radius: 8px;
  background: #fff; cursor: crosshair;
}
.sign-pad-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #b3b9c2; font-size: 13px; pointer-events: none;
}
.sign-pad-actions { display: flex; gap: 10px; margin-top: 12px; }
.sign-pad-actions .btn { flex: 1; }
.slip-sign .slip-sign-img {
  display: block; height: 52px; max-width: 240px; object-fit: contain;
  border: 1px solid var(--c-border); border-radius: 6px; background: #fff; padding: 4px;
}

/* v1.13.0：人脸录入 / 核验 */
.face-consent { margin: 12px 18px 0; border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; background: #fbfcfe; }
.face-consent summary { font-size: 13px; font-weight: 600; cursor: pointer; }
.face-consent .fc-text { font-size: 12px; color: var(--c-text-2); line-height: 1.75; margin-top: 6px; max-height: 190px; overflow: auto; }
.face-consent .fc-text p { margin: 0 0 4px; }
.face-consent .fc-agree { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; margin-top: 8px; line-height: 1.5; }
.face-consent .fc-agree input { margin-top: 2px; }

.face-stage {
  position: relative; margin: 12px auto 0; width: calc(100% - 36px); max-width: 420px;
  aspect-ratio: 4 / 3; background: #0f172a; border-radius: 12px; overflow: hidden;
}
.face-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.face-frame {
  position: absolute; inset: 12% 22%; border: 2px dashed rgba(255, 255, 255, .75);
  border-radius: 46% / 40%; pointer-events: none;
}
.face-hint {
  position: absolute; left: 0; right: 0; bottom: 10px; text-align: center;
  font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.face-actions { display: flex; gap: 10px; padding: 12px 18px 0; }
.face-actions .btn { flex: 1; }
.face-status { padding: 10px 18px 16px; font-size: 12.5px; color: var(--c-text-2); text-align: center; }
.face-status-ok { color: #1a7f37; }
.face-status-err { color: #c62828; }

.face-fallback { display: none; margin: 0 18px 8px; padding: 12px; border: 1px solid var(--c-warning, #ffd591); background: #fffbe6; border-radius: 8px; }
.face-fallback.on { display: block; }
.face-fallback .ff-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.face-fallback .ff-body { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.face-fallback .ff-body .input { flex: 1 1 160px; min-width: 0; }
.face-fallback .ff-msg { font-size: 12px; color: #c62828; margin-top: 6px; }
.face-tip { text-align: center; font-size: 12px; color: var(--c-text-2); padding: 0 18px 16px; }
.face-tip a { color: var(--c-primary); }

.face-status-card { margin: 12px 18px 0; padding: 12px; border: 1px solid var(--c-border); border-radius: 8px; background: #f7fbf8; }
.face-status-card .fs-title { font-size: 13px; font-weight: 600; color: #1a7f37; margin-bottom: 8px; }
.face-status-card .fs-body { display: flex; gap: 12px; align-items: center; }
.face-status-card .fs-photo { width: 68px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--c-border); background: #fff; }
.face-status-card .fs-line { font-size: 12.5px; color: var(--c-text-2); line-height: 1.6; }
/* 人脸页窄屏防护（360~430px 手机） */
@media (max-width: 480px) {
  .face-actions { flex-wrap: wrap; }
  .face-actions .btn { flex: 1 1 46%; min-width: 0; font-size: 12.5px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .face-consent .fc-text { overflow-wrap: anywhere; }
  .face-fallback .ff-body .input { flex: 1 1 100%; }
}

/* v1.13.1：工牌页修复 —— 手机顶栏排版 + 照片异常提示 */
.badge-photo-warn {
  max-width: 520px; margin: 0 auto; padding: 10px 12px;
  border: 1px solid #f3c1c1; background: #fdf1f1; border-radius: 8px;
  color: #b03434; font-size: 12.5px; line-height: 1.7; text-align: left;
}
@media (max-width: 720px) {
  .badge-appbar { flex-wrap: wrap; row-gap: 8px; padding: 10px 12px; }
  .badge-back, .badge-appbar-title { white-space: nowrap; flex: none; }
  .badge-appbar-title { margin-left: 2px; }
  .badge-appbar-ops { margin-left: 0; flex: 1 1 100%; gap: 6px; }
  .badge-appbar-ops .btn { height: 30px; padding: 0 10px; white-space: nowrap; }
}
