/* moments.css — 拼贴（.mo-*）：大标题、发布框（自动增高/缩略图/「同时放进朋友的今天」/高亮）、帖子卡片、拍立得照片排法（加载占位）、
   发布中（半显影 + 进度条）、喜欢与评论、显影/揉皱、新帖胶囊、加载更多、评论弹窗 */

/* ---------- 骨架 ---------- */
.mo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 8px;
}
.mo-sub { font-size: 13px; color: var(--muted); white-space: nowrap; }
.mo-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 14px 28px;
}
.mo-list { display: flex; flex-direction: column; gap: 14px; }
.mo-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.mo-end::before, .mo-end::after { content: ''; width: 28px; height: 1px; background: var(--line); }
.mo-end[hidden] { display: none; }

/* 列表底部：加载更早的 / 重试 */
.mo-foot { display: flex; flex-direction: column; align-items: center; min-height: 44px; justify-content: center; }
.mo-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 4px;
  font-size: 12px;
  color: var(--muted);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.mo-loading.is-on { opacity: 1; }
.mo-loading[hidden], .mo-retry[hidden] { display: none; }
.mo-spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--ink-2);
  animation: mo-spin .8s linear infinite;
}
@keyframes mo-spin { to { transform: rotate(360deg); } }
.mo-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--ink-2);
  transition: background-color var(--dur-2), transform var(--dur-1) var(--ease-out);
}
@media (hover: hover) { .mo-retry:hover { background: var(--surface-2); } }
.mo-retry:active { transform: scale(.97); }

/* 一条拼贴都没有时的引导卡 */
.mo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 16px 24px;
  border: 1.5px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
  transition: background-color var(--dur-2), border-color var(--dur-2), transform var(--dur-1) var(--ease-out);
}
.mo-empty[hidden] { display: none; }
@media (hover: hover) { .mo-empty:hover { background: var(--surface); border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); } }
.mo-empty:active { transform: scale(.98); }
.mo-empty-ic { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 6px; border-radius: 16px; background: var(--surface-2); color: var(--ink-2); }
.mo-empty-t { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink); }
.mo-empty-s { font-size: 13px; }

/* ---------- 发布框 ---------- */
.mo-compose {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.mo-compose:focus-within { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); box-shadow: var(--shadow-1); }
.mo-glow {
  position: absolute;
  inset: -3px;
  border-radius: 25px;
  padding: 2px;
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.mo-flash { position: absolute; inset: 0; border-radius: inherit; background: #FFFFFF; opacity: 0; pointer-events: none; }
.mo-compose-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  cursor: text;
}
.mo-ta {
  display: block;
  width: 100%;
  min-height: 51px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  overflow: hidden;
  outline: none;
  transition: height var(--dur-1) var(--ease-out);
}
.mo-ta:focus-visible { outline: none; }
.mo-ta.mo-ta-measure {
  position: absolute;
  left: 16px;
  top: 0;
  height: 0 !important;
  min-height: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

/* 缩略图：行高 0fr → 1fr 展开 */
.mo-thumbs-wrap {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: -10px;
  transition: grid-template-rows var(--dur-3) var(--ease-out), margin-top var(--dur-3) var(--ease-out);
}
.mo-thumbs-wrap.is-open { grid-template-rows: 1fr; margin-top: 0; }
.mo-thumbs-clip { min-height: 0; overflow: hidden; }
.mo-thumbs { display: flex; flex-wrap: wrap; gap: 12px 10px; padding: 9px 9px 4px 0; }
.mo-thumb { position: relative; flex: none; width: 64px; height: 64px; }
.mo-thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
  -webkit-user-drag: none;
}
.mo-thumb.is-loading img { opacity: 0; }
.mo-thumb.is-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: mo-shimmer 1.1s linear infinite;
}
@keyframes mo-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.mo-thumb-x {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  transition: transform var(--dur-1) var(--ease-out);
}
.mo-thumb-x::after { content: ''; position: absolute; inset: -9px; }
.mo-thumb-x:active { transform: scale(.88); }

