/* ============================================================================
 * frontend/address_book.css · 通讯录（前台整页）
 * 复刻对标站 scrm.gdzhongke.cn「通讯录」页 + 8766 统一规范
 * ========================================================================== */

/* 页面整体：参与 flex 链，保证内部表格可滚、底部不被 fixed 分页条遮 */
#address_bookView .wk-page-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
#address_bookHost {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ---------------------------------------------------------------- 页头 */
.ab-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  flex: none;
}
.ab-title-wrap { display: flex; align-items: baseline; gap: 10px; }
.ab-page-title { margin: 0; font-size: 17px; font-weight: 600; color: #1f2a37; }
.ab-page-sub { font-size: 12px; color: #8a94a6; }
.ab-head-actions { display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------- 筛选行 */
.ab-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 10px;
  flex: none;
  flex-wrap: wrap;
}
.ab-search-box { position: relative; display: flex; align-items: center; gap: 6px; }
.ab-search-box input {
  height: 32px;
  width: 250px;
  padding: 0 10px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
.ab-search-box input:focus { border-color: #0052cc; }
.ab-search-clear {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  color: #5b6472;
  cursor: pointer;
  flex: none;
}
.ab-search-clear:hover { border-color: #0052cc; color: #0052cc; }

.ab-sel {
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  color: #46536a;
  outline: none;
  cursor: pointer;
}
.ab-sel:focus { border-color: #0052cc; }

.ab-scope-chip {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  color: #5b6472;
  cursor: pointer;
  white-space: nowrap;
}
.ab-scope-chip:hover { border-color: #0052cc; color: #0052cc; }
.ab-scope-chip.is-active {
  background: #fffbef;
  border-color: #f5a623;
  color: #d97706;
  font-weight: 600;
}

/* ------------------------------------------------- 主体（列表 + A-Z 索引） */
.ab-body {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 0 16px calc(var(--active-pager-height, 58px) + 14px);
  gap: 6px;
}
.ab-list-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.ab-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #e8ecf2;
  border-radius: 8px;
}
/* 2026-10-21 boss：通讯录表格右侧"全部"看到空白 —— 根因是 .cfg-table 的
   min-width:max-content/width:max-content 叠加 colgroup 列宽，在表格里有隐藏列时
   算不出宽度 → 表格被撑到 100 万 px，单元格内容全甩到屏幕外。
   这里强制按列宽布局 + 不超过容器，内容才能正常落在可视区。 */
.ab-table-wrap table.cfg-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
  font-size: 13px;
}
.ab-table-wrap { overflow-x: auto; max-width: 100%; }
.ab-table-wrap table.cfg-table td,
.ab-table-wrap table.cfg-table th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
  border-bottom: 1px solid #e8ecf2;
  padding: 0;
  height: 38px;
  text-align: left;
  font-weight: 600;
  color: #46536a;
  white-space: nowrap;
}
.ab-table-wrap tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f3f7;
  color: #2c3849;
  vertical-align: middle;
}
.ab-table-wrap tbody tr.ab-row:nth-child(even) td { background: #f4f6f9; }
.ab-table-wrap tbody tr.ab-row:hover td { background: #eef2f7; }

/* 分组标题行 */
.ab-group-head td {
  background: #fafbfc !important;
  padding: 4px 10px !important;
  border-bottom: 1px solid #eef1f5;
}
.ab-group-badge {
  display: inline-block;
  min-width: 20px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: #0052cc;
}
.ab-group-count { font-size: 12px; color: #98a2b3; margin-left: 4px; }
.ab-group-flash td { background: #fffbef !important; transition: background .4s; }

/* 姓名单元格（头像 + 名字 + 岗位小字） */
.ab-name-cell { display: flex; align-items: center; gap: 8px; }
.ab-avatar {
  width: 28px; height: 28px;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.ab-name-main { min-width: 0; }
.ab-link { color: #0052cc; text-decoration: none; }
.ab-link:hover { text-decoration: underline; }
.ab-dimm { color: #b6bdc9; }
.ab-empty { text-align: center; padding: 40px 0; color: #b6bdc9; font-size: 13px; }

.ab-status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; line-height: 18px; }
.ab-status.on  { background: #eef7ee; color: #3f9142; }
.ab-status.off { background: #f5f5f5; color: #a0a6b0; }

/* 分页条：复用全站 .wk-pager（与客户列表 100% 一致） */
#address_bookView .wk-pager { margin-top: 4px; }

/* ------------------------------------------------------ A-Z 索引栏 */
.ab-index-bar {
  flex: none;
  width: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 4px 0;
  user-select: none;
}
.ab-index-item {
  width: 20px;
  height: 17px;
  line-height: 17px;
  padding: 0;
  border: none;
  background: none;
  font-size: 11px;
  font-weight: 600;
  color: #0052cc;
  cursor: pointer;
  border-radius: 3px;
}
.ab-index-item:hover { background: #eaf2ff; }
.ab-index-item.is-active { background: #0052cc; color: #fff; }
.ab-index-item.is-empty { color: #c9cfd8; cursor: default; }
.ab-index-item.is-empty:hover { background: none; }

/* ------------------------------------------------- 列拖拽把手 */
#address_bookHost .cfg-th-inner { display: flex; align-items: center; height: 38px; padding: 0 8px; gap: 4px; }
#address_bookHost .cfg-drag { cursor: grab; color: #b6bdc9; font-size: 12px; user-select: none; }
#address_bookHost .cfg-drag:active { cursor: grabbing; }
#address_bookHost .sort-th {
  background: none; border: none; cursor: pointer;
  font-weight: 600; color: #46536a; font-size: 13px;
  white-space: nowrap; padding: 0;
}
#address_bookHost .sort-th:hover { color: #0052cc; }
#address_bookHost .sort-th.active { color: #0052cc; }
#address_bookHost .sort-th.static { cursor: default; }
#address_bookHost .col-resizer {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
}
#address_bookHost .col-resizer:hover { background: #d6e4ff; }
#address_bookHost thead th { position: sticky; top: 0; }
#address_bookHost .cfg-th { position: relative; }

/* ------------------------------------------------- 字段配置弹窗 */
.ab-col-cfg { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.ab-col-cfg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: #2c3849;
  cursor: pointer;
}
.ab-col-cfg-row:hover { background: #f4f6f9; }
.ab-col-cfg-row input { cursor: pointer; }

/* ------------------------------------------------------ 详情内容 */
.ab-detail { padding: 4px 0; }
.ab-kv-row {
  display: flex;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid #f0f3f7;
  font-size: 13px;
}
.ab-kv-row:last-child { border-bottom: none; }
.ab-kv-k { flex: none; width: 96px; color: #8a94a6; }
.ab-kv-v { flex: 1; color: #2c3849; word-break: break-all; }

/* ------------------------------------------------------ 窄屏适配 */
@media (max-width: 1100px) {
  .ab-search-box input { width: 190px; }
  .ab-index-bar { display: none; }
}

/* ============ 左侧「企业组织架构」部门树（对标站口径）· 2026-10-17 ============ */
.ab-main{display:flex;gap:0;align-items:stretch;min-height:420px}
.ab-side{width:236px;flex:0 0 236px;border-right:1px solid #eef1f5;padding:6px 0 12px;background:#fcfdfe}
.ab-side-head{display:flex;align-items:center;justify-content:space-between;padding:8px 14px 10px}
.ab-side-title{font-size:13px;font-weight:600;color:#3d4a5c;letter-spacing:.3px}
.ab-side-all{font-size:12px;color:#8b95a5;cursor:pointer;padding:2px 8px;border-radius:10px}
.ab-side-all:hover{color:#0052cc;background:#eef4ff}
.ab-side-all.is-active{color:#0052cc;background:#e8f0ff;font-weight:600}
.ab-tree{padding:0 6px;max-height:calc(100vh - 300px);overflow:auto}
.ab-tree-loading,.ab-tree-empty{font-size:12px;color:#a3adbb;padding:12px 14px}
.ab-tree-row{display:flex;align-items:center;gap:5px;height:32px;border-radius:7px;cursor:pointer;
  font-size:13px;color:#46505f;transition:background .12s;user-select:none}
.ab-tree-row:hover{background:#f2f6fb}
.ab-tree-row.is-active{background:#e8f0ff;color:#0052cc;font-weight:600}
.ab-tree-caret{width:14px;flex:0 0 14px;text-align:center;font-size:10px;color:#9aa5b4;
  transition:transform .15s;display:inline-block}
.ab-tree-caret.is-open{transform:rotate(90deg)}
.ab-tree-caret.is-empty{opacity:0;pointer-events:none}
.ab-tree-ico{font-size:12px;flex:0 0 auto}
.ab-tree-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ab-tree-n{flex:0 0 auto;font-size:11px;color:#8b95a5;background:#eef1f5;border-radius:9px;
  padding:1px 7px;min-width:18px;text-align:center}
.ab-tree-row.is-active .ab-tree-n{background:#d3e2ff;color:#0052cc}
.ab-content{flex:1;min-width:0}

/* ===== 2026-10-21 boss：通讯录改表格 + 智能体标识 + 电子名片 ===== */
.ab-kind-seg{display:inline-flex;background:#f0f3f8;border-radius:9px;padding:3px;gap:2px;margin-right:10px}
.ab-kind-i{border:0;background:transparent;font-size:13px;color:#5b6675;padding:6px 14px;border-radius:7px;cursor:pointer}
.ab-kind-i:hover{color:#0052cc}
.ab-kind-i.is-on{background:#fff;color:#0052cc;font-weight:600;box-shadow:0 1px 3px rgba(20,30,60,.12)}
/* 智能体标识 */
.ab-ai-tag{font-size:12px;margin-right:3px}
.ab-avatar-ai{background:linear-gradient(135deg,#6366F1,#3B82F6);color:#fff;font-size:15px;display:flex;align-items:center;justify-content:center}
.ab-name-cell.is-ai .wk-main-name{color:#4F46E5}
.ab-wx{cursor:pointer;border-bottom:1px dashed #b6d4ef}
.ab-card-btn{padding:2px 9px!important;font-size:12px!important}
/* 电子名片 */
.ab-card{width:100%;max-width:420px;margin:0 auto;border:1px solid #e6ebf2;border-radius:14px;
  background:linear-gradient(160deg,#ffffff 0%,#f7fafd 100%);box-shadow:0 6px 20px rgba(20,30,60,.08);overflow:hidden}
.ab-card-top{display:flex;align-items:center;gap:12px;padding:18px 18px 12px;border-bottom:1px dashed #e6ebf2}
.ab-card-av{width:52px;height:52px;border-radius:50%;background:#0052CC;color:#fff;font-size:22px;font-weight:700;
  display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.ab-card-av.is-ai{background:linear-gradient(135deg,#6366F1,#3B82F6)}
.ab-card-id{flex:1;min-width:0}
.ab-card-name{font-size:19px;font-weight:700;color:#1F2A37}
.ab-card-title{font-size:12.5px;color:#5B6675;margin-top:3px}
.ab-card-badge{font-size:11px;color:#0052CC;background:#eaf2ff;border-radius:9px;padding:3px 9px;flex:0 0 auto}
.ab-card-body{padding:14px 18px 8px}
.ab-card-line{display:flex;align-items:flex-start;gap:8px;font-size:13.5px;color:#2b3648;padding:5px 0;word-break:break-all}
.ab-card-ic{width:18px;flex:0 0 18px;text-align:center;opacity:.85}
.ab-card-foot{padding:10px 18px 14px;font-size:11px;color:#a8b2c0;letter-spacing:.4px}
.ab-card-actions{display:flex;gap:10px;justify-content:center;margin-top:14px}
.ab-card-tip{font-size:12px;color:#8b95a5;text-align:center;margin-top:10px;line-height:1.6}

/* ===== 电子名片：按 boss 实体名片版式重做（正反面，90×54mm 5:3）=====
   所有尺寸用 cqw（=名片宽度的 1%），整张卡随容器等比缩放，印出来就是实物比例 */
.ab-card-wrap{container-type:inline-size;width:100%;max-width:520px;aspect-ratio:90/54;margin:0 auto;
  border-radius:8px;overflow:hidden;box-shadow:0 10px 30px rgba(16,32,64,.16);background:#EFEFEF}
.zkc-img{width:100%;height:100%;display:block;object-fit:fill}
.ab-card-tabs{display:flex;gap:8px;justify-content:center;margin-bottom:12px}
.ab-card-tabs button{border:1px solid #d8dfe9;background:#fff;color:#4a5568;border-radius:16px;
  padding:5px 18px;font-size:13px;cursor:pointer}
.ab-card-tabs button.is-on{background:#0A4FB8;border-color:#0A4FB8;color:#fff}
.zkc{position:relative;width:100%;height:100%;background:#EFEFEF;overflow:hidden;
  font-family:"Microsoft YaHei","PingFang SC","Source Han Sans SC",sans-serif}
.zkc-band{position:absolute;left:0;right:0;bottom:0;height:11.5cqw;background:#0A2A66}
/* —— 正面 —— */
.zkc-left{position:absolute;left:0;top:0;width:31cqw;height:100%;display:flex;flex-direction:column;
  align-items:center;padding-top:7.5cqw}
.zkc-logo{width:11cqw;height:11cqw}
.zkc-org{margin-top:2.6cqw;font-size:3.05cqw;font-weight:700;color:#0A2A66;letter-spacing:.05cqw;
  white-space:nowrap}
.zkc-org-en{margin-top:.7cqw;font-size:1.85cqw;color:#7C8798;letter-spacing:.05cqw}
.zkc-main{position:absolute;left:34cqw;right:4.5cqw;top:7.2cqw}
.zkc-name{font-size:8.2cqw;font-weight:700;color:#0A2A66;letter-spacing:.55cqw;line-height:1.05;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.zkc-title{margin-top:1.1cqw;font-size:2.85cqw;color:#546274;letter-spacing:.05cqw}
.zkc-row{display:flex;gap:1.2cqw;margin-top:1.9cqw;color:#0A2A66}
.zkc-i{flex:0 0 auto;display:flex;align-items:flex-start;padding-top:.45cqw;color:#0A2A66}
.zkc-i svg{width:2.5cqw;height:2.5cqw}
.zkc-orgs>div{font-size:2.5cqw;color:#16233B;line-height:1.55;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.zkc-org2{font-size:2.4cqw!important;color:#26334A!important}
.zkc-addr{font-size:2.3cqw!important;color:#5A6779!important}
.zkc-strong{font-size:2.85cqw;color:#16233B;line-height:1.55;white-space:nowrap}
.zkc-small{font-size:2.3cqw;color:#546274;line-height:1.55;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
/* —— 反面 —— */
.zkc-blk{position:absolute;top:7.2cqw}
.zkc-blk-1{left:5cqw;width:38.5cqw}
.zkc-blk-2{left:47cqw;width:28cqw}
.zkc-h{display:flex;align-items:center;gap:1.5cqw}
.zkc-no{width:4.3cqw;height:4.3cqw;background:#2F95D0;color:#fff;font-size:2.85cqw;font-weight:700;
  display:flex;align-items:center;justify-content:center;border-radius:.35cqw;flex:0 0 auto}
.zkc-ht{font-size:3.4cqw;font-weight:700;color:#141414}
.zkc-hr{height:.3cqw;background:#2F95D0;margin:1.2cqw 0 1.7cqw}
.zkc-list{margin:0;padding:0;list-style:none}
.zkc-list li{font-size:2.2cqw;color:#1c1c1c;line-height:1.78;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis}
.zkc-cols{display:grid;grid-template-columns:1fr 1fr;column-gap:2.6cqw}
.zkc-cols span{font-size:2.2cqw;color:#1c1c1c;line-height:1.78;white-space:nowrap}
.zkc-cols span:nth-child(even){border-left:1px solid #D3D9E3;padding-left:2.4cqw}
.zkc-qr{position:absolute;right:4cqw;top:7.2cqw;width:16.2cqw;height:16.2cqw;background:#fff;
  padding:1.7cqw;border-radius:.5cqw;box-sizing:border-box}
.zkc-qr canvas,.zkc-qr img{width:100%!important;height:100%!important;display:block}
.ab-card-hint{text-align:center;font-size:11.5px;color:#8b95a5;margin-top:10px}
.ab-card-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:12px}
.ab-card-tip{font-size:11.5px;color:#98a2b3;text-align:center;margin-top:10px;line-height:1.6}
/* 编辑简历弹窗头部 */
.ab-edit-head{display:flex;align-items:center;gap:10px;padding:2px 0 12px;border-bottom:1px solid #eef2f7;margin-bottom:10px}
.ab-edit-av{width:40px;height:40px;border-radius:50%;background:#0052CC;color:#fff;font-weight:700;
  display:flex;align-items:center;justify-content:center;font-size:16px;flex:0 0 auto}
.ab-edit-av.is-ai{background:linear-gradient(135deg,#6366F1,#3B82F6)}
.ab-edit-sub{font-size:12px;color:#8b95a5;margin-top:2px}

/* 2026-10-21 表头拖拽调列顺序 */
#abListArea .cfg-th[draggable="true"]{cursor:grab}
#abListArea .cfg-th[draggable="true"]:active{cursor:grabbing}
#abListArea .cfg-th.ab-dragging{opacity:.45;background:#eef4fb}
#abListArea .cfg-th.cfg-th-drop{box-shadow:inset 3px 0 0 #2f6fed}
