/* ============================================================
 * pdf-viewer.css —— 文章内 PDF 预览样式（极简版：无工具栏）
 * 配套 source/js/pdf-viewer.js
 * ============================================================ */

.pdfview {
  margin: 1.2em 0;
  border-radius: 10px;
  overflow: hidden;
  background: #1a1d24;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  outline: none;
}

/* ---------- 画布区 ---------- */
.pdfv-stage {
  position: relative;
  height: 620px;
  overflow-y: auto;
  overflow-x: auto;
  background: #14161b;
  /* 移动端惯性滚动 */
  -webkit-overflow-scrolling: touch;
}

.pdfv-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 16px;
}

.pdfv-page {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  line-height: 0;
  min-height: 100px;
  min-width: 100px;
}

.pdfv-page canvas {
  display: block;
  max-width: 100%;
}

/* ---------- 加载态 ---------- */
.pdfv-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #9aa3b2;
  font-size: 13px;
  background: #14161b;
}

.pdfv-loading p {
  margin: 0;
}

.pdfv-spin {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--theme-color, #49b1f5);
  border-radius: 50%;
  animation: pdfv-rotate 0.8s linear infinite;
}

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

.pdfv-err a {
  color: var(--theme-color, #49b1f5);
}

/* ---------- 兜底链接（JS 未接管 / 加载失败时显示） ---------- */
.pdfv-fallback {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  min-height: 84px;
  color: #e6e8eb;
  text-decoration: none;
  background: #23272f;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-sizing: border-box;
}

.pdfv-fallback:hover {
  border-color: var(--theme-color, #49b1f5);
  background: #2a2f38;
}

.pdfv-fb-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.pdfv-fb-text {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdfv-fb-tip {
  margin-left: auto;
  font-size: 12px;
  color: #8b93a1;
  flex-shrink: 0;
}

/* ---------- 手机适配 ---------- */
@media screen and (max-width: 768px) {
  .pdfv-stage {
    height: 480px;
  }
  /* 手机放不下提示语，只留图标 + 文件名 */
  .pdfv-fb-tip {
    display: none;
  }
}

/* 暗色模式下已经是深色底，保持一致 */
[data-theme="dark"] .pdfview {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}
