/* ============================================================
   大陶匠社区V2 - 首页样式
   老社区风格
   ============================================================ */

body { background: #faf8f4; }

.v2-page {
  min-height: 100vh;
  background: #faf8f4;
  padding-bottom: 70px;
}

/* ===== 分类Tab ===== */
.v2-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #f0ede8;
  overflow-x: auto;
  padding: 0 8px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.v2-tabs::-webkit-scrollbar {
  display: none;
}

.v2-tab {
  padding: 12px 12px;
  font-size: 14px;
  color: #999;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 3px;
}

.v2-tab.active {
  color: #3d3d3d;
  font-weight: 600;
  border-bottom-color: #8B4513;
}

/* 热门按钮（带排序下拉） */
.v2-tab-sort {
  padding-right: 8px;
  position: relative;
}

.v2-tab-sort .v2-sort-arrow {
  transition: transform 0.2s;
  flex-shrink: 0;
  display: inline-flex;
}

.v2-tab-sort.active .v2-sort-arrow {
  transform: rotate(180deg);
}

/* 排序菜单 */
.v2-sort-menu {
  position: absolute;
  top: 44px;
  left: 8px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 6px;
  z-index: 200;
  display: none;
  min-width: 130px;
}

.v2-sort-menu.show {
  display: block;
}

.v2-sort-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
}

.v2-sort-item:hover {
  background: #f5f0eb;
}

.v2-sort-item.active {
  color: #8B4513;
  font-weight: 600;
}

.v2-sort-check {
  display: none;
}

.v2-sort-item.active .v2-sort-check {
  display: inline-flex;
}

/* ===== 帖子列表 ===== */
/* ===== 瀑布流布局 ===== */
.v2-post-list {
  columns: 2;
  column-gap: 8px;
  padding: 8px;
}
.v2-post-list .v2-post-card {
  break-inside: avoid;
  margin-bottom: 8px;
}

.v2-masonry-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v2-post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  break-inside: avoid;
  transition: transform 0.2s, box-shadow 0.2s;
}

.v2-post-card:active {
  transform: scale(0.98);
}

/* 图片区域 */
.v2-post-images {
  width: 100%;
  overflow: hidden;
  background: #f5f0e8;
}

.v2-post-images.single {
  width: 100%;
  aspect-ratio: 3/4;
}

.v2-post-images.single .v2-post-image {
  width: 100%;
  height: 100%;
}

.v2-post-images.single img {
  width: 100%;
  height: 100% !important;
  display: block;
  object-fit: cover;
}

.v2-post-images.multi {
  display: grid;
  gap: 2px;
}

.v2-post-images.multi.count-2 {
  grid-template-columns: 1fr 1fr;
}

.v2-post-images.multi.count-3 {
  grid-template-columns: 1fr 1fr;
}

.v2-post-images.multi.count-3 .v2-post-image:first-child {
  grid-column: 1 / -1;
}

.v2-post-image {
  overflow: hidden;
  background: #f5f0e8;
}

.v2-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.v2-post-images.multi.count-2 .v2-post-image {
  aspect-ratio: 1;
}

.v2-post-images.multi.count-3 .v2-post-image:first-child {
  aspect-ratio: 16/10;
}

.v2-post-images.multi.count-3 .v2-post-image:not(:first-child) {
  aspect-ratio: 1;
}

/* 无图片 */
.v2-post-no-image {
  padding: 20px 12px;
  background: linear-gradient(135deg, #f5f0e8, #ebe4d8);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.v2-post-no-image-text {
  font-size: 12px;
  color: #8B7355;
  text-align: center;
  line-height: 1.5;
}

/* 标题区域 */
.v2-post-title-wrap {
  padding: 8px 10px 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.v2-post-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0;
  margin-right: 6px;
  line-height: 1.4;
  background: linear-gradient(135deg, #8B4513, #D96A1F);
}

.v2-post-title {
  font-size: 13px;
  font-weight: 600;
  color: #3d2c1e;
  padding: 0;
  line-height: 1.3;
  display: inline;
}

/* 底部区域 */
.v2-post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
}

.v2-post-author {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.v2-post-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, #8B4513, #D96A1F);
}

.v2-post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v2-post-nickname {
  font-size: 11px;
  color: #5c4a3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-post-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.v2-post-stat {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: #999;
}

.v2-post-stat svg {
  width: 14px;
  height: 14px;
}

.v2-post-stat.liked {
  color: #FF2442;
}

.v2-post-stat.favorited {
  color: #FFA500;
}

/* ===== 加载状态 ===== */
.v2-loading {
    display: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: #999;
  font-size: 13px;
}

.v2-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-top-color: #8B4513;
  border-radius: 50%;
  animation: v2-spin 0.8s linear infinite;
}

@keyframes v2-spin {
  to { transform: rotate(360deg); }
}

/* ===== 空状态 ===== */
.v2-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #999;
}

.v2-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.v2-empty-text {
  font-size: 14px;
}

/* ===== 没有更多 ===== */
.v2-nomore {
    display: none;
  text-align: center;
  padding: 20px;
  color: #ccc;
  font-size: 12px;
}





/* ===== 板块导航悬浮（JS控制） ===== */
/* 说明：因html/body设置了overflow-x:hidden导致CSS sticky失效，改用JS实现 */
.v2-tabs.tabs-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: visible; /* 悬浮时取消overflow裁剪，让热门下拉菜单正常显示 */
}

/* 悬浮时热门下拉菜单层级提高 */
.v2-tabs.tabs-fixed .v2-sort-menu {
  z-index: 91;
}

/* 悬浮时文字颜色加深 */
.v2-tabs.tabs-fixed .v2-tab {
  color: #555; /* 从#999加深到#555 */
}

.v2-tabs.tabs-fixed .v2-tab.active {
  color: #6d360f; /* 从#8B4513加深到#6d360f */
  border-bottom-color: #6d360f;
}

/* 板块导航占位符（防止内容跳动） */
.v2-tabs-placeholder {
  height: 44px;
  display: none;
}

/* 排序下拉菜单层级 */
.v2-sort-menu {
  z-index: 91;
}

/* 电脑端不启用悬浮 */
@media (min-width: 768px) {
  .v2-tabs-placeholder {
    display: none !important;
  }
  .v2-tabs.tabs-fixed {
    position: static !important;
    box-shadow: none !important;
  }
}

/* ===== 响应式布局 ===== */
/* 平板及以上：3列瀑布流 */
@media (min-width: 768px) {
  .v2-post-list {
    columns: 4;
    column-gap: 16px;
    padding: 16px;
  }
  .v2-post-list .v2-post-card {
    break-inside: avoid;
    margin-bottom: 16px;
  }

  .v2-tabs {
    padding: 0 24px;
  }
}

/* 电脑端 */
@media (min-width: 1024px) {
  .v2-post-list {
    column-gap: 20px;
    padding: 20px;
  }
  .v2-post-list .v2-post-card {
    margin-bottom: 20px;
  }
}










