/* ===== 仿微信朋友圈 H5（依据 CoderMikeHe/WeChat 真实规格还原） =====
   关键数值来源：MHConstant.h / MHMomentProfileView.m
   - 头像 44px；封面头像 75px(叠放在封面底部下方24px、右距10px)
   - 昵称色 #5B6A92；时间灰 #737373；正文黑；点赞评论区底 #F3F3F5
   - 九宫格 86px/间距6px；4图2列、其余3列；单图最大高180
   - •••弹窗 181x39，气泡背景 wx_albumOperateMoreViewBkg，上箭头 wx_albumTriangleB
*/
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: #b8b8bd; color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}
.phone {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  background: #fff; position: relative; overflow: hidden;
  box-shadow: 0 0 24px rgba(0,0,0,.2);
}

/* 状态栏 */
.statusbar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: 26px; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; color: #fff; font-size: 13px; font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.45); pointer-events: none;
}
.statusbar .right { display: flex; gap: 6px; align-items: center; }
.statusbar .right svg { height: 11px; width: auto; fill: #fff; }
.statusbar .right .sb-batt { height: 12px; }

/* 封面（正方形，高=宽） */
.cover {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  background-image: url(/static/assets/cover_bg2.png);
}
/* 封面顶部透明导航：左返回、右相机（仿微信朋友圈） */
.cover-top {
  position: absolute; top: 30px; left: 0; right: 0;   /* 26px 状态栏 + 4px 间距 */
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 8px; z-index: 20;
}
.cover-top button {
  background: none; border: none; padding: 5px; cursor: pointer;
  line-height: 0; border-radius: 50%;
}
.cover-top button:active { background: rgba(255, 255, 255, .2); }
.cover-top .nav-back img { height: 24px; width: auto; display: block; filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.cover-top .nav-cam img {
  width: 23px; height: 23px; display: block;
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0,0,0,.35));  /* 黑色相机转白 */
}

.cover .me {
  position: absolute; right: 10px; bottom: -24px;
  display: flex; align-items: flex-end; gap: 12px;
}
.cover .me .name {
  color: #fff; font-size: 17px; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,.5); margin-bottom: 40px;
}
.cover .me .avatar {
  width: 75px; height: 75px; border-radius: 6px;
  object-fit: cover; background: #ccc;
}

