:root {
  --viewer-chrome-y: 132px;
  --viewer-bg: #F8FAFC;
  --viewer-surface: #ffffff;
  --viewer-surface-muted: #fafbfc;
  --viewer-text: #111827;
  --viewer-muted: #6B7280;
  --viewer-border: #E5E7EB;
  --viewer-page-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.12), 0 24px 64px rgba(13, 27, 42, 0.08);
}

[data-theme=dark] {
  --viewer-bg: #0f1419;
  --viewer-surface: #1a2332;
  --viewer-surface-muted: #151d29;
  --viewer-text: #e8edf3;
  --viewer-muted: #94a3b8;
  --viewer-border: rgba(255, 255, 255, 0.1);
  --viewer-page-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), 0 12px 48px rgba(0, 0, 0, 0.35);
}

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--viewer-text);
  background: var(--viewer-bg);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}

.viewer-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.viewer-body {
  display: flex;
  flex: 1;
  min-height: 0;
  margin-top: 52px;
  overflow: hidden;
}

.viewer-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 12px;
  background: #0D1B2A;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 8px;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.toolbar-left {
  flex: 0 0 auto;
}

.toolbar-center {
  flex: 1;
  justify-content: center;
  gap: 8px;
}

.toolbar-right {
  flex: 0 0 auto;
  margin-left: auto;
}

.toolbar-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 0 4px;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-toolbar:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.btn-toolbar:active:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}
.btn-toolbar:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-toolbar.active {
  color: #2563EB;
}

.btn-toolbar-text {
  width: auto;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.btn-future {
  opacity: 0.5;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 6px;
}

.page-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-input {
  width: 56px;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 13px;
  text-align: center;
}
.page-input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
  background: rgba(255, 255, 255, 0.12);
}
.page-input[aria-invalid=true] {
  border-color: #f87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.35);
}
.page-input::-webkit-inner-spin-button, .page-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-total {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.zoom-display {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  min-width: 56px;
  text-align: center;
}

.actual-size-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.dropdown-toggle::after {
  margin-left: 4px;
  vertical-align: middle;
}

#fitModeLabel {
  font-size: 12px;
}

.spinner-accent {
  color: #2563EB !important;
}

.mobile-toolbar,
.mobile-bottom-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1025;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  background: #071321;
  color: #ffffff;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-toolbar {
  top: 52px;
  border-top: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-bottom-toolbar {
  bottom: 0;
}

.thumbnail-rail {
  flex: 0 0 120px;
  width: 120px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--viewer-surface-muted);
  border-right: 1px solid var(--viewer-border);
  overflow: hidden;
  transition: flex-basis 0.2s, width 0.2s, opacity 0.2s;
}
.thumbnail-rail.collapsed {
  flex-basis: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
  border-right: none;
}

.thumbnail-rail-inner {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
  scrollbar-width: thin;
}

.thumbnail-empty {
  font-size: 11px;
  color: #6B7280;
  text-align: center;
  padding: 12px 4px;
  margin: 0;
  line-height: 1.4;
}

.thumbnail-item {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.thumbnail-item:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}
.thumbnail-item.active {
  border-color: #2563EB;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}
.thumbnail-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
  background: #F8FAFC;
  pointer-events: none;
}

.thumbnail-label {
  display: block;
  text-align: center;
  font-size: 10px;
  color: #6B7280;
  margin-top: 3px;
}

.thumbnail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(145deg, #f1f5f9, #e8edf3);
  border: 1px dashed rgb(211.7043478261, 215.0347826087, 221.6956521739);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: #6B7280;
}

.reading-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--viewer-bg);
  overflow: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.reading-pane-inner {
  display: block;
  min-height: 100%;
  padding: 0;
  position: relative;
}

.page-stream-wrap {
  position: relative;
  width: 100%;
  min-height: 100%;
}

.page-stream-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}
.page-stream-loading.d-none {
  display: none !important;
}

.page-stream {
  width: 100%;
  max-width: 100%;
  padding: 20px 56px 48px;
  margin: 0 auto;
}
.page-stream.d-none {
  display: none !important;
}

.page-slot {
  margin: 0 auto 16px;
  scroll-margin-top: 12px;
}
.page-slot:last-child {
  margin-bottom: 32px;
}

