/* Video styling for course notes (see 注意事项.md) */
video {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 1rem 0;
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 图片居中显示 */
.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;
}

table img {
  max-width: 300px;
  height: auto;
}

img[src$=".gif"] {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   glightbox 长图注样式 - 确保完整显示
   ============================================ */

/* 图注容器 - 允许更大高度和滚动 */
.glightbox-container .gslide-description,
.gslide-description {
  max-height: 50vh !important;
  min-height: auto !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 1rem 1.5rem !important;
  box-sizing: border-box !important;
}

/* 图注内容 - 允许换行 */
.glightbox-container .gdesc-inner,
.gdesc-inner {
  max-width: 95vw !important;
  width: 100% !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  line-height: 1.7 !important;
  font-size: 0.9rem !important;
  text-align: justify !important;
}

/* 图注标题 - 允许换行 */
.glightbox-container .gslide-title,
.gslide-title {
  white-space: normal !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  text-align: justify !important;
  max-width: 95vw !important;
  width: 100% !important;
  line-height: 1.6 !important;
  margin-bottom: 0.5rem !important;
}

/* 整个灯箱描述区域 */
.glightbox-container .gslide-desc,
.gslide-desc {
  max-width: 95vw !important;
  padding: 0 !important;
}

/* 移除可能的文本截断 */
.glightbox-container .gslide-description *,
.gslide-description * {
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  display: block !important;
}

/* 滚动条样式 */
.gslide-description::-webkit-scrollbar {
  width: 6px;
}

.gslide-description::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.gslide-description::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.gslide-description::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
