/* ============================================================
   moments.css — 朋友圈时间线 / 发布器 / 详情浮层 / 点赞评论浮层
   仿微信：深色封面、白底信息流、灰底点赞评论面板、绿主色
   ============================================================ */

.mm-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.mm-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  position: relative;
}
.mm-scroll::-webkit-scrollbar { display: none; }

/* ---------- 顶部封面 ---------- */
.mm-cover {
  position: relative;
  width: 100%;
  height: 62vh;
  max-height: 560px;
  min-height: 360px;
  overflow: hidden;
  background: #222;
}
.mm-cover img.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mm-cover .mm-cam {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 5;
  cursor: pointer;
}
.mm-cover .mm-cam svg { width: 24px; height: 24px; }

/* 自己（或作者）头像 + 昵称，右下角压在封面上 */
.mm-me {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 4;
}
.mm-me .mm-me-name {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.mm-me img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: #333;
}
/* 单页（某人朋友圈）标题遮罩 */
.mm-page-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  z-index: 4;
}

/* ---------- 信息流条目 ---------- */
.mm-feed-item {
  display: flex;
  gap: 10px;
  padding: 14px 14px 4px;
  position: relative;
}
.mm-feed-item .mm-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
  cursor: pointer;
}
.mm-body { flex: 1; min-width: 0; }
.mm-name {
  color: #576B95;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.mm-name.self { color: #1A1A1A; }
.mm-text {
  font-size: 16px;
  line-height: 1.45;
  margin-top: 3px;
  color: #1A1A1A;
  word-break: break-word;
}
.mm-text .mm-more { color: #576B95; cursor: pointer; }

/* 九宫格图片 */
.mm-imgs {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}
.mm-imgs.col1 { grid-template-columns: minmax(0, 70%); }
.mm-imgs.col2, .mm-imgs.col4 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 70%; }
.mm-imgs.col3, .mm-imgs.col5, .mm-imgs.col6,
.mm-imgs.col7, .mm-imgs.col8, .mm-imgs.col9 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 100%;
}
.mm-imgs .mm-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eee;
  cursor: pointer;
}