/* 「同时放进朋友的今天」：有照片时才展开 */
.mo-also-wrap {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: -10px;
  opacity: 0;
  transition: grid-template-rows var(--dur-3) var(--ease-out), margin-top var(--dur-3) var(--ease-out), opacity var(--dur-2) var(--ease-out);
}
.mo-also-wrap.is-open { grid-template-rows: 1fr; margin-top: 0; opacity: 1; }
.mo-also-clip { min-height: 0; overflow: hidden; }
.mo-also {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 6px 2px 4px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mo-also-card {
  position: relative;
  flex: none;
  width: 18px;
  height: 24px;
  border-radius: 5px;
  background: var(--c-soft);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--c-deep);
  transition: box-shadow var(--dur-3) var(--ease-out), opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-spring);
}
.mo-also-card::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 4px; height: 2px; border-radius: 1px; background: var(--c-deep); opacity: .55; }
.mo-also.is-off .mo-also-card { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--line); opacity: .55; transform: scale(.92); }
.mo-also-t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; line-height: 1.35; color: var(--ink); }
.mo-also-s { font-size: 12px; color: var(--muted); }
.mo-also .ui-switch { margin-right: 2px; }

.mo-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line-2);
}
.mo-tools-l { display: flex; align-items: center; gap: 2px; min-width: 0; margin-left: -4px; }
.mo-tools-r { display: flex; align-items: center; gap: 10px; flex: none; }
.mo-tool {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 4px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
  transition: background-color var(--dur-2), transform var(--dur-1) var(--ease-out), opacity var(--dur-2);
}
@media (hover: hover) { .mo-tool:hover { background: var(--surface-2); } }
.mo-tool:active { transform: scale(.96); }
.mo-tool[aria-disabled="true"] { opacity: .42; }
.mo-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mo-count:empty { display: none; }
.mo-publish {
  height: 40px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--dur-3) var(--ease-out), color var(--dur-3) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.mo-publish { position: relative; }
.mo-publish::after { content: ''; position: absolute; inset: -2px; }
.mo-publish:active:not([aria-disabled="true"]) { transform: scale(.96); }
.mo-publish[aria-disabled="true"] { background: var(--placeholder); color: var(--bg); cursor: default; }

/* ---------- 帖子 ---------- */
.mo-post {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 8px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.mo-post.mo-pending { opacity: 0; transform: translateY(24px); }
/* 发布中：时间位置显示「冲洗中 42%」，操作暂不可用 */
.mo-post.is-pending .mo-time { color: var(--c-deep); font-variant-numeric: tabular-nums; }
.mo-post .mo-act[aria-disabled="true"] { opacity: .38; pointer-events: none; }
.mo-up {
  position: relative;
  height: 3px;
  margin: 0 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--c-deep) 16%, transparent);
  overflow: hidden;
}
.mo-up-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--c-deep);
  transform-origin: left center;
  transition: transform 260ms var(--ease-out);
}
.mo-up-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  background-size: 60% 100%;
  background-repeat: no-repeat;
  animation: mo-up-shine 1.2s linear infinite;
}
@keyframes mo-up-shine { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.mo-post.is-failed { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.mo-post-head { display: flex; align-items: center; gap: 10px; }
.mo-post-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mo-name { font-size: 15px; font-weight: 700; line-height: 1.35; }
.mo-time { font-size: 12px; line-height: 1.4; color: var(--muted); }
.mo-more { margin: -8px -10px -8px 0; color: var(--muted); }
.mo-text { font-size: 16px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }

.mo-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 4px 4px 6px;
}
.mo-ph {
  position: relative;
  width: 100%;
  text-align: left;
  -webkit-touch-callout: none;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.mo-ph > img { pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; transition: opacity 320ms var(--ease-out); }
/* 照片还没下载下来：纸色底 + 流光占位，下好后淡入 */
.mo-ph.is-loading > img { opacity: 0; }
.mo-ph::before {
  content: '';
  position: absolute;
  inset: 6px;
  background: linear-gradient(100deg, var(--surface-2) 30%, color-mix(in srgb, var(--surface-2) 45%, var(--paper)) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  opacity: 0;
  transition: opacity 320ms var(--ease-out);
  pointer-events: none;
}
.mo-ph.is-loading::before { opacity: 1; animation: mo-shimmer 1.2s linear infinite; }
@media (hover: hover) and (pointer: fine) {
  .mo-ph:hover { transform: rotate(var(--rot, 0deg)) translateY(-2px) scale(1.012); box-shadow: 0 12px 26px rgba(31, 29, 26, .17); }
}
.mo-ph:active { transform: rotate(var(--rot, 0deg)) scale(.985); }
.mo-dev { position: absolute; inset: 6px; background: #FBF8F1; opacity: 0; pointer-events: none; }

.mo-actions { display: flex; gap: 4px; margin-left: -4px; }
.mo-act {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 4px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 13px;
  transition: background-color var(--dur-2), transform var(--dur-1) var(--ease-out);
}
.mo-act.mo-cmt { padding: 0 10px; }
@media (hover: hover) { .mo-act:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); } }
.mo-act:active { transform: scale(.96); }
.mo-n { display: inline-block; min-width: 1ch; font-variant-numeric: tabular-nums; }
.mo-heart { position: relative; flex: none; display: inline-block; width: 20px; height: 20px; }
.mo-heart > svg { position: absolute; inset: 0; transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-spring); }
.mo-heart > .mo-h-on { color: var(--c-deep); opacity: 0; transform: scale(.4); }
.mo-like[aria-pressed="true"] .mo-h-on { opacity: 1; transform: none; }
.mo-like[aria-pressed="true"] .mo-h-off { opacity: 0; transform: scale(1.2); }
.mo-heart::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid var(--c-deep);
  opacity: 0;
  pointer-events: none;
}