.page-slot-inner {
  display: flex;
  justify-content: center;
  width: 100%;
}

.page-slot .page-image {
  display: block;
  max-width: 100%;
  height: auto;
  background: #ffffff;
  box-shadow: var(--viewer-page-shadow);
  border-radius: 3px;
  user-select: none;
  -webkit-user-drag: none;
}

.page-stream.zoom-fit-width .page-slot .page-image {
  width: 100%;
  max-width: 100%;
}

.page-stream.zoom-fit-page .page-slot .page-image {
  max-width: 100%;
  max-height: calc(100vh - var(--viewer-chrome-y) - 32px);
  width: auto;
  height: auto;
}

.page-stream.zoom-actual .page-slot .page-image,
.page-stream.zoom-custom .page-slot .page-image {
  max-width: none;
}

.page-stream-error {
  padding: 48px 24px;
  text-align: center;
  color: var(--viewer-muted);
  max-width: 520px;
  margin: 0 auto;
}
.page-stream-error p {
  margin: 0 0 10px;
  line-height: 1.5;
}
.page-stream-error .page-stream-error-detail {
  font-size: 13px;
  color: var(--viewer-text);
  word-break: break-word;
}
.page-stream-error .page-stream-error-hint {
  font-size: 12px;
  margin-top: 14px;
}
.page-stream-error code {
  font-size: 12px;
}

.page-slot-missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 520px;
  min-height: 280px;
  aspect-ratio: 1445/1870;
  padding: 32px 24px;
  text-align: center;
  color: var(--viewer-muted);
  background: var(--viewer-surface);
  border: 1px solid var(--viewer-border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.page-slot-missing i {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.45;
  color: #2563EB;
}
.page-slot-missing p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.page-slot-missing .page-slot-label {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--viewer-muted);
}

.floating-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(13, 27, 42, 0.9);
  color: rgba(255, 255, 255, 0.94);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(13, 27, 42, 0.28);
  transition: opacity 0.2s, background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.reading-pane-inner:hover .floating-nav {
  opacity: 0.9;
}
.floating-nav:hover {
  background: rgba(13, 27, 42, 0.98);
  border-color: rgba(37, 99, 235, 0.5);
  color: #ffffff;
  opacity: 1;
  box-shadow: 0 6px 20px rgba(13, 27, 42, 0.38);
}
.floating-nav:active:not(:disabled) {
  transform: translateY(-50%) scale(0.96);
}
.floating-nav:disabled {
  opacity: 0 !important;
  cursor: not-allowed;
  pointer-events: none;
}
.floating-nav i {
  font-size: 1.1rem;
  font-weight: 600;
}

.floating-nav-prev {
  left: 20px;
}

.floating-nav-next {
  right: 20px;
}

.bookmark-panel {
  flex: 0 0 340px;
  width: 340px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--viewer-surface);
  border-left: 1px solid var(--viewer-border);
  overflow: hidden;
  transition: flex-basis 0.2s, width 0.2s, opacity 0.2s;
}
.bookmark-panel.collapsed {
  flex-basis: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
  border-left: none;
}

.bookmark-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--viewer-border);
  flex-shrink: 0;
  background: var(--viewer-surface);
  z-index: 1;
}

.bookmark-panel-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--viewer-text);
}

.bookmark-search-wrap {
  position: relative;
  flex-shrink: 0;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--viewer-border);
  background: var(--viewer-surface-muted);
}
.bookmark-search-wrap.bookmark-search-wrap-mobile {
  padding: 10px 12px;
}

.bookmark-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #6B7280;
  pointer-events: none;
}

.bookmark-search-wrap-mobile .bookmark-search-icon {
  left: 22px;
}

.bookmark-search-input {
  width: 100%;
  height: 34px;
  padding: 6px 10px 6px 30px;
  border: 1px solid var(--viewer-border);
  border-radius: 8px;
  background: var(--viewer-surface);
  font-size: 13px;
  color: var(--viewer-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bookmark-search-input::placeholder {
  color: var(--viewer-muted);
}
.bookmark-search-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.6);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-panel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
}
.btn-panel-close:hover {
  background: #F8FAFC;
  color: #111827;
}

.bookmark-tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0 12px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.bookmark-filter-hidden {
  display: none !important;
}

