/* ===================== 基础 ===================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e4e8f0;
  --text: #1e2430;
  --muted: #6b7688;
  --primary: #2b5cff;
  --primary-d: #1e46d4;
  --green: #16a34a;
  --yellow: #d4a017;
  --blue: #2563eb;
  --purple: #9333ea;
  --red: #dc2626;
  --radius: 10px;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-tap-highlight-color: rgba(43,92,255,.12);
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }

/* ===================== 登录 ===================== */
.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0d1b3d 0%, #1e3a8a 28%, #2b5cff 55%, #6a4dff 78%, #9d6bff 100%);
  padding: 20px;
}
.login-card {
  background: #fff; padding: 38px 34px; border-radius: 16px; width: 100%; max-width: 380px;
  box-shadow: 0 18px 50px rgba(10, 25, 70, .28);
}
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-card label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.login-card input {
  width: 100%; margin-top: 6px; padding: 11px 13px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe;
}
.login-card input:focus { outline: none; border-color: var(--primary); background: #fff; }
.login-card .login-remember {
  display: flex; align-items: center; gap: 8px; margin: -2px 0 16px;
  font-size: 13px; color: var(--muted); cursor: pointer; user-select: none;
}
.login-card .login-remember input[type=checkbox] {
  width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0;
  accent-color: var(--primary); flex: none;
}
.login-error { color: var(--red); font-size: 13px; margin-top: 12px; text-align: center; min-height: 20px; }

/* 顶部常驻公告通知条（JS 动态插入顶栏下方，有新公告时滑入） */
#annBanner {
  display: none;
  background: linear-gradient(90deg, #ff4d3d, #ff7a3d);
  color: #fff; padding: 11px 16px; font-size: 15px; font-weight: 700;
  text-align: center; cursor: pointer;
  box-shadow: 0 3px 12px rgba(230, 60, 30, .22);
  animation: annDrop .35s ease;
}
@keyframes annDrop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ===================== 顶栏 ===================== */
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 22px; padding: 0 20px;
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav button {
  border: none; background: transparent; padding: 7px 14px; border-radius: 8px;
  font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.nav button:hover { background: #f0f3fa; color: var(--text); }
.nav button.active { background: #eaf0ff; color: var(--primary); font-weight: 600; }
.nav .badge {
  display: inline-block; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 5px;
  background: var(--red); color: #fff; border-radius: 9px; font-size: 11px;
  line-height: 17px; text-align: center; font-weight: 700;
}
/* 手机导航：更多按钮 + 全功能面板 + 遮罩 */
#btnMoreNav { flex: 1 1 0; position: relative; }
.nav-more-mask {
  position: fixed; inset: 0; z-index: 70; background: rgba(10, 20, 45, .35);
}
.nav-more-panel {
  display: none;
  position: fixed; left: 10px; right: 10px; top: 96px; z-index: 75;
  background: #fff; border-radius: 14px;
  box-shadow: 0 18px 60px rgba(10, 25, 70, .28);
  padding: 14px 12px 12px;
}
.nav-more-panel.open { display: block; }
.nav-more-title {
  font-size: 12.5px; color: var(--muted); font-weight: 600;
  padding: 0 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px;
}
.nav-more-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.nav-more-grid button {
  border: none; background: #f4f6fb; border-radius: 10px;
  padding: 11px 4px; font-size: 13.5px; color: var(--text);
  cursor: pointer; white-space: nowrap; text-align: center;
  overflow: hidden; text-overflow: ellipsis;
}
.nav-more-grid button.active { background: var(--primary); color: #fff; }
.userbox { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.user-label { font-size: 13px; color: var(--muted); }
.user-label b { color: var(--text); }
/* ☰ 我的菜单：收纳使用说明/绑定微信/颜色/修改密码/退出 */
.user-menu-wrap { position: relative; }
#btnUserMenu {
  padding: 7px 12px; font-size: 15px; line-height: 1;
  border: 1px solid var(--line); background: #f7f9fd; border-radius: 8px;
  cursor: pointer; color: var(--text);
}
#btnUserMenu:hover { background: #eef3ff; border-color: #c3d4ff; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 80;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 36px rgba(10, 25, 70, .16);
  min-width: 168px; padding: 6px; display: none;
}
.user-menu.open { display: block; }
.user-menu .btn {
  display: block; width: 100%; text-align: left; border: none;
  background: transparent; padding: 10px 12px; font-size: 14px;
  border-radius: 8px; color: var(--text); cursor: pointer; min-height: 0;
}
.user-menu .btn:hover { background: #f0f3fa; }
.user-menu .btn:last-child { color: var(--red); }
.user-menu .btn:last-child:hover { background: #fdeaea; }
.role-tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px;
  background: #eef2f9; color: var(--muted); margin-left: 4px;
}
.role-tag.admin { background: #fdecec; color: var(--red); }
.role-tag.leader { background: #fff4dd; color: #a9760a; }

/* ===================== 布局 ===================== */
.main { padding: 18px 20px 60px; max-width: 1560px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.panel-head {
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.panel-title { font-weight: 600; font-size: 15px; }
.panel-title .sub { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }
.panel-body { padding: 16px; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 12px; }
.status-inline { display: inline-flex; align-items: center; gap: 8px; margin-left: 14px; flex-wrap: wrap; }
.status-inline select {
  padding: 6px 10px; border-radius: 8px; border: 1px solid #d5dcea;
  font-size: 13.5px; font-weight: 600; background: #fff; color: var(--text); max-width: 240px;
}
.status-inline select:focus { border-color: var(--primary); }
.feed-chips { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ===================== 控件 ===================== */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: .12s;
}
.btn:hover { border-color: #c3cddf; background: #f8fafd; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.93); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f0f3fa; color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; width: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); }

/* ===================== 页签 ===================== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 16px; background: #fff;
        border-radius: var(--radius) var(--radius) 0 0; }
.tabs button {
  border: none; background: transparent; padding: 12px 16px; cursor: pointer;
  font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; font-family: inherit;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs .count { font-size: 12px; color: var(--muted); margin-left: 5px; }

/* ===================== 表格 ===================== */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th {
  text-align: left; padding: 10px 12px; background: #f8fafd; color: var(--muted);
  font-weight: 500; font-size: 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.grid th.sortable { cursor: pointer; user-select: none; }
table.grid th.sortable:hover { color: var(--primary); }
table.grid th .arrow { font-size: 10px; margin-left: 3px; }
table.grid td { padding: 10px 12px; border-bottom: 1px solid #f0f3f8; vertical-align: middle; }
table.grid tbody tr:hover { background: #f7f9fd; }
table.grid tbody tr.clickable { cursor: pointer; }
.phone { font-family: ui-monospace, Consolas, monospace; letter-spacing: .3px; }
.phone.masked { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

/* ===================== 状态标签 ===================== */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.st-following          { background: #e8f8ee; color: #157a3a; } .st-following .dot          { background: var(--green); }
.st-interview_promised { background: #fdf5e0; color: #9a7308; } .st-interview_promised .dot { background: var(--yellow); }
.st-arrived            { background: #ffeede; color: #c2410c; } .st-arrived .dot            { background: #f97316; }
.st-interview_passed   { background: #d5f5f0; color: #0f766e; } .st-interview_passed .dot   { background: #14b8a6; }
.st-interview_failed   { background: #ffe4e6; color: #be123c; } .st-interview_failed .dot   { background: #f43f5e; }
/* 透明状态下拉：看不见框，点一下弹出修改（公海/人才库/面试名单共用） */
select.quick-status, select.iv-status-sel {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 3px 2px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  max-width: 160px;
  text-align: left;
}
select.quick-status:hover, select.iv-status-sel:hover { background: #f4f6fb; border-radius: 4px; }
select.quick-status option, select.iv-status-sel option { color: var(--text); }

.st-no_show            { background: #eef0f4; color: #4b5563; } .st-no_show .dot            { background: #6b7280; }
.st-pending_onboard    { background: #e0f2fe; color: #0369a1; } .st-pending_onboard .dot    { background: #0ea5e9; }
.st-hired              { background: #e7efff; color: #1d4ed8; } .st-hired .dot              { background: var(--blue); }
.st-resigned_followup  { background: #f5e9fe; color: #7e22ce; } .st-resigned_followup .dot  { background: var(--purple); }
.st-failed             { background: #fdeaea; color: #b91c1c; } .st-failed .dot              { background: var(--red); }
.st-resigned           { background: #f1f3f7; color: #6b7280; } .st-resigned .dot            { background: #9ca3af; }
.st-resigned_unsettled { background: #f6ead9; color: #8a5a2b; } .st-resigned_unsettled .dot  { background: #a16207; }
.st-pool               { background: #eef2f9; color: #64748b; } .st-pool .dot                { background: #94a3b8; }

.quick-status { padding: 4px 6px; border-radius: 8px; font-size: 12.5px; border: 1px solid #d5dcea; background: #fff; color: var(--text); max-width: 132px; }

/* ---- 工厂库：区域按钮铺开（像分页一样按区域选厂） ---- */
.district-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 0 2px; border-top: 1px dashed var(--line); margin-top: 10px; }
.district-bar .district-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---- 工厂名称：纯文字，无背景色，点开改工厂信息 ---- */
.factory-edit {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--text); font-weight: 600; font-family: inherit; font-size: inherit;
  cursor: pointer; text-align: left; min-width: 72px; min-height: 20px;
}
.factory-edit:hover { color: var(--primary); text-decoration: underline; }

/* ---- 列表页顶部：已打开的台账页签（并排、可叠加） ---- */
.open-tabs-strip { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: 10px; }
.open-tabs-strip .strip-label { font-size: 12px; color: var(--muted); }
.open-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 20px; background: #f8fafd;
  font-size: 12.5px; cursor: pointer; color: var(--text); font-family: inherit;
}
.open-tab:hover { border-color: var(--primary); color: var(--primary); }
.open-tab .dt-close { opacity: .5; font-size: 11px; }
.open-tab .dt-close:hover { opacity: 1; }

/* ---- 台账多开页签 ---- */
.detail-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.detail-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  font-size: 13px; cursor: pointer; color: var(--text); max-width: 200px;
}
.detail-tab span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.detail-tab .dt-close { color: inherit; opacity: .6; font-size: 12px; padding: 0 2px; }
.detail-tab .dt-close:hover { opacity: 1; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px; background: #eef2f9; color: var(--muted); }
.tag.warn { background: #fdeaea; color: var(--red); }
.tag.ok   { background: #e8f8ee; color: var(--green); }
.tag.info { background: #e7efff; color: var(--blue); }

/* ===================== 可点击的统计数字 ===================== */
.stat-card.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.stat-card.clickable:hover { box-shadow: 0 4px 16px rgba(37,99,235,.14); transform: translateY(-1px); border-color: #b9cdfb; }
.stat-more { float: right; font-size: 11px; color: var(--primary); opacity: .75; font-weight: 400; }
.link-num {
  background: none; border: none; padding: 2px 6px; font: inherit; font-weight: 700;
  color: var(--primary); cursor: pointer; border-radius: 5px; border-bottom: 1px dashed #a9c0f5;
}
.link-num:hover { background: #eef3ff; }

/* ===================== 手机号一键拨号（手机端才生效） ===================== */
.tel-link {
  color: var(--primary); text-decoration: none; font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 6px; background: #eef3ff;
  -webkit-tap-highlight-color: transparent;
}
.tel-link:active { background: #dbe7ff; opacity: .75; }
@media (min-width: 769px) {
  .tel-link { background: none; padding: 0; color: inherit; font-weight: inherit; }
  .tel-link::before { content: none; }
  .tel-link .tel-ico { display: none; }
}

/* ===================== 每日跟进红点 ===================== */
.alert-flag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #dc2626; color: #fff; font-weight: 900; font-size: 14px;
  line-height: 1; margin-right: 6px; flex: none;
  box-shadow: 0 0 0 0 rgba(220,38,38,.6);
  animation: alertPulse 1.6s infinite;
}
@keyframes alertPulse {
  0%   { box-shadow: 0 0 0 0 rgba(220,38,38,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
.alert-row { background: #fff8f8 !important; }
.alert-row > td:first-child, .alert-row > td.cell-name { box-shadow: inset 3px 0 0 #dc2626; }
.follower-row { display: flex; align-items: center; }

/* ===================== 统计卡 ===================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; }
.stat-card .k { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat-card .v { font-size: 26px; font-weight: 700; line-height: 1.15; }
.stat-card .h { font-size: 11px; color: var(--muted); margin-top: 3px; }
.stat-card.accent { background: linear-gradient(135deg, #2b5cff, #4f8bff); border-color: transparent; color: #fff; }
.stat-card.accent .k, .stat-card.accent .h { color: rgba(255,255,255,.82); }

/* ===================== 跟进台账 ===================== */
.ledger { display: flex; flex-direction: column; gap: 0; }
.ledger-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #e8ecf4; }
.ledger-item:last-child { border-bottom: none; }
.ledger-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex: none; }
.ledger-main { flex: 1; }
.ledger-meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.ledger-meta b { color: var(--text); font-weight: 600; }
.ledger-content { white-space: pre-wrap; word-break: break-word; }

/* ===================== 弹窗 ===================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 620px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(10,25,70,.3);
}
.modal.wide { max-width: 900px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ===================== 提示 ===================== */
/* 注意：toast-root 是铺满屏的浮层，必须 pointer-events:none，
   否则它会吃掉整页的点击/触摸（手机上会导致「点哪都没反应」） */
.toast-root {
  position: fixed; top: 70px; right: 22px; z-index: 300;
  display: flex; flex-direction: column; gap: 9px;
  pointer-events: none;
}
.toast {
  background: #1e2430; color: #fff; padding: 11px 16px; border-radius: 9px; font-size: 13px;
  box-shadow: 0 8px 26px rgba(0,0,0,.22); animation: slideIn .18s ease; max-width: 360px;
  pointer-events: auto;
}
.toast.err { background: #b91c1c; }
.toast.ok  { background: #15803d; }
.toast.warn{ background: #b45309; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; color: var(--muted); padding: 46px 20px; font-size: 13px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; opacity: .45; }
.loading { text-align: center; color: var(--muted); padding: 40px; font-size: 13px; }

.notice { padding: 10px 13px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.notice.info { background: #eef4ff; color: #1d4ed8; border: 1px solid #d3e0ff; }
.notice.warn { background: #fff8e6; color: #9a7308; border: 1px solid #f4e3b4; }
.notice.err  { background: #fdeaea; color: #b91c1c; border: 1px solid #f6cfcf; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 20px; }
.detail-grid .item .k { font-size: 12px; color: var(--muted); }
.detail-grid .item .v { font-size: 14px; font-weight: 500; word-break: break-all; }
.sub-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sub-tabs .chip {
  padding: 6px 13px; border-radius: 20px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 13px;
}
.sub-tabs .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.follower-chip {
  display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; cursor: pointer; margin-bottom: 8px;
}
.follower-chip:hover { border-color: var(--primary); background: #f7f9ff; }
.follower-chip.active { border-color: var(--primary); background: #eef4ff; }

.filter-bar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filter-bar .field { min-width: 108px; }
.age-range { display: flex; align-items: center; gap: 5px; }
.age-range input { width: 62px; }

/* 工厂库筛选勾选 chips（岗位 / 吃住 / 班次多选） */
.fchip-groups { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.fchip-group { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.fchip-label { font-size: 12px; color: var(--muted); padding-top: 5px; min-width: 96px; }
.fchip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { padding: 5px 13px; border-radius: 16px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; color: #333; line-height: 1.4; }
.fchip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 手机端的筛选折叠：JS 会给 .filter-bar 插入 .filter-toggle 并把字段包进 .filter-body。
   电脑端 .filter-body 用 display:contents —— 等于没包过，布局完全不变。 */
.filter-toggle { display: none; }
.filter-body { display: contents; }

/* 公海批量勾选 + 私域批量退回 + 分页页码跳转 + 粘贴识别 */
.pool-chk, .rel-chk { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
#poolChkAll, #relChkAll { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.pager-jump { display: inline-flex; align-items: center; gap: 6px; }
.pager-jump input { width: 76px; }
#ePaste { font-size: 13.5px; line-height: 1.5; }
#ePasteHint { font-size: 12px; color: var(--muted); min-height: 16px; margin-top: 2px; }

/* ==================================================================
   手机端适配（≤ 768px）
   核心思路：表格 → 卡片；顶栏换行；弹窗全屏；按钮加大方便点
   ================================================================== */
@media (max-width: 768px) {

  /* ---------- 登录页：卡片更贴手，输入框够大 ---------- */
  .login-wrap { padding: 16px; align-items: center; }
  .login-card { padding: 30px 22px; border-radius: 14px; max-width: 100%; }
  .login-card h1 { font-size: 19px; }
  .login-sub { margin-bottom: 20px; }
  .login-card label { font-size: 14px; margin-bottom: 16px; }
  .login-card input { padding: 13px 14px; font-size: 17px; min-height: 48px; }
  .login-card .btn-block { padding: 14px; font-size: 17px; min-height: 50px; }

  /* ---------- 公告通知条：贴手尺寸 ---------- */
  #annBanner { padding: 10px 14px; font-size: 14px; }

  /* ---------- 工厂库筛选 chips：手机上标签竖排、点按区域更大 ---------- */
  .fchip-groups { gap: 6px; }
  .fchip-group { flex-direction: column; gap: 6px; }
  .fchip-label { min-width: 0; padding-top: 0; }
  .fchip { padding: 6px 13px; font-size: 13.5px; }

  /* ---------- 顶栏：品牌 + 用户一行，导航单独一行横向滚动 ---------- */
  .topbar {
    height: auto; flex-wrap: wrap; gap: 8px;
    padding: 8px 10px; align-items: center;
  }
  .brand { font-size: 14px; flex: 1; min-width: 0; }
  .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-mark { width: 24px; height: 24px; font-size: 12px; flex: none; }

  .userbox { order: 2; gap: 4px; flex: none; }
  .user-label { font-size: 12px; }
  .userbox .btn-sm { padding: 6px 8px; font-size: 12px; }
  .user-label .role-tag { display: none; }   /* 手机上角色标签藏起来，只留名字 */

  /* 导航：高频入口均分撑满一行，不滚动；其余收进「更多」面板 */
  .nav {
    order: 3; width: 100%; flex: 0 0 100%;
    display: flex; flex-wrap: nowrap; gap: 4px; overflow: visible;
    padding-bottom: 2px;
  }
  .nav > button:not(#btnMoreNav) {
    flex: 1 1 0; min-width: 0;
    padding: 10px 2px; font-size: 13.5px; text-align: center;
    background: #f4f6fb; border-radius: 10px;
    overflow: hidden; text-overflow: ellipsis;
  }
  .nav > button:not(#btnMoreNav).active { background: var(--primary); color: #fff; }
  .nav > button:not(#btnMoreNav) .badge { margin-left: 3px; }
  #btnMoreNav {
    padding: 10px 2px; font-size: 13.5px; text-align: center;
    background: #f4f6fb; border-radius: 10px; color: var(--text);
  }
  #btnMoreNav.has-badge { background: #fff2f0; color: var(--red); }
  .nav-more-panel { top: 100px; }

  /* ---------- 主体留白收紧 ---------- */
  .main { padding: 10px 10px 80px; }
  .panel { border-radius: 10px; margin-bottom: 10px; }
  .panel-head { padding: 10px 12px; gap: 8px; }
  .panel-title { font-size: 14px; }
  .panel-title .sub { display: block; margin-left: 0; font-size: 12px; margin-top: 2px; }
  .panel-body { padding: 12px; }
  .status-inline { margin-left: 0; margin-top: 6px; width: 100%; }
  .status-inline select { flex: 1; min-width: 0; max-width: none; font-size: 13px; padding: 7px 9px; }

  /* ---------- 页内标签：横向滚动，不换行 ---------- */
  .tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; gap: 4px; align-items: center;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: none; padding: 9px 14px; font-size: 14.5px; }
  .tabs .spacer { flex: 1 1 auto; min-width: 4px; }

  /* ---------- 表格 → 卡片 ---------- */
  .table-wrap { overflow-x: visible; }
  table.grid { font-size: 14px; display: block; }
  table.grid thead { display: none; }
  table.grid tbody { display: block; }
  table.grid tr {
    display: block; background: #fff; border: 1px solid var(--line);
    border-radius: 10px; margin-bottom: 10px; padding: 6px 10px;
    box-shadow: 0 1px 3px rgba(20,40,80,.04);
  }
  table.grid tbody tr:hover { background: #fff; }
  table.grid tr.alert-row { background: #fff8f8; border-color: #f5c2c2; }
  table.grid td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 8px 2px; border-bottom: 1px dashed #f0f3f8;
    text-align: right; min-height: 40px;
  }
  table.grid td:last-child { border-bottom: none; }
  table.grid td::before {
    content: attr(data-label);
    flex: none; color: var(--muted); font-size: 12.5px; font-weight: 600;
    text-align: left; margin-right: auto;
  }
  table.grid td:not([data-label])::before { content: none; }
  /* 内容很长的一格：标签上方、内容左对齐换行，不再挤成右对齐的一条 */
  table.grid td.long {
    flex-direction: column; align-items: stretch; text-align: left; gap: 4px;
  }
  table.grid td.long::before { margin-right: 0; }
  table.grid td.long > * { align-self: flex-start; text-align: left; }
  /* 姓名那一格放大当标题（cell-name 由 JS 标在第一个非勾选框的格子上） */
  table.grid td.cell-name {
    font-size: 16px; border-bottom: 1px solid #eef2f8;
    padding-top: 10px; padding-bottom: 10px;
  }
  table.grid td.cell-name::before { font-size: 12px; }
  table.grid td .btn { padding: 9px 14px; font-size: 14px; min-height: 38px; }

  /* ---------- 统计卡：两列 ---------- */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .v { font-size: 24px; }
  .stat-card .k { font-size: 12.5px; }
  .stat-stat .h, .stat-card .h { font-size: 11px; }
  .stat-more { display: none; }

  /* ---------- 筛选栏：默认收起，点一下展开；展开后两列排 ---------- */
  .filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .filter-bar .field { width: 100%; min-width: 0; }
  .filter-bar .field input, .filter-bar .field select { width: 100% !important; }
  .filter-bar .btn { width: 100%; padding: 11px; font-size: 15px; }
  .filter-bar .age-range { display: flex; gap: 6px; align-items: center; }
  .filter-bar .age-range input { flex: 1 1 0; min-width: 0; width: auto !important; }

  .filter-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    border: 1px solid var(--line); background: #f7f9fd; color: var(--text);
    padding: 12px 14px; border-radius: 9px; font-size: 15px; font-family: inherit;
    cursor: pointer; order: -1;
  }
  .filter-toggle .ft-left { font-weight: 600; }
  .filter-toggle .ft-arrow { color: var(--muted); font-size: 13px; }
  .filter-bar.open .filter-toggle { background: #eef3ff; border-color: #c3d4ff; color: var(--primary); }
  .filter-bar.open .filter-toggle .ft-arrow { color: var(--primary); }
  .filter-toggle .ft-dot {
    display: inline-block; min-width: 17px; height: 17px; line-height: 17px; padding: 0 5px;
    margin-left: 6px; background: var(--primary); color: #fff; border-radius: 9px;
    font-size: 11px; text-align: center; font-weight: 700; vertical-align: 1px;
  }

  .filter-body { display: none; }
  .filter-bar.open .filter-body {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%;
  }
  .filter-body > .field:first-child,
  .filter-body > .field.span2 { grid-column: 1 / -1; }   /* 关键词 / 落单的那格占整行 */
  .filter-body .field > span { font-size: 12.5px; }
  .filter-body .field input, .filter-body .field select { width: 100% !important; }
  .filter-actions {
    grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-top: 2px;
  }
  .filter-actions .btn { width: 100%; }
  /* 只有一个按钮（比如「搜索」）时也占满整行 */
  .filter-actions > .btn:only-child { grid-column: 1 / -1; }

  .row { flex-wrap: wrap; gap: 8px; }
  .row .field { flex: 1 1 100%; }
  .row .field input, .row .field select { width: 100% !important; }

  /* ---------- 弹窗：全屏 ---------- */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%; width: 100%; max-height: 94vh;
    border-radius: 16px 16px 0 0; overflow-y: auto;
  }
  .modal.wide { max-width: 100%; }
  .modal-head { padding: 14px 16px; font-size: 16px; position: sticky; top: 0; background: #fff; z-index: 2; }
  .modal-body { padding: 14px 16px; }
  .modal-foot {
    padding: 12px 16px; position: sticky; bottom: 0; background: #fff;
    display: flex; gap: 8px; border-top: 1px solid var(--line);
  }
  .modal-foot .btn { flex: 1; padding: 12px; font-size: 15px; }
  .form-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .detail-grid { grid-template-columns: 1fr 1fr !important; }
  .detail-grid .item.full { grid-column: 1 / -1; }

  /* ---------- 按钮 / 输入：加大方便手指点 ---------- */
  .btn { padding: 10px 14px; font-size: 14.5px; min-height: 40px; }
  .btn-sm { padding: 8px 12px; font-size: 13.5px; min-height: 37px; }
  .btn-xs { padding: 7px 11px; font-size: 13px; min-height: 34px; }
  input, select, textarea { font-size: 16px !important; }  /* 16px 防止 iOS 自动放大 */
  input[type=text], input[type=password], input[type=number], input[type=date], select {
    min-height: 42px;
  }
  .nav .badge { min-width: 16px; height: 16px; line-height: 16px; font-size: 10.5px; padding: 0 4px; }
  .userbox .btn-sm { min-height: 34px; }

  /* ---------- 其它 ---------- */
  .ledger-item { padding-left: 18px; }
  .pager { flex-wrap: wrap; gap: 6px; }
  .pager button { padding: 8px 12px; }
  /* top:auto 必须写！否则 top:70px + bottom:12px 会撑成满屏透明浮层挡住所有点击 */
  .toast-root { left: 12px; right: 12px; bottom: 12px; top: auto; }
  .toast { width: 100%; max-width: none; }
  .notice { font-size: 13.5px; padding: 11px 12px; }
  .grid-2 { grid-template-columns: 1fr !important; }
}

/* 小屏手机再收一收 */
@media (max-width: 400px) {
  /* 详情保持两列：字段值都很短，一列会把页面拉得很长 */
  .detail-grid { grid-template-columns: 1fr 1fr !important; gap: 10px 12px; }
  .detail-grid .item .v { font-size: 13.5px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card .v { font-size: 21px; }
  .brand span:last-child { font-size: 13px; }
  .login-card { padding: 28px 20px; }
  .filter-body { grid-template-columns: 1fr 1fr; }
}

/* 平板：表格还是表格，但缩小一点 */
@media (min-width: 769px) and (max-width: 1100px) {
  .main { padding: 14px 14px 60px; }
  table.grid { font-size: 12.5px; }
  table.grid th, table.grid td { padding: 8px 8px; }
}

/* 触屏设备：hover 效果去掉，避免点了还留着 */
@media (hover: none) {
  .stat-card.clickable:hover { transform: none; box-shadow: none; }
  table.grid tbody tr:hover { background: transparent; }
}
/* 状态下拉的浅色配色（透明框上的文字+浅底，和标签颜色一致） */
select.quick-status.st-following, select.iv-status-sel.st-following { color:#157a3a; background:#e8f8ee; border-radius:4px; }
select.quick-status.st-interview_promised, select.iv-status-sel.st-interview_promised { color:#9a7308; background:#fdf5e0; border-radius:4px; }
select.quick-status.st-arrived, select.iv-status-sel.st-arrived { color:#c2410c; background:#ffeede; border-radius:4px; }
select.quick-status.st-no_show, select.iv-status-sel.st-no_show { color:#4b5563; background:#eef0f4; border-radius:4px; }
select.quick-status.st-interview_passed, select.iv-status-sel.st-interview_passed { color:#0f766e; background:#d5f5f0; border-radius:4px; }
select.quick-status.st-interview_failed, select.iv-status-sel.st-interview_failed { color:#be123c; background:#ffe4e6; border-radius:4px; }
select.quick-status.st-pending_onboard, select.iv-status-sel.st-pending_onboard { color:#0369a1; background:#e0f2fe; border-radius:4px; }
select.quick-status.st-hired, select.iv-status-sel.st-hired { color:#1d4ed8; background:#e7efff; border-radius:4px; }
select.quick-status.st-resigned_followup, select.iv-status-sel.st-resigned_followup { color:#7e22ce; background:#f5e9fe; border-radius:4px; }
select.quick-status.st-failed, select.iv-status-sel.st-failed { color:#b91c1c; background:#fdeaea; border-radius:4px; }
select.quick-status.st-resigned, select.iv-status-sel.st-resigned { color:#6b7280; background:#f1f3f7; border-radius:4px; }
select.quick-status.st-resigned_unsettled, select.iv-status-sel.st-resigned_unsettled { color:#8a5a2b; background:#f6ead9; border-radius:4px; }
