.layout-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  box-sizing: border-box;
}

/* 左側 */
.scoop-channel {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  align-self: flex-start;
}

.left-scroll {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-right: 4px;
}

.channel-header {
    position: sticky;
    top: 48px;
    z-index: 60;
    background: #252525;
    padding: 12px 0;
    margin: 0 -3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.channel-menu-btn {
  background-color: unset;
  flex-shrink: 0;
}
.channel-menu-btn > i {
  width: 40px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.channel-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background: #3a3a3a;
  z-index: 9999;
  transform: translateX(100%);
  transition: 0.3s;
  display: flex;
  flex-direction: column;
}

.channel-drawer.show {
  transform: translateX(0);
}

.channel-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}
.channel-drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.channel-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #252525;
}

.channel-drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS 滑動更順 */
}

.channel-drawer-close {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.channel-thumb {
  width: 70px;
  height: 70px;
}

.channel-info {
  position: relative;
}

.channel-item {
  padding: 8px 4px;
  border-radius: 10px;
  cursor: pointer;
}

.channel-badge {
  position: absolute;
  border-radius: 1rem;
  width: 1.3rem;
  height: 1.3rem;
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.3rem;
  bottom: 5px;
  right: 0px;
}

.channel-item:hover {
  background: #3c3c3c;
}

/* 中間主內容 */
.scoop-main {
  flex: 1;
  min-width: 0;
  max-width: 820px;
  width: 100%;
  padding: 12px 16px;
  margin-top: 48px;
  /* border-right: 1px solid #3c3c3c; */
}

/* 右側 */
.scoop-aside {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
}

.right-inner {
  margin-bottom: 1rem;
}

.aside-card {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
}

.stats-row {
  display: flex;
  justify-content: space-around;
  gap: 12px;
}

/* 文字太長不要撐爆 */
.min-w-0 {
  min-width: 0;
}

.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* 平板以下：右欄移上方、左欄隱藏 */
@media (max-width: 991px) {
  .layout-wrapper {
    flex-direction: column;
    gap: 16px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .scoop-main {
    max-width: 100%;
    border-right: 0;
    padding: 0;
  }

  .channel-header {
    top: 80.5px;
  }
}

.post-card {
  padding: 16px;
  box-shadow: 0 1px 3px rgb(85, 85, 85);
  background-color: #ffffff;
  border-radius: 5px;
  margin-bottom: 1rem;
}

.post-title {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
}

.post-content {
  margin-top: 0.5rem;
  color: #454545;
}
.post-meta {
  color: #666;
  font-size: 14px;
  text-align: right;
}
.preview-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.preview-video-placeholder {
  width: 100%;
  height: 100%;
  min-height: 180px;
  background: linear-gradient(135deg, #242424 0%, #111 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}

.preview-video-placeholder i {
  font-size: 42px;
}

.preview-video-placeholder span {
  font-size: 14px;
  font-weight: 700;
}

.preview-video-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 42px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  background: rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

/* 單張圖 */
.preview-layout.type-1 {
  display: block;
}

.preview-layout.type-1 .preview-item img,
.preview-layout.type-1 .preview-item video {
  width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 500px;
}

/* 兩張圖 */
.preview-layout.type-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.preview-layout.type-2 .preview-item {
  aspect-ratio: 1 / 1;
}

/* 三張圖 */
.preview-layout.type-3 {
  display: flex;
  gap: 12px;
}

.preview-layout.type-3 .main-column {
  flex: 2;
}

.preview-layout.type-3 .sub-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-layout.type-3 .preview-item {
  aspect-ratio: 1 / 1;
}

/* 四張以上 */
.preview-layout.type-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.preview-layout.type-4 .preview-item {
  aspect-ratio: 1 / 1;
}

.file-is-blur {
  filter: blur(8px);
  transform: scale(1.05);
}

.is-blur img,
.is-blur video,
.is-blur .preview-video-placeholder {
  filter: blur(2px);
  transform: scale(1.05);
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 讓 post-card 可點 */
.post-card {
  cursor: pointer;
}

/* 收藏頁面專用樣式 */

.tg-card {
  height: 260px;
  padding: 2rem;
}

.tg-collect-card {
  padding: 1.5rem;
  cursor: pointer;
}

.tg-card > .tg-avatar {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
}

.tg-collect-card > .tg-avatar {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.tg-card > .tg-avatar > img,
.tg-collect-card > .tg-avatar > img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

@media screen and (max-width: 430px) {
  .tg-card {
    height: 200px;
    padding: 1rem;
  }
  .tg-collect-card {
    padding: 1rem;
  }
  .tg-collect-card > .tg-avatar {
    width: 100px;
    height: 100px;
  }
  .channel-thumb {
    width: 60px;
    height: 60px;
  }
}

/* 燈箱 */
.tg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.tg-lightbox.hide-arrow .tg-lightbox-arrow {
  display: none;
}

.tg-lightbox.show {
  display: block;
}

.tg-lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.tg-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(90vw, 1000px);
  height: 85vh;
  margin: 7vh auto 0;
  display: flex;
  flex-direction: column;
  background: #111;
  border-radius: 16px;
  padding: 56px 70px 20px;
  box-sizing: border-box;
}

.tg-lightbox-close {
  position: absolute;
  top: 12px;
  right: 18px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}

.tg-lightbox-main {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tg-lightbox-image-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tg-lightbox-image-wrap img,
.tg-lightbox-image-wrap video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.tg-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tg-lightbox-arrow i {
  pointer-events: none;
}

.tg-lightbox-prev {
  left: -54px;
}

.tg-lightbox-next {
  right: -54px;
}

.tg-lightbox-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 4px;
  overflow-x: auto;
  flex-shrink: 0;
}

.tg-lightbox-thumb {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  opacity: 0.6;
  background: #222;
}

.tg-lightbox-thumb.active {
  border-color: #fff;
  opacity: 1;
}

.tg-lightbox-thumb img,
.tg-lightbox-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tg-lightbox-thumb i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;

  font-size: 18px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);

  pointer-events: none;
}

.tg-lightbox-thumb.video {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  position: relative;
}

.tg-lightbox-thumb.video i {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  background: rgba(0, 0, 0, 0.16);
  pointer-events: none;
}

.tg-lightbox-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  flex-shrink: 0;
}

.tg-collect-card {
  cursor: pointer;
}

@media (max-width: 768px) {
  .tg-lightbox-dialog {
    width: 94vw;
    height: 88vh;
    margin-top: 6vh;
    padding: 52px 48px 16px;
  }

  .tg-lightbox-prev {
    left: -40px;
  }

  .tg-lightbox-next {
    right: -40px;
  }

  .tg-lightbox-arrow {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .tg-lightbox-thumb {
    width: 60px;
    height: 60px;
  }
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0.5rem 0;
}

.photo-grid-item {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: #eee;
}

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== Lightbox 主容器：一定要垂直排列 ===== */
.tg-lightbox-dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-height: 90vh;
}

/* ===== 主圖區塊 ===== */
.tg-lightbox-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
}

/* 👉 這個是關鍵：避免被縮圖蓋住 */
.tg-lightbox-image-wrap {
  position: relative;
  max-width: 100%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}

/* 主圖 / video */
.tg-lightbox-image-wrap img,
.tg-lightbox-image-wrap video {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

/* ===== 縮圖列：強制在下面 ===== */
.tg-lightbox-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  justify-content: center;
  position: relative;
  z-index: 2; /* 比主圖高沒關係，但不會疊 */
}

/* 縮圖本體 */
.tg-lightbox-thumb {
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
}

/* 縮圖圖片 */
.tg-lightbox-thumb img,
.tg-lightbox-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* active */
.tg-lightbox-thumb.active {
  outline: 2px solid #fff;
}

.video-placeholder {
  position: relative;
  display: inline-block;
}

/* 影片封面圖 */
.video-placeholder img {
  display: block;
  width: 100%;
  height: auto;
}

/* 播放按鈕：重新壓回去 */
.video-play-btn,
.preview-video-badge {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   z-index: 3;
   width: 48px;
   height: 48px;
   display: flex;
   align-items: center;
   justify-content: center;
   border-radius: 50%;
   background: rgba(0, 0, 0, 0);
   color: #fff;
}

/* icon 放大一點 */
.video-play-btn i,
.preview-video-badge i {
  font-size: 22px;
}

/* hover 可選 */
.video-placeholder:hover .video-play-btn {
  background: rgba(0,0,0,0.7);
}

.fancybox-overlay {
    z-index: 20000 !important;
}

