body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f5f5f5;
  height: 100vh;
  overflow: hidden;
  user-select: none; /* 防止意外选中文本 */
}

#root {
  height: 100vh;
  display: flex;
}

/* --- 新增布局样式 --- */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 1. 最左侧主导航栏 */
.main-nav {
  width: 60px;
  background-color: #2e2e2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 30px;
  padding-bottom: 20px;
  -webkit-app-region: drag; /* 允许拖动窗口 */
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 30px;
  cursor: pointer;
  -webkit-app-region: no-drag;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #979797;
  cursor: pointer;
  border-radius: 4px;
  position: relative;
  -webkit-app-region: no-drag;
  transition: color 0.2s;
}

.nav-icon:hover {
  color: #d6d6d6;
}

.nav-icon.active {
  color: #07c160; /* 微信绿 */
}

.nav-icon .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ff3b30;
  color: white;
  border-radius: 10px;
  padding: 0 4px;
  font-size: 10px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
}

/* 底部设置图标 */
.nav-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-app-region: no-drag;
}

/* 2. 中间列表栏 */
.list-panel {
  width: 250px;
  background-color: #e6e6e6;
  border-right: 1px solid #d6d6d6;
  display: flex;
  flex-direction: column;
}

/* 搜索框美化 */
.search-bar {
  padding: 20px 10px 10px 10px;
  background-color: #f7f7f7;
  border-bottom: 1px solid #e7e7e7;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 消息气泡箭头 - 顶部对齐以对准头像（像微信一样） */
.bubble-self::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 6px;
  border-color: transparent transparent transparent #95ec69;
}

.bubble-other::after {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 6px 6px 0;
  border-color: transparent #ffffff transparent transparent;
}

/* 图片和视频消息的气泡箭头 - 顶部对齐以对准头像（像微信一样） */
.bubble-self.bubble-media::after {
  top: 0;
}

.bubble-other.bubble-media::after {
  top: 0;
}

/* 确保图片和视频消息的气泡容器能够正确计算高度 */
.bubble-media {
  display: inline-block;
}

/* 工具栏图标悬停效果 */
.toolbar-icon {
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 20px;
  color: #666;
}

.toolbar-icon:hover {
  background-color: #e0e0e0;
}

/* 联系人列表项悬停/选中效果 */
.contact-item:hover {
  background-color: #d9d8d8 !important;
}

.contact-item.active {
  background-color: #c6c6c6 !important;
}

/* 模拟右键菜单 */
.context-menu {
  position: fixed;
  background: white;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
  z-index: 1000;
  border-radius: 4px;
  padding: 5px 0;
  min-width: 120px;
}

.context-menu-item {
  padding: 8px 15px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

.context-menu-item:hover {
  background-color: #f0f0f0;
}

/* 浏览器导航卡片 */
.browser-card {
  padding: 15px;
  background-color: white;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
  border: 1px solid #e0e0e0;
}

.browser-card:hover {
  background-color: #f0f0f0;
  border-color: #d0d0d0;
}

/* 最近打开小卡片：一行 5 个 */
.browser-card--recent {
  padding: 10px;
  margin-bottom: 0;
}
