/* 通讯录 UI v2 */
#content { background: transparent; }

/* 搜索框 */
.ct-search {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 14px 8px; padding: 0 12px;
  height: 42px; border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(120,160,190,.16);
  box-shadow: 0 4px 14px rgba(24,68,102,.05);
}
.ct-search-ico { width: 18px; height: 18px; color: #93A9B9; flex: none; display: flex; }
.ct-search-ico svg { width: 100%; height: 100%; }
.ct-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-size: 14px; color: #17394D;
}
.ct-search input::placeholder { color: #A7BAC8; }
.ct-search-clear {
  border: 0; background: rgba(120,160,190,.14); color: #5D7C90;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.ct-search-clear.hidden { display: none; }

/* 群聊入口卡 */
.ct-hub {
  margin: 0 14px 6px !important;
  border-radius: 16px;
  background: linear-gradient(135deg, #FFFFFF, #F5FAFE) !important;
  box-shadow: 0 6px 18px rgba(24,68,102,.06);
  border: 1px solid rgba(255,255,255,.9);
  padding: 12px 14px !important;
  display: flex; align-items: center; gap: 12px;
}
.ct-hub .name { font-size: 15px; font-weight: 800; color: #17394D; }
.ct-hub .last { font-size: 11.5px; color: #8FA5B5; margin-top: 2px; }
.ct-hub-arrow { margin-left: auto; width: 16px; height: 16px; color: #B6C8D6; display: flex; }
.ct-hub-arrow svg { width: 100%; height: 100%; }

/* 好友总数 */
.ct-count {
  margin: 10px 18px 6px;
  font-size: 11.5px; color: #90A6B6; letter-spacing: .4px;
}

/* 首字母分组 */
#content .conv-group {
  position: static;
  margin: 12px 18px 4px; padding: 2px 0;
  font-size: 12px; font-weight: 800; color: #7C93A5;
  letter-spacing: .8px;
  background: transparent;
}
#content .conv-group em {
  font-style: normal; font-size: 10.5px; font-weight: 600; color: #A7BAC8;
  margin-left: 6px;
}
#content .conv-group em {
  font-style: normal; font-size: 10.5px; font-weight: 600; color: #A7BAC8;
  margin-left: 6px;
}

/* 好友行 */
.ct-row {
  margin: 0 12px 6px !important;
  padding: 10px 13px !important;
  border-radius: 15px;
  background: #fff;
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 3px 12px rgba(24,68,102,.045);
  display: flex; align-items: center; gap: 12px;
  transition: transform .12s ease, box-shadow .16s;
}
.ct-row:active { transform: scale(.99); box-shadow: 0 2px 7px rgba(24,68,102,.08); }
.ct-row .av { flex: none; }
.ct-row .name { font-size: 14.5px; font-weight: 700; color: #17394D; }
.ct-row .last { font-size: 11px; color: #92A8B7; margin-top: 2px; }
.ct-row .body { flex: 1; min-width: 0; }
.ct-chev { width: 15px; height: 15px; color: #C3D2DD; flex: none; display: flex; }
.ct-chev svg { width: 100%; height: 100%; }

/* 新的朋友那一行（老版本是临时插入的 #friendReqRow，保留兼容） */
#friendReqRow {
  margin: 0 14px 6px !important;
  border-radius: 16px;
  background: linear-gradient(135deg, #FFF7F4, #FFEFEA) !important;
  border: 1px solid rgba(240,99,79,.16);
  box-shadow: 0 5px 16px rgba(240,99,79,.08);
}
#friendReqRow .name { font-size: 14.5px; font-weight: 800; color: #8C3A2C; }
#friendReqRow .last { font-size: 11px; color: #B97C6C; }
  /* 去掉基础 .row 自带的箭头，通讯录用自己那颗 */
  .ct-row::after, .ct-hub::after { display: none !important; }
  /* 头像占位（默认头像加载不出来时也别空一块） */
  .ct-row .av, .ct-hub .av { background: linear-gradient(135deg,#7CC4EA,#4BA8E0); }

/* ===== 好友申请：通讯录入口「新的朋友」 ===== */
.ct-freq {
  background: linear-gradient(133deg, #FFFFFF 0%, #FFF6F2 100%) !important;
  border-color: rgba(240,120,96,.20) !important;
  box-shadow: 0 8px 22px rgba(240,110,86,.10) !important;
}
.ct-freq-ico {
  position: relative; flex: none;
  width: 46px; height: 46px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(150deg, #FFB39E, #F0634F);
  box-shadow: 0 6px 16px rgba(240,99,79,.30);
}
.ct-freq-ico svg { width: 23px; height: 23px; }
.ct-freq-n {
  position: absolute; top: -5px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; background: #E84534; color: #fff;
  font-style: normal; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center;
  box-shadow: 0 2px 6px rgba(232,69,52,.40), 0 0 0 2px #FFFDFC;
}
.ct-freq .name { color: #8C3A2C !important; }
.ct-freq .last { color: #B97C6C !important; }

/* 通讯录 tab 的申请红点（JS 动态创建） */
.tabbar div { position: relative; }
.tabbar .tab-dot {
  position: absolute; top: 1px; left: calc(50% + 3px);
  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; background: linear-gradient(160deg, #FF8371, #E84534);
  color: #fff; font-size: 9.5px; font-weight: 800; font-style: normal;
  line-height: 16px; text-align: center; letter-spacing: -.2px;
  box-shadow: 0 2px 6px rgba(232,69,52,.42), 0 0 0 2px rgba(255,255,255,.94);
  pointer-events: none;
}

/* ===== 好友申请弹层 ===== */
#sheetHost .fr-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  margin-bottom: 12px;
}
#sheetHost .fr-head h3 { margin: 0 !important; font-size: 17px; border-bottom: 0 !important; padding: 0 !important; }
#sheetHost .fr-count { font-size: 11.5px; color: #8FA5B5; margin-top: 4px; font-weight: 600; }
#sheetHost .fr-refresh {
  flex: none; width: 32px; height: 32px; border-radius: 50%; padding: 0; border: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(120,160,190,.13); color: #5D7C90;
}
#sheetHost .fr-refresh:active { background: rgba(120,160,190,.22); }
#sheetHost .fr-refresh svg { width: 16px; height: 16px; }
#sheetHost .fr-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 56vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 2px 2px 0;
}
#sheetHost .fr-card {
  background: #fff;
  border: 1px solid rgba(120,160,190,.15);
  border-radius: 18px; padding: 12px 13px 11px;
  box-shadow: 0 6px 18px rgba(24,68,102,.06);
  animation: frCardIn .18s ease both;
}
@keyframes frCardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#sheetHost .fr-top { display: flex; align-items: flex-start; gap: 11px; }
#sheetHost .fr-av {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 15px; overflow: hidden;
  background: linear-gradient(135deg, #7CC4EA, #4BA8E0);
}
#sheetHost .fr-av-fb {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 17px;
}
#sheetHost .fr-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#sheetHost .fr-body { flex: 1; min-width: 0; }
#sheetHost .fr-name {
  font-size: 15px; font-weight: 800; color: #17394D; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#sheetHost .fr-sub { font-size: 11px; color: #93A9B9; margin-top: 2px; }
#sheetHost .fr-hello {
  display: inline-block; max-width: 100%; margin-top: 7px; padding: 6px 9px;
  border-radius: 10px; background: #F4FAFE;
  font-size: 12.5px; color: #4E6C80; line-height: 1.45; word-break: break-word;
}
#sheetHost .fr-time { flex: none; font-size: 10.5px; color: #A7BAC8; padding-top: 2px; }
#sheetHost .fr-acts { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 8px; margin-top: 11px; }
#sheetHost .fr-acts button {
  flex: 1 1 0; min-width: 0; height: 34px; border: 0; border-radius: 11px;
  font-size: 13px; font-weight: 800; letter-spacing: .5px;
}
#sheetHost .fr-ok {
  background: linear-gradient(160deg, #8FD0F2, #3E8FC9) !important; color: #fff !important;
  box-shadow: 0 5px 13px rgba(62,143,201,.28);
}
#sheetHost .fr-ok:active { transform: scale(.975); }
#sheetHost .fr-no { background: rgba(120,160,190,.13) !important; color: #5D7C90 !important; }
#sheetHost .fr-no:active { background: rgba(120,160,190,.22) !important; }
#sheetHost .fr-acts button[disabled] { opacity: .55; }
#sheetHost .fr-empty { text-align: center; padding: 30px 10px 22px; }
#sheetHost .fr-empty-ico {
  width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #EAF6FE, #D4EBFA); color: #5DA9DC;
}
#sheetHost .fr-empty-ico svg { width: 30px; height: 30px; }
#sheetHost .fr-empty-t { font-size: 13.5px; font-weight: 800; color: #17394D; }
#sheetHost .fr-empty-s { font-size: 11.5px; color: #93A9B9; margin-top: 6px; line-height: 1.6; word-break: break-all; }
#sheetHost .fr-empty-s b { color: #5D7C90; font-weight: 700; }

/* 深色 */
body.dark .ct-freq {
  background: linear-gradient(133deg, #17313F 0%, #1C2B36 100%) !important;
  border-color: rgba(240,120,96,.24) !important;
}
body.dark .ct-freq .name { color: #FFC9B8 !important; }
body.dark .ct-freq .last { color: #D29A8A !important; }
body.dark .ct-freq-n { box-shadow: 0 2px 6px rgba(0,0,0,.4), 0 0 0 2px rgba(23,49,63,.95); }
body.dark .tabbar .tab-dot { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 2px rgba(23,49,63,.95); }
body.dark #sheetHost .fr-card { background: #16304A !important; border-color: rgba(255,255,255,.08) !important; }
body.dark #sheetHost .fr-name { color: #E8F1F8; }
body.dark #sheetHost .fr-sub, body.dark #sheetHost .fr-time { color: #8FB0C7; }
body.dark #sheetHost .fr-hello { background: rgba(255,255,255,.07); color: #B9CFE0; }
body.dark #sheetHost .fr-no { background: rgba(255,255,255,.10) !important; color: #BFD6E6 !important; }
body.dark #sheetHost .fr-refresh { background: rgba(255,255,255,.10); color: #BFD6E6; }
body.dark #sheetHost .fr-empty-ico { background: linear-gradient(150deg, #1B3A52, #16303F); color: #7FBEE4; }
body.dark #sheetHost .fr-empty-t { color: #E8F1F8; }
body.dark #sheetHost .fr-empty-s { color: #8FB0C7; }
body.dark #sheetHost .fr-empty-s b { color: #BFD6E6; }
body.dark #sheetHost .fr-count { color: #8FB0C7; }

