
/* ============================================================
   index.html 专属样式
   ============================================================ */
body {
  font-family: 'Segoe UI', 'PingFang SC', Roboto, system-ui, sans-serif;
  background: #f2f5f9; min-height: 100vh;
  padding: 16px 8px 30px; color: #1e293b;
}
.app { max-width: 100%; margin: 0 auto; padding: 0 12px;}

/* ============================================================
   岗位分组 / 签到自动编号 面板
   ============================================================ */
.grp-root { display: flex; flex-direction: column; gap: 14px; }
.grp-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e5ebf3; border-radius: 14px; padding: 12px 16px;
}
.grp-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: #1e293b; }
.grp-switch input { display: none; }
.grp-switch .grp-sw {
  width: 48px; height: 27px; border-radius: 999px; background: #cbd5e1; position: relative; flex-shrink: 0;
  transition: background .2s ease;
}
.grp-switch .grp-sw::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: left .2s ease;
}
.grp-switch input:checked + .grp-sw { background: #16a34a; }
.grp-switch input:checked + .grp-sw::after { left: 24px; }
.grp-switch b { font-size: 15px; }
.grp-switch em { font-style: normal; font-size: 12px; color: #64748b; }
.grp-actions { display: flex; gap: 8px; flex-shrink: 0; }

.grp-main { display: grid; grid-template-columns: minmax(300px, 5fr) minmax(420px, 7fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .grp-main { grid-template-columns: 1fr; } }

.grp-col { background: #fff; border: 1px solid #e5ebf3; border-radius: 14px; padding: 14px; min-width: 0; }
.grp-sub-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: #0f2b5c; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.grp-sub-title em { font-style: normal; font-size: 12px; font-weight: 400; color: #94a3b8; }

#grpCards { display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow: auto; padding-right: 4px; }
.grp-empty {
  color: #94a3b8; font-size: 13px; border: 1px dashed #d3dce8; border-radius: 10px;
  padding: 18px 12px; text-align: center; background: #fbfcfe;
}
.grp-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; background: #fbfcff; }
.grp-card-head { display: flex; align-items: center; gap: 8px; }
.grp-order {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; font-size: 12px; font-weight: 700;
}
.grp-name {
  flex: 1; min-width: 0; padding: 6px 8px; font-size: 14px; font-weight: 600; color: #1e293b;
  border: 1px solid #e2e8f0; border-radius: 8px; outline: none; background: #fff;
}
.grp-name:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.grp-del {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; border: none; cursor: pointer;
  background: #f1f5f9; color: #64748b; font-size: 13px;
}
.grp-del:hover { background: #fee2e2; color: #dc2626; }
.grp-note {
  width: 100%; margin-top: 8px; box-sizing: border-box; padding: 6px 8px; font-size: 12px; color: #475569;
  border: 1px solid #e8eef5; border-radius: 8px; outline: none; background: #fff;
}
.grp-note:focus { border-color: #2563eb; }
.grp-meta { margin-top: 7px; display: flex; flex-direction: column; gap: 3px; }
.grp-meta em { font-style: normal; font-size: 11px; color: #94a3b8; line-height: 1.5; }

.grp-tip {
  margin-top: 10px; font-size: 12px; color: #64748b; line-height: 1.8; background: #f8fafc;
  border: 1px dashed #dbe3ef; border-radius: 10px; padding: 10px 12px;
}
.grp-tip b { color: #1d4ed8; background: #eef2ff; padding: 0 5px; border-radius: 5px; font-size: 12px; }

.grp-job-wrap { max-height: 62vh; overflow: auto; border: 1px solid #eef2f7; border-radius: 10px; }
.grp-job-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.grp-job-table th {
  position: sticky; top: 0; background: #f1f5f9; color: #475569; font-size: 12px; text-align: left;
  padding: 8px 10px; white-space: nowrap; z-index: 1;
}
.grp-job-table td { padding: 6px 10px; border-top: 1px solid #f1f5f9; vertical-align: top; word-break: break-word; overflow-wrap: anywhere; white-space: normal; }
.grp-job-table .grp-job-td { max-width: 210px; }
.grp-job-table .grp-employer-td { max-width: 190px; }
.grp-job-table .grp-group-td { max-width: 250px; }
.grp-job-table tr:hover td { background: #f8fafc; }
.grp-job-table .grp-code { font-family: Consolas, monospace; color: #1d4ed8; font-weight: 600; white-space: nowrap; }
.grp-job-table .grp-cnt { white-space: nowrap; color: #64748b; }
.grp-job-table tr.grp-row-auto td { background: #fffaf0; }
.grp-job-table tr.grp-row-auto:hover td { background: #fdf3e0; }
.grp-job-table .grp-nojob { color: #94a3b8; text-align: center; padding: 24px 10px; }
.grp-job-sel {
  width: 100%; min-width: 0; max-width: 100%; padding: 5px 6px; font-size: 12px; color: #334155;
  border: 1px solid #dbe3ef; border-radius: 7px; outline: none; background: #fff;
}
.grp-job-sel:focus { border-color: #2563eb; }
.grp-preview { font-size: 11px; color: #94a3b8; margin-top: 3px; line-height: 1.4; }
.grp-card[data-id] { animation: grpIn .15s ease; }
@keyframes grpIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ===== 欢迎横幅 ===== */
.welcome-banner {
  background: white; padding: 12px 20px; border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04); margin-bottom: 16px;
}
.welcome-content {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 18px; color: #0f2b5c;
}
.welcome-content img {
  height: 40px; width: 40px; border-radius: 6px; object-fit: contain;
  display: none; background: #f8fafc; border: 1px solid #e2e8f0; padding: 2px;
}
.welcome-content img.show { display: block; }
.welcome-content .company-name {
  background: linear-gradient(145deg, #0f2b5c, #1a4a8b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== 头部 ===== */
.header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  background: white; padding: 12px 20px; border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04); margin-bottom: 16px;
}
.header h1 {
  font-weight: 700; font-size: 22px; margin: 0;
  background: linear-gradient(145deg, #0f2b5c, #1a4a8b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

/* ===== 状态标签 ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef2ff; color: #1e3a8a; padding: 4px 14px;
  border-radius: 60px; font-weight: 600; font-size: 13px;
}
.status-badge .dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  background: #2563eb; animation: pulse 1.8s infinite;
}
.status-badge .dot.green { background: #16a34a; }
.status-badge .dot.orange { background: #ea580c; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1);} 50%{opacity:.4;transform:scale(.85);} }

/* ===== 面板 ===== */
.panel {
  background: white; border-radius: 16px; padding: 14px 16px; 
  box-shadow: 0 4px 16px rgba(0,0,0,0.04); margin-bottom: 16px;
}
.panel-title {
  font-weight: 700; font-size: 18px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.panel-title small { font-weight: 400; font-size: 13px; color: #64748b; }
.badge-count {
  background: #eef2ff; color: #1a4a8b; padding: 0 14px;
  border-radius: 60px; font-size: 13px; line-height: 26px; font-weight: 600;
}

/* ===== 导入区 ===== */
.import-area {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: #f8fafc; padding: 12px 16px; border-radius: 16px;
  border: 1px dashed #cbd5e1;
}
.file-label {
  background: white; border: 1px solid #cbd5e1; padding: 6px 16px;
  border-radius: 40px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.file-label:hover { background: #f1f5f9; }
.file-name { color: #64748b; font-size: 13px; }

/* ===== 统计行 ===== */
.stats-row {
  display: flex; flex-wrap: wrap; gap: 12px 24px;
  background: linear-gradient(135deg, #eef2ff, #f0fdf4);
  border-radius: 16px; padding: 12px 18px; margin-bottom: 12px;
  border: 1px solid #c7d2fe; align-items: center;
}
.stat-item { font-weight: 600; font-size: 14px; }
.stat-item .num { font-weight: 800; font-size: 18px; color: #0f2b5c; }
.stat-item .num.green { color: #16a34a; }
.stat-item .num.red { color: #dc2626; }
.progress-bar { flex: 1; min-width: 80px; height: 8px; background: #e2e8f0; border-radius: 40px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: linear-gradient(90deg, #16a34a, #22c55e); border-radius: 40px; transition: width .5s ease; width: 0%; }

/* ===== 岗位统计面板 ===== */
.job-stats-panel {
  background: #f8fafc; border-radius: 16px; padding: 12px 16px;
  margin-bottom: 12px; border: 1px solid #e2e8f0;
}
.job-stats-panel .panel-title-small {
  font-weight: 700; font-size: 14px; margin-bottom: 8px; color: #0f2b5c;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.job-stats-panel .collapse-arrow {
  display: inline-block; transition: transform 0.25s; font-size: 12px;
}
.job-stats-panel.collapsed .collapse-arrow { transform: rotate(-90deg); }
.job-stats-panel.collapsed .job-stats-grid { display: none; }
.job-stats-panel .panel-summary {
  display: inline; font-size: 12px; color: #64748b; margin-left: auto; font-weight: 400;
}

.job-stats-search {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap;
}
.job-stats-search .search-box {
  flex: 1; min-width: 160px; max-width: 400px; position: relative;
}
.job-stats-search .search-box input {
  width: 100%; padding: 5px 12px 5px 28px; border: 1.5px solid #cbd5e1;
  border-radius: 40px; font-size: 12px; outline: none; background: white;
}
.job-stats-search .search-box input:focus { border-color: #1a4a8b; }
.job-stats-search .search-icon {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; font-size: 12px;
}
.job-stats-search .clear-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: #e2e8f0; border: none; width: 16px; height: 16px; border-radius: 50%;
  cursor: pointer; font-size: 9px; color: #64748b; display: none;
}
.job-stats-search .clear-btn.show { display: flex; align-items: center; justify-content: center; }
.job-stats-search .search-action-btn {
  padding: 5px 12px; font-size: 12px; border-radius: 40px; white-space: nowrap;
}

.job-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.job-stat-card {
  background: white; border-radius: 10px; padding: 10px 12px;
  border: 1px solid #e2e8f0;
}
.job-stat-card .job-code {
  font-size: 10px; color: #1a4a8b; background: #eef2ff;
  padding: 1px 8px; border-radius: 20px; font-weight: 700; display: inline-block;
}
.job-stat-card .job-name {
  font-size: 13px; font-weight: 700; color: #0f2b5c; margin: 4px 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.job-stat-card .job-numbers {
  display: flex; gap: 8px; font-size: 12px; flex-wrap: wrap;
}
.job-stat-card .job-numbers .checked { color: #16a34a; font-weight: 700; }
.job-stat-card .job-numbers .unchecked { color: #dc2626; font-weight: 700; }
.job-stat-card .job-numbers .total { color: #64748b; }
.job-stat-card .mini-bar {
  height: 4px; background: #f1f5f9; border-radius: 10px; margin-top: 6px; overflow: hidden;
}
.job-stat-card .mini-bar .mini-fill {
  height: 100%; background: linear-gradient(90deg, #16a34a, #22c55e);
  border-radius: 10px; transition: width .4s ease;
}

/* ===== 工具栏 ===== */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  margin-bottom: 12px; padding: 8px 12px;
  background: #f8fafc; border-radius: 12px; border: 1px solid #e2e8f0;
}
.search-box {
  flex: 1; min-width: 180px; position: relative;
}
.search-box input {
  width: 100%; padding: 6px 12px 6px 30px; border: 1.5px solid #e2e8f0;
  border-radius: 10px; font-size: 13px; outline: none; background: white;
}
.search-box input:focus { border-color: #6366f1; }
.search-box .search-icon {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; font-size: 12px;
}
.search-box .clear-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: #e2e8f0; border: none; width: 18px; height: 18px; border-radius: 50%;
  cursor: pointer; font-size: 10px; color: #64748b; display: none;
}
.search-box .clear-btn.show { display: flex; align-items: center; justify-content: center; }
.search-action-btn {
  padding: 6px 14px; font-size: 13px; border-radius: 10px; white-space: nowrap;
}

.page-size-select {
  display: flex; align-items: center; gap: 4px; font-size: 12px; color: #64748b;
  background: white; padding: 2px 6px 2px 10px; border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.page-size-select select {
  padding: 4px 6px; border: none; border-radius: 6px;
  font-size: 12px; outline: none; cursor: pointer; background: #f1f5f9;
  font-weight: 600;
}

.pagination-inline {
  display: flex; gap: 3px; align-items: center; margin-left: auto;
}
.page-btn-inline {
  background: white; border: 1px solid #e2e8f0; padding: 2px 8px;
  border-radius: 6px; font-size: 11px; cursor: pointer; font-weight: 500;
  color: #475569; min-width: 24px; text-align: center;
}
.page-btn-inline:hover:not(:disabled) { background: #f1f5f9; }
.page-btn-inline.active {
  background: #1a4a8b; border-color: transparent; color: white; font-weight: 700;
}
.page-btn-inline:disabled { opacity: .35; cursor: not-allowed; }
.page-info-inline { font-size: 11px; color: #64748b; white-space: nowrap; }

/* ===== 表格 ===== */
.table-wrap { 
  overflow-x: auto; 
  border-radius: 12px; 
  border: 1px solid #e2e8f0;
}
table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 13px; 
  min-width: auto;
  table-layout: fixed; /* ★★★ 列宽严格按表头分配，防止内容撑开 ★★★ */
}
th {
  background: #f8fafc; 
  text-align: left; 
  padding: 10px 12px;
  font-weight: 700; 
  color: #334155; 
  border-bottom: 2px solid #e2e8f0;
  font-size: 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
td { 
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9; 
  vertical-align: middle;
  line-height: 1.5;
  white-space: nowrap;  /* ★★★ 默认不换行 ★★★ */
}
tr:hover td { background: #f8fafc; }
.empty-row td { text-align: center; color: #94a3b8; padding: 24px 0; }

.highlight { background: #fef08a !important; font-weight: 700; border-radius: 2px; padding: 0 2px; }

/* ===== 备注列 ===== */
.remark-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: #94a3b8;
  text-align: left;
  cursor: pointer;
  user-select: none;
}
.remark-cell:hover {
  background: #f1f5f9 !important;
  color: #475569;
}
.remark-cell:empty::before {
  content: '—';
}

/* ===== 抽签控制 ===== */
.draw-section { text-align: center; padding: 12px 0 4px; }
.draw-section .hint { color: #64748b; font-size: 13px; margin-top: 6px; }

/* ===== 分页 ===== */
.pagination {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center;
  margin-top: 14px;
}
.page-btn {
  background: white; border: 1px solid #e2e8f0; padding: 5px 12px;
  border-radius: 8px; font-size: 12px; cursor: pointer; font-weight: 500;
  color: #475569; min-width: 32px; text-align: center;
}
.page-btn:hover:not(:disabled) { background: #f1f5f9; }
.page-btn.active {
  background: #1a4a8b; border-color: transparent; color: white; font-weight: 700;
}
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-info { font-size: 12px; color: #64748b; margin: 0 4px; }

/* ===== 抽签遮罩 ===== */
.drawing-overlay {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 23, 42, 0.88); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; flex-direction: column;
}
.drawing-overlay.show { display: flex; }
.drawing-overlay .dice { font-size: 64px; animation: diceRoll 0.5s ease-in-out infinite alternate; }
@keyframes diceRoll { 0%{transform:rotate(-25deg) scale(1);} 100%{transform:rotate(25deg) scale(1.2);} }
.drawing-overlay .drawing-text { color: white; font-size: 26px; font-weight: 800; margin-top: 16px; }
.drawing-overlay .drawing-sub { color: rgba(255,255,255,0.7); font-size: 14px; margin-top: 6px; }
.drawing-overlay .progress-dots { margin-top: 16px; display: flex; gap: 6px; }
.drawing-overlay .progress-dots span {
  width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.3);
  animation: dotPulse 1.2s infinite ease-in-out;
}
.drawing-overlay .progress-dots span:nth-child(2) { animation-delay: 0.2s; }
.drawing-overlay .progress-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%,100%{transform:scale(1);opacity:.4;} 50%{transform:scale(1.4);opacity:1;} }

/* ===== 历史记录弹窗 ===== */
.history-modal {
  display: none; position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.history-modal.show { display: flex; }
.history-modal .modal-content {
  background: white; border-radius: 20px; width: 92%; max-width: 860px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.history-modal .modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-bottom: 2px solid #e2e8f0; flex-shrink: 0;
}
.history-modal .modal-header h2 {
  font-size: 20px; font-weight: 800; color: #0f2b5c;
}
.history-modal .modal-body {
  flex: 1; overflow-y: auto; padding: 16px 24px;
}
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid #f1f5f9;
  cursor: pointer; transition: 0.2s; border-radius: 8px;
}
.history-item:hover { background: #f8fafc; }
.history-item .info { flex: 1; min-width: 0; }
.history-item .info .time { font-weight: 700; color: #0f2b5c; font-size: 14px; }
.history-item .info .desc { font-size: 12px; color: #64748b; margin-top: 2px; }
.history-item .actions { display: flex; gap: 4px; flex-shrink: 0; }
.history-item .actions button {
  padding: 2px 10px; font-size: 11px; border-radius: 40px;
  border: 1px solid #cbd5e1; background: white; cursor: pointer;
}
.history-item .actions button:hover { background: #f1f5f9; }
.history-item .actions .btn-danger-sm { border-color: #dc2626; color: #dc2626; }
.history-empty { text-align: center; color: #94a3b8; padding: 30px 0; }
.history-empty .icon { font-size: 40px; margin-bottom: 8px; }

/* ===== 读卡器弹窗 ===== */
.reader-modal {
  display: none; position: fixed; inset: 0; z-index: 10002;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.reader-modal.show { display: flex; }
.reader-modal .modal-box {
  background: white; border-radius: 20px; padding: 28px 24px;
  width: 440px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.reader-modal .modal-title { text-align: center; font-size: 20px; font-weight: 800; color: #0f2b5c; }
.reader-modal .modal-sub { text-align: center; color: #94a3b8; font-size: 13px; margin-bottom: 16px; }
.reader-modal .info-box {
  background: #f8fafc; border-radius: 12px; padding: 12px 16px;
  margin-bottom: 12px; border: 1px solid #e2e8f0;
}
.reader-modal .info-row {
  display: flex; justify-content: space-between; padding: 4px 0;
  border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.reader-modal .info-row:last-child { border-bottom: none; }
.reader-modal .info-label { color: #64748b; }
.reader-modal .info-value { font-weight: 700; color: #0f2b5c; }
.reader-modal .btn-group { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.reader-modal .btn-yes {
  padding: 10px 40px; background: #16a34a; color: white;
  border: none; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.reader-modal .btn-yes:hover { background: #15803d; }
.reader-modal .btn-no {
  padding: 10px 40px; background: #dc2626; color: white;
  border: none; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.reader-modal .btn-no:hover { background: #b91c1c; }
.reader-modal .countdown {
  text-align: center; margin-top: 8px; font-size: 11px; color: #94a3b8;
}
.reader-modal .match-status {
  text-align: center; font-size: 12px; padding: 4px 10px;
  border-radius: 6px; margin-top: 6px;
}
/* ★★★ 人脸识别核验：开启「人脸识别」权限时加宽确认弹窗 ★★★ */
.reader-modal.face-on .modal-box { width: 600px; max-width: 94vw; }
#faceVerifyWrap .face-thumb {
  border: 1px solid #e2e8f0; border-radius: 10px; background: #fff;
  height: 170px; overflow: hidden; display: flex; align-items: center;
  justify-content: center; position: relative;
}
#faceVerifyWrap .face-thumb video,
#faceVerifyWrap .face-thumb img { width: 100%; height: 100%; object-fit: cover; }
#faceVerifyWrap .face-start-btn {
  background: #2563eb; color: #fff; border: none; border-radius: 8px;
  padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
#faceVerifyWrap .face-start-btn:hover { background: #1d4ed8; }
#faceVerifyWrap .face-start-btn:disabled { background: #94a3b8; cursor: not-allowed; }
.reader-modal .match-status.found { background: #dcfce7; color: #166534; }
.reader-modal .match-status.notfound { background: #fee2e2; color: #991b1b; }
.reader-modal .match-status.conflict { background: #fef3c7; color: #92400e; border: 2px solid #f59e0b; font-weight: 700; }

/* ===== 响应式 ===== */
@media (max-width: 600px) {
  body { padding: 10px 8px 20px; }
  .header { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 16px; }
  .header h1 { font-size: 18px; }
  .panel { padding: 12px 14px; }
  .panel-title { font-size: 16px; }
  .stats-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .toolbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .search-box { min-width: 0; }
  .pagination-inline { margin-left: 0; justify-content: center; }
  .page-btn-inline { padding: 2px 6px; font-size: 10px; }
  table { font-size: 12px; min-width: 480px; }
  th, td { padding: 6px 8px; }
  .job-stats-grid { grid-template-columns: 1fr; }
    /* ★★★ 新增：表格在小屏幕上的适配 ★★★ */
  .table-wrap { 
    margin: 0 -8px; 
    border-radius: 8px;
  }
  table { 
    font-size: 11px; 
    min-width: 700px;
  }
  th, td { 
    padding: 6px 8px !important; 
  }
  .action-cell .btn {
    font-size: 9px !important;
    padding: 2px 6px !important;
    min-width: 30px !important;
  }
}

/* ===== Toast 覆盖 ===== */
.toast-container {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  z-index: 9999; padding: 10px 20px; border-radius: 10px;
  background: #1e293b; color: white; font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2); opacity: 0;
  transition: opacity 0.3s ease; pointer-events: none; max-width: 90%;
}
.toast-container.show { opacity: 1; }
.toast-container.success { background: #16a34a; }
.toast-container.error { background: #dc2626; }
.toast-container.warning { background: #f59e0b; }

/* ===== 编辑弹窗 ===== */
.edit-modal .modal-box { max-width: 520px; }
.edit-modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.edit-modal .form-grid .full { grid-column: span 2; }
.edit-modal .form-group { margin-bottom: 0; }
.edit-modal .form-group label {
  display: block; font-size: 12px; font-weight: 600; color: #64748b; margin-bottom: 2px;
}
.edit-modal .form-group input {
  width: 100%; padding: 6px 10px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 13px; outline: none;
}
.edit-modal .form-group input:focus { border-color: #1a4a8b; }
.edit-modal .btn-group { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.edit-modal .btn-save {
  padding: 8px 36px; background: #8b5cf6; color: white;
  border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.edit-modal .btn-save:hover { background: #7c3aed; }

/* ===== 登录界面 ===== */
.login-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: linear-gradient(135deg, #0f2b5c, #1a4a8b);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 40px 16px;
}
.login-overlay.hidden { display: none; }
.login-box {
  background: white; border-radius: 28px; padding: 36px 32px;
  width: 400px; max-width: 92vw; box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  margin: auto;
}
.login-box .logo { text-align: center; font-size: 40px; margin-bottom: 4px; }
.login-box .logo img { max-height: 80px; width: auto; display: inline-block; }
.login-box h2 { text-align: center; font-size: 22px; font-weight: 700; color: #0f2b5c; }
.login-box .subtitle { text-align: center; color: #94a3b8; font-size: 13px; margin-bottom: 20px; }
.login-box .field { margin-bottom: 14px; }
.login-box .field label { display: block; font-weight: 600; font-size: 13px; color: #1e293b; margin-bottom: 4px; }
.login-box .field input {
  width: 100%; padding: 10px 14px; border: 1.5px solid #e2e8f0;
  border-radius: 10px; font-size: 14px; outline: none;
}
.login-box .field input:focus { border-color: #1a4a8b; }
.login-box .btn-login {
  width: 100%; padding: 12px; background: #1a4a8b; color: white;
  border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.login-box .btn-login:hover { background: #0f3b73; }
.login-box .login-error { color: #dc2626; font-size: 13px; text-align: center; margin-top: 10px; display: none; }
.login-box .login-error.show { display: block; }
/* ===== 滑块拼图验证码（隐藏式） ===== */
.captcha-wrap { position: relative; width: 300px; max-width: 100%; margin: 0 auto; }
/* 画布区域：默认收起（height:0），hover 或 active 时展开 */
.captcha-stage {
  position: relative; width: 300px; height: 0; overflow: hidden;
  transition: height 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-radius: 10px;
}
.captcha-wrap:hover .captcha-stage,
.captcha-wrap.active .captcha-stage {
  height: 150px;
  margin-bottom: 10px;
}
/* 验证通过后画布保持收起（不展开），只显示轨道 */
.captcha-wrap.verified .captcha-stage {
  height: 0;
  margin-bottom: 0;
}
.captcha-canvas { display: block; width: 300px; height: 150px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.captcha-puzzle { position: absolute; left: 0; top: 0; width: 300px; height: 150px; pointer-events: none; }
.captcha-puzzle canvas { position: absolute; left: 0; top: 0; border-radius: 3px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); transition: left 0.25s ease; }
.captcha-refresh {
  position: absolute; right: 8px; top: 8px; z-index: 3;
  width: 26px; height: 26px; padding: 0; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.88); color: #475569; font-size: 13px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.captcha-refresh:hover { background: #ffffff; color: #1a4a8b; }
/* 滑块轨道 */
.captcha-track {
  position: relative; height: 40px;
  background: #eef2f7; border: 1.5px solid #e2e8f0; border-radius: 20px;
  overflow: hidden; user-select: none; touch-action: none;
}
.captcha-progress {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: rgba(34,197,94,0.35); border-radius: 20px 0 0 20px;
  transition: width 0.25s ease;
}
.captcha-block {
  position: absolute; left: 0; top: 0; width: 44px; height: 40px;
  background: #ffffff; border: 1.5px solid #cbd5e1; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; z-index: 2; font-size: 16px; color: #1a4a8b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: left 0.25s ease;
}
.captcha-block:active { cursor: grabbing; box-shadow: 0 3px 10px rgba(0,0,0,0.25); }
.captcha-block.verified { background: #22c55e; color: #fff; border-color: #22c55e; cursor: default; box-shadow: none; }
.captcha-wrap.dragging .captcha-block,
.captcha-wrap.dragging .captcha-puzzle canvas,
.captcha-wrap.dragging .captcha-progress { transition: none; }
.captcha-tip {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #94a3b8; z-index: 1; pointer-events: none;
}
.captcha-tip.ok { color: #22c55e; font-weight: 600; }
.captcha-tip.fail { color: #dc2626; }
.captcha-wrap.verified .captcha-tip { display: none; }
.login-box .forgot-link { text-align: right; margin-top: 6px; }
.login-box .forgot-link button {
  background: none; border: none; color: #64748b; font-size: 12px; cursor: pointer;
}
.login-box .forgot-link button:hover { color: #1a4a8b; }
.login-box .forgot-modal {
  display: none; margin-top: 12px; padding: 12px 14px;
  background: #f8fafc; border-radius: 10px; border: 1px solid #e2e8f0;
}
.login-box .forgot-modal.show { display: block; }
.login-box .forgot-modal input {
  width: 100%; padding: 8px 12px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 13px; outline: none; margin-bottom: 8px;
}
.login-box .forgot-modal .btn-forgot {
  width: 100%; padding: 8px; background: #f59e0b; color: white;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.login-box .forgot-modal .btn-forgot:hover { background: #d97706; }
.login-box .forgot-modal .forgot-tabs {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.login-box .forgot-modal .forgot-tab {
  flex: 1; padding: 6px 0; background: #e2e8f0; color: #475569;
  border: none; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.login-box .forgot-modal .forgot-tab.active {
  background: #0f2b5c; color: white;
}
.login-box .forgot-modal .btn-code {
  padding: 8px 14px; background: #0f2b5c; color: white;
  border: none; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.login-box .forgot-modal .btn-code:disabled { background: #94a3b8; cursor: not-allowed; }
.login-box .forgot-modal .forgot-result {
  margin-top: 8px; padding: 8px 12px; border-radius: 6px; font-size: 13px; display: none;
}
.login-box .forgot-modal .forgot-result.success { display: block; background: #dcfce7; color: #166534; }
.login-box .forgot-modal .forgot-result.error { display: block; background: #fee2e2; color: #991b1b; }
.login-box .forgot-modal .forgot-result .show-pwd {
  font-weight: 700; font-size: 16px; color: #1a4a8b;
  background: white; padding: 2px 10px; border-radius: 4px; display: inline-block;
}

/* ===== 手动增删面板 ===== */
.manual-panel {
  background: #f8fafc; border-radius: 12px; padding: 12px 16px;
  margin-bottom: 10px; border: 1px solid #e2e8f0;
}
.manual-panel .manual-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end;
}
.manual-panel .form-group { margin-bottom: 0; }
.manual-panel .form-group label {
  display: block; font-size: 11px; color: #64748b; font-weight: 600;
}
.manual-panel .form-group input {
  padding: 5px 10px; border: 1.5px solid #e2e8f0;
  border-radius: 6px; font-size: 12px; outline: none; width: 100%;
  min-width: 80px;
}
.manual-panel .form-group input:focus { border-color: #1a4a8b; }

/* ===== 导出下拉 ===== */
.export-dropdown {
  display: none; position: absolute; top: 100%; right: 0;
  background: white; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  padding: 14px 18px; min-width: 160px; z-index: 999;
  border: 1px solid #e2e8f0; text-align: left;
}
.export-dropdown.show { display: block; }
.export-dropdown label {
  display: block; margin-bottom: 4px; font-size: 13px; cursor: pointer;
}
.export-dropdown label input[type="checkbox"] { margin-right: 6px; }
.export-dropdown .btn-row { border-top: 1px solid #e2e8f0; padding-top: 10px; display: flex; gap: 6px; justify-content: flex-end; }

/* ===== 锁定状态 ===== */
#lockStatus {
  display: inline-flex; align-items: center; gap: 4px;
  background: #e2e8f0; color: #94a3b8; padding: 2px 10px;
  border-radius: 60px; font-weight: 700; font-size: 11px;
}
#lockStatus.locked { background: #dc2626; color: white; }
#lockStatus.unlocked { background: #e2e8f0; color: #94a3b8; }

/* ===== 读卡器状态 ===== */
#readerStatusBadge {
  font-size: 11px; padding: 2px 10px; gap: 4px;
  background: #e2e8f0; color: #64748b; border-radius: 60px;
  display: inline-flex; align-items: center;
}
#readerStatusBadge .dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
  background: #94a3b8; animation: none;
}
#readerStatusBadge.connected { background: #dcfce7; color: #166534; }
#readerStatusBadge.connected .dot { background: #16a34a; animation: pulse 1.8s infinite; }
#readerStatusBadge.connecting { background: #fef3c7; color: #92400e; }
#readerStatusBadge.connecting .dot { background: #f59e0b; animation: pulse 0.8s infinite; }
#readerStatusBadge.disconnected { background: #fee2e2; color: #991b1b; }
#readerStatusBadge.disconnected .dot { background: #dc2626; animation: none; }

/* ===== 结果下拉 ===== */
.result-dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: white; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  padding: 6px 0; min-width: 130px; z-index: 999;
  border: 1px solid #e2e8f0; margin-top: 4px;
}
.result-dropdown.show { display: block; }
.result-dropdown a {
  display: block; padding: 6px 18px; font-size: 13px;
  color: #1a4a8b; text-decoration: none; transition: 0.15s;
}
.result-dropdown a:hover { background: #f1f5f9; }
.result-dropdown .view-link { color: #16a34a; }

/* ===== 搜索建议 ===== */
.search-suggestions {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  background: white; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border: 1px solid #e2e8f0; max-height: 200px; overflow-y: auto;
  z-index: 100; margin-top: 2px;
}
.search-suggestions.show { display: block; }
.search-suggestions .suggestion-item {
  padding: 6px 14px; font-size: 13px; cursor: pointer;
  border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between;
}
.search-suggestions .suggestion-item:hover { background: #f8fafc; }
.search-suggestions .suggestion-item .tag {
  font-size: 10px; color: #94a3b8; background: #f1f5f9;
  padding: 0 6px; border-radius: 4px;
}
/*历史记录标签*/
.history-tag-draw {
  background: #dcfce7 !important;
  color: #166534 !important;
}
.history-tag-snapshot {
  background: #eef2ff !important;
  color: #1a4a8b !important;
}
.login-box .forgot-modal .hint-text {
  font-size: 15px;
  color: #1e293b;
  margin-bottom: 12px;
  font-weight: 600;
  opacity: 0.6;
}
.login-box .forgot-modal .hint-text strong {
  font-size: 15px;
  color: #0f2b5c;
  font-weight: 700;
}

/* ===== 侧边栏布局 v8.1.18 ===== */
.app { padding: 8px 10px 24px; }
.layout {
  display: flex; align-items: flex-start;
  gap: 16px; width: 100%;
}
.sidebar {
  flex: 0 0 216px; width: 216px; position: sticky; top: 8px;
  background: #ffffff; border-radius: 18px; padding: 12px 10px 14px;
  box-shadow: 0 6px 20px rgba(15, 43, 92, 0.06);
  border: 1px solid #eef2f7; max-height: calc(100vh - 16px); overflow-y: auto;
  transition: width .2s ease, flex-basis .2s ease;
}
.side-brand {
  display: flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 13px; color: #0f2b5c;
  padding: 4px 10px 12px; border-bottom: 1px solid #eef2f7;
  white-space: nowrap; overflow: hidden;
}
.side-brand .brand-logo { flex: 0 0 auto; }
.side-brand .brand-text {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
/* 折叠 / 展开按钮 */
.side-collapse {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-left: auto; flex: 0 0 auto;
  border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc;
  color: #64748b; font-size: 14px; cursor: pointer; line-height: 1;
  transition: background .15s, color .15s;
}
.side-collapse:hover { background: #eef2ff; color: #0f2b5c; }
/* 折叠态：收缩为图标栏 */
.sidebar.collapsed { flex-basis: 62px; width: 62px; padding: 12px 8px 14px; }
.sidebar.collapsed .side-brand { justify-content: center; gap: 0; padding: 2px 0 12px; }
.sidebar.collapsed .side-brand .brand-logo,
.sidebar.collapsed .side-brand .brand-text { display: none; }
.sidebar.collapsed .side-brand .side-collapse { margin-left: 0; }
.sidebar.collapsed .side-sec,
.sidebar.collapsed .nav-item .nav-text,
.sidebar.collapsed .nav-drop-trigger .nav-text,
.sidebar.collapsed .nav-drop-trigger em,
.sidebar.collapsed .device-btn .device-text { display: none; }
.sidebar.collapsed .nav-item,
.sidebar.collapsed .nav-drop-trigger { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .device-btn { justify-content: center; padding: 8px 0; }
/* 折叠时下拉改为右侧弹出 */
.sidebar.collapsed .result-dropdown,
.sidebar.collapsed .export-dropdown { left: calc(100% + 8px); right: auto; min-width: 160px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.side-sec {
  font-size: 10.5px; color: #94a3b8; font-weight: 800;
  letter-spacing: 1.2px; padding: 10px 10px 3px;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  color: #334155; font-size: 13px; font-weight: 600;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  text-decoration: none; transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-item:hover { background: #eef4ff; color: #0f2b5c; }
.nav-danger { color: #dc2626; }
.nav-danger:hover { background: #fef2f2; color: #dc2626; }
.nav-drop { display: block; padding: 0; position: relative; }
.nav-drop-trigger {
  display: flex; align-items: center; gap: 8px;
  color: #334155; font-size: 13px; font-weight: 600;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  white-space: nowrap;
}
.nav-drop-trigger:hover { background: #eef4ff; color: #0f2b5c; }
.nav-drop-trigger em { margin-left: auto; font-style: normal; font-size: 10px; color: #94a3b8; }
/* 侧栏内的下拉子菜单向下展开 */
.sidebar .result-dropdown { left: 10px; right: auto; min-width: 140px; }
.sidebar .export-dropdown { left: 10px; right: auto; min-width: 170px; }
.sidebar .result-dropdown,
.sidebar .export-dropdown { margin-top: 2px; box-shadow: 0 10px 30px rgba(15,43,92,0.16); }
/* 读卡器设备操作 */
.nav-device { display: flex; flex-direction: column; gap: 4px; }
.device-btn {
  width: 100%; border-radius: 10px; border: 1px solid #cbd5e1;
  background: #f8fafc; padding: 7px 10px; font-size: 12px;
  font-weight: 700; cursor: pointer; transition: filter 0.15s;
  display: flex; align-items: center; justify-content: flex-start; gap: 6px;
}
.device-btn.connect { color: #16a34a; border-color: #86efac; background: #f0fdf4; }
.device-btn.disconnect { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.device-btn:hover { filter: brightness(0.97); }
/* 主内容区：自适应铺满，不再限制固定宽度 */
.side-main { flex: 1 1 auto; min-width: 0; }
.side-main .welcome-banner,
.side-main .header,
.side-main .panel { width: 100%; }
.header-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 窄屏：侧边栏转为顶部纵向导航（紧凑两列），并复位折叠态 */
@media (max-width: 1000px) {
  .layout { flex-direction: column; }
  .sidebar {
    flex: none; width: 100%; position: static; max-height: none;
    padding: 10px 12px 12px; border-radius: 16px;
    box-shadow: 0 4px 14px rgba(15, 43, 92, 0.05);
  }
  .side-brand { padding-bottom: 8px; margin-bottom: 2px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .side-sec { flex-basis: 100%; padding: 8px 6px 0; margin-top: 2px; }
  .nav-item, .nav-drop { flex: 1 1 calc(50% - 6px); min-width: 130px; }
  .nav-device { flex: 1 1 100%; }
  .nav-drop-trigger { justify-content: space-between; }
  .side-main .welcome-banner { margin-top: 0; }
  /* 窄屏时复位折叠态，避免缩成图标栏 */
  .sidebar.collapsed { flex-basis: auto; width: 100%; padding: 10px 12px 12px; }
  .sidebar.collapsed .side-brand { justify-content: flex-start; padding-bottom: 8px; margin-bottom: 2px; }
  .sidebar.collapsed .brand-logo,
  .sidebar.collapsed .brand-text,
  .sidebar.collapsed .side-sec,
  .sidebar.collapsed .nav-item .nav-text,
  .sidebar.collapsed .nav-drop-trigger .nav-text,
  .sidebar.collapsed .nav-drop-trigger em,
  .sidebar.collapsed .device-btn .device-text { display: revert; }
  .sidebar.collapsed .side-collapse { margin-left: auto; }
  .sidebar.collapsed .nav-item,
  .sidebar.collapsed .nav-drop-trigger { justify-content: flex-start; padding: 8px 10px; }
  .sidebar.collapsed .result-dropdown,
  .sidebar.collapsed .export-dropdown { left: 10px; min-width: 140px; }
}
@media (max-width: 600px) {
  .side-sec { padding: 6px 4px 0; }
  .nav-item, .nav-drop, .nav-device { flex-basis: 100%; min-width: 0; }
  .sidebar .result-dropdown,
  .sidebar .export-dropdown { min-width: 150px; left: 0; }
}
