html, body { margin: 0; height: 100%; background: #2f2f2f; }
body { height: 100dvh; --reader-bar-height: 46px; }
#reader-opening {
  position: fixed;
  z-index: 5;
  inset: 16px 16px calc(16px + var(--reader-bar-height) + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  pointer-events: none;
}
#reader-opening img { max-width: 100%; max-height: 100%; object-fit: contain; }
#reader {
  height: 100%;
  min-height: 0;
  --pdflip-font: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --pdflip-accent: #426f36;
  --pdflip-button-size: 42px;
}
#reader > .pdflip-toolbar {
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0;
  flex: none;
  height: calc(var(--reader-bar-height) + env(safe-area-inset-bottom, 0px));
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  border: 0;
  color: #f6f6f5;
  background: linear-gradient(#232323, #1e1e1e);
}
#reader .pdflip-toolbar-group { gap: 0; }
#reader .pdflip-toolbar-group:last-child { justify-self: end; }
#reader .pdflip-toolbar .pdflip-button {
  width: var(--pdflip-button-size); height: var(--reader-bar-height);
  background: transparent;
  color: inherit;
  border-radius: 0;
}
#reader .pdflip-toolbar .pdflip-icon { width: 18px; height: 18px; stroke-width: 1.7; }
#reader .pdflip-toolbar .pdflip-button:hover:not(:disabled),
#reader .pdflip-toolbar .pdflip-button[aria-pressed="true"]:not(.pdflip-button-sound) {
  background: #393939;
}
#reader .pdflip-toolbar .pdflip-button:focus-visible {
  outline: 2px solid #fff; outline-offset: -4px;
}
#reader .pdflip-toolbar .pdflip-button:disabled { opacity: .44; }
#reader.is-zoomed .reader-zoom-toggle .plus-stroke { display: none; }
#reader .pdflip-page-number {
  height: 24px;
  min-width: 72px;
  padding: 0 7px;
  margin: 0 5px;
  gap: 1px;
  line-height: 1;
  justify-content: center;
  background: #b9b9b9; color: #141414;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}
#reader .pdflip-page-number:focus-within { box-shadow: inset 0 0 0 2px white; }
#reader .pdflip-page-input {
  color: inherit; background: transparent; border: 0;
  border-radius: 0; padding: 0; outline: none;
  width: 3ch; text-align: right; font-variant-numeric: tabular-nums;
}
@supports (field-sizing: content) {
  #reader .pdflip-page-input { field-sizing: content; width: auto; min-width: 1ch; max-width: 8ch; }
}
#reader .pdflip-page-total { color: inherit; }
@media (max-width: 850px) {
  #reader { --pdflip-button-size: 34px; }
}
@media (max-width: 650px) {
  body { --reader-bar-height: 48px; }
  #reader { --pdflip-button-size: 30px; }
  #reader > .pdflip-toolbar { grid-template-columns: auto 1fr auto; }
  #reader .pdflip-toolbar-group:nth-child(2) { justify-self: center; }
  #reader .pdflip-toolbar :is(.pdflip-button-first, .pdflip-button-last, .pdflip-button-autoplay, .pdflip-button-pageMode) { display: none; }
  #reader .pdflip-toolbar .pdflip-button-sound { display: inline-flex; }
  #reader .pdflip-page-number { min-width: 59px; padding: 0 4px; margin: 0; }
}
@media (max-width: 355px) {
  #reader { --pdflip-button-size: 26px; }
  #reader .pdflip-toolbar .pdflip-icon { width: 16px; height: 16px; }
}
