/* =============================================================
   五岔 · 云匣子 · 图片查看器 / 视频播放器
   FLIP 放大 · 滚轮缩放 · 左右切换 · 胶片条
   ============================================================= */

.viewer {
  position: fixed;
  inset: 0;
  z-index: var(--z-viewer);
  overflow: hidden;
  background: rgba(6, 10, 22, 0);
  /* 只过渡 background。
     之前把 backdrop-filter 也放进 transition，等于每帧重算全屏模糊，
     是打开大图卡顿的主因之一；而且虚拟/低端 GPU 上尤其明显。 */
  transition: background var(--dur-4) var(--ease);
  animation: fade-in var(--dur-2) var(--ease) backwards;
}

.viewer.is-ready {
  background: rgba(6, 10, 22, 0.9);
}

.viewer.is-closing {
  background: rgba(6, 10, 22, 0);
}

/* ---------- 舞台：FLIP 变换的唯一载体 ---------- */
.vstage {
  position: fixed;
  transform-origin: 0 0;
  will-change: transform;
  overflow: visible;
}

.vstage.is-animating-in {
  transition: transform var(--dur-5) cubic-bezier(0.16, 0.84, 0.24, 1);
}

.vstage.is-animating-out {
  transition: transform var(--dur-4) var(--ease), opacity var(--dur-4) var(--ease);
}

.vmedia {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  display: grid;
  place-items: center;
}

.vmedia img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 0;
  transition: opacity var(--dur-4) var(--ease);
}

.vstage.is-round img,
.vstage.is-round .vblur {
  border-radius: 12px;
}

/* 缩略图占位（秒开体验） */
.vblur {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  /* 占位图本身已经是放大的低清缩略图，浏览器缩放时自带插值柔化，
     所以这里只需要很轻的模糊 —— 原来是 14px，全屏卷积不算便宜。 */
  filter: blur(7px) saturate(140%);
  transform: scale(1.02);
  opacity: 1;
  transition: opacity var(--dur-5) var(--ease);
  pointer-events: none;
}

.vblur.is-hidden {
  opacity: 0;
}

.vspin {
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -14px 0 0 -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.22);
  border-top-color: rgba(255, 255, 255, 0.9);
  animation: spin 0.75s linear infinite;
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}

.vspin.is-on {
  opacity: 1;
}

/* ---------- 顶部信息条 ---------- */
.viewer-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: linear-gradient(rgba(6, 10, 22, 0.72), rgba(6, 10, 22, 0));
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
  pointer-events: none;
}

.viewer.is-chrome .viewer-bar,
.viewer.is-chrome .viewer-foot,
.viewer.is-chrome .vnav {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.vbar-info {
  flex: 1 1 auto;
  min-width: 0;
  color: #fff;
}

.vbar-name {
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.vbar-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.66);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.vbar-meta .m {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vbar-meta svg {
  width: 12px;
  height: 12px;
}

.vbtn {
  flex: 0 0 auto;
  height: 36px;
  min-width: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--r-full);
  background: rgba(18, 20, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-back),
    border-color var(--dur-2) var(--ease);
}

.vbtn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1.5px);
}

.vbtn:active {
  transform: scale(0.95);
  transition-duration: var(--dur-instant);
}

.vbtn svg {
  width: 16px;
  height: 16px;
}

.vbtn.is-primary {
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: var(--brand-glow);
  padding: 0 15px;
}

.vbtn.is-primary:hover {
  box-shadow: 0 10px 26px rgba(74, 108, 140, 0.5);
}

/* ---------- 左右切换箭头 ---------- */
.vnav {
  position: fixed;
  top: 50%;
  z-index: 4;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(18, 20, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease), background var(--dur-2) var(--ease),
    transform var(--dur-3) var(--ease-back);
}

.vnav:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: scale(1.08);
}

.vnav:active {
  transform: scale(0.94);
  transition-duration: var(--dur-instant);
}

.vnav svg {
  width: 22px;
  height: 22px;
}

.vnav.prev { left: 22px; }
.vnav.next { right: 22px; }

.vnav[disabled] {
  opacity: 0.18 !important;
  pointer-events: none;
}

/* ---------- 底部：索引 / 缩略图条 / 缩放 ---------- */
.viewer-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(rgba(6, 10, 22, 0), rgba(6, 10, 22, 0.78));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
  pointer-events: none;
}

