#tab-books,
#tab-books .info-card {
  min-width: 0;
  min-height: 0;
  white-space: normal;
  overflow: hidden;
}

.books-card {
  padding: 0 !important;
}

.books-workspace {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: clamp(340px, 20vw, 420px) minmax(0, 1fr);
  background: var(--panel);
  overflow: hidden;
}

.books-sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 8px 10px;
  border-right: 1px solid var(--border-soft);
  background: var(--panel-2);
  overflow: hidden;
}

.books-sidebar-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--accent-2);
}

.books-sidebar-head > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.books-sidebar-head strong {
  font-size: 0.95rem;
}

.books-sidebar-head span {
  color: var(--text-dim);
  font-size: 0.7rem;
}

.books-sidebar-head button,
.books-toolbar button,
.books-statusbar button {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
}

.books-sidebar-head button {
  display: none;
  width: 30px;
  padding: 0;
  font-size: 1rem;
}

.books-toolbar button:hover,
.books-sidebar-head button:hover,
.books-statusbar button:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.books-admin-actions {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
  padding: 7px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: var(--panel);
}

.books-admin-actions[hidden],
.books-sort-actions[hidden] {
  display: none !important;
}

.books-admin-action-row,
.books-sort-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.books-admin-action-row button,
.books-sort-actions button {
  min-height: 28px;
  flex: 1 1 0;
  padding: 3px 6px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
}

.books-admin-action-row button:hover,
.books-sort-actions button:hover,
.books-admin-action-row button.active {
  border-color: var(--accent);
  color: var(--accent-2);
}

.books-upload-category {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.67rem;
}

.books-upload-category select {
  min-width: 0;
  flex: 1;
  min-height: 27px;
  padding: 2px 5px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.68rem;
}

.books-upload-status {
  min-height: 16px;
  color: var(--text-dim);
  font-size: 0.64rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.books-upload-status.success { color: var(--success, #18864b); }
.books-upload-status.error { color: var(--danger, #c43d3d); }

.books-toolbar button.active,
#booksBookmarkBtn.active {
  border-color: var(--accent);
  background: var(--accent-dark);
  color: var(--accent-2);
}

.books-search {
  flex: 0 0 auto;
  width: 100%;
  min-height: 32px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  outline: none;
  background: var(--panel);
  color: var(--text);
  font-size: 0.8rem;
}

.books-category-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 32px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.books-catalog {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding: 0 2px 8px 0;
  margin: 0;
}

.books-category + .books-category {
  margin-top: 0;
}

.books-category {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 7px;
  overflow: visible;
}

.books-category-head-row {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: var(--panel-2);
  border-radius: 6px;
}

.books-category-head {
  position: relative;
  z-index: 1;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--accent-2);
  font-size: 0.86rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  line-height: 1;
  box-shadow: 0 1px 0 var(--border-soft);
}

.books-category-sort-controls,
.books-item-sort-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.books-category-sort-controls {
  flex: 0 0 auto;
  padding: 0 5px 0 0;
}

.books-sort-button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.76rem;
  line-height: 1;
}

.books-sort-button:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.books-category-head:hover {
  background: var(--table-hover);
}

.books-category-head.active {
  background: linear-gradient(rgba(56, 189, 248, 0.14), rgba(56, 189, 248, 0.14)), var(--panel-2);
}

.books-folder-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow: hidden;
}

.books-folder-chevron {
  width: 10px;
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
}

.books-category.collapsed .books-category-list {
  display: none;
}

.books-category-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 6px 16px;
  margin: 0;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}

.books-folder-empty {
  padding: 11px 9px;
  color: var(--text-dim);
  font-size: 0.68rem;
  text-align: center;
}

.books-item {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 4px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 6px;
  align-items: center;
}

.books-item-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 3px;
}

.books-item-row .books-item {
  flex: 1 1 auto;
  min-width: 0;
}

.books-item-sort-controls {
  flex: 0 0 auto;
  padding-right: 2px;
}

.books-item:hover {
  background: var(--table-hover);
}

