:root {
  color-scheme: dark;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: #f9f8f6;
  background: #1d1d20;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  height: 100vh;
  height: 100dvh;
  min-height: 190px;
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .65rem clamp(.65rem, 2.4vw, 2rem);
  border-bottom: 1px solid #ffffff19;
}
h1 {
  font-size: clamp(.92rem, 3.5vw, 1.13rem);
  font-weight: 600;
  margin: 0;
}
.tools { display: flex; align-items: center; gap: .35rem; }
.tool, .step, .page-picker {
  color: inherit;
  background: #2e2e32;
  border: 1px solid #ffffff26;
  border-radius: .5rem;
}
.tool, .step {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .35rem .78rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.tool:hover, .step:not(:disabled):hover, .page-picker:hover { background: #3d3d42; }
:focus-visible { outline: 2px solid #fbcaaa; outline-offset: 3px; }
.viewer {
  min-height: 0;
  margin: .75rem clamp(.5rem, 2.3vw, 2rem);
  display: grid;
  place-items: center;
  container-type: size;
}
.canvas {
  position: relative;
  margin: 0;
  width: min(100%, calc((100vh - 171px) * 1.4052));
  width: min(100cqw, 140.52cqh);
  aspect-ratio: 1800 / 1281;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 36px #0005;
  touch-action: pan-y pinch-zoom;
}
.canvas img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hotspots { position: absolute; inset: 0; pointer-events: none; }
.hotspots a { position: absolute; pointer-events: auto; border-radius: 3px; }
.hotspots a:hover, .hotspots a:focus-visible {
  outline: 2px solid #bc392e;
  outline-offset: -1px;
  background: #c5291d09;
}
.load-error { position: absolute; inset: auto 8px 8px; background: #1d1d20; padding: .6rem; }
.footer {
  text-align: center;
  padding-bottom: max(.48rem, env(safe-area-inset-bottom));
}
.record {
  display: inline-block;
  font-size: .75rem;
  color: #c9c8ce;
  text-decoration: none;
}
.record:hover { text-decoration: underline; }
.navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  padding: .2rem .55rem .15rem;
}
.step { min-width: 48px; padding: 0; font-size: 2rem; line-height: 1; }
.step:disabled { opacity: .42; cursor: default; }
.page-picker {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 82px;
  height: 42px;
  font-variant-numeric: tabular-nums;
}
.page-picker select {
  color: inherit;
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  cursor: pointer;
}
.page-picker:focus-within { outline: 2px solid #fbcaaa; outline-offset: 3px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 530px) {
  .tool { padding-inline: .55rem; font-size: .87rem; }
  .viewer { margin-inline: 0; }
}
@media (max-height: 450px) and (orientation: landscape) {
  .toolbar { padding-block: .12rem; }
  .viewer { margin-block: .2rem; }
  .footer { padding-bottom: .15rem; }
}
:root:fullscreen .toolbar { border-bottom: none; padding-block: .15rem; }
:root:fullscreen .viewer { margin-block: .3rem; }
:root:fullscreen .footer { padding-bottom: .2rem; }
