/* 消息模块底栏：消息 / 联系人 / 朋友圈 */

.wechat-tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 18;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  min-height: calc(52px + env(safe-area-inset-bottom, 0px));
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(247, 247, 247, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

/* 见面 / 群聊 / 相册 / 设置等叠加层打开时强制隐藏，避免挡住返回与发送等按钮 */
#main-app.meeting-mode > .wechat-tab-bar,
#main-app.group-chat-list-mode > .wechat-tab-bar,
#main-app.group-chat-play-mode > .wechat-tab-bar,
#main-app.meeting-album-picker-mode > .wechat-tab-bar,
#main-app.meeting-album-content-mode > .wechat-tab-bar,
#main-app.desktop-active > .wechat-tab-bar,
#main-app.settings-tab > .wechat-tab-bar,
#main-app.music-active > .wechat-tab-bar,
#main-app.favorites-active > .wechat-tab-bar,
#main-app.learning-active > .wechat-tab-bar,
#main-app.reading-active > .wechat-tab-bar {
  display: none !important;
  pointer-events: none !important;
}

.wechat-tab-bar.hidden {
  display: none !important;
  pointer-events: none !important;
}

.wechat-tab-btn {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #737373;
  font: inherit;
}

.wechat-tab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.wechat-tab-label {
  font-size: 0.68rem;
  line-height: 1.2;
}

.wechat-tab-btn.is-active {
  color: #07c160;
}

.wechat-tab-btn:active {
  opacity: 0.75;
}

/* 有底栏时：消息页铺满可视区域，底栏叠在上方，内容区用 padding 避让 */
#main-app.wechat-shell-active #view-chat.view {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-bottom: 0 !important;
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 5;
}

#main-app.wechat-shell-active #view-chat .chat-inbox--wechat,
#main-app.wechat-shell-active #view-chat .chat-inbox--contacts-style,
#main-app.wechat-shell-active #view-contacts .contacts-shell--wechat,
#main-app.wechat-shell-active #view-moments .moments-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.wx-chat-avatar--group {
  background: #07c160 !important;
  color: #fff !important;
  font-size: 1.25rem !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#main-app.wechat-shell-active #moments-detail-composer:not(.hidden) {
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}

#main-app.wechat-shell-active > .silas-home-fab {
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* —— 微信风格消息会话列表 —— */
.chat-inbox--wechat {
  background: #ededed !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.wx-chat-top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: calc(44px + env(safe-area-inset-top, 0px));
  padding: calc(10px + env(safe-area-inset-top, 0px)) 48px 10px;
  background: #ededed;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.wx-chat-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111;
  letter-spacing: 0.02em;
}

.wx-chat-home-btn {
  position: absolute;
  right: 10px;
  bottom: 4px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #111;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.wx-chat-home-btn:active {
  opacity: 0.55;
}

.wx-chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.wx-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
}

.wx-chat-row {
  margin: 0;
  padding: 0;
  border-bottom: 0.5px solid #e5e5e5;
  background: #fff;
}

.wx-chat-row--locked {
  opacity: 0.55;
}

.wx-chat-row--locked .wx-chat-preview {
  color: #8a7a9a;
}

.wx-chat-row:active,
.wx-chat-row.wx-chat-row--pressing {
  background: #ececec;
}

.wx-chat-row-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-sizing: border-box;
}

.wx-chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.wx-chat-avatar-wrap .contacts-avatar,
.wx-chat-avatar-wrap .wx-chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-chat-avatar-wrap .contacts-avatar-img,
.wx-chat-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wx-chat-avatar-wrap .contacts-avatar-fallback {
  font-size: 1.1rem;
  font-weight: 600;
  color: #888;
}

.wx-chat-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  border: 1.5px solid #fff;
}