.books-item.active {
  color: var(--accent-2);
  background: rgba(56, 189, 248, 0.14);
}

.books-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.books-item-title {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.books-item-author {
  min-width: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.books-item-progress {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--text-dim);
  font-size: 0.66rem;
}

.books-list-status {
  padding: 20px 10px;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-align: center;
}

.books-reader {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
}

.books-toolbar {
  position: relative;
  z-index: 30;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 48px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel);
}

.books-title-group {
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.books-title-group > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.books-title-group strong,
.books-title-group span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.books-title-group strong {
  color: var(--accent-2);
  font-size: 0.82rem;
}

.books-title-group span {
  color: var(--text-dim);
  font-size: 0.64rem;
}

.books-controls {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  overflow: visible;
}

.books-controls button,
.books-primary-controls button,
.books-secondary-controls button {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 4px 7px;
}

.books-primary-controls,
.books-secondary-controls {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.books-reading-mode {
  flex: 0 0 auto;
  height: 30px;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 2px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel-2);
}

.books-reading-mode button {
  min-width: 40px;
  min-height: 24px;
  padding: 2px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.books-reading-mode button.active {
  background: var(--panel);
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.books-more-btn {
  display: none;
}

.books-find-control {
  flex: 0 0 150px;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel-2);
}

.books-find-control input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.7rem;
}

.books-find-control span {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 0.62rem;
}

.books-eye-control {
  flex: 0 0 116px;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.books-eye-control span {
  flex: 0 0 28px;
}

.books-eye-control input {
  min-width: 0;
  width: 100%;
  accent-color: var(--accent);
}

.books-page-control {
  flex: 0 0 auto;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text-muted);
  font-size: 0.68rem;
}

.books-page-control input {
  width: 42px;
  padding: 2px 3px;
  border: 0;
  border-bottom: 1px solid var(--border);
  outline: none;
  background: transparent;
  color: var(--text);
  text-align: center;
  font-size: 0.72rem;
}

.books-zoom-label {
  flex: 0 0 auto;
  min-width: 38px;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-align: center;
}

.books-control-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 22px;
  background: var(--border-soft);
}

.books-viewer {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  background: var(--pdf-viewer-bg, #c8d2de);
}

.books-page-edge {
  position: absolute;
  z-index: 18;
  top: calc(50% + 18px);
  width: 32px;
  height: 54px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--text-muted);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.58;
  transform: translateY(-50%);
  transition: opacity 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  backdrop-filter: blur(5px);
}

.books-page-edge-prev {
  left: 12px;
}

.books-page-edge-next {
  right: 12px;
}

.books-page-edge:hover {
  border-color: var(--accent);
  background: var(--panel);
  color: var(--accent-2);
  opacity: 1;
  transform: translateY(-50%) !important;
}

.books-page-edge:disabled {
  cursor: default;
  opacity: 0.18;
  transform: translateY(-50%) !important;
}

.books-page-edge:active,
.books-page-edge:focus-visible {
  transform: translateY(-50%) !important;
}

.books-page-edge[hidden] {
  display: none !important;
}

.books-page-shell {
  position: relative;
  flex: 0 0 auto;
  line-height: 0;
  background: #f8f8f5;
  box-shadow: var(--pdf-page-shadow, 0 4px 20px rgba(15, 23, 42, 0.24));
}

.books-page-shell.eye-mode {
  background: #f3eddc;
}

#booksCanvas {
  position: relative;
  z-index: 0;
  display: block;
  max-width: none;
  background: #ffffff;
}

.books-page-shell.eye-mode.eye-level-1 #booksCanvas {
  filter: sepia(0.10) saturate(0.90) brightness(1.02) contrast(0.98);
}

.books-page-shell.eye-mode.eye-level-2 #booksCanvas {
  filter: sepia(0.16) saturate(0.82) brightness(0.97) contrast(0.96);
}

.books-page-shell.eye-mode.eye-level-3 #booksCanvas {
  filter: sepia(0.20) saturate(0.76) brightness(0.90) contrast(0.95);
}

