* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #1a1a1a;
  color: #fff;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* 头部样式 - 修复遮挡问题 */
.header {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  height: 70px; /* 固定高度 */
}

.header.hidden {
  transform: translateY(-100%);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  height: 100%; /* 确保内容垂直居中 */
}

.header-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2; /* 更好的文本垂直居中 */
  padding: 5px 0; /* 增加垂直内边距 */
}

.header-actions {
  display: flex;
  gap: 12px;
  margin-left: 10px;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.action-btn:hover, .action-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

/* 查看器容器 - 修复遮挡问题 */
.viewer-container {
  position: relative;
  overflow: hidden;
  margin-top: 70px; /* 与头部高度匹配 */
  height: calc(100vh - 70px); /* 确保高度正确 */
  width: 100%;
}

#pdf-viewer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 10px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

#pdf-viewer.dragging {
  cursor: grabbing;
}

/* 页面导航 */
.page-navigation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prev-page-area, .next-page-area {
  position: relative;
  height: 100%;
  width: 80px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  z-index: 20;
}

.prev-page-area:hover, .next-page-area:hover,
.prev-page-area:active, .next-page-area:active {
  opacity: 1 !important;
}

.nav-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.2s, background 0.2s;
  pointer-events: auto;
}

.nav-btn:active {
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0.9);
}

/* 页面信息栏 */
.page-info-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 20;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-controls {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 20px;
}

.zoom-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 加载指示器 */
.loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 5;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

.loading-text {
  font-size: 16px;
  color: #fff;
}
/* 修复遮挡问题的CSS */
    .viewer-container {
      height: calc(100vh - 70px) !important; /* 确保查看区域不被遮挡 */
      margin-top: 70px !important; /* 增加顶部间距 */
    }
    
    /* 微信浏览器特殊处理 */
    .wechat-fallback {
      display: none;
      position: fixed;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(0, 0, 0, 0.8);
      color: white;
      padding: 15px;
      border-radius: 10px;
      z-index: 1000;
      text-align: center;
      max-width: 90%;
    }
    
    .wechat-fallback a {
      color: #4da6ff;
      font-weight: bold;
      text-decoration: none;
    }
/* 拖拽提示 */
.drag-hint {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  z-index: 20;
  backdrop-filter: blur(10px);
  opacity: 0.8;
  animation: fadeHint 5s forwards;
}

@keyframes fadeHint {
  0% { opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { opacity: 0; display: none; }
}

/* 动画 */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 高清渲染模式 */
.high-quality canvas {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* PC端原生PDF查看器样式 */
.pc-pdf-viewer {
  width: 100%;
  height: calc(100vh - 70px); /* 与头部高度匹配 */
  margin-top: 70px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header {
    padding: 10px;
    height: 60px; /* 移动端更小的高度 */
  }
  
  .header-title {
    font-size: 14px;
  }
  
  .viewer-container {
    margin-top: 60px; /* 与头部高度匹配 */
    height: calc(100vh - 60px); /* 确保高度正确 */
  }
  
  .page-info-bar {
    flex-direction: column;
    gap: 5px;
    padding: 6px 12px;
  }
  
  .drag-hint {
    bottom: 80px;
    font-size: 11px;
  }
  
  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}