:root {
  --sticker-size: 120px;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans JP", sans-serif;
  background: #50476a;
  color: #fff;
}
.chat-root {
  display: flex;
  height: 100vh;
  background: #50476a;
}
.sidebar {
  width: 280px;
  background: #3f355b;
  display: flex;
  flex-direction: column;
}
.server-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #2b2633;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}
.server-header:hover {
  background: rgba(61, 55, 80, 0.5);
}
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px 0 8px;
}
.channel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  background: #50476a;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 15px;
}
.channel-icon {
  width: 24px;
  height: 24px;
  display: flex;
  padding: 0 10px;
}
.section-label {
  font-size: 12px;
  color: #bdbdbd;
  margin: 16px 0 4px 8px;
}
.voice-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.voice-user:hover {
  background: #50476a;
}
.voice-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}
.bg-pink-500 {
  background: #ec4899;
}
.bg-purple-400 {
  background: #a78bfa;
}
.bg-teal-400 {
  background: #2dd4bf;
}
.bg-pink-400 {
  background: #f472b6;
}
.bg-purple-600 {
  background: #7c3aed;
}
.bg-green-600 {
  background: #22c55e;
}
.bg-red-600 {
  background: #ef4444;
}
.bg-default {
  background: #9a559b;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #50476a;
}
.chat-header {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid #2b2633;
  background: rgba(78, 72, 104, 0.8);
}
.chat-header .channel-icon {
  width: 24px;
  height: 24px;
  font-size: 13px;
}
.window-buttons {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.window-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.window-btn.blue {
  background: #62c4ed;
}
.window-btn.yellow {
  background: #f5c03b;
}
.window-btn.red {
  background: #f25a64;
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.message {
  display: flex;
  gap: 12px;
}
.message .avatar {
  width: 40px;
  height: 40px;
  font-size: 18px;
}
.message-content {
  flex: 1;
  min-width: 0;
}
.message-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.message-user {
  font-weight: 600;
  font-size: 15px;
}
.message-time {
  font-size: 12px;
  color: #bdbdbd;
}
.message-text {
  font-size: 15px;
  margin: 0;
}
.message-file {
  margin-top: 6px;
  background: #2b2633;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
}
.file-icon {
  width: 48px;
  height: 48px;
  background: #3d3750;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #bdbdbd;
}
.file-info {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size {
  font-size: 12px;
  color: #bdbdbd;
}
.file-download {
  background: none;
  border: none;
  color: #bdbdbd;
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
}
.file-download:hover {
  background: #3d3750;
}
.input-area {
  padding: 16px;
  background: none;
}
.input-box {
  background: #3f355b;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 15px;
}
.input::placeholder {
  color: #888;
}
.input-btns {
  display: flex;
  gap: 8px;
}
.input-btn {
  background: none;
  border: none;
  color: #bdbdbd;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.input-btn:hover {
  background: #3d3750;
  color: #fff;
}
.messages {
  scrollbar-width: thin;
  border-radius: 10px;
  scrollbar-color: rgb(53, 36, 78) rgb(70, 52, 92);
}

.sticker {
  vertical-align: middle;
  display: inline-block;
  max-width: 100%; /* 防止超出容器 */
}
.sticker-fixed {
  height: var(--sticker-size);
  width: auto;
}

.sticker-narrow {
  width: var(--sticker-size);
  height: auto;
}

.sticker-inline {
  height: 60px;
  width: auto;
}

/* 加载占位：在图片加载前显示正方形占位，尺寸与将要显示的贴纸大小匹配 */
.sticker-loading {
  background: #3d3750; /* 占位背景色 */
  display: inline-block;
  vertical-align: middle;
  width: var(--sticker-size);
  height: var(--sticker-size);
}

/* 对于 inline 情况，使用更小的正方形占位 */
.sticker-inline.sticker-loading {
  width: 60px;
  height: 60px;
}

/* 加载失败时显示的替代文本样式 */
.sticker-broken {
  color: #bdbdbd;
  font-style: italic;
  display: inline-block;
  padding: 0 6px;
}
