.boot {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #000;
  color: #fff;
}
.boot[hidden] { display: none !important; }
.boot p { margin: 0; font-size: 16px; }
.boot__count { color: #9a9a9a; font-size: 14px; }
.boot__bar {
  width: min(72vw, 320px);
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #2a2a2a;
}
.boot__bar i {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: system-ui, "Noto Sans TC", sans-serif;
}
.viewer {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
}
.stage {
  position: relative;
  width: min(100%, 520px);
  height: min(78dvh, 860px);
  display: flex;
  align-items: center;
  justify-content: center;
}
#page {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #efe6d4;
  user-select: none;
  -webkit-user-drag: none;
}
.empty {
  margin: 0;
  color: #9a9a9a;
  font-size: 16px;
}
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #e8e8e8;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.nav--prev { left: 8px; }
.nav--next { right: 8px; }
#bar {
  width: min(100%, 520px);
  margin: 10px 0 6px;
  accent-color: #fff;
}
.count {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  max-width: 520px;
  margin-top: 10px;
}
.dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #4a4a4a;
  cursor: pointer;
}
.dots button.is-on { background: #fff; }
.edit {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.edit button {
  min-width: 88px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: #fff;
  color: #111;
  font-size: 15px;
  cursor: pointer;
}
#remove { background: #5a1f1f; color: #fff; }
.status {
  margin: 8px 0 0;
  min-height: 1.2em;
  color: #9a9a9a;
  font-size: 14px;
}

@media (min-width: 768px) {
  .nav { width: 46px; height: 46px; }
}

@media (max-width: 767px) {
  .edit,
  .status,
  #bar,
  .dots {
    display: none !important;
  }
  .viewer {
    padding: 0;
    justify-content: stretch;
  }
  .stage {
    width: 100vw;
    height: 100dvh;
    max-width: none;
  }
  #page {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
  }
  .count {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 2;
    text-align: center;
    font-size: 13px;
    color: #fff;
    text-shadow: 0 1px 4px #000;
  }
}
