/* Lightbox 暗黑电竞风格样式 */

/* Lightbox遮罩层 */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 10, 0.45);
  backdrop-filter: blur(2px);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

/* Lightbox容器 */
.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Lightbox图片 */
.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 28px rgba(34, 211, 238, 0.16),
    0 0 42px rgba(251, 113, 133, 0.12);
  background: rgba(5, 7, 10, 0.24);
  padding: 8px;
}

/* Lightbox关闭按钮 */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #e5e7eb;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10000;
}

.lightbox-close:hover {
  background: rgba(251, 113, 133, 0.2);
  border-color: rgba(251, 113, 133, 0.4);
  transform: scale(1.1);
}

/* Lightbox导航按钮 */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #e5e7eb;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10000;
}

.lightbox-nav:hover {
  background: rgba(34, 211, 238, 0.2);
  border-color: rgba(34, 211, 238, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

.lightbox-nav.hidden {
  display: none;
}

/* Lightbox标题条 */
.lightbox-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(5, 7, 10, 0.78), rgba(5, 7, 10, 0.40));
  backdrop-filter: blur(4px);
  padding: 16px 20px;
  color: #e5e7eb;
  text-align: center;
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10000;
}

/* 文章内图片样式增强 */
.post-content figure {
  margin: 24px 0;
  text-align: center;
}

.post-content figure img,
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(34, 211, 238, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  display: block;
  margin: 0 auto;
}

/* --- 正文媒体图：默认清晰但不霸屏（解除锁死限制） --- */
.post-content figure.kb-media img {
  max-width: 960px !important;
  width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
}

/* --- 高信息密度图：更大更清晰（图1/2/3专用） --- */
.post-content figure.kb-media.kb-media-hi img {
  max-width: 1100px !important;
  width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
}

@media (max-width: 768px) {
  .post-content figure.kb-media img,
  .post-content figure.kb-media.kb-media-hi img {
  max-width: 92vw !important;
  width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
}
}

.post-content figure img:hover,
.post-content img:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(34, 211, 238, 0.2);
}

/* 图片caption overlay（悬停显示） */
.post-content figure {
  position: relative;
}

.post-content figure::after {
  content: attr(data-caption);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(5, 7, 10, 0.95), rgba(5, 7, 10, 0.7));
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  color: #e5e7eb;
  font-size: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 0 0 8px 8px;
}

.post-content figure:hover::after {
  opacity: 1;
}

/* 单独img的caption overlay（通过alt属性） */
.post-content img[alt]:not([alt=""]) {
  position: relative;
}

.post-content img[alt]:not([alt=""]):hover::after {
  content: attr(alt);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(5, 7, 10, 0.95), rgba(5, 7, 10, 0.7));
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  color: #e5e7eb;
  font-size: 12px;
  text-align: center;
  border-radius: 0 0 8px 8px;
  pointer-events: none;
  z-index: 10;
}

/* 封面图样式 */
.cover {
  margin: 24px 0;
  text-align: center;
}

.cover img {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 12px;
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(34, 211, 238, 0.15);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .lightbox-image {
    max-width: 95vw;
    max-height: 80vh;
  }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .lightbox-nav.prev {
    left: 10px;
  }
  
  .lightbox-nav.next {
    right: 10px;
  }
  
  .lightbox-caption {
    padding: 12px 16px;
    font-size: 13px;
  }
}

/* --- kb-media figcaption 可见性保证（任务2修复） --- */
.post-content figure.kb-media {
  margin: 14px auto !important;
  text-align: center !important;
}

.post-content figure.kb-media figcaption.kb-credit {
  display: block !important;
  margin-top: 10px !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: rgba(229, 231, 235, 0.75) !important;
  text-align: center !important;
  font-style: normal !important;
  overflow: visible !important;
  white-space: normal !important;
}

@media (max-width: 768px) {
  .post-content figure.kb-media figcaption.kb-credit {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
}





/* --- kb video (article body) --- */
.post-content figure.kb-media video.kb-video {
  display: block;
  width: 100%;
  max-width: 860px;
  margin: 12px auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
  .post-content figure.kb-media video.kb-video {
    max-width: 92vw;
    margin: 12px auto;
  }
}

/* --- lightbox video --- */
.lightbox-video {
  max-width: 96vw !important;
  max-height: 88vh !important;
  width: auto !important;
  height: auto !important;
  border-radius: 12px;
  object-fit: contain;
}

/* Center video in kb-media */
.post-content figure.kb-media { margin: 16px auto; }
.post-content figure.kb-media a.lightbox { display: block; }
.post-content figure.kb-media video.kb-video{
  display: block;
  width: 100%;
  max-width: 860px; /* 可读性优先，必要时可上调到 960 */
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
  background: #000;
}
@media (max-width: 768px){
  .post-content figure.kb-media video.kb-video{ max-width: 92vw; }
}

/* --- FORCE center for kb-media (img + video) --- */
.post-content figure.kb-media{
  width: 100%;
  display: flex;               /* 不管原来是不是 flex，都统一成列布局 */
  flex-direction: column;
  align-items: center;          /* 居中整个内容块 */
}

.post-content figure.kb-media > a.lightbox{
  width: 100%;
  display: flex;                /* 关键：让 a 占满整行并居中内部内容 */
  justify-content: center;
}

.post-content figure.kb-media > a.lightbox > img,
.post-content figure.kb-media > a.lightbox > video.kb-video{
  display: block;
  width: 100%;
  max-width: 860px;             /* 可读性优先，必要时可调到 960 */
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
}

.post-content a.lightbox video {
  cursor: pointer;
}

/* caption 也跟随同宽，避免"图在中间字幕跑左边" */
.post-content figure.kb-media > figcaption.kb-credit{
  width: 100%;
  max-width: 860px;
}

@media (max-width: 768px){
  .post-content figure.kb-media > a.lightbox > img,
  .post-content figure.kb-media > a.lightbox > video.kb-video,
  .post-content figure.kb-media > figcaption.kb-credit{
    max-width: 92vw;
  }
}
