/* ============================================================
   朋友圈（moments）· 微信风格
   设计口径：白卡片 + 灰底、名字用链接蓝、正文纯文本、九宫格媒体、
   点赞/评论合并在同一块浅灰区域里（这是朋友圈最容易被认出来的结构）。
   ============================================================ */

.mo-page {
  --mo-blue: #576b95;
  --mo-time: #b2b2b2;
  --mo-social-bg: #f7f7f7;
  --mo-page-bg: #ededed;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 10px 90px;
}

html[data-theme="dark"] .mo-page {
  --mo-blue: #8aa4d6;
  --mo-time: #7d838a;
  --mo-social-bg: #26292c;
  --mo-page-bg: #141618;
}

/* ---------- 封面 ---------- */
.mo-cover {
  position: relative;
  margin: 10px 0 0;
  border-radius: 12px;
  overflow: hidden;
  color: #fff;
  background: #2b3a42;
}

.mo-cover-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 120% at 10% 0%, #3d5a63 0%, rgba(61, 90, 99, 0) 55%),
    radial-gradient(100% 100% at 90% 10%, #2f4a5a 0%, rgba(47, 74, 90, 0) 60%),
    linear-gradient(135deg, #22303a 0%, #33474f 55%, #1d272d 100%);
}

.mo-cover-inner {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 46px 18px 16px;
  min-height: 158px;
}

.mo-cover-text { flex: 1; min-width: 0; }

.mo-cover-text h1 {
  font-size: 20px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mo-cover-sign {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mo-cover-stats {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, .68);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mo-cover-badge {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 11.5px;
}

.mo-cover-badge:hover { background: rgba(255, 255, 255, .28); text-decoration: none; }

.mo-cover-avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .18);
  border: 2px solid rgba(255, 255, 255, .55);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-decoration: none;
}

.mo-cover-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mo-cover-avatar:hover { text-decoration: none; }

.mo-cover-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 14px;
  flex-wrap: wrap;
}

.mo-friend-btn {
  border: 1px solid rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: 999px;
  padding: 4px 14px;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.mo-friend-btn:hover { background: rgba(255, 255, 255, .24); }
.mo-friend-btn[data-relation="Friends"] { border-color: rgba(255, 255, 255, .28); color: rgba(255, 255, 255, .8); }

.mo-cover-link {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .78);
}

.mo-cover-link:hover { color: #fff; text-decoration: none; }

.mo-notice {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--c-surface);
  border: 1px dashed var(--c-border);
  font-size: 12px;
  color: var(--c-text-3);
}

/* ---------- 页签 ---------- */
.mo-tabs {
  display: flex;
  gap: 4px;
  margin: 10px 0 8px;
  background: var(--c-surface);
  border-radius: 10px;
  padding: 4px;
}

.mo-tabs a {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--c-text-2);
}

.mo-tabs a:hover { text-decoration: none; background: var(--c-primary-weak); }
.mo-tabs a.active { background: var(--c-primary-weak); color: var(--c-primary); font-weight: 600; }

/* ---------- 动态卡片 ---------- */
.mo-list { display: flex; flex-direction: column; gap: 8px; }

.mo-item {
  display: flex;
  gap: 10px;
  padding: 14px 12px;
  background: var(--c-surface);
  border-radius: 10px;
  border: 1px solid var(--c-border);
}

.mo-avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--c-primary-weak);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  text-decoration: none;
}

.mo-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mo-avatar:hover { text-decoration: none; }

.mo-body { flex: 1; min-width: 0; }

.mo-name {
  display: inline-block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--mo-blue);
  line-height: 1.4;
}

.mo-text {
  margin-top: 4px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--c-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 九宫格 ---------- */
.mo-media {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  max-width: 420px;
}

.mo-media.n1 { grid-template-columns: minmax(0, 240px); }
.mo-media.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 260px; }
.mo-media.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mo-media.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 260px; }
.mo-media.n9 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mo-photo {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 4px;
  background: var(--c-bg);
  aspect-ratio: 1 / 1;
}

.mo-media.n1 .mo-photo { aspect-ratio: 4 / 3; }
.mo-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mo-photo:hover { text-decoration: none; }

.mo-video { margin-top: 8px; max-width: 420px; }
.mo-video video {
  width: 100%;
  border-radius: 6px;
  background: #000;
  display: block;
  max-height: 420px;
}

.mo-loc {
  margin-top: 6px;
  font-size: 12px;
  color: var(--mo-blue);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ---------- 时间 / 操作 ---------- */
.mo-meta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--mo-time);
}

.mo-spacer { flex: 1; }

.mo-vis {
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  font-size: 11px;
  line-height: 16px;
  color: var(--c-text-3);
}

