*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family:
    "Quicksand",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: #3b3b3b;
  color: #e0e0e0;
}

.pdf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 12px;
  background: #2b2b2b;
  border-bottom: 1px solid #222;
  user-select: none;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.topbar-filename {
  font-size: 0.82rem;
  font-weight: 600;
  color: #bbb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.1s;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.zoom-level {
  color: #aaa;
  font-size: 0.76rem;
  font-weight: 600;
  min-width: 44px;
  text-align: center;
}

.topbar-separator {
  width: 1px;
  height: 18px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.15);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.1s;
  font-family: inherit;
}

.dl-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.pdf-canvas-area {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
  touch-action: pan-x pan-y;
}

.pdf-canvas-area.spread-layout {
  display: block;
}

.spread-wrapper {
  display: flex;
  gap: 10px;
  width: fit-content;
  margin: 0 auto;
  flex-shrink: 0;
}

.spread-wrapper .pdf-page-canvas {
  flex-shrink: 0;
}

.pdf-page-canvas {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
  background: #fff;
  display: block;
}

.pdf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 3rem;
  color: #999;
  font-size: 0.92rem;
}

.pdf-loading i {
  font-size: 1.3rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.pdf-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
