/* 社区 — 信息流 + 右上角发布入口 */

.mc-hidden {
  display: none !important;
}

.community-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.community-feed-card {
  padding: 16px;
}

.community-feed-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.community-mobile-search {
  display: none;
  flex: 1;
  min-width: 0;
}

.community-mobile-messages-btn {
  display: none;
}

@media (max-width: 960px) {
  .community-mobile-search {
    display: block;
  }
}

.community-feed-toolbar-desktop {
  flex: 1;
  min-width: 0;
}

.community-feed-kicker {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.community-feed-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.community-compose-fab {
  flex-shrink: 0;
  width: 52px;
  height: 64px;
  padding: 4px 6px 0;
  border: none;
  border-radius: 14px;
  background: var(--panel);
  color: #757575;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.community-compose-fab:hover {
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(var(--primary-rgb, 91, 140, 191), 0.18);
}

.community-compose-fab svg {
  width: 100%;
  height: auto;
  display: block;
}

/* —— 三圆钮发布菜单 —— */
.community-action-overlay {
  position: fixed;
  inset: 0;
  z-index: 22000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.community-action-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 28, 0.45);
  backdrop-filter: blur(3px);
}

.community-action-menu {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 22px 20px 18px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(8, 14, 28, 0.22);
  text-align: center;
}

.community-action-menu-title {
  margin: 0 0 18px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.community-action-circles {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}

.community-action-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  min-width: 72px;
}

.community-action-circle-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.community-action-circle:hover .community-action-circle-icon {
  transform: translateY(-3px) scale(1.04);
}

.community-action-circle.is-post .community-action-circle-icon {
  background: linear-gradient(145deg, #5b8cbf, #4a74a8);
}

.community-action-circle.is-checkin .community-action-circle-icon {
  background: linear-gradient(145deg, #4caf7a, #2e9b63);
}

.community-action-circle.is-audio .community-action-circle-icon {
  background: linear-gradient(145deg, #9b6fd4, #7a4fbf);
}

.community-action-circle-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.community-action-cancel {
  width: 100%;
  min-height: 40px;
}

/* —— 表单弹窗 —— */
.community-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 22100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.community-form-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 28, 0.5);
}

.community-form-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(8, 14, 28, 0.24);
}

.community-form-panel h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.community-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.community-checkin-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--sub-text);
}

.community-checkin-pill.is-done {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.community-compose-textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.92rem;
  line-height: 1.55;
  font-family: inherit;
  box-sizing: border-box;
}

.community-compose-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.community-checkin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.community-checkin-head h3 {
  margin: 0;
}

.community-checkin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.community-checkin-meta select {
  flex: 1;
  min-width: 120px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.82rem;
}

.community-audio-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--sub-text);
  cursor: pointer;
}

.community-audio-pick-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.community-image-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--sub-text);
  cursor: pointer;
}

.community-image-pick-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.community-image-preview {
  margin-top: 10px;
}

.community-image-preview img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: var(--bg);
}

.community-weibo-image {
  margin-top: 8px;
}

.community-weibo-image img {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg);
  cursor: zoom-in;
}

.community-weibo-image img.is-loaded {
  cursor: zoom-in;
}

.community-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.community-image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 16, 24, 0.82);
  cursor: zoom-out;
}

.community-image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.community-image-lightbox-img {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1200px);
  max-height: 90vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

body.community-lightbox-open {
  overflow: hidden;
}

.community-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.community-tab {
  flex: 1;
  min-height: 38px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--sub-text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.community-tab.is-active {
  background: var(--panel);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.community-all-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.community-all-filters.mc-hidden {
  display: none;
}

.community-all-filter {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--sub-text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.community-all-filter.is-active {
  border-color: var(--primary);
  background: var(--primary-soft, rgba(96, 139, 187, 0.12));
  color: var(--primary);
}

.community-feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.community-weibo-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  position: relative;
}

.community-weibo-card.is-reward-highlight {
  border: 2px solid rgba(212, 168, 67, 0.7);
  background: linear-gradient(
    135deg,
    rgba(212, 168, 67, 0.06) 0%,
    var(--panel) 55%
  );
  box-shadow:
    0 0 0 1px rgba(212, 168, 67, 0.12),
    0 0 22px rgba(212, 168, 67, 0.22);
  animation: communityPostHighlight 2.6s ease-in-out infinite;
}

@keyframes communityPostHighlight {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(212, 168, 67, 0.12),
      0 0 16px rgba(212, 168, 67, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(212, 168, 67, 0.28),
      0 0 28px rgba(212, 168, 67, 0.38);
  }
}

.community-weibo-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.community-weibo-avatar.has-sound-frame {
  box-shadow: 0 0 0 2px var(--primary), 0 0 0 4px rgba(96, 139, 187, 0.25);
  border-radius: 50%;
}

.community-weibo-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.community-weibo-title {
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(96, 139, 187, 0.14);
  color: var(--primary);
  font-weight: 600;
}

.community-weibo-medals {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.community-weibo-medal {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(212, 168, 67, 0.15);
  color: #9a6b00;
  border: 1px solid rgba(212, 168, 67, 0.35);
}

.community-weibo-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-soft);
  overflow: hidden;
  flex-shrink: 0;
}

.community-weibo-avatar-default,
.community-weibo-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}

