/* IM 企业通讯 - 仿微信风格 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: 14px; color: #1a1a1a; }
.hidden { display: none !important; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 16px; outline: none; }

/* ---------------- 登录页 ---------------- */
#login-view {
  height: 100vh; height: 100dvh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1b1c26 0%, #2e3140 60%, #3a4150 100%);
}
.login-card {
  width: 340px; padding: max(44px, env(safe-area-inset-top)) 36px 30px; background: #fff; border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); text-align: center;
}
.login-logo {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 16px;
  background: #07c160; color: #fff; font-size: 30px; font-weight: bold;
  line-height: 72px; letter-spacing: 1px;
}
.login-title { font-size: 18px; color: #333; margin-bottom: 26px; }
.login-field { margin-bottom: 14px; }
.login-field input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid #e0e0e0;
  border-radius: 4px; background: #f7f7f7;
}
.login-field input:focus { border-color: #07c160; background: #fff; }
.login-btn {
  width: 100%; height: 42px; margin-top: 6px; background: #07c160; color: #fff;
  border-radius: 4px; font-size: 16px; letter-spacing: 6px;
}
.login-btn:hover { background: #06ad56; }
.login-err { color: #fa5151; font-size: 12px; min-height: 18px; margin-top: 10px; }
.login-reg { font-size: 12px; color: #888; margin-top: 4px; }
.login-reg a { color: #576b95; cursor: pointer; }

/* ---------------- 主界面三栏 ---------------- */
#main-view { height: 100vh; height: 100dvh; display: flex; background: #f5f5f5; }

/* 左侧导航 */
.nav-left {
  width: 60px; background: #2e2e2e; display: flex; flex-direction: column;
  align-items: center; padding: 18px 0; flex-shrink: 0;
}
.nav-logo {
  width: 38px; height: 38px; border-radius: 8px; background: #07c160; color: #fff;
  font-weight: bold; font-size: 15px; line-height: 38px; text-align: center; margin-bottom: 24px;
}
.nav-item { width: 42px; height: 42px; border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; margin-bottom: 8px; color: #9b9b9b; position: relative; }
.nav-item svg { width: 24px; height: 24px; }
.nav-me-avatar {
  width: 32px; height: 32px; border-radius: 6px; background: #3d3d3d; color: #fff;
  font-size: 14px; line-height: 32px; text-align: center; overflow: hidden;
  background-size: cover; background-position: center; flex-shrink: 0;
}
.nav-me-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-item:hover { background: #3d3d3d; color: #d5d5d5; }
.nav-item.active { color: #07c160; }
.nav-item.active::before {
  content: ''; position: absolute; left: -9px; top: 10px; width: 4px; height: 22px;
  background: #07c160; border-radius: 2px;
}
.nav-spacer { flex: 1; }

/* 中间列表 */
.panel-mid { width: 260px; background: #f7f7f7; border-right: 1px solid #e0e0e0; display: flex; flex-direction: column; flex-shrink: 0; }
/* 会话列表与聊天区分隔条（可拖动调整大小） */
.splitter {
  width: 5px; flex-shrink: 0; cursor: col-resize; position: relative; z-index: 6;
}
.splitter::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 2px; width: 1px; background: transparent;
}
.splitter:hover::after, .splitter.active::after { background: #07c160; }
.panel-header {
  height: 50px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; background: #f7f7f7; border-bottom: 1px solid #e7e7e7; flex-shrink: 0;
}
#mid-title { font-size: 15px; font-weight: bold; }
.mini-btn {
  padding: 3px 8px; font-size: 12px; color: #576b95; border: 1px solid #d5d9e0;
  border-radius: 4px; background: #fff;
}
.mini-btn:hover { background: #f0f2f5; }
.mid-search { padding: 8px 10px; }
.mid-search input {
  width: 100%; height: 28px; border-radius: 4px; border: none; background: #e2e2e2;
  padding: 0 10px; font-size: 12px;
}
.list-body { flex: 1; overflow-y: auto; }
#contact-wrap { flex-direction: column; }

/* 会话项 */
.session-item {
  display: flex; padding: 10px 12px; cursor: pointer; align-items: center;
}
.session-item:hover { background: #ececec; }
.session-item.active { background: #c7c7c7; }
.session-mid { flex: 1; margin-left: 10px; overflow: hidden; }
.session-top { display: flex; justify-content: space-between; align-items: center; }
.session-name { font-size: 14px; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-time { font-size: 11px; color: #b2b2b2; flex-shrink: 0; margin-left: 6px; }
.session-bottom { display: flex; justify-content: space-between; margin-top: 3px; }
.session-preview { font-size: 12px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  min-width: 16px; height: 16px; padding: 0 4px; background: #fa5151; color: #fff;
  border-radius: 8px; font-size: 11px; line-height: 16px; text-align: center; flex-shrink: 0;
  margin-top: 4px;
}
.badge.mention { background: #fa9d3b; }

/* 头像 */
.avatar {
  width: 40px; height: 40px; border-radius: 4px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: bold; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; border-radius: 8px; font-size: 26px; }
.avatar-xl { width: 90px; height: 90px; border-radius: 12px; font-size: 36px; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.online-dot { position: relative; }
.online-dot::after {
  content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  background: #07c160; border-radius: 50%; border: 2px solid #f7f7f7;
}

/* 通讯录 */
.dept-block { }
.dept-title {
  padding: 8px 12px; font-size: 12px; color: #888; background: #f0f0f0;
  cursor: pointer; user-select: none;
}
.dept-users { }
.contact-item { display: flex; align-items: center; padding: 8px 12px; cursor: pointer; }
.contact-item:hover { background: #ececec; }
/* 通讯录好友右侧「删除」按钮（危险操作，贴行最右） */
.contact-del {
  flex-shrink: 0; margin-left: auto; padding: 5px 12px; font-size: 12px; color: #fa5151;
  background: #fff; border: 1px solid #fa5151; border-radius: 4px; cursor: pointer;
}
.contact-del:hover { background: #fff5f5; }
.contact-info { margin-left: 10px; }
.contact-name { font-size: 14px; }
.contact-title { font-size: 11px; color: #999; }

/* 通讯录入口与好友 */
.my-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff;
  border-bottom: 1px solid #ececec; cursor: pointer;
}
.my-card:hover { background: #ececec; }
.my-card .avatar { width: 38px; height: 38px; border-radius: 8px; font-size: 16px; }
.my-card-info { flex: 1; min-width: 0; }
.my-card-name { font-size: 14px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.my-card-account { font-size: 11px; color: #999; margin-top: 2px; }
.my-card-arrow { color: #c9c9c9; font-size: 18px; }

.my-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff;
  border-bottom: 1px solid #ececec; cursor: pointer;
}
.my-bar:hover { background: #ececec; }
.my-bar .avatar { width: 34px; height: 34px; border-radius: 6px; font-size: 14px; }
.my-bar-name { flex: 1; font-size: 14px; font-weight: 600;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-header-actions { display: flex; align-items: center; gap: 4px; }

.contact-entry {
  display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 12px;
  background: #fff; border-bottom: 1px solid #ececec; cursor: pointer; font-size: 14px;
}
.contact-entry:hover { background: #ececec; }
.contact-entry .badge {
  margin-left: auto; background: #fa5151; color: #fff; border-radius: 9px;
  font-size: 11px; padding: 1px 6px; min-width: 16px; text-align: center;
}
/* 与 .avatar 统一规格：40x40 方块容器，图标居中，保证各行文字对齐 */
.ce-avatar {
  width: 40px; height: 40px; border-radius: 4px; background: #f0f2f5; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1;
}
.friends-sub { display: flex; flex-direction: column; height: 100%; }

/* 收藏夹 */
#fav-list .fav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #fff; border-bottom: 1px solid #f0f0f0; cursor: pointer;
}
#fav-list .fav-item:hover { background: #f2f2f2; }
.fav-icon {
  width: 36px; height: 36px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #f0f2f5; font-size: 18px; overflow: hidden;
}
.fav-icon img { width: 100%; height: 100%; object-fit: cover; }
.fav-mid { flex: 1; min-width: 0; }
.fav-t1 { font-size: 13px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-t2 { font-size: 11px; color: #b2b2b2; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-del {
  flex-shrink: 0; color: #999; font-size: 14px; padding: 6px; border-radius: 4px;
}
.fav-del:hover { color: #fa5151; background: #f5f5f5; }

/* 右侧收藏夹页面 */
.fav-page { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #f5f5f5; }
.fav-page-header {
  height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border-bottom: 1px solid #e7e7e7; background: #f5f5f5; flex-shrink: 0; font-size: 15px;
}
.fav-page-header .back { cursor: pointer; color: #07c160; }
#fav-list { padding: 0; }

/* 消息右键菜单 */
.ctx-menu {
  position: fixed; z-index: 90; min-width: 110px; background: #fff;
  border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.18);
  padding: 5px 0; overflow: hidden;
}
.ctx-menu .ctx-item {
  padding: 9px 18px; font-size: 13px; color: #333; cursor: pointer; user-select: none;
}
.ctx-menu .ctx-item:hover { background: #f2f2f2; }
.ctx-menu .ctx-item.danger { color: #fa5151; }
.ctx-menu .ctx-sep { height: 1px; background: #eee; margin: 4px 0; }
.sub-header {
  height: 44px; display: flex; align-items: center; padding: 0 14px; font-size: 14px;
  background: #f5f5f5; border-bottom: 1px solid #e7e7e7; flex-shrink: 0;
}
.sub-header .back { cursor: pointer; color: #07c160; }
.req-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.req-item .req-name { flex: 1; font-size: 14px; }
.req-item .req-actions { display: flex; gap: 8px; }
/* 弹窗内搜索行：输入框占一半宽、与按钮同高垂直居中，按钮贴右缘与结果行左右对齐 */
.dlg-fadd-body { padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.dlg-fadd-body .mid-search { flex: 0 1 50%; min-width: 0; max-width: 50%; padding: 0; }
.dlg-fadd-body .mid-search input { height: 30px; }
.dlg-fadd-body .fadd-search-btn { height: 30px; width: 90px; padding: 0; text-align: center; }
/* 搜索/添加/关闭三个按钮统一宽度：右缘对齐后左缘自然对齐 */
#dlg-friend-add .btn-small { width: 90px; padding-left: 0; padding-right: 0; text-align: center; }
#dlg-friend-add .modal-btns { margin-right: 12px; }
#dlg-friend-add .modal-btns .btn { width: 90px; }
#dlg-friend-add .contact-item { padding-right: 0; }
/* 搜索结果列表独占一行，避免与搜索框挤在同一行被压缩 */
#fadd-list { flex-basis: 100%; width: 100%; max-height: 300px; }
.fadd-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 0; width: 100%; font-size: 14px;
}
.fadd-item .fadd-name { flex: 1; }

/* 聊天区 */
.panel-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-header {
  height: 50px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid #e7e7e7; background: #f5f5f5; flex-shrink: 0;
}
#chat-title { font-size: 15px; }
.chat-header-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center;
  justify-content: center; color: #576b95; background: transparent;
}
.icon-btn:hover { background: #e8e8e8; }
.icon-btn svg { width: 20px; height: 20px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 20px; background: #f5f5f5; }
.chat-empty { color: #bbb; text-align: center; margin-top: 40vh; letter-spacing: 2px; }

/* 消息气泡 */
.msg-row { display: flex; margin-bottom: 16px; align-items: flex-start; }
.msg-row.self { flex-direction: row-reverse; }
.msg-content { max-width: 60%; margin: 0 10px; }
.msg-sender { font-size: 12px; color: #999; margin-bottom: 3px; }
.msg-row.self .msg-sender { text-align: right; }
.bubble {
  padding: 9px 12px; border-radius: 5px; background: #fff; position: relative;
  line-height: 1.5; word-break: break-all; white-space: pre-wrap; font-size: 14px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.msg-row.self .bubble { background: #95ec69; }
.bubble::before {
  content: ''; position: absolute; top: 12px; left: -5px; width: 10px; height: 10px;
  background: inherit; transform: rotate(45deg); border-radius: 2px;
}
.msg-row.self .bubble::before { left: auto; right: -5px; }
.bubble img.msg-img { max-width: 240px; max-height: 200px; border-radius: 4px; display: block; cursor: zoom-in; }
.bubble .file-card {
  display: flex; align-items: center; gap: 10px; min-width: 180px; cursor: pointer;
}
.bubble .file-icon { font-size: 30px; }
.bubble .file-name { font-size: 13px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble .file-size { font-size: 11px; color: #999; }
.bubble.voice-bubble { display: flex; align-items: center; gap: 8px; min-width: 90px; cursor: pointer; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 16px; }
.voice-wave i { width: 3px; background: #7a9d54; border-radius: 2px; animation: wave 1s infinite; }
.msg-row.self .voice-wave i { background: #3d6b1f; }
.voice-wave i:nth-child(1) { height: 6px; }
.voice-wave i:nth-child(2) { height: 12px; animation-delay: .2s; }
.voice-wave i:nth-child(3) { height: 9px; animation-delay: .4s; }
.voice-wave i:nth-child(4) { height: 14px; animation-delay: .1s; }
@keyframes wave { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.4); } }
.msg-tip { text-align: center; margin-bottom: 14px; }
.msg-tip span {
  display: inline-block; padding: 3px 10px; background: #dadada; color: #fff;
  border-radius: 3px; font-size: 12px;
}
.msg-time { text-align: center; margin: 8px 0 14px; }
.msg-time span { font-size: 12px; color: #b2b2b2; }
.load-more { text-align: center; margin-bottom: 12px; }
.load-more button { color: #576b95; font-size: 12px; }
.bubble.recalling { opacity: .7; }

/* 底部输入区 */
.chat-footer { position: relative; background: #f7f7f7; border-top: 1px solid #e7e7e7; flex-shrink: 0; display: flex; flex-direction: column; }
/* 输入区顶部拖拽条（可拖动调整高度） */
.splitter-v {
  height: 5px; flex-shrink: 0; cursor: row-resize; position: relative; z-index: 6;
}
.splitter-v::after {
  content: ''; position: absolute; left: 0; right: 0; top: 2px; height: 1px; background: transparent;
}
.splitter-v:hover::after, .splitter-v.active::after { background: #07c160; }
.toolbar { display: flex; gap: 6px; padding: 6px 12px; }
.tool-btn { font-size: 15px; padding: 2px 5px; border-radius: 4px; line-height: 1; }
.tool-btn:hover { background: #e8e8e8; }

/* ---------------- 微信式输入栏 ---------------- */
.wx-bar {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px));
  background: #f7f7f7;
}
.bar-btn {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 4px;
  font-size: 24px; line-height: 36px; text-align: center; color: #1a1a1a;
}
.bar-btn:hover, .bar-btn.active { background: #e8e8e8; }
#msg-input {
  flex: 1; resize: none; border: none; background: #fff; border-radius: 5px;
  line-height: 20px; font-size: 16px; overflow-y: auto;
  padding: 8px 10px; height: 36px; max-height: 130px;
}
.voice-btn {
  flex: 1; height: 36px; background: #fff; border: 1px solid #dcdcdc; border-radius: 5px;
  font-size: 15px; color: #333; user-select: none; text-align: center; line-height: 34px;
}
.voice-btn.recording { background: #c6c6c6; color: #111; border-color: #c6c6c6; }
.send-btn {
  height: 36px; padding: 0 16px; flex-shrink: 0; background: #07c160; color: #fff;
  border-radius: 5px; font-size: 15px;
}
.send-btn:hover { background: #06ad56; }

/* 语音模式：隐藏输入框/表情/加号，语音条占满中间 */
.wx-bar.voice-mode #msg-input,
.wx-bar.voice-mode #btn-emoji,
.wx-bar.voice-mode #btn-plus,
.wx-bar.voice-mode #btn-send { display: none; }
.wx-bar #btn-voice { display: none; }
.wx-bar.voice-mode #btn-voice { display: block; }
.wx-bar.voice-mode #btn-voice-switch { background: #e8e8e8; }

/* ---------------- 表情面板 / 加号面板（贴在输入栏上方，全宽） ---------------- */
.emoji-panel {
  position: absolute; bottom: 100%; left: 0; right: 0; height: 240px; padding: 12px 14px;
  background: #f7f7f7; border-top: 1px solid #e7e7e7; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; z-index: 30;
}
.emoji-panel span { font-size: 26px; text-align: center; cursor: pointer; padding: 6px 0; border-radius: 6px; }
.emoji-panel span:hover, .emoji-panel span:active { background: #e8e8e8; }
.plus-panel {
  position: absolute; bottom: 100%; left: 0; right: 0; height: 220px; padding: 22px 26px;
  background: #f7f7f7; border-top: 1px solid #e7e7e7; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 10px; align-content: start;
}
.plus-panel button {
  background: #fff; border: 1px solid #ececec; border-radius: 12px; padding: 16px 0 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; color: #555;
}
.plus-panel button:active, .plus-panel button:hover { background: #f0f0f0; }
.plus-panel button span { font-size: 30px; line-height: 1; }

/* ---------------- 弹窗 ---------------- */
#modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40;
}
.modal {
  /* 弹窗在去掉左侧导航栏后的内容区内水平居中：桌面导航 60px，补偿一半 30px */
  position: fixed; top: 50%; left: calc(50% + 30px); transform: translate(-50%,-50%);
  background: #fff; border-radius: 8px; z-index: 50; min-width: 380px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25); padding: 18px 20px;
}
.modal-title { font-size: 16px; font-weight: bold; margin-bottom: 14px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.btn {
  padding: 7px 18px; border-radius: 4px; border: 1px solid #dcdcdc; background: #fff; font-size: 13px;
}
.btn:hover { background: #f5f5f5; }
.btn-small { padding: 6px 14px; font-size: 12px; }
.btn-primary { background: #07c160; border-color: #07c160; color: #fff; }
.btn-primary:hover { background: #06ad56; }
.btn-danger { background: #fa5151; border-color: #fa5151; color: #fff; }
.btn-danger:hover { background: #e04848; }

.dlg-group-body { max-height: 320px; overflow-y: auto; border: 1px solid #eee; border-radius: 4px; }
.dlg-group-list { padding: 6px; }
.dlg-group-list label {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer;
}
.dlg-group-list label:hover { background: #f5f5f5; }

.gi-row { display: flex; align-items: flex-start; margin-bottom: 12px; gap: 10px; }
.gi-row > span { width: 50px; flex-shrink: 0; color: #888; font-size: 13px; padding-top: 6px; }
.gi-row input, .gi-row textarea {
  flex: 1; border: 1px solid #e0e0e0; border-radius: 4px; padding: 6px 8px; resize: none;
}
.gi-row input:disabled, .gi-row textarea:disabled { border: none; background: transparent; padding-left: 0; }
.gi-members { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.gi-member { display: flex; flex-direction: column; align-items: center; width: 52px; font-size: 11px; cursor: pointer; position: relative; }
.gi-member .kick { position: absolute; top: -6px; right: 2px; color: #fa5151; font-size: 14px; display: none; }
.gi-member:hover .kick { display: block; }
.gi-add { display: flex; gap: 8px; align-items: center; }
.gi-add select { flex: 1; height: 30px; border: 1px solid #e0e0e0; border-radius: 4px; }

.me-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }

/* 图片预览 */
#img-viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 60;
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
#img-viewer img { max-width: 90%; max-height: 90%; }

/* 文件预览（微信式） */
#file-viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55;
  display: flex; align-items: center; justify-content: center;
}
.fv-panel {
  width: 480px; max-width: 92vw; max-height: 82vh; background: #fff;
  border-radius: 10px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.fv-header {
  display: flex; align-items: center; height: 46px; padding: 0 10px;
  border-bottom: 1px solid #eee;
}
.fv-back { cursor: pointer; color: #576b95; font-size: 14px; padding: 6px 8px; white-space: nowrap; }
.fv-title {
  flex: 1; text-align: center; font-weight: 600; font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px;
}
.fv-close { cursor: pointer; color: #999; font-size: 16px; padding: 6px 10px; }
.fv-body {
  flex: 1; overflow: auto; padding: 26px; min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.fv-body img { max-width: 100%; max-height: 50vh; border-radius: 4px; }
.fv-file { text-align: center; color: #333; }
.fv-file .fv-file-icon { font-size: 64px; margin-bottom: 12px; }
.fv-file .fv-file-name { font-size: 15px; font-weight: 600; word-break: break-all; }
.fv-file .fv-file-size { color: #999; font-size: 12px; margin-top: 6px; }
.fv-voice { text-align: center; color: #333; }
.fv-voice .fv-voice-btn {
  width: 96px; height: 96px; border-radius: 50%; background: #07c160; color: #fff;
  border: none; cursor: pointer; font-size: 36px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; margin-left: auto; margin-right: auto;
}
.fv-voice .fv-voice-dur { color: #999; font-size: 13px; }
.fv-footer { display: flex; gap: 12px; padding: 14px 16px; border-top: 1px solid #eee; }
.fv-btn {
  flex: 1; height: 38px; border: 1px solid #ddd; border-radius: 6px;
  background: #fff; color: #333; font-size: 14px; cursor: pointer;
}
.fv-btn-primary { background: #07c160; border-color: #07c160; color: #fff; }

/* ---------------- 通话浮窗 ---------------- */
#call-overlay {
  position: fixed; inset: 0; background: #1a1a1a; z-index: 70; overflow: hidden;
}
#call-remote-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#call-local-video {
  position: absolute; right: 24px; top: 24px; width: 220px; border-radius: 8px;
  background: #000; box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
#call-local-video.hidden-video { visibility: hidden; }
.call-face {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-60%);
  text-align: center; color: #fff;
}
.call-face-name { margin-top: 16px; font-size: 22px; }
#call-status {
  position: absolute; top: 12%; width: 100%; text-align: center; color: #ddd;
  font-size: 15px; letter-spacing: 1px;
}
.call-btns {
  position: absolute; bottom: 60px; width: 100%; display: flex; justify-content: center;
  gap: 28px;
}
.call-btn {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.16);
  color: #fff; font-size: 24px; display: flex; align-items: center; justify-content: center;
}
.call-btn:hover { background: rgba(255,255,255,.28); }
.call-btn.active { background: #fff; color: #333; }
.call-btn-danger { background: #fa5151; }
.call-btn-danger:hover { background: #e04848; }
.call-btn-ok { background: #07c160; }
.call-btn-ok:hover { background: #06ad56; }
.ring .call-face-avatar { animation: pulse 1.2s infinite; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(7,193,96,.5); }
  50% { box-shadow: 0 0 0 18px rgba(7,193,96,0); }
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 聊天信息扩展面板（微信式右侧栏） ---------------- */
.chat-wrap { flex: 1; display: flex; min-height: 0; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 20px; background: #f5f5f5; min-width: 0; }
.info-panel {
  width: 280px; flex-shrink: 0; background: #fff; border-left: 1px solid #e0e0e0;
  overflow-y: auto; padding: 0 0 20px;
}
.ip-profile { padding: 24px 20px 18px; text-align: center; border-bottom: 1px solid #f0f0f0; }
.ip-profile .avatar { margin: 0 auto 10px; }
.ip-name { font-size: 17px; font-weight: bold; }
.ip-meta { font-size: 12px; color: #999; margin-top: 4px; line-height: 1.7; }
.ip-sec { padding: 14px 20px 6px; font-size: 13px; color: #888; display: flex;
  justify-content: space-between; align-items: center; }
.ip-sec b { font-size: 13px; color: #666; }
.ip-count { font-size: 11px; color: #b2b2b2; }
.ip-list { padding: 0 12px; }
.ip-item {
  display: flex; align-items: center; padding: 8px 8px; border-radius: 6px; cursor: pointer;
}
.ip-item:hover { background: #f5f5f5; }
.ip-item .ip-icon { width: 34px; height: 34px; border-radius: 6px; background: #f0f2f5;
  display: flex; align-items: center; justify-content: center; font-size: 18px; margin-right: 10px;
  flex-shrink: 0; overflow: hidden; }
.ip-item .ip-icon img { width: 100%; height: 100%; object-fit: cover; }
.ip-item .ip-text { flex: 1; min-width: 0; }
.ip-item .ip-t1 { font-size: 13px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ip-item .ip-t2 { font-size: 11px; color: #b2b2b2; margin-top: 2px; }
.ip-member { display: flex; align-items: center; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.ip-member:hover { background: #f5f5f5; }
.ip-member .name { margin-left: 8px; font-size: 13px; color: #333; flex: 1; }
.ip-member .dept { font-size: 11px; color: #b2b2b2; }
.ip-empty { text-align: center; color: #ccc; font-size: 12px; padding: 18px 0; }
.ip-notice { padding: 8px 14px; font-size: 12px; color: #666; background: #f8f8f8;
  border-radius: 6px; line-height: 1.6; margin: 0 14px 4px; white-space: pre-wrap; }

@media (max-width: 768px) {
  .info-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 80vw; max-width: 300px;
    z-index: 30; box-shadow: -4px 0 16px rgba(0,0,0,.12); animation: ip-slide-in .2s;
  }
}
@keyframes ip-slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- 移动端适配（手机 APP / 窄屏） ---------------- */
.chat-back {
  display: none; width: 32px; height: 32px; margin-right: 6px; font-size: 24px;
  color: #333; align-items: center; justify-content: center; border-radius: 6px;
  flex-shrink: 0; cursor: pointer; line-height: 32px;
}
.chat-back:hover { background: #e8e8e8; }

@media (max-width: 768px) {
  .nav-left { width: 48px; padding: 10px 0; }
  .nav-logo { width: 32px; height: 32px; line-height: 32px; font-size: 13px; margin-bottom: 16px; }
  .nav-item { width: 36px; height: 36px; }
  .panel-mid { flex: 1; width: auto; min-width: 0; }
  .splitter { display: none; }
  .splitter-v { display: none; }
  /* 聊天窗口全屏覆盖，打开时显示返回按钮 */
  .panel-chat { display: none; position: fixed; inset: 0; z-index: 25; background: #f5f5f5;
    padding-top: env(safe-area-inset-top); }
  .chat-footer { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  body.chat-open .panel-chat { display: flex; }
  body.chat-open .chat-back { display: flex; }
  .chat-header { padding: 0 10px; }
  .msg-content { max-width: 76%; }
  #call-local-video { width: 110px; top: 12px; right: 12px; }
  /* 手机端导航栏 48px：弹窗宽度基于内容区（去掉导航后）计算，并在内容区水平居中 */
  .modal { width: calc((100vw - 48px) * 0.94); min-width: 0; max-width: none; left: calc(50% + 24px); }
  /* 手机端弹窗内搜索行：与桌面一致（输入框一半宽、高30与按钮对齐） */
  .dlg-fadd-body .mid-search { min-width: 0; flex: 0 1 50%; max-width: 50%; padding: 0; }
  .dlg-fadd-body .fadd-search-btn { flex-shrink: 0; height: 30px; width: 90px; padding: 0; white-space: nowrap; text-align: center; }
  #fadd-list { max-height: 46vh; }
  #dlg-friend-add .contact-item { padding: 12px 0 12px 4px; }
  #dlg-friend-add .btn-small { width: 90px; padding: 8px 0; }
  #dlg-friend-add .modal-btns { margin-right: 12px; }
  #dlg-friend-add .modal-btns .btn { width: 90px; }
  .emoji-panel { width: calc(100vw - 24px); }
  .call-btn { width: 60px; height: 60px; }
  .bubble img.msg-img { max-width: 56vw; }
}
