.pdf-reader-container {
  display: flex;
  flex-direction: column;
  height: 80vh;
  min-height: 700px;
  background: #f0f2f5;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  font-family: inherit;
  position: relative;
  margin-bottom: 40px;
}
.loading-bar {
  height: 4px;
  background: #1b2fe7;
  width: 0%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: width 0.3s, opacity 0.3s;
}
.toast-msg {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 2000;
}
.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.reader-toolbar {
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.toolbar-left, .toolbar-center, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toolbar-center {
  flex-grow: 1;
  justify-content: center;
}
.file-name-display {
  font-weight: 600;
  color: #333;
  font-size: 16px;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-toolbar button {
  background: transparent;
  border: none;
  color: #555;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}
.reader-toolbar button:hover {
  background: #f0f2f5;
  color: #1b2fe7;
}
.reader-toolbar button.active {
  background: #e4e7ff;
  color: #1b2fe7;
}
.page-controls, .zoom-controls {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 2px;
}
#pageInput {
  width: 50px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px;
  font-size: 14px;
}
.page-total, #zoomVal {
  font-size: 14px;
  color: #666;
  padding: 0 8px;
}
.reader-workspace {
  display: flex;
  flex-grow: 1;
  height: calc(100% - 56px);
  position: relative;
  overflow: hidden;
}
.reader-sidebar {
  width: 250px;
  background: #fafafa;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  transition: width 0.3s;
  flex-shrink: 0;
}
.reader-sidebar.collapsed {
  width: 0;
  border-right: none;
  overflow: hidden;
}
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
}
.sidebar-tabs button {
  flex: 1;
  padding: 12px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: #666;
}
.sidebar-tabs button.active {
  border-bottom-color: #1b2fe7;
  color: #1b2fe7;
  background: #fff;
}
.sidebar-content {
  flex-grow: 1;
  overflow-y: auto;
  position: relative;
}
.sidebar-panel {
  display: none;
  padding: 16px;
  height: 100%;
}
.sidebar-panel.active {
  display: block;
}
/* Thumbnails */
#thumbPanel {
  padding: 16px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-content: start;
}
.thumb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
  border: 2px solid transparent;
}
.thumb-item:hover {
  background: #eee;
}
.thumb-item.active {
  background: #e4e7ff;
  border-color: #1b2fe7;
}
.thumb-item canvas {
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  margin-bottom: 8px;
  background: white;
}
.thumb-label {
  font-size: 12px;
  color: #555;
  font-weight: 500;
}
/* Outline */
.outline-item {
  padding: 6px 0;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}
.outline-item:hover {
  color: #1b2fe7;
}
.outline-item.level2 { margin-left: 12px; }
.outline-item.level3 { margin-left: 24px; }
/* Search */
#searchInput {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 12px;
}
.search-hit {
  padding: 8px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.search-hit:hover {
  border-color: #1b2fe7;
}
.search-hit-page {
  font-size: 11px;
  color: #1b2fe7;
  font-weight: 600;
  margin-bottom: 4px;
}
.search-hit mark {
  background: #ffeb3b;
  padding: 0 2px;
  border-radius: 2px;
}
/* Viewer */
.viewer-container {
  flex-grow: 1;
  background: #e0e0e0;
  overflow: auto;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 0;
}
.pdf-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.page-wrapper {
  position: relative;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.text-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  color: transparent;
  line-height: 1;
  opacity: 0.2;
}
.text-layer::selection { background: rgb(0,0,255,1); color: transparent; }
.text-layer *::selection { background: rgb(0,0,255,1); color: transparent; }
.text-layer.selectable span {
  color: transparent;
  cursor: text;
  position: absolute;
  transform-origin: 0% 0%;
}
.page-num-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0.7;
}
/* Info Panel */
.info-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  background: #fff;
  border-left: 1px solid #ddd;
  box-shadow: -4px 0 15px rgba(0,0,0,0.05);
  transform: translateX(100%);
  transition: transform 0.3s;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.info-panel.open {
  transform: translateX(0);
}
.info-header {
  padding: 16px;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.info-header button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #888;
}
.info-content {
  padding: 16px;
  flex-grow: 1;
  overflow-y: auto;
}
.info-row {
  margin-bottom: 12px;
}
.info-key {
  font-size: 12px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.info-val {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  word-break: break-all;
}
