/* ============================================
   冥曦 & 我  ·  自定义主题（纯 CSS，不影响性能）
   ============================================ */

/* —— 1. 主色调：紫 → 粉 —— */
html:root,
html[data-theme],
.cpd-theme-dark,
.cpd-theme-light {
  --cpd-color-bg-action-primary-rest: #7c4dff !important;
  --cpd-color-bg-action-primary-hovered: #6a3ee0 !important;
  --cpd-color-bg-action-primary-pressed: #5b34c2 !important;
  --cpd-color-bg-accent-rest: #7c4dff !important;
  --cpd-color-bg-accent-hovered: #6a3ee0 !important;
  --cpd-color-bg-accent-pressed: #5b34c2 !important;
  --cpd-color-bg-accent-selected: #7c4dff !important;
  --cpd-color-border-accent-primary: #7c4dff !important;
  --cpd-color-text-action-accent: #b391ff !important;
  --cpd-color-bg-badge-accent: #ff7ba9 !important;
  --cpd-color-bg-badge-primary: #7c4dff !important;
  --cpd-color-gradient-action-stop1: #7c4dff !important;
  --cpd-color-gradient-action-stop2: #ff7ba9 !important;
  --cpd-avatar-radius: 32% !important;
}

/* —— 2. 登录 / 欢迎页：深紫渐变 + 我们的 logo —— */
.mx_AuthPage,
.mx_DefaultWelcome,
.mx_WelcomePage {
  background: radial-gradient(1100px 620px at 12% -10%, #4a3a86 0%, rgba(74,58,134,0) 60%),
              radial-gradient(900px 560px at 100% 100%, #6e3357 0%, rgba(110,51,87,0) 62%),
              linear-gradient(155deg, #241d3c 0%, #17131f 100%) !important;
}
.mx_DefaultWelcome_logo,
.mx_WelcomePage_logo {
  background-image: url(/custom/logo.png) !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  width: 104px !important;
  height: 104px !important;
}
img.mx_DefaultWelcome_logo,
img.mx_WelcomePage_logo {
  content: url(/custom/logo.png) !important;
  object-fit: contain;
}
.mx_DefaultWelcome_logo img,
.mx_WelcomePage_logo img,
.mx_DefaultWelcome_logo svg,
.mx_WelcomePage_logo svg {
  visibility: hidden !important;
}
.mx_AuthHeaderLogo img,
.mx_AuthHeaderLogo svg {
  visibility: hidden !important;
}
.mx_AuthHeaderLogo {
  background-image: url(/custom/logo.png) !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}
.mx_DefaultWelcome_text,
.mx_WelcomePage h1,
.mx_AuthHeader h1 {
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
}

/* —— 3. 房间名 / 顶栏 更有质感 —— */
.mx_RoomHeader_name {
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
}
.mx_RoomTile_title {
  font-weight: 500 !important;
}
.mx_RoomTile:hover {
  background-color: rgba(124, 77, 255, 0.10) !important;
}
.mx_RoomTile_selected:hover {
  background-color: rgba(124, 77, 255, 0.22) !important;
}

/* —— 4. 消息气泡圆角 & 头像 —— */
.mx_EventTile_body {
  line-height: 1.62 !important;
}
.mx_BaseAvatar_initial,
.mx_BaseAvatar_image {
  border-radius: 32% !important;
}

/* —— 5. 细滚动条 —— */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 130, 220, 0.55) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: rgba(150, 130, 220, 0.45);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 130, 220, 0.75);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* —— 6. 隐藏用不上的入口（私有小站） —— */
.mx_HomePage_button_explore,
.mx_RoomList_explore,
.mx_LeftPanel_explore {
  display: none !important;
}

/* —— 7. 发送按钮渐变 —— */
.mx_SendMessageComposer .mx_AccessibleButton_kind_primary,
.mx_MessageComposer_sendMessage {
  background: linear-gradient(135deg, #7c4dff, #ff7ba9) !important;
  border: none !important;
}

/* 隐藏登录页底部 Element 官方外链（Blog / Mastodon / GitHub / Powered by Matrix） */
.mx_AuthFooter, .mx_AuthFooter * { display: none !important; }

/* 收起「端到端加密未启用」这类加密提示气泡（房间介绍里那块红框），避免误点「启用加密」 */
.mx_EventTileBubble.mx_cryptoEvent,
li.mx_NewRoomIntro .mx_cryptoEvent { display: none !important; }
/* 房间介绍里那句「你创建了此房间」的引导也一起收掉，只留名字/主题/邀请按钮 */
/* 隐藏「消息已被删除」这类撤回提示条目，保持小窝干净 */
.mx_EventTile:has(.mx_RedactedBody) { display: none !important; }
