/* 相册：文件夹分类、图片网格与灯箱。 */

.阅读区:has(.相册页) {
  width: min(1440px, 96vw);
}

.相册页 {
  width: 100%;
}

.相册头 h1 {
  margin: 0.2rem 0 0.4rem;
  font-size: 1.9rem;
}

.相册头夹 .面包屑 {
  margin: 0;
}

/* ---------- 文件夹卡片 ---------- */

.相册文件夹们 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
  margin-top: 1.2rem;
}

.相册文件夹 {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
}

.相册封面 {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.8rem;
  background: rgba(128, 128, 128, 0.12);
}

.相册封面 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.相册文件夹:hover .相册封面 img {
  transform: scale(1.05);
}

.相册空封面 {
  opacity: 0.45;
  font-size: 0.9rem;
}

.相册夹名 {
  font-size: 1rem;
  font-weight: 600;
}

.相册夹数 {
  font-size: 0.78rem;
  opacity: 0.65;
}

.相册夹卡 {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.相册夹分享 {
  align-self: flex-start;
}

.相册分享栏 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.6rem 0 0;
}

.相册页.选图中 .相册图 {
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.相册图.选中 {
  outline: 2px solid #7c6af2;
  outline-offset: 2px;
}

.相册图.选中::after {
  content: "✓";
  position: absolute;
  right: 0.35rem;
  top: 0.35rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #7c6af2;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.35rem;
  text-align: center;
}

.相册分享罩 {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
}

.相册分享罩[hidden] {
  display: none;
}

.相册分享框,
.相册分享开锁 {
  width: min(26rem, 100%);
  display: grid;
  gap: 0.7rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border-radius: 0.9rem;
  background: var(--fallback-b1, #fff);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

.相册分享框 h2 {
  margin: 0;
  font-size: 1.15rem;
}

.相册分享项 {
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
}

#相册引用链们 {
  min-height: 6rem;
  max-height: 12rem;
  resize: vertical;
}

.相册分享项[hidden],
.相册分享结果[hidden],
.相册分享错[hidden] {
  display: none;
}

.相册分享勾 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
}

.相册分享动作 {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.相册分享结果 {
  display: grid;
  gap: 0.5rem;
}

.相册分享错 {
  margin: 0;
  color: #e5484d;
  font-size: 0.82rem;
}

.相册分享开锁 {
  margin: 1.2rem 0 2rem;
}

.相册空 {
  opacity: 0.6;
  padding: 1.4rem 0;
}

/* ---------- 图片网格 ---------- */

.相册筛选 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
}

.相册筛选[hidden] {
  display: none;
}

.相册筛选 button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border: 1px solid rgba(128, 128, 128, 0.35);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.相册筛选 button.当前 {
  background: rgba(128, 128, 128, 0.22);
  border-color: transparent;
}

.相册筛数 {
  opacity: 0.55;
  font-size: 0.9em;
}

.相册空 {
  grid-column: 1 / -1;
  margin: 1.6rem 0;
  text-align: center;
  opacity: 0.65;
}

.相册格 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}

.相册图 {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0.55rem;
  background: rgba(128, 128, 128, 0.12);
  cursor: zoom-in;
}

.相册图 img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.相册图:hover img {
  transform: scale(1.05);
}

.相册图.视频 {
  cursor: pointer;
}

