/**
 * 社区帖子卡片 · 参考图样式（封面 + 底栏元信息）
 */

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 100% !important;
  text-align: left !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .post-card-bg {
  width: 100% !important;
  height: auto !important;
  padding-bottom: 0 !important;
  min-height: 0 !important;
  position: relative !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-cover--landscape .post-card-bg,
.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .post-card-bg.snapshot-post-card-cover--landscape {
  aspect-ratio: 4 / 3 !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-cover--portrait .post-card-bg,
.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .post-card-bg.snapshot-post-card-cover--portrait {
  aspect-ratio: 3 / 4 !important;
}

/* 每周优质：封面统一横版 4:3 */
.snapshot-community-redesign #community .weekly-content .post-card .post-card-bg,
.snapshot-community-redesign #community .weekly-content .post-card.snapshot-post-card-cover--landscape .post-card-bg,
.snapshot-community-redesign #community .weekly-content .post-card.snapshot-post-card-cover--portrait .post-card-bg {
  aspect-ratio: 4 / 3 !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .post-card-bg img {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  border: none !important;
  border-radius: 12px !important;
  transform: none !important;
  transition: none !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .post-card-bg img:hover {
  transform: none !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .post-card-bg {
  cursor: pointer !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .snapshot-post-card-cover-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  border-radius: 12px !important;
  background: rgba(0, 0, 0, 0.55) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease, visibility 0.2s ease !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .post-card-bg:hover .snapshot-post-card-cover-overlay {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .snapshot-post-card-cover-intro {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  text-align: center !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 8 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  word-break: break-word !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .snapshot-post-card-cover-cta {
  margin: 0 !important;
  padding: 10px 22px !important;
  border: none !important;
  border-radius: 999px !important;
  background: #f0f0f0 !important;
  color: #111 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  flex-shrink: 0 !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .snapshot-post-card-title {
  cursor: pointer !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .snapshot-post-card-avatar {
  cursor: pointer !important;
}

.snapshot-community-redesign #community .post-card.snapshot-post-card-v2 .post-card-bg .mask {
  display: none !important;
}

.snapshot-community-redesign #community .snapshot-post-card-meta {
  padding: 8px 0 0 !important;
  background: transparent !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

.snapshot-community-redesign #community .snapshot-post-card-meta-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.snapshot-community-redesign #community .snapshot-post-card-meta-content {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 0 !important;
  box-sizing: border-box !important;
}

.snapshot-community-redesign #community .snapshot-post-card-meta-bottom {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  flex-shrink: 0 !important;
  margin-top: auto !important;
}

.snapshot-community-redesign #community .snapshot-post-card-avatar {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  object-fit: cover !important;
}

.snapshot-community-redesign #community .snapshot-post-card-meta-body {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.snapshot-community-redesign #community .snapshot-post-card-title {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  text-align: left !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 1 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  word-break: break-word !important;
}

.snapshot-community-redesign #community .snapshot-post-card-username {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.snapshot-community-redesign #community .snapshot-post-card-updated {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.snapshot-community-redesign #community .snapshot-post-card-stats {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  gap: 6px !important;
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

.snapshot-community-redesign #community .snapshot-post-card-stat {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.snapshot-community-redesign #community .snapshot-post-card-stat img {
  width: 14px !important;
  height: 14px !important;
  opacity: 0.7 !important;
}

.snapshot-community-redesign #community .snapshot-post-card-stat-num {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

/* ---------- 帖子列表：瀑布流（JS 最短列布局） ---------- */
.snapshot-community-redesign #community .post-lists.snapshot-post-lists-masonry {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  --snapshot-masonry-col-width: 100%;
  --snapshot-masonry-gap: 20px;
}

.snapshot-community-redesign #community .post-lists.snapshot-post-lists-masonry > .post-card.snapshot-post-card-v2 {
  position: absolute !important;
  margin: 0 !important;
  width: var(--snapshot-masonry-col-width) !important;
  min-width: var(--snapshot-masonry-col-width) !important;
  max-width: var(--snapshot-masonry-col-width) !important;
  display: block !important;
  box-sizing: border-box !important;
}

/* ---------- 创作者 hover 卡片（头像悬停） ---------- */
.snapshot-creator-hovercard {
  position: fixed;
  z-index: 10050;
  width: 280px;
  max-width: calc(100vw - 24px);
  padding: 16px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #181818;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.snapshot-creator-hovercard.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.snapshot-creator-hovercard-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.snapshot-creator-hovercard-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.snapshot-creator-hovercard-identity {
  min-width: 0;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.snapshot-creator-hovercard-name {
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snapshot-creator-hovercard-handle {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snapshot-creator-hovercard-bio {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