.wx-chat-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wx-chat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.wx-chat-name {
  flex: 1;
  min-width: 0;
  font-size: 1.02rem;
  font-weight: 400;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-chat-time {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: #b2b2b2;
}

.wx-chat-preview {
  font-size: 0.82rem;
  color: #999;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 兼容旧 class（未读角标更新） */
.chat-message-contact-unread {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chat-message-contact-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.chat-message-contact-time {
  font-size: 0.68rem;
  color: #999;
}

/* —— 叙事事件提示条 —— */
.narrative-event-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.narrative-event-banner.hidden {
  display: none !important;
}

.narrative-event-banner-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.narrative-event-banner-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.narrative-event-banner-list,
.narrative-event-banner-dismiss {
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.narrative-event-banner-dismiss {
  padding: 6px 9px;
  font-size: 1rem;
  line-height: 1;
}

.narrative-event-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  margin: 8px 0 12px;
}

.narrative-event-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.narrative-event-row-ctx {
  font-size: 0.8rem;
  color: #666;
}

.narrative-event-row-status {
  font-size: 0.72rem;
  color: #07c160;
}

.meeting-event-banner {
  margin: 8px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #f0e0b2;
  color: #6a5a30;
  font-size: 0.85rem;
  line-height: 1.4;
}
/* 消息模块底栏：消息 / 联系人 / 朋友圈 */

.wechat-tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 18;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  min-height: calc(52px + env(safe-area-inset-bottom, 0px));
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(247, 247, 247, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

/* 见面 / 群聊 / 相册 / 设置等叠加层打开时强制隐藏，避免挡住返回与发送等按钮 */
#main-app.meeting-mode > .wechat-tab-bar,
#main-app.group-chat-list-mode > .wechat-tab-bar,
#main-app.group-chat-play-mode > .wechat-tab-bar,
#main-app.meeting-album-picker-mode > .wechat-tab-bar,
#main-app.meeting-album-content-mode > .wechat-tab-bar,
#main-app.desktop-active > .wechat-tab-bar,
#main-app.settings-tab > .wechat-tab-bar,
#main-app.music-active > .wechat-tab-bar,
#main-app.favorites-active > .wechat-tab-bar,
#main-app.learning-active > .wechat-tab-bar,
#main-app.reading-active > .wechat-tab-bar {
  display: none !important;
  pointer-events: none !important;
}

.wechat-tab-bar.hidden {
  display: none !important;
  pointer-events: none !important;
}

.wechat-tab-btn {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #737373;
  font: inherit;
}

.wechat-tab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.wechat-tab-label {
  font-size: 0.68rem;
  line-height: 1.2;
}

.wechat-tab-btn.is-active {
  color: #07c160;
}

.wechat-tab-btn:active {
  opacity: 0.75;
}

/* 有底栏时：消息页铺满可视区域，底栏叠在上方，内容区用 padding 避让 */
#main-app.wechat-shell-active #view-chat.view {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-bottom: 0 !important;
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 5;
}

#main-app.wechat-shell-active #view-chat .chat-inbox--wechat,
#main-app.wechat-shell-active #view-chat .chat-inbox--contacts-style,
#main-app.wechat-shell-active #view-contacts .contacts-shell--wechat,
#main-app.wechat-shell-active #view-moments .moments-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.wx-chat-avatar--group {
  background: #07c160 !important;
  color: #fff !important;
  font-size: 1.25rem !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#main-app.wechat-shell-active #moments-detail-composer:not(.hidden) {
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}

#main-app.wechat-shell-active > .silas-home-fab {
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* —— 微信风格消息会话列表 —— */
.chat-inbox--wechat {
  background: #ededed !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.wx-chat-top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: calc(44px + env(safe-area-inset-top, 0px));
  padding: calc(10px + env(safe-area-inset-top, 0px)) 48px 10px;
  background: #ededed;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.wx-chat-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111;
  letter-spacing: 0.02em;
}

.wx-chat-home-btn {
  position: absolute;
  right: 10px;
  bottom: 4px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #111;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.wx-chat-home-btn:active {
  opacity: 0.55;
}

.wx-chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.wx-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
}

.wx-chat-row {
  margin: 0;
  padding: 0;
  border-bottom: 0.5px solid #e5e5e5;
  background: #fff;
}

.wx-chat-row--locked {
  opacity: 0.55;
}