.相册播标 {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.4rem;
  height: 2.4rem;
  margin: -1.2rem 0 0 -1.2rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.相册播标::after {
  content: "";
  position: absolute;
  left: 0.92rem;
  top: 0.68rem;
  border-style: solid;
  border-width: 0.52rem 0 0.52rem 0.82rem;
  border-color: transparent transparent transparent #fff;
}

.相册图签 {
  position: absolute;
  left: 0.35rem;
  bottom: 0.35rem;
  max-width: calc(100% - 0.7rem);
  padding: 0.08rem 0.42rem;
  overflow: hidden;
  border-radius: 0.35rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#相册文件提示 {
  position: fixed;
  z-index: 80;
  max-width: min(18rem, calc(100vw - 1.2rem));
  padding: 0.45rem 0.65rem;
  border-radius: 0.45rem;
  background: rgba(18, 18, 22, 0.94);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-line;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.相册更多 {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.4rem 0;
  min-height: 2.5rem;
}
.相册更多[hidden] {
  display: none;
}
.相册更多 #相册更多[hidden] {
  display: none !important;
}
.相册已完 {
  margin: 0;
  opacity: 0.62;
  font-size: 0.88rem;
}
.相册已完[hidden] {
  display: none;
}

.相册片错条 {
  margin: 0.9rem 0 0;
  color: #c62828;
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.相册片错条[hidden] {
  display: none;
}

.相册图.损坏 {
  outline: 2px solid #e24a4a;
  outline-offset: 1px;
}

.相册冷却 {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  border: 1px dashed rgba(128, 128, 128, 0.45);
  border-radius: 0.7rem;
}

/* ---------- 灯箱 ---------- */

.相册灯箱 {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  user-select: none;
  touch-action: manipulation;
}

.相册灯箱[hidden] {
  display: none;
}

.相册片错 {
  position: absolute;
  left: 50%;
  bottom: 6.8rem;
  z-index: 6;
  max-width: min(90vw, 40rem);
  margin: 0;
  padding: 0.5rem 0.85rem;
  transform: translateX(-50%);
  color: #ffc9c9;
  background: rgba(92, 14, 14, 0.86);
  border: 1px solid rgba(255, 130, 130, 0.45);
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}

.相册片错[hidden] {
  display: none;
}

.相册灯箱.背景-棋盘 {
  background-color: #ededed;
  background-image:
    linear-gradient(45deg, #d8d8d8 25%, transparent 25%, transparent 75%, #d8d8d8 75%),
    linear-gradient(45deg, #d8d8d8 25%, transparent 25%, transparent 75%, #d8d8d8 75%);
  background-position: 0 0, 18px 18px;
  background-size: 36px 36px;
}

.相册灯箱.背景-透明 {
  background: transparent;
}

.相册灯箱.背景-纯色 {
  background-color: #111;
}

.相册灯箱.背景-渐变 {
  background-color: var(--相册渐变一, #f0daa8);
  background-image: linear-gradient(
    135deg,
    var(--相册渐变一, #f0daa8) 0%,
    var(--相册渐变二, #d6a9ca) 50%,
    var(--相册渐变三, #aba9ea) 100%
  );
}

.相册灯箱.背景-透明::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.相册灯箱顶 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.28) 65%, transparent);
  font-size: 0.86rem;
  opacity: 0;
  transform: translateY(-0.6rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.相册灯箱.鼠标动 .相册灯箱顶,
.相册灯箱顶:hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.相册灯箱顶 .相册计数 {
  opacity: 0.75;
}

.相册图名 {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: min(46vw, 42rem);
  overflow: hidden;
  transform: translate(-50%, -50%);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.55);
}

.相册灯箱顶 .相册顶空 {
  flex: 1;
}

.相册灯箱顶,
.相册底栏 {
  touch-action: auto;
}

.相册灯箱顶 button {
  border: 0;
  border-radius: 0.45rem;
  padding: 0.3rem 0.6rem;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
}

.相册灯箱顶 button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.相册舞台 {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}

.相册大图 {
  display: block;
  max-width: none;
  max-height: none;
  transform-origin: center center;
  will-change: transform;
  cursor: grab;
  -webkit-user-drag: none;
}

.相册大图.拖动中 {
  cursor: grabbing;
}

.相册视频壳 {
  display: none;
  z-index: 1;
  position: relative;
  line-height: 0;
  touch-action: auto;
  pointer-events: auto;
}

.相册视频壳[hidden] {
  display: none !important;
}

.相册灯箱.播视频 .相册大图 {
  display: none;
}

.相册灯箱.播视频 .相册视频壳 {
  display: block;
}

.相册大视频 {
  display: block;
  max-width: none;
  max-height: none;
  background: #000;
  touch-action: auto;
  cursor: grab;
}

.相册视频壳.拖动中 .相册大视频 {
  cursor: grabbing;
}

.相册弹幕层 {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.相册弹幕 {
  position: absolute;
  left: 0;
  white-space: nowrap;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.45);
  will-change: transform;
}

.相册弹幕 img {
  height: 6em;
  max-width: none;
  vertical-align: -0.45em;
}

.相册箭头 {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 2.6rem;
  height: 4.2rem;
  margin-top: -2.1rem;
  border: 0;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.55;
}

.相册箭头:hover {
  opacity: 0.95;
}

.相册箭头.左 {
  left: 0.6rem;
}

.相册箭头.右 {
  right: 0.6rem;
}

/* 设置面板 */

.相册设置板 {
  position: absolute;
  top: 3.1rem;
  right: 0.9rem;
  z-index: 5;
  width: min(20rem, calc(100vw - 1.6rem));
  max-height: calc(100vh - 5rem);
  overflow: auto;
  padding: 0.9rem 1rem;
  border-radius: 0.8rem;
  background: rgba(18, 18, 18, 0.94);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.82rem;
  touch-action: auto;
  -webkit-overflow-scrolling: touch;
}

.相册设置板[hidden] {
  display: none;
}

.相册设置板 h3 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}

.相册设置板 label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0.45rem 0;
}

.相册设置板 select,
.相册设置板 input[type="range"] {
  width: 55%;
}

.相册设置板 select {
  padding: 0.2rem 0.3rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #222;
  color: #fff;
}

.相册设置板 input[type="color"] {
  width: 3rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.相册速度组 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 55%;
}

.相册速度组 input[type="range"] {
  flex: 1;
  min-width: 0;
  width: auto;
}

.相册速度值 {
  flex: 0 0 auto;
  min-width: 4.6em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.相册设置板 .相册设置脚 {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.相册设置板 .相册设置脚 button {
  flex: 1;
  padding: 0.35rem;
  border: 0;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}

/* 底栏：评论与胶卷 */

.相册底栏 {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 0.4rem 0.9rem 0.6rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.相册灯箱.鼠标动 .相册底栏,
.相册底栏:hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.相册评论条 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 60rem;
  margin: 0 auto 0.4rem;
}

.相册评论条 input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.45rem;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 0.85rem;
}

.相册评论条 .btn,
.相册评论条 button {
  padding: 0.4rem 0.8rem;
  border: 0;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
}

.相册评论条 .相册提示 {
  opacity: 0.75;
}

.相册灯箱.藏胶卷 .相册底栏 {
  display: none;
}

.相册胶卷 {
  display: flex;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.25rem 0.2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.相册胶卷图 {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 48px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  opacity: 0.7;
}

.相册胶卷图 .相册播标 {
  width: 1.35rem;
  height: 1.35rem;
  margin: -0.675rem 0 0 -0.675rem;
}

.相册胶卷图 .相册播标::after {
  left: 0.5rem;
  top: 0.36rem;
  border-width: 0.3rem 0 0.3rem 0.48rem;
}

.相册胶卷图 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.相册胶卷图.当前 {
  border-color: #fff;
  opacity: 1;
}

/* 表情面板（灯箱内与评论共用基础样式在 表情.css） */
.相册表情挂载 {
  position: relative;
}

@media (max-width: 720px) {
  .相册格 {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  }

  .相册灯箱顶 {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: max(0.55rem, env(safe-area-inset-top)) 0.7rem 0.55rem;
  }

  .相册图名 {
    position: static;
    max-width: none;
    flex: 1 1 100%;
    order: 8;
    transform: none;
    text-align: center;
  }

  .相册灯箱顶 button {
    min-height: 2.2rem;
    padding: 0.4rem 0.65rem;
  }

  .相册箭头 {
    width: 2.2rem;
    height: 3.6rem;
    margin-top: -1.8rem;
    font-size: 1.25rem;
  }

  .相册箭头.左 {
    left: max(0.35rem, env(safe-area-inset-left));
  }

  .相册箭头.右 {
    right: max(0.35rem, env(safe-area-inset-right));
  }

  .相册设置板 {
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: min(72vh, 34rem);
    border-radius: 0.9rem 0.9rem 0 0;
    padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
  }

  .相册底栏 {
    padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
  }

  .相册评论条 {
    max-width: none;
  }

  .相册胶卷图 {
    width: 52px;
    height: 40px;
  }
}

@media (hover: none) {
  .相册箭头 {
    display: block;
    opacity: 0.8;
  }
}
