/* 朋友圈 — 仿微信 PC 样式 */
.wx-im-moments-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--im-chat-bg, #ededed);
  overflow: hidden;
  position: relative;
  padding: 12px 12px 12px 0;
  box-sizing: border-box;
}
.wx-im-moments-main[hidden] { display: none !important; }
.wx-im-app.is-moments-mode:not(.is-moments-group-profile) .wx-im-chat-body { display: none !important; }
.wx-im-app.is-moments-mode.is-moments-group-profile .wx-im-moments-main { display: none !important; }
.wx-im-app.is-moments-mode.is-moments-group-profile .wx-im-chat-body {
  display: flex !important;
  flex: 1;
  min-height: 0;
}
.wx-im-app.is-moments-mode .wx-im-favorites-main { display: none !important; }

.wx-im-moments-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.wx-im-moments-hero {
  position: relative;
  margin-bottom: 0;
  flex-shrink: 0;
}

.wx-im-moments-cover {
  height: 280px;
  background-color: #6b8cae;
  background-image: url('/static/home/images/mi.png'), linear-gradient(135deg, #4a6fa5 0%, #6b8cae 45%, #8faec8 100%);
  background-size: cover;
  background-position: center;
  position: relative;
  border-radius: 0 12px 0 0;
  overflow: hidden;
}

.wx-im-moments-toolbar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.wx-im-moments-tool-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.92);
  color: #2c2c2c;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.wx-im-moments-tool-btn:not(.wx-im-moments-tool-btn--action) {
  width: 34px;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
}

.wx-im-moments-tool-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
}

.wx-im-moments-tool-btn:not(.wx-im-moments-tool-btn--action):hover {
  background: rgba(0, 0, 0, 0.48);
}

.wx-im-moments-tool-btn--action svg {
  flex-shrink: 0;
}

.wx-im-moments-profile {
  position: absolute;
  right: 20px;
  bottom: -28px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3;
}

.wx-im-moments-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.wx-im-moments-profile-name {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-im-moments-feed {
  flex: none;
  min-height: 0;
  overflow: visible;
  padding: 0 20px 32px;
  background: #fff;
  box-sizing: border-box;
}

.wx-im-moments-body {
  flex: 1;
  min-height: 320px;
  background: #fff;
  border-radius: 0 0 12px 0;
  padding-top: 36px;
}

.wx-im-moments-empty-hint,
.wx-im-moments-feed-empty {
  margin: 0;
  padding: 32px 12px;
  text-align: center;
  font-size: 13px;
  color: #999;
}

.wx-im-moments-post {
  display: flex;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid #ececec;
}

.wx-im-moments-post:last-child { border-bottom: none; }

.wx-im-moments-post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}

.wx-im-moments-post-avatar.is-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #576b95;
  background: #eef2f8;
}

.wx-im-moments-post-body {
  flex: 1;
  min-width: 0;
}

.wx-im-moments-post-name {
  font-size: 15px;
  font-weight: 600;
  color: #576b95;
  margin-bottom: 6px;
}

.wx-im-moments-post-text {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.55;
  color: #111;
  word-break: break-word;
  cursor: pointer;
}

.wx-im-moments-post-text.is-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wx-im-moments-post-media {
  margin: 8px 0 10px;
  cursor: pointer;
}

.wx-im-moments-post-media img,
.wx-im-moments-post-media video {
  display: block;
  max-width: 240px;
  max-height: 320px;
  border-radius: 4px;
  object-fit: cover;
  background: #f2f2f2;
}

.wx-im-moments-post-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 88px);
  gap: 4px;
  max-width: 272px;
}

.wx-im-moments-post-media-grid img {
  width: 88px;
  height: 88px;
  max-width: none;
  max-height: none;
}

.wx-im-moments-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.wx-im-moments-post-time {
  font-size: 12px;
  color: #b2b2b2;
}

.wx-im-moments-post-more {
  width: 28px;
  height: 18px;
  border: none;
  border-radius: 4px;
  background: #f7f7f7;
  color: #576b95;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  letter-spacing: 1px;
}

.wx-im-moments-post-social {
  margin-top: 8px;
  padding: 8px 10px;
  background: #f7f7f7;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.55;
  color: #111;
}

.wx-im-moments-post-likes {
  color: #576b95;
  margin-bottom: 4px;
}

.wx-im-moments-post-likes:empty { display: none; }

.wx-im-moments-post-likes::before {
  content: '♥ ';
  color: #576b95;
  font-size: 12px;
}

.wx-im-moments-post-comment {
  margin: 0;
  word-break: break-word;
}

.wx-im-moments-post-comment + .wx-im-moments-post-comment {
  margin-top: 4px;
}

.wx-im-moments-post-comment strong {
  color: #576b95;
  font-weight: 600;
}

.wx-im-moments-post-fav {
  margin-top: 4px;
  font-size: 12px;
  color: #888;
}

/* 好友朋友圈全屏层 */
.wx-im-moments-overlay {
  position: fixed;
  inset: 0;
  z-index: 14000;
  background: #ededed;
}
.wx-im-moments-overlay[hidden] { display: none !important; }

.wx-im-moments-overlay-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}

.wx-im-moments-overlay-back {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 20;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.wx-im-moments-scroll--overlay {
  flex: 1;
  min-height: 0;
}

/* 文章详情层（从朋友圈打开） */
.wx-im-moments-article-layer {
  position: fixed;
  inset: 0;
  z-index: 15000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wx-im-moments-article-layer[hidden] { display: none !important; }

.wx-im-moments-article-toolbar {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.wx-im-moments-article-toolbar > * {
  pointer-events: auto;
}

.wx-im-moments-article-close {
  position: static;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #333;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.wx-im-moments-article-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.wx-im-moments-article-back {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: #333;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}

.wx-im-moments-article-back:hover {
  background: rgba(255, 255, 255, 0.72);
}

.wx-im-moments-article-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  position: relative;
}

.wx-im-moments-article-body .xhs-note-shell {
  width: min(1320px, calc(100% - 24px));
  margin: 0 auto;
  padding-top: 8px;
}

.wx-im-moments-article-loading {
  padding: 48px 20px;
  text-align: center;
  color: #999;
}

.wx-im-moments-empty {
  display: none !important;
}

@media (max-width: 768px) {
  .wx-im-moments-cover { height: 220px; }
  .wx-im-moments-profile-avatar { width: 56px; height: 56px; }
  .wx-im-moments-profile-name { font-size: 15px; }
  .wx-im-moments-feed { padding: 0 12px 20px; }
}