/* 底部行：时间 + 操作按钮 */
.mm-foot {
  display: flex;
  align-items: center;
  margin-top: 6px;
  gap: 10px;
}
.mm-foot .mm-time { font-size: 12px; color: var(--wx-text-faint); flex: 1; }
.mm-foot .mm-toggle {
  width: 34px;
  height: 24px;
  border-radius: 4px;
  background: #F2F2F2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  flex: none;
  position: relative;
}
.mm-foot .mm-toggle svg { width: 16px; height: 16px; color: #5A5A5A; }
.mm-foot .mm-toggle.liked { background: #FFE9E9; }
.mm-foot .mm-toggle.liked svg { color: #F54545; }
.mm-foot .mm-toggle.liked { animation: mmPop .22s ease; }
.mm-foot .mm-toggle.open { background: #E5E5E5; }

/* 点赞 / 评论浮层气泡 */
.mm-pop {
  position: absolute;
  right: 14px;
  top: 44px;
  background: #4C4C4C;
  border-radius: 6px;
  display: flex;
  align-items: center;
  z-index: 20;
  box-shadow: var(--wx-shadow-pop);
}
.mm-pop::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 14px;
  border: 6px solid transparent;
  border-bottom-color: #4C4C4C;
  border-top: 0;
}
.mm-pop .mm-pop-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 14px;
  padding: 8px 12px;
  cursor: pointer;
}
.mm-pop .mm-pop-btn + .mm-pop-btn {
  border-left: .5px solid rgba(255, 255, 255, .2);
}
.mm-pop .mm-pop-btn svg { width: 15px; height: 15px; color: #fff; }

/* 点赞 + 评论面板（灰底圆角） */
.mm-panel {
  margin-top: 8px;
  background: #F7F7F7;
  border-radius: 4px;
  padding: 6px 10px;
}
.mm-likes {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  padding: 3px 0;
}
.mm-likes .mm-heart { color: #F54545; flex: none; margin-top: 3px; }
.mm-likes .mm-heart svg { width: 13px; height: 13px; }
.mm-likes .mm-like-names { flex: 1; min-width: 0; }
.mm-likes .mm-like-name {
  color: #576B95;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.mm-panel .mm-divider {
  height: .5px;
  background: #E2E2E2;
  margin: 4px 0;
}
.mm-comment {
  font-size: 14px;
  line-height: 1.5;
  padding: 2px 0;
  cursor: pointer;
}
.mm-comment .c-name { color: #576B95; font-weight: 500; }
.mm-comment .c-reply { color: #576B95; }
.mm-comment .c-text { color: #1A1A1A; }

/* ---------- 评论输入条 ---------- */
.mm-comment-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border-top: .5px solid var(--wx-line-soft);
}
.mm-comment-bar input {
  flex: 1;
  background: #F2F2F2;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 15px;
}
.mm-comment-bar .mm-send {
  color: var(--wx-green);
  font-size: 15px;
  padding: 0 6px;
}
.mm-comment-bar .mm-send[disabled] { color: #B2B2B2; }

/* ---------- 发布浮层 ---------- */
.mm-publish-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 930;
}
.mm-publish {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 6%;
  background: #fff;
  z-index: 931;
  display: flex;
  flex-direction: column;
  animation: mmSlideUp .25s ease;
}
@keyframes mmSlideUp { from { transform: translateY(30%); } to { transform: translateY(0); } }
.mm-publish .pub-head {
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: .5px solid var(--wx-line-soft);
}
.mm-publish .pub-cancel { color: var(--wx-text-sub); font-size: 16px; }
.mm-publish .pub-title { font-size: 16px; font-weight: 600; }
.mm-publish .pub-post {
  background: var(--wx-green);
  color: #fff;
  font-size: 14px;
  padding: 5px 14px;
  border-radius: 4px;
}
.mm-publish .pub-post[disabled] { background: #9FDFB8; }
.mm-publish textarea {
  width: 100%;
  height: 130px;
  padding: 14px;
  font-size: 17px;
  resize: none;
  background: #fff;
}
.mm-pub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
}
.mm-pub-grid .pub-imgbox {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: #F2F2F2;
}
.mm-pub-grid .pub-imgbox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mm-pub-grid .pub-imgbox .pub-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mm-pub-grid .pub-add {
  aspect-ratio: 1 / 1;
  border: 1px dashed #C7C7CC;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #B2B2B2;
  font-size: 34px;
  cursor: pointer;
}

/* ---------- 详情浮层 ---------- */
.mm-detail-mask {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 940;
  display: flex;
  flex-direction: column;
  animation: mmFadeIn .2s;
}
@keyframes mmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.mm-detail-navbar {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: .5px solid var(--wx-line-soft);
  flex: none;
}
.mm-detail-navbar .d-back { color: var(--wx-green); font-size: 16px; }
.mm-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
}
.mm-detail-body .d-head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.mm-detail-body .d-head img { width: 44px; height: 44px; border-radius: 6px; }
.mm-detail-body .d-head .d-name { color: #576B95; font-weight: 600; font-size: 16px; }
.mm-detail-body .d-text { margin-top: 12px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; }
.mm-detail-body .d-imgs { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.mm-detail-body .d-imgs img { width: 100%; border-radius: 4px; }
.mm-detail-body .d-time { margin-top: 14px; font-size: 13px; color: var(--wx-text-faint); }

/* 时间线之间的竖线（微信时间感） */
.mm-feed-item:last-child { padding-bottom: 20px; }

/* 发布器元信息（位置 / 谁可以看） */
.pub-meta {
  border-top: .5px solid var(--wx-line-soft);
  margin-top: 6px;
}
.pub-row {
  display: flex;
  align-items: center;
  padding: 13px 14px;
  border-bottom: .5px solid var(--wx-line-soft);
  cursor: pointer;
}
.pub-row:active { background: #F2F2F2; }
.pub-row-label { color: var(--wx-text-main); font-size: 15px; flex: none; }
.pub-row-val { flex: 1; text-align: right; font-size: 15px; color: var(--wx-text-sub); margin-right: 8px; }
.pub-row-arrow { color: #C7C7CC; }

/* 信息流位置标签 */
.mm-loc {
  color: #576B95;
  font-size: 12px;
  flex: none;
}

/* 按天分隔条 */
.mm-dayhead {
  padding: 14px 14px 2px;
  font-size: 13px;
  color: var(--wx-text-faint);
}

/* 点赞弹跳动画 */
@keyframes mmPop {
  0% { transform: scale(.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.mm-pop-in { animation: mmPop .22s ease; }

@media (min-width: 900px) {
  .mm-scroll { max-width: 640px; margin: 0 auto; width: 100%; }
}