.vindex {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 15px;
  border-radius: var(--r-full);
  background: rgba(18, 20, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.vindex .cur {
  font-size: 15px;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vindex .sep {
  opacity: 0.4;
}

.vindex .total {
  opacity: 0.7;
}

.vzoom {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: var(--r-full);
  background: rgba(18, 20, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
}

.vzoom button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-back);
}

.vzoom button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.vzoom button:active {
  transform: scale(0.9);
  transition-duration: var(--dur-instant);
}

.vzoom button svg {
  width: 15px;
  height: 15px;
}

.vzoom .pct {
  min-width: 54px;
  text-align: center;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* ---------- 胶片条 ---------- */
.filmstrip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: min(880px, 92vw);
  padding: 8px;
  border-radius: var(--r-l);
  background: rgba(18, 20, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.filmstrip::-webkit-scrollbar {
  display: none;
}

.film {
  position: relative;
  flex: 0 0 auto;
  width: 58px;
  height: 44px;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  opacity: 0.52;
  transform: scale(0.94);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--ease-back),
    box-shadow var(--dur-2) var(--ease);
}

.film img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film:hover {
  opacity: 0.9;
  transform: scale(1) translateY(-2px);
}

.film:active {
  transform: scale(0.94);
  transition-duration: var(--dur-instant);
}

.film.is-active {
  opacity: 1;
  transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--brand-1), 0 6px 16px rgba(0, 0, 0, 0.4);
}

.film .f-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.film .f-play svg {
  width: 14px;
  height: 14px;
}

/* ---------- 视频播放器 ---------- */
.vplayer {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: inherit;
  overflow: hidden;
  /* ★ 用 grid 居中：播放按钮是普通流元素，之前容器是块级，
     它就贴到了左上角。海报层是 absolute，不参与居中布局。 */
  display: grid;
  place-items: center;
}

.vplayer video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.vplayer-poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
}

.vplayer-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.55));
}

.vplay-btn {
  position: relative;
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-ink);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  transition: transform var(--dur-3) var(--ease-back), box-shadow var(--dur-3) var(--ease);
}

.vplay-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55);
}

.vplay-btn svg {
  width: 20px;
  height: 20px;
  margin-left: 3px;
}

/* 视频画质提示：放在 viewer-foot 的流式布局里参与排布。
   ⚠ 之前用 position:absolute + bottom:16px，会压在索引/缩放控件上面（组件重叠）。
   现在它是 footer 这个纵向 flex 的普通子项，永远与其它元素错开。 */
.vplayer-tip {
  max-width: 92%;
  background: rgba(255, 255, 255, 0.94);
  color: #a15c00;
  border-color: rgba(240, 140, 0, 0.3);
  box-shadow: var(--shadow-m);
}

/* ---------- 打开/关闭时的页面压暗 ---------- */
@media (max-width: 860px) {
  .filmstrip {
    display: none;
  }
  .vnav {
    width: 44px;
    height: 44px;
    margin-top: -22px;
  }
  .vnav.prev { left: 10px; }
  .vnav.next { right: 10px; }
}

/* =============================================================
   可拖动的分段进度条
   （在线播放按需分段加载：缓冲只领先播放位置几秒，不整条下载）
   ============================================================= */
.vseek {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 10px 16px 12px;
  background: linear-gradient(180deg, rgba(6, 6, 12, 0) 0%, rgba(6, 6, 12, 0.72) 62%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
}

.vplayer:hover .vseek,
.vseek.is-seeking {
  opacity: 1;
  transform: none;
}

.vseek-time {
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 650;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.vseek-track {
  position: relative;
  height: 16px;
  cursor: pointer;
  touch-action: none;
  display: flex;
  align-items: center;
}

/* 轨道底 */
.vseek-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.26);
}

/* 已缓冲段：比已播放段更浅，一眼能看出"下到哪了" */
.vseek-buf {
  position: absolute;
  left: 0;
  height: 5px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.42);
  transition: width var(--dur-2) linear;
}

/* 已播放段：强调色 */
.vseek-fill {
  position: absolute;
  left: 0;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--brand-1);
}

.vseek-thumb {
  position: absolute;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  transform: scale(0.7);
  transition: transform var(--dur-2) var(--ease-back);
}

.vseek-track:hover .vseek-thumb,
.vseek.is-seeking .vseek-thumb {
  transform: scale(1.15);
}

.vseek-hint {
  margin-top: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
}

.vseek-hint em {
  margin-left: 6px;
  font-style: normal;
  color: rgba(255, 255, 255, 0.48);
}
/* =============================================================
   文档在线预览（PDF / 文本 / Office / 音频 / 兜底）
   每条路径都刻意只取需要的部分，不整份下载
   ============================================================= */
