/* ════════════════════════════════════════════════════════
   Blog — community style matching site accent palette
   ════════════════════════════════════════════════════════ */

/* ── Shared page shell ──────────────────────────────────────────────────── */
.blogListPage,
.blogWritePage,
.blogPostPage {
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + 12px);
  padding-bottom: calc(var(--footer-height, 56px) + 20px);
}

.blogListPage {
  width: 100%;
  padding-top: calc(var(--nav-height) + 8px);
}

.blogFeedShell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 0 16px calc(var(--footer-height, 56px) + 24px);
}

/* Search */
.blogSearchWrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 14px;
  position: sticky;
  top: var(--nav-height);
  z-index: 20;
  background: transparent;
}
.blogSearchBar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(520px, 100%);
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  cursor: text;
}
.blogSearchBar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(59, 130, 246, 0.12));
}
.blogSearchIcon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}
.blogSearchInput {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--primary);
  outline: none;
  min-width: 0;
}
.blogSearchInput::placeholder { color: #9ca3af; }

/* Toolbar: 推荐 + 分类 + 发布 */
.blogToolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 14px;
}
.blogToolbarScroll {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.blogToolbarScroll::-webkit-scrollbar { display: none; }

.blogFeedTab,
.blogFilterChip {
  flex-shrink: 0;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.blogFeedTab:hover,
.blogFilterChip:hover { color: var(--primary); background: rgba(255,255,255,0.7); }
.blogFeedTab.is-active,
.blogFilterChip.is-active {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
  font-weight: 700;
}

.blogSortSelect {
  flex-shrink: 0;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.blogSortSelect:focus { border-color: var(--accent); }

.blogPublishBtn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  border: none;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}
.blogPublishBtn:hover { background: #2563eb; }

/* Waterfall */
.blogWaterfall {
  column-count: 5;
  column-gap: 16px;
}
@media (max-width: 1200px) { .blogWaterfall { column-count: 4; } }
@media (max-width: 900px) { .blogWaterfall { column-count: 3; } }
@media (max-width: 640px) { .blogWaterfall { column-count: 2; column-gap: 10px; } }

.bwEmpty {
  column-span: all;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 60px 0;
}

/* Card */
.bwCard {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(15,23,42,0.07);
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: block;
}
.bwCard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15,23,42,0.1); }
@media (max-width: 480px) { .bwCard { margin-bottom: 8px; border-radius: 10px; } }

/* Cover image — natural aspect ratio with height guard */
.bwCardImg {
  width: 100%;
  overflow: hidden;
  min-height: 100px;
  max-height: 460px;
  background: #f3f4f6;
}
.bwCardImg img {
  width: 100%;
  height: auto;
  max-height: 460px;
  display: block;
  object-fit: cover;
  object-position: center top;
}
.bwCardImgPlaceholder {
  aspect-ratio: unset;   /* text-only cards size to content, not forced 3/4 */
  min-height: 88px;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}
.bwCardTextPlaceholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  width: 100%;
}
.bwCardTextEmoji {
  font-size: 30px;
  line-height: 1;
  opacity: 0.75;
}
.bwCardTextContent {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.72);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Card body */
.bwCardBody { padding: 10px 11px 10px; }
.bwCardTitle {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bwCardExcerpt {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bwCardSubtitle {
  margin: 4px 0 0;
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(15,23,42,0.5);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bwCardTags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.bwTagChip {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft, rgba(59,130,246,0.1));
  color: var(--accent, #3b82f6);
  font-size: 10.5px;
  font-weight: 600;
}
.bwCardFoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.bwCardAuthor { display: flex; align-items: center; gap: 5px; min-width: 0; }
.bwCardAvatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #3b82f6), #10b981);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bwCardAuthorName {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80px;
}
.bwRoleBadge {
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}
.bwRoleBadge--owner { background: #fef3c7; color: #b45309; }
.bwRoleBadge--super { background: #ede9fe; color: #6d28d9; }
.bwRoleBadge--paid  { background: #dbeafe; color: #1d4ed8; }
.bwCardStats { display: flex; align-items: center; gap: 5px; }
.bwCardLoc { font-size: 10.5px; color: var(--muted); }
.bwCardLikeBtn {
  display: inline-flex; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  border-radius: 6px; color: var(--muted); font-size: 10.5px; font-weight: 600;
  transition: color 0.15s;
}
.bwCardLikeBtn:hover, .bwCardLikeBtn.is-liked { color: #e11d48; }
.bwCardLikeBtn svg { flex-shrink: 0; }
.bwCardLikeBtn.is-liked svg { fill: #e11d48; stroke: #e11d48; }

/* Load more */
.blogLoadMoreWrap {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
}
.blogLoadMoreBtn {
  height: 38px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.blogLoadMoreBtn:hover { border-color: var(--accent); color: var(--accent); }

/* ════════════════════════════════════════════════════════
   POST DETAIL OVERLAY (opens over the listing page)
   ════════════════════════════════════════════════════════ */

.bwOverlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
}
.bwOverlay.is-open {
  display: flex;
  visibility: visible;
  pointer-events: auto;
  animation: bwOverlayIn 0.2s ease;
}
@keyframes bwOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.bwOverlayCard {
  width: min(1080px, 96vw);
  height: min(90vh, 780px);
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  background: #fff;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22);
  position: relative;
  animation: bwCardIn 0.22s ease;
}
@keyframes bwCardIn { from { transform: scale(0.96) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.bwOverlayClose {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.bwOverlayClose:hover { background: rgba(0,0,0,0.65); }

/* Gallery pane */
.bwOvGallery {
  background: #0f172a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Prev / Next arrows */
.bwOvGalleryNav {
  position: absolute;
  top: calc(50% - 20px); /* slight upward offset to center in image area above dots */
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.18s, background 0.15s;
  pointer-events: none;
}
.bwOvGallery:hover .bwOvGalleryNav {
  opacity: 1;
  pointer-events: auto;
}
.bwOvGalleryNav:hover { background: rgba(0, 0, 0, 0.72); }
.bwOvGalleryPrev { left: 12px; }
.bwOvGalleryNext { right: 12px; }
.bwOvGalleryTrack {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.bwOvGalleryTrack::-webkit-scrollbar { display: none; }
.bwOvGallerySlide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
/* Blurred background fills the dark bars — XHS-style */
.bwOvGalleryBg {
  position: absolute;
  inset: -12px;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.42) saturate(1.3);
  transform: scale(1.06);
  pointer-events: none;
}
.bwOvGallerySlide img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.bwOvGalleryDots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 12px;
}
.bwOvGalleryDot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.bwOvGalleryDot.is-active { background: #fff; transform: scale(1.3); }

/* No-image placeholder in overlay (now a sibling of track/dots, shown when no images) */
.bwOvNoImage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}
.bwOvNoImage[hidden] { display: none; }

/* Content pane */
.bwOvContent {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid #f1f5f9;
}
.bwOvContentScroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* Fixed bottom action bar — like XHS */
.bwOvBottomBar {
  flex-shrink: 0;
  border-top: 1px solid #f1f5f9;
  padding: 10px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}
.bwOvBtmActions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.bwOvBtmLikeBtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s;
}
.bwOvBtmLikeBtn:hover,
.bwOvBtmLikeBtn.is-liked { color: #e11d48; }
.bwOvBtmLikeBtn.is-liked svg { fill: #e11d48; stroke: #e11d48; }
.bwOvBtmViews {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.bwOvBtmShareBtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  background: none;
  border: 1.5px solid var(--border);
  cursor: pointer;
  padding: 4px 14px;
  border-radius: 999px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}
.bwOvBtmShareBtn:hover { border-color: var(--accent); color: var(--accent); }

/* Author */
.bwOvAuthorRow { display: flex; align-items: center; gap: 10px; }
.bwOvAvatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #3b82f6), #10b981);
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bwOvAuthorInfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bwOvAuthorName { font-size: 14px; font-weight: 700; color: var(--primary); }
.bwOvRoleBadge {
  align-self: flex-start; padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
}
.bwOvRoleBadge--owner { background: #fef3c7; color: #b45309; }
.bwOvRoleBadge--super { background: #ede9fe; color: #6d28d9; }
.bwOvRoleBadge--paid  { background: #dbeafe; color: #1d4ed8; }
.bwOvTime { margin-left: auto; font-size: 12px; color: var(--muted); flex-shrink: 0; }

.bwOvTitle { margin: 0; font-size: 19px; font-weight: 900; color: var(--primary); line-height: 1.35; }
.bwOvSubtitle { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); line-height: 1.5; }
.bwOvMeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bwOvTag {
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft, rgba(59,130,246,0.1));
  color: var(--accent, #3b82f6);
  font-size: 11.5px; font-weight: 600;
}
.bwOvLoc { font-size: 12.5px; color: var(--muted); }
.bwOvViews { font-size: 12px; color: var(--muted); margin-left: auto; }

.bwOvBody {
  font-size: 14.5px; line-height: 1.8; color: var(--primary);
  white-space: pre-wrap; word-break: break-word;
}

.bwOvLikeRow { display: flex; align-items: center; padding: 4px 0; }
.bwOvLikeBtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1.5px solid var(--border); cursor: pointer;
  padding: 6px 16px; border-radius: 999px;
  color: var(--muted); font-size: 14px; font-weight: 700;
  transition: color 0.15s, border-color 0.15s;
}
.bwOvLikeBtn:hover, .bwOvLikeBtn.is-liked { color: #e11d48; border-color: #e11d48; }
.bwOvLikeBtn.is-liked svg { fill: #e11d48; stroke: #e11d48; }

.bwOvOwnerActions { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid #f1f5f9; }
.bwOvEditBtn {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--border); background: rgba(248,250,252,0.9);
  color: var(--primary); font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.bwOvEditBtn:hover { border-color: var(--accent); color: var(--accent); }
.bwOvDeleteBtn {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
  border-radius: 8px; border: 1px solid rgba(239,68,68,0.2); background: rgba(239,68,68,0.06);
  color: #b91c1c; font-size: 12px; font-weight: 600; cursor: pointer;
}

/* Overlay loading spinner */
.bwOvLoading {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--muted); font-size: 14px;
  position: absolute; inset: 0; background: #fff; border-radius: 18px; z-index: 5;
}
.bwOvLoading.is-visible {
  display: flex;
}
.bwOvSpinner {
  width: 32px; height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--accent, #3b82f6);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Comments in overlay */
.bwOvComments { border-top: 1px solid #f1f5f9; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.bwOvCommentsTitle { margin: 0; font-size: 14px; font-weight: 800; color: var(--primary); }
.bwOvCommentList { display: flex; flex-direction: column; gap: 8px; }
.bwOvCommentEmpty { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; padding: 8px 0; }
.bwOvCommentItem { padding: 9px 11px; background: #f8fafc; border-radius: 9px; display: flex; flex-direction: column; gap: 4px; }
.bwOvCommentHeader { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bwOvCommentAuthor { font-size: 12.5px; font-weight: 700; color: var(--primary); }
.bwOvCommentTime { font-size: 11px; color: var(--muted); margin-left: auto; }
.bwOvCommentBody { margin: 0; font-size: 13px; line-height: 1.5; color: #374151; word-break: break-word; }
.bwOvCommentForm { display: flex; gap: 8px; align-items: center; }
.bwOvCommentInput {
  flex: 1; border-radius: 999px; border: 1.5px solid var(--border); background: #f8fafc;
  padding: 7px 14px; font-size: 13px; line-height: 1.5; color: var(--primary);
  font-family: inherit; outline: none; resize: none; transition: border-color 0.15s;
  min-height: 36px; max-height: 90px;
}
.bwOvCommentInput:focus { border-color: var(--accent); background: #fff; }
.bwOvCommentSubmit {
  height: 36px; padding: 0 16px; border-radius: 999px; border: none;
  background: var(--accent, #3b82f6); color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.bwOvCommentSubmit:hover { background: #2563eb; }
.bwOvCommentSubmit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Mobile overlay: image fills full width at natural 3:4 ratio, content scrolls below */
@media (max-width: 768px) {
  .bwOverlay { padding: 0; align-items: flex-end; }
  .bwOverlayCard {
    width: 100%; height: 95vh;
    border-radius: 18px 18px 0 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow: hidden;
  }
  .bwOvGallery {
    width: 100%;
    aspect-ratio: 3/4;
    max-height: 78vw;
    height: auto;
    flex-shrink: 0;
  }
  .bwOvGalleryTrack { min-height: 0; }
  .bwOvGallerySlide { height: 100%; }
  .bwOvContent { border-left: none; border-top: 1px solid #f1f5f9; overflow: hidden; min-height: 0; }
  .bwOvTitle { font-size: 16px; }
  .bwOvBody { font-size: 13.5px; }
}

/* ════════════════════════════════════════════════════════
   WRITE OVERLAY (compose on blog listing page)
   ════════════════════════════════════════════════════════ */

.bwWriteOverlay {
  position: fixed;
  inset: 0;
  z-index: 920;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}
.bwWriteOverlay.is-open {
  display: flex;
  visibility: visible;
  pointer-events: auto;
  animation: bwOverlayIn 0.2s ease;
}

.bwWriteCard--split {
  width: min(1120px, 96vw);
  height: min(94vh, 860px);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
  animation: bwCardIn 0.22s ease;
}

.bwWriteClose {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.06);
  color: var(--primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.bwWriteClose:hover { background: rgba(15, 23, 42, 0.12); }

.bwWriteLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.bwWriteMediaPane {
  background: #f8fafc;
  border-right: 1px solid #f1f5f9;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
}

.bwWriteMediaLabel {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
}

.bwWritePreview {
  flex: 1;
  min-height: 220px;
  max-height: 520px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.bwWritePreviewEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 200px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.bwWritePreviewPlus {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #9ca3af;
  line-height: 1;
}

.bwWritePreviewImg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #0f172a;
}

.blogImgGrid--strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.blogImgGrid--strip::-webkit-scrollbar { display: none; }
.blogImgGrid--strip .blogImgPreview,
.blogImgGrid--strip .blogImgAddSlot {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  aspect-ratio: auto;
}

.bwWriteEditorPane {
  min-height: 0;
  overflow-y: auto;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
}

.bwWriteEditorTitle {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.bwWriteEditorPane .blogWriteForm {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bwWriteEditorPane .blogWriteActions {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.bwWriteCard {
  width: min(680px, 94vw);
  max-height: min(92vh, 860px);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: bwCardIn 0.22s ease;
}

.bwWriteCardHead {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.bwWriteCardTitle {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.3;
}

.bwWriteClose {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  color: var(--primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.bwWriteCardHead .bwWriteClose {
  position: static;
}
.bwWriteClose:hover { background: rgba(15, 23, 42, 0.14); }

.bwWriteCardBody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 28px;
}

.bwWriteCardBody .blogWriteForm {
  gap: 16px;
}

.bwWriteCardBody .blogImgUploadLabel,
.bwWriteCardBody .blogWriteFieldLabel {
  line-height: 1.5;
  overflow: visible;
}

@media (max-width: 768px) {
  .bwWriteOverlay {
    align-items: flex-end;
    padding: 0;
  }
  .bwWriteCard--split {
    width: 100%;
    height: 96vh;
    border-radius: 16px 16px 0 0;
  }
  .bwWriteLayout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .bwWritePreview { max-height: 240px; min-height: 160px; }
  .blogToolbar { gap: 6px; }
  .blogPublishBtn { padding: 0 10px; font-size: 12px; }
  .blogFeedTab, .blogFilterChip { font-size: 13px; padding: 0 11px; height: 30px; }
  .blogSortSelect { height: 30px; font-size: 12px; padding: 0 6px; }
}

/* ════════════════════════════════════════════════════════
   WRITE PAGE (standalone fallback)
   ════════════════════════════════════════════════════════ */

.blogWritePage { overflow: auto; }

.blogWriteShell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

.blogWriteHeader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0 16px;
  position: sticky;
  top: var(--nav-height);
  background: rgba(245,245,247,0.9);
  backdrop-filter: blur(8px);
  z-index: 10;
  flex-wrap: wrap;
}
.blogWriteBack {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
}
.blogWriteBack:hover { color: var(--accent); }
.blogWriteTitle {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--primary);
}

.blogWriteForm { display: flex; flex-direction: column; gap: 18px; }

/* Image upload */
.blogImgUploadSection { display: flex; flex-direction: column; gap: 8px; }
.blogImgUploadLabel { margin: 0; font-size: 13px; font-weight: 700; color: var(--primary); }
.blogImgGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 480px) { .blogImgGrid { gap: 6px; } }

.blogImgAddSlot {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px dashed var(--border);
  background: rgba(248,250,252,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.blogImgAddSlot:hover { border-color: var(--accent); background: var(--accent-soft, rgba(59,130,246,0.06)); }
.blogImgAddIcon { font-size: 26px; color: #9ca3af; line-height: 1; }
.blogImgAddText { font-size: 11px; color: #9ca3af; font-weight: 600; }

.blogImgPreview {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #f3f4f6;
}
.blogImgPreview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blogImgPreview.is-cover { outline: 2.5px solid var(--accent); }
.blogImgCoverBadge {
  position: absolute;
  bottom: 5px; left: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 999px;
}
.blogImgLocalBadge {
  position: absolute;
  bottom: 5px; left: 5px;
  background: #f59e0b;
  color: #fff;
  font-size: 9.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 999px;
}
.blogImgRemove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff; font-size: 14px;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.blogImgSpinner::after {
  content: ""; width: 24px; height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: block; margin: auto;
}
.blogImgUploadHint { margin: 0; font-size: 12px; color: #ef4444; min-height: 16px; }

/* Form fields */
.blogWriteField { display: flex; flex-direction: column; gap: 6px; }
.blogWriteFieldRow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .blogWriteFieldRow { grid-template-columns: 1fr; } }

.blogWriteFieldLabel { margin: 0; font-size: 13px; font-weight: 700; color: var(--primary); }

.blogWriteInput, .blogWriteSelect {
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.85);
  padding: 0 13px;
  font-size: 16px;
  color: var(--primary);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.blogWriteInput:focus, .blogWriteSelect:focus { border-color: var(--accent); }
.blogWriteTitleInput { font-size: 16px; font-weight: 700; }
.blogWriteSubtitleInput { font-size: 14px; color: var(--muted); }

.blogWriteContentField { position: relative; }
.blogWriteTextarea {
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.85);
  padding: 12px 13px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--primary);
  font-family: inherit;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.blogWriteTextarea:focus { border-color: var(--accent); }
.blogWriteCharRow { display: flex; justify-content: flex-end; }
.blogWriteCharCount { font-size: 11.5px; color: var(--muted); }

.blogWriteTagRow { display: flex; flex-wrap: wrap; gap: 7px; }
.blogWriteTagPill {
  height: 30px; padding: 0 13px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.85);
  color: var(--primary); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all 0.12s;
}
.blogWriteTagPill:hover { border-color: var(--accent); color: var(--accent); }
.blogWriteTagPill.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.blogWriteActions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding-top: 4px;
}
.blogWriteError { flex: 1; font-size: 12.5px; color: #dc2626; min-height: 18px; }
.blogWriteSubmitBtn {
  height: 44px; padding: 0 32px;
  border-radius: 999px; border: none;
  background: var(--accent, #3b82f6);
  color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.blogWriteSubmitBtn:hover:not(:disabled) { background: #2563eb; }
.blogWriteSubmitBtn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════
   STANDALONE POST DETAIL PAGE (blog-post.html)
   ════════════════════════════════════════════════════════ */

.blogPostPage { padding-left: 0; padding-right: 0; }

.blogPostLoading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 80px 20px; color: var(--muted); font-size: 14px;
}
.blogPostLoadingSpinner {
  width: 36px; height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.blogPostLayout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: calc(100vh - var(--nav-height));
}

.blogPostGallery {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  background: #0f172a;
  display: flex; flex-direction: column; overflow: hidden;
}
.blogPostGalleryTrack {
  flex: 1; display: flex;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.blogPostGalleryTrack::-webkit-scrollbar { display: none; }
.bpGallerySlide {
  flex: 0 0 100%; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.bpGallerySlide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.blogPostGalleryDots {
  display: flex; justify-content: center; gap: 6px; padding: 10px 0 14px; background: #0f172a;
}
.bpGalleryDot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.35); border: none; cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.bpGalleryDot.is-active { background: #fff; transform: scale(1.3); }

.blogPostContent { display: flex; flex-direction: column; overflow: hidden; }
.blogPostContentScroll {
  flex: 1; overflow-y: auto;
  padding: 22px 24px 60px;
  display: flex; flex-direction: column; gap: 14px;
}
.blogPostBack {
  align-self: flex-start; font-size: 13px; color: var(--muted);
  text-decoration: none; margin-bottom: -6px;
}
.blogPostBack:hover { color: var(--accent); }
.blogPostAuthorRow { display: flex; align-items: center; gap: 10px; }
.bpAvatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #3b82f6), #10b981);
  color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bpAuthorInfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bpAuthorName { font-size: 14px; font-weight: 700; color: var(--primary); }
.bpRoleBadge { align-self: flex-start; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.bpRoleBadge--owner { background: #fef3c7; color: #b45309; }
.bpRoleBadge--super { background: #ede9fe; color: #6d28d9; }
.bpRoleBadge--paid  { background: #dbeafe; color: #1d4ed8; }
.bpPostTime { margin-left: auto; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.blogPostTitle { margin: 0; font-size: 20px; font-weight: 900; color: var(--primary); line-height: 1.35; }
.blogPostMeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bpTag { padding: 2px 9px; border-radius: 999px; background: var(--accent-soft, rgba(59,130,246,0.1)); color: var(--accent, #3b82f6); font-size: 11.5px; font-weight: 600; }
.bpLoc { font-size: 12.5px; color: var(--muted); }
.bpViews { font-size: 12px; color: var(--muted); margin-left: auto; }
.blogPostBody { font-size: 15px; line-height: 1.8; color: var(--primary); white-space: pre-wrap; word-break: break-word; }
.blogPostOwnerActions { display: flex; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.blogPostEditBtn {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--border); background: rgba(248,250,252,0.9);
  color: var(--primary); font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.blogPostEditBtn:hover { border-color: var(--accent); color: var(--accent); }
.blogPostDeleteBtn {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px;
  border-radius: 8px; border: 1px solid rgba(239,68,68,0.2); background: rgba(239,68,68,0.06);
  color: #b91c1c; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.blogPostComments { border-top: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.blogPostCommentsTitle { margin: 0; font-size: 15px; font-weight: 800; color: var(--primary); }
.blogCommentList { display: flex; flex-direction: column; gap: 10px; }
.blogCommentEmpty { margin: 0; font-size: 13px; color: var(--muted); text-align: center; padding: 10px 0; }
.blogCommentItem { padding: 10px 12px; background: #f8fafc; border-radius: 10px; display: flex; flex-direction: column; gap: 5px; }
.blogCommentHeader { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.blogCommentAuthor { font-size: 13px; font-weight: 700; color: var(--primary); }
.blogCommentTime { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.blogCommentBody { margin: 0; font-size: 13.5px; line-height: 1.55; color: #374151; word-break: break-word; }
.blogCommentForm { display: flex; gap: 8px; align-items: flex-end; }
.blogCommentInput {
  flex: 1; border-radius: 10px; border: 1.5px solid var(--border); background: #fff;
  padding: 9px 12px; font-size: 14px; line-height: 1.5; color: var(--primary);
  font-family: inherit; outline: none; resize: none; transition: border-color 0.15s;
}
.blogCommentInput:focus { border-color: var(--accent); }
.blogCommentSubmit {
  height: 38px; padding: 0 16px; border-radius: 10px; border: none;
  background: var(--accent, #3b82f6); color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.blogCommentSubmit:hover { background: #2563eb; }
.blogCommentSubmit:disabled { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 768px) {
  .blogListPage { padding-top: calc(var(--nav-height) + 8px); }
  .blogPostLayout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .blogPostGallery { position: static; height: 55vw; max-height: 340px; }
  .blogPostContent { overflow: visible; }
  .blogPostContentScroll { overflow: visible; padding: 16px 16px 40px; }
  .blogPostTitle { font-size: 17px; }
  .blogPostBody { font-size: 14px; }
}