/* 揉皱：折痕纹理 */
.mo-crease {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 31%, rgba(0, 0, 0, .09) 32%, rgba(255, 255, 255, .35) 33.5%, transparent 35%),
    linear-gradient(64deg, transparent 46%, rgba(255, 255, 255, .4) 47%, rgba(0, 0, 0, .08) 48.5%, transparent 50%),
    linear-gradient(158deg, transparent 57%, rgba(0, 0, 0, .1) 58%, transparent 60%),
    linear-gradient(22deg, transparent 19%, rgba(0, 0, 0, .07) 20%, transparent 22%),
    linear-gradient(96deg, transparent 70%, rgba(0, 0, 0, .08) 71%, transparent 73%),
    radial-gradient(circle at 42% 46%, rgba(0, 0, 0, .1), transparent 62%);
}

/* ---------- 新帖胶囊「N 条新的今天」：列表顶部不在视野时浮在紧凑栏下方（top 由 JS 写） ---------- */
.mo-hint-wrap {
  position: absolute;
  left: 0;
  right: 0;
  top: 58px;
  z-index: 7;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.mo-hint {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-2);
  font-size: 14px;
  font-weight: 500;
  transition: transform var(--dur-1) var(--ease-out);
}
.mo-hint[hidden] { display: none; }
.mo-hint:active { transform: scale(.96); }
.mo-hint .ui-ico { opacity: .7; }
.mo-hint-chars { display: inline-flex; align-items: center; }
.mo-hint-chars:empty { display: none; }
.mo-hint-char {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--c-soft);
  box-shadow: 0 0 0 2px var(--ink);
}
.mo-hint-char + .mo-hint-char { margin-left: -8px; }
.mo-hint-char .ui-char { --size: 19px; color: var(--c-deep); line-height: 1; }

/* ---------- 评论弹窗 ---------- */
.mo-cm-sheet .ui-sheet-body { padding: 2px 18px 18px; }
.mo-cm-list { display: flex; flex-direction: column; gap: 16px; padding-top: 6px; }
.mo-cm { display: flex; align-items: flex-start; gap: 12px; }
.mo-cm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.mo-cm-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mo-cm-name { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.mo-cm-tag {
  align-self: center;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--c-soft);
  color: var(--c-ink);
  font-size: 11px;
  line-height: 1.4;
}
.mo-cm-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mo-cm-text { font-size: 15px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.mo-cm { -webkit-touch-callout: none; outline: none; transition: opacity var(--dur-2) var(--ease-out); }
.mo-cm.is-pending { opacity: .6; }
.mo-cm.ui-pressing { transform: none; }
.mo-cm.ui-pressing .mo-cm-main { opacity: .7; }
.mo-cm-empty { padding: 28px 0 12px; text-align: center; font-size: 14px; color: var(--muted); }
.mo-cm-form { display: flex; align-items: center; gap: 8px; }
.mo-cm-input { flex: 1; min-width: 0; }
.mo-cm-send { flex: none; width: 44px; padding: 0; }
.mo-cm-send[aria-disabled="true"] { opacity: .38; }

/* 拼贴视频 */
.mo-vid { display: block; padding: 6px; }
.mo-vid > video { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: cover; background: #1F1E1D; border-radius: 2px; }
.mo-thumb.is-video .mo-thumb-v { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 8px; background: rgba(31, 30, 29, .72); color: #fff; font-size: 10.5px; pointer-events: none; }