.books-page-shell.eye-mode.eye-level-4 #booksCanvas {
  filter: sepia(0.24) saturate(0.70) brightness(0.82) contrast(0.94);
}

.books-text-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: clip;
  line-height: 1;
  text-align: initial;
  transform-origin: 0 0;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  forced-color-adjust: none;
}

.books-text-layer :is(span, br) {
  position: absolute;
  color: transparent;
  white-space: pre;
  cursor: text;
  transform-origin: 0 0;
}

.books-text-layer ::selection {
  background: rgba(22, 135, 232, 0.28);
}

.books-text-layer .books-find-hit {
  background: rgba(245, 190, 40, 0.34);
  border-radius: 2px;
}

.books-text-layer .books-find-hit-active {
  background: rgba(255, 132, 32, 0.56);
}

.books-empty,
.books-loading {
  margin: auto;
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  text-align: center;
}

.books-empty[hidden],
.books-loading[hidden],
.books-page-shell[hidden] {
  display: none !important;
}

.books-continuous[hidden] {
  display: none !important;
}

.books-viewer.continuous-mode {
  display: block;
  padding: 0;
  scroll-behavior: auto;
}

.books-continuous {
  width: 100%;
  min-height: 100%;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 18px 20px 24px;
}

.books-continuous-page {
  position: relative;
  width: min(900px, calc(100% - 16px));
  aspect-ratio: var(--page-aspect, 0.72);
  flex: 0 0 auto;
  overflow: hidden;
  background: #f8f8f5;
  box-shadow: var(--pdf-page-shadow, 0 4px 20px rgba(15, 23, 42, 0.24));
}

.books-continuous-page canvas {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff;
}

.books-continuous-page:not(.rendered)::before {
  content: '正在载入第 ' attr(data-page) ' 页';
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.72rem;
}

.books-continuous-page-number {
  position: absolute;
  z-index: 3;
  right: 7px;
  bottom: 6px;
  min-width: 24px;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.56);
  color: #ffffff;
  font-size: 0.62rem;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.books-continuous.eye-mode.eye-level-1 canvas {
  filter: sepia(0.10) saturate(0.90) brightness(1.02) contrast(0.98);
}

.books-continuous.eye-mode.eye-level-2 canvas {
  filter: sepia(0.16) saturate(0.82) brightness(0.97) contrast(0.96);
}

.books-continuous.eye-mode.eye-level-3 canvas {
  filter: sepia(0.20) saturate(0.76) brightness(0.90) contrast(0.95);
}

.books-continuous.eye-mode.eye-level-4 canvas {
  filter: sepia(0.24) saturate(0.70) brightness(0.82) contrast(0.94);
}

.books-empty strong {
  color: var(--accent-2);
  font-size: 0.92rem;
}

.books-empty span,
.books-loading {
  font-size: 0.76rem;
}

.books-empty button {
  justify-self: center;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.books-navigation {
  position: absolute;
  z-index: 28;
  left: 0;
  top: 48px;
  bottom: 32px;
  width: 286px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
  background: var(--panel-2);
  box-shadow: 14px 0 34px rgba(15, 23, 42, 0.18);
  transform: translateX(-104%);
  transition: transform 0.18s ease;
}

.books-navigation.open {
  transform: translateX(0);
}

.books-navigation-head {
  min-height: 38px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--accent-2);
  font-size: 0.8rem;
}

.books-navigation-head button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.books-navigation-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-soft);
}

.books-navigation-tabs button {
  min-height: 30px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.books-navigation-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-dark);
  color: var(--accent-2);
}

.books-navigation-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 6px 8px 10px;
}

.books-navigation-empty {
  padding: 16px 8px;
  color: var(--text-dim);
  font-size: 0.72rem;
  text-align: center;
}

.books-outline-list {
  display: grid;
  gap: 2px;
}