.wx-chat-row--locked .wx-chat-preview {
  color: #8a7a9a;
}

.wx-chat-row:active,
.wx-chat-row.wx-chat-row--pressing {
  background: #ececec;
}

.wx-chat-row-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-sizing: border-box;
}

.wx-chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.wx-chat-avatar-wrap .contacts-avatar,
.wx-chat-avatar-wrap .wx-chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-chat-avatar-wrap .contacts-avatar-img,
.wx-chat-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wx-chat-avatar-wrap .contacts-avatar-fallback {
  font-size: 1.1rem;
  font-weight: 600;
  color: #888;
}

.wx-chat-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  border: 1.5px solid #fff;
}

.wx-chat-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wx-chat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.wx-chat-name {
  flex: 1;
  min-width: 0;
  font-size: 1.02rem;
  font-weight: 400;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-chat-time {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: #b2b2b2;
}

.wx-chat-preview {
  font-size: 0.82rem;
  color: #999;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 兼容旧 class（未读角标更新） */
.chat-message-contact-unread {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chat-message-contact-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.chat-message-contact-time {
  font-size: 0.68rem;
  color: #999;
}

/* —— 叙事事件提示条 —— */
.narrative-event-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.narrative-event-banner.hidden {
  display: none !important;
}

.narrative-event-banner-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.narrative-event-banner-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.narrative-event-banner-list,
.narrative-event-banner-dismiss {
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.narrative-event-banner-dismiss {
  padding: 6px 9px;
  font-size: 1rem;
  line-height: 1;
}

.narrative-event-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  margin: 8px 0 12px;
}

.narrative-event-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.narrative-event-row-ctx {
  font-size: 0.8rem;
  color: #666;
}

.narrative-event-row-status {
  font-size: 0.72rem;
  color: #07c160;
}

.meeting-event-banner {
  margin: 8px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #f0e0b2;
  color: #6a5a30;
  font-size: 0.85rem;
  line-height: 1.4;
}
/* 消息模块底栏：消息 / 联系人 / 朋友圈 */

.wechat-tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 18;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  min-height: calc(52px + env(safe-area-inset-bottom, 0px));
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(247, 247, 247, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

/* 见面 / 群聊 / 相册 / 设置等叠加层打开时强制隐藏，避免挡住返回与发送等按钮 */
#main-app.meeting-mode > .wechat-tab-bar,
#main-app.group-chat-list-mode > .wechat-tab-bar,
#main-app.group-chat-play-mode > .wechat-tab-bar,
#main-app.meeting-album-picker-mode > .wechat-tab-bar,
#main-app.meeting-album-content-mode > .wechat-tab-bar,
#main-app.desktop-active > .wechat-tab-bar,
#main-app.settings-tab > .wechat-tab-bar,
#main-app.music-active > .wechat-tab-bar,
#main-app.favorites-active > .wechat-tab-bar,
#main-app.learning-active > .wechat-tab-bar,
#main-app.reading-active > .wechat-tab-bar {
  display: none !important;
  pointer-events: none !important;
}

.wechat-tab-bar.hidden {
  display: none !important;
  pointer-events: none !important;
}

.wechat-tab-btn {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #737373;
  font: inherit;
}

.wechat-tab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.wechat-tab-label {
  font-size: 0.68rem;
  line-height: 1.2;
}

.wechat-tab-btn.is-active {
  color: #07c160;
}

.wechat-tab-btn:active {
  opacity: 0.75;
}

/* 有底栏时：消息页铺满可视区域，底栏叠在上方，内容区用 padding 避让 */
#main-app.wechat-shell-active #view-chat.view {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-bottom: 0 !important;
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 5;
}

#main-app.wechat-shell-active #view-chat .chat-inbox--wechat,
#main-app.wechat-shell-active #view-chat .chat-inbox--contacts-style,
#main-app.wechat-shell-active #view-contacts .contacts-shell--wechat,
#main-app.wechat-shell-active #view-moments .moments-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.wx-chat-avatar--group {
  background: #07c160 !important;
  color: #fff !important;
  font-size: 1.25rem !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#main-app.wechat-shell-active #moments-detail-composer:not(.hidden) {
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}

#main-app.wechat-shell-active > .silas-home-fab {
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* —— 微信风格消息会话列表 —— */
.chat-inbox--wechat {
  background: #ededed !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.wx-chat-top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: calc(44px + env(safe-area-inset-top, 0px));
  padding: calc(10px + env(safe-area-inset-top, 0px)) 48px 10px;
  background: #ededed;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.wx-chat-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111;
  letter-spacing: 0.02em;
}

.wx-chat-home-btn {
  position: absolute;
  right: 10px;
  bottom: 4px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #111;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.wx-chat-home-btn:active {
  opacity: 0.55;
}

.wx-chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.wx-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
}