.community-weibo-avatar-img {
  object-fit: cover;
  z-index: 1;
}

.community-weibo-avatar-img[hidden] {
  display: none !important;
}

.community-weibo-avatar-default[hidden] {
  display: none !important;
}

.community-weibo-user {
  flex: 1;
  min-width: 0;
}

.community-weibo-time {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--sub-text);
}

.community-weibo-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
}

.community-weibo-badge.is-checkin {
  background: var(--success-soft);
  color: var(--success);
}

.community-weibo-badge.is-audio {
  background: #f0e8ff;
  color: #7a4fbf;
}

.community-weibo-badge.is-reward-highlight-badge {
  background: rgba(212, 168, 67, 0.18);
  color: #9a7424;
  border: 1px solid rgba(212, 168, 67, 0.35);
  border-radius: 999px;
}

.community-weibo-body {
  margin: 10px 0 0 52px;
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.community-weibo-tags {
  margin: 8px 0 0 52px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.community-weibo-tag {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: var(--bg);
  color: var(--sub-text);
  border: 1px solid var(--border);
}

.community-weibo-audio {
  margin: 10px 0 0 52px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.community-weibo-audio-title {
  margin: 0 0 8px;
  font-size: 0.84rem;
  font-weight: 600;
}

.community-weibo-audio audio {
  width: 100%;
}

.community-weibo-foot {
  margin: 12px 0 0 52px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.community-weibo-action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 0.8rem;
  cursor: pointer;
}

.community-weibo-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.community-weibo-action.is-liked {
  border-color: #e8a0b0;
  background: #fff0f3;
  color: #c45c74;
}

.community-weibo-action.is-favorited {
  border-color: #d4b86a;
  background: #fff9eb;
  color: #9a7420;
}

.community-weibo-action.is-danger {
  margin-left: auto;
  border-color: #e8b4b0;
  color: #c0392b;
}

.community-weibo-action.is-danger:hover {
  border-color: #c0392b;
  background: #fff5f5;
  color: #a93226;
}

.community-comments {
  margin: 10px 0 0 52px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.community-comment-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.community-comment-item.is-highlighted {
  background: var(--primary-soft, rgba(96, 139, 187, 0.14));
  outline: 1px solid var(--primary);
}

.community-comment-main {
  flex: 1;
  min-width: 0;
}

.community-comment-item strong {
  color: var(--primary);
}

.community-comment-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.community-comment-reply-btn,
.community-comment-fav {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--sub-text);
  font-size: 0.74rem;
  padding: 2px 0;
  cursor: pointer;
}

.community-comment-reply-to {
  color: var(--sub-text);
  font-size: 0.78rem;
}

.community-comment-reply-hint {
  font-size: 0.78rem;
  color: var(--primary);
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--primary-soft, rgba(96, 139, 187, 0.1));
}

.community-comment-reply-hint.mc-hidden {
  display: none;
}

.community-reply-cancel {
  border: none;
  background: transparent;
  color: var(--sub-text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  margin-left: 6px;
  padding: 0 4px;
}

.community-comment-fav.is-favorited {
  color: var(--primary-strong, var(--primary));
  font-weight: 600;
}

.community-fav-source {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft, rgba(96, 139, 187, 0.08));
  border: 1px solid var(--border);
}

.community-fav-source.is-linkable {
  cursor: pointer;
}

.community-fav-source.is-linkable:hover {
  border-color: var(--primary);
}

.community-fav-source-link,
.community-goto-post-btn {
  margin-left: auto;
}

.community-fav-source-label {
  display: block;
  font-size: 0.72rem;
  color: var(--sub-text);
  margin-bottom: 6px;
}

.community-fav-source-user {
  margin: 0 0 4px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary);
}

.community-fav-source-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
}

.community-fav-source-link {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.community-fav-source-time {
  font-size: 0.72rem;
  color: var(--sub-text);
}

.community-fav-source-excerpt {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text);
}

.community-fav-comment .community-fav-comment-body {
  margin-bottom: 4px;
}

.community-fav-comment-meta {
  margin: 0 0 4px;
  font-size: 0.72rem;
  color: var(--sub-text);
}

.community-fav-comment-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.community-comment-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.community-comment-input {
  flex: 1;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.community-empty,
.community-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--sub-text);
  font-size: 0.88rem;
}

.community-load-more {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
}

body.community-modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .community-action-circles {
    gap: 12px;
  }

  .community-action-circle-icon {
    width: 56px;
    height: 56px;
  }

  .community-weibo-body,
  .community-weibo-tags,
  .community-weibo-audio,
  .community-weibo-foot,
  .community-comments {
    margin-left: 0;
  }
}
