.pdf-body {
  min-height: 100dvh;
}
.pdf-body [hidden] {
  display: none !important;
}
.pdf-body a.quiet {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.pdf-shelf-main {
  max-width: 1080px;
  margin: auto;
  padding: 70px 32px 40px;
}
.pdf-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}
.pdf-heading h1 {
  font:
    400 clamp(36px, 5vw, 54px)/1.25 "Songti SC",
    SimSun,
    serif;
  margin: 10px 0 14px;
}
.pdf-kicker {
  color: var(--muted);
  margin: 0;
}
.pdf-shelf-tools {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.pdf-shelf-tools input {
  max-width: 440px;
}
.pdf-list {
  margin: 0 0 30px;
}
.pdf-item {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}
.pdf-file-mark {
  width: 46px;
  height: 58px;
  flex-shrink: 0;
  border: 1px solid #91a6af;
  border-radius: 2px 12px 2px 2px;
  display: grid;
  place-items: center;
  color: #62757e;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: #fff;
}
.pdf-item-info {
  flex: 1;
  min-width: 0;
}
.pdf-item-title {
  font-size: 19px;
  font-weight: 500;
  text-align: left;
  padding: 0;
  overflow-wrap: anywhere;
}
.pdf-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.pdf-item-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pdf-item-actions button {
  min-height: 44px;
}
.pdf-shelf-note {
  color: var(--muted);
  font-size: 13px;
}
.pdf-reader {
  position: fixed;
  inset: 0;
  height: 100dvh;
  z-index: 10;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #dfe6e9;
}
.pdf-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px
    max(12px, env(safe-area-inset-left));
  background: #f4f7f8;
  border-bottom: 1px solid #ced9de;
}
.pdf-topbar h1 {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-stage {
  position: relative;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: none;
  padding: 16px;
  min-width: 0;
  min-height: 0;
  outline-offset: -3px;
}
.pdf-page-wrap {
  position: relative;
  margin: auto;
  background: #fff;
  box-shadow: 0 2px 12px #263b4614;
}
#pdfCanvas {
  display: block;
  background: white;
}
.pdf-controls {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  background: #f4f7f8;
  border-top: 1px solid #ced9de;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
}
.pdf-pagination,
.pdf-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pdf-controls button {
  white-space: nowrap;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 10px;
}
@media (max-width: 360px) {
  .pdf-controls {
    flex-direction: column;
    gap: 0;
  }
}
.pdf-pagination > button {
  font-size: 26px;
  line-height: 1;
}
.pdf-page-input {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}
.pdf-page-input input {
  width: 52px;
  height: 38px;
  padding: 4px;
  text-align: center;
  margin: 0;
  appearance: textfield;
}
.pdf-page-input input::-webkit-inner-spin-button {
  appearance: none;
}
#pageTotal {
  white-space: nowrap;
  min-width: 32px;
}
.pdf-read-status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(85%, 440px);
  padding: 18px 22px;
  border: 1px solid #ced9de;
  border-radius: 8px;
  background: #f4f7f8f5;
  text-align: center;
  overflow-wrap: anywhere;
}
.pdf-exit-focus {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: 12px;
  background: #f4f7f8ec;
  border: 1px solid #ced9de;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 12px;
}
.pdf-reader.is-focused {
  grid-template-rows: minmax(0, 1fr);
}
.pdf-reader.is-focused .pdf-topbar,
.pdf-reader.is-focused .pdf-controls {
  display: none;
}
.pdf-upload-status {
  white-space: pre-line;
  font-size: 13px;
  max-height: 200px;
  overflow: auto;
}
#pdfUploadProgress {
  display: block;
  width: 100%;
  accent-color: #213e54;
  margin-top: 12px;
}
.pdf-admin-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 26px;
  margin: 18px 0 30px;
  border: 1px solid var(--line);
  background: var(--paper);
  text-decoration: none;
  border-radius: 12px;
}
.pdf-admin-link strong {
  display: block;
  font-size: 19px;
  font-weight: 500;
}
.pdf-admin-link small {
  color: var(--muted);
}
@media (max-width: 600px) {
  .pdf-shelf-main {
    padding: 36px 20px;
  }
  .pdf-heading {
    align-items: flex-end;
    margin-bottom: 28px;
    gap: 10px;
  }
  .pdf-heading h1 {
    font-size: 36px;
  }
  .pdf-heading .hint {
    font-size: 12px;
  }
  .pdf-heading .primary {
    padding: 11px 13px;
    white-space: nowrap;
  }
  .pdf-item {
    gap: 14px;
    padding: 20px 0;
    flex-wrap: wrap;
  }
  .pdf-item-actions {
    width: 100%;
    padding-left: 60px;
    justify-content: flex-end;
  }
  .pdf-item-title {
    font-size: 17px;
  }
  .pdf-stage {
    padding: 8px;
  }
  .pdf-controls {
    gap: 4px;
    justify-content: space-between;
    padding-left: 4px;
    padding-right: 4px;
  }
  .pdf-controls button {
    min-width: 40px;
    padding: 6px;
  }
  .pdf-pagination,
  .pdf-zoom {
    gap: 0;
  }
  .pdf-page-input {
    gap: 4px;
  }
  .pdf-page-input input {
    width: 40px;
  }
  #pageTotal {
    min-width: 28px;
  }
  .pdf-topbar {
    padding: max(6px, env(safe-area-inset-top)) 6px 6px;
    gap: 2px;
  }
  .pdf-topbar .quiet {
    padding: 8px;
    min-height: 44px;
    font-size: 13px;
  }
  .pdf-topbar h1 {
    font-size: 13px;
  }
  .pdf-admin-link {
    margin: 16px 0;
    padding: 18px;
  }
}