.wx-chat-row {
  margin: 0;
  padding: 0;
  border-bottom: 0.5px solid #e5e5e5;
  background: #fff;
}

.wx-chat-row--locked {
  opacity: 0.55;
}

.wx-chat-row--locked .wx-chat-preview {
  color: #8a7a9a;
}

.wx-chat-row:active,
.wx-chat-row.wx-chat-row--pressing {
  background: #ececec;
}

.wx-chat-row-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-sizing: border-box;
}

.wx-chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.wx-chat-avatar-wrap .contacts-avatar,
.wx-chat-avatar-wrap .wx-chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-chat-avatar-wrap .contacts-avatar-img,
.wx-chat-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wx-chat-avatar-wrap .contacts-avatar-fallback {
  font-size: 1.1rem;
  font-weight: 600;
  color: #888;
}

.wx-chat-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  border: 1.5px solid #fff;
}

.wx-chat-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wx-chat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.wx-chat-name {
  flex: 1;
  min-width: 0;
  font-size: 1.02rem;
  font-weight: 400;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-chat-time {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: #b2b2b2;
}

.wx-chat-preview {
  font-size: 0.82rem;
  color: #999;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 兼容旧 class（未读角标更新） */
.chat-message-contact-unread {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chat-message-contact-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.chat-message-contact-time {
  font-size: 0.68rem;
  color: #999;
}

/* —— 叙事事件提示条 —— */
.narrative-event-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.narrative-event-banner.hidden {
  display: none !important;
}

.narrative-event-banner-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.narrative-event-banner-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.narrative-event-banner-list,
.narrative-event-banner-dismiss {
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.narrative-event-banner-dismiss {
  padding: 6px 9px;
  font-size: 1rem;
  line-height: 1;
}

.narrative-event-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  margin: 8px 0 12px;
}

.narrative-event-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.narrative-event-row-ctx {
  font-size: 0.8rem;
  color: #666;
}

.narrative-event-row-status {
  font-size: 0.72rem;
  color: #07c160;
}

.meeting-event-banner {
  margin: 8px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #f0e0b2;
  color: #6a5a30;
  font-size: 0.85rem;
  line-height: 1.4;
}
/* 消息模块底栏：消息 / 联系人 / 朋友圈 */

.wechat-tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 18;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  min-height: calc(52px + env(safe-area-inset-bottom, 0px));
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(247, 247, 247, 0.96);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}

/* 见面 / 群聊 / 相册 / 设置等叠加层打开时强制隐藏，避免挡住返回与发送等按钮 */
#main-app.meeting-mode > .wechat-tab-bar,
#main-app.group-chat-list-mode > .wechat-tab-bar,
#main-app.group-chat-play-mode > .wechat-tab-bar,
#main-app.meeting-album-picker-mode > .wechat-tab-bar,
#main-app.meeting-album-content-mode > .wechat-tab-bar,
#main-app.desktop-active > .wechat-tab-bar,
#main-app.settings-tab > .wechat-tab-bar,
#main-app.music-active > .wechat-tab-bar,
#main-app.favorites-active > .wechat-tab-bar,
#main-app.learning-active > .wechat-tab-bar,
#main-app.reading-active > .wechat-tab-bar {
  display: none !important;
  pointer-events: none !important;
}

.wechat-tab-bar.hidden {
  display: none !important;
  pointer-events: none !important;
}

.wechat-tab-btn {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #737373;
  font: inherit;
}

.wechat-tab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.wechat-tab-label {
  font-size: 0.68rem;
  line-height: 1.2;
}

.wechat-tab-btn.is-active {
  color: #07c160;
}

.wechat-tab-btn:active {
  opacity: 0.75;
}

/* 有底栏时：消息页铺满可视区域，底栏叠在上方，内容区用 padding 避让 */
#main-app.wechat-shell-active #view-chat.view {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-bottom: 0 !important;
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 5;
}

