/** pages/community/index.wxss **/
page {
  height: 100%;
  overflow: hidden;
}

.community-page {
  background-color: #fff;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header with User Info */
.community-header {
  display: flex;
  align-items: center;
  padding: 24rpx 40rpx;
  padding-top: calc(24rpx + env(safe-area-inset-top));
  background: white;
  flex-shrink: 0;
  border-bottom: 2rpx solid rgba(0, 0, 0, 0.03);
}

.community-header .user-info {
  display: flex;
  align-items: center;
  gap: 20rpx;
}

.community-header .user-avatar {
  width: 80rpx;
  height: 80rpx;
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  color: #558B2F;
  border-radius: 16rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 32rpx;
}

.community-header .user-name {
  font-size: 34rpx;
  font-weight: 700;
  color: #333;
}

/* Feed Scroll Area */
.moments-feed {
  flex: 1;
  padding: 0 40rpx;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.moments-feed::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Post Card */
.moment-post {
  display: flex;
  gap: 24rpx;
  margin-top: 40rpx;
  padding-bottom: 40rpx;
  border-bottom: 2rpx solid #f5f5f5;
}

.moment-post:last-child {
  border-bottom: none;
}

/* Avatar - WeChat Style Rounded Square */
.post-avatar {
  flex-shrink: 0;
}

.avatar-square {
  width: 88rpx;
  height: 88rpx;
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  color: #558B2F;
  border-radius: 16rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 36rpx;
}

/* Post Content */
.post-content {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.post-user-name {
  color: #576b95;
  font-weight: 600;
  font-size: 30rpx;
  margin-bottom: 12rpx;
  display: block;
}

.post-text {
  font-size: 30rpx;
  color: #333;
  line-height: 1.6;
  margin-bottom: 20rpx;
  display: block;
  word-wrap: break-word;
}

/* Image Grid - CSS Grid Layout */
.post-images-grid {
  display: grid;
  gap: 8rpx;
  margin-bottom: 20rpx;
  border-radius: 16rpx;
  overflow: hidden;
}

.post-image-item {
  position: relative;
  background: #f0f0f0;
  overflow: hidden;
}

/* Single Image */
.grid-1 {
  display: flex;
  width: 70%;
}

.grid-1 .post-image-item {
  width: 100%;
  border-radius: 16rpx;
}

.grid-1 .post-image-item t-image {
  border-radius: 16rpx;
}

/* 2-4 Images (2 columns) */
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  width: 75%;
}

.grid-2 .post-image-item {
  aspect-ratio: 1;
}

/* 5+ Images (3 columns) */
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-3 .post-image-item {
  aspect-ratio: 1;
}

/* Post Meta */
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20rpx;
  height: 44rpx;
}

.post-time {
  font-size: 24rpx;
  color: #a0a0a0;
}

.action-btn {
  background: #f7f7f7;
  border-radius: 8rpx;
  width: 72rpx;
  height: 44rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8rpx;
}

.action-btn:active {
  background: #e8e8e8;
}

.action-dot {
  width: 10rpx;
  height: 10rpx;
  background: #576b95;
  border-radius: 50%;
}

/* Likes & Comments Box */
.likes-comments-box {
  background: #f7f7f7;
  border-radius: 8rpx;
  padding: 20rpx 24rpx;
  position: relative;
  font-size: 26rpx;
  color: #333;
}

.likes-comments-box::before {
  content: '';
  position: absolute;
  top: -12rpx;
  left: 24rpx;
  border-width: 0 12rpx 12rpx;
  border-style: solid;
  border-color: transparent transparent #f7f7f7;
}

.likes-section {
  display: flex;
  align-items: flex-start;
  gap: 12rpx;
  color: #576b95;
  line-height: 1.5;
}

.likes-list {
  flex: 1;
  font-weight: 500;
}

.like-name {
  color: #576b95;
}

.divider {
  height: 2rpx;
  background: rgba(0, 0, 0, 0.05);
  margin: 16rpx 0;
}

.comments-section {
  display: flex;
  flex-direction: column;
  gap: 12rpx;
}

.comment-item {
  line-height: 1.5;
}

.comment-user {
  color: #576b95;
  font-weight: 500;
}

.comment-content {
  color: #333;
}

/* Empty State */
.empty-feed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120rpx 40rpx;
  color: #999;
}

.empty-icon {
  width: 160rpx;
  height: 160rpx;
  background: #f5f5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32rpx;
}

.empty-text {
  font-size: 32rpx;
  font-weight: 600;
  color: #666;
  margin-bottom: 12rpx;
}

.empty-hint {
  font-size: 26rpx;
  color: #999;
}

/* Floating Action Button */
.fab {
  position: fixed;
  right: 40rpx;
  bottom: 200rpx;
  width: 112rpx;
  height: 112rpx;
  background: linear-gradient(135deg, #689F38, #558B2F);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12rpx 32rpx rgba(85, 139, 47, 0.4);
  z-index: 100;
  transition: all 0.2s;
}

.fab:active {
  transform: scale(0.92);
  box-shadow: 0 6rpx 16rpx rgba(85, 139, 47, 0.3);
}

/* WeChat Style Action Container */
.action-container {
  position: relative;
  display: flex;
  align-items: center;
}

/* WeChat Style Action Popup */
.action-popup {
  position: absolute;
  right: 80rpx;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: right center;
  display: flex;
  align-items: center;
  background: #4c4c4c;
  border-radius: 8rpx;
  overflow: hidden;
  opacity: 0;
  transition: all 0.2s ease-out;
  z-index: 10;
}

.action-popup.show {
  transform: translateY(-50%) scaleX(1);
  opacity: 1;
}

.popup-btn {
  display: flex;
  align-items: center;
  gap: 8rpx;
  padding: 16rpx 24rpx;
  color: #fff;
  font-size: 26rpx;
  white-space: nowrap;
}

.popup-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

.popup-divider {
  width: 2rpx;
  height: 32rpx;
  background: rgba(255, 255, 255, 0.2);
}

/* Comment Input Bar */
.comment-input-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.comment-input-bar.show {
  transform: translateY(0);
}

.comment-input-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
}

.comment-input-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20rpx;
  padding: 20rpx 32rpx;
  padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
  background: #f5f5f5;
  border-top: 2rpx solid #e5e5e5;
}

.comment-input {
  flex: 1;
  height: 72rpx;
  padding: 0 24rpx;
  background: #fff;
  border-radius: 36rpx;
  font-size: 28rpx;
}

.send-btn {
  padding: 16rpx 32rpx;
  background: #e0e0e0;
  border-radius: 8rpx;
  font-size: 28rpx;
  color: #999;
  transition: all 0.2s;
}

.send-btn.active {
  background: #558B2F;
  color: #fff;
}

.send-btn:active {
  opacity: 0.8;
}

.comment-expand-btn {
  font-size: 26rpx;
  color: #576b95;
  margin-top: 8rpx;
  padding: 4rpx 0;
}
