/* KaTeX 公式的站点化样式：正文里的行内/独立公式与暗色主题 */

.math--inline {
  font-size: 1.02em;
}

.article-content .math--inline .katex {
  font-size: 1.02em;
}

.article-content .math--block {
  margin: 1.9em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}

.article-content .math--block .katex-display {
  margin: 0;
}

.article-content .math--block .katex {
  font-size: 1.06em;
}

/* 窄屏时公式横向滚动，避免撑破正文栏宽 */
@media (max-width: 640px) {
  .article-content .math--block {
    margin: 1.5em -4px;
  }

  .article-content .math--block .katex {
    font-size: 1em;
  }
}

/* 暗色主题下 KaTeX 的分数线/根号描边跟随文字色 */
[data-theme="dark"] .katex .frac-line,
[data-theme="dark"] .katex .sqrt > .root,
[data-theme="dark"] .katex .overline .overline-line,
[data-theme="dark"] .katex .underline .underline-line,
[data-theme="dark"] .katex .hline {
  border-color: currentColor;
}

.katex-error {
  color: var(--brand);
}

/* B 站视频卡片：先显示封面，点了才加载官方播放器 */
.article-content .video-embed {
  margin: 2em 0;
}

.video-embed__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-mute);
}

.video-embed__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-embed__cover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.video-embed__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.4s var(--ease), filter 0.3s var(--ease);
}

.video-embed__cover:hover img {
  transform: scale(1.02);
  filter: brightness(0.92);
}

.video-embed__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62px;
  height: 62px;
  margin: -31px 0 0 -31px;
  border-radius: 50%;
  background: rgba(18, 18, 22, 0.62);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px rgba(10, 10, 12, 0.28);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}

.video-embed__play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  margin: -11px 0 0 -6px;
  border-style: solid;
  border-width: 11px 0 11px 19px;
  border-color: transparent transparent transparent #fff;
}

.video-embed__cover:hover .video-embed__play {
  transform: scale(1.06);
  background: var(--brand);
}

.video-embed__time {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(10, 10, 12, 0.72);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.video-embed__meta {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
}

.article-content .video-embed__meta {
  margin-top: 10px;
  font-size: 13px;
  text-align: left;
  color: var(--text-3);
}

.video-embed__title {
  display: block;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
}

.video-embed__title:hover {
  color: var(--brand);
}

.video-embed__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 12.5px;
}

.video-embed__sub a {
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.video-embed__sub a:hover {
  color: var(--brand);
}

.video-embed__sub .dot {
  width: 3px;
  height: 3px;
  background: var(--border-strong);
}
