/* ============================================================
   contacts.css — 通讯录列表 / 好友资料 / 编辑资料 / 群信息
   严格微信配色：白底列表、灰分区、绿主色 #07C160
   ============================================================ */

/* ===================== 通讯录 Tab 列表 ===================== */
.ct-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--wx-bg);
  overflow: hidden;
}

.ct-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.ct-scroll::-webkit-scrollbar { display: none; }

/* 顶部功能行（新的朋友 / 群聊 / 标签） */
.ct-util-group {
  background: #fff;
  margin-top: 10px;
}
.ct-util {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  position: relative;
  cursor: pointer;
}
.ct-util:active { background: #EBEBEB; }
.ct-util + .ct-util::before {
  content: "";
  position: absolute;
  left: 56px;
  right: 0;
  top: 0;
  height: .5px;
  background: var(--wx-line-soft);
}
.ct-util .util-icon {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 19px;
  overflow: hidden;
}
.ct-util .util-icon svg { width: 22px; height: 22px; }
.ct-util .util-main { flex: 1; font-size: 16px; }
.ct-util .util-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--wx-red);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

/* 字母分组标题（吸顶） */
.ct-section-head {
  position: sticky;
  top: 0;
  background: #F2F2F2;
  padding: 4px 15px;
  font-size: 13px;
  color: var(--wx-text-sub);
  z-index: 5;
}

/* 好友行 */
.ct-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 8px 12px;
  position: relative;
  cursor: pointer;
}
.ct-row:active { background: #EBEBEB; }
.ct-row + .ct-row::before {
  content: "";
  position: absolute;
  left: 56px;
  right: 0;
  top: 0;
  height: .5px;
  background: var(--wx-line-soft);
}
.ct-row .ct-avatar {
  width: 40px;
  height: 40px;
  border-radius: 5px;
  object-fit: cover;
  background: #d8d8d8;
  flex: none;
}
.ct-row .ct-name {
  flex: 1;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-row .ct-tag {
  font-size: 12px;
  color: var(--wx-text-faint);
  flex: none;
}

/* 右侧 A-Z 字母索引 */
.ct-abc {
  position: absolute;
  right: 2px;
  top: 0;
  bottom: 0;
  width: 18px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  touch-action: none;
}
.ct-abc .abc {
  font-size: 10px;
  color: #576B95;
  text-align: center;
  line-height: 12px;
  padding: 1px 0;
  font-weight: 500;
}
.ct-abc .abc.active {
  color: #fff;
  background: var(--wx-green);
  border-radius: 3px;
  transform: scale(1.05);
}
.ct-abc-tip {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: rgba(40, 40, 40, .85);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  pointer-events: none;
}

/* 搜索框（可输入态） */
.ct-search {
  padding: 7px 12px;
  background: var(--wx-bg);
  flex: none;
}
.ct-search .ct-search-inner {
  background: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
}
.ct-search .ct-search-inner svg {
  width: 15px;
  height: 15px;
  color: #B2B2B2;
  flex: none;
}
.ct-search input {
  flex: 1;
  font-size: 15px;
  background: transparent;
}

/* 「新的朋友」发现列表（弹层） */
.ct-discover-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 920;
}
.ct-discover-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 8%;
  background: var(--wx-bg);
  border-radius: 14px 14px 0 0;
  z-index: 921;
  display: flex;
  flex-direction: column;
  animation: ctSlideUp .25s ease;
}
@keyframes ctSlideUp { from { transform: translateY(30%); } to { transform: translateY(0); } }
.ct-discover-panel .dp-head {
  padding: 14px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  background: #fff;
  border-radius: 14px 14px 0 0;
  position: relative;
  flex: none;
}
.ct-discover-panel .dp-close {
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 15px;
  color: var(--wx-text-sub);
}
.ct-discover-panel .dp-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ct-discover-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 10px 12px;
  position: relative;
}
.ct-discover-row + .ct-discover-row::before {
  content: "";
  position: absolute;
  left: 56px;
  right: 0;
  top: 0;
  height: .5px;
  background: var(--wx-line-soft);
}
.ct-discover-row img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}
.ct-discover-row .dp-info { flex: 1; min-width: 0; }
.ct-discover-row .dp-name { font-size: 16px; }
.ct-discover-row .dp-sig {
  font-size: 12px;
  color: var(--wx-text-sub);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-discover-row .dp-add {
  background: var(--wx-green);
  color: #fff;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 4px;
  flex: none;
}
.ct-discover-row .dp-add.added { background: #C7C7CC; }

/* ===================== 好友资料页 ===================== */
.fp-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--wx-bg);
  overflow: hidden;
}
.fp-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.fp-scroll::-webkit-scrollbar { display: none; }

