/* ============ 人物朋友圈 · 微信版式 ============ */
:root {
  --wx-bg: #FFFFFF;
  --wx-text: #191919;
  --wx-blue: #576B95;        /* 微信人名蓝 */
  --wx-grey: #B2B2B2;        /* 时间 */
  --wx-sub: #888888;         /* 签名、出处 */
  --wx-box: #F7F7F7;         /* 点赞评论框 */
  --wx-line: #EDEDED;
  --wx-pop: #4C4C4C;
  --wx-w: 560px;
  --f-wx: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

.wx-page {
  display: grid;
  grid-template-columns: var(--w-rail) var(--wx-w);
  gap: 56px;
  justify-content: center;
  padding: 28px 20px 100px;
}

/* 左侧：行迹地图 + 年份，沿用 v1 的样式类 */
.wx-page .mo-rail { top: calc(var(--topbar-h) + 28px); }

/* 朋友圈本体：一块白色的「屏幕」 */
.wx {
  background: var(--wx-bg);
  color: var(--wx-text);
  font: 400 16px/1.55 var(--f-wx);
  box-shadow: 0 1px 2px rgba(43, 38, 32, .08), 0 14px 40px rgba(43, 38, 32, .12);
  border-radius: 10px;
  overflow: clip;
  min-height: 100vh;
}

/* 顶栏：盖在封面上时透明，翻过封面变实底 */
.wx-nav {
  position: sticky; top: var(--topbar-h); z-index: 30;
  height: 48px; margin-bottom: -48px;
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  color: #fff; transition: background .2s, color .2s;
}
.wx-nav a { display: grid; place-items: center; height: 48px; }
.wx-nav svg { width: 22px; height: 22px; }
.wx-nav-title { text-align: center; font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; }
.wx-nav.solid { background: #EDEDED; color: var(--wx-text); }
.wx-nav.solid .wx-nav-title { opacity: 1; }

/* 封面 + 名字 + 头像 */
.wx-cover { position: relative; aspect-ratio: 560 / 400; background: linear-gradient(180deg, #C9BFA9, #A89B83); }
.wx-cover > img { width: 100%; height: 100%; object-fit: cover; }
.wx-me-name { white-space: nowrap; }
.wx-me {
  position: absolute; right: 16px; bottom: -26px;
  display: flex; align-items: flex-end; gap: 16px;
}
.wx-me-name {
  margin: 0 0 34px; color: #fff;
  font: 600 20px/1.2 var(--f-wx);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.wx-me-ava { width: 74px; height: 74px; border-radius: 8px; object-fit: cover; background: #eee; }
.wx-sign {
  padding: 36px 16px 22px; text-align: right;
  font-size: 13px; color: var(--wx-sub); line-height: 1.5;
}
.wx-sign span { display: block; color: var(--wx-grey); font-size: 12px; margin-top: 2px; }

/* 年份分隔（像微信个人相册里的年份） */
.wx-year {
  padding: 26px 16px 6px;
  display: flex; align-items: baseline; gap: 10px;
  border-top: 8px solid #F2F2F2;
}
.wx-year b { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.wx-year span { font-size: 13px; color: var(--wx-sub); }

/* 一条动态 */
.wx-post {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 0 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--wx-line);
}
.wx-year + .wx-post { padding-top: 12px; }
.wx-ava { width: 42px; height: 42px; border-radius: 4px; object-fit: cover; background: #eee; }
.wx-ava-txt { display: grid; place-items: center; font: 20px/1 var(--f-kai); color: #8C6A44; background: #F1ECE2; }
.wx-name { color: var(--wx-blue); font-weight: 600; font-size: 16px; line-height: 1.3; }
.wx-text { margin: 4px 0 0; white-space: pre-line; word-break: break-word; }

/* 配图：一张 / 两三张一排 / 四张田字 / 九宫格 */
.wx-imgs { margin-top: 8px; display: grid; gap: 4px; }
.wx-imgs button { display: block; padding: 0; overflow: hidden; background: #f0f0f0; }
.wx-imgs img { width: 100%; height: 100%; object-fit: cover; }
.wx-imgs.one { width: min(300px, 75%); }
.wx-imgs.one button { aspect-ratio: 4 / 3; }
.wx-imgs.one.tall { width: min(200px, 55%); }
.wx-imgs.one.tall button { aspect-ratio: 3 / 4; }
.wx-imgs.multi { grid-template-columns: repeat(3, 1fr); width: min(330px, 100%); }
.wx-imgs.multi button { aspect-ratio: 1; }
.wx-imgs.four { grid-template-columns: repeat(2, 1fr); width: min(218px, 66%); }
.wx-imgs.four button { aspect-ratio: 1; }

/* 诗：像微信里分享出来的链接卡片 */
.wx-card {
  margin-top: 8px; display: flex; gap: 10px; align-items: center;
  padding: 7px; background: var(--wx-box); width: min(360px, 100%);
}
.wx-card-thumb {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  background: #F4EEE2; border: 1px solid rgba(163, 54, 31, .25);
  font: 900 18px/1 var(--f-title); color: var(--zhu); writing-mode: vertical-rl;
}
.wx-card-t { font-size: 14px; line-height: 1.45; color: var(--wx-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wx-card-d { font-size: 12px; color: var(--wx-sub); margin-top: 2px; }
.wx-card:hover { background: #EFEFEF; }

.wx-quote { margin: 6px 0 0; font-size: 14px; color: var(--wx-sub); }

.wx-loc { margin-top: 8px; font-size: 13px; color: var(--wx-blue); line-height: 1.4; display: block; width: max-content; max-width: 100%; }
a.wx-loc:hover { text-decoration: underline; }

.wx-foot {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px; font-size: 13px; color: var(--wx-grey); line-height: 20px;
}
.wx-more {
  width: 32px; height: 20px; border-radius: 4px; background: var(--wx-box);
  display: grid; place-items: center; color: var(--wx-blue);
}
.wx-more svg { width: 18px; height: 6px; }
.wx-more:hover { background: #EBEBEB; }
.wx-pop {
  position: absolute; right: 40px; top: 50%; transform: translateY(-50%); z-index: 5;
  display: flex; background: var(--wx-pop); border-radius: 4px; overflow: hidden;
  animation: wx-pop .15s ease-out;
}
@keyframes wx-pop { from { opacity: 0; transform: translate(8px, -50%); } }
.wx-pop[hidden] { display: none; }
.wx-pop button { color: #fff; padding: 0 18px; height: 38px; font-size: 14px; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.wx-pop button + button { border-left: 1px solid rgba(0, 0, 0, .25); }
.wx-pop button:hover { background: rgba(255, 255, 255, .06); }
.wx-pop svg { width: 16px; height: 16px; }

/* 点赞评论框 */
.wx-react {
  position: relative; margin-top: 8px;
  background: var(--wx-box); border-radius: 3px;
  font-size: 14px; line-height: 1.6;
}
.wx-react::before {
  content: ""; position: absolute; left: 12px; top: -6px;
  border: 6px solid transparent; border-top: 0; border-bottom-color: var(--wx-box);
}
.wx-likes { padding: 6px 10px; color: var(--wx-blue); font-weight: 500; }
.wx-likes svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.wx-likes a:hover, .wx-cmt a:hover { background: #E2E2E2; }
.wx-cmts { padding: 5px 10px 6px; }
.wx-likes + .wx-cmts { border-top: 1px solid #E8E8E8; }
.wx-cmt { margin: 1px 0; }
.wx-cmt a { color: var(--wx-blue); font-weight: 500; }
.wx-cmt .src { color: var(--wx-sub); font-size: 12px; margin-left: 2px; }
.wx-cmt.note { color: #5A5146; }
.wx-cmt.note b { color: var(--zhu); font-weight: 600; }

.wx-end { padding: 26px 16px 40px; text-align: center; font-size: 12.5px; color: var(--wx-grey); line-height: 1.8; }
.wx-end::before { content: ""; display: block; width: 6px; height: 6px; margin: 0 auto 14px; border-radius: 50%; background: #D8D8D8; }

/* —— 窄屏：朋友圈占满，站点顶栏让位给微信顶栏 —— */
@media (max-width: 900px) {
  .wx-page { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .wx-page .mo-rail { display: none; }
  .wx { border-radius: 0; box-shadow: none; }
  body.is-wx .topbar { display: none; }
  .wx-nav { top: 0; }
}
@media (max-width: 420px) {
  .wx-cover { aspect-ratio: 375 / 300; }
  .wx-me-ava { width: 66px; height: 66px; }
}

/* 看看别人的朋友圈 */
.wx-others { margin-top: 26px; }
.wx-others p { margin: 0 0 10px; font-size: var(--fs-sm); color: var(--ink-3); }
.wx-others div { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.wx-others a { display: grid; justify-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); }
.wx-others img, .wx-others .wx-ava-txt { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.wx-others a:hover { color: var(--qing); }
.wx-others a[aria-current] img { outline: 2px solid var(--qing); outline-offset: 2px; }
.wx-others-end { display: none; padding: 20px 16px 0; border-top: 8px solid #F2F2F2; }
.wx-others-end p { color: var(--wx-sub); }
.wx-others-end a { color: var(--wx-text); }
@media (max-width: 900px) { .wx-others-end { display: block; } }
