/* ============================================================
   微语 — 前台时间线样式（独立页面，插件自有 CSS）
   风格基准：dist/preview-moments-front.html（用户已确认）
   ============================================================ */

:root {
  --mm-ink: #2B313B;
  --mm-hint: #9AA1AC;
  --mm-faint: #B7BDC7;
  --mm-line: #EFF1F4;
  --mm-accent: #3B82F6;
  --mm-like: #F04438;
}

/* —— 独立页面基础（不继承主题，自带字体/底色） —— */
body {
  margin: 0;
  background: #F3F5F8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--mm-ink);
  -webkit-font-smoothing: antialiased;
}

.mm-wrap { max-width: 640px; margin: 0 auto; padding: 34px 16px 60px; }
.mm-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(31,41,55,.08);
  overflow: hidden;
}
.mm-wrap .mm-text { margin: 5px 0 0; font-size: 15px; line-height: 1.7; color: var(--mm-ink); word-break: break-word; }
.mm-wrap a { text-decoration: none; }

/* —— 页头头图 —— */
.mm-cover { position: relative; height: 180px; background-color: #C9D4E3; background-size: cover; background-position: center; }
.mm-cover.no-img { background: linear-gradient(135deg, #6C8CB8 0%, #46628A 100%); }
.mm-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,28,40,.05) 0%, rgba(20,28,40,.55) 100%); }
.mm-cover-inner { position: absolute; left: 26px; right: 118px; bottom: 16px; z-index: 1; color: #fff; }
.mm-cover-inner h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: .5px; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.mm-cover-inner p { margin: 4px 0 0; font-size: 13px; opacity: .88; text-shadow: 0 1px 4px rgba(0,0,0,.35); }
.mm-cover-name { position: absolute; right: 118px; bottom: 24px; z-index: 1; color: #fff; font-size: 15px; font-weight: 500; text-shadow: 0 1px 5px rgba(0,0,0,.45); }
.mm-cover-ava {
  position: absolute; right: 26px; bottom: -26px; z-index: 2;
  width: 76px; height: 76px; border-radius: 12px;
  border: 3px solid #fff; background-color: #DCE3EC;
  background-size: cover; background-position: center;
  box-shadow: 0 6px 18px rgba(15,23,42,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #7A8494;
}
.mm-cover-ava.has-img { text-indent: -9999px; }

/* —— 发布器（登录管理员可见） —— */
.mm-composer { margin: 44px 26px 4px; border: 1px solid var(--mm-line); border-radius: 12px; padding: 12px 14px 10px; background: #FAFBFC; transition: border-color .15s; }
.mm-composer:focus-within { border-color: #C9D8F7; background: #fff; }
.mm-composer textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: transparent;
  font: inherit; font-size: 14.5px; line-height: 1.65; color: var(--mm-ink); min-height: 58px;
  min-width: 0;
}
.mm-composer textarea::placeholder { color: var(--mm-faint); }
.mm-composer-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.mm-hint { font-size: 12px; color: var(--mm-faint); }
.mm-composer-right { display: flex; align-items: center; gap: 10px; }
.mm-count { font-size: 12px; color: var(--mm-faint); }
.mm-count.over { color: var(--mm-like); }
.mm-btn-img { border: 1px dashed #D8DDE4; background: #fff; color: var(--mm-hint); font-size: 12.5px; border-radius: 7px; padding: 3px 10px; cursor: pointer; }
.mm-btn-img:hover { border-color: var(--mm-accent); color: var(--mm-accent); }
.mm-btn-loc { border: 1px dashed #D8DDE4; background: #fff; color: var(--mm-hint); font-size: 12.5px; border-radius: 7px; padding: 3px 10px; cursor: pointer; }
.mm-btn-loc:hover { border-color: var(--mm-accent); color: var(--mm-accent); }
.mm-btn-loc.has-loc { border-style: solid; border-color: var(--mm-accent); color: var(--mm-accent); background: #EFF6FF; }
.mm-loc-row { margin-top: 8px; position: relative; }
.mm-loc-row input { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; color: var(--mm-ink); border: 1px solid var(--mm-line); border-radius: 8px; padding: 7px 10px; background: #fff; }
.mm-loc-row input:focus { outline: none; border-color: var(--mm-accent); }
.mm-loc-row input::placeholder { color: var(--mm-faint); }
.mm-loc-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff; border: 1px solid var(--mm-line); border-radius: 8px; box-shadow: 0 8px 24px rgba(20,30,50,.12); overflow: hidden; max-height: 240px; overflow-y: auto; }
.mm-loc-suggest .mm-loc-opt { padding: 8px 12px; font-size: 13px; color: var(--mm-ink); cursor: pointer; line-height: 1.4; }
.mm-loc-suggest .mm-loc-opt:hover { background: #F4F7FB; }
.mm-loc-suggest .mm-loc-opt span { color: var(--mm-hint); font-size: 12px; margin-left: 6px; }
.mm-loc-suggest .mm-loc-empty { padding: 9px 12px; font-size: 12.5px; color: var(--mm-faint); }
/* 联想服务不可用（Key / 安全密钥 / 域名白名单 / 配额）时的可见提示，避免静默无下拉 */
.mm-loc-suggest .mm-loc-fail { padding: 9px 12px; font-size: 12.5px; line-height: 1.55; color: var(--mm-faint); }
.mm-btn-send { border: 0; cursor: pointer; font: inherit; font-size: 13px; color: #fff; background: var(--mm-accent); padding: 6px 18px; border-radius: 8px; }
.mm-btn-send:hover { opacity: .88; }
.mm-btn-send:disabled { opacity: .5; cursor: not-allowed; }
.mm-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mm-thumbs .th { position: relative; width: 48px; height: 48px; border-radius: 8px; background-size: cover; background-position: center; background-color: #EDF0F4; }
.mm-thumbs .th i { position: absolute; right: -6px; top: -6px; width: 16px; height: 16px; border-radius: 50%; background: #4B5563; color: #fff; font-size: 11px; line-height: 16px; text-align: center; font-style: normal; cursor: pointer; }
.mm-composer.is-drop { border-color: var(--mm-accent); border-style: dashed; }

/* —— 时间线列表 —— */
/* —— 封面与列表之间的波浪水纹（缓慢横向漂移，纯 CSS，无 JS）—— */
.mm-wave { position: relative; z-index: 0; height: 56px; margin-top: -38px; line-height: 0; pointer-events: none; }
.mm-wave svg { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; display: block; }
.mm-wave .w1 { animation: mmWave 20s linear infinite; }
.mm-wave .w2 { bottom: -4px; opacity: .85; animation: mmWave 27s linear infinite; }
.mm-wave .w3 { bottom: -9px; opacity: .7; animation: mmWave 34s linear infinite; }
.mm-wave .w4 { bottom: -14px; opacity: .55; animation: mmWave 44s linear infinite; }
@keyframes mmWave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .mm-wave .w1, .mm-wave .w2 { animation: none; } }

.mm-list { margin-top: 22px; }
.mm-item { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding: 18px 26px; }
.mm-item + .mm-item { border-top: 1px solid var(--mm-line); }
.mm-ava {
  width: 40px; height: 40px; border-radius: 10px; background-color: #DCE3EC;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #7A8494; user-select: none;
}
.mm-ava.has-img { text-indent: -9999px; }
.mm-body { min-width: 0; }
.mm-name { font-size: 14px; font-weight: 400; color: var(--mm-ink); }
.mm-badge-private { font-size: 11px; color: #8B93A1; background: #F0F2F5; border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.mm-text .mm-tag { color: var(--mm-accent); }
.mm-text .mm-tag:hover { text-decoration: underline; }

.mm-gallery { margin-top: 10px; display: grid; gap: 8px; }
.mm-gallery.g1 { grid-template-columns: 1fr; }
.mm-gallery.g2 { grid-template-columns: 1fr 1fr; }
.mm-gallery.g3 { grid-template-columns: 1fr 1fr 1fr; }
.mm-ph { width: 100%; background-size: cover; background-position: center; border-radius: 10px; background-color: #E8ECF1; display: block; cursor: zoom-in; }
.g1 .mm-ph { height: 200px; max-width: 320px; }   /* 单图兜底（非 img 情形）：固定中等尺寸 */
.g2 .mm-ph { height: 190px; }
.g3 .mm-ph { height: 128px; }

/* 单图走真 <img>：按原比例完整显示——不 cover 裁切、不放大超原尺寸（点灯箱看原图）。
   ⛔ 选择器必须带 img. 抬高特异性：否则下方 560px 媒体查询的 .g1 .mm-ph{height:240px}
      与它同特异性且排在后面，会把 height:auto 盖掉 → 又变回裁切。 */
.mm-gallery.g1 img.mm-ph {
  width: auto; height: auto;
  max-width: 100%; max-height: 460px;
  justify-self: start;
}

.mm-meta { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.mm-loc { margin-top: 8px; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--mm-hint); }
.mm-loc svg { width: 14px; height: 14px; fill: var(--mm-hint); flex: none; }
.mm-loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-time { font-size: 13px; color: var(--mm-faint); }
.mm-acts { display: flex; align-items: center; gap: 18px; }
.mm-act {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; cursor: pointer; font: inherit;
  font-size: 13px; color: var(--mm-hint); padding: 2px; transition: color .15s;
}
.mm-act svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mm-act:hover { color: var(--mm-ink); }
.mm-act.is-liked { color: var(--mm-like); }
.mm-act.is-liked svg { fill: var(--mm-like); stroke: var(--mm-like); }
.mm-empty { padding: 40px 26px; text-align: center; font-size: 13.5px; color: var(--mm-faint); }

/* —— 评论区（默认收起，点气泡展开） —— */
.mm-comments { margin-top: 10px; border-top: 1px dashed var(--mm-line); padding-top: 10px; }
.mm-cm { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; padding: 5px 0; }
.mm-cm-ava {
  width: 28px; height: 28px; border-radius: 8px; background-color: #E4E9F0;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #7A8494;
}
.mm-cm-ava.has-img { text-indent: -9999px; }
.mm-cm-body { min-width: 0; }
.mm-cm-head { display: flex; align-items: center; gap: 8px; }
.mm-cm-name { font-size: 12.5px; color: var(--mm-ink); }
.mm-cm-time { font-size: 11.5px; color: var(--mm-faint); }
.mm-cm-del { margin-left: auto; border: 0; background: none; font-size: 11.5px; color: #6B7280; cursor: pointer; opacity: 0; transition: opacity .12s, color .12s; }
.mm-cm:hover .mm-cm-del, .mm-cm:focus-within .mm-cm-del { opacity: 1; }
.mm-cm-del:hover { color: var(--mm-ink); text-decoration: underline; }
@media (hover: none) { .mm-cm-del { opacity: 1; } }
.mm-cm-replies { margin-top: 6px; margin-left: 16px; padding-left: 12px; border-left: 2px solid var(--mm-line); }
.mm-cm-reply-to { color: var(--mm-hint); font-size: 12px; }
.mm-cm-reply { margin-top: 4px; border: 0; background: none; font-size: 12px; color: var(--mm-hint); cursor: pointer; padding: 0; opacity: 0; transition: opacity .12s, color .12s; }
.mm-cm:hover .mm-cm-reply, .mm-cm:focus-within .mm-cm-reply { opacity: 1; }
.mm-cm-reply:hover { color: var(--mm-ink); }
.mm-cm-reply-form { grid-column: 1 / -1; margin-top: 4px; margin-left: 36px; display: grid; gap: 6px; }
.mm-cm-reply-form textarea, .mm-cm-reply-form input { border: 1px solid var(--mm-line); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 12.5px; color: var(--mm-ink); background: #FAFBFC; outline: none; min-width: 0; }
.mm-cm-reply-form textarea { resize: vertical; min-height: 40px; }
.mm-cm-reply-form textarea:focus, .mm-cm-reply-form input:focus { border-color: #C9D8F7; background: #fff; }
.mm-cm-reply-cancel { border: 0; background: none; font-size: 12px; color: var(--mm-hint); cursor: pointer; padding: 0 6px; }
.mm-cm-reply-cancel:hover { color: var(--mm-ink); }
@media (hover: none) { .mm-cm-reply { opacity: 1; } }
.mm-cm-text { margin-top: 2px; font-size: 13px; line-height: 1.6; color: #4B5563; word-break: break-word; }
.mm-cm-form { margin-top: 8px; display: grid; gap: 6px; }
.mm-cm-who { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mm-cm-form input, .mm-cm-form textarea {
  border: 1px solid var(--mm-line); border-radius: 8px; padding: 6px 10px;
  font: inherit; font-size: 12.5px; color: var(--mm-ink); background: #FAFBFC; outline: none; min-width: 0;
}
.mm-cm-form input:focus, .mm-cm-form textarea:focus { border-color: #C9D8F7; background: #fff; }
.mm-cm-form textarea { resize: vertical; min-height: 44px; }
.mm-cm-form-bar { display: flex; align-items: center; justify-content: flex-end; }
.mm-cm-send { border: 0; cursor: pointer; font: inherit; font-size: 12px; color: #fff; background: var(--mm-accent); padding: 5px 14px; border-radius: 7px; }
.mm-cm-send:hover { opacity: .88; }
.mm-cm-send:disabled { opacity: .5; cursor: not-allowed; }

/* —— 加载更多 —— */
.mm-more { border-top: 1px solid var(--mm-line); padding: 16px; text-align: center; }

/* 页面底部版权（独立于白卡，居中悬于页面底） */
.mm-foot {
  padding: 22px 0 30px;
  text-align: center;
  font-size: 12.5px;
  color: var(--mm-faint);
  letter-spacing: .3px;
}
.mm-foot-link { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: color .15s, border-color .15s; }
.mm-foot-link:hover { color: var(--mm-accent); border-bottom-color: currentColor; }
.mm-more button {
  border: 1px solid var(--mm-line); background: #fff; cursor: pointer; font: inherit;
  font-size: 13px; color: var(--mm-hint); padding: 8px 26px; border-radius: 999px; transition: all .15s;
}
.mm-more button:hover { color: var(--mm-ink); border-color: #D8DDE4; }
.mm-more button:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 560px) {
  .mm-wrap { padding: 18px 10px 40px; }
  .mm-cover-inner { left: 18px; right: 110px; }
  .mm-cover-name { right: 110px; }
  .mm-cover-ava { right: 18px; width: 64px; height: 64px; bottom: -22px; }
  .mm-composer { margin: 36px 18px 4px; }
  .mm-item { padding: 16px 18px; }
  .g1 .mm-ph { height: 240px; }
  .g2 .mm-ph { height: 140px; }
  .g3 .mm-ph { height: 100px; }
}

/* —— 位置链接（v1.3.0，灰色不抢色） —— */
.mm-loc-link { color: var(--mm-hint); cursor: pointer; }
.mm-loc-link:hover { color: var(--mm-ink); text-decoration: underline; }

/* —— 图片放大灯箱：点击 .mm-ph 全屏看原图（结构由 moments.js 动态挂到 body） —— */
.mm-lb { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 44px 40px; background: rgba(15, 23, 42, .72); opacity: 0; pointer-events: none; transition: opacity .25s; }
.mm-lb.show { opacity: 1; pointer-events: auto; }
.mm-lb img { max-width: min(92vw, 900px); max-height: 84vh; border-radius: 10px; box-shadow: 0 30px 70px -24px rgba(0, 0, 0, .6); transform: scale(.96); opacity: 0; transition: transform .3s cubic-bezier(.2, .85, .25, 1), opacity .28s; }
.mm-lb.show img { transform: none; opacity: 1; }
.mm-lb-close { position: absolute; top: 22px; right: 22px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .32); font-size: 16px; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; }
.mm-lb-close:hover { background: rgba(255, 255, 255, .28); }
.mm-lb-hint { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; color: rgba(255, 255, 255, .6); font-size: 12.5px; }
