:root {
  --wechat-blue: #576b95;
  --page: #ededed;
  --surface: #fff;
  --text: #1f1f1f;
  --muted: #777;
  --line: #e5e5e5;
  --bubble: #f4f4f4;
}

.single-body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.tool-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.back-link {
  color: #194f45;
  font-weight: 800;
  text-decoration: none;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.save-status {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.primary-btn,
.secondary-btn {
  min-height: 34px;
  border-radius: 6px;
  padding: 7px 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  border: 0;
  background: #07c160;
  color: #fff;
}

.secondary-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.phone-shell {
  width: min(430px, 100%);
  min-height: calc(100vh - 55px);
  margin: 0 auto;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.status-bar {
  display: flex;
  justify-content: space-between;
  padding: 7px 14px 5px;
  background: rgba(245, 245, 245, .94);
  color: #111;
  font-size: .76rem;
  font-weight: 800;
}

.profile-strip {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 8px;
  background: #d9e3f0;
  background-size: cover;
  background-position: center;
  color: var(--wechat-blue);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 900;
  cursor: pointer;
}

.avatar.has-image span {
  display: none;
}

.profile-name {
  width: fit-content;
  min-width: 120px;
  color: var(--wechat-blue);
  font-size: 1.05rem;
  font-weight: 800;
}

.profile-strip p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.moment-card {
  padding: 16px 14px 20px;
}

[contenteditable="true"]:focus {
  outline: 2px solid #07c160;
  outline-offset: 2px;
  border-radius: 4px;
}

.post-text {
  min-height: 110px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  width: min(254px, 100%);
  margin: 12px 0;
}

.photo-grid.count-1 {
  grid-template-columns: minmax(0, 170px);
}

.photo-grid.count-2,
.photo-grid.count-4 {
  grid-template-columns: repeat(2, minmax(0, 80px));
}

.photo-slot {
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  background: #e9e9e9;
  cursor: pointer;
}

.photo-slot.empty {
  border: 1px dashed #b8b8b8;
  color: var(--muted);
  font-weight: 800;
}

.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: .82rem;
}

.interaction {
  position: relative;
  margin-top: 12px;
  padding: 8px 9px;
  border-radius: 3px;
  background: var(--bubble);
  font-size: .9rem;
}

.interaction::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 18px;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--bubble);
  border-left: 6px solid transparent;
}

.likes {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--wechat-blue);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.comments {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.comment {
  display: grid;
  grid-template-columns: minmax(64px, auto) 1fr;
  gap: 4px;
  margin-top: 4px;
}

.comment-user {
  color: var(--wechat-blue);
  font-weight: 800;
}

.comment-empty {
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #191919;
  color: #fff;
  font-size: .86rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript-note {
  max-width: 430px;
  margin: 16px auto;
  color: #b42318;
  font-weight: 800;
}

@media (max-width: 680px) {
  .tool-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-actions {
    justify-content: flex-start;
  }

  .phone-shell {
    min-height: calc(100vh - 112px);
    box-shadow: none;
  }
}
