/* ============ community.css ============ */
.page-community {
  --community-top-offset: 64px;
  padding: 0;
  position: relative;
  min-height: calc(100vh - var(--nav-height, 52px));
  overflow: visible;
}

.community-layout {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--community-top-offset) 20px 80px 40px;
  overflow: visible;
}
.community-sidebar { width: 130px; flex-shrink: 0; position: fixed; top: calc(var(--nav-height, 52px) + var(--community-top-offset)); left: max(40px, calc((100vw - 1100px) / 2 + 40px)); z-index: 10; }
.community-content { grid-column: 2; min-width: 0; }

.community-tabs { margin-bottom: 12px; }
.community-track {
  position: relative; display: flex; flex-direction: column;
  background: #141314;
  border-radius: 18px; padding: 4px;
  gap: 4px;
}
.community-indicator {
  position: absolute; left: 4px;
  width: calc(100% - 8px);
  background: var(--color-primary);
  border-radius: 14px; z-index: 0;
  transition: top .45s cubic-bezier(.25,.8,.25,1), height .45s cubic-bezier(.25,.8,.25,1);
}
.community-tab {
  width: 100%; position: relative; z-index: 1;
  background: transparent; border: none;
  color: var(--color-text-dim); padding: 10px 0; border-radius: 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: color .3s cubic-bezier(.25,.8,.25,1);
  font-family: inherit; text-align: center;
}
.community-tab:hover { color: var(--color-text); }
.community-tab.active {
  background: transparent;
  color: #fff;
}

.btn-new-post {
  width: 100%; margin-top: 12px;
  padding: 10px 0; font-size: 13px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: opacity .2s;
  font-family: inherit;
}
.btn-new-post:hover { opacity: 0.88; }

/* 帖子列表 */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-card {
  background: #141314;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 20px 24px;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 10px 34px rgba(0,0,0,0.14);
}
.post-card:hover {
  border-color: #242324;
  box-shadow: 0 12px 28px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

.post-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-card-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post-card-author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}
.post-card-author-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-card-author .level-badge {
  margin-left: 0;
  transform: none;
}
.post-card-time { font-size: 11px; color: var(--color-text-dim); margin-left: auto; }
.post-card-title { font-size: 16px; font-weight: 700; color: var(--color-text); margin-bottom: 8px; line-height: 1.4; }
.post-card-content {
  font-size: 13px; color: var(--color-text-dim); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-images { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.post-card-images img { flex: 1; min-width: 0; aspect-ratio: 4/3; max-height: 220px; object-fit: cover; border-radius: 8px; }
.post-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--color-border); font-size: 12px; color: var(--color-text-dim); }
.post-card-tag { display: inline-block; padding: 2px 6px; background: rgba(175,35,49,0.15); color: var(--color-accent); border-radius: var(--radius); font-size: 9px; font-weight: 600; }
.post-card-stats { font-size: 12px; color: var(--color-text-dim); }

.post-state {
  padding: 60px 0;
  color: var(--color-text-dim);
  font-size: 14px;
  text-align: center;
}

.post-list .loading-indicator { padding: 72px 0; }

@media (max-width: 768px) {
  .community-layout {
    display: block;
    margin-top: 70px;
    padding: 0 16px 70px;
  }

  .community-sidebar {
    position: static;
    width: 100%;
    margin-bottom: 14px;
  }

  .community-content {
    grid-column: auto;
    margin-left: 0;
  }

  .community-track {
    flex-direction: row;
    border-radius: 999px;
    overflow-x: auto;
  }

  .community-indicator {
    display: none;
  }

  .community-tab {
    min-width: 58px;
    padding: 9px 12px;
    border-radius: 999px;
  }

  .community-tab.active {
    background: var(--color-primary);
  }

  .post-card {
    padding: 16px;
  }

  .post-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