.books-outline-entry button {
  width: 100%;
  min-height: 28px;
  padding: 4px 7px 4px calc(7px + var(--outline-depth) * 13px);
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.books-outline-entry button:hover {
  background: var(--table-hover);
  color: var(--text);
}

.books-navigation-bookmarks {
  display: grid;
  gap: 4px;
}

.books-navigation-bookmarks button {
  min-height: 32px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 0.72rem;
}

.books-navigation-bookmarks button span:last-child {
  color: var(--text-dim);
  font-size: 0.64rem;
}

.books-statusbar {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 4px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--text-dim);
  font-size: 0.66rem;
}

.books-bookmarks {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  overflow-x: auto;
}

.books-bookmarks button {
  min-height: 24px;
  padding: 2px 7px;
  font-size: 0.64rem;
}

.books-directory-toggle,
.books-mobile-directory,
.books-sidebar-backdrop {
  display: none;
}

.books-workspace:fullscreen {
  width: 100vw;
  height: 100vh;
  background: var(--panel);
}

body.dark-mode .books-sidebar {
  background: #24262b;
  border-right-color: #373b43;
}

body.dark-mode .books-toolbar,
body.dark-mode .books-statusbar,
body.dark-mode .books-navigation {
  background: #24262b;
  border-color: #373b43;
}

body.dark-mode .books-viewer {
  background: #191b1f;
}

body.dark-mode .books-page-edge {
  background: rgba(36, 38, 43, 0.86);
  border-color: #464b54;
  color: #c0c6cf;
}

body.dark-mode .books-page-shell,
body.dark-mode .books-page-shell.eye-mode {
  background: #f3eddc;
}

body.dark-mode .books-continuous-page {
  background: #f3eddc;
}

@media (max-width: 900px) {
  .books-workspace {
    display: block;
  }

  .books-sidebar {
    position: absolute;
    z-index: 45;
    inset: 0 auto 0 0;
    width: min(82vw, 340px);
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: 16px 0 40px rgba(15, 23, 42, 0.24);
  }

  .books-workspace.sidebar-open .books-sidebar {
    transform: translateX(0);
  }

  .books-sidebar-head button,
  .books-mobile-directory {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .books-sidebar-backdrop {
    position: absolute;
    z-index: 44;
    inset: 0;
    background: rgba(15, 23, 42, 0.34);
  }

  .books-workspace.sidebar-open .books-sidebar-backdrop {
    display: block;
  }

  .books-reader {
    height: 100%;
  }

  .books-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .books-title-group {
    width: 100%;
  }

  .books-controls {
    width: 100%;
    justify-content: flex-start;
    overflow: visible;
  }

  .books-primary-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .books-primary-controls .books-page-control {
    flex: 1 1 auto;
    justify-content: center;
  }

  .books-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .books-secondary-controls {
    position: absolute;
    z-index: 50;
    top: calc(100% + 5px);
    right: 8px;
    width: min(360px, calc(100vw - 16px));
    display: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.28);
  }

  .books-secondary-controls.open {
    display: flex;
  }

  .books-reading-mode {
    flex: 1 1 104px;
  }

  .books-find-control {
    flex: 1 1 190px;
  }

  .books-eye-control {
    flex: 1 1 120px;
  }

  .books-navigation {
    top: 86px;
    bottom: 28px;
    width: min(82vw, 320px);
  }

  .books-viewer {
    padding: 10px;
  }

  .books-viewer.continuous-mode {
    padding: 0;
  }

  .books-continuous {
    gap: 10px;
    padding: 10px 8px 18px;
  }

  .books-page-edge {
    width: 28px;
    height: 46px;
    opacity: 0.48;
  }

  .books-page-edge-prev {
    left: 5px;
  }

  .books-page-edge-next {
    right: 5px;
  }
}

@media (max-width: 560px) {
  .books-toolbar button {
    min-height: 28px;
  }

  .books-secondary-controls .books-control-divider,
  .books-secondary-controls .books-zoom-label {
    display: none;
  }

  .books-statusbar {
    min-height: 28px;
  }

  .books-bookmarks {
    max-width: 56%;
  }
}
