/* =============================================
   消息模块样式
   ============================================= */

/* ---------- 页面容器 ---------- */
.message-page {
  /* padding-top: 30px;  */
  padding-bottom: calc(70px + 24px + env(safe-area-inset-bottom, 0px) + var(--browser-bottom-ui, 0px));
  min-height: 100vh;
  background-color: var(--color-bg, #F5F5F5);
}

/* ---------- 顶部导航右侧按钮 ---------- */
.page-header .header-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  padding: 8px 4px;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 6px;
  transition: background 0.2s;
}
.page-header .header-btn:active {
  background: rgba(255,255,255,0.2);
}

/* ---------- 空状态 ---------- */
.msg-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}
.msg-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.msg-empty-text {
  font-size: 15px;
  color: var(--color-text-hint, #8E8E93);
}

/* ---------- 消息列表 ---------- */
.msg-list {
  background-color: #fff;
}

/* ---------- 单个会话项 ---------- */
.conv-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border, #EEEEEE);
  cursor: pointer;
  transition: background-color 0.15s;
}
.conv-item:active {
  background-color: var(--color-primary-bg, #FFF5F8);
}

/* ---------- 头像容器 ---------- */
.conv-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  margin-right: 12px;
}

/* ---------- 头像通用 ---------- */
.conv-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 系统通知头像：浅蓝圆形背景 */
.sys-notif-avatar {
  background: linear-gradient(90deg, #01affe, #01cdff);
}
.sys-notif-icon {
  font-size: 22px;
  color: #fff;
  line-height: 1;
}

/* 用户头像：灰色圆形背景 + 首字 */
.user-avatar {
  background-color: var(--color-bg-secondary, #F2F2F7);
}
.user-avatar-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-secondary, #636366);
}

/* ---------- 未读徽章（粉圈白字） ---------- */
.unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background-color: var(--color-primary, #FF589B); /* 主题粉色 */
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  line-height: 20px;
  text-align: center;
  padding: 0 5px;
  box-sizing: border-box;
}

/* ---------- 右侧信息区 ---------- */
.conv-info {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  cursor: pointer;        /* 防止 flex 溢出 */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 第一行：名称 + 时间 */
.conv-top {
  display: flex;
  align-items: center;
}

.conv-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary, #1C1C1E);
  display: flex;
  align-items: center;
  gap: 6px;
}

.conv-time {
  font-size: 12px;
  color: var(--color-text-hint, #8E8E93);
  flex-shrink: 0;
  margin-left: auto;
}

/* 第二行：消息预览 */
.conv-bottom {
  display: flex;
  align-items: center;
}

.conv-preview {
  font-size: 13px;
  color: var(--color-text-secondary, #636366);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------- "官方"标签 ---------- */
.official-tag {
  display: inline-flex;
  padding: 1px 5px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;         /* 椭圆矩形 */
  background-color: #01beff;  /* 浅蓝色 */
  color: #fff;                /* 白色字体 */
  font-size: 8px;
  /* line-height: 16px; */
  vertical-align: middle;
  font-weight: 500;
}

/* ---------- 折叠栏铃铛 ---------- */
.fold-bell-icon {
  color: #999;
  font-size: 15px;
  width: 20px;
  text-align: center;
}

/* ---------- 底部导航小红点 ---------- */
.nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  background: var(--color-primary, #FF589B);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  border-radius: 9px;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
  display: none;
}

/* ---------- 折叠和一键已读栏 ---------- */
.msg-operation-container {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background-color: #fff;
}
.flex-spacer {
  min-width: 0;
  align-self: stretch;
  cursor: pointer;
}


.fold-toggle-area {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.fold-left {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 4px;
}

.fold-left .fold-text {
  font-size: 15px;
  color: #666;
  font-weight: 400;
}

.fold-left .icon {
  display: block;
  fill: #999;
}

.fold-action {
  font-size: 15px;
  color: #666;
  transition: color 0.2s;
}

.fold-separator {
  color: var(--color-border, #EEEEEE);
  margin: 0 2px;
}

.icon-arrow {
  transition: transform 0.25s ease;
}
.icon-arrow.rotated {
  transform: rotate(180deg);
}

.fold-right {
  display: flex;
  align-items: center;
  gap: 4px;
}


.mark-read-btn {
  font-size: 15px;
  color: var(--color-primary, #FF589B);
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}
.mark-read-btn:active {
  opacity: 0.7;
}

/* 被折叠的会话列表 */
.msg-folded-list {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.msg-folded-list.active {
  grid-template-rows: 1fr;
}
.msg-folded-inner {
  min-height: 0;
  overflow: hidden;
}