#main-app.wechat-shell-active #view-chat .chat-inbox--wechat,
#main-app.wechat-shell-active #view-chat .chat-inbox--contacts-style,
#main-app.wechat-shell-active #view-contacts .contacts-shell--wechat,
#main-app.wechat-shell-active #view-moments .moments-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.wx-chat-avatar--group {
  background: #07c160 !important;
  color: #fff !important;
  font-size: 1.25rem !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#main-app.wechat-shell-active #moments-detail-composer:not(.hidden) {
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}

#main-app.wechat-shell-active > .silas-home-fab {
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* —— 微信风格消息会话列表 —— */
.chat-inbox--wechat {
  background: #ededed !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.wx-chat-top-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: calc(44px + env(safe-area-inset-top, 0px));
  padding: calc(10px + env(safe-area-inset-top, 0px)) 48px 10px;
  background: #ededed;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.wx-chat-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111;
  letter-spacing: 0.02em;
}

.wx-chat-home-btn {
  position: absolute;
  right: 10px;
  bottom: 4px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #111;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.wx-chat-home-btn:active {
  opacity: 0.55;
}

.wx-chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.wx-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
}

.wx-chat-row {
  margin: 0;
  padding: 0;
  border-bottom: 0.5px solid #e5e5e5;
  background: #fff;
}

.wx-chat-row--locked {
  opacity: 0.55;
}

.wx-chat-row--locked .wx-chat-preview {
  color: #8a7a9a;
}

.wx-chat-row:active,
.wx-chat-row.wx-chat-row--pressing {
  background: #ececec;
}

.wx-chat-row-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-sizing: border-box;
}

.wx-chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}

.wx-chat-avatar-wrap .contacts-avatar,
.wx-chat-avatar-wrap .wx-chat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wx-chat-avatar-wrap .contacts-avatar-img,
.wx-chat-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wx-chat-avatar-wrap .contacts-avatar-fallback {
  font-size: 1.1rem;
  font-weight: 600;
  color: #888;
}

.wx-chat-unread {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  border: 1.5px solid #fff;
}

.wx-chat-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wx-chat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.wx-chat-name {
  flex: 1;
  min-width: 0;
  font-size: 1.02rem;
  font-weight: 400;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-chat-time {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: #b2b2b2;
}

.wx-chat-preview {
  font-size: 0.82rem;
  color: #999;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 兼容旧 class（未读角标更新） */
.chat-message-contact-unread {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fa5151;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chat-message-contact-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.chat-message-contact-time {
  font-size: 0.68rem;
  color: #999;
}

/* —— 叙事事件提示条 —— */
.narrative-event-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(420px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.narrative-event-banner.hidden {
  display: none !important;
}

.narrative-event-banner-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.narrative-event-banner-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.narrative-event-banner-list,
.narrative-event-banner-dismiss {
  flex-shrink: 0;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.narrative-event-banner-dismiss {
  padding: 6px 9px;
  font-size: 1rem;
  line-height: 1;
}

.narrative-event-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  margin: 8px 0 12px;
}

.narrative-event-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.narrative-event-row-ctx {
  font-size: 0.8rem;
  color: #666;
}

.narrative-event-row-status {
  font-size: 0.72rem;
  color: #07c160;
}

.meeting-event-banner {
  margin: 8px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #f0e0b2;
  color: #6a5a30;
  font-size: 0.85rem;
  line-height: 1.4;
}