/* 顶部大资料卡 */
.fp-hero {
  background: #fff;
  padding: 22px 15px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.fp-hero img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #d8d8d8;
  flex: none;
}
.fp-hero .fp-hero-info { flex: 1; min-width: 0; }
.fp-hero .fp-realname {
  font-size: 20px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-hero .fp-wxid { font-size: 14px; color: var(--wx-text-sub); margin-top: 6px; }

/* 资料行 */
.fp-group { background: #fff; margin-top: 10px; }
.fp-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  position: relative;
}
.fp-cell + .fp-cell::before {
  content: "";
  position: absolute;
  left: 15px;
  right: 0;
  top: 0;
  height: .5px;
  background: var(--wx-line-soft);
}
.fp-cell .fp-label { width: 76px; color: var(--wx-text-sub); font-size: 15px; flex: none; }
.fp-cell .fp-value { flex: 1; font-size: 16px; }
.fp-cell .fp-arrow { color: #C7C7CC; }
.fp-cell.tappable { cursor: pointer; }
.fp-cell.tappable:active { background: #EBEBEB; }

/* 标签行 */
.fp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 15px;
  background: #fff;
  margin-top: 10px;
}
.fp-tag-chip {
  background: #F2F2F2;
  color: #4C4C4C;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 4px;
}
.fp-tag-chip.add {
  background: #fff;
  border: 1px dashed #C7C7CC;
  color: var(--wx-text-sub);
  cursor: pointer;
}

/* 操作按钮组：朋友圈 / 音视频通话 */
.fp-action { background: #fff; margin-top: 10px; }
.fp-action .fp-cell.tappable {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.fp-action .fp-act-icon {
  width: 22px;
  height: 22px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wx-text-main);
}
.fp-action .fp-act-icon svg { width: 22px; height: 22px; }

/* 大操作按钮：发消息 / 音视频 */
.fp-bigbtns {
  background: #fff;
  margin-top: 10px;
  padding: 8px 12px 16px;
  display: flex;
  gap: 12px;
}
.fp-bigbtn {
  flex: 1;
  border-radius: 6px;
  padding: 10px 0;
  text-align: center;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.fp-bigbtn svg { width: 20px; height: 20px; }
.fp-bigbtn.primary { background: var(--wx-green); color: #fff; }
.fp-bigbtn.plain { background: #fff; color: var(--wx-text-main); border: .5px solid var(--wx-line); }
.fp-bigbtn:active { opacity: .85; }

/* 开关 */
.fp-switch {
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: #D8D8D8;
  position: relative;
  flex: none;
  transition: background .2s;
  cursor: pointer;
}
.fp-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: left .2s;
}
.fp-switch.on { background: var(--wx-green); }
.fp-switch.on::after { left: 20px; }

/* 底部删除好友 */
.fp-del { margin: 18px 0 24px; }
.fp-del .fp-del-inner {
  background: #fff;
  text-align: center;
  color: var(--wx-red);
  font-size: 16px;
  padding: 12px 0;
  cursor: pointer;
}
.fp-del .fp-del-inner:active { background: #EBEBEB; }

/* ===================== 编辑资料页 ===================== */
.ef-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--wx-bg);
  overflow: hidden;
}
.ef-scroll { flex: 1; overflow-y: auto; }
.ef-scroll::-webkit-scrollbar { display: none; }
.ef-avatar-row {
  background: #fff;
  padding: 16px 15px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.ef-avatar-row:active { background: #EBEBEB; }
.ef-avatar-row img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}
.ef-avatar-row .ef-up { font-size: 14px; color: var(--wx-blue); }
.ef-field {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 11px 15px;
  position: relative;
}
.ef-field + .ef-field::before {
  content: "";
  position: absolute;
  left: 15px;
  right: 0;
  top: 0;
  height: .5px;
  background: var(--wx-line-soft);
}
.ef-field label { width: 92px; font-size: 15px; color: var(--wx-text-sub); flex: none; }
.ef-field input, .ef-field textarea {
  flex: 1;
  font-size: 16px;
  background: transparent;
  resize: none;
}
.ef-hint {
  padding: 10px 15px;
  font-size: 12px;
  color: var(--wx-text-faint);
  line-height: 1.5;
}
.ef-gender { display: flex; gap: 20px; flex: 1; }
.ef-gender label { width: auto; display: flex; align-items: center; gap: 5px; color: var(--wx-text-main); font-size: 16px; cursor: pointer; }

/* ===================== 群信息页 ===================== */
.gi-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--wx-bg);
  overflow: hidden;
}
.gi-scroll { flex: 1; overflow-y: auto; padding-bottom: 24px; }
.gi-scroll::-webkit-scrollbar { display: none; }

/* 群成员宫格 */
.gi-members {
  background: #fff;
  margin-top: 10px;
  padding: 12px 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px 6px;
}
.gi-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.gi-cell img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}
.gi-cell .gi-mname {
  font-size: 11px;
  color: var(--wx-text-sub);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* 群信息行 */
.gi-group { background: #fff; margin-top: 10px; }
.gi-cellrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  position: relative;
  cursor: pointer;
}
.gi-cellrow:active { background: #EBEBEB; }
.gi-cellrow + .gi-cellrow::before {
  content: "";
  position: absolute;
  left: 15px;
  right: 0;
  top: 0;
  height: .5px;
  background: var(--wx-line-soft);
}
.gi-cellrow .gi-label { color: var(--wx-text-sub); font-size: 15px; flex: none; }
.gi-cellrow .gi-val { flex: 1; text-align: right; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-cellrow .gi-arrow { color: #C7C7CC; }

/* 群公告多行 */
.gi-announce {
  display: flex;
  flex-direction: column;
  padding: 11px 15px;
  position: relative;
  cursor: pointer;
}
.gi-announce:active { background: #EBEBEB; }
.gi-announce .gi-label { color: var(--wx-text-sub); font-size: 15px; }
.gi-announce .gi-val { margin-top: 5px; font-size: 16px; line-height: 1.4; }

/* 退出群聊 */
.gi-exit {
  background: #fff;
  margin-top: 10px;
  text-align: center;
  color: var(--wx-red);
  font-size: 16px;
  padding: 12px 0;
  cursor: pointer;
}
.gi-exit:active { background: #EBEBEB; }

/* 响应式：窄屏 */
@media (max-width: 360px) {
  .gi-members { grid-template-columns: repeat(4, 1fr); }
  .fp-hero .fp-realname { font-size: 18px; }
}
