/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  text-align: none;
  list-style: none;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  width: 100%;
  height: 100vh; 
}

/* 瀑布流容器 */
.posts-container {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}

/* 帖子容器 */
.post {
  break-inside: avoid;
  /* 防止内容断裂 */
  background: rgb(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 16px auto;
  padding: 20px;
  max-width: 360px;
  transition: transform 0.2s;
}

.post:hover {
  transform: translateY(-2px);
}

/* 头部区域 */
.post-header {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 9;
  /* background-color: #fff; */
  align-items: center;
}

/* 类型 */
.post-type {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;

  &.love {
    background: #ffe6e6;
    color: #c00;
  }

  &.help {
    background: #e6f3ff;
    color: #06c;
  }

  &.event {
    background: #fff9e6;
    color: #e6a700;
  }

  &.found {
    background: #e6ffe6;
    color: #090;
  }

  &.daily {
    background: #f5e6ff;
    color: #60a;
  }
}

.post-type i {
  margin: 0 6px;
  font-size: 0.9em;
}

/* 类型配色 */

/* 发布时间 */
.post-time {
  color: #666;
  font-size: 0.85em;
}

/* 正文区域 */
.post-body {
  position: relative;
  margin-bottom: 16px;
}

.post-image {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.post-image img {
  width: 100%;
  height: 197px;
  object-fit: cover;
  border-radius: 8px;
}

.post-image img:hover {
  /* transform: scale(1); 放大到原始尺寸 */
}

/* 帖子标题 */
.post-title {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-title:hover {
  color: #2196f3;
}

/* 帖子内容 */
.post-content p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.6;
  max-height: 3.2em;
  /* 2行 × 1.6行高 */
}

/* 底部操作栏 */
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #eee;
  flex-direction: row-reverse;
}
/* 点赞评论 后期可增加 */
.post-actions {
  display: flex;
  display: none;
  gap: 16px;
}

.post-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}

.post-actions button:hover {
  background: #f5f5f5;
}

.post-actions .fas {
  color: #2196f3;
}

.post-author {
  color: #888;
  font-size: 0.9em;
}

/* 加载动画 */
#loader {
  text-align: center;
  padding: 20px;
  display: none;
}

.loader-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2196f3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Toast提示 */
.toast-container {
  z-index: 1000;
}

.toast {
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  margin-bottom: 8px;
  opacity: 0.95;
  animation: slideIn 0.3s ease-out;
}

.toast.error {
  background: #ff4444;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

/* 分类过滤按钮 */
.filter-btn {
  margin: 0px 5px;
  border-radius: 20px;
}

.filter-btn.active {
  background: #2196f3;
  color: white;
  border-color: transparent;
}









        /* 骨架屏样式 */
 /* 帖子入场动画 */
@keyframes postEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 动态加载动画 */
@keyframes pulseGlow {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.post {
  animation: postEntrance 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  position: relative;
  overflow: hidden;
}

/* 文字加载占位 */
.post-loading-text::after {
  content: "";
  display: inline-block;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: 1.5s loadingShimmer linear infinite;
}

@keyframes loadingShimmer {
  to { background-position: 200% 0; }
}


/* 图片加载特效 */
.loading-bg {
  background: linear-gradient(110deg, 
    rgba(240,240,240,0.8) 25%,
    rgba(225,225,225,0.9) 50%,
    rgba(240,240,240,0.8) 75%);
  background-size: 200% 100%;
  animation: 2s loadingShimmer linear infinite;
}

.glow {
  filter: blur(8px);
  opacity: 0.8;
  transition: all 0.8s ease;
}

.glow.loaded {
  filter: blur(0);
  opacity: 1;
}


/* 类型图标动画 */
.pulse {
  animation: pulseGlow 2s ease infinite;
  color: rgba(220,53,69,0.8);
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}