/* 证书全屏放大 / 旋转查看（专家页与案例页共用） */
.cert-viewer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: rgba(12, 14, 20, .94);
}
.cert-viewer[hidden] { display: none !important; }
.cert-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
}
.cert-viewer-actions {
  display: flex;
  gap: 8px;
}
.cert-viewer-btn {
  min-width: 40px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  font-size: 13px;
  font-weight: 600;
}
.cert-viewer-btn:active { background: rgba(255, 255, 255, .28); }
.cert-viewer-stage {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  min-height: 0;
}
.cert-viewer-canvas {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  height: max-content;
  min-width: 100%;
  min-height: 100%;
  padding: 8px 12px 16px;
}
.cert-viewer-rotator {
  position: relative;
  display: block;
  flex: 0 0 auto;
}
.cert-viewer-stage img {
  display: block;
  max-width: min(100%, calc(100vw - 24px));
  max-height: calc(100vh - 110px);
  width: auto;
  height: auto;
  border-radius: 4px;
  object-fit: contain;
  transform-origin: center center;
  transition: transform .2s ease;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.cert-viewer-stage img.is-zoomed {
  max-width: none;
  max-height: none;
  cursor: grab;
  /* 放大态由 JS 设定宽高与绝对定位，禁用 transition 避免拖动抖动 */
  transition: none;
}
.cert-viewer-stage img.is-zoomed:active {
  cursor: grabbing;
}
.cert-viewer-hint {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 14px max(14px, env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  text-align: center;
}
