body, html {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: rgba(0, 0, 0, 0.643);
  color: #5beff2d8;
  display: flex;
  width: 100%;
  height: 100%;
  font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
}
pre {
  margin: 0;
  font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
}
.left {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.right {
  width: 200px;
  background-color: rgb(47, 47, 47);
  border-left: 1px solid rgba(151, 151, 151, 0.3);
  display: flex;
  flex-direction: column;
}
.right .users-header {
  padding: 15px;
  border-bottom: 1px solid rgba(151, 151, 151, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.right .users-header h2 {
  margin: 0;
  font-size: 15px;
  color: #ffffffbb;
  font-weight: normal;
}
.right .users-header .count {
  background: rgba(91, 239, 242, 0.15);
  color: #5beff2d8;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 13px;
}
.right .users-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}
.right ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.right ul li {
  padding: 8px 15px;
  display: flex;
  align-items: center;
  color: #ffffffbb;
  font-size: 14px;
  transition: background-color 0.2s;
}
.right ul li:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.right ul li .user-avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
  margin-right: 10px;
  margin-bottom: 0;
  border: none;
  box-shadow: none;
}
.right ul li .current-user {
  color: #5beff2d8;
  font-size: 12px;
  margin-left: 5px;
}
.right .users-content::-webkit-scrollbar {
  width: 4px;
}
.right .users-content::-webkit-scrollbar-track {
  background: transparent;
}
.right .users-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.right .users-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
.chat-wrapper {
  flex: 1;
  font-size: 18px;
  line-height: 24px;
  display: flex;
  flex-direction: column;
  overflow: auto;
  scroll-behavior: smooth;
}
.chat-item {
  display: flex;
  margin: 20px 20px;
  align-items: flex-start;
  position: relative;
}
.chat-item.me {
  flex-direction: row-reverse;
}
.chat-item .chat-item_user {
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: #999;
  min-width: 45px;
}
.chat-item .chat-item_content {
  max-width: 65%;
  margin: 0 12px;
  background: rgba(74, 74, 74, 0.9);
  padding: 12px 15px;
  border-radius: 3px 12px 12px 12px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.chat-item .chat-item_content:before {
  content: '';
  position: absolute;
  left: -8px;
  top: 15px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid rgba(74, 74, 74, 0.9);
}
.chat-item .chat-item_content pre{
  white-space: pre-wrap;
  /* 自动换行 */
  word-wrap: break-word;
  word-break: break-all;
  line-height: 1.4;
}
.chat-item .chat-item_content pre a{
  color: #5beff2;
  text-decoration: none;
  transition: opacity 0.2s;
}
.chat-item .chat-item_content pre a:hover,
.chat-item .chat-item_content a.file:hover {
  opacity: 0.8;
}
.chat-item a.file, .chat-item a.file:visited {
  color: #5beff2d8;
  text-decoration: none;
}
.txt-msg {
  outline: none;
  color: #000;
  /* border-radius: 5px; */
  /* width: 100%; */
  height: 20%;
  min-height: 100px;
  background-color: rgb(236, 236, 236);
  border: none;
  resize: none;
  padding: 8px;
  font-size: 16px;
  line-height: 22px;
  box-sizing: border-box;
  margin: 0 20px 20px 20px;
}
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #2f2f2f;
  padding: 20px;
  border-radius: 5px;
  min-width: 300px;
}

.modal h3 {
  margin: 0 0 15px 0;
  color: #5beff2d8;
}

.user-list {
  max-height: 300px;
  overflow-y: auto;
}

.user-select-item {
  padding: 8px;
  margin: 5px 0;
  cursor: pointer;
  color: #ffffffbb;
}

.user-select-item:hover {
  background: rgba(91, 239, 242, 0.1);
}

.user-select-item label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.user-select-item input[type="checkbox"] {
  cursor: pointer;
  margin-right: 10px;
}

.user-select-item span {
  flex: 1;
}

.modal-footer {
  margin-top: 15px;
  text-align: right;
}

.modal-footer button {
  padding: 5px 15px;
  margin-left: 10px;
  background: #5beff2d8;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.modal-footer button:hover {
  background: #4bd8e6d8;
}

.modal-footer button:disabled {
  background: #cccccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.progress-container {
  margin: 15px 0;
}

.progress-text {
  color: #ffffffbb;
  margin-bottom: 5px;
  font-size: 14px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-inner {
  width: 0%;
  height: 100%;
  background: #5beff2d8;
  transition: width 0.3s ease;
}

/* 修改标题栏样式 */
.header {
  background: rgb(47, 47, 47);
  padding: 10px;
  border-bottom: 1px solid rgb(151, 151, 151);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  margin: 0;
  font-size: 18px;
  color: #5beff2d8;
}

.header .online-users {
  display: none;
  background: none;
  border: none;
  color: #5beff2d8;
  font-size: 16px;
  cursor: pointer;
  padding: 5px 10px;
}

.header .online-users .count {
  background: #5beff2d8;
  color: #000;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 5px;
  font-size: 14px;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
  /* 隐藏右侧用户列表 */
  .right {
    display: none;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    height: auto;
    max-height: 70vh;
    background: rgb(47, 47, 47);
    border-bottom: 1px solid rgb(151, 151, 151);
    z-index: 100;
    padding: 15px;
    box-sizing: border-box;
  }
  
  .right.show {
    display: block;
  }

  /* 调整左侧布局 */
  .left {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
  }

  /* 调整聊天区域 */
  .chat-wrapper {
    flex: 1;
    height: 0; /* 确保可以正确滚动 */
  }

  /* 调整输入区域 */
  .input-area {
    padding: 10px;
    background: rgb(47, 47, 47);
    border-top: 1px solid rgb(151, 151, 151);
  }

  .txt-msg {
    min-height: 60px;
    margin: 0 0 10px 0;
    border-radius: 4px;
  }

  /* 调整按钮样式 */
  .action-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  /* 调整标题栏 */
  .header {
    padding: 10px;
  }

  .header h1 {
    font-size: 16px;
  }

  .header .online-users {
    display: flex;
    align-items: center;
    padding: 5px 10px;
  }

  /* 遮罩层 */
  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .overlay.show {
    display: block;
  }
}

/* 移除一些不必要的边距和圆角 */
@media screen and (max-width: 768px) {
  .chat-item {
    margin: 15px 10px;
  }

  body {
    overflow: hidden; /* 防止页面滚动 */
  }
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  font-weight: bold;
  margin-bottom: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.chat-item .user-avatar {
  width: 42px;
  height: 42px;
  font-size: 18px;
  margin: 0 0 4px 0;
}

.right ul li .user-avatar {
  width: 24px;
  height: 24px;
  font-size: 14px;
  margin-right: 8px;
  margin-bottom: 0;
}

/* 系统消息样式 */
.chat-item.system {
  justify-content: center;
  margin: 8px 0;
}

.chat-item.system .chat-item_user {
  display: none;  /* 隐藏系统消息的用户信息区域 */
}

.chat-item.system .chat-item_content {
  background: transparent;  /* 移除背景色 */
  padding: 5px 10px;
  margin: 0;
  max-width: none;  /* 允许更宽的系统消息 */
}

.chat-item.system .chat-item_content:before {
  display: none;  /* 移除小三角 */
}

.system-message {
  color: rgba(153, 153, 153, 0.8);
  font-style: italic;
  font-size: 12px;
  text-align: center;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 12px;
}

/* 侧消息的小三角 */
.chat-item .chat-item_content:before {
  content: '';
  position: absolute;
  left: -8px;
  top: 15px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid rgba(74, 74, 74, 0.9);
}

/* 自己发送的消息样式 */
.chat-item.me .chat-item_content {
  background: rgba(91, 239, 242, 0.85);
  border-radius: 12px 3px 12px 12px;
  color: rgba(0, 0, 0, 0.85);
}

/* 自己发送的消息的小三角 */
.chat-item.me .chat-item_content:before {
  left: auto;
  right: -8px;
  border-right: none;
  border-left: 8px solid rgba(91, 239, 242, 0.85);
}

/* 自己发送的消息中的链接颜色 */
.chat-item.me .chat-item_content pre a,
.chat-item.me .chat-item_content a.file {
  color: #000;
}

/* 消息时间样式 */
.message-time {
  font-size: 11px;
  color: rgba(153, 153, 153, 0.8);
  margin-top: 6px;
  text-align: right;
}

/* 自己发送的消息时间样式 */
.chat-item.me .message-time {
  color: rgba(0, 0, 0, 0.4);
}

/* 系统消息不显示时间 */
.chat-item.system .message-time {
  display: none;
}

/* 输入区域容器 */
.input-area {
  background: rgb(47, 47, 47);
  padding: 20px;
  border-top: 1px solid rgb(151, 151, 151);
  position: relative;
}

/* 消息输入框 */
.txt-msg {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  background-color: rgb(236, 236, 236);
  border: none;
  border-radius: 4px;
  resize: none;
  padding: 12px;
  font-size: 16px;
  line-height: 22px;
  box-sizing: border-box;
  margin: 0 0 10px 0;
  outline: none;
  color: #000;
}

/* 按钮容器 */
.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 按钮基础样式 */
.action-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

/* 文件选择按钮 */
.file-btn {
  background: transparent;
  color: #5beff2d8;
  border: 1px solid #5beff2d8;
}

.file-btn:hover {
  background: rgba(91, 239, 242, 0.1);
}

/* 发送按钮 */
.send-btn {
  background: #5beff2d8;
  color: #000;
}

.send-btn:hover {
  background: rgba(91, 239, 242, 0.85);
}

/* 文件输入框隐藏 */
#fileInput {
  display: none;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
  .input-area {
    padding: 10px;
  }
  
  .txt-msg {
    min-height: 60px;
  }
  
  .action-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* 全选按钮样式 */
.select-all {
  padding: 0 8px 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.select-all label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  color: #ffffffbb;
}

.select-all input[type="checkbox"] {
  margin-right: 10px;
  cursor: pointer;
}

/* 媒体内容样式 */
.media-content {
  margin-bottom: 8px;
}

.media-content img {
  max-width: 300px;
  max-height: 200px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}

.media-content img:hover {
  transform: scale(1.02);
}

.media-content video {
  max-width: 300px;
  max-height: 200px;
  border-radius: 4px;
}

/* 媒体预览模态框 */
.media-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: pointer;
}

.media-preview-content {
  max-width: 90vw;
  max-height: 90vh;
}

.media-preview-content img,
.media-preview-content video {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
  .media-content img,
  .media-content video {
    max-width: 200px;
    max-height: 150px;
  }
}