.mo-del {
  border: 0;
  background: none;
  color: var(--c-text-3);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.mo-del:hover { color: var(--c-danger); }

.mo-dot {
  width: 26px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  background: var(--c-bg);
  color: var(--mo-blue);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0;
}

.mo-dot:hover { background: var(--c-primary-weak); }

.mo-menu {
  position: absolute;
  right: 0;
  bottom: 26px;
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  z-index: 5;
}

.mo-menu[hidden] { display: none; }

.mo-menu button {
  border: 0;
  background: #4c4c4c;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.mo-menu button + button { border-left: 1px solid rgba(255, 255, 255, .18); }
.mo-menu button:hover { background: #5d5d5d; }
.mo-menu button.on { color: #ffd479; }

/* ---------- 点赞 / 评论 ---------- */
.mo-social {
  position: relative;
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--mo-social-bg);
  font-size: 13px;
  line-height: 1.55;
}

.mo-social.is-empty { display: none; }

/* 微信那块小三角 */
.mo-social::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 12px;
  width: 8px;
  height: 8px;
  background: var(--mo-social-bg);
  transform: rotate(45deg);
}

.mo-likes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  color: var(--mo-blue);
  padding-bottom: 2px;
}

.mo-likes.is-empty {
  display: none;
  padding: 0;
}

.mo-like-icon { color: var(--mo-blue); font-size: 12px; }

.mo-like-name { color: var(--mo-blue); font-weight: 500; }
.mo-like-more { color: var(--c-text-3); }

.mo-comments { padding-top: 2px; }

.mo-comments:not(:empty) { border-top: 1px solid rgba(0, 0, 0, .05); padding-top: 4px; }

html[data-theme="dark"] .mo-comments:not(:empty) { border-top-color: rgba(255, 255, 255, .07); }

.mo-c { position: relative; padding: 1px 34px 1px 0; font-size: 13px; word-break: break-word; }
.mo-c-name { color: var(--mo-blue); font-weight: 500; }
.mo-c-reply, .mo-c-sep { color: var(--c-text-2); }
.mo-c-text { color: var(--c-text); white-space: pre-wrap; }

.mo-c-del {
  position: absolute;
  right: 0;
  top: 2px;
  border: 0;
  background: none;
  color: var(--c-text-3);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease;
}

.mo-c:hover .mo-c-del, .mo-c-del:focus-visible { opacity: 1; }
.mo-c-del:hover { color: var(--c-danger); }

.mo-more {
  border: 0;
  background: none;
  color: var(--mo-blue);
  font-family: inherit;
  font-size: 12.5px;
  padding: 2px 0;
  cursor: pointer;
}

.mo-more:hover { text-decoration: underline; }

/* ---------- 行内评论框 ---------- */
.mo-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.mo-form[hidden] { display: none; }

.mo-form input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: inherit;
  font-size: 13px;
}

.mo-form input[type="text"]:focus { outline: none; border-color: var(--c-primary); }

.mo-form button {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: var(--c-primary);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.mo-form-reply { font-size: 12px; color: var(--c-text-3); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-form-reply[hidden] { display: none; }

/* ---------- 空态 / 加载更多 ---------- */
.mo-empty {
  padding: 40px 16px;
  text-align: center;
  background: var(--c-surface);
  border-radius: 10px;
  border: 1px dashed var(--c-border);
  color: var(--c-text-3);
}

.mo-empty p { margin: 0; }
.mo-empty .hint { margin-top: 6px; font-size: 12px; }

.mo-more-wrap { display: flex; justify-content: center; padding: 14px 0 4px; }

.mo-login-tip {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--c-text-3);
}

/* ---------- 悬浮发布按钮 ---------- */
.mo-fab {
  position: fixed;
  right: max(18px, calc((100vw - var(--max-w)) / 2 + 18px));
  bottom: 26px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  cursor: pointer;
  z-index: 40;
}

.mo-fab:hover { color: var(--c-primary); border-color: var(--c-primary); }

/* ---------- 发布面板 ---------- */
.mo-sheet {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
}

.mo-sheet.open { display: block; }

.mo-sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
}

.mo-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--c-surface);
  border-radius: 14px 14px 0 0;
  box-shadow: var(--shadow-pop);
  padding-bottom: env(safe-area-inset-bottom);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: mo-slide-up .18s ease;
}

@keyframes mo-slide-up {
  from { transform: translateY(18px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}

.mo-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
}

.mo-sheet-cancel {
  border: 0;
  background: none;
  color: var(--c-text-2);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.mo-sheet-pub {
  border: 0;
  border-radius: 999px;
  padding: 5px 16px;
  background: var(--c-primary);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.mo-sheet-pub:disabled { opacity: .55; cursor: default; }

.mo-sheet-body { padding: 12px 14px 18px; overflow: auto; }

.mo-sheet-body textarea {
  width: 100%;
  min-height: 96px;
  border: 0;
  background: transparent;
  color: var(--c-text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
}

.mo-sheet-body textarea:focus { outline: none; }

.mo-picked {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 0;
}

.mo-picked:empty { display: none; }

.mo-pick {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
}

.mo-pick img, .mo-pick video { width: 100%; height: 100%; object-fit: cover; display: block; }

.mo-pick-x {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.mo-pick-busy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 12px;
}

.mo-pick-tag {
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 0 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 11px;
}

.mo-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--c-border);
}

.mo-tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--c-text-2);
  cursor: pointer;
  user-select: none;
}

.mo-tool:hover { border-color: var(--c-primary); color: var(--c-primary); }

.mo-loc-input {
  flex: 1;
  min-width: 110px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: inherit;
  font-size: 12.5px;
}

.mo-loc-input:focus { outline: none; border-color: var(--c-primary); }

.mo-vis-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: inherit;
  font-size: 12.5px;
}

.mo-tip {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--c-text-3);
}

/* ---------- 好友列表 ---------- */
.friend-list { list-style: none; margin: 0; padding: 0; }

.friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}

.friend-row:last-child { border-bottom: 0; }

.friend-main { flex: 1; min-width: 0; }

.friend-name { font-weight: 600; color: var(--c-text); }

.friend-sign {
  margin-top: 2px;
  font-size: 12px;
  color: var(--c-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-actions { flex: none; display: flex; gap: 6px; }

/* ---------- 移动端 ---------- */
@media (max-width: 600px) {
  .mo-page { padding: 0 8px 84px; }
  .mo-cover-inner { padding: 38px 14px 12px; min-height: 140px; }
  .mo-cover-text h1 { font-size: 18px; }
  .mo-item { padding: 12px 10px; }
  .mo-fab { right: 14px; bottom: 18px; width: 48px; height: 48px; }
  .mo-sheet-panel { border-radius: 14px; margin: 8px; bottom: 8px; max-height: 86vh; }
}
