/* 文章正文里的图片 / 视频 / 附件：尺寸统一卡死，PC/平板/手机都适配 */
.art-img,
.art-media,
.art-file {
  max-width: 560px;
  margin: 16px auto;
  line-height: 0;
}

.art-img img {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
}

/* 正文里直接写的 <img> 也按同一规格收口 */
body > p > img,
body img:not(.am-none) {
  max-width: 560px;
  height: auto;
}

.art-media video {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  background: #000;
}

.art-file {
  line-height: 1.8;
}
.art-file a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid rgba(212, 165, 58, .5);
  border-radius: 8px;
  background: rgba(0, 0, 0, .28);
  color: #f3e7c9;
  text-decoration: none;
  word-break: break-all;
}
.art-file a:hover { border-color: rgba(248, 183, 0, .9); background: rgba(0, 0, 0, .42); }

/* B 站嵌入：固定 16:9 */
.art-embed {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 16px auto;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.art-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- 自绘视频控制条：左播放、中进度、右喇叭+最大化 ---- */
.am-wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  user-select: none;
}
.am-wrap video { border-radius: 0; }

.am-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .78));
  opacity: 1;
  transition: opacity .55s ease;
}
.am-wrap.is-idle .am-bar { opacity: .2; }

.am-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  box-shadow: 0 0 0 1px rgba(248, 183, 0, .45);
  color: #f8b700;
  font-size: 12px;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
}
.am-btn:hover { background: rgba(0, 0, 0, .7); }

/* 播放键用站点统一的金环播放图 */
.am-btn.am-play {
  position: relative;
  width: 34px;
  height: 34px;
  background-color: transparent;
  background-image: url("../img/video-play.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 34px 34px;
  box-shadow: none;
  font-size: 0;
  line-height: 0;
}
.am-btn.am-play:hover { background-color: transparent; transform: scale(1.06); }
.am-btn.am-play.is-playing {
  background-image: url("../img/video-pause.png");
  background-color: transparent;
  box-shadow: none;
}

.am-time {
  flex: 0 0 auto;
  min-width: 60px;
  font-size: 11px;
  color: #cbb98f;
  text-align: center;
  white-space: nowrap;
}

.am-progress {
  flex: 1 1 auto;
  min-width: 60px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #f8b700;
  background: transparent;
}

/* 喇叭 + 竖向音量滑杆 */
.am-vol-wrap { position: relative; flex: 0 0 auto; line-height: 0; }
.am-vol-wrap .am-btn { line-height: 26px; }
.am-vol-wrap .am-btn svg { vertical-align: middle; }
.am-vol-box {
  position: absolute;
  right: -2px;
  bottom: 34px;
  width: 30px;
  height: 96px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .82);
  box-shadow: 0 0 0 1px rgba(248, 183, 0, .45);
  display: none;
  text-align: center;
}
/* 图标与滑杆之间的透明过渡带，鼠标经过时不会触发离开 */
.am-vol-box::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 9px;
}
.am-vol-box.is-open { display: block; }
.am-vol {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 16px;
  margin: -8px 0 0 -39px;
  cursor: pointer;
  accent-color: #f8b700;
  background: transparent;
  transform: rotate(-90deg);
}

/* 最大化：整屏，等比缩放不拉伸 */
.am-wrap:fullscreen,
.am-wrap:-webkit-full-screen {
  max-width: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.am-wrap:fullscreen video,
.am-wrap:-webkit-full-screen video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
}
.am-wrap:fullscreen .am-bar,
.am-wrap:-webkit-full-screen .am-bar {
  left: 0;
  right: 0;
}

@media screen and (max-width: 750px) {
  .art-img, .art-media, .art-file, .art-embed, .am-wrap { max-width: 100%; }
  .art-img img, .art-media video { max-width: 100%; }
  .am-vol-wrap { display: none; }
  .am-bar { gap: 6px; padding: 6px 8px; }
  .am-btn.am-play { width: 30px; height: 30px; background-size: 30px 30px; }
  .am-time { min-width: 52px; }
}
