/* else0610 消息中心：IM/消息中心全部样式
   原内联于 navigation.php / components/message/list.php / components/message/detail.php，统一抽出。
   由 navigation.php 全站引入（红点/toast 的 DOM 在导航里，每页都有）。 */

/* ───── 导航红点 + 移动端即时广告条（navigation.php，全站） ───── */
/* 头像未读红点（放在圆形头像外层，避免被 .user_target 的 overflow:hidden 裁切） */
.nav-categories .search-extra > li,
.side-toolbar-list .ai-my-item {
  position: relative;
}
.user_target {
  position: relative;
}
.user_target + .unread-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

.user_target + .unread-dot.hidden {
  display: none;
}

.user-menu-mount-target {
  position: relative;
}
/* 红点/toast 默认隐藏，im.js 按未读 toggle 'hidden' 类 */
.ai-dot.hidden,
.ai-dot-inline.hidden,
.ai-msg-toast.hidden {
  display: none !important;
}

.user_menu .unreadcount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 100%;
  background: rgba(255, 0, 0, 1);
  margin-left: 8px;
  font-size: 0.65rem;
  line-height: 1;
  color: #fff;
}

.user_menu .unreadcount.hidden {
  display: none;
}

.message-announcement-item {
  display: block;
}
.message-announcement-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.message-announcement-item-header h3 {
  font-size: 1.2rem;
  font-weight: 500;
}

.message-announcement-item-header span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

.message-announcemen-item-body {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.message-ad-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.message-ad-item-poster {
  width: 20%;
  min-width: 8rem;
  border-radius: 0.3rem;
}

.message-ad-item > .message-ad-item-poster:has(> img.loading) {
  width: 20% !important;
  min-width: 8rem !important;
  height: auto !important;
  display: block !important;
  background-color: transparent !important;
}

.message-ad-item-poster > img {
  width: 100%;
}

.message-ad-item-poster > img.loading {
  content: url("/usr/themes/Mirages/images/185x95.png");
  height: auto !important;
}

.message-ad-item .message-ad-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 1.2rem;
  font-weight: 500;
  flex: 1;
}

.message-list-item {
  position: relative;
  padding: 1rem;
  background-color: rgba(48, 48, 48, 1);
  border-radius: 0.3rem;
  color: #fff;
  margin-bottom: 1rem;
}
.message-list-item.is-read .unread-dot {
  display: none;
}
.message-list-item .unread-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff2d2d;
}

/* 消息详情页样式 */
.message-detail-container .message-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem;
  margin-block: 1rem;
}

.message-detail-container .message-detail-header > span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
}

.message-detail-container .message-detail-content img {
  width: 100%;
}

.message-detail-container .message-detail-content p {
  margin-bottom: 1rem;
}

.message-banner-swiper {
  position: relative;
  width: 100%;
  aspect-ratio: 95 / 11;
  overflow: hidden;
}

.message-banner-swiper .swiper-pagination {
  position: absolute;
  right: 10px;
  bottom: 8px;
  left: auto;
  width: auto;
  text-align: right;
}

.message-banner-swiper .swiper-wrapper,
.message-banner-swiper .swiper-slide {
  height: 100%;
}

.message-banner-swiper .swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-banner-swiper .swiper-pagination-bullet {
  background-color: rgba(240, 152, 52, 1);
}

.bottom-ads {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 1000;
  width: 100%;
  max-width: 720px;
  pointer-events: auto;
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 767px) {
  .bottom-ads {
    max-width: 710px;
  }
}

@media screen and (min-width: 768px) and (max-width: 1301px) {
  .bottom-ads {
    max-width: 720px;
  }
}

@media screen and (min-width: 1302px) and (max-width: 1599px) {
  .bottom-ads {
    max-width: 864px;
  }
}

@media screen and (min-width: 1600px) and (max-width: 1799px) {
  .bottom-ads {
    max-width: 896px;
  }
}

@media screen and (min-width: 1800px) and (max-width: 1999px) {
  .bottom-ads {
    max-width: 960px;
  }
}

@media screen and (min-width: 2000px) and (max-width: 2399px) {
  .bottom-ads {
    max-width: 992px;
  }
}

@media screen and (min-width: 2400px) {
  .bottom-ads {
    max-width: 1024px;
  }
}

.bottom-ads .bottom-ads-close {
  position: absolute;
  top: 2px;
  right: 2px;
  left: auto;
  bottom: auto;
  z-index: 20;
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-ads .bottom-ads-close img {
  width: 100%;
  height: 100%;
  display: block;
}

.bottom-ads-countdown {
  position: absolute;
  right: 2px;
  bottom: 4px;
  z-index: 2;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}

.bottom-ads-swiper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.bottom-ads-swiper .swiper-wrapper,
.bottom-ads-swiper .swiper-slide {
  height: auto;
}

.bottom-ads-swiper .swiper-slide a {
  display: block;
}

.bottom-ads-img {
  display: block;
  width: 100%;
  height: auto;
}

.bottom-banner a > img:not([src]),
.bottom-banner a > img.loading {
  content: url("/usr/themes/Mirages/images/banner.png");
  margin: 0 auto;
  object-fit: contain;
  background-size: contain;
  background-position: center;
}

.bottom-ads-swiper .swiper-pagination {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  margin: auto;
  text-align: center;
}

.bottom-ads-swiper .swiper-pagination-bullet {
  background-color: #fff;
}
