/**
 * PDF 查看器样式
 * @version 1.0.0
 * @date 2026-02-03
 */

.pdf-viewer-container {
  margin: 24px 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Header */
.pdf-header {
  background: linear-gradient(to right, #f9fafb, #f3f4f6);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

.pdf-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdf-icon {
  font-size: 32px;
}

.pdf-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdf-name {
  font-weight: 600;
  color: #1f2937;
  font-size: 14px;
}

.pdf-size {
  font-size: 12px;
  color: #6b7280;
}

.pdf-controls {
  display: flex;
  gap: 8px;
}

.pdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  color: #4b5563;
  text-decoration: none;
}

.pdf-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.pdf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pdf-btn .material-icons {
  font-size: 20px;
}

/* Content */
.pdf-content {
  position: relative;
  min-height: 400px;
  background: #f9fafb;
}

.pdf-loading,
.pdf-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #6b7280;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.pdf-canvas-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px;
  overflow-x: auto;
}

.pdf-canvas-wrapper canvas {
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Footer */
.pdf-footer {
  background: #f9fafb;
  padding: 12px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  border-top: 1px solid #e5e7eb;
}

.pdf-pagination {
  font-size: 14px;
  color: #4b5563;
  font-weight: 500;
}

/* Dark mode support */
.dark .pdf-viewer-container {
  background: #1f2937;
  border-color: #374151;
}

.dark .pdf-header,
.dark .pdf-footer {
  background: #111827;
  border-color: #374151;
}

.dark .pdf-name {
  color: #f3f4f6;
}

.dark .pdf-size,
.dark .pdf-pagination {
  color: #9ca3af;
}

.dark .pdf-btn {
  background: #374151;
  border-color: #4b5563;
  color: #d1d5db;
}

.dark .pdf-btn:hover:not(:disabled) {
  background: #4b5563;
  border-color: #6b7280;
}

.dark .pdf-content {
  background: #111827;
}

.dark .pdf-loading,
.dark .pdf-error {
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 640px) {
  .pdf-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .pdf-controls {
    width: 100%;
    justify-content: flex-end;
  }

  .pdf-canvas-wrapper {
    padding: 10px;
  }

  .pdf-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
}