.vdoc {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
}

.vdoc-frame {
  padding: 0;
  background: #fff;
}

.vdoc-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.vdoc-text,
.vdoc-office {
  align-items: stretch;
  justify-content: flex-start;
  padding: 8px;
}

.vdoc-text pre,
.md-body {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 22px 26px;
  overflow: auto;
  border-radius: var(--r-m);
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

/* Markdown 渲染后的排版 */
.md-body {
  display: block;
  overflow: auto;
}

.md-body h1,
.md-body h2,
.md-body h3,
.md-body h4 {
  margin: 22px 0 10px;
  color: #14121c;
  line-height: 1.35;
}

.md-body h1 {
  margin-top: 0;
  padding-bottom: 12px;
  font-size: 25px;
  font-weight: 800;
  border-bottom: 1px solid rgba(20, 18, 28, 0.12);
}

.md-body h2 {
  font-size: 19px;
  font-weight: 750;
}

.md-body h3 {
  font-size: 16px;
  font-weight: 700;
}

.md-body p {
  margin: 10px 0;
}

.md-body blockquote {
  margin: 14px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--brand-1);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  background: rgba(41, 105, 255, 0.07);
  color: #3a3550;
}

/* ⚠ base.css 里有全局的 list-style: none（界面用的列表不需要符号），
   Markdown 正文里必须显式恢复，否则编号和项目符号全丢。 */
.md-body ul,
.md-body ol {
  margin: 10px 0;
  padding-left: 28px;
}

.md-body ul {
  list-style: disc;
}

.md-body ol {
  list-style: decimal;
}

.md-body ul ul {
  list-style: circle;
}

.md-body li {
  margin: 5px 0;
}

.md-body li::marker {
  color: var(--brand-1);
  font-weight: 700;
}

.md-body code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(41, 105, 255, 0.1);
  color: #2b3fd6;
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.md-body pre.md-code {
  margin: 14px 0;
  padding: 16px 18px;
  border-radius: var(--r-s);
  background: #14121c;
  color: #e6e3ee;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow: auto;
  white-space: pre;
}

.md-body pre.md-code code {
  padding: 0;
  background: none;
  color: inherit;
}

.md-body hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid rgba(20, 18, 28, 0.12);
}

.md-body a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.md-body strong {
  font-weight: 750;
  color: #14121c;
}

.vdoc-office img {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--r-s);
  background: #fff;
  box-shadow: var(--shadow-l);
}

/* ⚠ 这里原来有 .vdoc-pager / .vdoc-pager .icon-btn / :hover 三条，
   是那个「1 / 1」假翻页器的样式。2026-10-08 翻页器删掉后它们再没有落点，
   一并删除（不是留着"以后可能用"—— 留着就是死样式，工具也会报）。 */

.vdoc-note {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: var(--r-full);
  background: rgba(10, 10, 18, 0.6);
  color: rgba(255, 255, 255, 0.78);
  font-size: 11.5px;
  white-space: nowrap;
}

.vdoc-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

.vdoc-state.is-error {
  color: #ffb3ac;
}

.vdoc-state svg {
  width: 20px;
  height: 20px;
}

.vdoc-none .btn {
  margin-top: 4px;
}

/* =============================================================
   ★ 在线查看压缩包（ZIP）的内容清单
   查看器是深色的，这里跟着用半透明浅色卡片，保证可读性。
   ============================================================= */
.vdoc-zip {
  width: min(760px, 92vw);
  max-height: 74vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zip-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 8px;
  width: 100%;
}

.zip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding: 10px 14px;
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.zip-head b {
  color: #fff;
  font-size: 13px;
}

.zip-list {
  min-height: 0;
  max-height: 56vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: var(--r-s);
  background: rgba(255, 255, 255, 0.06);
}

.zip-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.zip-item:last-child {
  border-bottom: 0;
}

.zip-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.zip-item.is-dir {
  color: #ffd79a;
  font-weight: 650;
}

.zip-item svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.zip-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
}

.zip-size {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11.5px;
}

/* 音频 */
.vdoc-audio-art {
  width: 132px;
  height: 132px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--brand-glow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.vdoc-audio-art svg {
  width: 52px;
  height: 52px;
}

.vdoc-audio-name {
  max-width: 70%;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vdoc-audio audio {
  width: min(520px, 76%);
}