/* Responsive video container for iframes and HTML5 video */
.video-container {
  position: relative;
  width: 100%;
  padding-top: 0;
  /* 16:9 aspect ratio */
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1em 0;
  border-radius: 6px;
  background: #000;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Ensure plain <video> without container still looks reasonable */
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== 图片居中显示 ===== */
.md-content img:not(.twemoji):not(.emoji) {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 1rem auto;
}

.md-content p > img {
  display: block;
  margin: 1rem auto;
}

article img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* ===== 长图注样式 - 允许换行和滚动 ===== */
.glightbox-container .gslide-description {
  max-height: 40vh;  /* 最多占屏幕高度的40% */
  overflow-y: auto;  /* 超长时可滚动 */
  padding: 1rem 2rem;
}

.glightbox-container .gdesc-inner {
  max-width: 90vw;  /* 最大宽度为屏幕的90% */
  white-space: normal;  /* 允许换行 */
  word-wrap: break-word;
  line-height: 1.6;
  font-size: 0.95rem;
}

.glightbox-container .gslide-title {
  white-space: normal;
  word-wrap: break-word;
  text-align: justify;
  max-width: 90vw;
}