/* 帖子列表 */
.feed { padding: 40px 0 40px; }
.post {
  display: flex; gap: 10px; padding: 16px 14px;
  border-bottom: 1px solid #e5e5e5;
}
.post .ava {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 6px;
  object-fit: cover; background: #d8d8d8;
}
.post .body { flex: 1; min-width: 0; }
.post .uname { color: #5B6A92; font-size: 16px; font-weight: 600; }
.post .text { font-size: 15px; line-height: 1.42; margin: 6px 0; color: #1a1a1a; white-space: pre-wrap; word-break: break-word; }

/* 九宫格（自适应：多图 3 列、4 图 2 列、单图按比例；宽度由 grid 1fr 自动算） */
.imgs { display: grid; gap: 6px; margin: 6px 0; }
.imgs.g2 { grid-template-columns: repeat(2, 1fr); }
.imgs.g4 { grid-template-columns: repeat(2, 1fr); max-width: calc((100% - 12px) * 2 / 3 + 6px); }
.imgs.g3, .imgs.g5, .imgs.g6, .imgs.g7, .imgs.g8, .imgs.g9 { grid-template-columns: repeat(3, 1fr); }
.imgs .img {
  width: 100%; aspect-ratio: 1 / 1; background: #d8d8d8;
  border-radius: 3px; overflow: hidden;
}
.imgs.g1 { display: block; }
.imgs.g1 .img {
  width: auto; max-width: 65%; height: auto; max-height: 180px;
  aspect-ratio: auto; border-radius: 3px;
}
.imgs .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgs.g1 .img img { object-fit: contain; }

/* 工具条 */
.toolbar { display: flex; align-items: center; margin-top: 8px; position: relative; }
.toolbar .meta { flex: 1; }
.toolbar .time { color: #737373; font-size: 12px; }
/* 删除图标：用两张 svg 按主题切换（del.svg 浅色 / del_black.svg 深色），由 JS 切 src */
.toolbar .del { height: 12px; width: auto; margin-left: 1em; font-size: 12px; cursor: pointer; vertical-align: middle; }
/* 工具栏右侧 评论图标：使用提供的浅色/深色 SVG（由 JS 按主题切换） */
.toolbar .more {
  background: none; border: none; padding: 0; margin-left: 8px;
  height: 22px; cursor: pointer; line-height: 0;
  display: flex; align-items: center;
}
.toolbar .more img { height: 16px; width: auto; display: block; }

/* 新消息提示：位于文案（帖子）上方居中，常驻显示，不自动消失 */
.cmt-pop {
  display: none;
  margin: 62px auto 0;
  width: fit-content;
  max-width: 90%;
  background: #3a3a3c; color: #fff; border-radius: 4px;
  padding: 4px 36px 4px 4px; gap: 2em; align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
}
.cmt-pop.show { display: flex; }
.cmt-pop img {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 5px;
  object-fit: cover; background: #555;
}
.cmt-pop .ctext { color: #fff; font-size: 15px; line-height: 1.2; white-space: nowrap; }
/* 提示出现时，帖子与提示之间收紧间距（贴近微信布局） */
.cmt-pop.show + .feed { padding-top: 22px; }

/* 点赞/评论区 */
.footer {
  position: relative; margin-top: 8px; background: #F3F3F5;
  border-radius: 4px; padding: 7px 9px; display: none;
}

/* 增量出现动效：新节点 fadeUp 0.35s */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.new { animation: fadeUp .35s ease both; }
.likes { padding-bottom: 6px; line-height: 1.55; word-break: break-all; overflow-wrap: anywhere; }
.likes .hearticon { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; color: #5B6A92; }
.like-item { display: inline-flex; align-items: center; gap: 3px; }
.like-item .lavatar { width: 20px; height: 20px; border-radius: 4px; object-fit: cover; background: #d8d8d8; }
.likes .who { color: #5B6A92; font-size: 14px; }
.likes .sep { color: #5B6A92; font-size: 14px; }
.comments { padding-top: 2px; }
.likes:empty { padding-bottom: 0; }
.comments:empty { padding-top: 0; }
.footer.haslikes .comments { border-top: 1px solid #e2e2e4; padding-top: 6px; margin-top: 1px; }
.comment-item { padding: 2px 0; font-size: 14px; line-height: 1.5; }
.comment-item .cbody { font-size: 14px; line-height: 1.5; }
.comment-item .nm { color: #5B6A92; font-weight: 500; }
.comment-item .tx { color: #1a1a1a; }
.empty { color: #b2b2b2; font-size: 13px; padding: 2px 0; }

/* ===== 深色模式（控制台切换，body.dark） ===== */
body.dark { background: #000; }
body.dark .phone { background: #000; box-shadow: 0 0 24px rgba(0,0,0,.6); }
body.dark .post { border-bottom-color: #1c1c1e; }
body.dark .uname { color: #7d90a9; }
body.dark .post .text { color: #e6e6e6; }
body.dark .toolbar .time { color: #8a8a8e; }
body.dark .toolbar .del { color: #7d90a9; }
body.dark .toolbar .del:hover { color: #93a6c4; }
body.dark .footer { background: #2a2a2c; }
body.dark .likes .who, body.dark .likes .sep, body.dark .likes .hearticon { color: #7d90a9; }
body.dark .comment-item .nm { color: #7d90a9; }
body.dark .comment-item .tx { color: #e6e6e6; }
body.dark .footer.haslikes .comments { border-top-color: #3a3a3c; }