.bookmark-section {
  border-bottom: 1px solid var(--viewer-border);
}
.bookmark-section:last-child {
  border-bottom: none;
}

.bookmark-parent {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  width: 100%;
}

.bookmark-chevron {
  flex: 0 0 28px;
  width: 28px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
}
.bookmark-chevron:hover {
  background: #F8FAFC;
  color: #111827;
}
.bookmark-chevron.leaf {
  visibility: hidden;
}

.bookmark-row {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 12px 6px 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  width: 100%;
  border-radius: 0;
  color: var(--viewer-text);
  font-size: 13px;
  line-height: 1.4;
  border-left: 3px solid transparent;
}
.bookmark-row:hover {
  background: rgba(37, 99, 235, 0.08);
}
.bookmark-row.active {
  color: rgb(20.2857142857, 83.1714285714, 221.1142857143);
  font-weight: 500;
  background: rgba(37, 99, 235, 0.1);
  border-left-color: #2563EB;
}
.bookmark-row.parent-active {
  font-weight: 600;
  background: rgba(37, 99, 235, 0.04);
}

.bookmark-row-child {
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: 4px;
}
.bookmark-row-child.active {
  border-left-color: #2563EB;
}

.bookmark-title {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.bookmark-page {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--viewer-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.bookmark-children {
  padding-left: 20px;
  padding-bottom: 4px;
}
.bookmark-children .bookmark-row {
  font-size: 12.5px;
}
.bookmark-children.collapsed {
  display: none;
}

.bookmark-offcanvas {
  width: min(340px, 90vw) !important;
  background: var(--viewer-surface);
  color: var(--viewer-text);
}
.bookmark-offcanvas .offcanvas-header {
  border-bottom: 1px solid var(--viewer-border);
  padding: 12px 14px;
  background: var(--viewer-surface);
}
.bookmark-offcanvas .offcanvas-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--viewer-text);
}
.bookmark-offcanvas .offcanvas-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.bookmark-offcanvas .bookmark-tree {
  flex: 1;
  min-height: 0;
  height: auto;
}

@media (max-width: 768px) {
  .viewer-body {
    margin-top: calc(52px + 44px);
    margin-bottom: 44px;
  }
  .thumbnail-rail {
    display: none !important;
  }
  .bookmark-panel {
    display: none !important;
  }
  .reading-pane-inner {
    padding: 0;
  }
  .page-stream {
    padding: 12px 12px 32px;
  }
  .floating-nav {
    display: none !important;
  }
  .toolbar-title {
    font-size: 14px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (min-width: 768px) {
  .mobile-toolbar,
  .mobile-bottom-toolbar {
    display: none !important;
  }
}
.dropdown-menu-dark.viewer-dropdown {
  --bs-dropdown-bg: #071321;
  --bs-dropdown-border-color: rgba(255, 255, 255, 0.14);
  --bs-dropdown-color: rgba(255, 255, 255, 0.92);
  --bs-dropdown-link-color: rgba(255, 255, 255, 0.92);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-hover-bg: rgba(255, 255, 255, 0.1);
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-link-active-bg: #2563EB;
  --bs-dropdown-header-color: rgba(255, 255, 255, 0.55);
  --bs-dropdown-divider-bg: rgba(255, 255, 255, 0.12);
  min-width: 200px;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  font-size: 13px;
}
.dropdown-menu-dark.viewer-dropdown .dropdown-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 10px 4px;
}
.dropdown-menu-dark.viewer-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.92);
}
.dropdown-menu-dark.viewer-dropdown .dropdown-item:hover, .dropdown-menu-dark.viewer-dropdown .dropdown-item:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.dropdown-menu-dark.viewer-dropdown .dropdown-item.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.35);
  font-weight: 500;
}
.dropdown-menu-dark.viewer-dropdown .dropdown-divider {
  margin: 6px 0;
  opacity: 1;
}

.dropdown-menu-dark {
  --bs-dropdown-bg: #071321;
  --bs-dropdown-border-color: rgba(255, 255, 255, 0.1);
  --bs-dropdown-link-hover-bg: rgba(255, 255, 255, 0.1);
  --bs-dropdown-link-active-bg: #2563EB;
  font-size: 13px;
}

/*# sourceMappingURL=styles.css.map */
