/* 相册书：贴边铺满，黑底白线，和外壳同一套像素外观。窄屏一页，宽屏两页并排。 */
:root {
  --z-album: 45;
}

.album {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-album);
  background: var(--black);
  color: var(--ink);
  touch-action: none;
}

/* 宽屏上书居中，两边是同一块黑底 */
.al-inner {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

.al-head {
  min-height: 44px;
}

.al-head .sys-close::after {
  right: -4px;
}

.al-head .sys-title {
  font-size: var(--fs-big);
  line-height: 24px;
  padding: 0;
}

.al-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.al-book {
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  -webkit-perspective: 900px;
  perspective: 900px;
}

.al-spread {
  display: flex;
  width: 100%;
  height: 100%;
}

.al-turn-next {
  -webkit-transform-origin: left center;
  transform-origin: left center;
  -webkit-animation: al-next 0.24s ease-out;
  animation: al-next 0.24s ease-out;
}

.al-turn-prev {
  -webkit-transform-origin: right center;
  transform-origin: right center;
  -webkit-animation: al-prev 0.24s ease-out;
  animation: al-prev 0.24s ease-out;
}

@-webkit-keyframes al-next {
  from { -webkit-transform: rotateY(-75deg); opacity: 0.2; }
  to { -webkit-transform: rotateY(0); opacity: 1; }
}

@keyframes al-next {
  from { transform: rotateY(-75deg); opacity: 0.2; }
  to { transform: rotateY(0); opacity: 1; }
}

@-webkit-keyframes al-prev {
  from { -webkit-transform: rotateY(75deg); opacity: 0.2; }
  to { -webkit-transform: rotateY(0); opacity: 1; }
}

@keyframes al-prev {
  from { transform: rotateY(75deg); opacity: 0.2; }
  to { transform: rotateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .al-turn-next, .al-turn-prev { -webkit-animation: none; animation: none; }
}

/* 一页：深灰底、白边；两页并排时共用中间的书脊 */
.al-page {
  position: relative;
  flex: none;
  border: 2px solid var(--line);
  background: #161616;
  overflow: hidden;
}

.al-page + .al-page {
  margin-left: -2px;
}

.al-photos {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.al-slot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.al-print {
  position: relative;
  flex: none;
  display: block;
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--black);
  color: var(--ink);
  touch-action: none;
  cursor: -webkit-grab;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}

/* 正被拖着的照片盖在别的照片上面 */
.al-dragging {
  z-index: 2;
}

.al-print img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.al-print:active {
  border-color: var(--ink-2);
}

/* 胶带：顶上一条，或者两个角各一条 */
.al-tape-top::before,
.al-tape-corners::before,
.al-tape-corners::after {
  content: '';
  position: absolute;
  z-index: 1;
  height: 9px;
  background: var(--ink-2);
}

.al-tape-top::before {
  top: -6px;
  left: 50%;
  width: 28px;
  margin-left: -14px;
  -webkit-transform: rotate(-4deg);
  transform: rotate(-4deg);
}

.al-tape-corners::before,
.al-tape-corners::after {
  width: 22px;
  top: -2px;
}

.al-tape-corners::before {
  left: -9px;
  -webkit-transform: rotate(-38deg);
  transform: rotate(-38deg);
}

.al-tape-corners::after {
  right: -9px;
  -webkit-transform: rotate(38deg);
  transform: rotate(38deg);
}

/* 动图和视频的角标 */
.al-tag {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0 3px;
  background: var(--ink);
  color: var(--black);
  line-height: 12px;
}

/* 第一页：上面是书名和张数，署名永远在最下面；页太矮时整页自己下滚 */
.al-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 12px;
  text-align: center;
}

.al-title {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.al-big {
  margin: 12px 0 4px;
  font-size: var(--fs-big);
  line-height: 28px;
}

.al-sub {
  margin: 0;
  color: var(--ink-2);
  line-height: 18px;
}

.al-warn {
  color: var(--danger);
}

.al-sources {
  flex: none;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.al-sources:empty {
  display: none;
}

.al-cover .credit {
  flex: none;
  width: 100%;
  margin: 8px 0 0;
}

.al-cover .credit-row {
  flex-wrap: wrap;
  white-space: normal;
}

/* 底下一排：上一页、页码、下一页 */
.al-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  background: var(--black);
}

.al-nav {
  flex: none;
  min-width: 96px;
  min-height: 44px;
}

.al-nav[disabled] {
  color: var(--ink-3);
  border-color: var(--ink-3);
  pointer-events: none;
}

.al-pageno {
  flex: 1 1 auto;
  text-align: center;
  line-height: 18px;
}

/* 详情里的预览不超过屏幕高度的 40% */
.al-detail .modal-preview {
  max-height: 40vh;
}

.al-meta {
  color: var(--ink-2);
}
