/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: row;
}

/* 侧边栏样式 */
.sidebar {
  width: 100px;
  height: 460px;
  background-color: #f0f0f0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-header {
  width: 100%;
  text-align: center;
  padding: 0px 0;
}

.avatar {
  width: 60px;
  height: 60px;
  background-color: purple;
  border-radius: 20%;
  margin-left: 20px;
  margin-top: 20px;
  margin-bottom: 30px;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-item {
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.nav-item.active {
  background-color: #ccc;
}

.icon {
  display: inline-block;
  width: 50px;
  height: 50px;

  border-radius: 4px;
}

.chat-icon {
  background-image: url("img/chat-dots.svg"); /* 可替换实际聊天图标 */
  background-size: cover;
}

.file-icon {
  background-image: url("img/file-earmark-fill.svg"); /* 可替换实际文件图标 */
  background-size: cover;
}

.profile-icon {
  background-image: url("img/person.svg"); /* 可替换实际个人信息图标 */
  background-size: cover;
}

/* 主内容区域通用样式 */
.main-section {
  display: none;
  flex: 1;
  padding-top: 0px;
}

.main-section.active-section {
  display: block;
}

/* 聊天模块样式 */
.chat-header {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  margin-bottom: 10px;
  padding-top: 110px;
}

.chat-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 150px;
  height: 350px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 50px;
  text-align: left;
  background-color: whitesmoke;
}
.chat-font {
  font-size: 15px;
  text-align: left;
}

.chat-user {
  padding: 0px 0px;
  margin-right: 0px;
  background-color: #eee;
  cursor: pointer;
  text-align: left;
}

.chat-user.active-user {
  background-color: #ccc;
}

.add-btn {
  font-size: 40px;
  padding: 1px 10px;
  cursor: pointer;
  border-radius: 40%;
  position: absolute;
  top: 20px;
  right: 20px;
}
.chat-content-input-wrapper {
  display: flex;
  flex-direction: column;
  flex: 3;
}
.chat-content {
  height: 300px;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 10px;
  margin-bottom: 10px;
}

.chat-box {
  display: none;
}

.chat-box.active-chat {
  display: block;
}

.chat-message {
  margin-bottom: 5px;
}

.other-message {
  text-align: left;
}

.my-message {
  text-align: right;
}

.chat-text {
  display: inline-block;
  background-color: #f1f1f1;
  padding: 5px 10px;
  border-radius: 5px;
}

.chat-input-area {
  display: flex;
}

.chat-input {
  flex: 1;
  padding: 5px;
  margin-left: 10px;
  margin-right: 10px;
}

.send-btn {
  padding: 5px 10px;
  background-color: limegreen;
  border-radius: 20%;
  margin-right: 10px;
}

/* 文件模块样式 */
.file-container {
  display: flex;
  justify-content: space-around;
  padding: 10%;
}

.file-box {
  width: 130px;
  height: 100px;
  border: 2px dashed #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 5px;
}

/* 个人信息模块样式 */
.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-left: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
  width: 500px;
  background-color: #999;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  background-color: purple;
  border-radius: 20%;
  margin-right: 10px;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-weight: bold;
}

.profile-menu {
  display: flex;
  flex-direction: column;
}

.menu-item {
  padding: 5px;
  cursor: pointer;
  background-color: #eee;
  margin-bottom: 5px;
  border-radius: 3px;
  width: 500px;
}
/* 登录页面样式 */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex; /* 确保默认是flex布局 */
  justify-content: center;
  align-items: center;
  z-index: 1000;
  /* 移除可能存在的 display: none; */
}

.login-container {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  width: 300px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  position: relative;
}

.login-tabs {
  display: flex;
  margin-bottom: 1rem;
}

.login-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.login-tab.active {
  border-bottom: 2px solid #007bff;
  color: #007bff;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.submit-btn {
  width: 100%;
  padding: 0.5rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.message {
  margin-top: 1rem;
  text-align: center;
  color: red;
}

.form-panel {
  display: none;
}

.form-panel.active {
  display: block;
}
.close-btn {
  /* 清除默认按钮样式 */
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;

  /* 定位到右上角 */
  position: absolute;
  top: 15px; /* 距离顶部15px */
  right: 15px; /* 距离右侧15px */

  /* 鼠标悬停效果 */
  cursor: pointer;
  transition: transform 0.2s, stroke 0.2s;
}

/* SVG 图标交互效果 */
.close-btn svg {
  transition: stroke 0.2s;
}

.close-btn:hover svg {
  stroke: #333; /* 鼠标悬停时颜色变深 */
}

.close-btn:active {
  transform: scale(0.9); /* 点击时轻微缩小 */
}

.avatar,
.profile-avatar {
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
/* 编辑资料弹窗样式 */
#edit-profile-page {
  display: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s;
}

#edit-profile-page.active {
  display: flex;
  visibility: visible;
  opacity: 1;
}

.edit-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.edit-tab.active {
  border-bottom: 2px solid #007bff;
  color: #007bff;
}
#friend-request-modal .login-container {
  max-height: 80vh; /* 限制最大高度为视口的80% */
  overflow-y: auto; /* 垂直滚动 */
  overflow-x: hidden; /* 禁止水平滚动 */
  width: 400px; /* 适当增加弹窗宽度 */
}

/* 调整好友请求项布局，防止内容溢出 */
#friend-requests-list .profile-header {
  width: 100%; /* 宽度适应容器 */
  box-sizing: border-box; /* 包含内边距计算 */
  display: flex;
  align-items: center;
  justify-content: space-between; /* 分散布局，避免按钮溢出 */
  border-radius: 12px;
}

/* 限制好友信息文本区域宽度 */
#friend-requests-list .profile-info {
  flex: 1; /* 占满中间空间 */
  margin: 0 10px; /* 增加左右间距 */
  white-space: nowrap; /* 防止文本换行 */
  overflow: hidden; /* 超出部分隐藏 */
  text-overflow: ellipsis; /* 显示省略号 */
}

/* 调整按钮区域样式 */
#friend-requests-list .profile-header > div:last-child {
  flex-shrink: 0; /* 按钮区域不收缩 */
}
/* 在styles.css中添加以下样式 */
#friend-requests-list .profile-header > div:last-child {
  display: flex;
  flex-direction: column; /* 改为垂直排列 */
  gap: 5px; /* 按钮之间的垂直间距 */
  
}

/* 调整按钮宽度使其一致 */
#friend-requests-list .accept-btn,
#friend-requests-list .profile-header button:not(.accept-btn) {
  width: 60px !important; /* 固定按钮宽度 */
}
#files-close-btn {
  margin-top: -10px; /* 向上移动5px，可根据实际情况调整数值 */
  margin-left: 15px; /* 增加左侧间距，与下载按钮分隔开 */
}

/* 确保按钮容器有足够的空间 */
#my-files-modal .login-container > div:first-child {
  align-items: center;
  flex-wrap: wrap; /* 允许按钮换行，防止空间不足时重叠 */
  gap: 10px; /* 按钮之间的间距 */
}
/* 调整添加好友弹窗中个人信息布局，防止内容溢出 */
#add-friend-modal .profile-header,
#user-detail-modal .profile-header {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* 左对齐布局 */
  padding: 10px;
}

#add-friend-modal .profile-info,
#user-detail-modal .profile-info {
  flex: 1;
  margin: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 限制用户ID显示长度 */
#add-friend-modal .profile-id,
#user-detail-modal .profile-id {
  font-size: 14px;
  color: #666;
}