/* ============================================================
   媒体查看器 —— 照片 / 视频
   桌面右侧信息栏，移动端底部抽屉
   ============================================================ */

.mv {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: #0E0C09;
  color: #F2ECE0;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
.mv.is-open { display: block; animation: mvIn 220ms var(--ease-out); }
@keyframes mvIn { from { opacity: 0 } to { opacity: 1 } }

.mv__backdrop { position: absolute; inset: 0; background: radial-gradient(120% 100% at 50% 0%, #1A1611 0%, #0A0906 100%); }

/* ---------- Bar ---------- */
.mv__bar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px 0 10px;
  z-index: 6;
  background: linear-gradient(to bottom, rgba(14,12,9,.92), rgba(14,12,9,0));
}
.mv__icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #EDE6D8;
  transition: background var(--t-1) var(--ease), opacity var(--t-1) var(--ease);
  flex: none;
}
.mv__icon:hover { background: rgba(242,236,224,.12); }
.mv__icon svg { width: 18px; height: 18px; }
.mv__head { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.mv__brand {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .14em;
  color: rgba(242,236,224,.9);
  white-space: nowrap;
}
.mv__file {
  font-size: 11px;
  letter-spacing: .04em;
  color: rgba(242,236,224,.38);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mv__tools { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.mv__counter {
  font-size: 12px;
  letter-spacing: .1em;
  color: rgba(242,236,224,.55);
  font-variant-numeric: tabular-nums;
  margin-right: 10px;
  white-space: nowrap;
}

/* ---------- Stage ---------- */
.mv__stage {
  position: absolute;
  inset: 62px 360px 84px 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  /* 手势全部交给 JS：pan-y 会让浏览器抢走横向滑动 */
  touch-action: none;
}
.mv__canvas {
  /* 用绝对定位撑满舞台：百分比高度在这里会被内容撑开，导致图片溢出被裁 */
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: transform 220ms var(--ease-out);
  will-change: transform;
}
.mv__canvas.is-zoomed { cursor: grab; }
.mv__img {
  /* 绝对定位铺满画布：grid 的 place-items:center 会让百分比高度失效 */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 260ms var(--ease);
  -webkit-user-drag: none;
  pointer-events: none;
}
.mv__img.is-on { opacity: 1; }
.mv__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: none;
}

.mv__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(242,236,224,.2);
  background: rgba(14,12,9,.42);
  backdrop-filter: blur(8px);
  color: #F2ECE0;
  z-index: 4;
  transition: all var(--t-2) var(--ease);
}
.mv__nav:hover { background: rgba(242,236,224,.14); border-color: rgba(242,236,224,.4); }
.mv__nav svg { width: 18px; height: 18px; }
.mv__nav--prev { left: 18px; }
.mv__nav--next { right: 18px; }
.mv__nav[disabled] { opacity: .18; pointer-events: none; }

.mv__spinner {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  pointer-events: none;
}
.mv__spinner.is-on { display: grid; }
.mv__spinner span {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(242,236,224,.18);
  border-top-color: rgba(242,236,224,.8);
  animation: mvSpin .8s linear infinite;
}
@keyframes mvSpin { to { transform: rotate(360deg) } }

/* ---------- Video player ---------- */
.mv__player {
  position: absolute;
  inset: auto 0 0 0;
  padding: 26px 18px 14px;
  display: none;
  z-index: 5;
  background: linear-gradient(to top, rgba(10,9,6,.9), rgba(10,9,6,.42) 55%, transparent);
  transition: opacity var(--t-2) var(--ease);
}
.mv__player.is-on { display: block; }
.mv__player.is-hide { opacity: 0; pointer-events: none; }

.mv__bigplay {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px; height: 68px;
  z-index: 3;
  border-radius: 50%;
  place-items: center;
  background: rgba(20,17,12,.55);
  border: 1px solid rgba(242,236,224,.3);
  backdrop-filter: blur(10px);
  color: #F7F1E4;
  transition: transform var(--t-2) var(--ease), opacity var(--t-2) var(--ease), background var(--t-2) var(--ease);
}
.mv__bigplay:hover { transform: scale(1.06); background: rgba(20,17,12,.72); }
.mv__bigplay svg { width: 24px; height: 24px; margin-left: 3px; }
.mv.is-video .mv__bigplay { display: grid; }
.mv.is-playing .mv__bigplay { opacity: 0; pointer-events: none; }
.mv.is-playing .mv__bigplay:hover { opacity: 0; }

.mv__controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mv__cbtn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #EDE6D8;
  flex: none;
  transition: background var(--t-1) var(--ease);
}
.mv__cbtn:hover { background: rgba(242,236,224,.14); }
.mv__cbtn svg { width: 17px; height: 17px; }
.mv__rate { width: auto; padding: 0 8px; border-radius: 3px; font-size: 11px; letter-spacing: .04em; }
.mv__time {
  font-size: 11px;
  color: rgba(242,236,224,.66);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  min-width: 34px;
  text-align: center;
}
.mv__track {
  position: relative;
  flex: 1;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.mv__track::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  border-radius: 2px;
  background: rgba(242,236,224,.2);
}
.mv__buffer, .mv__played {
  position: absolute;
  left: 0;
  height: 3px;
  border-radius: 2px;
  pointer-events: none;
}
.mv__buffer { background: rgba(242,236,224,.28); width: 0; }
.mv__played { background: var(--clay-soft); width: 0; }
.mv__knob {
  position: absolute;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #F7F1E4;
  transform: translate(-50%, 0);
  left: 0;
  pointer-events: none;
  box-shadow: 0 1px 6px rgba(0,0,0,.5);
}

/* ---------- Info ---------- */
.mv__info {
  position: absolute;
  inset: 62px 0 0 auto;
  width: 360px;
  border-left: 1px solid rgba(242,236,224,.1);
  background: #14110C;
  z-index: 5;
  display: flex;
  flex-direction: column;
}
.mv__infohandle { display: none; }
.mv__infobody {
  padding: 26px 26px 30px;
  overflow-y: auto;
  flex: 1;
}
.mv__state {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border: 1px solid rgba(242,236,224,.22);
  border-radius: 2px;
  font-size: 10px;
  letter-spacing: .12em;
  color: rgba(242,236,224,.6);
  text-transform: uppercase;
}
.mv__state.is-pub { border-color: rgba(201,122,94,.5); color: #DCA18C; }
.mv__title {
  font-size: 25px;
  line-height: 1.38;
  letter-spacing: .02em;
  margin: 14px 0 12px;
  color: #F6F0E3;
}
.mv__desc {
  font-size: 13px;
  line-height: 1.95;
  color: rgba(242,236,224,.62);
  margin-bottom: 18px;
}
.mv__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.mv__tags span {
  font-size: 10.5px;
  letter-spacing: .05em;
  color: rgba(242,236,224,.55);
  border: 1px solid rgba(242,236,224,.16);
  padding: 3px 8px;
  border-radius: 2px;
}
.mv__tags .is-album { border-color: rgba(201,122,94,.45); color: #DCA18C; }
.mv__meta { margin: 0; border-top: 1px solid rgba(242,236,224,.1); }
.mv__meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(242,236,224,.07);
  font-size: 11.5px;
}
.mv__meta dt { color: rgba(242,236,224,.38); letter-spacing: .05em; margin: 0; }
.mv__meta dd { margin: 0; color: rgba(242,236,224,.84); text-align: right; }
.mv__mono { font-family: var(--mono); font-size: 10.5px; }
.mv__note {
  margin-top: 18px;
  font-size: 10.5px;
  line-height: 1.75;
  color: rgba(242,236,224,.3);
  border-left: 1px solid rgba(242,236,224,.16);
  padding-left: 11px;
}

/* ---------- Strip ---------- */
.mv__strip {
  position: absolute;
  inset: auto 360px 0 0;
  height: 84px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 20px;
  overflow-x: auto;
  background: linear-gradient(to top, rgba(10,9,6,.9), rgba(10,9,6,.3));
  z-index: 4;
  scrollbar-width: none;
}
.mv__strip::-webkit-scrollbar { display: none; }
.mv__thumb {
  position: relative;
  width: 52px; height: 52px;
  flex: none;
  border-radius: 2px;
  overflow: hidden;
  opacity: .38;
  outline: 1px solid transparent;
  outline-offset: 1px;
  transition: opacity var(--t-1) var(--ease), outline-color var(--t-1) var(--ease), transform var(--t-1) var(--ease);
}
.mv__thumb img { width: 100%; height: 100%; object-fit: cover; }
.mv__thumb:hover { opacity: .78; }
.mv__thumb.is-on { opacity: 1; outline-color: #C97A5E; transform: translateY(-2px); }
.mv__thumbplay {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(10,9,6,.6);
  border: 1px solid rgba(242,236,224,.5);
}
.mv__thumbplay::after {
  content: "";
  position: absolute;
  left: 6px; top: 4px;
  border-left: 5px solid rgba(242,236,224,.9);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
}

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .mv__bar { height: 56px; gap: 8px; padding-right: 8px; }
  .mv__file { display: none; }
  .mv__stage { inset: 56px 0 64px 0; }
  .mv__nav { width: 40px; height: 40px; border: 0; background: rgba(14,12,9,.5); }
  .mv__nav--prev { left: 8px; }
  .mv__nav--next { right: 8px; }
  .mv__strip { display: none; }

  .mv__info {
    inset: auto 0 0 0;
    width: auto;
    height: 76vh;
    border-left: 0;
    border-top: 1px solid rgba(242,236,224,.14);
    border-radius: 14px 14px 0 0;
    transform: translateY(calc(100% - 64px));
    transition: transform 320ms var(--ease-out);
    box-shadow: 0 -20px 50px rgba(0,0,0,.5);
  }
  .mv__info.is-open { transform: translateY(0); }
  .mv__infohandle {
    display: grid;
    place-items: center;
    height: 64px;
    width: 100%;
    flex: none;
  }
  .mv__infobar {
    width: 38px; height: 4px;
    border-radius: 2px;
    background: rgba(242,236,224,.28);
  }
  .mv__infobody { padding: 4px 20px 32px; }
  .mv__title { font-size: 21px; margin: 10px 0 10px; }
  .mv__desc { font-size: 12.5px; line-height: 1.85; }
  .mv__player { padding: 20px 10px 10px; }
  .mv__controls { gap: 4px; }
  .mv__cbtn { width: 40px; height: 40px; }
  .mv__rate { display: none; }
  .mv__time { font-size: 10.5px; min-width: 30px; }
  .mv__bigplay { width: 60px; height: 60px; }
}

@media (max-width: 480px) {
  .mv__brand { display: none; }
  .mv__tools .mv__icon[data-act="zoomin"],
  .mv__tools .mv__icon[data-act="zoomout"] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mv__canvas, .mv__info, .mv__img { transition: none; }
}
