/* ========== Space Author Card ========== */
.space-author-section {
  position: relative; z-index: 1;
  padding: calc(var(--nav-height) + 48px) 40px 0;
  display: flex; justify-content: flex-start;
}

.space-author-card {
  padding: 8px 4px;
  padding-left: 64px;
  text-align: left;
  max-width: 600px;
}

.space-author-name {
  font-size: 2rem; font-weight: 700;
  color: var(--blue-700);
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.space-author-bio {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* 空间页 feed-section 减小顶部间距 */
#feed.feed-section {
  padding-top: 36px;
}

/* ========== Moment Items ========== */
.moment-item {
  margin-bottom: 16px;
}

.moment-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
}

.moment-date {
  display: block;
  font-size: 0.82rem;
  color: var(--text-light, #999);
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.moment-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-color, #333);
  word-break: break-word;
}

.moment-body p {
  margin: 0 0 0.8em 0;
}

.moment-body p:last-child {
  margin-bottom: 0;
}

.moment-body pre {
  background: var(--code-bg, #f5f5f5);
  border-radius: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0.6em 0;
}

.moment-body code {
  background: var(--code-bg, #f5f5f5);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.88em;
}

.moment-body pre code {
  background: none;
  padding: 0;
}

.moment-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 0.6em 0;
}

/* 九宫格改造完成前隐藏原始图片 */
.moment-body:not(.gallery-done) img {
  display: none;
}

.moment-body blockquote {
  border-left: 3px solid var(--blue-300, #93c5fd);
  padding-left: 12px;
  margin: 0.6em 0;
  color: var(--text-light, #666);
}

.moment-empty {
  color: var(--text-light, #999);
  text-align: center;
  padding: 32px 0;
  font-size: 0.95rem;
}

.moment-sentinel {
  height: 1px;
}

/* ========== Image Gallery (九宫格) ========== */
.moment-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 12px;
  max-width: 480px;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 6px;
}

.gallery-item img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  border-radius: 6px !important;
  margin: 0 !important;
  transition: transform 0.25s;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* +N 标签 */
.gallery-more {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  pointer-events: none;
}

/* ========== Lightbox ========== */
.moment-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.moment-lightbox.active {
  display: flex;
}

.lightbox-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.88);
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  z-index: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-counter {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.lightbox-img {
  position: relative;
  z-index: 0;
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .space-author-section {
    padding: calc(var(--nav-height) + 28px) 20px 0;
  }
  .space-author-card {
    padding-left: 20px;
  }
  .space-author-name {
    font-size: 1.6rem;
  }
  .space-author-bio {
    font-size: 0.88rem;
  }
  .moment-gallery {
    gap: 3px;
  }
  .lightbox-prev,
  .lightbox-next {
    font-size: 2rem;
    padding: 8px 12px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-img {
    max-width: 95vw;
  }
}
